存档

作者存档

MSN space的Firefox兼容性又开始抽风了

2007年10月18日 2 条评论

使用Firefox的时候,即使已经写了内容,“发布日志”的按钮也是灰掉的。
基本上完全无法在线编辑。

使用IE的话,如果禁用了ActiveX,一样无法使“发布日志”的按钮变亮。

之前也出现过几次,不过问题很快解决了,不过这次似乎已经好多天了。

那么这篇文章是……
我用电子邮件发布的,之前把Windows Installer在C:\Windows\Installer的目录
弄坏了,导致现在Live Writer也装不上。

考虑再三,GMail撰写,Email发布好了。

BTW: 我真希望可以有一个浏览器内建的编辑器,可以智能的替换掉所有的需要写
长文章的地方。例如Gmail写邮件的文本框,Live Space或者其他的什么blog写文
章的框等等。而且,最好兼容某些经典的使用习惯,例如Emacs……

标签: ,

GPhone is coming

2007年10月10日 1 条评论

From New York Times:
For Google, Advertising and Phones Go Together

看起来Google是要建立一个Open Source,可能附带浏览器的手机操作系统,然后通过这个操作系统来卖他的广告。Google是一个把Joel关于“附属品”的商业概念发挥到极致的又一家公司。

Google就是一个卖广告的公司,说白了就是这样。为了卖出更多的广告,它就必须把更多的人拉拢到它的软件使用者当中去。所以,它不关心软件是不是卖钱,甚至干脆开源算了。因为软件的成本越低,卖出的软件越多,Google就可以把越多的拥护笼络在它的触手之下,进而可以更加理直气壮地向广告商要钱。现在,Google已经不满足于在PC上面拉拢用户了,接下来是手机和移动设备——几乎免费的手机操作系统和软件交给vendor去生产,GPhone看起来还真是一个不错的主意。

接下来了?Google的模式能否在手机上复制成功呢?要知道,让用户消耗自己宝贵的GPRS流量来传输广告,实在不一定是一件很得人心的事情。

或者,just build up cool features, and wait for the hardware (and bandwidth) to catch up … again?

标签: ,

Google Code for Educators

2007年10月9日 没有评论

http://code.google.com/edu/

互联网真是个好东西。

标签:

这个十一

2007年10月7日 6 条评论

过的相当happy,除了有点小败。

消耗掉了2天半的年假,加上黄金周,从29号开始休假到8号上午。

29æ—¥

早上8:00开始坐上长途汽车一直到晚上18:00,到家。途中严重考验了手机的电池性能——连续10小时的mp3播放,电池格数竟然没有下降。PHILIPS的电池就是好,就是好,嗯。

在家几天天天睡到中午,看到家人安好,安心许多。

[中间省略数万字]

3æ—¥

和前高中同学,现某铁路部门人士共进午餐,谈及高中同学目前的状况,唏嘘不已。饭毕切磋PS2,发现古董级别的实况7,虐对方N场,被虐N场。

晚上卧铺回南京,途中遇到一个在天津师大读新闻系的mm,甚为pp,成功搭讪并一路聊到徐州此mm下车,非常happy。此mm下车之后才恍然大悟没要电话,堪称做过的最败的事情之一。土的程度一塌糊涂,骇人听闻。回来试图补救,发挥本人专业特长进行搜索,失败。

4æ—¥

早上4:30到达南京,竟然比时刻表上面的要早一个小时,严重打乱了我的睡眠。

5:30回到家,冲个澡之后把衣服丢进洗衣机之后一觉之后到早上10点,吃了午饭冲向中央门车站,打算去合肥耍耍,结果下楼之后想起衣服尚在洗衣机当中,冲回楼上收拾了衣服,浪费10分钟余。

后乘公交车到中央门,不想一路畅通,未见堵车,到站过早,在车站等了接近两个小时。

下午五点多方才到合肥,下车才发现恰逢出租车交班,搭乘摩的回到科大,途中惊险无数,发誓从此不再搭摩的。

抵达之后即和业界某顶尖牛人、科大某技术版版主及某网络传媒公司的某manager一同吃海鲜,成功造成此牛人拉肚子。为了海鲜还放了某宣称当日进京的中科院人士的鸽子。

饭毕扯淡到晚上10点,冲到本科同学的宿舍,发现此中科院人士竟然放了火车站的鸽子,曰为我专门改变行程,感激涕零,遂欣欣然约定第二日为其送行。

当日在其屋借宿一宿,不想此床枕头太低,落枕。

5æ—¥

醒来已经中午,恰逢信院院足球队某大牌请另一大牌吃饭,遂与中科院人士共同前往。席间八卦无数,听闻本班某mm对大牌甚为欣赏,为席间最大八卦。

晚上做东请饭,因饭店实行买二送一,遂六人同行,包括信院大牌。此大牌席间消耗螃蟹无数,某新认识的mm消耗蛋糕无数,本人消耗肉类无数,幸为自助,且不限量供应,众人感叹不虚此行。

饭毕回到科大,发现众人已归,甚喜,遂将归期后推一日。

当夜换床而眠,落枕不治而愈。

6æ—¥

中午醒来亦中午,收到实验室某mm短信,曰实验室某高工携夫人请饭。不想此饭局成为科大otaku聚会,席间大谈即将出来的高达新片,偏偏发现对loli感兴趣的本大叔对此兴趣不大,遂埋头苦吃,消耗羊肉和基维虾无数。

饭毕回到科大,欲蹴鞠,寻遍行李发现出行急促,未带装备,悻悻然。后寻遍该楼层,未发现众大牌踪迹,悻悻然去实验室考察,吹牛至下午饭时间。

后听闻因连续腐败,某mm口腔溃疡,不能出席当晚饭局,众人为其惋惜之余,不免感叹。遂决定归宁之后,节衣缩食3月,以补偿近日腐败之余毒。

饭毕玩杀人游戏,见识众人真面目。最后一场首轮自杀,欲观察众人风格,不想看到有生以来的最具戏剧性的杀人游戏,堪为经典。

回去睡觉,不想与老同学卧谈至2点余。唏嘘颇多。

7æ—¥

早上竟然6:55分自行醒来,洗漱完毕发现众研究生尚在梦中,不忍扰其好梦,故群发短信后闪人。

不想此次同样估算失误,到了车站之后买到5分钟之后发车的某汽车车票,无时间买早饭,遂空腹颠簸至南京。中途睡觉竟然未醒。

11:00下车,发现由于合肥大兴土木修路无数,兼由南京车多人多堵车无数,原本2小时20分钟的车程消耗3小时,甚为不爽。

下车后收到短信曰“一路顺风”,回曰“多谢,我已经到了”。

出站发现方向感丢失。凭方位感找到路之后,观察路上车流量之后,决定乘坐地铁回家。不想进入地铁站之后方向感随即归来。

到家后吃过午餐之后午觉到2:00,发现大风渐起,遂趁早冲去附近超市采购些许物品,发现新上市桔子,购买无数,一下午消耗完毕。

一边消耗,一边写了这个blog。

就是这样。

标签:

一些智力题

2007年10月6日 没有评论

来自这里。

  1. There is an array A[N] of N numbers. You have to compose an array Output[N] such that Output[i] will be equal to multiplication of all the elements of A[N] except A[i]. For example Output[0] will be multiplication of A[1] to A[N-1] and Output[1] will be multiplication of A[0] and from A[2] to A[N-1].

    Solve it without division operator and in O(n).

  2. There is a linked list of numbers of length N. N is very large and you don’t know N. You have to write a function that will return k random numbers from the list. Numbers should be completely random.

    Hint:
    1. Use random function rand() (returns a number between 0 and 1) and irand() (return either 0 or 1)
    2. It should be done in O(n).

  3. You are given a game of Tic Tac Toe. You have to write a function in which you pass the whole game and name of a player. The function will return whether the player has won the game or not. First you to decide which data structure you will use for the game.You need to tell the algorithm first and then need to write the code.

    Note: Some position may be blank in the game। So your data structure should consider this condition also.

  4. You are given an array [a1 To an] and we have to construct another array [b1 To bn] where bi = a1*a2*…*an/ai. you are allowed to use only constant space and the time complexity is O(n). No divisions are allowed.
  5. How do you put a Binary Search Tree in an array in a efficient manner.

    Hint: If the node is stored at the ith position and its children are at 2i and 2i+1(I mean level order wise)Its not the most efficient way.

  6. How do you find out the fifth maximum element in an Binary Search Tree in efficient manner.

    Note: You should not use use any extra space. i.e sorting Binary Search Tree and storing the results in an array and listing out the fifth element.

  7. Given a Data Structure having first n integers and next n chars. A = i1 i2 i3 … iN c1 c2 c3 … cN.Write an in-place algorithm to rearrange the elements of the array ass A = i1 c1 i2 c2 … in cn
  8. Given two sequences of items, find the items whose absolute number increases or decreases the most when comparing one sequence with the other by reading the sequence only once.
  9. Given That One of the strings is very very long , and the other one could be of various sizes. Windowing will result in O(N+M) solution but could it be better? May be NlogM or even better?
  10. How many lines can be drawn in a 2D plane such that they are equidistant from 3 non-collinear points ?
  11. Lets say you have to construct Google maps from scratch and guide a person standing on Gateway of India (Mumbai) to India Gate(Delhi).How do you do the same ?
  12. Given that you have one string of length N and M small strings of length L . How do you efficiently find the occurrence of each small string in the larger one ?
  13. Given a Binary Tree, Programmatically you need to Prove it is a Binary Search Tree

    Hint: Some kind of pointer handling with In Order Traversal – anybody in for writing some code

  14. You are given a small sorted list of numbers, and a very very long sorted list of numbers – so long that it had to be put on a disk in different blocks. How would you find those short list numbers in the bigger one?
  15. Suppose you have given N companies, and we want to eventually merge them into one big company. How many ways are theres to merge?
  16. Given a file of 4 billion 32-bit integers, how to find one that appears at least twice?
  17. Write a program for displaying the ten most frequent words in a file such that your programshould be efficient in all complexity measures.
  18. Design a stack. We want to push, pop, and also, retrieve the minimum element in constant time.
  19. Given a set of coin denominators, find the minimum number of coins to give a certain amount of change.
  20. Given an array,
    i) find the longest continuous increasing subsequence.
    ii) find the longest increasing subsequence.
  21. Suppose we have N companies, and we want to eventually merge them into one big company. How many ways are there to merge?
  22. Write a function to find the middle node of a single link list.
  23. Given two binary trees, write a compare function to check if they are equal or not. Being equal means that they have the same value and same structure.
  24. Implement put/get methods of a fixed size cache with LRU replacement algorithm.
  25. You are given with three sorted arrays ( in ascending order), you are required to find a triplet ( one element from each array) such that distance is minimum.

    Distance is defined like this :

    If a[i], b[j] and c[k] are three elements then distance=max(abs(a[i]-b[j]),abs(a[i]-c[k]),abs(b[j]-c[k]))"

    Please give a solution in O(n) time complexity

  26. Classic – Egg Problem
    You are given 2 eggs.You have access to a 100-storey building.

    Eggs can be very hard or very fragile means it may break if dropped from the first floor or may not even break if dropped from 100 th floor.Both eggs are identical.You need to figure out the highest floor of a 100-storey building an egg can be dropped without breaking.

    Now the question is how many drops you need to make. You are allowed to break 2 eggs in the process.

标签:

When Web 2.0 Meets Computer 1.0

2007年10月5日 没有评论

Long Live the Command Line: access Google Calander

The latest example of new-meets-old: the gcalcli command-line interface to Google’s online calendar application. It’s an open-source utility that lets people read and update Google calendars–either their own or shared ones.

原以为是Google Calander的Web UI直接支持的command line接口,还想看看Google对于Command Line UI的支持方式——毕竟这个公司对于Web的理解应当成为一个值得借鉴的素材;仔细一看其实不是,这是Google Code上面的一个项目,用Google GData API访问Google Calander的后台并提供一个命令行接口。

有点意思,但是这种做法反而失去了Web 2.0的优势——随时随地的访问。

不过,让我们回头考虑一下,为什么这种Command Line接口的Google Calender前端会有市场——因为人们的操作习惯使然。而目前的Web软件开发还没有形成一种统一的操作习惯——虽然大多数人看到鼠标变成手形就会试图电击,但是更细致的习惯,像Unix一样认为一切皆可通过shell和管道通过文本连接的哲学,还没有形成。目前的Web开发,虽然大家让程序运行在相同的浏览器平台上面——通过HTML/XML/JavaScript/Flash来提供UI和使用HTTP进行数据的传输和命令的调用,但是这些UI并没有固定的标准和用户体验,所以人们才想出来开发一个大家习惯的用户界面,来访问Web应用程序。

也许我们除了浏览器,我们还需要一个shell,来整合这一切。这个shell是什么呢?基于feed的Google Personal Page也许是一个趋势:在Unix当中,一切皆是文本;那么在Web上面,一切皆是feed。

那么如何让feed能够更好的互操作呢?如何让用户可以方便的整合不同的应用,让他们通过feed进行通信?

这应该是个非常有趣的话题。

标签: ,

Google adds Postini security into hosted apps offering

2007年10月3日 没有评论

http://www.news.com/8301-10784_3-9789901-7.html

Google is beefing up its outsourced e-mail offering aimed at
corporations and universities, adding security features that large
companies demand.

Three weeks after closing its acquisition of Postini, Google has
integrated the company’s security and government regulation services
into Google Apps Premier Edition. That suite includes hosted e-mail,
calendar, instant messaging, Docs & Spreadsheets and Web page
creation software.

Google的hosted application suite的确是一个非常有意思的创意。而现在其中加上了Anti-Spam和Anti-Virus的自定义,是不是看起来Google应该成为比Microsoft更大的一个安全行业的竞争对手了呢?

标签: , , ,

Gmail cookie vulnerability exposes user’s privacy

2007年9月28日 1 条评论

又一起Gmail的XSS问题。

http://www.news.com/Gmail-cookie-vulnerability-exposes-users-privacy/2100-1002_3-6210353.html?part=rss&tag=2547-1_3-0-20&subj=news

Petko Petkov of "ethical hacking" group GNUCitizen has developed a proof-of-concept program to steal contacts and incoming e-mails from Google Gmail users.

"This can be used to forward all your incoming e-mail," Pure Hacking security researcher Chris Gatford said. "It’s just a proof of concept at the moment, but what they’re demonstrating is the potential to use this vulnerability for malicious purposes."

According to Gatford, attackers could compromise a Gmail account–using a cross-site scripting vulnerability–if the victim is logged in and clicks on a malicious link. From that moment, the attacker can take over the session cookies for Gmail and subsequently forward all the account’s messages to a POP account.

[…]
"People do use private accounts to store work information," IBRS security analyst James Turner said.

[…]
"When you have organizations like Google spending countless man-hours
reducing security vulnerabilities…you can imagine how bad the actual
situation is for other organizations," Gatford said.

通过XSS注入到当前的Web应用程序当中,然后执行程序,窃取Cookie,进而窃取隐私。非常简单的经典的攻击方式。但是在Web的世界里,Cookie就是一切隐私,也是唯一的隐私。这是一个很大的问题。

这种问题很像传统安全问题里面的权限提升,本质是使用某种诸如手段让自己的代码可以运行在其他人的安全上下文当中。在Web世界里,这个问题更加严重:毕竟在桌面系统上面伪造安全令牌时非常复杂的,但是在浏览器尚上,一旦获取到Cookie,伪造会变得非常容易。

进而考虑一下,传统的安全问题当中,恶意代码提升权限的目的是为了能够做更多的事情,例如对用户计算机的完全的特权访问。在Web安全当中,这个问题有些类似,通过XSS的方式,代码可以以“当前用户”的身份做更多的事情,例如,去感染更多的用户。

随着Web应用程序越来越流行,这种安全问题最终会变得很严重:试想一下,有一天,你的计算机(如果还可以称为计算机的话)上面不需要有硬盘,不需要太多的内存,你需要的只是一个固化在ROM里面的浏览器——Web终端,通过高速的电缆或无线信号连接到互联网。你真正的数据都存储在网络上面的数据中心当中——在那里有无法计数的海量存储设备;你通过访问互联网上无处不在的Web应用程序来访问和处理这些数据。我可以用在线RSS阅读器读取网络上各种各样的blog文章;可以通过在线的视频点播或者电视系统观看电视节目;甚至你可以将自己的照片、视频、文档统统保存在互联网上,以便可以在各处查阅。

这时候的互联网就是一个操作系统,但是,你所有的隐私,都基于一些Cookie——存储在浏览器当中的一些短小的字符串。Cookie,就是你的一切隐私。

这是个很大的问题。

Open Office Again, and something other

2007年9月26日 没有评论

Open Office bug hits multiple operating systems.

正如今天听CTO所说,Internet is dangerous。

就是这样。

BTW: Windows Server 2008 RC0 Releases today.

标签: ,

考虑一种基于浏览器的Anti-Blog-Spam的方法

2007年9月22日 没有评论

上面发的这个关于blog comment spam的文章被同样的人再次spam,而且正好被Ace的两个回复夹了三明治。实在让我郁闷了一把。

既然我不能对live space做什么让它不接收spam comment,那么我只能让我自己眼不见为净了。既然必须要我自己访问自己的blog的时候才会发现自己的blog是不是被spam了并且会手动删除上面的spam comment,那么我就把这个过程自动化好了。

基于GreaseMonkey好了。

先搭个架子,然后向里面填算法来判断这个comment是不是spam,目前的话,先基于关键字好了,看到那个叫做boubo的链接就删掉。

标签: ,