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 | |
include_once "alfa.sms.class.php"; | |
$servername = "localhost"; | |
$username = "username"; | |
$password = "password"; | |
$dbname = "myDB"; | |
// Create connection | |
$conn = new mysqli($servername, $username, $password, $dbname); | |
// Check connection |
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 | |
$ts1 = strtotime(str_replace('/', '-', '24:00:00')); | |
$ts2 = strtotime(str_replace('/', '-', date('H:i:s'))); | |
$diff = (abs($ts1 - $ts2) * 1000); | |
setcookie('expire', 'test',+$diff); | |
?> |
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 wiringpi | |
import time | |
# 1M external pull-up resistor | |
# 1) set pin low and to output to discharge | |
# 2) make the pin an input without the internal pull-up on | |
# 3) read input and see how long it takes to go high | |
# ref: https://github.com/WiringPi/WiringPi-Python | |
# pins: https://projects.drogon.net/raspberry-pi/wiringpi/pins/ |
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
def doAction(str2): | |
words = str2.split() | |
if words[0] == 'set': | |
a = re.compile(' set an alarm for (\w+ \w*) (am|pm)') | |
m = a.match(str2) | |
if m: | |
print(m.group(1), m.group(2)) | |
setAlarm(m.group(1), m.group(2)) | |
else: | |
print(str2) |
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
<html> | |
<head> | |
prove that you are not a bot.type the word you see in the screen | |
</head> | |
<body> | |
<?php | |
session_start(); | |
if(!isset($_SESSION["random"]) || !isset($_POST['user']) ) | |
{ | |
$random = str_shuffle("dgds235"); |
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 | |
function getCoordinates($location) | |
{ | |
$address = str_replace(" ", "+", $location); | |
$url = "http://maps.google.com/maps/api/geocode/json?sensor=false&address=$location"; | |
$response = file_get_contents($url); | |
$json = json_decode($response,TRUE); | |
return ($json['results'][0]['geometry']['location']['lat'].",".$json['results'][0]['geometry']['location']['lng']); | |
} | |
echo getCoordinates('gandhinagar,jaipur'); |
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
$(document).ready(function() { | |
var NS = {}; | |
var put_text = function(bot_say) { | |
html_data = '<div class="alert alert-success fade in">\ | |
<a href="#" class="close" data-dismiss="alert">×</a>'; | |
$.each(bot_say["responseJSON"], function (index, data) { | |
html_data = html_data + index +" : "+data+"<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
documents = [ dict( | |
email=open("conference/%d.txt" % n).read().strip(), | |
category='conference') for n in range(1,372) ] | |
documents.extend([ dict( | |
email=open("job/%d.txt" % n).read().strip(), | |
category='job') for n in range(1,275)]) | |
documents.extend([ dict( | |
email=open("spam/%d.txt" % n).read().strip(), | |
category='spam') for n in range(1,799) ]) |
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
[ | |
{ | |
"cronPattern": "* * * * *", | |
"serviceProviderID": "LULUXKW#####", | |
"bankName": "The City Bank", | |
"transferMode": "WWW", | |
"ftpUrl": "null", | |
"maximumAttemptsNo": 4, | |
"passwordExpFreq": 30, | |
"testkey": false, |
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 os | |
import pickle | |
from sklearn.feature_extraction.text import TfidfVectorizer | |
from sklearn.naive_bayes import MultinomialNB | |
from sklearn.pipeline import Pipeline | |
def train(X, y,outpath=None, verbose=True): | |
def build(X, y=None): | |
""" |
OlderNewer