原先的1ming.org.ru废弃不用,
blog.1ming.org.ru和www.1ming.org.ru均指向一个google app搭的小博客,提示访问新域名1ming.org。
1ming.org.ru指向交大的首页
1ming.org.ru已从google中移出,估计几天后会重新弄收录1ming.org
PS:话说能看到这篇文章的看官也就知道1ming.org这个地址了。。。。算我没写
原先的1ming.org.ru废弃不用,
blog.1ming.org.ru和www.1ming.org.ru均指向一个google app搭的小博客,提示访问新域名1ming.org。
1ming.org.ru指向交大的首页
1ming.org.ru已从google中移出,估计几天后会重新弄收录1ming.org
PS:话说能看到这篇文章的看官也就知道1ming.org这个地址了。。。。算我没写
聪明人不可怕,可怕的是聪明人比常人还勤奋。
富二代不可怕,可怕的是富二代爱学习。
作为一个普通人,还有什么借口可以不勤奋?
(写不出paper就很难向老板要长假期。。。。)
写于2月16日凌晨,
俺寂寞了,俺蛋疼了,俺焦虑了。。。。
为啥你们都不上qq呢?天天看着你们的灰头像总觉得心里空荡荡的。留学生果然大部分时间都是寂寞的,俺有点顶不住了。
.–. ..- –.. –.. .-.. . / -….- / .– .- .-.. -.- / – …. .-. — ..- –. ….
Step 1:
这是一个QR码,使用PC/S60/Android/iOS下的条形码QR码识别软件读入后得到下列地址:
” There’s more you can see http://1ming.org/e122up”
Step2:
前往上述地址,页面内容区域是一片空白。按[Ctrl] + [A]可以看到“There’s more than meets your eye”
查看该页面的HTML源码,可以找到下述被注释掉的信息:
There’s more than meets the ear.
http://1ming.org/blog/wp-content/uploads/2011/01/call.wav
Decrypt “pass.txt” with the message you got from “call.wav”(AES-256)
But, why does “pass.txt” contain no unprintable characters?
Did I miss a step?
Did you miss a critical step before decrypting with AES?
PS: Of course you can decrypt the file with brute force.
PS2: You don’t have to use any hash in this puzzle.
PS3:
PS4: Sony has not made it yet.
http://1ming.org/blog/wp-content/uploads/2011/01/pass.txt
设计出处: “Google’s Nexus S on Twitter(12月5日),http://twitter.com/#!/googlenexus”
Step 3:
下载call.wav,播放可以听到电话拨号的声音。类似柯南剧场版12《战栗的乐谱》中提到的,这是个DTMF(双音多频)信号。使用http://www.dialabc.com/sound/detect/ 或类似工具分析得到数字串
236337
设计出处:iCTF 2010 Challenge 5
Step4:
下载pass.txt,这是一个文本文件,未包含任何不可打印字符,每行最多64个字符。可以分析出pass.txt保存的是base64编码后的数据。题目说明PS2提示无需使用Hash,236337就是加密口令。
使用base64 -d pass.txt >pass.dat得到加密后的数据
AES256有CBC,CFB和ECB三种模式,分别使用三种mode用openssl解密
openssl enc -d -aes-256-ecb -in pass.dat (或前一步不对base64解码而在openssl命令行加-a参数)
得到:
http://1ming.org/blog/wp-content/uploads/2011/01/error.jpg
Send the decrypted message to xxxx@gmail.com
设计出处:无
Step5:
下载error.jpg
Steganographic,
观察这个3D图片得到一个字符串“outguess”
(看立体画的方法参见http://www.liuhs.com/3d.htm)
使用outguess工具提取隐藏信息
outguess -r error.jpg final_result.txt
final_result.txt的内容为:
Twenty-twenty-twenty four hours to go I wanna be sedated
设计出处:iCTF 2008 Side Chanllenge – Forensics -200
关于“快速通道”:
那是一个1000层压缩的zip文件,每层的文件名是一个随机数。最后会得到一个地址:
http://1ming.org/blog/wp-content/uploads/2011/01/chart.png
是Step1中的QR码的原始图像文件。
对,快速通道的意思就是,“获得原始QR码文件的快速通道”,scaret君表示很悲催。
解压缩的bash script我弄丢了,大概意思就是ls获取当前目录下文件,sort按创建时间排序,awk提取创建时间最晚的文件的文件名,gunzip解压缩,rm删除旧文件,如此循环,最后剩下一个txt文件。
本文的标题是Morse Code,
在线编码解码http://www.qbit.it/lab/demorse.php
Thanks for 围观,
诚如kennelevil和robeen所言,lz真的是蛋疼
天涯何处不蛋疼,只是半夜特别疼
俺一直就不是一个善于起标题的家伙,要么过于SB要么过于ZB要么过于2B。推而广之,在与人交流是也是如此,要么过于SB要么过于ZB要么过于2B,其实S和Z和2没有什么本质的区别,从外形上就看得出来,不过那是另一个故事了。
按照本博客第一篇日志中地图的记录,俺的飘是从高中开始的。
按照俺爹在某年春节的说法,高中是我”发达“的开端。无论怎样,如果说一人飘在远方就算是”发达”的话,那么俺爹的话还是在理的。
2003~2006,是俺懵懵懂懂在沈阳南部的一片土地上混的日子。住校,两周一回家,三周一回家,四周一回家,食堂,八人一间寝室,卧谈,夜宵,炒面,早操,晚自习。虽然晚自习什么的并不陌生,但是还是不适应住校集体生活。其间各种虎各种ZB各种2B。
谈到ZB和2B,就不得不提高中ZB体的作文。这也是高中阶段留下来的痕迹的一大部分。在话题作文的指引下,俺开始看余秋雨学余秋雨的华丽辞藻和无病呻吟,写完之后就觉得自己就是丫一哲人,华山顶上俾睨群雄的那种,代表作为《巅峰人生》,有兴趣围观ZB少年的请移步http://www.neyc.cn/Item/684.aspx和http://www.neyc.cn/Item/694.aspx。算是耻辱吧。余秋雨什么的毕业后就从来不读了。回想起来最初开始读余秋雨的契机只是《山居笔记》中对杨梅的描写和《文化苦旅》中的兰州拉面和哈密瓜。
高中的生活总体上是忙碌 充实偶有惊喜的,只是我个人并没有在三年的校园生活中留下什么痕迹。前几天在育才理科部的贴吧围观,当年的学弟学妹依然记得某汀、某澍、某思聪、某萌、某娜、某金峰,相对于第一届理科部的”符号“抑或”传说“,俺只是个无名的小角色。其实到了大学也是这样,俺是个围观者,俺是个过客,俺是个随风迁徙的候鸟,社交什么的不在行。嗯,所以适合当IT民工吧。
飘来飘去,总有感时伤怀的时候,尤其是”自古逢秋悲寂寥“”无边落木萧萧下“的时节,尤其是在啥也不懂的高中一年级上学期的深秋,写出的东西很朴实地反映了俺当时想家的心情,有兴趣围观寂寞少年的请移步http://www.neyc.cn/Item/692.aspx。回忆下当时的心境:(1)想家(2)火车粉丝(3)暑假时电视剧看多了。三种东西混杂在一起便诞生了这样一篇标题很2内容很朴实的文章。而孙老师点评也十分给力:“生命的围城”,就是这样吧,身在大洋彼岸,依然是此情此景。
北京时间2011年1月1日 7:22
Phoenix时间2010年12月31日 4:25pm
今年年末最流行的一个词叫“给力”,对我来说2010年是不是给力还有待商榷,或许也没必要商榷,但对我来说2010的确是一个改变很大的年份,说是一辈子中的一个里程碑也不算为过。
上半年的记忆已经有些模糊,依稀记得自己在寄出了申请材料后每天的生活就是查邮件查导师兼套磁,顺带着在春天的时候搞搞我那个关于TPM的毕业设计。
那时的日子过得很滋润很日常,以至于到现在只剩下模糊的印象。无非是中午起床,三餐吃饭,下午泡泡C300,傍晚去二餐或一餐吃饭,晚上骑车出去逛逛或在寝室宅或在图书馆折腾电脑。然后就是水源站庆。然后在一个阴雨绵绵的周末参加了毕业旅行,虽然小雨不断但感觉非常好。然后就是拿下了驾照。然后就是搞定了美国签证。然后就是VOS。然后就是毕业典礼。然后在几天短暂的留校腐败后,卷铺盖滚蛋。
上半年的生活先是几个月平淡悠闲的日常,然后是一周内高密度的感情迸发。虽然现在有些后悔当时没有对整个大学本科四年做一个完整的回忆整理,写一个类似编年史的东西出来,或许是不忍吧,或许就是懒,最终也没有写。现在偶尔能回忆起当初的一些细节,但似乎剩下的只有一种叫做“怀念”的情绪。
7月初滚蛋,8月初出发。一个月在家里的时间,除了陪陪父母也没有多余的行动。期间参加了一次高中聚会,若干次进城见summerxyt同学。最后也没有见到freewater同学。现在回想起来,在毕业典礼上就是最后一面了。正如四年前育才的毕业典礼,见了最后一面就各奔东西。
然后8月8日,那是一个阴雨连绵的日子,父亲和几个亲戚送我去桃仙机场,母亲因为身体原因没有成行。期间无话,没有什么拥抱握别,当我走进海关边防检查口后就没有回头,没有眼泪流下来。就是这样。和平时的旅游没什么两样。和本科时每年沪沈往返也没什么两样。自打高中就在外面飘,已然习惯了这种日子。有时候这种冷静或者冷漠让我自己感到恐惧,仿佛在看别人的事情一样冷眼观察着自己和周围的环境,要么打破僵局拼一场,要么蜷缩在自己的壳里无视外面的世界。趁着年轻,再飘几年再说。
然后就是东京转机,洛杉矶转机,菲尼克斯到达。在这个夏天酷热冬天舒适的城市一隅安顿下来。住着美国政府的廉租房,拿着1500刀每月的工资,在枯燥的Research和花花绿绿的美帝生活中寻找自己的生活。
然后就是时光飞逝,课程+Research占据了生活的大半,夜里抱着自己的肩膀思念那边的人,白天在显示器和键盘前追寻自己的梦想,并陷入了立业和成家之间的新的矛盾。
嗯,就是这样,上半年收获梦想的果实,下半年陷入了新的矛盾。
回到沈阳,回到我那个小县城开始平淡的生活。
回到中国,在一线城市辛苦打拼,创业,跳出工薪族被高房价高通胀剥削的命运。
毕业后申请H1B,在加州或西雅图的IT企业就职。
回到沈阳,相亲找个女孩子结婚,靠着父母的关系网过着平淡舒适的生活。
回到国内,遵守当初对自己的承诺依然认准一个女孩非娶不可,在帝都奋斗若干年,安家立业。
在美国,恋爱结婚,生根发芽。
2011就这么开始了,距离三十而立还有七年。
这次先写思路。最后贴题目。算法描述以后在写
本次题目的大意是:
As a newbie on a particular internet discussion board, you notice a distinct trend among its veteran members; everyone seems to be either unfailingly honest or compulsively deceptive. You decide to try to identify the members of the two groups, starting with the assumption that every senior member either never lies or never tells the truth. You compile as much data as possible, asking each person for a list of which people are liars. Since the people you are asking have been around on the board for a long time, you may assume that they have perfect knowledge of who is trustworthy and who is not. Each person will respond with a list of people that they accuse of being liars. Everyone on the board can see that you are a tremendous n00b, so they will grudgingly give you only partial lists of who the liars are. Of course these lists are not to be taken at face value because of all the lying going on.
You must write a program to determine, given all the information you’ve collected from the discussion board members, which members have the same attitude toward telling the truth. It’s a pretty popular discussion board, so your program will need to be able to process a large amount of data quickly and efficiently.
Your program must take a single command line argument; the name of a file. It must then open the file and read out the input data. The data begins with the number of veteran members n followed by a newline. It continues with n chunks of information, each defining the accusations made by a single member. Each chunk is formatted as follows:
<accuser name> <m>
followed by m lines each containing the name of one member that the accuser says is a liar. accuser name and m are separated by some number of tabs and spaces. m will always be in [0, n]. All member names contain only alphabetic characters and are unique and case-sensitive.
Example input file:
5 Stephen 1 Tommaso Tommaso 1 Galileo Isaac 1 Tommaso Galileo 1 Tommaso George 2 Isaac Stephen
Your output must consist of two numbers separated by a single space and followed by a newline, printed to standard out. The first number is the size of the larger group between the liars and the non-liars. The second number is the size of the smaller group. You are guaranteed that exactly one correct solution exists for all test data.
Example output:
放在那里已经两个月了。
我是一个艺术和体育方面的白痴,和音乐扯上关系也只是在小学时。那时有一门课叫《音乐》,课本16开彩色印刷,是小学所有课本中最漂亮的,以至于每次发新书都会把它包上挂历纸的书皮,然后用紫色(那时我最喜欢的颜色)彩笔在上面歪歪扭扭的写下“音乐”两个字。然后在五年级时,音乐课本上出现了两种乐器:竖笛和口琴。
老师自然是教竖笛的(确切的说是卖竖笛)。米白色的笛子加上墨绿色的布套,斜躺在书包里露出个头,每天小小子和小姑娘就这样背着乐器往返于学校和家。但对于我来说笛子有一个致命的缺陷(所以哥是音乐白痴),笛子有六个孔,最下面的两个孔间距比其他孔都要大,导致俺的右手中指和无名指无法同时按住这两个孔,因此在吹奏so和la时右手的动作总是非常不自然(就是难受!)。经过一段时间的挣扎,还是放弃了笛子。
然后就转向了口琴,因为家中正好有一支上海牌28孔双音口琴。相对于笛子,这个貌似更简单,只要记住相对位置就好了。虽然一次只含住1个孔,但相对于笛子至少不用让手指受罪了。这就是和口琴的结缘。
然后是小学六年级,学计算机时先搞了GWBASIC,然后是Play命令,于是为了把音乐书上的歌用电脑放出来,学会了简谱。但也止步于此,再也没有碰过五线谱。现在看到do re mi fa so la si还是会下意识地想到 C D E F G A B。
然后就是初中,只在某一年的新年联欢会上吹过一首李叔同的《送别》。爸买了个敦煌双音口琴送我。
高中,从来没碰过。
本科,玩了Falcom的《空之轨迹》系列。为了重现《星之所在》再度拿起口琴,有一个音高始终吹不出来也就作罢了,唯一的回忆:午后暖暖的阳光,空无一人的交大北区河岸边,背完英语课文掏出口琴吹一曲。
研究生,amazon上$7入手一布鲁斯口琴,恰巧孙娜也买了一支布鲁斯。之后忙于课业科研我一直没碰过,不知道她有没有吹出完整的《星之所在》。
口琴放在那里已经两个多月了。
刚来美国时偶尔还会流着泪醒来,起床后有心痛的感觉。
现在似乎渐渐适应了这种见不到你们和你的生活。
但我还是不想0点就睡觉,想着睡前看到你们的QQ头像一个个变成彩色,在商场看到有趣的东西还是会想到“这个送给xx不错”,还是上人人网不上facebook。
anyway,i’m doing good
anyway, i miss u so much
先贴题目要求和翻译:
To safeguard against the dreaded phenomenon of wall posting while drunk, Facebook is implementing a feature that detects when post content is too garbled to have been done while sober and informs the user that they need to take an online breathalyzer test before being allowed to post.
废话,不翻译。
Unfortunately, there is far too much content for a given set of persons to evaluate by hand. Fortunately, you are a programmer of some repute and can write a program that processes and evaluates wall posts. You realize that such a program would be of great use to society and intend to resolve the problem once and for all. The program you write must compute a score for a body of text, returning this score upon completion.
废话,不翻译。
Your program will be given a list of accepted words and run on one wall post at a time. For each word W in the post, you must find word W’ from the list of accepted words such that the number of changes from W to W’ is minimized. It is possible that W is already W’ and thus the number of changes necessary is zero. A change is defined as replacing a single letter with another letter, adding a letter in any position, or removing a letter from any position. The total score for the wall post is the minimum number of changes necessary to make all words in the post acceptable.
题目提供了一个单词表(从这里下载) 。对于待分析字符串中的每个词,你的程序要从单词表中找到最接近的词并计算这两个词的“距离”。两个字符串的“距离”定义为从字符串1变成字符串2所需要的最小操作数,允许的操作包括:
Your program must take a single string argument, representing the file name containing the wall post to analyze. In addition, your program must open up and read the accepted word list from the following static path location:
/var/tmp/twl06.txt
你的程序的参数为: 单词表文件 待分析文本文件
For testing purposes, you may download and examine the accepted word list here. When submitting your code, you do not need to include this file, as it is already present on the machine.
The input file consists entirely of lower case letters and space characters. You are guaranteed that the input file will start with a lower case letter, and that all words are separated by at least one space character. The file may or may not end with a new line character.
Example input file:
tihs sententcnes iss nout varrry goud
You are guaranteed that your program will run against well formed input files and that the accepted word list is identical to the one provided for testing.
Your program must print out the minimum number of changes necessary to turn all words in the input wall post into accepted words as defined by the word list file. Words may not be joined together, or separated into multiple words. A change in a word is defined as one of the following:
This score must be printed out as an integer and followed by a single new line.
Example Output (newline after number):
8
那么我们的程序的基本流程为:取一个字符串 -> 和单词表中的每一个词计算距离 -> 找到最小值 -> 取下一个字符串
首先需要留意的就是那个”距离“(原文为“changes”),这个函数是整个程序的核心,因为其他的步骤无非就是字符串分析和查找最小值,没什么难度。
这个”距离“,即两个字符串由一个转成另一个所需的最少编辑操作次数(接受的操作定义见前述),称为”编辑距离“,或”Levenshtein Distance“(后面以LD代替),由前苏联科学家Vladimir Levenshtein于1965年提出。中文wiki对这个算法的描述甚少,只有一个伪代码描述。这里我把英文wiki的描述在这里翻译一下,把整个LD的计算过程理顺一些。
又是动态规划问题,依然使用自底向上的思路解决。
首先考虑空串到空串的情况,不需要任何操作,LD=0。
直接拿矩阵说话:
| k | i | t | t | e | n | ||
|---|---|---|---|---|---|---|---|
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | |
| s | 1 | 1 | 2 | 3 | 4 | 5 | 6 |
| i | 2 | 2 | 1 | 2 | 3 | 4 | 5 |
| t | 3 | 3 | 2 | 1 | 2 | 3 | 4 |
| t | 4 | 4 | 3 | 2 | 1 | 2 | 3 |
| i | 5 | 5 | 4 | 3 | 2 | 2 | 3 |
| n | 6 | 6 | 5 | 4 | 3 | 3 | 2 |
| g | 7 | 7 | 6 | 5 | 4 | 4 | 3 |
distance_matrix[x][y]的值可能有三种来源:
取三个值中的最小值即可。
依此类推,最后得到完整的矩阵。矩阵右下角的值就是需要的LD(str1, str2),算法的时间复杂度为O(n2)
def ld(s, t):
"""Find the Levenshtein distance between two strings."""
m = len(s)
n = len(t)
if m > n:
s, t = t, s
m, n = n, m
if n == 0:
return m
# d is a matrix with m+1 rows and n+1 columns
d = [[0] * (n+1) for x in range(m+1)]
for i in range(m+1): # from 0 to m
d[i][0] = i
for j in range(n+1): # from 0 to n
d[0][j]=j
for i in range(m):
for j in range(n):
if s[i] == t[j]:
d[i+1][j+1] = d[i][j]
else:
deletion = d[i][j+1] + 1
insertion = d[i+1][j] + 1
substitution = d[i][j] + 1
d[i+1][j+1] = min(insertion, deletion, substitution)
return d[m][n]
算法不复杂,但该算法的时间复杂度却不能再降了,因此在单词表中单词量很大且单词长度很长的情况下,该算法慢的要死。题目提供的单词表一共178691的单词,待分析的单词6个,那么需要计算178691*6次LD,对于一个O(n2)的算法来说无法承受。事实上在我的电脑上(Core i5 2.6GHz 逻辑四核)该程序耗时1分钟,只把一个核跑到100%CPU占用。而且这个程序非常适合改造成map-reduce的结构。一个单词和单词表中所有单词的距离的计算可以map到数个计算线程上,每个线程汇报一个线程最小值,最后这几个线程reduce找到最小值。
字符串处理使用python是一个好主意,但是对于并行计算,python的threading机制并不是一个好的选择。stackless python没有试过。我想尝试的是原生并发的erlang。《erlang核心编程》的第20章第4节有一个使用map-reduce的文件内容索引器的范例,可以改造成本题的解答。
然而erlang不适合文件和字符串的parsing,太tmd烂了,而且据某些大牛表示:同是functinal programing (FP) language, Haskell显得更elegant,仿佛若干年前Perl和Python的关系。然而谁知道未来谁会是FP的赢家。erlang不好学,而且字符串parsing太tmd恶心了,为了提高效率还得转成binary,好多算法还要自己重新写。。。。
所以本文为stage 1,什么时候写stage 2我也不知道,等我把erlang的字符串处理搞掉再说。
唉,喜欢Python就是因为我不用在造轮子的问题上浪费时间。
West of the coast lies my sweet home,
East of the coast lies my passionate career
View 飘 in a larger map