duMobility's Blog

about.me/durul
Recent Tweets @duruldalkanat

cocoaheads:

Wish we could say more.

Command 1~8 to jump through the Navigators, Command 0 to close the navigation area.

Command Alt 1~6 to jump through the Inspectors, Command Alt 0 to close the utility area.

Control Command Alt 1~4 to jump through the Libraries.

Control 1~6 to bring down tabs in the Jump Bar.

Never trust any input!
Validate input from all untrusted sources - use whitelists not blacklists
Plan for security from the start - it’s not something you can bolt on at the end
Keep it simple - complexity increases the likelihood of security holes
Keep your attack surface to a minimum
Make sure you fail securely
Use defence in depth
Adhere to the principle of least privilege
Use threat modelling
Compartmentalize - so your system is not all or nothing
Hiding secrets is hard - and secrets hidden in code won’t stay secret for long
Don’t write your own crypto
Using crypto doesn’t mean you’re secure (attackers will look for a weaker link)
Be aware of buffer overflows and how to protect against them

//
// Original Playground taken from https://gist.github.com/u10int/a178945a451d48d4c961
//
// Extended to include > Bool {
let range: NSRange = NSMakeRange(0, countElements(left))
if right.regex {
let matches: AnyObject[] = right.regex!.matchesInString(left, options: right.matchingOptions, range: range)
return matches.count > 0
}

return false
}

func =~(left: String, right: String) -> Bool {
return left =~ Regex(pattern: right)
}

operator infix > String{
if left =~ right.regex {
let range: NSRange = NSMakeRange(0, countElements(left))
if right.regex.regex {
return right.regex.regex!.stringByReplacingMatchesInString(left, options: right.regex.matchingOptions, range: range, withTemplate: right.template)
}
}
return left
}

func > String{
return left >

Swift supports method overloading.

class Test
{
func test(a : String) -> NSString {
return a;
}
func test(a : UInt) -> NSString {
return “{\(a)}”
}
}

Test().test(“Foo”) // “Foo”
Test().test(123) // “{123}”

println(Test().test(“Foo”))
println(Test().test(123))

pavanladkani:

Brilliant graphic design…

(via fabforgottennobility)

keepcalmandprogram:


This animated gif is wowzy.

keepcalmandprogram:

This animated gif is wowzy.

(via italkapple)

When designing responsive websites it pays to know the various resolutions so you can create proper breakpoints in your design.

Apple

Apple Ipad 2 – 1024 x 768 at at 132 ppi with a 9.7 inch display
Apple Ipad with Retina display – 2048-x 1536 at 264 ppi with 9.7 inch display
Apple Mini – 1024 x 768 at 153 ppi with a 7.9 inch display
Apple IPod – 1136 x 640 at 326 ppi
Apple IPod -4th generation – 960 x 640 at 320ppi
Apple Ipod Touch – 1136 x 640 at 326 ppi
Apple IPhone 4 and 4S – 960 x 640 at 326 ppi with a 3.5″ display
Apple IPhone 5 – 1136 x 640 at 326 ppi with a 4″ display

Amazon Kindle

Kindle Fire (1st gen) 1024 x 600 with 7″ display
Kindle Fire (2nd gen) 1024 x 600 with 7″ display
Kindle Fire HD 7″ – 1280 x 800 with 7″ display
Kindle Fire 8.9 – 1920 x 1200 with 8.9″ display

Android Phones

Samsung Galaxy II – 800 x 480 at 218 ppi
Samsung Galaxy III – 1280 x 720 at 306 ppi
Blackberry 10 – 1280 x 768
Blackberry Z10 – 1280 x 768

Android Tablets

Samsung Galaxy Tab 10 – 1280 x 800 – 10″ display
Samsung Galaxy Tab 7 and 7 Plus – 1024 x 600 – 7″ display
Acer Iconia Tab A500 – 1280 x 800 – 10″ display

The most commonly used response codes are:

Code 200: The request has succeeded.
Code 301: The resource has moved permanently.
Code 400: Bad request.
Code 401: Unauthorized.
Code 403: Forbidden.
Code 404: Not found.
Code 408: Request timed out.
Code 5xx: All codes starting with 5 indicate a server error.”

MacBook’unuzu kapatın
Güç adaptörünü pirize ve MacBook’unuza bağlayın
Klavyede sol tarafta bulunan Shift - Control - Alt (Option) ve kapama açma tuşuna aynı anda basın
Tüm tuşları aynı anda bırakın
MacBook’unuzu açma kapa tuşuna basarak tekrar açın

littlebigdetails:

Apple - The Chinese version of the introduction video of iOS 7 replaces the Twitter and Facebook icon with Weibo (Sina & Tencent).

Sample Script to automate documentation creation using a run script in Xcode. appledoc can be integrated with Xcode in many ways. Below is one of those ways to get you up and running quickly on Xcode 4.6

1.Select top of your project in Project Navigator
2.Click Add Target
3.Depending on your project type (iOS or OS X) choose Aggregate Template
4.Create new target. I suggest to call it Documentation
5.Click on Build Phases and add new Build Phase based on Script
6.Paste the script below into the script window
7.Adjust variables in section “Start Constants” as required
8.Uncomment correct ‘target’ for your project and comment out another one depending on your project type.
9.Adjust path to appledoc binary and appledoc’s command-line switches if required
10.When you ready to generate a docset from your project, build Documentation target.
11.Docset will be installed into new loction and will become available to Xcode immediately.
12.To refresh Quick Help (ALT+Click) and (ALT+double-click) you may need to restart Xcode to refresh its index cache.

The iconutil command-line tool converts iconset folders to deployment-ready, high-resolution icns files. (You can find complete documentation for this tool by entering man iconutil in Terminal.) Using this tool also compresses the resulting icns file, so there is no need for you to perform additional compression.

To convert a set of icons to an icns file

Enter this command into the Terminal window:

iconutil -c icns

where is the path to the folder containing the set of icons you want to convert to icns. The output is written to the same location as the iconset file, unless you specify an output file as shown:

iconutil -c icns -o

In other words, you need to replace by the path:

/Users/myname/SDK Mac Apps/MyApp/grafica/icon.iconset
Since the path contains spaces, you need to use double quotes, for example:

iconutil -c icns “/Users/myname/SDK Mac Apps/MyApp/grafica/icon.iconset”

My preferred way to view unicode characters is using the Mac Character Viewer.

- Go to System Preferences/Keyboard
- Tick the checkbox ‘Show Keyboard and Character Viewers in menu bar‘
- From the menu bar select Show Character Viewer
- When you find a symbol and right click to Copy Character Info