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

星期日, 五月 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

星期四, 三月 14, 2013

体重就像公里速

爷的体重就像公里速一样,60就是顶,超过60就要被开罚单。55最安全,低于55要小心了, 低于50,就挡住后面的车了。 爷吃东西就得跟开车一样小心翼翼。人阿。。。。

--
Feng

星期二, 一月 29, 2013

N8 连接USB键盘

本来想用N8来读ONDA阅读器里的东西的。  

鬼使神差的, 我把无线键盘的USB接收器插上去了。 N8就成功连上键盘了。 可以打字。 

用的是百度输入法,可以用拼音打出中文 。 设成五笔后, 用键盘还是打出拼音来。 

理论上来说,也支持 USB 有线键盘。

用的就是N8 的USB 口, 因为支持OTG, 可以直接读U盘。 没想还可以连键盘。

--
Feng

星期六, 一月 19, 2013

Fwd: 在安卓虚拟机上安装华为网盘



为了升级华为网盘的空间, 又没有安卓机. 至少家里没有, 又不想等到星期一去公司. 

于是开了虚拟机. 

先是建了一个1.5 版的 avd, 从虚拟机的浏览器里下载华为网盘成功. 安装失败. 

又试了 4.xx 版的虚拟机, 一样失败. 

于是在电脑里下载. 用adb install 安装, 成功...

居然要用 adb 来安装, 没天理.

--
Feng



--
Feng

星期四, 一月 17, 2013

关于减肥

上次生病去看医生,医生让我去验了血。 然后护士就寄了封信告诉我胆固醇太高, 需要控制饮食。 主要就是不能吃肥肉,鸡皮之内的。 还嘱咐我一周要吃两次鱼。

好吧。。。整天说自己老了,还真他妈老了, 老人病都出来了。

于是, 便有了减肥的念头。 反正要控制饮食了, 于是便再狠一点, 干脆一起减肥吧。

要降胆固醇, 主要在于减少胞和脂肪的摄取。 就是不能吃动物油(肥肉),不能吃油炸品(棕榈油), 少吃含胆固醇高的食品。

要减肥的话, 要求也就高一点点,主要是控制卡路里的摄取, 那就是糖不能多吃,饭不能多吃, 就是说, 吃个八分胞就好了。 还要做一些运动。

其实大多数东西都还是可以吃,控制的,其实是量。

现在每天的目标是摄入的热量少于 1500卡。 胞和脂肪当然是越少越好,一天都不要超过18克。 这些都是一个叫 myfitnesspal 的 ipad 软件计算出来的。 我就是跟着作就是了。

才开始控制饮食不到两周。 体重好像没有什么变化。 但是我已经享受到两个好处。

1. 我从前每次吃完午饭和晚饭, 都觉得头重脚轻, 头痛欲裂, 急需睡眠。 还以为是得了地中海贫血。 一直想去问问医生。 但自从控制饮食以后, 这个问题减轻很多, 甚至已经消失不见。
 
2. 以前每天总是要上好几次大号, 3到4次吧。。。多的时候5次以上都有。。。一直以为是连医生都搞不定的胃肠病。 现在一天明显少了, 只有1到2次。 才发现跟本就是以前吃太多, 全身气血都集中去胃部进行消化工作了。 难怪要头重脚轻了。 难怪了上好几次大号了。。。

其它好处还没见着。 现在饿的时候还是不好受的。 不过基本也不会太饿,因为吃的是易饱腹的食物, 下午4点左右开始饿。 晚饭要6点以后才有着落。中间就是靠吃坚果,水果。 总体来说,还算好过。 不会想节食减肥那么痛苦。继续坚持, 说不定可以受回60公斤,和刚出国的时候差不多。

--
Feng

星期日, 一月 13, 2013

mp240 无边距打印

原以为这款便宜的打印机不支持 ($39..或是$49买的)

今天用5800直接用 pictbridge 直接打印了一张IPAD的截图. 居然是无边距的....

于是打开电脑研究. 

发现有一个border less printing 的选项. 里面有个 Amount of Extension 的滑动条, 但是灰的, 不能用.

另外一个 margin 的选项, 已经是 0mm. 

后来我终于发现, 选纸张的时候, 要选  A4(borderlss). 然后以上选项就可以用了... 搞半天居然是在选纸张里面. 

用 textedit 还是打不出无边距. 

用photoshop 建了一张和A4 一样大的图片, 纸纸选  A4 borderless, 其它全部用默认设置. 点打印, PS会给个WARNING, 没细看. 无非就是说图片超出打印范围啥的, 直接点继续. 无边距成功. 

--
Feng

星期四, 一月 03, 2013

橄榄果渣油

老婆说橄榄油只能凉拌不能抄菜, 于是现在已经不吃了,而是吃大豆,花生,芝麻混合的调合油.

想着吃橄榄油更健康的我只能研究研究.

研究结果非常悲哀....因为没能研究出来...

在大部分能找到的中文资料里, 都有说过橄榄油的等级, 但跟本没有说明不同等级的优缺点和不同. 对选购橄榄油不能给予足够的帮助.

从现在我掌握的资料来说, 初榨橄榄油烟点较低, 橄榄果渣油(英文 olive pomace oil) 烟点较高. 而初榨橄榄油不适合抄菜等温度比较高烹调手段; 凉拌才是比较好的选择. 橄榄果渣油则更适合抄菜, 甚至煎炸. 

好像问题解决了, 抄菜就用果渣油呗. 但问题不在这里, 果渣油和初榨油一样健康吗? 我没有找到相关的资料. 如果不是一样健康的话,我又何必吃橄榄油. 


从我找到的资料来看, 橄榄油之所以健康, 其中的不饱和脂肪酸起着很重要的作用. 而初榨橄榄油经不起高温的原因也在这里. 高温会把不饱和脂肪酸转变成反式脂肪酸从而对人体有害. 

那果渣油不会有这个问题吗? 所有我找到的资料都没有提到. 只是说精炼过的油烟点高. 我想知道, 是不是因为精炼的橄榄油所含的不饱和脂肪酸很少所以不怕高温? 或是因为精炼过的橄榄油里的不饱和脂肪酸被保护起来了, 不容易生成反式脂肪酸? 我希望是第二个原因, 这样, 果渣油至少还是健康有效的.

在维基百科的英文olive pomace oil 词条中提到, 化学成份来说, 初榨油和果渣油是一样的, 健康上来说了是一样的. 但这句话被打上了[dubious – discuss]标志, 说明很多人不同意这个看法.

所以, 我到现在也是搞不清楚, 是不是应该用橄榄油抄菜...那就用花生油或大豆油吧...


--
Feng

星期四, 十二月 20, 2012

成功安装了山狮


成功安装了山狮. 安装好后, 除了DOCK上多了个NOTES和PARALELL 因为不兼容被移除了, 其它什么改变也没发现. 当然,开机速度慢了点可能是因为安装好后第一次启动.


安装的过程很简单, 虽然有个漫长.. 本来以为要搞序列号什么的太麻烦,所以一直没有升级. 也不想为了一些自己从来不用的功能去买正版. 所以迟迟没有动手. 看了网上的一些文章, 以为要用U盘做个启动盘. 于是便从115 下载了镜像. 做成了U盘启动盘. 这时才发现, 其实直接运行安装程序就可以安装, 根本不需要做成启动盘. 就像安装其它软件一样.


由于8G的U盘做成启动盘后不能再装上DMG的镜像文件. 于是我便没有把DMG文件带回家. 回家后直接在U盘里运行安装程序. 环境是LION. 我没有用U盘启动, 而是直接在LION里安装.


安装过程只有十几分钟. 然后重启了. 我以为这便结束了, 还在惊讶速度如此之快. 我又想试试U盘启动会是什么样的. 于是在重启后, 按住了OPTION 键. 奇怪的事情发生了, 电脑直接进入了安装界面. 连选项也没有…我晕死. 我想我刚才已经用升级安装了, 这下用U盘全新安装就惨了, 怎么它问也不问就往电脑上装???


我有点慌了, 于是按电源键待机, 拨下U盘. 再按电源键回来,我期待它安装出错. 可是它还是在继续安装. 我只好再待机,拨电源, 重启. 可是古怪的事情发生了, 电脑又回到安装界面, 这回我没有插U盘,也没有按OPTION键呀. 于是我反应过来, 其实是之前的安装还没有完. 在LION里面的安装只是把安装程序移到了硬盘上准备好了安装. 重启后才是真正的进入安装界面. 这里值得一提的是, 那个进度条一直在走, 但是右下角却永远显示 examing available disks… 非常的confusing. 还有一件事是, 安装到95%的时候, 居然又退到80%….晕


不过其实就是等待而已, 等了估计有一小时, 终于安装完成. 进了登入界面. 然后就是我在这个NOTES里面写这篇博客. NOTES这个应用原来是集成在MAIL里的, 现在独立出来确实方便了一些.


感想就是, 这个mountain lion 也太好盗版了吧? 啥破解也不要, 只要你能下载到安装镜像, 你就能安装. 估计是因为只能安装在苹果电脑上, 所以苹果公司就网开一面吧. 不过好像又安静下来了.


--
Feng

星期日, 十二月 02, 2012

HP FHA 3410 mouse stop working

Well, it became lag then just stopped working after few days of using.

I tried everything.

And I found that quite a few people got this issue and there was not solution for it. 

I fixed it by playing the connect buttons. 

I didn't really use the connect buttons on the receiver and mouse before because the mouse just worked after plugin in.

But it was the only thing I had not tried. I plugged in the receiver. Then I pressed the button on it, and then I pressed the connect button on the mouse. I repeated doing this for a few times. And suddenly, I noticed that the mouse was working again.

--
Feng

星期四, 十一月 29, 2012

pdftotext for mac os

It's not easy to find a command line pdf to text file for mac os. I found one on softpedia called pdftotext which is working well.

--
Feng

星期三, 十一月 21, 2012

HP we788aa wireless mouse driver

There is not driver came along with this product.

It works well with mac os.

I plug the receiver into the mac mini with mac os lion installed. It worked immediately without any delay.

Then I tried win7 32bit in the VM. It searched online for driver and took a while to install the driver. But it worked without any problem.

Then I brought the mouse to company and tried to use it on my company computer with win7 64bit installed. It didn't work because not driver can be found on windows update.

I tried to find hp official driver and failed. There isn't one.

Then I realize that this mouse is using Microsoft standard driver. The only problem is the win7 64 bit doesn't know it's a mouse.

Then I updated the driver from device manager. When it asked me to select the driver location, I choose to select device. I set it as a mouse. Then the standard driver was installed. And the mouse worked like a charm.

--
Feng

星期五, 十一月 09, 2012

-webkit-appearance

input field 里面奇怪的有一条横, 细看的话,说是上边框的阴影效果

-box-shadow 和 border 试也试去也没用,

后来发现是由 -webkit-appearance:textarea 引起的

把 -webkit-appearance 改成 none 解决。

--
Feng

星期四, 十一月 08, 2012

Vim 重新排版中文

设定 textwidth 后, 用 gq 命令可以把很长的段落重新排版成textwidth 设定的行宽。 但是对中文无效。

要想对中文有效, 只需设定一下 formatoptions 就可以

set fo+=m

然后 gq 就对中文有效了。 其实双字节文字也一样。

--
Feng

佳能 mp240 墨盒

在grabone 看到卖墨盒的, 要53刀。。。免费送货

想想, 当年买佳能mp240, 只要39刀, 加上运费才50刀。。。还送两个墨盒。。。。

这单单两个墨盒就要53刀。。。。更坚定了我一旦墨盒坏了,马上换一台打印机的想法

让那坑爹的卖墨盒的去坑吧,我是坚决不买

53其实还算便宜的了, 去店里买,两个要70多刀。

想当初入连供是多么正常的选择呀。。。虽然连供墨水没那么炫丽。 但对我来说无妨了。

如果没有连供的话,现在两个墨盒已经打完了,我其实啥也没打呀。。。一本书都没打过。。。就打过几个纸模。。。

好像大部分的墨水都浪费在清洗上了。。。汗。。。

不过,连供的瓶子里墨水还是满满的看不出动静。

PG512 Black + CL513 Colour -2 cartridges - $53
For : MP240, MP250, MP270, MP272, MP280, MP282, MP480, MP490, MP492, MP495 Multifunction Printers , MX320, MX330, MX340, MX350, MX360, MX410, MX420 multifunction printers and iP2700 Printer

--
Feng

星期日, 十一月 04, 2012

Canon Mp240 打印头 对齐

用打印机打出来的黑字, 发现有阴影...我可没加阴影效果呀...

看了看维护代码, 发现有 u L U 可以用来调节打印头的对齐. 不知道怎么用, 于是翻了下用户手册.

先用L打出现在的值, 果然, EF两个黑色有明显白条纹. 

用 u打出对齐表格, 然后像高考填答题卡一样, 把最顺眼的涂上黑圈. 然后放入打印机的扫描件. 这时维护代码显示U, 如果不是, 调成U.

然后, 点black 键开始扫描. 几秒钟后完成. 再用L打出现在的值. 现在的值就是刚才用笔填成黑圈的. E现在为-1, F为-4. 原来的时候全部是默认值0. 

现在基本看不到白条纹. 再打一下原来那张有阴影的文字, 对比一下, 阴影已经不见. 大功告成. 简单. 

此方法不需要连电脑. 连电脑的话,应该有更高级的设定. 

--
Feng

其它博客地址

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