Posts by Slowaways • 1,818 points
34 posts
-
6
votes5
answers87966
viewsA: How to print content inside a HTML div?
The solutions presented above are not as flexible. They present at least one of the listed problems: No support for printing large content that gives more than one sheet Remove all CSS already…
-
0
votes1
answer276
viewsA: Angularjs 1.6 with asynchronous content loading jQuery Steps plugin
Solved (Punkler updated): I used ng-include with autoload: http://plnkr.co/edit/6p1dVln2R9Pgb9ivoMcX?p=preview The code: <!-- Jquery Steps HTML Template --> <div id="wizard"…
-
1
votes1
answer276
viewsQ: Angularjs 1.6 with asynchronous content loading jQuery Steps plugin
I have a problem that after loading a HTML content dynamically asynchronously with the plugin jQuery Steps: <section data-mode="async" data-url="test.html"></section> the AngularJS does…
-
3
votes2
answers320
viewsQ: What is the difference between a plugin and a Javascript library?
I have recently studied a lot front-end in the vast world that is web programming and by installing some new functionality on the sites I developed I realized that some authors called their project…
-
15
votes1
answer2776
viewsQ: What is the difference between testing and debugging?
In the book "Introduction to Software Testing" of Ammann & Offutt mentions in p.32 the 5 levels maturity models of software testing: Level 0 - No difference between testing and debugging. Level…
-
0
votes2
answers201
viewsQ: Interface with the same class name
namespace path; interface test{ public function method(); } class test{ } class foo implements test{ } When writing the above code a fatal error is returned: Cannot declare class path\test, because…
-
14
votes2
answers5656
viewsQ: When and where to use a delegate in C#?
I’m new to C# and I still don’t fully understand the concept of using a delegate: public delegate void HTTPRequestsHandler(string url); I would like to know when to use them and in which cases a…
-
1
votes1
answer160
viewsQ: Infinite loop with data stream in PHP
I have the following code below: <?php $Start = microtime(true); $Code = <<<'Code' <?php for($i = 0; $i < 300; $i++){ echo '.'; } Code; include 'data://text/plain,'.$Code; echo…
-
4
votes1
answer739
viewsQ: How to connect JDBC (H2 Database) in PHP?
How to connect a JDBC database (specifically H2 Database) in PHP? The database is in a single file with extension .db
-
1
votes0
answers464
viewsQ: Error opening H2 Database
I have been trying to open a H2 Database file that is not corrupted and H2 Database has returned me the following error: Encryption error in file "C:/Users/Administrator/test.h2.db" [90049-189]…
-
0
votes2
answers1247
viewsA: Rewrite - How to redirect everything without index.php
Changing the pattern of . for ^ solves the problem. The . means that there must be at least one character in the request, already the ^ no. When the root directory / is loaded, which is a blank…
-
0
votes2
answers1247
viewsQ: Rewrite - How to redirect everything without index.php
I would like to redirect all requests from my Apache server to the test.php file and remove the index.php file from the root folder (public_html or Documentroot). I have the following code:…
-
3
votes2
answers730
viewsQ: What better option to protect directories and files in a root folder?
On a web server, I have a folder inside the root folder (public_html) that must be protected. It contains system files, settings, logs, classes and etc... In general, what is the best option to…
-
5
votes1
answer10312
viewsA: How to copy to clipboard in Javascript?
1st Option - Function with argument This function is a function that receives a value and automatically copies it to the clipboard. If your browser does not support error handling calls a secondary…
-
4
votes1
answer10312
viewsQ: How to copy to clipboard in Javascript?
Which code to copy to clipboard works best in all browsers?
-
9
votes2
answers6946
viewsQ: What is the difference between Template and Layout?
I would like to know the difference semantic, visual and web development front-end and back-end. @Edit Related: Is there any kind of dependency? To have the layout you need to have the template?…
-
35
votes3
answers22400
viewsA: What is the difference between bindParam and bindValue?
Differences in the receipt of values: In accordance with rray quoted: In bindParam() the expected argument is a reference (variable or constant) and cannot be a primitive type like a string or loose…
-
25
votes3
answers22400
viewsQ: What is the difference between bindParam and bindValue?
What’s the difference between Pdostatement::bindParam() and Pdostatement::bindValue()?…
-
4
votes3
answers210
viewsQ: What’s the difference between var $var and public $var?
I have a class: class anyClass{ public $var1; var $var2; } The difference between $var1 and $var2?
-
0
votes2
answers767
viewsQ: How to create a subdirectory tree with an Array
I have a way: C:\Users\Default\AppData\Local I want a function that takes a path equal to the top path and Return an Array: Output: array(5) { [0]=> string(30) "C:\Users\Default\AppData\Local"…
-
3
votes3
answers90
viewsA: Constant containing Array (matrix)
Before PHP 5.6: It is possible to do a gambiarra using the functions serialize() and unserialize(): define('COLORS', serialize(['red', 'blue', 'green'])); unserialize(COLORS); From PHP 5.6: Like…
-
2
votes3
answers90
viewsQ: Constant containing Array (matrix)
When I try to define a constant as an Array gives error. define('COLORS', ['red', 'blue', 'green']); Is there any way to define an Array in the value of a constant?…
-
5
votes1
answer2432
viewsA: Return Purchase Status on Automatic Return of Pagseguro Notification
That’s enough after $transaction = simplexml_load_string($transaction);: $transactionStatus = $transaction->status; if($transactionStatus == 1){ $transactionStatus = 'Aguardando pagamento'; }…
-
2
votes2
answers254
viewsA: How to detect if my site has been visited by a search engine?
The most complete and valid option I’ve found so far is this: function isBot(){ if( isSet($_SERVER['HTTP_USER_AGENT']) && preg_match('/bot|crawl|slurp|spider/i', $_SERVER['HTTP_USER_AGENT'])…
-
0
votes2
answers254
viewsQ: How to detect if my site has been visited by a search engine?
I am using php and saw something about the variable $_SERVER['HTTP_USER_AGENT'], but I do not know how to detect the visit of all search engines. I would like to detect any search bot and send to…
-
0
votes1
answer94
viewsQ: How to get all function calls from a php script?
Example: index php. <?php foo(); bar(); print_r(getCalledFunctions(__FILE__)); Print: array 0 => 'foo' 1 => 'bar' Question: Can someone return me the getCalledFunctions function?…
-
1
votes5
answers1501
viewsA: How to take the name of the variable used in the function argument?
With the PHP 5.6 update, the "Variadic functions via ..." I was able to create a clean, clear code: Script1.php $variavel = 'foo'; sendData($variavel); Script2.php public function…
-
3
votes1
answer162
viewsA: How to get the name of all user classes?
So far I’ve found no other way: You can do it for Reflection: $classes = get_declared_classes(); foreach($classes as $className){ $reflection = new \ReflectionClass($className); if(…
-
5
votes1
answer162
viewsQ: How to get the name of all user classes?
The function get_declared_classes magpie ALL the classes defined in PHP, both from the internal PHP library and from the user. I wanted a role for classes like: get_defined_functions, that separates…
-
1
votes1
answer1535
viewsQ: How to redirect a URL always with bar (/) at the end?
I have that code: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteRule . /index.php [L] </IfModule> When I type http://localhost/path I’d…
-
16
votes1
answer10823
viewsQ: What are the most files I can have in a folder?
I’m developing a web application to run on linux. In my project the visitor of my site can send images as many times as he wants. My image upload folder structure will be separated by year/month.…
-
2
votes2
answers1334
viewsA: How to automatically scroll to the top when viewing the page footer?
Here is your code: $(document).ready(function(){ var $documentHeight = $(document).height(); var $windowHeight = $(window).height(); var $scrollHeight = $documentHeight - $windowHeight; var…
-
3
votes3
answers6532
viewsA: How to detect click on Chrome Back/Next/Reload buttons
Basically, the answer is: That is not possible! Javascript does not have access to these browser features, so Javascript has no way to detect when the user pressed the Back, Forward and Restart…
-
4
votes5
answers1501
viewsQ: How to take the name of the variable used in the function argument?
Script1.php Here script1.php calls the function that is in script2: sendData($variavel); Script2.php The function takes the value and includes script 3 to receive argument values: sendData(){…