Archive for December, 2010

微博的瞬时记忆

Tuesday, December 28th, 2010

我不喜欢鸡,是因为我小时候到奶奶家,曾亲眼看过杀鸡的场景。那是一群,我伯父取向其中最肥的一只,其它几只纷纷逃窜。但是没走几步,就又开始悠哉的吃食了。那只鸡被反掐住脖子,刀子一划便在滴血,扑腾了几下就挂掉了。之后是拔毛,刨腹,把肠子肚子什么拉出来丢到桶里。我清楚地记得有一只鸡溜达回来,看到桶里的肠子就很快地叼走了。我想,鸡的记忆是瞬时的吧?几秒钟的恐惧被食物的吸引冲淡了,也忘掉刚才沦为刀下鬼的是自己的同伴,或可能就是它自己。

前几天看到两篇文章,一个是《南方人物周刊2010年度人物——微博客》,一个是《娱乐至死》,是讨论微博和娱乐的。我最近的主要“娱乐”就是微博了。其实我上微博的目的很简单,ID叫@科学玩家,想找一些志同道合的人,谈谈技术,谈谈科学。后来接触的人多了,信息也杂了起来。我还是尽量的保持不被“琐事”所累,一门心思地读圣贤书。但谁也无法独善其身,大量的信息扑面而来的时候,你想不关注也不行的。于是,像我这么消息不灵通的人,也几乎第一时间知道了王家岭矿难,玉树地震,南京化工厂爆炸,舟曲泥石流,李刚之子事件,到最近的乐清碾人事件。

我开始是漠不关心,后来偶尔跟着喊一喊,掉掉眼泪,到一度的情绪高涨,大有愤青的模样了。但是喊完也就喊完了,骂够了,舒服了,日子该过还是得过,我的论文还是要赶紧写出来。而事件中那些人的日子如何了,就和我没什么关系了。我可以煞有介事地大谈特谈舆论监管,跟着便是冷笑话和萌物,前一条慨叹民生疾苦,后一条秀新买的数码。情绪和思维的切换达到前所未有的速度,比Alt-Tab来的快多了。

这或许就是微博里面体现的,微信息,微思考。我可以被短短140字打动,之后又投入到另一140字的情景中。《娱乐至死》的漫画里,奥威尔预言权威会打压舆论,禁止信息的流动,从而达到控制人民思想的目的;赫胥黎预言权威们会倾倒大量的“垃圾”信息,混杂到“有威胁性”的信息中,叫你无暇分辨,无心思考。“奥兹曼认为,对未来作出正确预测的,不是奥威尔,而是赫胥黎”是这篇漫画的最后一句。我比较“乐观地”认为,欧美等政府是在按照赫胥黎的想法出牌,而中国政府还是采取比较低级的打压政策。
或者说,我国人民除了面对上面的压力之外,自己也在主动地将信息遗忘在海量的娱乐中?

我不提倡大家过苦行僧搬的生活,或者每天苦大仇深地要如何如何。仇恨永远不该成为主旋律,我希望大家都能幸福,至少认为自己幸福。但是如果某事触动了你敏感的神经,让你真的为之一震,我们也应该把这个事儿当个事儿了,不要骂娘声刚落,立刻又幸福了起来。因为这个幸福是短暂的,是廉价的。同样廉价的还有莫名的惊恐和愤怒,虽然真相往往掌握在有关部门手里,但这不该成为我们看到菜刀边哭喊着四处逃窜,菜刀收起来就放心吃食的理由。如果我没有将事情解决的能力,那我至少保持着关注,看看别人是如何解决,或到底有没有解决。

舆论的力量是强大的,同时也是短暂而脆弱的。如果我是王家岭矿难某遇险矿工的妻子,我会很欣慰地看到网上关于此事铺天盖地的曝光。仿佛一群素未谋面的街坊四邻,敲锣打鼓地从四面八方出现,呜呜泱泱地要去衙门讨公道,或去找青天大老爷。然后短短数日,听说玉树地震,于是这群热情的邻里们又吹着喇叭走掉了,剩下茫然的寡妇和她背后的笑声。
就在昨天,看到微博上一个MM在喊,她的20岁的年轻同学因政府建设用地的事,被政府的人围殴死了。也就在她一系列的@后面,跟了几条“没的美剧追了,该追韩剧”的感慨(现已删除)。那我想,这位同学的记忆也是短暂的吧?像我一样。

我做个预言的话,或者我的这个文章石沉大海,不足以激起共鸣的浪花;或者会被转,有人会感慨,共鸣,然后下一条是星座运势,或厨房秘籍了。

Advertisements

Playing the music with the spark gap

Friday, December 17th, 2010

I posted an article <Play the music with your DAQ card> some days ago. It saves you when you have no sound card but only a data acquisition card to play the music (and you’re welcome:)). Now what if you have no speaker but only a Jacob’s Ladder?  We borrowed a Jacob’s Ladder from the physics department and had a play with it. Using the electric arc we are able to play the tunes!
This is the video I uploaded in youtube, please help yourself:)

For the people who are not convinient to browse youtube, you can also find it in this link (tudou.com, a video server in China).
Sorry I didn’t edit this phone recorded video, and you have to rotate your head to the left to view it. So we converted the sound file to a sequence of train pulses in LabVIEW, which triggers the Jacob’s Ladder to genenrate sparks. By changing the duty cycle and the frequency of the pulses, we are able to change the volumes and tunes.

P.S. We are not playing all the music, for the tune and pace range of the Jacob’s Ladder is very limited. It only makes the sound when the electric arc appears.

Return the bigger values of 2 arrays

Friday, December 10th, 2010

I came up with a similar question (<Return #elements of an array greater than a certain value>) before, and today this one “What’s the efficient way of comparing 2 arrays and returning an array with the bigger values?” was posted in gsdzone.net forum.

This is not a complex problem and many responses were given. But all of them suggested using a for loop to compare the elements one by one. Most of the comparison and numeric nodes in LabVIEW are polymorphic and we should take use of them efficiently. I tried the following code and it works 🙂

So a single Max & Min node can do the job.

A thought that may or may not be helpful (or even correct!) in optimization: Always try to do it with polymorphic nodes when you did it with a loop; always try to do it in one loop when you did it with several loops.
Thanks to rogel who brought up this problem.

Run consumer loop without waiting

Thursday, December 9th, 2010

Producer/Consumer loop (PC loop) is one of the most important architectures in LabVIEW. It gives a good solution when your data producing rate is faster than your consuming rate. A typical example is analysing/storing the data while acquiring new ones. We dont want any slowness or jag of the post-process  interrupt the acqusition. Thus PC loop create a space from the memory and uses it as a buffer to deal with the asynchronous tasks.

In this architecture, the consumer loop will wait (for timeout period) until there is a new element in the queue. What if we want to run the consumer loop regardless the queue is empty or not? Sometime, we want to output waveforms until new waveform is generated. I modified the PC loop as following:

 

Note: Since the consumer loop runs all the time, we need a ‘wait until‘ node in it to save the CPU. It is not shown in the figure and sorry about that.

So the consumer loop does the normal things (like output pre-defined signals) when there is no element in the queue (determined by state of queue.vi). And when there is, the consumer loop dequeues it and updates the state (like updating signals). I think this thought is logical and similar to human thought. An alternative method is to enqueue the same element after we de-queue it. In this case the loops will be keeping enqueuing and de-queuing. I don’t quite like this method, of which the thought is not straightforward.