米米的博客

做了一点微小的工作

Heavens Above 是一个天文数据库网站,可以查询到诸如卫星过境的很多信息。虽然数据很全面,但是检索方式非常繁琐,在网站上需要依次打开多个链接进行比对,难以迅速地获取需要的信息。故笔者决定写一个爬虫,以直观地展现所有数据。由于 Heavens Above 采取了大量的反爬虫措施,例如校验 Cookie、限制单个 IP 的访问次数等,因此必须严格地模拟浏览器请求,才能正确爬取数据。

Heavens Above数据收集

笔者也参考了大量 GitHub 上已有的 Heavens Above 爬虫项目,不过它们大部分失去维护,停留在数年前,已经不再适用。具体的逻辑还是要自行测试。

项目地址:heavens-above

It's kind of painful to re-live this one. As a programmer, you learn to blame your code first, second, and third... and somewhere around 10,000th you blame the compiler. Well down the list after that, you blame the hardware.
回想起这个 bug,仍然让我感觉有些痛苦。作为一个程序员,在发现 bug 时,你学会了首先在自己代码中找问题,一次、两次、三次…… 或许在测试一万次之后,你会把问题归咎于编译器。只有在这所有的都不起作用之后,你才会把问题归咎于硬件。

This is my hardware bug story.
这是我遭遇硬件 bug 的故事。

Among other things, I wrote the memory card (load/save) code for Crash Bandicoot. For a swaggering game coder, this is like a walk in the park; I expected it would take a few days. I ended up debugging that code for six weeks. I did other stuff during that time, but I kept coming back to this bug -- a few hours every few days. It was agonizing.
抛开别的不说,我曾为古惑狼(Crash Bandicoot,PS1 游戏)写存储卡(读写)代码。对于一个自大的游戏程序员,这就像是在公园里散步一样轻松愉快;我预计只要几天就可以写完。我最终用了六个礼拜把那些代码调试完毕。在此期间我也做过一些其他的事情,但却一直绕不开这个 bug—— 每几天内就要花上好几个小时来处理。这个 bug 实在烦人。

The symptom was that you'd go to save your progress and it would access the memory card, and almost all the time, it worked normally... But every once in a while the write or read would time out... for no obvious reason. A short write would often corrupt the memory card. The player would go to save, and not only would we not save, we'd wipe their memory card. D'Oh.
这个 bug 的症状是,当你需要保存你的进度时,代码会访问存储卡,而大部分情况下没有什么问题… 但是偶尔读写会超时… 没有任何明显的原因。一个简短的写入经常毁掉存储卡。玩家要保存进度,我们不仅不保存,还擦除他们存储卡上的全部东西。天哪。

After a while, our producer at Sony, Connie Booth, began to panic. We obviously couldn't ship the game with that bug, and after six weeks I still had no clue what the problem was. Via Connie we put the word out to other PlayStation 1 developers -- had anybody seen anything like this? Nope. Absolutely nobody had any problems with the memory card system.
过了一段时间,我们在 Sony 的制作人 Connie Booth 慌了。我们显然不能发布带有这个 bug 游戏,而六个星期之后我对于问题出在哪一点线索都没有。通过 Connie 我们向其他 PS1 开发者求助:有没有人出现过像我们这样的情况?没有。绝对没有任何人在存储卡系统上出现任何问题。

About the only thing you can do when you run out of ideas debugging is divide and conquer: keep removing more and more of the errant program's code until you're left with something relatively small that still exhibits the problem. You keep carving parts away until the only stuff left is where the bug is.
在你绞尽脑汁之后,你能做的唯一一个调试方法就是分而治之:一点点去除错误程序中的代码,直到留下的代码相对很少,但仍然表现出问题。像雕刻一样去除没有问题的代码,留下的就是你的 bug 所在。

阅读全文 »

月下独酌
李白
花间一壶酒,独酌无相亲。
举杯邀明月,对影成三人。
月既不解饮,影徒随我身。
暂伴月将影,行乐须及春。
我歌月徘徊,我舞影零乱。
醒时同交欢,醉后各分散。
永结无情游,相期邈云汉。

八月十五夜月
杜甫
满月飞明镜,归心折大刀。
转蓬行地远,攀桂仰天高。
水路疑霜雪,林栖见羽毛。
此时瞻白兔,直欲数秋毫。

十五夜望月
王建
中庭地白树栖鸦,冷露无声湿桂花。
今夜月明人尽望,不知秋思落谁家!

南斋玩月
王昌龄
高卧南斋时,开帷月初吐。
清辉澹水木,演漾在窗户。
荏苒几盈虚,澄澄变今古。
美人清江畔,是夜越吟苦。
千里共如何,微风吹兰杜。

中秋月
苏轼
暮云收尽溢清寒,银汉无声转玉盘。
此生此夜不长好,明月明年何处看。

中秋月
齐已
空碧无云露湿衣,众星光外涌清规。
东林莫碍渐高势,四海正看当路时。
还许分明吟皓魄,肯教幽暗取丹枝。
可怜关夜婵娟影,正对五候残酒卮。

阅读全文 »

It's no great mystery that truly great user interfaces are the ones that are engineered to stay out of the way.
真正优秀的用户界面都是那些设计得「不挡路」的 —— 这并不是什么奥秘。
'Staying out of the way' means not distracting your users. Rather, good UIs let your users complete goals. The result? A reduction in training and support costs, and happier, satisfied and highly engaged users.
「不挡路」意味着不会分散用户的注意力。事实上,良好的用户界面可以让你的用户完成目标。结果呢?减少培训和支持的成本,以及让用户更快乐、更满意并被深深吸引。
Check out our other design courses at Treehouse.
在 Treehouse 查看我们的其他设计课程
When getting started on a new interface, make sure to remember these fundamentals:
在开始设计新的用户界面时,请务必记住以下原则:

Know your user

了解你的用户

"Obsess over customers: when given the choice between obsessing over competitors or customers, always obsess over customers. Start with customers and work backward." -- Jeff Bezos
「对顾客的关注:当在关注竞争对手或顾客之间做出选择时,总是应该关注顾客。从顾客开始,用逆向思维工作。」 —— Jeff Bezos

Your user's goals are your goals, so learn them. Restate them, repeat them. Then, learn about your user's skills and experience, and what they need. Find out what interfaces they like and sit down and watch how they use them. Do not get carried away trying to keep up with the competition by mimicking trendy design styles or adding new features. By focusing on your user first, you will be able to create an interface that lets them achieve their goals.
你的用户的目标就是你的目标,因此请了解它们。重申它们,重复它们。然后,了解你的用户的技能和经验,以及他们需要什么。找出他们喜欢的界面,坐下来看看他们如何使用这些界面。不要试图通过模仿时尚的设计风格或添加新功能来跟上竞争对手,而忘乎所以。通过首先关注你的用户,你将能够创建一个让他们完成目标的界面。

Pay attention to patterns

注意 UI 样式

Users spend the majority of their time on interfaces other than your own (Facebook, MySpace, Blogger, Bank of America, school/university, news websites, etc). There is no need to reinvent the wheel. Those interfaces may solve some of the same problems that users perceive within the one you are creating. By using familiar UI patterns, you will help your users feel at home.
用户会将大部分时间花在除你以外的其他界面上(Facebook,MySpace,Blogger,美国银行,学校 / 大学,新闻网站等等)。没有必要重新发明轮子。这些接口可以解决用户在你正在创建的问题中感知的一些相同问题。通过使用熟悉的 UI 模式,你将让你的用户有宾至如归的感觉。

Stay consistent

保持一致性

"The more users' expectations prove right, the more they will feel in control of the system and the more they will like it." -- Jakob Nielson
「越多用户的期望被证明是正确的,他们对系统的控制感越强,他们就会越喜欢它。」 —— Jakob Nielson

Your users need consistency. They need to know that once they learn to do something, they will be able to do it again. Language, layout, and design are just a few interface elements that need consistency. A consistent interface enables your users to have a better understanding of how things will work, increasing their efficiency.
你的用户需要一致性。他们需要知道,一旦他们学会做某事,他们就能再次做到。语言、布局和设计只是需要一致性的一些界面元素。一致的界面使你的用户能够更好地了解事物的运作方式,从而提高效率。

阅读全文 »
0%