昨天,今天,明天,每天的每天,你是否都多懂得一点点...

星期六, 十一月 02, 2013

有没有无色的偏光镜


有人说有

我觉得没有

我认为偏光镜一定会有灰色, 因为偏光镜不是靠颜色滤光的

偏光镜利用光的偏振原理滤光

所以偏光镜本身应该是透明的, 但是因为它把光滤掉了, 所以人眼看, 它就是灰色的墨镜.

所以偏光镜不可能是全透明的, 全透明的说明它没有滤掉任何光线. 那它还是偏光镜吗?

但偏光镜可以有很淡的颜色, 说明它滤掉的光线有限, 可以看到淡淡的偏光测试图, 那也说明了它的偏光效果不怎么样.

而偏光镜并不一定是灰色的, 说明有些偏光镜还是加了有色膜的.

我在想, 国际象棋的棋盘多加一些格子, 远远的看, 会不会就是灰色的?

--
Feng

星期五, 十月 25, 2013

Install commandT for macvim



1. download commandT vimball file
2. open vimball and run so %
3. move the extracted file to bundle folder if needed
4. run CommandT in vim, doesn't work, saying cannot find c extension
5. run ruby extconf.rb under vimfiles/bundle/commandT/ruby
6. failed, and saying cannot find ruby header files
7. install xcode commandline tool
8. restart (may not needed)
9. do step5
10. all good, run make
11. do 4, all good.

--
Feng

星期四, 九月 12, 2013

Fiddler https proxy for iphone/android

死活不行, 什么都做了

用了fiddler 的 证书生成器

也在设备上安装了证书

HTTP 可以, HTTPS 就是过不来

上次试过, 这次要用, 还是不行

试了无数次, 证书装了又装。。。。

最后发现, 换了个端口就可以了, 法克。

原来用的是 80 端口, 换成 8888, 搞定。。。


于是, 还是听80端口

用命令 !listen 8888, 多听一个端口, 搞定。

--
Feng

星期二, 九月 10, 2013

ipad wifi 版 无连接 也能定位

这个现象我无法解释。

在加拿大坐公车, 看ipad 地图的时候, 发现居然能定位。

公车走, 它也走。。。。厉害

我无法解释这个现象。

因为我的WIFI版 IPAD 没有3G模块, 也没有GPS 模块。 它不应该可以定位。

有WIFI 连接的情况下, 可以定位是可以理解的, 因为可以通过 WIFI AP 的MAC 地址通过服务器返回大概的位置。

但我没有连接WIFI, 虽然可以拿到MAC 地址, 但没有网络, 自然无法查到这个AP的地址。 而且我看过, 我的IPAD 没有探测到任何 WIFI热点。

难道IPAD里存着全球的 MAC 地址的位置? 或者就缓存了温哥华的MAC 地址的数据? 而且WIFI其实探测到了热点却因为某些原因(如信号太弱)而没有显示?

我依然不解,不解。

--
Feng

星期二, 八月 20, 2013

加拿大签证怎么还没到呀。。。

网签一天就下来了

可是护照寄过去后就没消息了。。。

估计我没在收件人那栏写上 EAPP 有影响。。。。急死我了。。。

--
Feng

星期三, 八月 14, 2013

Vim clang_complete for object c

It's easier than I expected.

You don't need to download clang

You only need clang_complete plugin

then set

let g:clang_library_path="/Developer/usr/clang-ide/lib/"

in vim

the clang library has been installed by xcode.

hit ctrl+x ctrl+u to force auto complete

--
Feng

星期六, 八月 10, 2013

IntelliJ IDEA 注册机算的号居然通用MAC WINDOWS

今天想试下 intelliJ

于是下了个来看看

用了WINDOWS的注册机, 注册了WINDOWS版

然后下载了MAC 版, 用同一个注册机注册的号居然可以用...

看来注册码不关联机子, 可关联名字.

但后来发现同一个注册码只能在同一台机子上使用. 看来 intelliJ 的服务器还是知道谁在用的.

然后便用同样的名字, 又生成一个注册码, 工作.

--
Feng

星期五, 八月 02, 2013

How to undo an amend commit

git reflog is useful

# Move the current head so that it's pointing at the old commit # Leave the index intact for redoing the commit git reset --soft HEAD@{1} # commit the current tree using the commit details of the previous # HEAD commit. (Note that HEAD@{1} is pointing somewhere different from the # previous command. It's now pointing at the erroneously amended commit.) git commit -C HEAD@{1}

ref: http://stackoverflow.com/questions/1459150/how-to-undo-git-commit-amend-done-instead-of-git-commit

--
Feng

找回 git amend 误删的文件

因为 checkout master 的时候没耐心, cancel 了

第二天来看的时候, 看到一堆checkout 到一半的文件, 于是reset了一些。 看到三个被删除的文件 。 以为是之前删除了没有 commit, 于是 amend 了。

之后才发现, 这三个文件不是我忘了commit的。 耐是因为 master branch 没有这三个文件,在 checkout master 的时候被删的。。。。

惊。。。 惊得我一身冷汗。。。。

因为在LOG 里面看不到我之前的 commit 了。。。。不知道怎么找回来, 搜索了许久。。。终于找到如下此文
git reflog

可以显示出

...
86e3649 HEAD@{7}: commit (amend): Add Amount keypad Gui
7a0dc86 HEAD@{8}: commit: Add Amount keypad Gui
...

那个 7a0d...就是我要的commit了。

git checkout 7a0dc86

回来了。。。耶!!!!

--
Feng

星期四, 七月 18, 2013

胆固醇降了

半年前被护士警告胆固醇高。 于是发奋降胆固醇,也顺便减肥。

减肥不算很成功,胆也是成功的,至少轻了10公斤。 BMI值也到绿色范围。 虽然和黄色很近。

降胆固醇也不算很成功, 但也是成功的。 不过这个自己称不出来。 刚才打了电话问了一下上周的血检结果, 是4.5. 问了下半年前的结果, 是6。 5 以下是正常, 所以也是在危险边缘。

护士没跟我讲单位,所以上网查了一下,是这么个单位

mmol/L

反正也是看不懂, mol 是什么东西呀。。。

不管怎么说,都还算成功吧。 其实体重在减肥三个月后就降到现在这样了。 后来三个月因为冬天来了,锻炼的时间减少, 只能保持不反弹,没法往下减了。 估计胆固醇也是在那个时候不再减了。

所以得意的认为, 我是三个月把胆固醇从6 降到4.5的, 不知道这样算不算快。

--
Feng

星期一, 七月 15, 2013

微波炉并不是完全不能放金属

有过几次把镀了金属的容器放在微波炉里, 产生电火花和电流声, 恐怖。

小学的时候家里就买了微波炉, 爸爸告诉过我里面不能放金属容器。 于是便记下了,但是微波炉自带的那个烧烤架却从来都是用来架盘子的。 从来没有想过它也是金属, 怎么就可以放进去。

今天上网查了一下, 说是网状的金属因为表面积小的原因, 是不会有事的。 但是千万不要让它碰到金属炉壁。 隐约记得家里的微波炉是塑料炉壁的, 所以有惊无险这么多年。

还有就是金属会反射微波, 如果金属容器把食物遮住了,食物就不会热了。 而微波粮蒸蛋器就是利用这个原理, 屏蔽微波, 只加热水来蒸蛋。

好像还在商店里见过某容器, 金属的,写明可以放在微波炉,但好像有几个注意事项。 没有认真看, 所以也不记得了。

--
Feng

不粘锅与老年痴呆

最近才知道大多数不粘锅都是铝身的,轻,导热好。 不过因为有涂层的关系,食物并不会与铝接触。

于是我便担心起涂层脱落的问题来。 便开始寻找不粘锅涂层脱落后的危害。 或者说既使不脱落,是不是也会溶入铝无素。

但是我发现,有一个问题要先解决。就是铝到底是不是老年痴呆的祸首。如果不是,我上面的调查就毫无意义。

而我发现, 我初中时被告知的油条中含铝会导至老年痴呆是存在争议的。 于是便自己再找了点资料证明一下。

资料是在 google scholar 随便找的。 但是是今年的,而且是正儿八经的出版物, 有详细的文献参考, 对我来说,这足够可信。

文章中提到, 铝是无罪的。 这让我大释其怀, 不再担心铁铲把锅铲坏了。 因为坏了可以再买。




    Aluminium in health and food: a gradual global approach
    Florence Hachez-Leroy
    European Review of History: Revue europeenne d'histoire
    Vol. 20, Iss. 2, 2013




--
Feng

星期三, 五月 29, 2013

use ssh key to access gitbucket

No very sure

Seems just need to put the private key under

c:\Users\ydeng\.ssh

How to generate key pairs:

run ssh-keygen then press enter all the way

ssh-keygen may come with msysgit

or use putty instead.


--
Feng

星期六, 五月 11, 2013

Well-known or well known

I will say well known is the one we usually need.

"this man is well known"

That means "People know this man well".

"this man is well-known"

"That means "people who know this man, know his is well".

the "well" here is a noun.

That's my understanding. What's your opinion?

--
Feng

星期日, 五月 05, 2013

打印机打印出来右边模糊

写印出来, 左边中间都没问题, 右边有点糊. 

于是又调了一打印头的assigment, 

无效.

打开打印机盖,看到连供的线没卡紧. 有点松了, 在墨盒上高出来一点. 于是压紧. 再试一下, 居然就好了....

原来模糊可以这样....

--
Feng

星期一, 四月 29, 2013

Lc3 Assembly notes

LEA

Load the address (not the value) of a Label

LEA R0,Label1 ; Load the address of Label1

Label:

When you put a label, the label point to a memory address, The Label is pc offset, you can treat it a as memory address.

LD

Load the value from a label (addres)

LD R1, Label1 ; Load the value stored in Label1 address to R1

ST R2, Label1 ; Store the value of R1 into the address Label1

LDR

Load the value from a address, and the address is from a Register

LDR R1,R2,#0, Load the value from the memory where the R2's value pointing to

LD can be rewrite with LDR

For example

LD R1, Label1

=

LEA R2, Label1 ;store Label1's address to R2
LDR R1, R2, #0 ; Load Label1's value

ST and STR is similar to LD, and LDR


JSR is use to call function
Need to save and restore R7 to a label, then RET can work.

BRnzp ; Branch if last accessed register is negative, zero or positive (uncondition)
BRz ; Branch if last accessed register is zero.
BRzp ; Branch if last accessed register is zero or positive

for example
BRp Label2


.FILL

Assign a address to Label, reverse the address to this label, and initial the value

NINE .FILL #57

Allocate a memory address to NINE, and fill that address with the value 57

ZERO. FILL x0000


NAME    .STRINGZ "hello"

Allocate a address to NAME, and fill the memory with h e l l o , chars.

ARR .BLKW 20 ; assign a address to ARR, and reserve the following 20 address for it.












--
Feng

星期五, 四月 26, 2013

htc one x 解锁后无中文

解锁后没有了中文

搜了一下说是要安装区域软件

或者刷别的ROM

。。。

只是想拿ROOT, 懒得刷ROM。。。。

看看中文能不能正常显示, 正常输入,能就不折腾了。

--
Feng

第一次root android

机子是 htc one x, android 4.1.1, sense 4+

用的是公司的电脑,因为sdk 已经有了。 家里用mac, 连htc 驱动都没有。
用了一键root 工具,失败

failed to copy 'busybox' to '/data/local/busybox': Permission denied

根本就不能成功复制文件

后来就跟着这个教程做了

http://bbs.dospy.com/thread-14575412-1-624-1.html

总共三步

1. 解锁就是根着官方教程做了, 过程没啥风险。
2. 刷recovery, 和第一步差不多, 第一步是要下载官方发给你的bin 文件刷, 这步自己下载recover.img 来刷。
3. 用recovery 来刷supersu了, 我用的是英文界面, 论坛提供的是CHS, 刷进去后是英文的。。。

三步都要在 HTBOOT 里面做。 不过我有重启到正常, 因为第三步要把文件复制到SDCARD。



--
Feng

星期二, 四月 23, 2013

Fiddler 引用 C# dll

之前失败, 后来就莫名其妙的好了。 在现在也不知道缘由。

最开始是用.net 4.0 编译--


Script Failure
OK
Failed to load script.
 c:\Users\ydeng\Documents\Fiddler2\Scripts\ForFiddler.dll
System.BadImageFormatException: Could not load file or assembly 'file:///c:\Users\ydeng\Documents\Fiddler2\Scripts\ForFiddler.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
File name: 'file:///c:\Users\ydeng\Documents\Fiddler2\Scripts\ForFiddler.dll'
   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at Microsoft.JScript.VsaReference.Compile(Boolean throwOnFileNotFound)

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll
Running under executable  C:\Program Files (x86)\Fiddler2\Fiddler.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = CHECKFREE\ydeng
LOG: Where-ref bind. Location = c:\Users\ydeng\Documents\Fiddler2\Scripts\ForFiddler.dll
LOG: Appbase = file:///C:/Program Files (x86)/Fiddler2/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\Program Files (x86)\Fiddler2\Fiddler.exe.Config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: The same bind was seen before, and was failed with hr = 0x8013101b.
   at Microsoft.JScript.VsaReference.Compile(Boolean throwOnFileNotFound)
   at Microsoft.JScript.VsaReference.Compile()
   at Microsoft.JScript.Vsa.VsaEngine


出了以上错误, 于是改成 .net 2.0 编译, 还是一样。

于是注意到错误中有 Framework64 这个东西。 觉得奇怪, 32位的程序怎么找 Framework64的东西呢。

于是

在网上找了这样一行命令

"c:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\x64\CorFlags.exe" MyApplication.exe /32bit+

强制将FIDDLER 在32位执行。

于是得到这个错误, 错误变了:

Script Failure
OK
Failed to load script.
 c:\Users\ydeng\Documents\Fiddler2\Scripts\ForFiddler.dll
System.BadImageFormatException: Could not load file or assembly 'ForFiddler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'ForFiddler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at Microsoft.JScript.VsaReference.Compile(Boolean throwOnFileNotFound)

   at Microsoft.JScript.VsaReference.Compile(Boolean throwOnFileNotFound)
   at Microsoft.JScript.VsaReference.Compile()
   at Microsoft.JScript.Vsa.VsaEngine.DoCompile()
   at Microsoft.Vsa.BaseVsaEngine.Compile()
   at Fiddler.FiddlerScript._LoadScript(String sScriptFilename, Boolean bPlaySounds)
   at Fiddler.FiddlerScript.LoadRulesScript(Boolean bPlaySounds)


其实这是更错。 后来把fiddler 关了, 再把备份的fiddler.exe 还原回去。 就突然可以了。

好像原因就是最之前没有.net 2.0 编译。 虽然后来改了过来了, 可是因为某些原因没有生效。

现在不管是用 x86, x64, any cpu 都不出错了。

Feng

星期二, 三月 26, 2013

macbook pro bootcamp 安装 win8

之前在学校的电脑上用BOOTCAMP安装过WIN8, 安装的过程不能说很顺利, 但是好像也没有印象深刻. 

我妹要我给她的MACBOOK PRO 装WIN8, 想想装过. 应该没什么难度,便开始给她装了.

记得就是用 BOOTCAMP 嘛. 于是启动 BOOTCAMP, 有两个选项, 第一个是下载驱动, 第二步是安装. 第一步容易,花点时间下载, 然后存在U盘就搞定. 第二步安装的时候,要分区,我就对半分了.

然后问题就来了,说检测不动安装盘,要我插入安装盘. 好吧,我也忘了之前是怎么弄的安装盘了.于是就去量产了一个.靠,还是认不到. 于是便用ULTRAISO做了个启动盘...也没用...

经过一番搜索, 才明白原来WIN8启动盘是用BOOTCAMP做的.突然就想起来之前在学校的MAC MINI上,的确有这一步的.

于是用我的MACMINI做了个启动盘...

我X,居然还是不认.

再搜索一下, 才他妈的知道MACBOOK PRO因为有光驱,是不认U盘启动盘的.

没办法...刻盘吧

刻成后,终于能安装了. 

电脑重启后,又进MAC, 没进安装界面呀...晕

于是再重启,按住ALT键. 出来好几个选项,一个是MAC, 另一个是WINDOWS(光盘图标),再另一个ELF光盘图标, 再一个是ELFU盘图标(因为之前插的U盘启动盘还插着).于是选了光盘那个图标...死机了

再试一下, 这次选了ELF光盘图标, 行了, 进了安装界面了,酷了...到分区那一步, 说什么不能安装在BOOTCAMP那个分区,不然启动不了...晕了...

再重启,再选WINDOWS光盘图标,好的,这次有点耐性.一直到输完序列号...然后卡了,1%就不动了...

没耐性了, 不搞了...


第二天, 重新刻了盘,这次放3速来刻, 刻完还验证了一下.没问题.

再装,这回没卡了,过了...去做别的事了,回来一看,进MAC了...咋回事呀,从来

装完了...装的时候去洗澡了...回来一看, 进MAC了. 于是重启,按住ALT键. 这回菜单又多出来一个WINDOWS选项(硬盘图标),看来就是它了,新装的WINDOWS. 于是选它,启动...OK了

然后启动WIN8后,触摸板不能轻触点击,找了半天原来在控制面板里有个BOOTCAMP设置可以打开...突然记起是有这么个东西...以前设置别的东西进过...




--
Feng

其它博客地址

此博客的同步博客地址: http://fengnz.wordpress.com
这里进入我的MSN SPACE.