This blog is rated 🔞, viewer discretion is advised

德阳三诊语文考试~~

发信人: SaintShaka (天舞宝轮), 信区: MilitaryJoke
标 题: 叫你们丫的还钓鱼!
发信站: 水木社区 (Sat Aug 13 15:52:27 2011), 站内

【 以下文字转载自 RailWay 讨论区 】
发信人: Aragorn21 (男儿到死心如铁,看试手,补天裂), 信区: RailWay
标 题: 叫你们丫的还钓鱼!
发信站: 水木社区 (Sat Aug 13 14:14:30 2011), 站内

参考:

2010年10月8日参考消息电子版,注意这里面并没有“夏尔谢夫”一文。

四川省德阳市高中2011级第三次诊断性考试(语文)

关于这个国内最强钓鱼文,让我感到非常费解的,既不是文科生如此之低的低智商,也不是人们传播帖子的急切心情,而是为啥很多人没有看过黄万里的那篇报道原文?现在的人阅读量真的都太少了。

还有文科生那种找不到引用就随便编造一个(栽赃参考消息)的作风也是非常中国的。

Posted

archive

The Vibe of Curiosity

I kinda feel the same way like somehow in some degree, I've lost part of my curiosity.

Here's a random list of why:

  • Lack of variety input. Patterned routine lifestyle kills any motivation of curiosity.
  • Surrounded by losers who think you interest is lame.
  • You have an alternative identity to keep which happens don't require any curiosity.
  • You get used to a low demanding which is mindless grind
  • You got way too focus on certain target that you missed the greater scene.
  • Life happens too fast, it's better to enjoy the moment than curios about the rest.
  • You satisfaction feedback relies more on material stimulation.
  • Dynamic curiosity is a huge waste of time. You have no purpose and accomplish nothing.
  • Shit's too trivial for your taste of mind. You have better things to do. This happens when your hierarchical curiosity has upgraded to a better level. It's painful to look back.
  • You care yourself too much.
  • You are an oldfag.

The curiosity boat sailed into the sunset. So long and thanks for the joys.

Posted

archive

黑RSA ID与yuange1975

今天才看到黑掉RSA ID的一些细节过程

https://twitter.com/yuange1975/status/42357318628802560

ready? new flash 0day is on the way.
6:55 AM Mar 1st via web
Retweeted by 24 people

yuange1975

这个cve-2011-0609 Flash 0day嵌入一个叫"2011 Recruitment Plan"的xls里作为附件发送给了EMC RSA的员工,RSA员工从垃圾箱里把这个邮件附件打开了。payload是Poison Ivy RAT这个远控。

一开始还真以为是威武的yuange1975,结果又看到这个

http://hi.baidu.com/yuange1975/blog/item/eff4b687834ca83fc65cc35e.html

http://twitter.com/yuange1975到底是谁?
2011-03-30 11:00

    http://twitter.com/yuange1975到底是谁?有意混淆视听不说,现在竟然我的照片都用上了.

    不管出于什么目的,希望好自为之.

看来是被冒充了。 @yuange1975 这个帐号的twitter发言,英语也太native了一点。

Posted

archive

hey与情感

网友修订版v1:

网友修订版v2:

via

Posted

archive

MongoDB之mapReduce()蛋痛

  1. 直到发现 printjson()之前,调试起来麻烦。
  2. 写起来很诡异,因为MongoDB本来就是诡异的BSON(用内置的Javascript操作起来就是JSON)数据结构,然后大量的Javascript Array的forEach(), map()就昏了。
  3. 万幸的是MongoDB自带的SpiderMonkey还不支持Array.reduce(), yield()等各种蛋痛Javascript 1.8方法。
  4. mapReduce()代码维护起来麻烦,2周之后自己的代码可读性趋近于0了。郁闷。
  5. 用的是pymongo这个 MongoDB Python Driver。Javascript和Python混写很蛋痛。估计Node.js写起来爽一点吧。还有就是命名风格也很蛋痛,findOne() 和 find_one() 是同一个东西在不同地方的写法,但是$addToSet又是同一个写法。
  6. Javascript还是比较烂的一门语言。我觉得最大的问题就是函数不能可选命名参数调用,把Object当字典用但是key又不加引号,缺乏Object.keys()和 Object.update() 方法,key只能是固定格式的字符。

Posted

archive

苏宁的渣服务器

$ curl -I "http://www.suning.com"
HTTP/1.1 200 OK
Date: Sun, 31 Jul 2011 11:56:15 GMT
Server: IBM_HTTP_Server/7.0.0.13 (Unix)
Pragma: No-cache
Cache-Control: no-cache,no-store,max-age=0
Expires: Thu, 01 Jan 1970 00:00:00 GMT

  1. 时间比北京时间晚了4分钟
  2. Expires很奇怪。。

Posted

archive

The Free Design - Love You

今天看电影《Stranger than Fiction》觉得结束的vocal很好听。想收藏OST,在Amazon, wikipedia, ,IMDbColumbia Records都没找到。

想起了一个神奇的听歌搜歌网站,midomi.com,试了一下,太牛X了。果然准确鉴定

http://www.xiami.com/song/2025405

Give a little time for the child within you,
don't be afraid to be young and free.
Undo the locks and throw away the keys
and take off your shoes and socks, and run you.
La, la, la...

Give a little time for the child within you,
don't be afraid to be young and free.
Undo the locks and throw away the keys
and take off your shoes and socks, and run you.
La, la, la...

Run through the meadow and scare up the milking cows
Run down the beach kicking clouds of sand
Walk a windy weather day, feel your face blow away
Stop and listen: Love you.

Roll like a circus clown, put away your circus frown
Ride on a roller coaster upside down
Waltzing Matilda, Carey loves a kinkatchoo
Joey catch a kangaroo, hug you.

Dandylion, milkweed, silky on a sunny sky
Reach out and hitch a ride and float on by
Balloons down below catching colors of the rainbow
red, blue and yellow-green: I love you.

Bicycles, tricycles, ice cream candy
Lollypops, popsicles, licorice sticks
Solomon Grundy, Raggedy Andy
Tweedledum and Tweedledee, home free.

Cowboys and Indians, puppydogs and sandpails
Beachballs and baseballs and basketballs, too.
I love forget-me-nots, fluffernutters, sugarpops
I'll hug you and kiss you and love you
La, la, la... Love you.

第一个感觉有点像 Suzanne Vega - Tom's Diner‏。

Posted

archive

WSGI的毛病

来自pocoo.org

  • 'wsgi.input' is ill-specified but in practice it rarely causes troubles because a) half the servers are already extending WSGI and b) even though half the libraries are in violation it's only the edge cases that cause problems and those are rare.
  • Headers cannot be streamed which might be a problem with responses that have a huge amount of headers.
  • Trailers are not specified at all except for that “servers might do chunked responses”
  • Chunked request data is totally unimplementable on top of the current specification due to the ill-specified WSGI input thing.
  • WSGI can be hard to implement in an environment where you are running inside a server like Apache that is already doing request filtering that is outside of your control. WSGI assumes HTTP level access which inside a webserver you usually no longer have.
  • WSGI extends CGI's environment and inherits the problem that paths are decoded which comes with loss of information.
  • The start_response() machinery seems unnecessarily complex for the fact that barely anybody these days needs the exc_info or write() callable any more.
  • The 'wsgi.file_wrapper' is complete garbage because it does not work in practice as soon as middlewares are involved that process responses.

n年前在Web-SIG就对WSGI这玩意产生了厌恶。不支持异步服务器模型

看来ZeroMQ+JSON才是未来架构的王道啊。

via

Posted

archive

Wanna dance?

BGM来自Mass Effect 2 Lower Afterlifed Lo-Fi Epic the Techno Madness Mix

via

Posted

archive

组策略Software Restriction Policies (SRP)提权

  1. rename gpdisable.dll to deskpan.dll;
  2. create a new folder and name it as files.{42071714-76d4-11d1-8b24-00a0c9068ff3};
  3. place deskpan.dll to the new folder;
  4. open the folder;
  5. create a new rich text document in the folder;
  6. double-click the rich-text document.
  7. Wordpad runs with gpdisable.dll
  8. Bypassed :) We can run any process.

gpdisable下载

via

Posted

archive

Fuck Google

你麻痹的把老子Google Plus Profile冻结了,

Your profile has been suspended

After reviewing your profile, we have determined that the name that you provided violates our Community Standards.

If you believe that your profile has been blocked in error, please provide us with additional information via this form and we will review your profile again.

估计是因为没用真名。真你妹啊!

然后Google Reader的分享功能就没法用了。

There was a problem saving your post. Please try again.

Oops...an error occurred. Please try again in a few seconds

艹你妈山景城一群吃屎的。

更新

你麻痹的还要老子上传近照证明真身。麻痹的还需不需要JB照证明老子是男的啊。这种big corporation就是跟tg一样欠操。等老子有空来一定删掉Gmail走人。

Posted

archive

wtf

7月9日,广东东莞中堂镇一家专业制作医用硅胶仿真人皮面具的工厂里,工作人员演示仿真人皮的使用。时下,一种号称“可以改变人脸相貌”的仿真人皮面具悄然兴起,已成国内影视圈、美容圈、娱乐圈以及时尚化妆舞会上的新宠。据了解,目前仿真人皮面具在市场售价在800-13000元之间,最高可达3万-6万元不等。CFP

via

Posted

archive

不知道为啥ifttt也能火

Google Plus出来这几天,还有一个很火的就是If This Then That。满村飞的邀请码。

不明白啊,ifttt这软件不是第一个,也不是做得最好的,这个邀请泡沫就那么迷人嘛?

几个月前参加beta看了下,ifttt的功能简直弱暴了:

  • 中心化抓取服务,肯定是延迟超高的瓶颈
  • 既然是中心化的,被abuse了,然后被各大hosting和ICP封IP也是意料中的。
  • 轮询机制
  • 伪同步。其实算上延迟基本就没法用。还不如用pubsubhubblob这种直接支持事件的实时服务好。
  • 逻辑太弱,不支持多事件和复合条件判断
  • 管道太直,不支持数据微加工。比如我想抓取的RSS的某一个xml的属性值转换为时间,用这个时间发送SMS怎么做?

和ifttt类似的,我第一个想起来的就是xfruits。以前我用这个来合并过RSS。为啥xfruits就没这么火?

如果考虑我上面说的后两点,那么直接用Yahoo Pipes好了。Yahoo Pipes其实限制也多,那么把Yahoo Pipes编译到Google App Engine是个最好的办法。

我只能说,最终用户永远只会用类似 ifttt 直观得不能再直观的服务,而且加上的邀请的神秘感,真的很能炒。高级货只适合技术宅。

Posted

archive

iPad两个音乐软件:autoflip和etude

最近一直在玩电钢琴,一直很迷恋Windows上的Synthesia这个软件,这个软件的好处是:通过MIDI信号来识别你的弹奏,和现有的midi文件做对比,判断你是否把曲谱弹对了。这自学者来说太爽了。

Synthesia还有几个NB的功能:用算法把midi自动显示为五线谱,区分左右手,最新的dev版还加入了指法提示。(虽然fingering hint是人工输入数据,保存为metadata到midi文件,不是算法判断的)

但是软件虽然好,但是要在电钢琴前面放一个小桌子,再放笔记本,在小房间里还是显得有点挤。如果电钢琴靠墙,那么本本放侧边,你就只能偏头痛的去看Synthesia屏幕上的谱。

我又想起来我还有个iPad。iPad上面,我知道的,有两个显谱软件:Etude 和 Autoflip

Etude ~ sheet music on steroidsBy Wonder Warp Software SP

autoflip By Velvetmatter, LLC

Etude是在Hacker News上看到的(1, 2),功能非常类似Synthesia,不同的是,Etude不是通过MIDI,而是通过iPad的麦克风来聆听用户的弹奏是否符合乐谱。这一点很NB。

但是我最终没有选择Etude,而是选择了Autoflip,是因为我有一个愚蠢的判断:

Etude有一个in-app store模式,所有sheet music是可能需要在etudeapp.com上付费购买的(虽然现在全场免费)。而我不需要那么多的花哨功能,我只需要一个根据用户弹奏自动翻谱的app。Etude的盈利模式明显是诱惑用户去破费购买私有五线谱格式。

所以我选择了Autoflip,Autoflip的功能很简单,聆听用户弹奏,然后自动乐谱翻页。而且支持 pdf格式 的五线谱格式。

所以花了$4.99买了Autoflip。

当然,我才Autoflip肯定不会去OCR扫描版的pdf,所以今天花了很大功夫,晚上终于找到一个非扫描版的Op 599的钢琴谱,然后欢天喜地的用iTunes传到iPad上,发现被坑了

被坑的关键是:Autoflip不是用算法自动识谱的,所有新pdf通过iTunes传到iPad上,必须先用钢琴给Autoflip弹一遍,然后按照常规的方法给Autoflip翻一次页,Autoflip用KissFFT这个开源快速傅立叶变换库来学习音频信号,然后以后就可以根据学习的这个数据自动翻页。

这不坑爹嘛!!!!!!!!!!

$4.99后悔死了。我再也不相信付费app了。

Posted

archive

某雷《大抄袭》决战Team Fortress 2

某雷最近搞了个天雷滚滚的东西

官方网站

《大冲锋》由大名鼎鼎的《古墓丽影》系列游戏制作人 Troy Horton 领衔担纲产品制作,研发团队云集世界顶尖游戏开发者,分别来自EA, Ubi Soft, Sony ,blizzard的精英程序、策划、设计人员,一共拥有超过14年、30余款游戏开发经验。《古墓丽影》作为一款优秀的动作冒险游戏,其逸秀品质放在今天来看也不失为经典,而这一切都应该归功于其幕后强大的制作班底。 Troy Horton蛰伏多年,如今在充分了解中国本土玩家喜好和需求的基础上推出《大冲锋》,希望给中国玩家带来一个耳目一新的FPS游戏精品。

贴吧消息

其实迅雷是把项目外包给有实力的司。主要山寨这个构思绝对是迅雷的领导想出来的....开发的人无罪。主要是我加的一个群有人是在上海PDE工作,他就跟我们直接说了就山寨TF2+BF:HS。。。

PDE是啥司? 一个庞大的外包司,当然自己也有自主开发东西。BC2等游戏都有他们的参与...http://www.pearldigital.com/cn/index.html

百度知道又

Pearl Digital Entertainment (PDE)
公司位于上海,由著名游戏《古墓丽影》系列的前制作人特洛伊霍顿创立。公司通过提供技术和美术方面的专业游戏开发外包服务,为全球互动娱乐软件公司的产品和财务竞争力提供优秀的解决方案。

以制作大名鼎鼎的《古墓丽影》系列游戏一举成名的著名制作人特洛伊.霍顿(Troy Horton)放弃了他在英国的百万年薪、首席制作人的职位和公司提供的BMW轿车,举家搬迁到中国上海,这个充满了梦想和机遇的城市,旨在创建游戏史上第一个以中国为战略中心和开发基地,在香港和日本拥有分支机构,具有世界一流水平的次世代游戏制作室--- Pearl Digital Entertainment (PDE)。

来自世界各地的精英正陆续加入到Pearl Digital Entertainment (PDE) 的队伍中来,其中有曾在EA, Ubi Soft, Sony任职的资深程序开发、美术制作小组;整个精英团队在拥有超过14年、30余款游戏开发经验,一手缔造了《古墓丽影》系列游戏辉煌历史的特洛伊.霍顿本人指导下进行开发工作,保证了其在次世代游戏平台上的超一流开发实力。

还IPO,还贱卖狗狗,还上市。上你妹啊。

阀门公司也老杯具了,抄袭CF,现在又抄袭FC(大决战 = Final Combat)

btw 宇宙第一大国其实也抄袭过TF2,名字叫 H.A.V.E.,不过别人有妹子!

Posted

archive

兲朝的网站果然很威武

Google搞了个HTTP Archive

Pages with the Most Javascript

我勒个擦丫,千脑的1.3MB的javascript是肿么做到的?肿么做到的?肿么做到的?

Page with the Most Flash Files

搜房 和 东莞阳光网

Posted

archive

用lambda写python class

原class:

class Foo:
    classVariable = 'ImAClassVariable'
    def __init__(self, a, b, c):
        self._a = a
        self._b = b
        self._c = c

    def getA(self):
        return self._a

    @classmethod
    def aClassMethod(cls):
        return cls.classVariable

    @staticmethod
    def aStaticMethod(a, b):
        return a + b

    def __repr__(self):
        return '<%s: %r>' % (
            self.__class__.__name__,
            vars(self)
        )

lambda版本:

Foo = (lambda(new): # level 1, we define our new variable.
        new.classobj('Foo', (), dict( # return a class object.
            classVariable = 'ImAClassVariable',
            __init__ = (lambda self, a, b, c:
                self.__dict__.update(dict(
                    _a = a,
                    _b = b,
                    _c = c
                ))
            ),
            getA = lambda self: self._a,
            aClassMethod = classmethod(
                lambda cls: cls.classVariable
            ),
            aStaticMethod = staticmethod(
                lambda a, b: a + b
            ),
            __repr__ = (lambda self:
                '<%s: %r>' % (
                    self.__class__.__name__,
                    vars(self)
                )   
            )
        ))
    )(__import__('new')) # level 1 args

虽然很炫,但是new模块不是已经要被废除了么?

from gist via reddit

Posted

archive

Big Bang之前发生鸟神马

Q: If you believe the universe was created by thebig bang, what do you think happened before it?
A: The big foreplay, obviously

国内网上似乎对lamebook这种形式的截图赏析不是很热衷。

via

Posted

archive

端午节快乐

发信人: Adnim (轻轻地脱掉你的……小内裤), 信区: MilitaryTech
标 题: 发个应景的,端午快乐
发信站: 水木社区 (Sun Jun 5 20:52:48 2011), 站内

Posted

archive

和《孙子兵法》齐名的The 48 Laws of Power

Law 1 Never outshine the master.
Law 2 Never put too much trust in friends; learn how to use enemies.
Law 3 Conceal your intentions.
Law 4 Always say less than necessary.
Law 5 So much depends on reputation. Guard it with your life.
Law 6 Court attention at all costs.
Law 7 Get others to do the work for you, but always take the credit.
Law 8 Make other people come to you; use bait if necessary.
Law 9 Win through your actions, never through argument.
Law 10 Infection: avoid the unhappy and unlucky.
Law 11 Learn to keep people dependent on you.
Law 12 Use selective honesty and generosity to disarm your victim.
Law 13 When asking for help, appeal to people's self-interests, never to their mercy or gratitude.
Law 14 Pose as a friend, work as a spy.
Law 15 Crush your enemy totally.
Law 16 Use absence to increase respect and honor.
Law 17 Keep others in suspended terror: cultivate an air of unpredictability.
Law 18 Do not build fortresses to protect yourself. Isolation is dangerous.
Law 19 Know who you're dealing with; do not offend the wrong person.
Law 20 Do not commit to anyone.
Law 21 Play a sucker to catch a sucker: play dumber than your mark.
Law 22 Use the surrender tactic: transform weakness into power.
Law 23 Concentrate your forces.
Law 24 Play the perfect courtier.
Law 25 Re-create yourself.
Law 26 Keep your hands clean.
Law 27 Play on people's need to believe to create a cultlike following.
Law 28 Enter action with boldness.
Law 29 Plan all the way to the end.
Law 30 Make your accomplishments seem effortless.
Law 31 Control the options: get others to play with the cards you deal.
Law 32 Play to people's fantasies.
Law 33 Discover each man's thumbscrew.
Law 34 Be royal in your fashion: act like a king to be treated like one.
Law 35 Master the art of timing.
Law 36 Disdain things you cannot have: Ignoring them is the best revenge.
Law 37 Create compelling spectacles.
Law 38 Think as you like but behave like others.
Law 39 Stir up waters to catch fish.
Law 40 Despise the free lunch.
Law 41 Avoid stepping into a great man's shoes.
Law 42 Strike the shepherd and the sheep will scatter.
Law 43 Work on the hearts and minds of others.
Law 44 Disarm and infuriate with the mirror effect.
Law 45 Preach the need for change, but never reform too much at once.
Law 46 Never appear perfect.
Law 47 Do not go past the mark you aimed for; in victory, learn when to stop.
Law 48 Assume formlessness.

via

Posted

archive

QOTD

tg要乱咯。

via

Posted

archive

[图]苹果高价泡沫破裂 囤货商大量甩货

  据中国之声《新闻晚高峰》报道,去年(2010年)秋天,苹果身价暴涨,而近期,苹果出库价格急转直下,昔日高价买进的苹果现在无人问津。专家表示,苹果价格泡沫破裂,反映出目前生产组织化程度的“短板”。

  据中国之声《新闻晚高峰》报道,去年(2010年)秋天,苹果身价暴涨,而近期,苹果出库价格急转直下,昔日高价买进的苹果现在无人问津。专家表示,苹果价格泡沫破裂,反映出目前农业生产组织化程度的“短板”。

  出库价格不仅没有上涨反而“拦腰一刀”

  山东菏泽曹县拥有众多冷库,以往大多存储的是大蒜、圆葱等蔬菜,因为对未来市场看好,去年秋天,不少果蔬经销商购进了大批的苹果。但近期,苹果出库价格不仅没有上涨,反而是“拦腰一刀”。

  经销商:秦冠也就是7毛5、8毛一斤,一斤就要舍(亏损)一半,红富士进的时候1块7,现在也就卖1块3、一块2。而在2010年10月,山东的一级普通红富士曾一路飙升至3.5元/斤左右。

  同样类似的情况发生在山东多地,对此,山东省商务厅市场运行处副处长郭宏伟表示,随着库存逐渐上市销售,苹果有价无市的局面还将持续一段时间。

  郭宏伟:苹果是有一些囤的,有些市反映囤的比较多一些,最近就要出货了,因为苹果的存储期2到3个月,不能再囤了。

  大量积压、供求关系变化导致价格泡沫破裂

  按照往年的情况,“五一”过后,市场上的苹果价格会上涨,为何今年不但没涨价,反而低价销售却无人问津呢。我国苹果主产地、山东烟台苹果协会会长赵培策表示,主要因为去年收购价过高,不少人收购后惜售存在冷库里,造成今年(2011年)苹果大量积压,供求关系变化导致价格泡沫破裂。

  赵培策:去年秋收的时间,收购苹果的价格比较高,高的出奇。我们果农都不理解。

  赵培策告诉记者,看到价格高的离谱,他和不少同行及时收手,但还是有大量的资金前来收购,仿佛一夜之间,全国的经销商都来了,抢着收购烟台苹果。正是这股力量,最终将苹果价格推到天价。

  赵培策:去年参与经营苹果的队伍掺杂了一些杂音,有一部分搞其他产业的,你比如说搞建筑的,搞服务行业的等等,看到前几年苹果价格高,就勾起了他的欲望,搞炒作,游资炒作,这部分人比较多。我们算了一些,这部分人收购的苹果数量大概有40%左右。

  专业人士:农业组织化程度的缺陷或成主因

  恰恰是这40%的苹果,成为目前市场上最难销售的。因为对市场判断过分乐观而大量存储农产品(000061),最终导致价格泡沫破裂,这在山东已不少见。这个问题怎么解决?

  从大白菜到苹果,在山东省商务厅市场运行处副处长郭宏伟看来,反映的是农业组织化程度的缺陷。

  郭宏伟:包括蔬菜也好,苹果也好,还是与我们农业生产的规模化程度有关,规模程度上不去,农业生产的组织方式不改变,很难避免这种。一家一户的生产无法开展订单农业,也就无法避免这种市场波动。

  而烟台苹果协会会长赵培策表示,只有形成“大农业”的生产模式,才能更好的降低市场风险。

  赵培策:有了农民苹果专业合作社,生产有了规模,那么这个规模得和企业相对接,然后再和国家超市相对接,形成一个产业链条,用我们常说那个农业产业化经营模式,这是最好的经营渠道。

新闻来源:http://finance.jrj.com.cn/industry/2011/05/18230910000857.shtml

Posted

archive

5·19

稍有常识的人都可以看出,如果我们的方校长不去武大,那个螳螂挡车的MM用鸡蛋砸得了的么。同某些twitter上的敌对分子说的恰恰相反,方校长面对MM保持了最大限度的克制。

另:@WSongw 方校长拿砖砸了下自己,然后周游全国,拥抱了c姑娘、贝贝、木木和陶乐丝,收获ipad2、itouch、ip4各n台,去香港吃了大餐,去杭州喝了龙井,去东莞上了模特,嫖妓无数、采菊无数,然后开心的回家继续写白名单。

See Also: 1, 2, 3

Posted

archive

Forbidden City

还有比这个更加autism的吗????!!!

Posted

archive

盲狙IRL

练盲狙的 看上去像练盲狙的

练搬树的

Posted

archive

voilà

Tumblr居然火了啊

想起了n年前玩tumblr的时光:

http://est.tumblr.com/page/733

当时只是简单的把RSS和twitter的东西导入。

没想到现在cool kids居然又开始玩tumblr了。

Posted

archive

用VBScript实现IE 6,7,8的javascript getter/setter


<html>
<head>
  <title>A Crazy Getter/Setter Hack</title>
</head>
<body>  
  <script language="VBScript" type="text/VBScript"> 
    Function exec_vb_global(code)
      ExecuteGlobal(code)
    End Function
  </script>
  <script type="text/javascript">

    // Create the main default thing object, we will proxy this later
    function ThingBase() {
      // Private
      var space = 'something about the awesome';

      this.getSpace = function() {
        alert('getting');
        return space;
      }
      this.setSpace = function(value) {
        alert('setting');
        space = value;
      }
      this.groove = function() {
        alert('nn ts nn ts nn ts nn ts');
      }
    }

    // We need a factory to build this becuase we can't call 'new' from vbscript
    function ThingBaseFactory() {
      return new ThingBase();
    }

    // Eventually this text construction will be automated for the proxy
    // All you need to do is build the proxy for each property set*, get*
    // and stub each method 
    var obj = ""+
      "Class ThingProxy\n"+
      "  Private obj__\n"+
      "  Public Property Get space\n"+
      "    space = obj__.getSpace()\n"+
      "  End Property\n"+
      "  Public Property Let space(value)\n"+
      "    obj__.setSpace(value)\n"+
      "  End Property\n"+      
      "  Public Function groove\n"+
      "    obj__.groove()\n"+
      "  End Function\n"+  
      "  Private Sub Class_Initialize()\n"+
      "    Set obj__ = ThingBaseFactory()\n"+
      "  End Sub\n"+
      "End Class\n"+
      "' We need a factory because we can't call 'New' from javascript\n"+
      "Function thingProxyFactory()\n"+
      "  Dim tmp\n"+
      "  Set tmp = New ThingProxy\n"+
      "  Set thingProxyFactory = tmp\n"+
      "End Function\n";

    // Register the proxy class in the global context, make the factory global
    exec_vb_global(obj);

    // The actual thing constructor
    var Thing = function() { return (window["thingProxyFactory"]()) }    

    // Use the thing
    var t = new Thing();
    t.groove();
    alert(t.space);
    t.space = "Imma let you finish";
    alert(t.space);


  </script>
</body>
</html>  

太疯狂了,据说Dojo用这个hack也有很多年了。牛啊~~

via

Posted

archive

校训

各校校训大比拼:
  
  北京大学:勤奋、严谨、求实、创新;
  
  同济大学:严谨、求实、团结、创新;
  
  北京理工:团结、勤奋、求实、创新;
  
  华北电力:团结、勤奋、求实、创新;
  
  汕头大学:创新、求实、勤奋、团结;
  
  华东交大:团结、严谨、求实、勤奋;
  
  石油大学:勤奋、严谨、求实、创新;
  
兲朝就是这样创新求实的。

Posted

archive

手摇电筒简单比评

为了认真准备2012,est最近在淘宝搜刮了个这样的东东,简单的说叫手摇电筒,详细点是具备以下特性的东东::
1. 电源输入:手摇 or 太阳能 or 充电 or 电池
2. 电源输出:电筒 or 收音机 or 报警器 or 手机充电电源
3. 其他:防水,指南针
注意到一些型号,写个简单review
一般来说,收音功能就AM/FM,有的只有FM;有的是电子调谐,有的是老式旋钮;
现在电筒都是LED的了,有的是3颗⌀5 LED,有的是7颗⌀5 LED,有的是1颗⌀8 LED;3个16000MCD亮度的LED是可达到普通电筒亮度了。
手机充电那个其实就是USB电压;

理丹收音机L105 or 德劲Degen DE13


不足:
1. 收音机音量是log(n)函数那样的,一开始灵敏度恨高,后来声音就变化不大。
2. 手摇柄感觉非常脆弱容易断
价格一般在100-150
非常不推荐

Sorbo硕而博:

贵。
能手摇充电的有:SB-3085润亮、SB-3046曙光、SB-3030天籁之音
SB-3046这种还带防水

还有一些型号是马灯那种造型比较有特色。
淘宝上有便宜货山寨版,我问了sorbo官方客服,说88元SB-3046这样价格他们不可能做得出来

新岭南

有的型号要么只能手摇,要么只能太阳能。既能手摇又能太阳能发电的只有这几个型号
XLN-811B
XLN-288AS 没AM
XLN-288BS 没AM
XLN-288CS DC马达
XLN-288DS AC马达
XLN-284A 没有AM
XLN-284B
XLN-284D 没收音机 和 对手机充电

也就是说功能比较全面的就是XLN-811B、XLN-284B、XLN-288CS、XLN-288DS了。
我还不知道AC马达和DC马达有什么区别,囧。

更新:

AC马达与DC马达最大的不同是:DC马达有碳刷而AC马达没有,DC马达的速度回馈方式,是以发电机所发出的电压转换为数位以校正实际转速。
AC马达则用脉波产生器生的脉波校正实际转速。
一般而言AC比DC好,因其转速可以控制得相当的精确,而且AC马达没有碳刷,较不须维护,使用较省事。

另外没有太阳能充电的XLN-289,侧面却有CCFL冷光灯,可以当台灯用于阅读。但是前面的电筒是1颗8LED,亮度不够。

其他手掌大小便宜货

最便宜的有15,加上运费5元。可以当玩具。

后记

感觉我买东西越来越nerd了。或许我需要一个类似 http://www.podcatchermatrix.org/ 这样的矩阵比较工具。

Posted

archive

hacker koan

Enlightenment

This koan is attributed to Tom Knight, one of the primary developers of the Lisp machine at MIT:

A novice was trying to fix a broken Lisp machine by turning the power off and on.
Knight, seeing what the student was doing, spoke sternly: "You cannot fix a machine by just power-cycling it with no understanding of what is going wrong."
Knight turned the machine off and on.
The machine worked.

Linus老大又发飙了(1, 2

关于这位Tom Knight,STM就是他发明的。

Posted

archive

designMode和contentEditable这条贼船

今天在玩Code Mirror 2,读到这条 internal:

CodeMirror 1 was heavily reliant on designMode or contentEditable (depending on the browser). Neither of these are well specified (HTML5 tries to specify their basics), and, more importantly, they tend to be one of the more obscure and buggy areas of browser functionality—CodeMirror, by using this functionality in a non-typical way, was constantly running up against browser bugs. WebKit wouldn't show an empty line at the end of the document, and in some releases would suddenly get unbearably slow. Firefox would show the cursor in the wrong place. Internet Explorer would insist on linkifying everything that looked like a URL or email address, a behaviour that can't be turned off. Some bugs I managed to work around (which was often a frustrating, painful process), others, such as the Firefox cursor placement, I gave up on, and had to tell user after user that they were known problems, but not something I could help.

幸好我没上这条贼船啊。想起了沈大仙在《程序员的 100 种境界》中一句经典的话:

IE 的这个 BUG 只要用 IE 另外的一个 BUG 就可以解决了

现在做HTML的rich WYSIWYG editor一般就这么几条路:

  1. iframe
  2. textarea
  3. div contentEditable
  4. place a micro textarea at cursor

Google Docs(此link目前挂了)也用了一个和4比较类似的YD技巧。

Posted

archive