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
# Required libraries: | |
# | |
# * vobject <http://vobject.skyhouseconsulting.com/> | |
# | |
# Copyright (C) 2011 Marek Stepniowski <marek@stepniowski.com> | |
# | |
# This program is free software. It comes without any warranty, to | |
# the extent permitted by applicable law. You can redistribute it | |
# and/or modify it under the terms of the Do What The Fuck You Want | |
# To Public License, Version 2, as published by Sam Hocevar. See |
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
#################################### | |
# BASIC REQUIREMENTS | |
# http://graphite.wikidot.com/installation | |
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/ | |
# Last tested & updated 10/13/2011 | |
#################################### | |
sudo apt-get update | |
sudo apt-get upgrade |
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 mechanize | |
from BeautifulSoup import BeautifulSoup | |
import time | |
user_agent = ("sadsds") | |
br = mechanize.Browser() | |
br.addheaders = [('User-agent', user_agent)] | |
start = time.clock() | |
response = br.open("http://backdoor-problems.cognizance.org.in/misc75/misc75.php") | |
html = response.read() |
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 socket,time,zlib,sys | |
from struct import pack | |
sk = socket.socket(socket.AF_INET,socket.SOCK_STREAM) | |
sk.connect(("106.187.35.165",8080)) | |
buff = sk.recv(1024) | |
print 'Received', repr(buff) | |
buff = sk.recv(1024) |
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 re | |
import socket,time,zlib,sys | |
from struct import pack | |
sk = socket.socket(socket.AF_INET,socket.SOCK_STREAM) | |
sk.connect(("106.187.35.165",8080)) | |
buff = sk.recv(1024) | |
print 'Received', repr(buff) |
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 | |
// h4x0r's ultimate encryption algorithm | |
// I put the string to be encrypted here | |
$str = 'aaaaaaaaaaaaaaaaaa'; | |
// I convert the string to ASCII | |
// I generate a random key in between 10 and the maximum value of the ASCII's | |
// So the key is different everytime B) |
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> | |
#include <vector> | |
#include "viennacl/vector.hpp" | |
#include "benchmark-utils.hpp" | |
#define BENCHMARK_VECTOR_SIZE 1000 | |
#define BENCHMARK_RUNS 10 | |
int main() { |
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
public List<Tweet> fetchFeedsOfUser(Long user_id,int tweet_id) { | |
return jdbcTemplate.query("Select * from tweet where tweet_id < ? and (user_id in (select user_id2 from following where user_id1 = ?) or user_id = ? ) order by timestamp desc limit 15", | |
new Object[]{tweet_id,user_id,user_id}, new BeanPropertyRowMapper<>(Tweet.class)); | |
} |
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
explain Select * from tweet where tweet_id < 9999999999999 and (user_id in (select user_id2 from following where user_id1 = 1) or user_id = 1 ) order by tweet_id desc limit 15; |
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
public List<Tweet> fetchOlderFeeds(Long user_id, Long tweet_id) { | |
List<Tweet> tweetList = jdbcTemplate.query("select t.* from tweet t INNER JOIN following f ON (f.user_id2 = t.user_id) " + | |
"WHERE t.tweet_id < ? AND f.user_id1 = ? " + | |
"UNION ALL SELECT * FROM tweet t WHERE t.user_id=? AND t.tweet_id < ? " + | |
"ORDER BY tweet_id desc limit 15", | |
new Object[]{tweet_id, user_id, user_id, tweet_id}, new BeanPropertyRowMapper<>(Tweet.class)); | |
return tweetList; |
OlderNewer