Profile

Cover photo
wg wang
505 followers|4,250 views
AboutPostsPhotosVideos

Stream

wg wang

Shared publicly  - 
 
不能看游记,一看游记就想着远足!
 ·  Translate
1
wg wang's profile phototuzi hu's profile photo
5 comments
tuzi hu
 
西塘去过了,对江南古镇没啥特别的兴趣,从小就是这么长大的。我想去凤凰,男人说,苗寨啥的太危险,不让我一个人去。主要是以前看过苗蛊啥的,把他吓到了
Add a comment...

wg wang

Shared publicly  - 
 
用g+的人太少了,求关注求好友求各种兴趣小组,求技术群求搜索数据挖掘分布式计算……
 ·  Translate
1
2
tuzi hu's profile photoXiaoqiang Zhu's profile photo
Add a comment...

wg wang

Shared publicly  - 
 
熟练使用ssh,ssh-copy-id这个命令经常使用ssh的,会有帮助的,用法相当简单:
ssh-copy-id [-i [identity_file]] [user@]machine
更加详细的内容见 ssh-copy-id的manpage

SSH-COPY-ID(1) SSH-COPY-ID(1)

NAME
ssh-copy-id - install your public key in a remote machine's authorized_keys

SYNOPSIS
ssh-copy-id [-i [identity_file]] [user@]machine

DESCRIPTION
ssh-copy-id is a script that uses ssh to log into a remote machine and append the indicated identity file to that machine's
~/.ssh/authorized_keys file.

If the -i option is given then the identity file (defaults to ~/.ssh/id_rsa.pub) is used, regardless of whether there are any keys
in your ssh-agent. Otherwise, if this:

ssh-add -L

provides any output, it uses that in preference to the identity file.

If the -i option is used, or the ssh-add produced no output, then it uses the contents of the identity file. Once it has one or
more fingerprints (by whatever means) it uses ssh to append them to ~/.ssh/authorized_keys on the remote machine (creating the
file, and directory, if necessary.)

NOTES
This program does not modify the permissions of any pre-existing files or directories. Therefore, if the remote sshd has Strict‐
Modes set in its configuration, then the user's home, ~/.ssh folder, and ~/.ssh/authorized_keys file may need to have group
writability disabled manually, e.g. via

chmod go-w ~ ~/.ssh ~/.ssh/authorized_keys

on the remote machine.
1
Add a comment...

wg wang

Shared publicly  - 
1
guobing luo's profile photo
 
amazing,but where the "usleep" function come from?
Add a comment...

wg wang

Shared publicly  - 
 
pythoner写php代码,好累啊!
 ·  Translate
1
guobing luo's profile photo徐从斌's profile photo
2 comments
 
eclipse不错,
Add a comment...

wg wang

Shared publicly  - 
 
貌似可以把这个当blog用了,不知道有多少字数限制
 ·  Translate
1
guobing luo's profile phototuzi hu's profile photowg wang's profile photo
4 comments
wg wang
 
是的,这个很重要。可惜国人无法享受。
Add a comment...
In his circles
1,109 people
Have him in circles
505 people
teja hn's profile photo
Errol Lishman's profile photo
Simon Baldwin's profile photo
Nagashiva Kumar Rangoju's profile photo
Pablo Pera's profile photo
Andrew Kurinnyi's profile photo
Zaid Mahomedy's profile photo
Naveen Kumar's profile photo
Scott Arenz's profile photo

wg wang

Shared publicly  - 
 
一篇不太好玩的小文章《C No Evil》http://blog.regehr.org/archives/574

假想的场景是,你有一个不共戴天的敌人(比如情敌啊,杀父之仇啊,杀师之仇啊),而这个敌人有正好跟你在一个地方(即你有可能改动他的代码)。在某个时候,他要在很短的时间内(比如一两周)要完成一个伟大的项目(比如做成这个项目后,可以打败竞争对手,或者可以让市值上涨200%)。这时,你想通过改动他的代码中的某个头文件(c语言的),来实现最大限度的使项目延期。记住,任何能够很快的就被发现的代码改动都是达不到目标的(比如编译器能够检查到的,以及各种常用的工具如cpplint、valgrind等能够检查到的)。针对这个场景,你会怎么做呢?
下面是该文章提供的一些例子:
#define FALSE 1
#define FALSE exit()
#define while if
#define goto
#define struct union
#define assert(x)
#define volatile
#define continue break
#define double int
#define long short
#define unsigned signed

hacker news中,有几十个针对这篇文章的评论,其中有一些有点意思,总结如下:
#define sin(d) ((double)sinf(d))
#define double float
#define pthread_mutex_lock(x)
#define pthread_mutex_unlock(x)
#define free(x) free(x + 1)
#define malloc(x) malloc(random())
#define if(x) if(rand()<0.0001 && (x))
#define assert(x) ((void)(x))
#define int char
××××××××××这是一个×××××××××××
__attribute__((constructor)) void __maiin(void)
{
if (rand() < 0.05) exit();
//if (rand() < 0.05) close(1);
//if (rand() < 0.05) main(); // and so on ..
}
××××××××××××××××××××××××××××××××



也有从这个讨论中引申出去的,用以改善而非邪恶目的的:
#define free(x) do { free(x); x = NULL; } while (0)

还有一个对关键字:volatile 的讨论,有兴趣的也可以看看。

hacker news对这个的讨论的链接为:http://news.ycombinator.com/item?id=2866217
 ·  Translate
1
Add a comment...

wg wang

Shared publicly  - 
 
主动;以结果为导向;爱拼不会赢,拼到底才会赢!
 ·  Translate
1
1
tuzi hu's profile photo
Add a comment...

wg wang

Shared publicly  - 
 
Python and the Principle of Least Astonishment. written on Saturday, July 9, 2011. When you use something for a long time you will develop some kind of sensing of what goes together and what does not ...
1
Add a comment...

wg wang

Shared publicly  - 
 
Realtime Hadoop usage at Facebook: The Complete Story. I had earlier blogged about why Facebook is starting to use Apache Hadoop technologies to serve realtime workloads. We presented the paper at the...
1
Add a comment...

wg wang

Shared publicly  - 
 
昨天跟人聊了下,不支持递归的圈,貌似还是有所缺陷的呀。当圈的数量达到一定数量,管理起来会很累。不知道google是否准备支持圈的树形结构?或者已经支持了,但我不知道怎么用?
 ·  Translate
1
wg wang's profile photo
wg wang
 
树,就是递归的呀
关系表,就不是递归的
Add a comment...
People
In his circles
1,109 people
Have him in circles
505 people
teja hn's profile photo
Errol Lishman's profile photo
Simon Baldwin's profile photo
Nagashiva Kumar Rangoju's profile photo
Pablo Pera's profile photo
Andrew Kurinnyi's profile photo
Zaid Mahomedy's profile photo
Naveen Kumar's profile photo
Scott Arenz's profile photo
Basic Information
Gender
Male
Story
Tagline
上善若水