You can get the maximum value in an NSSet full of NSNumbers using Key-Value-Coding like so:
NSSet *set = [NSSet setWithArray:@[ @1,@2,@3,@4,@5 ]]; NSNumber *maxValue = [set valueForKeyPath:@"@max.self"];Value of
maxValueis now@5.It took me ages to find the correct KVC syntax for this. Source is linked below, and has a bunch of other cool uses of KVC.
(This was prompted by a recent question on StackOverflow.)
Key-value coding is one of my more favorite things about Cocoa (up there with
NSPredicate). Basically, it allows you to access properties of objects by name (ie, as a string) rather than invoking a method (er… sending a message)…
About Parse
Parse.com has been out of beta for a few weeks now, and I have been using this service for a few months, while they were still polishing the tool - and the API. I do regard this kind of service as the next step in app evolution: for the example that is interesting us today, if…
Objective-C literals: one can now create literals for NSArray, NSDictionary, and NSNumber (just like one can create literals for NSString)
NSArray Literals
Previously:
array = [NSArray arrayWithObjects:a, b, c, nil];Now:
array = @[ a, b, c ];NSDictionary Literals
Previously:
...
9 reasons you must install Sublime Text 2. Code like a man, man.
Hello, fellow code monkeys.
Look at your editor. Now back at mine. Now back at yours. Now back to mine. Sadly your editor is not like mine. But if you stopped using noob-scented editor, and switched to Sublime Text 2, your editor could look like mine.
Look down. Back up. Where are you?
You are on a desk with the editor your editor could look like.
What’s in your hand? Back at me. I have it! It’s a package control with several handy plugins that you would love. Look again. The plugins are now diamonds. Anything is possible when your editor looks like Sublime Text 2 and not Eclipse.
I’m on a horse.
关于《Rails Is Not For Beginners》,我有话要说
阅读此文前,请先阅读我之前写的《Rails Is Not For Beginners》,当然最好也把文章里的那些链接也点一遍,把评论啥的也看一遍。
我非常同意 DHH 的观点,learnability(易学性) 和 usability(可用性) 是个两难的问题,Rails 优先考虑 usability 是完全正确的,至于 learnability 我个人觉得 rails 已经做得很不错了。
拿 Sinatra 和 Rails 比其实是件蛮搞笑的事情,相对 Rails 来说,Sinatra 充其量就是一个高级一点的玩具,拿来写个 Demo 有时都可能不够用,稍微复杂一点,就办不到了,或需要付出相当的时间和精力去搞定(当然有些场合 Sinatra 会比 Rails 更适合,这好像是废话 :))。
针对国内环境,针对「Rails Is Not For Beginners」这个话题,我倒想展开来说几句。
Gow (Gnu On Windows) is the lightweight alternative to Cygwin. It uses a convenient “Windows installer” that installs about 130 extremely useful open source UNIX applications compiled as native win32 binaries. It is designed to be as small as possible, about 10 MB, as opposed to Cygwin which can run well over 100 MB depending upon options.
(Source: onethingwell)
Make handy Growl notes straight from Quicksilver
Quicksilver has built-in notifications that can be displayed for newly installed plugins, iTunes track changes, and Remember The Milk Tasks. Growl can be used as the medium for Quicksilver’s notifications if the Growl Notifier plugin…
(Source: lovequicksilver)
Fixes up Triggers, puts advanced features on the mantelpiece, and drops ß62 off at the recycle centre
Users are appreciating the auto updates of Quicksilver and its plugins introduced recently. Unfortunately, a nasty bug in ß61 meant app updates failed to stick, leaving users with the false…
(Source: lovequicksilver)
[NSString stringWithFormat:@“哈囉, %@.”, yourName]
不知道你是否有注意到,台灣設計的 app 跟美國與歐洲的在製作水準上有很大的差距;若是單論功能或技術,並不會差太多,真正的差距其實是在觀念上。
對於這些觀念上的差距,我有一些想法與建議。
「設計」和「介面設計」的關係
設計與介面設計是不一樣的。
設計對我而言相當廣泛,從一開始的點子、功能規劃、獲利方式、使用流程到最後的外觀與使用經驗,全都是設計的一部分,有一句話可以總結這個概念:
“Design is how it works.” — 師父
…
ruby 是一门编程语言,ruby on rails 是 ruby 的一个 web 框架,简称 rails。
有很多人对 rails 感兴趣,但又不知道从何下手、学习路线是什么,因为在多个场合下回答过类似问题,所以决定整理成文章供大家参观。
有很多人选择直接学习 rails,在学习使用 rails 的过程中学习 ruby。但我觉得这有些本末倒置,我更推崇先学 ruby 再学 rails,在对 ruby 有了一定的了解后再学 rails 有事半功倍的效果,同时也不会那么有挫败感。
另外,不管你之前是否有过其它编程语言(如 java、php 等)的经验,都可以直接学 ruby 编程语言。

