Movatterモバイル変換


[0]ホーム

URL:


mikeash.com: just this guy, you know?
Home
Book
The Complete Friday Q&A, advanced topics in Mac OS X and iOS programming.
Blog
GitHub
My GitHub page, containing various open-source libraries for Mac and iOS development, and some miscellaneous projects
Glider Flying
HD Ridge Running Video
List of Landouts
Day in the Life
Skyline Soaring Club
Soaring Society of America
Getting Answers
Ten simple points to follow to get good answers on IRC, mailing lists, and other places
Miscellaneous Pages
Miscellaneous old, rarely-updated content
mike@mikeash.com
E-mail me

NSBlog
"A failure in the hot air department"
RSS feed (full text feed) -Show Tag CloudHide Tag Cloud

accessors(2)advertisement(11)advice(4)apple(7)apressarc(6)arduinoassembly(11)assert(2)atomic(3)audio(4)autorelease(3)blocks(14)bolo(3)book(4)books(2)braaaiiiinnnssss(2)bridgingbug(3)c(19)c++(4)c99casestudychemicalburn(4)clang(5)classic(2)cocoa(42)code(4)codeinjectioncodesigningcollectionscommunitycompilerconference(3)content-free(3)continuationcontinuationscontrolscoreaudio(3)corefoundation(2)crashminescryptography(2)dangerous(3)dashboarddebugging(7)defensive(5)design(2)disassembly(3)dwarf(3)dyldencodingenumerationepub(4)errorhandlingeulogyevil(15)exceptionfftfilemergefloat(2)fluidflyingfollowup(2)forkframeworksfridayfridayqa(8)fridayqna(177)futures(2)fuzzinggames(3)garbagecollection(2)gcd(15)gdbgenerators(3)gpulifeguest(16)hack(17)hardware(4)hashheapheartbleedhtmlhttphumor(3)image(3)initinitializerinjectioninterview(3)ioccc(2)ipc(2)iphone(16)ircisequaljavascriptjobs(3)kqueuekvo(3)leopard(2)letsbreakletsbuild(20)libffilibrarieslink(18)linking(2)linuxlispllvm(3)machmacho(2)macromacrosmagicmailinglistmemory(18)meta(3)migminions(3)namemanglingnetworking(4)nib(2)nostalgia(2)notifications(3)nscellnscodingnsfastenumerationnsoperationqueue(5)numericalobjcobjectivec(64)oldschool(2)oopopencl(2)opengl(2)opensourceoptimizationosbug(4)overrideparallelismpdfperformance(20)plist(2)pluginpointlessposixpreprocessor(2)print-on-demandprivateapiprocessprogrammingpublishingpyobjcpython(4)qnaquizrandom(2)rant(17)reachabilityreleaseretainrogueamoebarunloopsafetysecurity(4)semi-evil(3)serialization(5)sharksignal(2)simblsimulationsingletonsocketssourcecode(4)stackstl(2)strnstr(2)stupidsubversion(2)superswift(24)swizzlingtestingtexttheorythreading(14)tigertoolbox(2)trampoline(3)translation(2)unicode(3)universityupdateutilityvalgrind(2)vararg(2)versioncontrol(2)webwindowwritingwwdc(3)xboloxcode(4)zombie(2)

objc_msgSend's New Prototype at 2019-10-11 12:09
byMike AshTags:objc
Apple's new OSes are out. If you've looked through the documentation, you may have noticed thatthe prototype forobjc_msgSend has changed. Previously, it was declared as a function that tookid,SEL, and variadic arguments after that, and returnedid. Now it's declared as a function that takes and returnsvoid. Similar functions likeobjc_msgSendSuper also becamevoid/void. Why the change?
(Read More)30 comments

Friday Q&A 2018-06-29: Debugging with C-Reduce at 2018-06-29 13:35
byMike AshTags:fridayqnadebugging
Debugging a complex problem is tough, and it can be especially difficult when it's not obvious which chunk of code is responsible. It's common to attempt to produce a reduced test case in order to narrow it down. It's tedious to do this manually, but it's also the sort of thing computers are really good at. C-Reduce is a program which automatically takes programs and pares them down to produce a reduced test case. Let's take a look at how to use it.
(Read More)4 comments

Friday Q&A 2018-04-27: Generating Text With Markov Chains in Swift at 2018-04-28 01:27
byMike AshTags:fridayqna
Markov chains make for a simple way to generate realistic looking but nonsensical text. Today, I'm going to use that technique to build a text generator based on this blog's contents, an idea suggested/inspired by reader Jordan Pittman.
(Read More)2 comments

Friday Q&A 2017-12-08: Type Erasure in Swift at 2017-12-15 14:09
byMike AshTags:fridayqnaswift
You might have heard the term type erasure. You might have even used type-erased types in the standard library, such asAnySequence. But what exactlyis type erasure and how do you do it yourself? In this article, I'll explore type erasure, why you'd want it, and how to make it happen, a topic suggested by Lorenzo Boaro.
(Read More)10 comments

Friday Q&A 2017-11-10: Observing the A11's Heterogenous Cores at 2017-11-10 12:41
byMike AshTags:fridayqnahardwareperformance
Apple's newest mobile CPU, the A11, brings a new level of heterogeneous computing to iOS, with both high and low performance cores that are always on. With the release of the iPhone X, I set out to see if I could observe these heterogeneous cores in action.
(Read More)7 comments

Friday Q&A 2017-10-27: Locks, Thread Safety, and Swift: 2017 Edition at 2017-10-27 11:28
byMike AshTags:fridayqnaswiftthreading
Back in the dark ages of Swift 1, I wrotean article about locks and thread safety in Swift. The march of time has made it fairly obsolete, and readerSeth Willits suggested I update it for the modern age, so here it is!
(Read More)7 comments

The Complete Friday Q&A Volumes II and III Are Out! at 2017-10-10 16:19
byMike AshTags:advertisement
It's finally here! I'm pleased to presentThe Complete Friday Q&A Volumes II and III.
(Read More)2 comments

Friday Q&A 2017-10-06: Type-Safe User Defaults at 2017-10-06 12:55
byMike AshTags:fridayqnaswift
It's fun to re-imagine traditional techniques with a Swift twist. I've implemented a type-safe layer on top of the venerableNSUserDefaults, and I'm going to discuss my little library today. Credit/blame for this idea goes to local reader José Vazquez, although he inspired it by accident while talking about something else.
(Read More)8 comments

Friday Q&A 2017-09-22: Swift 4 Weak References at 2017-09-23 00:57
byMike AshTags:fridayqnaswift
Soon after Swift was initially open sourced, I wrotean article about how weak references are implemented. Time moves on and things change, and the implementation is different from what it once was. Today I'm going to talk about the current implementation and how it works compared to the old one, a topic suggested by Guillaume Lessard.
(Read More)7 comments

The Best New Features in Swift 4 at 2017-09-15 14:43
byMike Ash
I'm afraid I once again don't have a Friday Q&A for you today, but I wrote upthe best new features in Swift 4 for the Plausible Labs blog, which isalmost as good.Check it out over there!
(Read More)0 comments

Corporate Training, NYC Workshop, and Book Update at 2017-09-08 19:07
byMike Ash
I'm afraid I ran out of time for Friday Q&A this week. Will shoot for next week instead. Instead, I present a little update about various other things in my world.
(Read More)0 comments

Friday Q&A 2017-08-25: Swift Error Handling Implementation at 2017-08-25 13:13
byMike AshTags:fridayqnaswiftassembly
Swift's error handling is a unique feature of the language. It looks a lot like exceptions in other languages, but the syntax is not quite the same, and it doesn't quite work the same either. Today I'm going to take a look at how Swift errors work on the inside.
(Read More)11 comments

Friday Q&A 2017-08-11: Swift.Unmanaged at 2017-08-11 13:14
byMike AshTags:fridayqnaswiftc
In order to work with C APIs, we sometimes need to convert Swift object references to and from raw pointers. Swift'sUnmanagedstruct is the standard API for handling this. Today, I'd like to talk about what it does and how to use it.
(Read More)7 comments

Friday Q&A 2017-07-28: A Binary Coder for Swift at 2017-07-28 12:44
byMike AshTags:fridayqnaswiftserialization
Inmy last article I discussed the basics of Swift's newCodable protocol, briefly discussed how to implement your own encoder and decoder, and promised another article about a custom binary coder I've been working on. Today, I'm going to present that binary coder.
(Read More)11 comments

Friday Q&A 2017-07-14: Swift.Codable at 2017-07-14 13:57
byMike AshTags:fridayqnaswiftserialization
One of the interesting additions to Swift 4 is theCodable protocol and the machinery around it. This is a subject near and dear to my heart, and I want to discuss what it is and how it works today.
(Read More)14 comments

Friday Q&A 2017-06-30: Dissecting objc_msgSend on ARM64 at 2017-07-01 04:23
byMike AshTags:fridayqnaobjectivecassembly
We're back! During the week of WWDC, I spoke at CocoaConf Next Door, and one of my talks involved a dissection ofobjc_msgSend's ARM64 implementation. I thought that turning it into an article would make for a nice return to blogging for Friday Q&A.
(Read More)12 comments

More Advanced Swift Workshop, and Blog and Book Updates at 2017-06-13 16:11
byMike AshTags:advertisement
I'm hoping to resume a regular posting schedule soon, and I wanted to give everybody some updates.
(Read More)0 comments

Advanced Swift Workshop in New York City at 2017-03-27 15:29
byMike AshTags:advertisement
I will be holding another one-day workshop on advanced Swift programming in New York City on May 4th. This will be much the same as my previous one in Washington in December, in a new location and with various tweaks and improvements. If you enjoy my articles and want to sharpen your Swift skills,check it out.
(Read More)0 comments

Advanced Swift Workshop in Washington, DC at 2016-11-12 21:27
byMike AshTags:advertisement
I will be holding a one-day workshop on advanced Swift programming in the Washington, DC area on December 12th. If you enjoy my articles and want to sharpen your Swift skills,check it out.
(Read More)10 comments

Good News, Bad News, and Ugly News at 2016-06-01 11:48
byMike AshTags:book
The good news is that I'm officially restarting work on The Complete Friday Q&A: Volume II. I got partway into it a while ago and ran out of steam. The restarted edition includes all posts made since then, making it pretty massive. I can't commit to a specific timeframe, but I hope that it will be a few months at most before I have it out. There may be opportunities for reader involvement in checking and polishing it, so watch this space.
(Read More)20 comments

Friday Q&A 2016-04-15: Performance Comparisons of Common Operations, 2016 Edition at 2016-04-15 13:20
byMike AshTags:fridayqnaperformancecocoaobjectiveciphone
Back in the mists of time, before Friday Q&A was a thing, I posted some articles running performance tests on common operations and discussing the results. The most recent one was from 2008, running on 10.5 and the original iPhone OS, and it's long past time to do an update.
(Read More)13 comments

Friday Q&A 2016-03-04: Swift Asserts at 2016-03-04 14:30
byMike AshTags:fridayqnaswiftassert
Asserts are really useful for checking assumptions in code to ensure that errors are caught early and often. Today, I'm going to explore the assert calls available in Swift and how they're implemented, a topic suggested by reader Matthew Young.
(Read More)7 comments

Friday Q&A 2016-02-19: What Is the Secure Enclave? at 2016-02-19 14:40
byMike AshTags:fridayqnaapplesecurity
The big tech news this week is that the FBI is trying to force Apple to unlock a suspect's iPhone. One of the interesting points around this story is that the iPhone in question is an older one, an iPhone 5c. Newer phones have what Apple calls the Secure Enclave, which some say protects against requests of this nature; even if Apple wanted to break into your phone, they couldn't. Which then brings up an interesting question I've seen a lot of people asking: what exactly is the Secure Enclave, and what role does it play here?
(Read More)35 comments

Friday Q&A 2016-01-29: Swift Struct Storage at 2016-01-29 14:57
byMike AshTags:fridayqnaswiftmemory
Swift'sclasses tend to be straightforward for most people new to the language to understand. They work pretty much like classes in any other language. Whether you've come from Objective-C or Java or Ruby, you've worked with something similar. Swift'sstructs are another matter. They look sort of likeclasses, but they're value types, and they don't do inheritance, and there's this copy-on-write thing I keep hearing about? Where do they live, anyway, and how do they work? Today, I'm going to take a close look at just howstructs get stored and manipulated in memory.
(Read More)10 comments

Friday Q&A 2015-12-25: Swifty Target/Action at 2015-12-25 15:11
byMike AshTags:fridayqnaswiftcocoa
Cocoa's target/action system for responding to controls is a great system for Objective-C, but is a bit unnatural to use in Swift. Today, I'm going to explore building a wrapper that allows using a Swift function as the action.
(Read More)8 comments

Friday Q&A 2015-12-11: Swift Weak References at 2015-12-11 14:16
byMike AshTags:fridayqnaswift
In case you have been on Mars, in a cave, with your eyes shut and your fingers in your ears,Swift has been open sourced. This makes it convenient to explore one of the more interesting features of Swift's implementation: how weak references work.
(Read More)15 comments

Friday Q&A 2015-11-20: Covariance and Contravariance at 2015-11-20 14:16
byMike AshTags:fridayqnaooptheory
Subtypes and supertypes are a common part of modern programming. Covariance and contravariance tell us where subtypes are accepted and where supertypes are accepted in place of the original type. This shows up frequently in most of the programming most of us do, but many developers are unaware of the concepts beyond a loose instinctual sense. Today I'm going to discuss it in detail.
(Read More)14 comments

Friday Q&A 2015-11-06: Why is Swift's String API So Hard? at 2015-11-06 14:00
byMike AshTags:fridayqnaswift
Welcome to a very delayed edition of Friday Q&A. One of the biggest complaints I see from people using Swift is theString API. It's difficult and obtuse, and people often wish it were more like string APIs in other languages. Today, I'm going to explain just why Swift'sString API is designed the way it is (or at least, why I think it is) and why I ultimately think it's the best string API out there in terms of its fundamental design.
(Read More)34 comments

Friday Q&A 2015-09-18: Building a Gear Warning System at 2015-09-18 13:29
byMike AshTags:fridayqnarandomflyingarduino
Today I'm going to go outside my usual set of topics and talk about a fun side project that might broaden your horizons. Or expose my ignorance. A couple of years ago I set out to build a gear warning system for my glider using an Arduino-type system, and I'm going to talk about how it works and what that code looks like.
(Read More)8 comments

Friday Q&A 2015-09-04: Let's Build dispatch_queue at 2015-09-04 13:22
byMike AshTags:fridayqnaletsbuildgcd
Grand Central Dispatch is one of the truly great APIs to come out of Apple in the past few years. In the latest installment of the Let's Build series, I'm going to explore a reimplementation of the most basic features ofdispatch_queue, a topic suggested by Rob Rix.
(Read More)6 comments

Friday Q&A 2015-08-14: An Xcode Plugin for Unsmoothed Text at 2015-08-14 14:11
byMike AshTags:fridayqnaxcodehack
Getting Xcode to display unsmoothed text in its editor has been an ongoing battle which finally required me to write an Xcode plugin to impose my will. Several readers asked me to discuss how it works, which is what I'm going to do today.
(Read More)9 comments

Friday Q&A 2015-07-31: Tagged Pointer Strings at 2015-07-31 14:10
byMike AshTags:fridayqnaobjectivec
Tagged pointers are an interesting technology used to increase performance and reduce memory usage. As of OS X 10.10,NSString got the tagged pointer treatment, and today I'm going to take a look at how it works, a topic suggested by Ken Ferry.
(Read More)29 comments

Friday Q&A 2015-07-17: When to Use Swift Structs and Classes at 2015-07-17 12:54
byMike AshTags:fridayqnaswift
One of the persistent topics of discussion in the world of Swift has been the question of when to useclasses and when to usestructs. I thought I'd contribute my own version of things today.
(Read More)8 comments

Friday Q&A 2015-07-03: Address Sanitizer at 2015-07-03 13:52
byMike AshTags:fridayqnavalgrindc
Outside ofSwift 2 news, one of the exciting announcements to come out of WWDC was that clang's Address Sanitizer is now available directly in Xcode 7. Today I'm going to discuss what it is, how it works, and how to use it, a topic suggested by Konstantin Gonikman.
(Read More)11 comments

Friday Q&A 2015-06-19: The Best of What's New in Swift at 2015-06-19 13:12
byMike AshTags:fridayqnaswift
Apple made a lot of interesting announcements at WWDC this year about the release of Swift 2 and the new features in it, in among various other announcements of little interest. In addition to the announcement that Swift will be made open source, which is a huge deal all by itself, Swift 2 contains a lot of great new features which significantly improve the language. Today I'm going to talk about the most important ones, what they are, and why they're useful.
(Read More)36 comments

I Do Not Agree To Your Terms at 2015-06-15 17:37
byMike AshTags:apple
Apple introduced their News app at WWDC, and the other day they sent me an e-mail saying they want to include this blog in News.
(Read More)81 comments

Friday Q&A 2015-05-29: Concurrent Memory Deallocation in the Objective-C Runtime at 2015-06-05 13:06
byMike AshTags:fridayqnaobjectivecthreading
The Objective-C runtime is at the heart of much Mac and iOS code. At the heart of the runtime is theobjc_msgSend function, and the heart of that is the method cache. Today I'm going to explore how Apple manages resizing and deallocating method cache memory in a thread safe manner without impacting performance, using a technique you probably won't find in textbooks discussing thread safety.
(Read More)21 comments

Friday Q&A 2015-05-01: Fuzzing with afl-fuzz at 2015-05-01 13:24
byMike AshTags:fridayqnafuzzingsecurity
With computer security high on everyone's minds these days, tools that help assess and improve the security of our code are extremely useful. Today I'm going to talk about one such tool,afl-fuzz, which has seen a lot of attention lately and produces some interesting results. I'll discuss how it works and how to use it on your own code.
(Read More)3 comments

Friday Q&A 2015-04-17: Let's Build Swift.Array at 2015-04-17 13:42
byMike AshTags:fridayqnaletsbuildswift
Swift 1.2 is now available as part of Xcode 6.3, and one of the new APIs it includes allows us to build efficient data structures with value semantics, such as Swift's built-inArray type. Today, I'm going to reimplement the core functionality ofArray.
(Read More)13 comments

Friday Q&A 2015-03-20: Preprocessor Abuse and Optional Parentheses at 2015-03-20 14:23
byMike AshTags:fridayqnacpreprocessorevil
The other day I ran into an interesting problem: how can you write a C preprocessor macro that removes parentheses surrounding its argument, but leaves the argument alone if no parentheses are present? For today's article, I'm going to share my solution.
(Read More)11 comments

Friday Q&A 2015-02-20: Let's Build @synchronized at 2015-02-20 14:26
byMike AshTags:fridayqnaletsbuildthreadingswift
Continuing the theme of thread safety from the previous article, today I'm going to explore an implementation of Objective-C's@synchronized facility in the latest edition of Let's Build. I'm going to build it in Swift, although an equivalent Objective-C version would be much the same.
(Read More)9 comments

Friday Q&A 2015-02-06: Locks, Thread Safety, and Swift at 2015-02-06 14:23
byMike AshTags:fridayqnaswiftthreading
An interesting aspect of Swift is that there's nothing in the language related to threading, and more specifically to mutexes/locks. Even Objective-C has@synchronized and atomic properties. Fortunately, most of the power is in the platform APIs which are easily used from Swift. Today I'm going to explore the use of those APIs and the transition from Objective-C, a topic suggested by Cameron Pulsford.
(Read More)21 comments

Friday Q&A 2015-01-23: Let's Build Swift Notifications at 2015-01-23 14:52
byMike AshTags:fridayqnaletsbuildnotificationsswift
NSNotificationCenter is a useful API that's pervasive in Apple's frameworks, and often sees a lot of use within our own code. Ipreviously explored buildingNSNotificationCenter in Objective-C. Today, I want to build it in Swift, but not just another reimplementation of the same idea. Instead, I'm going to take the API and make it faster, better, stronger, and take advantage of all the nice stuff Swift has to offer us.
(Read More)32 comments

Friday Q&A 2014-11-07: Let's Build NSZombie at 2014-11-07 16:04
byMike AshTags:fridayqnamemoryzombiebraaaiiiinnnssss
Zombies are a valuable tool for debugging memory management problems. I previously discussedthe implementation of zombies, and today I'm going to go one step further and build them from scratch, a topic suggested by Шпирко Алексей.
(Read More)7 comments

A Brief Pause at 2014-09-12 15:18
byMike Ash
No Friday Q&A this week, or for a few more weeks. I'm speaking atNSSpain next week and preparing for that is keeping me busy. Subsequent travel will interrupt my writing for a while longer. Do not despair! I shall return, and soon. If you're looking for stuff to read, I recommend heading over toThe Old New Thing, which is my favorite blog out there, even though it focuses entirely on platforms I don't program for or even use. If you're looking for a place to start,this story about the heroic workarounds Windows 95 had to use for buggy 386 CPUs is great fun.
(Read More)0 comments

Friday Q&A 2014-08-29: Swift Memory Dumping at 2014-08-29 13:24
byMike Ash
Inpreviousarticles, I've discussed the layout of various runtime data structures in Swift and alluded to a memory dumper that I was using to extract that data. Today, I'm going to walk through the implementation of that dumper.
(Read More)6 comments

Friday Q&A 2014-08-15: Swift Name Mangling at 2014-08-15 14:20
byGwynne RaskindTags:swiftnamemanglingfridayqnaguest
It's been a long time since I wrote a Friday Q&A, but I'm back, with a brand-new post about a brand-new topic: Swift. Over the last few posts, Mike's gone into some detail about what Swift's internal structures looked like, but he's only touched very lightly on what the linker sees when it looks at Swift-containing binaries: mangled symbol names.
(Read More)6 comments

Friday Q&A 2014-08-01: Exploring Swift Memory Layout, Part II at 2014-08-01 14:22
byMike AshTags:fridayqnaswift
Continuing the theme fromthe previous article, I'm going to continue exploring implementation details of Swift's memory layout. Today, I'm going to look at the memory layout of generics, optionals, and protocol objects.
(Read More)12 comments

Friday Q&A 2014-07-18: Exploring Swift Memory Layout at 2014-07-18 13:57
byMike AshTags:fridayqnaswift
Welcome back to another exploration of Swift. Today I'm going to dig into some implementation details and explore how Swift lays out objects and classes in memory.
(Read More)11 comments

Friday Q&A 2014-07-04: Secrets of Swift's Speed at 2014-07-04 13:40
byMike AshTags:fridayqnaswiftoptimization
Since the introduction of Swift, speed has been a key selling point. Indeed, it's right in the name of the language. It's said to be faster than dynamic languages like Python or JavaScript, potentially faster than Objective-C, and even claimed to be faster than C for certain cases. But how exactly does it do it?
(Read More)26 comments

Friday Q&A 2014-06-20: Interesting Swift Features at 2014-06-20 13:17
byMike AshTags:fridayqnaswift
Roughly six hundred million people have asked me to write something about Swift. I'm hoping to write a series of articles about various aspects of it. For today, I want to start things off by exploring a few Swift features that are interesting and unusual from the perspective of Objective-C, and why I think they're going to be good to have.
(Read More)46 comments

Friday Q&A 2014-06-06: Secrets of dispatch_once at 2014-06-06 13:27
byMike AshTags:fridayqnagcdthreadingatomic
Reader Paul Kim pointed out anentry on Michael Tsai's blog about makingdispatch_once fast. While the comment in thedispatch_once source code is fascinating and informative, it doesn't quite delve into the detail that some would like to see. Since this is one of my favorite hacks, for today's article I'm going to discuss exactly what's going on there and how it all works.
(Read More)16 comments

Friday Q&A 2014-05-23: A Heartbleed-Inspired Paranoid Memory Allocator at 2014-05-23 13:46
byMike AshTags:fridayqnamemoryheartbleed
TheHeartbleed vulnerability made a big splash a couple of months ago, and rightly so. It could be described as a "memory leak", but it's not the standard kind where a program fails to free allocated memory. Instead, it allowed an attacker to dump memory contents from a remote program nearly at will, potentially leaking private keys, passwords, source code, and other data intended to stay secret. This got me thinking about ways to protect sensitive data against similar attacks. The result isMAParanoidAllocator, and in this article I'll discuss the implementation.
(Read More)11 comments

Friday Q&A 2014-05-09: When an Autorelease Isn't at 2014-05-09 13:59
byMike AshTags:fridayqnaarcmemoryassembly
Welcome back to another Friday Q&A. I apologize for the unannounced hiatus in posts. It's not due to anything interesting, just a shortage of time. Friday Q&A will continue, and I will continue to aim for my regular biweekly postings. For today's article, I have a little story about anautorelease call that didn't do what it was supposed to do.
(Read More)29 comments

Friday Q&A 2014-03-14: Introduction to the Sockets API at 2014-03-14 13:52
byMike AshTags:fridayqnasocketsnetworking
Network programming is everywhere these days. It's tough to find an iPhone app thatdoesn't use the network for something. We also spend a lot of our time abstracted away from the details of networking, using high-level APIs likeNSURLConnection. Today I'm going to walk you through the lowest-level API you can find without diving into the kernel, the POSIX sockets API.
(Read More)12 comments

Tales From The Crash Mines: Issue #1 at 2014-02-06 14:53
byLandon FullerTags:crashminesguestdebuggingassembly
Today's post comes courtesy of Landon Fuller, who you may remember from a previousguest post about mach exception handlers. Landon is a fellow member at Plausible Labs, and today he presents the first in what is intended to be a running series on interesting crashes we encounter in our work.
(Read More)7 comments

Friday Q&A 2014-01-24: Introduction to libclang at 2014-01-24 15:01
byMike AshTags:fridayqnaclang
In addition to its many other fine attributes, the Clang compiler also provides a clean API that makes it easy to use its facilities as a library in your own code. Today, I'm going to give a basic introduction to this library and how to use it, a topic suggested by reader Jeffrey Macko.
(Read More)9 comments

Friday Q&A 2014-01-10: Let's Break Cocoa at 2014-01-10 14:58
byMike AshTags:fridayqnaletsbreak
TheLet's Build articles are my favorite on this blog. Sometimes, though, it's more fun to break things than to build them. Today, I'm going to explore some amusing and unusual ways to break Cocoa.
(Read More)6 comments

Friday Q&A 2013-12-06: Network Protocol Design at 2013-12-06 13:29
byMike AshTags:fridayqnanetworkingdesign
In this age of REST and HTTP and massive inefficiency in internet communications, the need for custom network protocols is rare. However, it does happen sometimes, and when it does, I want to make sure it's done right. With that aim, I'm going to discuss some guidelines for designing network protocols, a topic suggested by Mike Shields.
(Read More)8 comments

VoodooPad Acquisition at 2013-11-07 19:17
byMike AshTags:advertisement
I hope you'll all excuse this brief excursion from hardcore technical content. Over atPlausible Labs we have acquiredVoodooPad, the personal wiki app previously fromFlying Meat.
(Read More)3 comments

Friday Q&A 2013-10-25: NSObject: the Class and the Protocol at 2013-10-25 13:27
byMike AshTags:fridayqnaobjectivec
Reader Tomas Bouda asks: what's the deal with theNSObject protocol? There are twoNSObjects in Cocoa, a class and a protocol. Why both? What purpose do they serve? In today's article, I'll explore the answer to this question.
(Read More)11 comments

Friday Q&A 2013-10-11: Why Registers Are Fast and RAM Is Slow at 2013-10-11 14:14
byMike AshTags:fridayqnahardwarememory
In theprevious article on ARM64, I mentioned that one advantage of the new architecture is the fact that it has twice as many registers, allowing code load data from RAM less often, which is much slower. Reader Daniel Hooper asks the natural question: just whyis RAM so much slower than registers?
(Read More)13 comments

Friday Q&A 2013-09-27: ARM64 and You at 2013-09-27 13:31
byMike AshTags:fridayqnahardwareiphone
Ever since the iPhone 5S wasannounced a couple of weeks ago, the world of tech journalism has beenfilled withmassivequantities ofmisinformation. Unfortunately, good information takes time, and the world of tech journalism is more about speed than accuracy. Today, as suggested by a variety of readers, I'm going to give the rundown of just what 64-bit ARM in the iPhone 5S means for you, in terms of performance, capabilities, and development.
(Read More)61 comments

Friday Q&A 2013-09-13: A Library for Easier Property List Type Checking and Error Reporting at 2013-09-13 15:35
byMike AshTags:fridayqnaplistserialization
As Ipromised last time, today I'm going to discuss a library I've been working on that makes the task of type-checking property lists much less verbose and painful.
(Read More)1 comment

Friday Q&A 2013-08-30: Model Serialization With Property Lists at 2013-08-30 13:35
byMike AshTags:fridayqnaplistserialization
Object serialization is a common requirement for saving files to disk, communicating over a network, or simply persisting settings. Today, I'm going to talk about the basics of using property lists for object serialization, a topic suggested by Nicolas Goles.
(Read More)16 comments

Friday Q&A 2013-08-16: Let's Build Dispatch Groups at 2013-08-17 02:19
byMike AshTags:fridayqnaletsbuildgcd
Dispatch groups are a handy facility for synchronizing multiple tasks, and an anonymous reader suggested them for the subject of today's Let's Build.
(Read More)2 comments

Friday Q&A 2013-08-02: Type-Safe Scalars with Single-Field Structs at 2013-08-02 15:01
byMike AshTags:fridayqnac
Welcome back, and apologies for going silent without warning. Something resembling normality has resumed, and so I hope to also resume something resembling my normal schedule. In any case, for today's article, local reader Michael Manesh suggested that I talk about how you can use (or abuse) C's type system to obtain stronger typing guarantees by creatingstructs containing only a single field.
(Read More)11 comments

Friday Q&A 2013-06-28: Anatomy of a Compiler Bug at 2013-06-28 13:04
byMike AshTags:fridayqnaassemblycompiler
Some people have a favorite color or a favorite food. It may come as no surprise that I have a favorite compiler bug. Today, I'm going to demonstrate it and pick it apart, a topic suggested by reader Daniel Jalkut.
(Read More)12 comments

Friday Q&A 2013-06-14: Reachability at 2013-06-14 13:49
byMike AshTags:fridayqnanetworkingreachability
Networking is playing an ever more important role in application development, and Apple's reachability API is a valuable tool in making network-centric apps play nicely with varying real-world conditions. Today I'm going to give an overview of the reachability API, what it does, and how to use it, a suggestion from reader Manuel Diaz.
(Read More)15 comments

Friday Q&A 2013-05-31: C Quiz at 2013-05-31 13:46
byMike AshTags:fridayqnacquiz
I thought I'd mix things up a bit today and give my readers a quiz. The C language is perhaps the most popular computer language in existence, but it's also quite odd, and because of that often poorly understood. I'd like to give you a quiz to see how much you know about some of the odd but useful corners of the language.
(Read More)21 comments

Friday Q&A 2013-05-17: Let's Build stringWithFormat: at 2013-05-17 14:40
byMike AshTags:fridayqnaletsbuildcobjectiveccocoa
Our long effort to rebuild Cocoa piece by piece continues. For today, reader Nate Heagy has suggested buildingNSString'sstringWithFormat: method.
(Read More)11 comments

Friday Q&A 2013-05-03: Proper Use of Asserts at 2013-05-03 13:03
byMike AshTags:fridayqnacobjectiveccocoaassert
Asserts are a powerful tool for building quality code, but they're often poorly understood. Today, I want to discuss the various options for writing asserts in Cocoa apps and the best ways to use them, a topic suggested by reader Ed Wynne.
(Read More)16 comments

Friday Q&A Is On Vacation at 2013-04-19 14:24
byMike Ash
Friday Q&A is on vacation at the moment, so there will be no article today. Never fear: although he's busy relaxing today, Friday Q&A will return, and soon. To keep my loyal readers from being too upset, here is a collection of links to interesting articles to keep you occupied.
(Read More)1 comment

Friday Q&A 2013-04-05: Windows and Window Controllers at 2013-04-05 13:36
byMike AshTags:fridayqnacocoadesignwindow
It's time to take a turn to some lighter fare, but to a subject that's near and dear to my heart. The fundamental UI component of a Cocoa app is the NSWindow, and there are many different ways to instantiate and manage them, but there is only one correct way: for each type of window, there should be a separate nib file, and a specializedNSWindowController subclass. I'll walk through what this means and how to do it, a topic suggested by reader Mike Shields.
(Read More)21 comments

Objective-C Literals in Serbo-Croatian at 2013-03-26 23:48
byMike AshTags:clangobjectivectranslation
Reader Anja Skrba from Webhostinggeeks.com has translated myObjective-C Literals article into Serbo-Croatian. It's always fun to see translations of my writing, even when I can't understand them at all. If you do understand Serbo-Croatian, or know someone who does, check it out.The Serbo-Croatian version of Objective-C Literals is available on Webhostinggeeks.com.
(Read More)8 comments

Friday Q&A 2013-03-22: Let's Build NSInvocation, Part II at 2013-03-22 14:57
byMike AshTags:fridayqnaletsbuildobjectivec
Last time on Friday Q&A, I began the reimplementation of parts ofNSInvocation asMAInvocation. In that article, I discussed the basic theory, the architecture calling conventions, and presented the assembly language glue code needed for the implementation. Today, I present the Objective-C part ofMAInvocation.
(Read More)4 comments

Friday Q&A 2013-03-08: Let's Build NSInvocation, Part I at 2013-03-08 14:33
byMike AshTags:fridayqnaletsbuildobjectivec
It's time for another trip into the nether regions of the soul. Reader Robby Walker suggested an article aboutNSInvocation, and I have obliged, implementing it from scratch for your amusement. Today I'll start on a guided tour down the hall of horrors that isMAInvocation, my reimplementation of theNSInvocation API. It's a big project, so today I'm going to focus on the basic principles and the assembly language glue code, with the rest of the implementation to follow.
(Read More)0 comments

Friday Q&A 2013-02-22: Let's Build UITableView at 2013-02-22 15:35
byMatthew EltonTags:fridayqnaiphoneletsbuildguest
Friday Q&A is driven by the readers, and that's especially true today. ReaderMatthew Elton thought that "Let's Build UITableView" would make a good topic for Friday Q&A, but he decided he'd rather implement it himself and write it up rather than wait for me to do it (good move, Matthew). Without further ado, here is Matthew's article an buildingUITableView.
(Read More)8 comments

Friday Q&A 2013-02-08: Let's Build Key-Value Coding at 2013-02-08 14:17
byMike AshTags:fridayqnaletsbuildobjectivec
Last time, I showed how to build the basic functionality ofNSObject. I left out key-value coding, because the implementation ofvalueForKey: andsetValue:forKey: is complex enough to need its own article. This is that article.
(Read More)14 comments

Friday Q&A 2013-01-25: Let's Build NSObject at 2013-01-25 15:32
byMike AshTags:fridayqnaletsbuildobjectivec
TheNSObject class lies at the root of (almost) all classes we build and use as part of Cocoa programming. What does it actually do, though, and how does it do it? Today, I'm going to rebuildNSObject from scratch, as suggested by friend of the blog and occasional guest author Gwynne Raskind.
(Read More)27 comments

Friday Q&A 2013-01-11: Mach Exception Handlers at 2013-01-11 14:44
byLandon FullerTags:fridayqnaguestsignalevilmachexceptionmigdebugging
This is my first guest Friday Q&A article, dear readers, and I hope it will withstand your scrutiny. Today's topic is on Mach exception handlers, something I've recently spent some time exploring on Mac OS X and iOS for the purpose ofcrash reporting. While there is surprisingly little documentation available about Mach exception handlers, and they're considered by some to be a mystical source of mystery and power, the fact is that they're actually pretty simple to understand at a high level - something I hope to elucidate here. Unfortunately, they're also partially private API on iOS, despite being used in a number of new crash reporting solutions - something I'll touch on in the conclusion.
(Read More)7 comments

Friday Q&A 2012-12-28: What Happens When You Load a Byte of Memory at 2012-12-28 14:45
byMike AshTags:fridayqnahardwarememory
The hardware and software that our apps run on is almost frighteningly complicated, and there's no better place to see that than in the contortions that the system goes through when we load data from memory. What exactly happens when we load a byte of memory? Reader and friend of the blog Guy English suggested I dedicate an article to answering that question.
(Read More)11 comments

Friday Q&A 2012-12-14: Objective-C Pitfalls at 2012-12-14 14:38
byMike AshTags:fridayqnaobjectiveccocoa
Objective-C is a powerful and extremely useful language, but it's also a bit dangerous. For today's article, my colleague Chris Denter suggested that I talk about pitfalls in Objective-C and Cocoa, inspired by Cay S. Horstmann'sarticle on C++ pitfalls.
(Read More)24 comments

Friday Q&A 2012-11-30: Let's Build A Mach-O Executable at 2012-11-30 17:59
byGwynne RaskindTags:assemblymachofridayqnaguestevildwarfletsbuild
This is something of a followup to my last article,dyld: Dynamic Linking On OS X, in which I explored how the dynamic linkerdyld does its job. This week, I'm going to recreate the function of both the compiler and thestatic linker, building a Mach-O binary completely from scratch with only the help of the assembler.
(Read More)7 comments

Friday Q&A 2012-11-16: Let's Build objc_msgSend at 2012-11-16 14:27
byMike AshTags:fridayqnaobjectivecletsbuild
Theobjc_msgSend function underlies everything we do in Objective-C. Gwynne Raskind, reader and occasional Friday Q&A guest contributor, suggested that I talk about howobjc_msgSend works on the inside. What better way to understand how something works than to build it from scratch? Let's buildobjc_msgSend.
(Read More)10 comments

Friday Q&A 2012-11-09: dyld: Dynamic Linking On OS X at 2012-11-09 15:51
byGwynne RaskindTags:dyldassemblymachofridayqnaguestlinklinking
In the course of a recent job interview, I had an opportunity to study some of the internals ofdyld, the OS X dynamic linker. I found this particular corner of the system interesting, and I see a lot of people having trouble with linking issues, so I decided to do an article about the basics of dynamic linking. Some of the deeper logic is new to me, so sorry in advance for any inaccuracies.
(Read More)2 comments

Friday Q&A 2012-11-02: Building the FFT at 2012-11-02 14:29
byChris LiscioTags:fridayqaaudiofftguest
In thelast post in this mini-series, Mike gave an overview of the Fourier Transform and then showed you how to use Apple's implementation of the Fast Fourier Transform (FFT).
(Read More)5 comments

Friday Q&A 2012-10-26: Fourier Transforms and FFTs at 2012-10-26 13:25
byMike AshTags:fridayqaaudiocoreaudio
Last time around I discussed the basics of audio data, how to get it, and how to understand it. Today, I'm going to go into some detail about one of the fundamental tools for more complex audio analysis, the fourier transform, and the FFT algorithm that makes it practical to use on computers.
(Read More)15 comments

Friday Q&A 2012-10-12: Obtaining and Interpreting Audio Data at 2012-10-12 13:20
byMike AshTags:fridayqaaudiocoreaudio
Continuing the multimedia data processing trend, today I'm switching over to audio. A reader known as Derek suggested a discussion on how to obtain and interpret audio data, which is what I'll cover today.
(Read More)13 comments

Friday Q&A 2012-09-28: Optimizing Flood Fill at 2012-09-28 13:17
byMike AshTags:fridayqacocoaimage
Last time, I presented the implementation of a basic flood fill. That implementation works fine, but is not terribly fast. Today, I'm going to walk through various optimizations that can be done to make it faster, using techniques which I hope will be useful in many different situations. Ultimately, starting from the original code, I was able to achieve over an order of magnitude speedup while still keeping the code relatively straightforward and clear.
(Read More)8 comments

Friday Q&A 2012-09-14: Implementing a Flood Fill at 2012-09-14 14:16
byMike AshTags:fridayqacocoaimage
Following up fromthe previous article about manipulating image data, Marc Palluat de Besset suggested a followup discussing the implementation of a flood fill. Today, I'm going to walk through the theory and practice of implementing flood fill on anNSBitmapImageRep.
(Read More)8 comments

Friday Q&A 2012-08-31: Obtaining and Interpreting Image Data at 2012-08-31 14:52
byMike AshTags:fridayqacocoaimage
Cocoa provides some great abstractions for working with images.NSImage lets you treat an image as an opaque blob that you can just draw where you want it. Core Image wraps a lot of image processing in an easy-to-use API that frees you from worrying about how individual pixels are represented. However, sometimes you really just want to get at the raw pixel data in code. Scott Luther suggested today's topic: fetching and manipulating that raw pixel data.
(Read More)9 comments

Friday Q&A 2012-08-24: Things You Never Wanted To Know About C at 2012-08-24 13:15
byGwynne RaskindTags:cpreprocessorevilfridayqnalinuxguest
It's been a bit since I did an article, but I'm back again, with a somewhat off-the-cuff treatment of a very twisted set of code I use to pretend that C has exceptions. I delve into little-known extensions of C, Linux compatibility, and worst of all,goto, so be warned!
(Read More)21 comments

Friday Q&A 2012-08-10: A Tour of CommonCrypto at 2012-08-10 13:21
byMike AshTags:fridayqacryptography
It's the end of another work week, and time for another Friday Q&A. Reader James Safechuck suggested that I write about encryption, and for today's article I've creatively interpreted the request and will give a tour of the built-in CommonCrypto library.
(Read More)7 comments

Friday Q&A 2012-07-27: Let's Build Tagged Pointers at 2012-07-27 13:35
byMike AshTags:fridayqnaobjectivecletsbuild
Last time on Friday Q&A, I discussed a hypothetical implementation of theNSNumber class. Starting on Mac OS X 10.7 and iOS 5,NSNumber uses a new runtime facility called tagged pointers to increase speed and reduce memory usage, the inner workings of which I want to examine today.
(Read More)17 comments

Friday Q&A 2012-07-06: Let's Build NSNumber at 2012-07-06 15:08
byMike AshTags:fridayqnaobjectivecletsbuild
NSNumber is a deceptively simple class with some interesting implementation details. In today's edition of Friday Q&A, I'll explore how to build a class that works likeNSNumber, a topic suggested by Jay Tamboli.
(Read More)9 comments

Friday Q&A 2012-06-22: Objective-C Literals at 2012-06-22 14:17
byMike AshTags:fridayqnaobjectivecclang
Welcome back! After a brief hiatus for WWDC, it's time for another wacky adventure. Today's topic is the new object literals syntax being introduced into Objective-C, which was suggested by reader Frank McAuley.
(Read More)27 comments

Friday Q&A 2012-06-01: A Tour of PLWeakCompatibility: Part II at 2012-06-01 13:38
byMike AshTags:fridayqnaobjectivecarchack
Last time, I discussed the basics of PLWeakCompatibility in terms of the motivation, the basic hooks used to get the compiler to call our code when handling__weak variables, and calling through to the original implementations where available. Today, I'm going to discuss the implementation of the zeroing weak reference facility that gets used when the runtime doesn't supply its own__weak support.
(Read More)3 comments

Friday Q&A 2012-05-18: A Tour of PLWeakCompatibility: Part I at 2012-05-18 16:53
byMike AshTags:fridayqnaobjectivecarchack
A few weeks ago, IintroducedPLWeakCompatibility. This is a small library that can be dropped into an app to enable use of the__weak qualifier on OSes that don't support it. ARC is officially supported on Mac OS X 10.6 and iOS 4, but__weak is only available on 10.7 and iOS 5.PLWeakCompatibility adds support for__weak on those older OSes when using ARC. Today I'm going to discuss howPLWeakCompatibility works on the inside.
(Read More)4 comments

Solving Simulator Bootstrap Errors at 2012-05-07 20:06
byMike AshTags:applexcodehack
I'm sure every iOS developer has seen the dreaded bootstrap error. "Couldn't register com.yourcompany.yourapp with the bootstrap server. Error: unknown error code. This generally means that another instance of this process was already running or is hung in the debugger." After nearly throwing my Mac out the window for the Nth time today, I finally managed to come up with a simple fix. Run this in the shell:launchctl list|grep UIKitApplication|awk '{print $3}'|xargs launchctl remove. And your bootstrap errors magically melt away.
(Read More)19 comments

Friday Q&A 2012-05-04: PLCrashReporter and Unwinding the Stack With DWARF, Part 2 at 2012-05-04 18:44
byGwynne RaskindTags:dwarfdebuggingsemi-evilfridayqnadangerousguest
Here I am, yet again! This week, I'm continuing where my last article left off, regarding PLCrashReporter and unwinding stack frames on x86_64. In particular, I go into how I got at and used all the various data Idiscussed in last week's article, and why some of the existing solutions in the wild weren't suited for our use.
(Read More)3 comments

Friday Q&A 2012-04-27: PLCrashReporter and Unwinding the Stack With DWARF at 2012-04-27 14:11
byGwynne RaskindTags:dwarfdebuggingsemi-evilfridayqnadangerousguest
I'm back once again for Friday Q&A. Today I'm going to talk about some work I recently did onPLCrashReporter, adding support for unwinding stack frames on x86_64. PLCrashReporter was originally targeted solely at iOS, where both ARM and x86-32 (the simulator) make crash reporting relatively straight-forward; we can simply walk the stack via the preserved frame pointer. On x86-64, matters are different, leading to the need to implement support for alternative methods for stack unwinding. This work was sponsored byHockeyApp, to support theirupcoming release of Mac OS X sandbox-compatible crash reporting. I'll talk about DWARF debugging information, the compact unwind encoding, and stack scanners. I assume at least some knowledge of x86_64 architecture, for simplicity's sake.
(Read More)8 comments

Friday Q&A 2012-04-13: Nib Memory Management at 2012-04-13 14:14
byMike AshTags:fridayqnamemorynib
I'm back from my hiatus and ready with a fresh journey into the netherworld of Apple's platforms. Today's subject comes from several readers who suggested that I discuss the subtleties of dealing with memory management and nibs, and particularly the differences between the Mac and iOS.
(Read More)17 comments

Introducing PLWeakCompatibility at 2012-03-31 03:09
byMike AshTags:objectiveccodehackarcsourcecode
As a way of atoning for the lack of a Friday Q&A today, I'm pleased to introducePLWeakCompatibility. Do you like ARC? Do you need to support older OS releases? Do you wish you could use__weak variables on those older OSes? If so, then I have good news for you! PLWeakCompatibility is the solution you've been looking for.
(Read More)5 comments

Friday Q&A 2012-03-16: Let's Build NSMutableDictionary at 2012-03-16 14:55
byMike AshTags:fridayqnaobjectivecletsbuild
Last time on Friday Q&A, we discussed how to implementNSMutableArray. Today, I'll repeat the same exercise withNSMutableDictionary and build an implementation of it from scratch.
(Read More)4 comments

Friday Q&A 2012-03-09: Let's Build NSMutableArray at 2012-03-09 13:44
byMike AshTags:fridayqnaobjectivecletsbuild
Collection classes are ubiquitous in Cocoa apps, but also fairly opaque. Today, at the suggestion of Matthew Elton, I'm going to take a look at howNSMutableArray works behind the scenes by building a replacement for it from scratch.
(Read More)23 comments

Friday Q&A 2012-03-02: Key-Value Observing Done Right: Take 2 at 2012-03-02 14:09
byGwynne RaskindTags:cocoakvofollowupsemi-evilguest
I'm back again for Friday Q&A, and this week I'm going to follow up on Mike's 2008 article,Key-Value Observing Done Right, where he debuted a replacement for KVO,MAKVONotificationCenter. It's been a long time since then, and it was high time such a useful piece of code got an update, which I gave it. With the help of Mike andTony Xiao, it's gotten a full overhaul and is now a modern code library with some fun features. In this article, I'm going to go through the new stuff and how it was done.
(Read More)20 comments

Friday Q&A 2012-02-17: Ring Buffers and Mirrored Memory: Part II at 2012-02-17 12:50
byMike AshTags:fridayqnamemoryhackcode
Last time on Friday Q&A, I started talking about implementing a ring buffer using virtual memory tricks to mirror memory. The first article concentrated on those virtual memory tricks. Today, I'm going to fill out the second half of the puzzle and show how to implement the ring buffer on top of the mirrored memory allocator we developed. If you haven't readthe previous article yet, I strongly recommend you so so, otherwise the memory mirroring is likely to be confusing.
(Read More)3 comments

Deadlocks and Lock Ordering: a Vignette at 2012-02-13 04:26
byMike AshTags:objectivecthreadingevil
Every once in a while, when writing threaded code, you may find yourself wanting to acquire two different locks in a critical section. Normally one should resist such perversions, but sometimes they just end up being necessary, or too tempting. Holding multiple locks at the same time immediately raises the specter of deadlock: if two threads acquire the same locks in a different order, they can end up waiting on each other forever.
(Read More)6 comments

Friday Q&A 2012-02-03: Ring Buffers and Mirrored Memory: Part I at 2012-02-03 16:37
byMike AshTags:fridayqnamemoryhackcode
Playing with virtual memory is always fun, and one place where it can be put to good use is in building a ring buffer. A ring buffer is a way to implement a FIFO queue of data, and using virtual memory tricks to mirror multiple copies of the same data can make the implementation simpler and better by virtually concatenating noncontiguous data. Readers Jose Vazquez and Dylan Lukes suggested that I explore the building of such a construct. Today I will talk about how to implement the virtual memory tricks, and then in part II I will show how to implement the ring buffer on top of them.
(Read More)9 comments

The Mac Toolbox: Followup at 2012-01-20 16:14
byGwynne RaskindTags:nostalgiaoldschoolclassictoolboxguestfollowup
Welcome back to Friday, NSBlog readers. Here's the promised followup to my article last week about the Mac Toolbox, where I do a line-by-line analysis of the code from the original article, alongside Mike's Friday Q&A for this week.
(Read More)8 comments

Friday Q&A 2012-01-20: Fork Safety at 2012-01-20 14:07
byMike AshTags:fridayqnaforkprocessposixsafetythreading
It's once again time to dive into bizarre programming arcana. In today's article, I want to look at the details of fork-safe code, why the restrictions are present, and why you might care, a topic suggested by Ben Mitchell.
(Read More)5 comments

Plausible Labs is Hiring at 2012-01-18 15:38
byMike AshTags:advertisementjobsminions
Plausible Labs, creators of fine software and employer of me, is looking for a software engineer in New York City or San Francisco. Do you like to create fine software? Do you want to join a worker-owned cooperative filled with great people? Do you want to work with a guy who writes a blog? If so,check out our announcement.
(Read More)1 comment

Friday Q&A 2012-01-13: The Mac Toolbox at 2012-01-13 19:28
byGwynne RaskindTags:fridayqnanostalgiaoldschoolclassictoolboxguest
Hi again, readers of NSBlog! This is my first guest post of 2012, and also my first one writing the introduction myself. I plan to do posts every two weeks, alternating with Mike's to bring back the once-a-week format. This week, at my own suggestion, I'm doing a historical piece on the original programming environment for Macs: The Mac Toolbox. Time for a trip down memory lane!
(Read More)15 comments

Buy Videos of My VTM Presentations at 2012-01-09 16:52
byMike AshTags:advertisementconferencedefensivememoryarc
I gave two presentations at the Voices That Matter conference in Boston in November. Both presentations were recorded and the videos are now available for purchase. And as a special present for my readers, you can get 35% off!
(Read More)0 comments

Friday Q&A 2012-01-06: The Hopper Disassembler at 2012-01-06 15:48
byMike AshTags:fridayqnaobjectivec
We've spent the last few weeks talking about disassembling executables and how to read the result. Today, I want to wrap up that discussion with a look at a powerful third-party disassembly tool called Hopper.
(Read More)4 comments

Avoid Apress at 2012-01-01 03:27
byMike AshTags:bookspublishingapress
Nearly three years ago, I got involved with Apress to contribute to two books. The experience went disastrously wrong. It was a profoundly unpleasant experience and I want to warn any other prospective authors to avoid this publisher, and encourage readers to buy from other publishers.Warning: this post is non-technical and something of a rant. If that's not your thing, please skip it and come back in a week when technical goodies shall resume their normal course.
(Read More)55 comments

Friday Q&A 2011-12-30: Disassembling the Assembly, Part 3: ARM edition at 2011-12-30 21:44
byGwynne RaskindTags:fridayqnaobjectivecassemblydisassemblyguest
Gwynne finishes off her series on analyzing assembly code with a look at ARM assembly, for all of your iOS needs. Gwynne will be contributing the occasional article in the future as well as a guest author, without my introductions. Watch the Author field at the top of the post to see who's writing what. Without further ado, let's take a look at ARM.
(Read More)8 comments

Friday Q&A 2011-12-23: Disassembling the Assembly, Part 2 at 2011-12-23 20:48
byGwynne RaskindTags:fridayqnaobjectivecassemblydisassemblyguest
Today I have the pleasure to present the followup to last week's guest post.Gwynne Raskind returns to complete her in-depth analysis of the assembly code generated by a small sample program.
(Read More)4 comments

Friday Q&A 2011-12-16: Disassembling the Assembly, Part 1 at 2011-12-16 15:02
byGwynne RaskindTags:fridayqnaobjectivecassemblydisassemblyguest
As a small change of pace, today's post is written by guest authorGwynne Raskind. My last post touched a bit on disassembling object files, and Gwynne wanted to dive deeply into just how to read the output in detail. Without further ado, I present her wonderful in-depth look at readingx86_64 assembly.
(Read More)10 comments

Friday Q&A 2011-12-02: Object File Inspection Tools at 2011-12-02 14:45
byMike AshTags:fridayqnaobjectivec
Being able to see all stages of your work can be immensely helpful when debugging a problem. Although you can get a lot done only looking at the source code and the app's behavior, some problems benefit immensely from being able to inspect the preprocessed source code, the assembly output from the compiler, or the final binary. It can also be handy to inspect other people's binaries. Today, I want to talk about various tools you can use to inspect binaries, both your own and other people's, a topic suggested by Carlton Gibson.
(Read More)4 comments

Testing Hashcash-Based Anti-Spam Measures at 2011-11-26 18:42
byMike AshTags:meta
Due to a recent uptick in spam comments (I've had to delete literallyseveral this week!) I decided to dust off my dormant JavaScript-based hashcash implementation and drop it into the comments system as an added anti-spam measure.
(Read More)39 comments

No Article For you! at 2011-11-25 16:48
byMike Ash
In honor of Thanksgiving (an American holiday celebrating theseven deadly sins), there is no Friday Q&A this week. I will resume next week.
(Read More)0 comments

Friday Q&A 2011-11-11: Building a Memoizing Block Proxy at 2011-11-11 16:06
byMike AshTags:fridayqnablocksobjectivecevilhack
Last time, I talked about my crazy hack that misuses the Objective-C message forwarding machinery to doblock proxying. This allows writing code that interposes in front of an arbitrary block to intercept its arguments, manipulate its return value, etc. Today, I want to present an exanmple of using this hack which almost verges on the practical. Specifically, I'm going to discuss how to use it to build a generalized block memoization facility.
(Read More)2 comments

Friday Q&A 2011-10-28: Generic Block Proxying at 2011-10-28 13:57
byMike AshTags:fridayqnablocksobjectivecevilhack
Here at Friday Q&A, I pride myself on occasionally taking my readers to places where normal people dare not tread. Today is one of those days. This is not a reader suggested topic, but today I want to talk about a fun hack I came up with that allows proxying block invocations in much the way that one can proxy Objective-C messages.
(Read More)2 comments

Friday Q&A 2011-10-14: What's New in GCD at 2011-10-14 12:01
byMike AshTags:fridayqnagcd
Happy iPhone Day to all! For those of you stuck waiting in line or waiting for the delivery guy, never fear, for I have the solution to your pain. For today's topic, Jon Shier suggested that I talk about the new features in Grand Central Dispatch in Lion and iOS 5.
(Read More)23 comments

Friday Q&A 2011-09-30: Automatic Reference Counting at 2011-09-30 15:02
byMike AshTags:fridayqnacocoamemoryarcobjectivec
Since the moment Apple announced it, readers have asked me to write about Automatic Reference Counting, or ARC. Today is the day. I'll talk about Apple's new memory management system, how it works, and how to get the most out of it.
(Read More)66 comments

Friday Q&A 2011-09-16: Let's Build Reference Counting at 2011-09-16 14:00
byMike AshTags:fridayqnacocoamemoryletsbuild
Last time, I discussed how to buildNSAutoreleasePool and how it works internally. Today, I'm going to carry that theme forward by building an implementation of Cocoa reference counting withretain andrelease, a topic suggested by David Dunham.
(Read More)7 comments

Friday Q&A 2011-09-02: Let's Build NSAutoreleasePool at 2011-09-02 16:30
byMike AshTags:fridayqnacocoaautoreleaseletsbuild
It's that time again: time for more programming craziness. Dallas Brown suggested that I talk about howNSAutoreleasePool works behind the scenes. I decided that the best way to do that would be to simply reimplement it, and that is what I'll discuss today.
(Read More)13 comments

Friday Q&A 2011-08-19: Namespaced Constants and Functions at 2011-08-19 14:40
byMike AshTags:fridayqnaobjectivecc
The inevitable rotation of the Earth means that it's once again time for another Friday Q&A. For today's edition, Jose Vazquez suggested that I discuss namespaced constants and functions in C.
(Read More)20 comments

See Me Speak at Voices That Matter in Boston at 2011-08-10 16:35
byMike AshTags:advertisementconferencedefensive
My spoken version ofDefensive Programming in Cocoa atVoices That Matter in Seattle this spring was popular enough that I've been invited back to speak again at Voices That Matter in Boston this November. If you'd like to come,sign up with Priority Code BSTSPK2 to get $150 off. If you combine that with Early Bird pricing through September 30th, your total price is only $395. As an extra bonus, I get a small kickback if you use my code!
(Read More)1 comment

Friday Q&A 2011-08-05: Method Signature Mismatches at 2011-08-05 14:45
byMike AshTags:fridayqnaobjectivecvararg
You're happily writing code one day, click Build, and suddenly the dreaded warning appears:warning: no '-fooMessage' method found (Messages without a matching method signature will be assumed to return 'id' and accept '...' as arguments.) You double-check your code and your method name is correct, so you shrug and move on. A few hours later, your program starts misbehaving strangely. What's going on? Today, I'll explore the mysterious world of Objective-C method signature mismatches, a topic suggested by an anonymous reader.
(Read More)8 comments

Friday Q&A 2011-07-22: Writing Unit Tests at 2011-07-22 16:16
byMike AshTags:fridayqnatesting
It is once again that Fridayest of all days, and time for another Friday Q&A. For today's fountain of technical goodness, reader Jay Tamboli has suggested that I discuss how to write unit tests.
(Read More)8 comments

Friday Q&A 2011-07-08: Let's Build NSNotificationCenter at 2011-07-08 16:11
byMike AshTags:fridayqnacocoanotificationsletsbuild
Notifications in Cocoa are extremely useful and are pervasive in Cocoa programming. Unfortunately, a lot of Cocoa programmers see the notification system as something of a black box: a notification is posted, Stuff Happens, and somehow the observer gets notified. Fortunately, the Stuff that Happens is actually pretty simple, and to explore it, I'm going to reimplement anNSNotificationCenter workalike from scratch to illustrate how it all works, a topic suggested by Dylan Copeland.
(Read More)7 comments

Friday Q&A Delayed Again at 2011-07-01 20:59
byMike Ash
I am sad to report that I have once again failed in my duty to bring you biweekly titillating tales of technology, and that Friday Q&A will be delayed as a result. Too much stuff going on right now, although it's good stuff, and blogging drew the short straw.
(Read More)2 comments

Friday Q&A 2011-06-17: gdb Tips and Tricks at 2011-06-17 19:49
byMike AshTags:fridayqnagdbdebugging
It has been said that programming is simply the art of debugging an empty file. While this is a bit of a narrow minded view of things, the fact is that debugging is hugely important to any serious programming. There are a lot of different ways to debug programs, ranging from writing logs to blinking a light to simply inspecting the contents of memory on a crashed system. However, the debugger is one of the most powerful tools for debugging, as you might expect, since it allows deep inspection and modification of a running program without having to anticipate your debugging needs in advance. Althoughlldb, the new debugger from the LLVM project, is quickly gaining functionality, the gold standard for debugging Cocoa apps is stillgdb. Today I'm going to discuss how to usegdb and various tips and tricks for getting the most out of it, a topic suggested by Luis de la Rosa.
(Read More)20 comments

Friday Q&A 2011-06-03: Objective-C Blocks vs. C++0x Lambdas: Fight! at 2011-06-03 15:11
byMike AshTags:fridayqnaobjectivecc++blocks
Blocks are perhaps the most significant new language feature introduced by Apple in years, and I've written a lot about them before. The new C++ standard, C++0x, introduces lambdas, a similar feature. Today, I want to discuss the two features and how they are alike and how they differ, a topic suggested by David Dunham.
(Read More)16 comments

Friday Q&A 2011-05-20: The Inner Life of Zombies at 2011-05-20 16:00
byMike AshTags:fridayqnamemoryzombiebraaaiiiinnnssss
It's Friday again, that Fridayest of days, and this week that means it's time for another Friday Q&A. Samuel Goodwin suggested discussing howNSZombie works, and that's the topic I will discuss today.
(Read More)3 comments

Friday Q&A 2011-05-06: A Tour of MABlockClosure at 2011-05-06 17:34
byMike AshTags:fridayqnablockstrampolinelibffi
It's a week late, but it's finally time for the latest edition of Friday Q&A. About a year ago, I wrote aboutconverting blocks into function pointers by building code at runtime. This was an interesting exercise, but ultimately impractical due to various limitations. In the meantime, I wroteMABlockClosure, a more robust and usable way of doing the same thing, but I never posted about it. Landon Fuller suggest I discuss how it works, and so that is what I will talk about today.
(Read More)3 comments

Friday Q&A Falls Behind at 2011-04-30 02:07
byMike Ash
Too much to do, not enough time, and I'm afraid Friday Q&A just didn't quite make the cut this week. I will see if I can make it up to everybody next week. Sorry to disappoint, and check back next week!
(Read More)3 comments

Friday Q&A 2011-04-15: Compile-Time Tips and Tricks at 2011-04-15 16:20
byMike AshTags:fridayqnacobjectivec
Greetings, salutations, and welcome to another edition of Friday Q&A, the Fridayest source of information on the internet. This week, friend of the blog Jose Vazquez had the idea of discussing miscellaneous compile-time tips and tricks in C/Objective-C, like useful preprocessor techniques and compile-time asserts.
(Read More)7 comments

Link: Implementing imp_implementationWithBlock at 2011-04-14 16:26
byMike AshTags:linkhacktrampoline
Friend of the blog Landon Fuller has created a third-party implementation of Apple's newimp_implementationWithBlock API, and has also writtena blog post on how it all works.
(Read More)0 comments

Friday Q&A 2011-04-01: Signal Handling at 2011-04-01 15:21
byMike AshTags:fridayqnasignalkqueuegcd
Happy April Fool's Day to all my readers, and welcome to one web site which won't irritate you all day with bizarre practical jokes. Instead, I bring you another edition of Friday Q&A. In this edition, I will discuss various ways of handling signals in Mac programs, a topic suggested by friend of the blogLandon Fuller.
(Read More)20 comments

Friday Q&A 2011-03-18: Random Numbers at 2011-03-18 16:19
byMike AshTags:fridayqnarandomcryptography
A mere fourteen days have passed since the last time, but here is yet another Friday Q&A. Luis de la Rosa contributed this week's topic: proper generation and use of random numbers.
(Read More)27 comments

See Me Speak at Voices That Matter in Seattle at 2011-03-08 21:20
byMike AshTags:advertisementconferencedefensive
All of a sudden, it turns out that I'm giving a talk atVoices That Matter in Seattle in April. I'll be giving a spoken-word version of my post onDefensive Programming in Cocoa. If you'd like to come, sign up with priority code SEASPK3 to get $100 off.
(Read More)0 comments

Friday Q&A 2011-03-04: A Tour of OSAtomic at 2011-03-04 18:24
byMike AshTags:fridayqnathreadingatomic
It's time for another crazy edition of Friday Q&A. Today,Paul Kim has suggested that I give a tour of OSAtomic, OS X's built-in low-level functions for lockless thread-safe operations. Given the announcement Wednesday of the dual-core iPad 2, this was a particularly prescient suggestion on his part.
(Read More)13 comments

Friday Q&A 2011-02-18: Compound Literals at 2011-02-18 16:20
byMike AshTags:fridayqnac99
We're back to our regular schedule at last. For today's edition, I'm taking a break from the usual reader-driven format to discuss a topic of my own choosing: compound literals in C99.
(Read More)17 comments

Complete Friday Q&A Direct-Sell ePub, PDF, and Print on Demand at 2011-02-04 16:17
byMike AshTags:bookepubpdfprint-on-demand
Followinglast week's ofThe Complete Friday Q&A: Volume I, I had requests for additional formats. Some asked for PDF, some asked for paper, and some asked for ePub that could be bought without the geographical restrictions of iBooks. I am happy to report that these are all available.
(Read More)4 comments

Writing the Complete Friday Q&A at 2011-01-28 20:17
byMike AshTags:bookepub
As you may have noticed,The Complete Friday Q&A is now available from iBooks and Amazon. To celebrate, I'm going to skip the regular Friday Q&A this week and instead talk about my experience in writing that book, polishing it, and the general world of self-publishing.
(Read More)7 comments

Complete Friday Q&A Now Available at 2011-01-27 21:39
byMike AshTags:bookepub
After months of hard work by an incredibly gracious group of reviewers,The Complete Friday Q&A: Volume I is now available throughiBooks andAmazon!
(Read More)24 comments

Friday Q&A 2011-01-04: Practical Floating Point at 2011-01-14 16:33
byMike AshTags:fridayqnafloat
Welcome to the first Friday Q&A of the new year. For the first post of0x7DB, I decided to write about practical floating point, a topic suggested by Phil Holland.
(Read More)18 comments

Rogue Amoeba Is Hiring Again at 2011-01-07 20:43
byMike AshTags:advertisementjobsminions
If you like reading my blog, perhaps you would enjoy working with me as well.Rogue Amoeba is currently hiring.
(Read More)1 comment

Friday Q&A 2010-12-31: C Macro Tips and Tricks at 2010-12-31 22:43
byMike AshTags:fridayqnacmacros
The year is almost over, but there's time for one last Friday Q&A before 2011 comes around. For today's post, fellow Amoeba Dan Wineman suggested that I discuss tricks for writing macros in C.
(Read More)27 comments

Friday Q&A 2010-12-17: Custom Object Allocators in Objective-C at 2010-12-17 18:27
byMike AshTags:fridayqnamemoryobjectivec
Merry holidays, happy winter, and a joyous Friday Q&A to you all. Camille Troillard suggested that I discuss how to create custom object memory allocators in Objective-C, and today I'm going to walk through how to accomplish this and why you might want to.
(Read More)16 comments

Friday Q&A 2010-12-03: Accessors, Memory Management, and Thread Safety at 2010-12-03 16:53
byMike AshTags:fridayqnaobjectivecaccessorsthreadingmemory
It's once again time for a brand new edition of Friday Q&A. This week, I'm going to talk about accessors, and how to properly deal with memory management and thread safety when creating them, a topic suggested byDaniel Jalkut.
(Read More)5 comments

Friday Q&A 2010-11-19: Creating Classes at Runtime for Fun and Profit at 2010-11-19 17:53
byMike AshTags:fridayqaobjectivec
It's time for another edition of Friday Q&A. Inthe last Friday Q&A, I discussed how to create classes at runtime in Objective-C. Today, I'm going to discuss how to actually make practical use of this technique.
(Read More)3 comments

Summary of the Current State of my Publications at 2010-11-09 05:49
byMike AshTags:bookswritingepub
I occasionally get inquiries about the books that I'm involved in, particularly the upcomingPro Objective-C for Mac and iPhone. I want to briefly summarize the publications that I'm involved with so that there's a single public place that explains it all. I will discuss them in chronological order from when I first started on each one.
(Read More)11 comments

Friday Q&A 2010-11-6: Creating Classes at Runtime in Objective-C at 2010-11-05 17:08
byMike AshTags:fridayqnaobjectivec
Friday Q&A is back! I had some very important slacking to take care of for the past couple of months, but now I'm ready to resume business as usual. For this return to Friday Q&A, I'm going to talk about how to create Objective-C classes at runtime, a topic suggested by Kevin Avila. This topic is meaty enough that this will be a two-parter; today's post will talk about the basics of how to create classes at runtime, and then the next one will discuss uses for such classes and how to take advantage of them.
(Read More)17 comments

Friday Q&A Will Return at 2010-10-14 16:07
byMike Ash
I know that some of you have been missing my biweekly ramblings on here, and I wanted to reassure you that Friday Q&A is merely sleeping and will be back soon. I'm not quite ready to resume, but anticipate restarting within a few weeks.
(Read More)0 comments

Cocoa Unbound at 2010-09-04 21:51
byMike AshTags:communitymailinglistlinkcocoa
Myrecent whining aboutridiculous moderation policies oncocoa-dev has borne fruit! Brent Simmons has graciously createdcocoa-unbound, a group dedicated to Cocoa discussion but without the foolishness. I've already joined, and I encourage you to do so as well. A well-trafficked mailing list where we can talk about Mac programming without minions of the Mothership getting in our way will be a wonderful resource to have.
(Read More)7 comments

Friday Q&A 2010-08-27: Defensive Programming in Cocoa at 2010-08-27 15:19
byMike AshTags:fridayqnadefensiveobjectiveccocoa
Welcome back to another word-laden edition of Friday Q&A. About a year ago, I wrotea post on defensive programming. That post covered defensive programming in a general sense, and Scott Gould has requested that I write one specific to various standard Cocoa practices, which is what I will be talking about today.
(Read More)20 comments

Friday Q&A 2010-08-12: Implementing NSCoding at 2010-08-13 16:35
byMike AshTags:fridayqnacocoaobjectivecnscodingserialization
Welcome back to another frightening edition of Friday Q&A. This time around, friend and local OS X coderJose Vazquez has suggested that I discuss how to implementNSCoding in Objective-C classes.
(Read More)11 comments

Friday Q&A 2010-07-30: Zeroing Weak References to CoreFoundation Objects at 2010-07-30 19:01
byMike AshTags:fridayqnacorefoundationhackevil
It's time for another friendly edition of Friday Q&A. For my last Friday Q&A, I talked aboutMAZeroingWeakRef and how it's implemented for pure Objective-C objects. For this one, I'm going to discuss the crazy hacks I implemented to make it work with toll-free bridged CoreFoundation objects as well.
(Read More)4 comments

Introducing MAZeroingWeakRef at 2010-07-16 20:19
byMike AshTags:objectiveccodehacksourcecode
I'm extremely excited to announce a new library for Cocoa and Cocoa Touch development:MAZeroingWeakRef. In short, it's a library which allows zeroing weak references to be used in retain/release Cocoa code. This has all sorts of uses and should make retain/release coding less painful. While I discussed this in detail inmy Friday Q&A post this week, I also want to make a separate announcement for people who don't want to read through all of the horrible details.
(Read More)3 comments

Friday Q&A 2010-07-16: Zeroing Weak References in Objective-C at 2010-07-16 20:18
byMike AshTags:fridayqnaobjectivecgarbagecollectionhack
It's that time of the biweek again. For this week's Friday Q&A, Mike Shields has suggested that I talk about weak references in Objective-C, and specifically zeroing weak references. I've gone a bit further and actually implemented a class that provides zeroing weak references in Objective-C using manual memory management.
(Read More)62 comments

Friday Q&A 2010-07-02: Background Timers at 2010-07-02 16:45
byMike AshTags:fridayqnablocksgcd
Welcome back to another Friday Q&A. This week I'm departing from my usual user-driven format to present a class I've written for what I'm calling "background timers", and discuss potential uses for it.
(Read More)0 comments

Blocks and GCD in Russian at 2010-06-29 15:22
byMike AshTags:blocksgcdtranslation
Alexander Babaev has been kind enough to translate my series of posts on blocks and GCD into Russian forTouchDev.ru. So far he has posted two,Blocks in Objective-C andIntro to Grand Central Dispatch, Part I. Others in the series will be going up in the future. If you happen to speak Russian, check them out!
(Read More)0 comments

Friday Q&A 2010-06-18: Implementing Equality and Hashing at 2010-06-18 14:48
byMike AshTags:fridayqnaisequalhashcocoaobjectivec
Welcome back to a late edition of Friday Q&A. WWDC pushed the schedule back one week, but it's finally time for another one. This week, I'm going to discuss the implementation of equality and hashing in Cocoa, a topic suggested by a reader.
(Read More)20 comments

Friday Q&A 2010-05-28: Leopard Collection Classes at 2010-05-28 16:43
byMike AshTags:fridayqnacollectionscocoa
Welcome back to another edition of Friday Q&A. For this week's post, I'm going to talk about three somewhat obscure collections classes that were introduced to Cocoa in 10.5:NSPointerArray,NSHashTable, andNSMapTable, a topic suggested by Phil Holland.
(Read More)8 comments

Some Light Reading at 2010-05-21 16:02
byMike AshTags:link
As I mentioned last week, I'm shifting Friday Q&A to a biweekly schedule, so there will be no Friday Q&A this week. However, I've dug up a few articles that I enjoyed reading this week and that I thought you might enjoy as well.
(Read More)2 comments

Friday Q&A 2010-05-14: What Every Apple Programmer Should Know at 2010-05-14 15:36
byMike AshTags:fridayqnaapplecocoaadvice
Welcome back to another Friday Q&A. This week, Quentin Carnicelli (who is heavily involved in generating my paychecks) has suggested that I talk about things that every Apple programmer should know. In other words, common Cocoa design and implementation decisions that I'd prefer Apple not to make.
(Read More)28 comments

iPhone Apps I Can't Have at 2010-05-14 02:46
byMike AshTags:iphonerantapple
During a recent discussion on Twitter about Apple's draconion App Store policies, I mentioned that there's a long list of apps I want which Apple does not allow, and thus these restrictions directly hurt me not only as a developer, but as an iPhone user. This made@pbur curious, and he indicated he'd like to know what those apps are. So I sat down and came up with a list of apps that I really want for my iPhone but that Apple won't let me have. To the best of my knowledge, every single one of these ideas is completely feasible in a technical sense, wouldn't destroy the cell network, wouldn't make your phone's battery life unusably short, and are kept out of my hands solely because Apple thinks it knows what's best for me.
(Read More)49 comments

Another Week Without Friday Q&A at 2010-05-07 23:08
byMike Ash
I must apologize, but I ran out of time this week and don't have a Friday Q&A for you to enjoy. If you want something to read, you might enjoy+initialize Can Be Executed Multiple Times (+load not so much) from Bill Bumgarner,Collection Extensions from friend-of-the-blog Guy English, andlaunchd: Better than sliced bread! from Chris Hanson.
(Read More)0 comments

Friday Q&A 2010-04-30: Dealing with Retain Cycles at 2010-04-30 15:29
byMike AshTags:fridayqnacocoamemoryretainrelease
Happy iPad 3G day to everyone. Whether you're waiting in line, waiting for the delivery guy, or just pining at home like I am, you can fill your idle moments with another edition of Friday Q&A. This week, Filip van der Meeren has suggested that I discuss retain cycles and how to deal with them.
(Read More)15 comments

Friday Q&A 2010-04-23: Implementing a Custom Slider at 2010-04-23 16:01
byMike AshTags:fridayqnacocoacontrols
Welcome to another chilling edition of Friday Q&A. While I hope to be soaring over the scenic Shenandoah Valley on this fine Friday, I have taken the precaution of preparing my post in advance, so that you may see it even while I am incommunicado. Such is the magic of the modern world. This week, Michael Crawford has suggested that I give in example of implementing a custom control in Cocoa.
(Read More)9 comments

Mistakes and Chains of Events at 2010-04-19 19:18
byMike AshTags:appleiphonerantlinkrogueamoeba
For those of you who don't readmy employer's blog, I just made a post over there titledMistakes and Chains of Events. It discusses the recent news about political cartoonist Mark Fiore's iPhone rejection, the bigger picture of Apple's system and policies, and my perception that Apple is not learning the right lessons from the various problems that they're encountering.
(Read More)0 comments

Friday Q&A 2010-04-16: Implementing Fast Enumeration at 2010-04-16 16:35
byMike AshTags:fridayqnaobjectivecenumeration
Last week I discussedthe various options available in Objective-C for enumerating over a collection This week I'm going to finish up the discussion of enumeration with a guide on how to implement Fast Enumeration in your own program.
(Read More)17 comments

An Objective-C Continuations Library at 2010-04-13 16:25
byMike AshTags:objectiveccontinuationblocks
A couple of months ago I wrote aboutusing Continuation Passing Style in Objective-C as an alternative technique for returning errors from methods. The major downside to that technique is that it integrates poorly with Cocoa, since Cocoa isn't written to use CPS. Jordan Breeding has spent the intervening time building upan impressive CPS adapter library which allows converting any CocoaNSError ** call into CPS style with virtually no work. Source code and extensive examples are available, and I encourage you tocheck it out.
(Read More)2 comments

Friday Q&A 2010-04-09: Comparison of Objective-C Enumeration Techniques at 2010-04-09 11:17
byMike AshTags:fridayqnansfastenumerationobjectivec
Welcome back to another edition of Friday Q&A. Preston Sumner has suggested that I talk about different ways of enumerating over collections in Cocoa, and how to implement Fast Enumeration. This will be a two part series: this week I will look at the different enumeration techniques and their pros and cons, and then next week I will take you through implementing Fast Enumeration on a custom object.
(Read More)7 comments

Friday Q&A 2010-04-02: OpenCL Basics at 2010-04-02 11:28
byMike AshTags:fridayqnaopencl
I'm back in action at last, so it's time for another Friday Q&A. This week, both someone named "charles" and Brian Olsen have suggested that I talk about OpenCL, so I'm going to go through the basics of what OpenCL is and how to do some simple computation with it.
(Read More)6 comments

And Again at 2010-03-26 21:10
byMike Ash
I hate to skip even one week, let alone two in a row, but a biological self-replicator is currently interfering with my ability to write and so I have to skip Friday Q&A once again this week. I will really try to get one out next Friday, assuming the self-replicator can be defeated, promise!
(Read More)2 comments

Friday Q&A Skips a Week at 2010-03-19 22:01
byMike Ash
Due to the unfortunate actions of a large, shadowy government conspiracy, there will be no Friday Q&A this week. I plan to resume the regular schedule next week. Sorry to disappoint, but check back next Friday.
(Read More)0 comments

Friday Q&A 2010-03-12: Subclassing Class Clusters at 2010-03-12 18:51
byMike Ash
Welcome to another chewy edition of Friday Q&A. This week, Gwendal Roué has suggested talking about the techniques of subclassing class clusters.
(Read More)12 comments

Friday Q&A 2010-03-05: Compound Futures at 2010-03-05 13:53
byMike AshTags:fridayqnafuturesblocks
Welcome back to another thrilling edition of Friday Q&A. This week I want to extend mydiscussion from last week about futures, and talk about compound futures, an extension to the basic futures system that I developed previously.
(Read More)0 comments

Friday Q&A 2010-02-26: Futures at 2010-02-26 18:19
byMike AshTags:fridayqnafuturesblocks
Welcome back to another shiny edition of Friday Q&A.Guy English suggested taking a look at implementing futures in Objective-C using blocks, and for this week's post I'm going to talk about the futures implementation that I built.
(Read More)10 comments

Friday Q&A 2010-02-19: Character Encodings at 2010-02-19 22:15
byMike AshTags:fridayqnaunicodeencodingtext
It's another Friday and another Friday Q&A. For this week's post, Joshua Pokotilow has suggested that I talk about character encodings, so I want to give a basic tour of just what a character encoding is, how it works, and useful details about common encodings.
(Read More)12 comments

Friday Q&A 2010-02-12: Trampolining Blocks with Mutable Code at 2010-02-12 18:20
byMike AshTags:fridayqnablockstrampolineassemblyevil
Welcome to another edition of Friday Q&A, where deep technical talk and complete insanity combine! This week, I'm going to take a quick break from my usual reader-driven format and talk about a little toy I built earlier in the week, an adapter betweenblocks and more traditional function-pointer-based callback systems.
(Read More)3 comments

Friday Q&A 2010-02-05: Error Returns with Continuation Passing Style at 2010-02-05 18:36
byMike AshTags:fridayqnablocksobjectiveccontinuationserrorhandling
The Earth has moved 6.9 degrees around the Sun since my last post, which means it's time for another edition of Friday Q&A. This 6.9-degree segment, Guy English has suggested that I talk about the use of continuation passing style to simplify error returns in Objective-C code.
(Read More)28 comments

Friday Q&A 2010-01-29: Method Replacement for Fun and Profit at 2010-01-29 19:00
byMike AshTags:fridayqnaobjectivecswizzlingoverrideevil
It's that time of the week again. For this week's Friday Q&A Mike Shields has suggested that I talk about method replacement and method swizzling in Objective-C.
(Read More)28 comments

Friday Q&A 2010-01-22: Toll Free Bridging Internals at 2010-01-22 16:57
byMike AshTags:fridayqnacorefoundationbridging
It's been a week, and once again, it's time for a Friday Q&A. For this week's edition, I'm going to talk about how toll-free bridging works, a topic suggested by Jonathan Mitchell.
(Read More)16 comments

Friday Q&A 2010-01-15: Stack and Heap Objects in Objective-C at 2010-01-15 21:58
byMike AshTags:fridayqnastackheapmemory
Welcome to another Friday Q&A. I survived my travel and am (just barely) ready to write another exciting edition. This week's topic comes fromGwynne, who asked why Objective-C only uses heap objects, and no stack objects.
(Read More)22 comments

Friday Q&A 2010-01-08: NSNotificationQueue at 2010-01-08 07:21
byMike AshTags:fridayqnacocoanotifications
It's that time of the week again. No, it's not just time to go get drunk, but time for Friday Q&A! This week's topic, suggested by Christopher Lloyd ofCocotron (a really neat open source project that lets you write Objective-C/Cocoa code for non-Mac platforms like Windows), isNSNotificationQueue, a little-known, poorly-understood, but handy Foundation class.
(Read More)21 comments

Friday Q&A 2010-01-01: NSRunLoop Internals at 2010-01-01 10:43
byMike AshTags:fridayqnacocoarunloop
It's the first Friday of the new year, and that means it's time for the first Friday Q&A of 2010. This week, I'm taking Dave DeLong's suggestion of talking aboutNSRunLoop internals.
(Read More)12 comments

Friday Q&A 2009-12-18: Highlights From a Year of Friday Q&A at 2009-12-18 11:18
byMike AshTags:fridayqnapointless
It's hard to believe that it's been a full year (minus a day) sincemy first Friday Q&A. It's become more successful than I thought possible, and many kind and obviously deluded people have said great things about it to me. Since I'm feeling lazy this week, I thought I'd pull up some highlights from the past year rather than write anything new.
(Read More)3 comments

Rogue Amoeba Is Hiring at 2009-12-18 06:54
byMike AshTags:jobsminionsadvertisement
As some of you already know, I work forRogue Amoeba, and it just so happens thatwe're hiring.
(Read More)0 comments

Friday Q&A 2009-12-11: A GCD Case Study: Building an HTTP Server at 2009-12-11 23:58
byMike AshTags:fridayqnagcdhttpnetworkinggenerators
It's time for another wintry edition of Friday Q&A. From the comfort of your toasty-warm homes, you can read about building an HTTP server using Grand Central Dispatch, a topic suggested by a reader.
(Read More)7 comments

Friday Q&A 2009-12-04: Building Standalone iPhone Web Apps at 2009-12-04 19:29
byMike AshTags:iphonewebjavascripthtml
Welcome to another edition of Friday Q&A. This week I'm going to talk about building standalone iPhone web apps, web apps that have an icon on the home screen, and which start a separate program when tapped, just like native apps, a topic suggested by Mike Shields.
(Read More)6 comments

Friday Q&A 2009-11-27: Using Accessors in Init and Dealloc at 2009-11-27 16:32
byMike AshTags:cocoaobjectivecaccessors
It's Black Friday, and that means it's time for another Friday Q&A. Today I'm going to talk about the use of accessors in Objective-C init/dealloc methods, a topic suggested byJon Trainer.
(Read More)19 comments

Friday Q&A 2009-11-20: Probing Cocoa With PyObjC at 2009-11-21 02:44
byMike AshTags:cocoapythonpyobjcobjectivechack
It's another Friday and time for another Friday Q&A. This week, fellow Amoeba Jeff Johnson suggested talking about using Cocoa from the command line using Python and PyObjC.
(Read More)9 comments

Deconstructing Apple's Copyright and Trademark Guidelines at 2009-11-17 02:08
byMike AshTags:appleiphoneevilrantstupid
It's well known that every member of the official iPhone developer program is bound by Apple's iPhone SDK agreement. What seems to be much less well known is that the agreement also binds developers to follow Apple's "Copyright and Trademark Guidelines", which add a huge list of restrictions to what an iPhone developer can and cannot do.
(Read More)19 comments

Friday Q&A 2009-11-13: Dangerous Cocoa Calls at 2009-11-13 20:38
byMike AshTags:cocoathreadingdangerous
It's another Friday, and so time for another Friday Q&A. This week, Quentin Carnicelli (one of the guys who signs my paychecks) suggested that I talk about dangerous API calls in Cocoa.
(Read More)50 comments

Friday Q&A 2009-11-06: Linking and Install Names at 2009-11-07 00:18
byMike AshTags:linkinglibrariesframeworks
It's another Friday, and thus another Friday Q&A. I have recovered from the confusion of the Daylight Saving Time transition and am now ready to talk about Mac OS X linking, install names,@executable_path, and friends.
(Read More)16 comments

Friday Q&A 2009-10-30: Generators in Objective-C at 2009-10-30 16:59
byMike AshTags:fridayqnagenerators
It's Friday again and time for another Friday Q&A. This week I'm going to discuss a framework for creating generators in Objective-C. I'm indulging myself a bit with this, because nobody suggested it, but nothing in my suggestion bank inspired me this time around, so I decided to go with something of my own.
(Read More)10 comments

Friday Q&A 2009-10-23: A Preview of Coming Attractions at 2009-10-23 15:45
byMike AshTags:fridayqnagenerators
I'm afraid that I ran out of time this week and wasn't able to put together a real Friday Q&A. However, as a preview of what I'll be talking about next week, check out theMAGenerator project in my public subversion repository.
(Read More)2 comments

Friday Q&A 2009-10-16: Creating a Blocks-Based Object System at 2009-10-16 15:50
byMike AshTags:fridayqnablocksevil
It's Friday again, and that means another Friday Q&A. This week, Guy English proposed talking about a blocks-based object system, and that is what I will do. The system I've developed is a rudimentary system for doing object-oriented programming in pure C (plus blocks), and I'll discuss how it works and how to use it.
(Read More)18 comments

XBolo is Out! at 2009-10-09 23:56
byMike AshTags:boloxbologames
My good friend Robert has been working on this for many years, and it's finally out for the public. For those of you who know what it is,XBolo is a fully Mac OS X native clone of the old Bolo game for the Mac, with live fullscreen graphics and much improved networking.
(Read More)2 comments

Friday Q&A 2009-10-09: Defensive Programming at 2009-10-09 16:03
byMike AshTags:fridayqnadefensive
It's that time of the week again. This week I'm going to discuss defensive programming, a topic suggested by Ed Wynne.
(Read More)8 comments

Friday Q&A 2009-10-02: Care and Feeding of Singletons at 2009-10-02 15:59
byMike AshTags:fridayqnacocoaobjectivecsingleton
It's time for another Friday Q&A. I hope everyone who had a chance to go to C4 had a good time and is back home safe and sound. This week I'm going to discuss singletons, both how to make them and when to use them, as suggested by Jon Trainer.
(Read More)27 comments

Friday Q&A 2009-09-25: GCD Practicum at 2009-09-25 11:52
byMike AshTags:fridayqnagcdperformancesourcecode
Welcome back to another Friday Q&A. I'm off to C4 today (hope to see you there!) but I've prepared this in advance so everyone stuck at home (or worse, work) can at least have something interesting to read. Over the past four weeks I've introduced Grand Central Dispatch and discussed the various facilities it provides. InPart I I talked about the basics of GCD and how to use dispatch queues. InPart II I discussed how to use GCD to extract more performance from multi-core machines. InPart III I discussed GCD's event dispatching mechanism, and inPart IV I took care of various odds and ends that I hadn't covered before. This week I'm going to examine a practical application of using GCD to speed up the production of thumbnails for a large quantity of images, a topic suggested by Willie Abrams.
(Read More)19 comments

Friday Q&A 2009-09-18: Intro to Grand Central Dispatch, Part IV: Odds and Ends at 2009-09-18 17:23
byMike AshTags:fridayqnagcdperformance
It's that time of the week again. Over the past three weeks I've introduced you to the major pieces Grand Central Dispatch, an exciting new API for parallel processing and event handling in Snow Leopard.The first week I covered basic concepts and dispatch queues.The second week I discussed how to use dispatch queues for parallel processing on multi-core computers.The third week I covered GCD's event handling system. This week I'm going to cover various odds and ends which I didn't get to before: dispatch queue suspension and targeting, semaphores, and one-time initialization.
(Read More)7 comments

The iPhone Development Story: One Year Later at 2009-09-17 16:56
byMike AshTags:iphonerant
A year ago today I postedThe iPhone Development Story, detailing all of the insane and largely pointless steps required to build an iPhone application. The article was incredibly popular, seeing tens of thousands of hits that weekend and still generating fresh comments even to this day. Now, a year later, it's time to look back and see where we stand today.
(Read More)57 comments

GCD Is Not Blocks, Blocks Are Not GCD at 2009-09-11 21:27
byMike AshTags:gcdrant
There's a lot of discussion going around the internet lately about blocks and Grand Central Dispatch. They're both great new technologies that have seen the light of day with the 10.6 release, and they see a lot of use together. However, a lot of the people discussing blocks and GCD don't seem to understand that they are not, in fact, the same thing, and aren't even really related. I just wanted to make a quick note here to describe exactly what each one is, how they're different, and how they work together.
(Read More)6 comments

Friday Q&A 2009-09-11: Intro to Grand Central Dispatch, Part III: Dispatch Sources at 2009-09-11 15:28
byMike AshTags:fridayqnagcdperformance
Welcome back to another Friday Q&A. This week I continue the discussion of Grand Central Dispatch from the past two weeks. In the last two weeks I mainly focused on dispatch queues. This week I'm going to examine dispatch sources, how they work, and how to use them.
(Read More)14 comments

Friday Q&A 2009-09-04: Intro to Grand Central Dispatch, Part II: Multi-Core Performance at 2009-09-04 01:51
byMike AshTags:fridayqnagcdperformance
Welcome back to Friday Q&A. Last week I discussed the basics of Grand Central Dispatch, an exciting new technology in Snow Leopard. This week I'm going to dive deeper into GCD and look at how you can use GCD to take advantage of multi-core processors to speed up computation. This post assumes that you'veread last week's edition, so be sure to do that if you haven't already.
(Read More)12 comments

Objective-C Runtime Podcast Episode at Mobile Orchard at 2009-08-31 16:39
byMike AshTags:interviewlink
Last week I recorded an interview with Dan Grigsby ofMobile Orchard and today it showed up in his podcast. It's pretty much the same material as covered inmy series on the Objective-C runtime but now in audio form, so if you like audio thenget to the podcast here.
(Read More)4 comments

Friday Q&A 2009-08-28: Intro to Grand Central Dispatch, Part I: Basics and Dispatch Queues at 2009-08-28 14:16
byMike AshTags:fridayqnagcdperformance
Welcome back to Friday Q&A. This week's edition lines up with Apple's release of Snow Leopard, so I'm going to take this opportunity to open up the discussion on previously NDA'd technologies and talk about some of the cool stuff now available in Snow Leopard. For this week I'm going to start what I plan to be an ongoing series on Grand Central Dispatch, a topic suggested byChris Liscio.
(Read More)26 comments

Unicode Comments Support at 2009-08-22 20:55
byMike AshTags:metaunicodepython
As some of you are aware, my comment system did not support non-ASCII characters. This is not because I am unaware that there exists a world outside of the United States. No, it's simply that I could never force the horrible combination of Python and MySQL to cooperate when it came to non-ASCII characters. I struggled with it for a long time, and finally gave up. Well, I'm happy to say that I have finally solved the problem and my blog now supports Unicode comments!
(Read More)13 comments

Reading Between the Lines of Apple's FCC Reply at 2009-08-21 23:17
byMike AshTags:iphonelink
I've just written a blog post formy evil taskmasters which I thought this audience would be interested in too. It's calledReading Between the Lines of Apple's FCC Reply and talks about Apple's response to the FCC's inquiry over the rejection of the Google Voice iPhone application. My favorite part is, "With 17,000 reviews per week and 45 reviewers, that means each reviewer performs 378 reviews per week. At 40 hours per week, this is 9.4 reviews per hour, orone review every 6.4 minutes." I encourage you to make your way over to Under the Microscope andread the whole thing.
(Read More)1 comment

Friday Q&A 2009-08-21: Writing Vararg Macros and Functions at 2009-08-21 15:15
byMike AshTags:fridayqnacvarargmacro
Welcome to another Friday Q&A, where all references are strong and all values are above average. This week I'm going to talk about how to write macros and functions that take variable arguments in C, as suggested by Damien Sorresso.
(Read More)17 comments

Friday Q&A 2009-08-14: Practical Blocks at 2009-08-14 20:06
byMike AshTags:fridayqnablocks
Welcome back to another edition of Friday Q&A. I'm back from my break and ready to bring you more programming goodies. This week I want to take Landon Fuller's suggestion to write a followup tomy original Friday Q&A on blocks now that the design is finalized and code available for them.
(Read More)42 comments

Friday Q&A 2009-07-17: Format Strings Tips and Tricks at 2009-07-17 15:21
byMike AshTags:fridayqnac
Greetings and welcome back to Friday Q&A. This week I'm going to discuss some tips and tricks for usingprintf-style format strings in C, as suggested by Kevin Avila.
(Read More)26 comments

Friday Q&A 2009-07-10: Type Specifiers in C, Part 3 at 2009-07-10 13:00
byMike AshTags:fridayqnac
Here at last is the conclusion to Friday Q&A's three-part series on C type specifiers. Thefirst week I discussedconst andrestrict.Last week I discussed the basics ofvolatile and why it's not very useful. This week I'm going to finish up by discussing the use ofvolatile in a multithreaded context.
(Read More)9 comments

Friday Q&A 2009-07-03: Type Specifiers in C, Part 2 at 2009-07-03 13:20
byMike AshTags:fridayqnac
Welcome to another edition of Friday Q&A.Last week I began to talk about type qualifiers in C, and discussed the meaning and use of theconst andrestrict qualifiers. This week I will continue with a discussion of the third qualifier,volatile.
(Read More)1 comment

Friday Q&A 2009-06-26: Type Qualifiers in C, Part 1 at 2009-06-26 16:11
byMike AshTags:fridayqnac
Welcome back to another warm and fuzzy edition of Friday Q&A. This week I'm going to discuss the use of type qualifiers in C, a subject suggested by Nate Vander Wilt.
(Read More)17 comments

Friday Q&A 2009-06-19: Mac OS X Process Memory Statistics at 2009-06-19 13:48
byMike AshTags:fridayqnamemoryperformance
Welcome back to another Friday Q&A. Now that WWDC is behind us, I'm back on track to bring you more juicy highly-technical goodness. Maybe I can even get back to doing one a week.... This week I'm going to take André Pang's suggestion of discussing process memory statistics (the stuff you see in Activity Monitor ortop) in Mac OS X.
(Read More)19 comments

Friday Q&A 2009-06-05: Introduction to Valgrind at 2009-06-05 15:55
byMike AshTags:fridayqnavalgrind
Welcome back to another late Friday Q&A. My apologies to all of my readers for missing last week's edition. Some family events beyond the scope of this blog prevented me from writing one. And I should probably point out right now that WWDC is almost certainly going to prevent me from writing one next week. This week, however, Ido have a post, and I'm going to be talking about Valgrind as suggested by Landon Fuller.
(Read More)8 comments

Friday Q&A 2009-05-22: Objective-C Class Loading and Initialization at 2009-05-23 00:37
byMike AshTags:fridayqnaobjectivec
Welcome back to another cromulent Friday Q&A. After taking a few weeks off I intend to resume the regular schedule. We'll see how far that intention takes me, but I'm hopeful. This week I'm going to take Daniel Jalkut's suggestion to discuss class loading and initialization in Objective-C.
(Read More)19 comments

Use NSOperationQueue at 2009-05-12 21:18
byMike AshTags:nsoperationqueueosbug
Mac OS X 10.5.7 has shipped and includes a fix forthe NSOperationQueue bug that I discovered late last year. I have run all of my old test cases against 10.5.7 and it appears to perform as advertised. As far as I can see, NSOperationQueue is now safe to use. I'm glad that my prediction of no fix until Snow Leopard turned out to be wrong. Enjoy!
(Read More)4 comments

Nanogolf at 2009-05-08 16:22
byMike AshTags:iphonelink
I'm afraid I have to skip Friday Q&A one more week but I hope to be back up next week, because one of the things that's been keeping me busy has finally shipped! It's calledNanogolf, and it's a multiplayer mini golf game for the Mac and iPhone. My partner and I have been hard at work on this for a long time and it's nice to finally see it out in the wild. The Mac version is free, the iPhone version is cheap, and they can play against each other. Go forth and soothe your Q&A pangs with a nice round of miniature golf.
(Read More)2 comments

Friday Q&A 2009-05-01: On Hold at 2009-05-01 19:31
byMike AshTags:content-free
The cyclic functions which underlie my life all seem to have come to a maximum recently. Friday Q&A being one that I can most easily control, I've decided to skip this week to concentrate on the rest. I hope to return next week, although as usual, no promises.
(Read More)0 comments

Friday Q&A 2009-04-24: Code Generation with LLVM, Part 2: Fast Objective-C Forwarding at 2009-04-24 01:35
byMike AshTags:fridayqnallvm
It's Friday again, and that means another Friday Q&A. As promised, this week's edition will pick up where last week's left off.Last week I discussed the basics of generating code at runtime using LLVM. This week I'm going to build on that base and show how to use LLVM to perform fast forwarding in Objective-C.
(Read More)15 comments

Friday Q&A 2009-04-17: Code Generation with LLVM, Part 1: Basics at 2009-04-17 11:07
byMike AshTags:fridayqnallvm
Welcome back to another heart-pounding edition of Friday Q&A. Phil Holland and Ed Wynne both suggested that I do something with LLVM, and so I'm going to discuss how to generate and call code at runtime using LLVM. This week I'm going to talk about the basics needed to get up and running with code generation, and then next week in Part 2 I'm going to show how you can use this technique to build a fast Objective-C trampoline object.
(Read More)11 comments

Friday Q&A 2009-04-10: Multithreaded Optimization in ChemicalBurn at 2009-04-10 17:22
byMike AshTags:fridayqnachemicalburnperformancethreading
Welcome to another Friday Q&A, where all the women are strong, all the men are good-looking, and all the programmers are above average. This week, Phil Holland has suggested that I dissect an interesting piece of code from one of my screensavers, so we're going to take a look atChemicalBurn's multithreaded routing code.
(Read More)0 comments

Friday Q&A 2009-04-03: On Hold at 2009-04-03 19:38
byMike AshTags:content-free
Due to personal reasons, Friday Q&A will not be published this week. While I make no promises, I expect to resume the regular schedule next week. I will be more likely to resume the regular schedule if I have some good ideas to work with, sosend them in!
(Read More)0 comments

Friday Q&A 2009-03-27: Objective-C Message Forwarding at 2009-03-27 16:50
byMike AshTags:fridayqnaobjectivec
Welcome back to another exciting Friday Q&A. This week I'm going to continue the series on the Objective-C runtime. Yuji Tachikawa suggested talking about how@dynamic properties work in CoreData and I'm going to take that and expand it to talk about message forwarding in general.
(Read More)12 comments

Friday Q&A 2009-03-20: Objective-C Messaging at 2009-03-21 01:59
byMike AshTags:fridayqnaobjectivec
Welcome back to another Friday Q&A. This week I'd like to take Joshua Pennington's idea and elaborate on a particular facet last week's topic of the Objective-C runtime, namely messaging. How does messaging work, and what exactly does it do? Read on!
(Read More)5 comments

Friday Q&A 2009-03-13: Intro to the Objective-C Runtime at 2009-03-13 14:13
byMike AshTags:fridayqnaobjectivec
Welcome back to another Friday Q&A, on another Friday the 13th. This week I'm going to take Oliver Mooney's suggestion and talk about the Objective-C runtime, how it works, and what it can do for you.
(Read More)13 comments

Friday Q&A 2009-03-06: Using the Clang Static Analyzer at 2009-03-06 22:19
byMike AshTags:fridayqnaclang
Welcome back to another exciting Friday Q&A. This week's topic, suggested by Ed Wynne, will be an overview of the Clang Static Analyzer and an example of how to use it.
(Read More)13 comments

Friday Q&A 2009-02-27: Holistic Optimization at 2009-02-27 04:21
byMike AshTags:fridayqnarantperformance
Welcome back to Friday Q&A, a bit early this week since I won't be around to post it at the usual time. This week I'm going to cheat a little bit and use a topic that I "suggested" myself. I'll be talking about what I like to call "holistic optimization", which is essentially how to look at optimization within the context of your entire project, rather than bit-swizzling, loop unrolling, and other micro-optimizations.
(Read More)4 comments

Friday Q&A 2009-02-20: The Good and Bad of Distributed Objects at 2009-02-20 20:40
byMike AshTags:fridayqnaperformancecocoaipc
Welcome back to another Friday Q&A. This week I'm going to take Erik's (no last name given) suggestion frommy interprocess communication post and expand a bit on Distributed Objects, what makes it so cool, and the problems that it has.
(Read More)9 comments

Friday Q&A 2009-02-13: Operations-Based Parallelization at 2009-02-13 20:31
byMike AshTags:fridayqnaperformancensoperationqueue
Welcome back to Friday Q&A, which this week is also Friday the Thirteenth! Be especially careful, as this is the first of two consecutive Friday the Thirteenths. For this first Friday the Thirteenth I'm going to talk about parallel software design using an "operations" approach (think NSOperation), as suggested by Nikita Zhuk way back when I first started this whole thing.
(Read More)2 comments

Late Night Cocoa: NSOperationQueue Problems at 2009-02-11 18:04
byMike AshTags:interviewnsoperationqueuelink
I've done another appearance on Late Night Cocoa, this time discussingNSOperationQueue problems. Check it out over atThe Mac Developer Network.
(Read More)0 comments

Friday Q&A 2009-02-06: Profiling With Shark at 2009-02-06 17:30
byMike AshTags:fridayqnasharkperformance
Welcome back to Friday Q&A.; This week I'm taking Jeff Johnson's idea to discuss optimization and profiling tools.
(Read More)2 comments

Friday Q&A 2009-01-30: Code Injection at 2009-01-30 18:34
byMike AshTags:fridayqnacodeinjectionhackevil
Welcome back to another exciting Friday Q&A.; This week I'll be taking Jonathan Mitchell's suggestion to talk about code injection, the various ways to do it, why you'd want to, and why you wouldn't want to.
(Read More)31 comments

Friday Q&A 2009-01-23 at 2009-01-23 21:31
byMike AshTags:fridayqnakvo
Welcome to the first Friday Q&A; of the new Presidential administration. Unlike Mr. Obama, I'm afraid of change and so this week's edition will be just like all the other ones. This week I'll be taking Jonathan Mitchell's suggestion to talk about how Key-Value Observing (KVO) is actually implemented at the runtime level.
(Read More)17 comments

Friday Q&A 2009-01-16 at 2009-01-16 22:35
byMike AshTags:fridayqnaipc
Happy Friday to everyone, and welcome back to another Friday Q&A. This week I'll be taking Eren Halici's suggestion to discuss the various ways to do interprocess communication on OS X.
(Read More)16 comments

Friday Q&A 2009-01-09 at 2009-01-09 21:38
byMike AshTags:fridayqnathreadingcocoa
Greetings one and all. I caught my mistaken writing of "2008" in this blog post title almost instantly instead of only noticing after I'd already posted it like I did last week, so the year must be coming along. Welcome to the second Friday Q&A of 2009 (and only the fourth in all human history!) where I'll be taking Ed Wynne's suggestion and talking about the various meanings and implications of thread safety as they apply to Mac OS X system frameworks.
(Read More)4 comments

Friday Q&A 2009-01-02 at 2009-01-02 23:06
byMike AshTags:fridayqnaprivateapi
It's a new year, and that means a new Friday Q&A! This week I'm going to take a reader's suggestion and discuss the ups and downs of using private APIs.
(Read More)13 comments

Friday Q&A 2008-12-26 at 2008-12-26 17:19
byMike AshTags:fridayqnablocks
Welcome to another Friday Q&A. This week I thought I would take fellow amoeboid Jeff Johnson's suggestion and talk about blocks in Objective-C.
(Read More)42 comments

Friday Q&A 2008-12-19 at 2008-12-20 01:28
byMike AshTags:fridayqnathreadingparallelismperformance
Great response last week. This week I'm going to merge Sam McDonald's question about how I got into doing multithreaded programming and Phil Holland's idea of talking about the different sorts of parallelism available.
(Read More)6 comments

Friday Q&A at 2008-12-13 05:00
byMike AshTags:fridayqna
In an effort to liven up the blog a bit, I thought I would start soliciting topics from the readership. Given the large number of comments on certain past posts and the couple hundred unique hits to my RSS feed URL every day, I'm hoping that this might just work out.
(Read More)4 comments

RAOperationQueue, an open-source replacement for NSOperationQueue at 2008-12-02 17:24
byMike AshTags:nsoperationqueuelinkbug
The other day I posted about howNSOperationQueue is broken and can't be used. At Rogue Amoeba we liked the API so much we decided to create a non-broken version, so we'vereleased RAOperationQueue. It's not a 100% replacement, as it has some significant limitations (and some benefits) compared to NSOperationQueue, but we've found it to be very useful. For more information, click the link above.
(Read More)2 comments

Don't Use NSOperationQueue at 2008-11-30 23:36
byMike AshTags:nsoperationqueueosbug
I've been discussing thison cocoa-dev but wanted to make a separate post about it to get the word out further. NSOperationQueue is broken on Leopard and will cause crashes. Don't use it!
(Read More)42 comments

Key-Value Observing Done Right at 2008-10-22 21:47
byMike AshTags:cocoakvosourcecode
Cocoa's Key-Value Observing facilities are extremely powerful and useful. Unfortunately they have a really terrible API that's inherently broken in a couple of different ways. I want to discuss how it's broken, and a way to make it better.
(Read More)23 comments

The How and Why of Cocoa Initializers at 2008-10-09 23:43
byMike AshTags:cocoaobjectivecsuperinitinitializer
One of the longest ongoing controversies in the Cocoa community is how to write your init methods. More specifically, how to properly call your superclass's initializer. In the hopes of putting this controversy to rest, I want to walk through the right way to write an initializer and exactly why this is the right way.
(Read More)14 comments

It's a Poor Carpenter Who Blames His Tools or: Xcode Sucks Again at 2008-10-08 20:28
byMike AshTags:xcoderant
The title isn't wholly appropriate because I'm not going to blame my tools, per se, just complain about them a whole lot. It occurred to me that we as programmers really don't haveany good tools, and this has been annoying me for some time.
(Read More)59 comments

The iPhone Development Story at 2008-09-18 00:30
byMike AshTags:iphonerant
I just got my first application in the iTunes App Store, and I wanted to tell the story of what it's like to publish one, from start to finish. The app,NetAwake, is an independent project I wrote with my friend Joshua. It makes an interesting story, I think, because unlike the sordid tale of some people's struggle to get accepted into the iPhone developer program, my personal experience was perfectly normal. (As far as I know.)
(Read More)201 comments

NetAwake at 2008-09-15 02:28
byMike AshTags:linkiphone
I just wanted to make a quick post to note that I've released my first iPhone app,NetAwake. It's a Wake-on-LAN program with a fancy ZeroConf-based MAC grabber to make it accessible to people who think that MACs are the computers you buy from APPLE. Credit should also go to my partner Joshua, who did all of the work on the GUI.
(Read More)8 comments

Late Night Cocoa at 2008-09-05 23:31
byMike AshTags:interviewlinkatomicthreading
Readers of this blog may be interested in my recent appearance on Late Night Cocoa. I discussed the fundamental principles and basic concepts behind lockless thread-safe data structures. You canaccess the episode here.
(Read More)6 comments

Welcome to iPhone: Your Crappy Mac of Tomorrow, Today! at 2008-08-01 17:23
byMike AshTags:iphonerant
Note: this post is a long non-technical rant. Please skip it if you don't want to read that kind of thing. I promise that this will be a rare event.
My employer got me an iPod Touch shortly after Apple announced the official iPhone SDK, but it ended up not doing much for a while. Due to various things beyond the scope of this post, I didn't do any SDK work with it. And since I rarely listen to music outside of my office and my car (which has no iPod hookup), it didn't get used very much for anything.
(Read More)102 comments

WWDC 08 Followup at 2008-06-23 01:33
byMike AshTags:wwdcgcdopenclllvmclang
As you saw from my last post, I was sorely disappointed in this year's WWDC keynote. Fortunately the rest of the week didn't follow the same trend.
(Read More)1 comment

Worst. Keynote. Ever. at 2008-06-09 18:49
byMike AshTags:wwdc
That is all.
(Read More)7 comments

WWDC 2008 at 2008-06-04 14:00
byMike AshTags:wwdc
As some of you may be aware, WWDC 2008 is coming up soon, and I'm going to be there. If you see a tall guy in a shirt depicting a militaristic microbe, that's me.
(Read More)0 comments

Tales from the Sausage Factory: Why Those Big Downloads for Simple Updates? at 2008-03-21 23:40
byMike AshTags:updatelink
I don't know what it is about March, but it seems like I can't keep away from this blog. This is a bit less technical than I usually like to have here, but I think it's still interesting, and in any case it's a nifty place to be published. You can readTales from the Sausage Factory: Why Those Big Downloads for Simple Updates? over atTidBITS.
(Read More)0 comments

Deconstructing the iPhone SDK: Malware at 2008-03-20 16:58
byMike AshTags:iphonerant
In part two of my potentially ongoing series about the iPhone SDK, I want to discuss the platform's potential for malware.
(Read More)7 comments

Performance Comparisons of Common Operations, iPhone Edition at 2008-03-19 21:40
byMike AshTags:performancecocoaobjectiveciphone
I finally got a chance to run my performance comparison code on an iPhone, so we can see just how much horsepower this little device has. I still am not able to load my own code onto the device myself, so I want to thank an anonymous benefactor for adapting my code to the new environment and gathering the results for me.
(Read More)10 comments

Use strnstr at 2008-03-18 20:49
byMike AshTags:strnstrsecuritytigerlinkosbug
A few months ago I told everyonenot to usestrnstr. This bug was fixed in Leopard, but persisted in Tiger. Today, Applefinally fixed it in Tiger. Now you can safely usestrnstr. I assume that this bug probably still exists on Panther and earlier, but as long as you're targeting Tiger and up (as every sane person ought to), you are now safe.
(Read More)0 comments

Deconstructing the iPhone SDK: No Multitasking at 2008-03-15 01:02
byMike AshTags:iphonerant
The recent release of the iPhone SDK has created a great deal of controversy in the Mac community. In typical fashion, two sides have formed, with each side thinking the other side is a bunch of fools. I'd like to explore one big point of controversy: Apple's prohibition against running applications in the background.
(Read More)4 comments

Code Signing and You at 2008-03-07 20:32
byMike AshTags:codesigninglink
I just posted a long treatise on code signing over at my place of employment. I'm posting this for the few people who read my blog but not that one. Link after the fold because my RSS feed generator sucks.
(Read More)2 comments

Goodbye, Nibs at 2008-02-22 01:49
byMike AshTags:eulogy
This post is to say goodbye to nibs. Not the kind you create with Interface Builder.
(Read More)1 comment

A Tool for Editing Version-Controlled Bundles at 2008-02-09 21:31
byMike AshTags:pythonutilitysubversionversioncontrol
If you're like me, you sometimes have to editrtfd files which are under version control, and it's painful. TextEdit and Xcode will blow away the version control directory (if you use the sort of version control which keeps directories in everything) and it's annoying to work around it. I finally got fed up enough to write a script which works around it for me.
(Read More)5 comments

Performance Comparisons of Common Operations, Leopard Edition at 2008-01-12 21:01
byMike AshTags:performancecocoaobjectivecleopard
By popular demand, I have re-run my Performance Comparisons of Common Operations on the same hardware but running Leopard.
(Read More)14 comments

The Cults of Programming at 2007-12-31 05:51
byMike AshTags:programmingranthumor
In my experience with various programmers over the years, I've realized that most of them fall into one of several cults which describe their behavior. I've compiled a list of cults and brief descriptions you can use to identify them. (Note: if you're easily offended and think you might fall into one of these categories, please forego reading the rest of the article.)
(Read More)37 comments

Leopard: First Impressions at 2007-11-30 23:12
byMike AshTags:leopardcocoaobjectivecrant
Leopard's been out for a while now and brings with it a lot of interesting new tools for the Mac programmer. I've had the chance to work with some of them and want to offer my opinion on how they've worked out.
(Read More)5 comments

Algorithmic Optimizations: a Case Study at 2007-11-26 01:08
byMike AshTags:performancec++stlcasestudy
Those who know me from a programming standpoint know that I am a big opponent of needless optimization. But sometimes optimization is necessary, and when that comes I'm a big proponent of examining algorithms over twiddling low-level code. I recently had a good opportunity to perform algorithmic optimizations in a somewhat unconventional scenario, and this post will describe what I did.
(Read More)5 comments

Perform Better With Garbage Collection at 2007-11-21 04:44
byMike AshTags:cocoagarbagecollectionperformance
The move to garbage collection in Cocoa has been interesting. People have said that it's impossible, or impractical, or a bad idea, or doomed to failure, and one of the most common things trotted out is that GC is inevitably slow. However, I think that enabling garbage collection in your Cocoa app could actually be a good way to increase performance under the right conditions.
(Read More)7 comments

IOCCC 2006 Winners at 2007-11-04 14:17
byMike AshTags:ioccccevil
The winners of the 2006IOCCChave been posted. Sadly I am not among the winners this year, but the winners all appear to be most deserving.
(Read More)0 comments

First Post at 2007-11-04 14:16
byMike AshTags:meta
This is my first post with my new blog system. Eventually I hope to get my old blog posts moved over, but for now you can access the old blog atits old address.
(Read More)0 comments

Don't use strnstr at 2007-09-26 00:00
byMike AshTags:osbugstrnstrsecurity
Thestrnstr function is broken on Mac OS X 10.4 (and presumably earlier) and should be avoided.
(Read More)14 comments

Performance Comparisons of Common Operations at 2007-08-25 00:00
byMike AshTags:performanceobjectiveccocoa
We all know that premature optimization is the root of all evil. But a recent conversation brought to mind that we often don't really know the runtime costs of the code we write. While we should be writing foremost for correctness and clarity, having an idea of these speeds is good, especially when we get it into our heads that some operation is much more costly than it really is. With that in mind, I compiled a list of common Cocoa operations and how much time they require at runtime.
(Read More)17 comments

Subtle Bugs at 2007-07-10 00:00
byMike AshTags:chemicalburndebugging
I've just released a new version ofChemicalBurn which fixes two nasty bugs which have been in there for quite some time. Today I'll tell you about them. (You can alsofollow along at home in the svn repository.)
(Read More)1 comment

Open Source at 2007-03-15 00:00
byMike AshTags:opensourcegpulifechemicalburn
I'm slowly coming to realize that there isn't always much point in releasing freeware but keeping the source closed. As part of this realization, I have created apublicly accessible Subversion repository and added the source of two of my screensavers,GPULife andChemicalBurn. They're both MIT licensed and contributions are welcome, although not expected. Maybe one of you can figure out why ChemicalBurn very occasionally gets into a routing loop....
(Read More)1 comment

How To Shrink Your Source Code at 2007-03-07 00:00
byMike AshTags:linkhumor
I've written a handy article which should be useful to anyone whose C source code is too large and needs to be reduced. It outlines ten easy techniques you can use to reduce the size of your code. For reasons unknown to me, my employers seem to actually like it when I enter contests which revolve around making horrible code, and so you can read the article over atUnder the Microscope.
(Read More)0 comments

More Fun With Autorelease at 2007-02-08 00:00
byMike AshTags:autoreleasebugcocoaobjectivec
I just hit a subtle but commonly known bug for the first time. I thought I'd share my fun with the world.Everybody reading this blog should know about autorelease pools and how they work in Cocoa. As everybody knows, every time you go through the event loop, Cocoa blows away the old pool and makes a new one for you, so that all of your autoreleased objects go away and your new ones go into a fresh pool. That way you never build up more objects than get produced during a single event loop cycle.
(Read More)17 comments

Why CoreAudio is Hard at 2006-10-19 00:00
byMike AshTags:audiocoreaudiorant
I wrote this post over in comp.sys.mac.programmer.help, then realized that it would make a pretty decent blog post as well. I have edited it slightly to work as a blog post rather than as a newsgroup post. If you've ever wondered why CoreAudio is so difficult to use and why it can't be simple and easy like CoreImage or CoreVideo, read on.
(Read More)14 comments

Hacking C++ From C at 2006-08-03 00:00
byMike AshTags:magiccc++hack
For a long time, LiveDictionary used deeply unwholesome methods to do its work. Version 1.2.5, just released, now uses nothing but public methods. This means vastly improved stability, but it also means that LiveDictionary's evil WebKit text grabber, once considered the app's crown jewels, is no longer useful. I'm going to use it as an object lesson on how to do evil things with C++ applications from pure C.
(Read More)11 comments

Lesson of the Day at 2006-07-27 00:00
byMike AshTags:adviceopengl
OpenGL contexts have maximum viewport sizes. If you attempt to exceed the maximum size by, say, calling glViewport() with a size greater than that, you'll get incomplete drawing and weird corruption. This is particularly bad if you're using OpenGL as an interface element in a resizable window. To fix it, call glGetIntegerv(GL_MAX_VIEWPORT_DIMS, dims) to get the max viewport size, then limit your window's size to make sure you never exceed it.
(Read More)0 comments

Getting Answers at 2006-07-18 00:00
byMike AshTags:ircadvicerant
This is probably not so useful to my audience directly, but maybe you can forward it on to people who would find it helpful. I've written my own version of How To Ask Questions, but without gravely insulting anybody who reads it. People who ask questions don't really care about fitting in or conforming or following the rules, they just want answers. This guide tells you how to get answers with a minimum of fuss. And so I presentGetting Answers. Any comments you might have on it are most welcome.
(Read More)21 comments

Using Evil for Good at 2006-07-14 00:00
byMike AshTags:cocoaobjectivecc++stlchemicalburn
People who know me as a programmer probably know that I am a great hater of C++. As someone who does a lot of Cocoa, this extends naturally into hating Objective-C++. But I made good use of Objective-C++ inChemicalBurn and I thought I'd share.
(Read More)4 comments

Autorelease is Fast at 2006-06-07 00:00
byMike AshTags:autoreleaseperformancecocoaobjectivec
If you've done much Cocoa programming, you've probably run into a situation where you needed to create a local autorelease pool because of some sort of loop. And you've probably run into advice telling you not to create and destroy the pool for every iteration, because that would be slow. I never believed that it could be significant, and I finally took the time to test it today. What's the verdict? Just as I thought, making autorelease pools is really fast.
(Read More)16 comments

Making Xcode Better at 2006-05-31 00:00
byMike AshTags:linkxcode
I don't normally post these kinds of articles that are just links, but I really like this link, and also I haven't posted in a long time and I don't want anybody to think I'm dead. So I present to you:King of the Xcode. On the unlikely chance that there are any Apple employees reading who have a say in this sort of thing, please please please take his advice. I hold no illusions about my readership, but I am nothing if not hopeful.
(Read More)2 comments

Custom NSCells Done Right at 2006-04-06 00:00
byMike AshTags:nscellnibhack
Anyone who's done enough Cocoa has eventually run into the nightmare that is subclassing an NSCell. While it looks simple enough, actually getting an Interface Builder-generated control touse your NSCell subclass is effectively impossible. You either have to use CustomViews in IB, write an IBPalette, or do a whole lot of tedious and error-prone manual copying of attributes to get everything from the IB-provided cell into your own.
(Read More)15 comments

Cocoa SIMBL Plugins at 2006-03-25 00:00
byJoshua PokotilowTags:cocoasimblinjectionplugin
Occasionally, we wish our favorite programs would sport a particular feature that just isn't there. Those of us who aren't developers need to fall back on lobbying for features, but those of us fortunate enough to be in the biz, churning out line after line of Objective-C well into the heart of the night, waking up the next day with bloodshot eyes and feeling not unlike the living dead, have other options. O, we lucky few.
(Read More)2 comments

Fluid Simulation for Dummies at 2006-03-13 00:00
byMike AshTags:fluidsimulation
In the spring and summer of 2005, I wrote my Master's thesis on high-performance real-time 3D fluid simulation and volumetric rendering. The basics of the fluid simulation that I used are straightforward, but I had a very difficult time understanding it. The available reference materials were all very good, but they were a bit too physics-y and math-y for me. Unable to find something geared towards somebody of my mindset, I'd like to write the page I wish I'd had a year ago. With that goal in mind, I'm going to show you how to do simple 3D fluid simulation, step-by-step, with as much emphasis on the actual programming as possible.
(Read More)34 comments

NSOpenGLContext and one-shot at 2006-02-23 00:00
byMike AshTags:adviceopenglcocoa
If you've done any OpenGL work in Cocoa, you may have noticed that OpenGL surfaces behave badly when it comes to things like miniaturization and deminiaturization to the Dock. This recently caused some big problems for me, and I finally found out how to get rid of these problems altogether. It wasn't excruciatingly hard to find, but I wanted to make a post about it here so that it could be found with words like "deminiaturization".
(Read More)0 comments

What Every Programmer Should Know at 2006-02-21 00:00
byMike AshTags:linkfloatnumerical
I have a short post for once! I happened to be talking about floating-point comparisons, and I trotted out my usual web page explaining all about floating-point calculation and error. And then I thought, this stuff is so essential, I ought to post it here as well. So without further ado:What Every Computer Scientist Should Know About Floating-Point Arithmetic. A bit heavy on the math, but if you've ever wondered why printing out 10.1 gives you 10.1000002, or why 1.0/10.0 * 5.0 != 1.0/2.0, this will explain it all.
(Read More)0 comments

Braaaaaaaains at 2006-02-20 00:00
byMike AshTags:bologames
A couple of articles back, I wrote an article aboutBolo, and briefly mentioned an OS X version callednuBolo. Those of you who have tried it have no doubt noticed how authentic it is. You may also have noticed that it's lacking Bolo's Brains (AI plugins) support. I'm working on a module to add Brains support to nuBolo, and I've reached the stage where I thought I'd make a post about it.
(Read More)3 comments

Bug Reversal at 2006-02-06 00:00
byMike AshTags:unicodebug
The most interesting bugs for me are the bugs which appear at the confluence of many different things. Module A has a small defect, which happens to expose a lack in module B, causing it to feed bad data to module C, which then behaves oddly. With a difference in any of those modules, the problem might never have appeared. I recently saw a non-bug which is a great example of this kind of interaction.
(Read More)0 comments

Bolo Ecology at 2006-01-01 00:00
byMike AshTags:bologames
Today I'm going to talk to you about the mechanics and social interactions in a little-known Mac tank game. Those of you who understood the title already know which one. For those of you who don't, the game isBolo. For people suddenly hit with nostalgia, there's aCarbon port now available which is amazingly authentic.
(Read More)7 comments

Score! at 2005-11-09 00:00
byMike AshTags:iocccevilclisp
The International Obfuscated C Code Contest is a contest with the goal of creating the most unreadable, difficult-to-understand C program possible. Aside from being difficult to understand, the judges tend to prefer programs which do clever or interesting things, or which do mundane things in clever, interesting, or weird ways.
(Read More)1 comment

Fun With Beowulf Clusters at 2005-07-13 00:00
byMike AshTags:universityrant
I've been working on my Master's thesis for the past four months or so, and having an interesting time of it. Today, I finally reached an important goal: running a fluid simulation split into separate simulation and visualization components, with different components running on different computers for speed. The bad news is that I'm not using a single bit of my university's clustering library which I'm supposed to be using.
(Read More)1 comment

Using FileMerge with subversion at 2005-07-06 00:00
byMike AshTags:filemergesubversionversioncontrolpython
I was introduced to subversion about a month and a half ago, and have generally found it to be wonderful, and a vast improvement over CVS. I won't get into the details, because I'll just sound like every other person out there who has switched to svn and then raved about it, so you can just look up somebody else's blog post on the subject. One thing I did miss, however, was the ability to open diffs in FileMerge.
(Read More)9 comments

Dashboard Rant at 2005-04-29 00:00
byMike AshTags:dashboardrant
I've spent a good part of the last few days working on a Dashboard widget, trying to get it ready in time for the release. The good news is that I got it done and working. The bad news is that Dashboard seems like a horrible, badly-designed development environment. The main purpose of this post is to rant about that, but it'll also include the occasional tip for writing your own widget.
(Read More)0 comments

Name/comment conflict at 2005-01-24 00:00
byMike AshTags:humorcontent-free
Going through some code, I came across a function calledAtomicReplaceDirectory. The very first line of this function was a comment that said:

note, despite the name, this is *not* atomic.

Isn't it great when the name and the comments are at odds?
(Read More)2 comments
Hosted atDigitalOcean.

[8]ページ先頭

©2009-2025 Movatter.jp