Problem again. Assembly generated by clang or written manually, using integrated assembler or not

Simply, clang has an option ‘–no-integrated-as’ so that the compiler invokes apple’s standalone ‘as’ assembler instead of using clang’s built-in. But, either has its own lost pieces. Without ‘–no-integrated-as’, clang would use its internal assembler. Unfortunately it doesn’t recognize the mnemonic ‘ldmltfd’ With ‘–no-integrated-as’, apple’s ‘as’ assembler reports an error in pesudo instruction ‘.ios_version_min’, which was apparently…

Some tricks in passing file descriptors through unix domain socket

Passing file descriptors through unix domain socket is well-known. But there still have some tricks in implementation. I spent one day to deal with it in Mac OS X by digging into xnu source. How to pass multiple file descriptors in one sendmsg() call? Simple. Put all file descriptors one by one after struct cmsghdr.…

curl certificate issue

Mac OS X El Capitan, MacPorts, it goes well for so long. And one day, git complains: curl: (77) error setting certificate verify locations: CAfile: /opt/local/share/curl/curl-ca-bundle.crt CApath: none Easy, update git config system to use ca-bundle.crt found by searching. [http] sslcainfo = /opt/local/share/apps/kssl/ca-bundle.crt Problem sovled. But, curl itself still complains: curl –cacert /opt/local/share/apps/kssl/ca-bundle.crt … Problem…

Auto Layout UITableView cell resizing with multi-line UILabel issue in iOS7

There are many blogs and articles talked about this issue and resolution on Internet. But any of them has this or that problems in those solutions. So I took several hours on researches and got a perfect result, at least I think so. 🙂 Thought about device orientation change, table width and cell width will change.…

国内网盘的 API 服务粗览

因为要写一个从云端读取文件的程序, 首先想到的自然就是目前各家火爆的网盘服务了. 于是今天就花了点时间, 逐个看了一下. 当然, 因为是要写程序嘛, 所以网盘是否提供 API 当然就是重点了. 除了 API 之外, 也要能方便地从浏览器访问, 这样程序才有东西可以读, 对吧. 1. 百度云网盘 原来是有开放 API 的, 叫 PCSAPI (个人云服务), 但是现在已经不支持了. 新的移动接入方式在内测中, 只支持 Android, 并且需要申请. 申请表格中需要填写申请者详细信息以及应用本身的信息和下载方式. 申请之后需要审核, 也不知道要审核多久会不会有回应. 另外, 作为一个需要从云端下载文件的应用, 在你云端都还没有让我访问之前, 我怎么可能有应用存在并供你下载? 另外, 这个 android 的 SDK 还需要你在手机上安装了百度云的 app 才能工作. 2. 360 网盘 不支持 API. 3. 微盘 微盘有公开 API 支持, 开发者简单创建应用后即可使用. 很好.…

Odd behavior in Windows Service status reporting from recent Windows 2008 R2

I have a Windows service program written many year ago and the user asked me to fix an issue that occurs recently in Windows 2008 R2. Indeed it is not a big problem but quite annoying. When the user stops the service, Windows always popup a window showing an error message like “Windows could not stop…

Object subscripting in objc

Object scripting what use something other than an integer inside []. For example, dictionary[@”key”] = @”value” And in generated machine code, it is a call to selector -(id) objectForKeyedSubscripting:(id)key An informal protocol named __ARCLiteKeyedSubscripting__ was defined @protocol __ARCLiteKeyedSubscripting__ – (void)setObject:(id)arg1 forKeyedSubscript:(id)arg2; – (id)objectForKeyedSubscript:(id)arg1; @end Built-in types like NSDictionary already implemented this protocol, which is indeed generated by compiler. For…

Some license checkpoints in Reveal app.

[IBAAppDelegate applicationDidFinishLaunching:] would call [IBAAppDelegate verifyCodeSignature] to verify code signature of the app to prevent itself from modifications. [IBATrialModeReminderPresenter shouldShowTrailModeSheet] controls whether trial mode sheet, including quit after trial period expired, would be shown. [IBAMainWindowController configureTitleBarAccesoryView] will create IBATrialModeReminderTitleBarAccessoryView to shown trial information on window’s title bar. That’s all.

Make IB designed view work with iCarousel

Oddly, View designed in IB would have FlexibleWidth+FlexibleHeight set in it autoresizingMask, even if you cleared everything in auto resizing box, regardless using AutoLayout or not. The behavior causes that subviews inside item view have wrong positions after transform3D with rotations. In short, item view’s width/height in subviews position/constraints calculation would be calculated as rotated…