This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.AlertDialog; | |
import android.app.Dialog; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.support.v7.preference.Preference; | |
import android.util.AttributeSet; | |
import android.view.Gravity; | |
import android.view.View; | |
import android.widget.LinearLayout; | |
import android.widget.NumberPicker; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generate a random number between 0 and 1, including 0 and excluding 1. | |
*/ | |
double frandom() | |
{ | |
static bool init = false; | |
if (!init) | |
{ | |
// This will be done just once | |
srand(time(NULL)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="pdo-dbquery-csv.php"> | |
<input type="hidden" name="dblib" value="mysql" /> | |
User: <input type="text" name="user" /><br /> | |
Password: <input type="password" name="password" /><br /> | |
<br /> | |
Host: <input type="text" name="host" /><br /> | |
Database: <input type="dbname" name="dbname" /><br /> | |
<br /> | |
<b>Query: </b><textarea name="q"></textarea><br /> | |
<b>Query params:</b><br /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main(int argC, char** argv) | |
{ | |
cout << "\033[102;93;4;1;3mBrasil\033[0m e \033[97;106mArgentina\033[0m" << endl; | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Request login | |
if (!isset($_SERVER['PHP_AUTH_USER'])) { | |
header('WWW-Authenticate: Basic realm="My restrict area"'); | |
header('HTTP/1.0 401 Unauthorized'); | |
// Echoes a message if user cancel the login | |
echo '<p style="font-weight:bold; color:red">You don\'t have permission to access this page without authentication!</p>'; | |
die; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true | |
do | |
( | |
echo 'HTTP/1.1 200 OK' | |
echo 'content-type: text/html; charset=utf-8' | |
echo | |
echo "Current Directory: <b>$(pwd)</b>" | |
echo '<br />' | |
echo '<p style="color: blue">Hello, <b>World</b>!!!</p>' | |
) | nc -l 8081 -q 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo Start | |
ls -l | while read line | |
do | |
# Execute these commands for each line read from command 'ls -l' | |
echo -en "\r\033[2KProgress: $line" | |
sleep 1 | |
done | |
echo |