- What is the output of the following code:
$a = '1';
$b = &$a;
$b = "2$b";
echo $a.", ".$b;
- What is the difference between
$_GET
and$_POST
? - What does the
isset()
function mean?
$a = '1';
$b = &$a;
$b = "2$b";
echo $a.", ".$b;
$_GET
and $_POST
?isset()
function mean?$a = '1';
$b = &$a;
$b = "2$b";
echo $a.", ".$b;
$_GET
and $_POST
?isset()
function mean?$a = '1';
$b = &$a;
$b = "2$b";
echo $a.", ".$b;
$_GET
and $_POST
?isset()
function mean?# VERY IMPORTANT! After each kernel update or dkms rebuild the modules must be signed again with the script | |
# ~/.ssl/sign-all-modules.sh | |
# Place all files in ~/.ssl folder | |
mkdir ~/.ssl | |
cd ~/.ssl | |
# Generate custom keys with openssl | |
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -subj "/CN=Owner/" |
public class FileDownload { | |
private volatile bool _completed; | |
public void DownloadFile(string address, string location) { | |
using(WebClient client = new WebClient()) { | |
Uri Uri = new Uri(address); | |
_completed = false; | |
client.DownloadFileCompleted += new System.ComponentModel.AsyncCompletedEventHandler(Completed); |
SELECT | |
c.CONSTRAINT_NAME, | |
cu.TABLE_NAME AS ReferencingTable, cu.COLUMN_NAME AS ReferencingColumn, | |
ku.TABLE_NAME AS ReferencedTable, ku.COLUMN_NAME AS ReferencedColumn | |
FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS c | |
INNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE cu | |
ON cu.CONSTRAINT_NAME = c.CONSTRAINT_NAME | |
INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE ku | |
ON ku.CONSTRAINT_NAME = c.UNIQUE_CONSTRAINT_NAME | |
WHERE ku.TABLE_NAME = 'FOO' |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class PercentRounder | |
{ | |
public class PercentInfo | |
{ | |
public int Index; | |
public int Percent; |
function in_array_r($needle, $haystack, $strict = false) { | |
foreach ($haystack as $item) { | |
if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && in_array_r($needle, $item, $strict))) { | |
return true; | |
} | |
} | |
return false; | |
} | |
// sample |
```php | |
$array=[ | |
['day'=>'11','movements'=>'1'], | |
['day'=>'11','movements'=>'1'], | |
['day'=>'11','movements'=>'1'], | |
['day'=>'12','movements'=>'1'], | |
['day'=>'12','movements'=>'1'], | |
['day'=>'12','movements'=>'1'] | |
]; | |
foreach($array as $row){ // iterate all rows |
simple ordering lat long MySQL
SELECT
*,
6371 * ASIN(
SQRT(
POWER( SIN( ( '-8.637420' - sample.lat ) * pi( ) / 180 / 2 ), 2 ) + COS( '-8.637420' * pi( ) / 180 ) * COS( sample.lat * pi( ) / 180 ) * POWER( SIN( ( '115.253001' - sample.lng ) * pi( ) / 180 / 2 ), 2 )
)
) AS distance
FROM