晒出你最蠢的一段代码,送 Cherry 鼠标垫

2015-08-04 15:47:00 +08:00
 xiaobetty

可能是 上周五的活动不够有趣,还有约300份鼠标垫没有送出去。。。

现在,只要你是北京的程序员,
在评论处写下你最蠢的一段代码
戳这里填写收件信息
就可以领取100offer定制Cherry鼠标垫一枚!
送完即止


Cherry鼠标垫是100offer用户最爱的办公品之一,这次我们也漂洋过海与德国的Cherry官方达成合作,赠与大家。

优秀的程序员是企业争抢的对象,很多用户通过100offer来「挑」工作:
http://100offer.com/about

2015年,100offer会努力给信任我们的广大程序员们提供更多的福利与更好更优质的职业机会,离你们的需求更近一步。

27333 次点击
所在节点    推广
426 条回复
wzp09tjlg
2015-08-05 09:42:28 +08:00
<intent-filter>
<action android:name="android.intent.action.ACTION_MEDIA_MOUNTED" />
<data android:scheme="file" >
</data>
</intent-filter>
加了个筛选,硬是干掉了我两个小时去找广播的各种问题,最后发现是自己手残。
caixiexin
2015-08-05 09:47:33 +08:00
@realpg 哈哈,其实那段不是我写的,不过确实是学校里刚学编程的同学会干出来的23333
anthozoan77
2015-08-05 09:50:37 +08:00
alert("xxx") 输出中间信息...
不知道console.log()...
zikkeung
2015-08-05 09:55:18 +08:00
* { zoom:1;}
ChenYounG
2015-08-05 09:55:36 +08:00
a="2"
b="3333"
print a+b
23333
Unknwon
2015-08-05 09:57:54 +08:00
if a == true {
return true
} else {
return false
}
rogeecn
2015-08-05 09:59:43 +08:00
呵呵,你们都写的高大上。看我的:

begin:
....
bool a = callFunc();
if (a == true) return true;
if (a == false) return false;
end.
rogeecn
2015-08-05 10:00:17 +08:00
@Unknwon 跟我写的一样了……
mhycy
2015-08-05 10:03:02 +08:00
find /harddisk/disk_b/www/host/ -type f -name "*.php" | xargs perl -pi -e 's|<(a.*?href='http://10\.76\.6\.18'.*?)>(.*?)</a>|<!--\1-->\2<!--/a-->|g'

* IP做了打码处理
* 这段代码目的用于替换文件夹内部的HTML代码,把某个超链接注释掉
* 这段代码运行后一般存在超链接的文件都给清空或截断了
* 这段代码犯的错误极其愚蠢,相信犯同一个错误的人不止我一个
sunchuo
2015-08-05 10:09:56 +08:00
$db = DB::Query('a sql');


if(is_int($id))
{
$db->where('id', '=', $id);
}

代码类似于上面这样。

一个工具类,是查找某个用户配置的SQL语句。如果传入ID,就查询某个用户的。如果不传入就返回第一条。判断id类型的时候用了is_int,但是这个id有的时候是从redis读出来的。

redis读出来都是string啊!!!所以,如果是从redis读出的id,那数据就查询错了。


这个bug找了两周。
jadetang
2015-08-05 10:10:25 +08:00
为什么只有北京的程序员才给
MadbookPro
2015-08-05 10:10:32 +08:00
# javascript
function sleep(seconds){
var e = new Date().getTime() + (seconds * 1000);
while (new Date().getTime() <= e) {
;
}
}
mantgh
2015-08-05 10:12:35 +08:00
@yhxx 好蛋疼
leassy
2015-08-05 10:13:34 +08:00
string strA="10";
string strB="20";
string strC=strA+strB;
🐶
hadoopie
2015-08-05 10:13:39 +08:00
switch(firstChar) {
case ‘N’:
nextFirstChar = ‘O’;
break;
case ‘O’:
nextFirstChar = ‘P’;
break;
case ‘P’:
nextFirstChar = ‘Q’;
break;
case ‘Q’:
nextFirstChar = ‘R’;
break;
case ‘R’:
nextFirstChar = ‘S’;
break;
case ‘S’:
nextFirstChar = ‘T’;
break;
case ‘T’:
throw new IllegalArgument();
default:
}
linsiqing2008
2015-08-05 10:15:11 +08:00
- rm -rf /usr /lib/nvidia-current/xorg/xorg
comesx4
2015-08-05 10:17:10 +08:00
try
{
...
}
catch()
{
throw;
}
moe3000
2015-08-05 10:22:04 +08:00
try {
throw new Exception();
} catch (Exception e) {
e.printStackTrace();
}
strongcoder
2015-08-05 10:26:42 +08:00


tdifg
2015-08-05 10:27:43 +08:00
try:
temp = template_html.decode(chardet.detect(domain_title)['encoding'])
except:
temp = template_html.encode('utf-8')

呵呵…………

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/210710

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX