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
var http = require('http'), | |
cheerio = require('cheerio'); | |
startUrl = 'http://www.renren.com'; | |
var urls = [startUrl]; | |
var tags = ["div","h1","h2","h3","h4","h5","img","a"] | |
// Utility function that downloads a URL and invokes callback |
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
function download(url, callback){ | |
http.get(url, function(res){ | |
var data=""; | |
res.on('data', function(chunk){ | |
data += chunk; | |
}); | |
res.on('end', function(){ | |
callback(data); |
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
Mona Lisa is a unique painting that i enjoy most. | |
Mona Lisa is facing us directly. As we watch her bloom into a smile, we cannot help but feel that it is our presence that is causing her to smile, and we cannot help feeling a positive connection with the woman. | |
But we are suddenly aware of another, negative side of our connection to her. Is it possible that, rather than breaking out into a smile, her face is undergoing the opposite motion, losing the traces of a full smile that she had a moment earlier? | |
The picture offers no answer. An ordinary painting cannot evoke in us such a complexity and dynamicity of emotions. No wonder this painting is considered so great ... |
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
Harry Potter is the last book you should miss. For those who refuse to give Harry Potter a chance, here is my ammunition to turn them on to the Wizarding World. | |
First, let me remind you, J.K, Rowling is a BILLIONAIRE, richer than the queen of UK, just because she wrote seven children's novels. It shows how popular and great the book is, Plain and simple, the books tell a great story. It's epic, especially for a children's series, but it's not terribly long. | |
Second, it is so educational. Children's books are supposed to be tools for teaching and yet too many of them beat the kids over their heads with their message. Most kids widh they had magic to take care of their problems. Harry Potter teaches kids that life is rough(and won't be all sugar plums and fairy tales, even if you do have magic spells to clean your root)Let's be honest, how many children's books and movies will start off with the main characters parents being murdered in the first chapter of the first book?Life is like that, and that's the reas |
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
First, I am so fascinated by puzzle-solving just as Holmes does. As a detective, Holmes is the Master puzzle-solver, and he makes it a science and then reveals so well how he does it. | |
Second, Holmes shows us life as we wish it could be. Would that all our own problems could be solved by this great intellect, or that today's crimes could be approached with such scientific diligence and care. His work helps us to maintain a sense of fairness always. In a world in which evil often trumphs over good and evildoers get away with more than murder, this ideal is a cherished one indeed. |
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
PING_COUNT = 3 | |
LATENCY_STATUS = /^round-trip min\/avg\/max\/stddev = [\d.]+\/([\d.]+)\/[\d.]+\/[\d.]+ ms/ | |
def ping(host) | |
p "pinging... #{host}" | |
cmd = "ping -c #{PING_COUNT} #{host}" | |
`#{cmd}` | |
end |
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
tttt tttt iiii | |
ttt:::t ttt:::t i::::i | |
t:::::t t:::::t iiii | |
t:::::t t:::::t | |
ttttttt:::::ttttttt eeeeeeeeeeee ssssssssss ttttttt:::::ttttttt iiiiiiinnnn nnnnnnnn ggggggggg ggggg | |
t:::::::::::::::::t ee::::::::::::ee ss::::::::::s t:::::::::::::::::t i:::::in:::nn::::::::nn g:::::::::ggg::::g | |
t:::::::::::::::::t e::::::eeeee:::::eess:::::::::::::s t:::::::::::::::::t i::::in::::::::::::::nn g:::::::::::::::::g | |
tttttt:::::::tttttt e::::::e e:::::es::::::ssss:::::stttttt:::::::tttttt i::::inn:::::::::::::::ng::::::ggggg::::::gg |
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 <stdio.h> | |
#include <sys/time.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#define TIMEOUT 5 /* select timeout in seconds */ | |
#define BUF_LEN 1024 /* read buffer in bytes */ | |
int main (void) { | |
struct timeval tv; |
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 <stdio.h> | |
#include <unistd.h> | |
#include <poll.h> | |
#define TIMEOUT 5 /* poll timeout, in seconds */ | |
int main (void) { | |
struct pollfd fds[2]; | |
int ret; | |
/* watch stdin for input */ | |
fds[0].fd = STDIN_FILENO; | |
fds[0].events = POLLIN; |
OlderNewer