Stackoverflow[3]

2009年07月30日 blankyao 发布在 杂七杂八 标签:vim, stackoverflow, linux, shell 暂无评论

1. Is there a one-liner that allows me to create a directory and move into it at the same time?

mkdir + cd

2. How to report number of files in all subdirectories?

for f in *; do [ -d ./"$f" ] && find ./"$f" -maxdepth 1 -exec echo \; | wc -l && echo $f; done

看当前目录下有多少子目录,以及有子目录下有多少文件

3. Most efficient way to store thousand telephone numbers

这个面试题,好像挺常用的

4. What is your most productive shortcut with Vim?

让你更高效的vim操作是什么?另外,你使用vim有那么多问题是因为你根本就不了解vi!

5.  How can I create a empty file whose name begins with a dash?

一般来说,命令都是以“-”作为选项的开头的,那么怎样创建以“-”开头的文件?

6. Why is '.' a hard link in Unix?

为什么“.”是一个hard link呢?

7. How to temporarily switch from ssh to my local shell?

在终端里连接到一台服务器后可能需要暂时在本地操作一下,那么除了新开一个终端窗口外还有其他方法不?

 

 

Stackoverflow[2]

2009年07月30日 blankyao 发布在 杂七杂八 标签:javascript, stackoverflow, linux 暂无评论

1. Why does [5,6,8,7][1,2] = 8 in Javascript

又一个趣味性的javascript语法问题

 

2. Why aren't ◎ܫ◎ and ☺ valid Javascript variable names?

连“草泥马”、“ಠ_ಠ”都是合法的变量名,为啥◎ܫ◎就不是呢?

 

3. What do single quotes do in C++ when used on multiple characters?

在多个字符外面加上单引号代表着什么?

 

4. Why use swap when there is more than enough RAM

linux在啥时候才会用swap呢?

 

5. What is the funniest bug you've ever experienced?

你遇到过的最有趣的bug是啥?

 

7. How to count characters in a unicode string in C

Unicode长度的计算以及截取

 

Stackoverflow[1]

2009年07月30日 blankyao 发布在 杂七杂八 标签:jQuery, iPhone, Objective-c, Cocoa, linux 暂无评论

1. Disable a user's login without disabling the account

如何在不禁用帐户的情况下禁止这个帐号登录呢?而且还可以su - user哦亲。

 

2. Any funny *nix one-liners?

闷骚的程序员们都不喜欢啰嗦。

 

3. What are best practices that you use when writing Objective-C and Cocoa?

Objective-C && Cocoa最佳实践。

 

4. Why can I use constants as statements in C?

虽然没啥用,也值得了解一下,从前还真不知道可以这样写。

 

5. For loop instead of while

"I vote for someone having an affinity for bad coding style. "