Wed, Jul 26, 2023, 12:58pm Complex Number Notation in Swift Code
By far the most common way to indicate complex numbers in code is by postfixing an i, j, or im to a number. Ex: 3 + 4i. This is based on the old pen-on-paper notation in math, physics and electrical engineering (who use j). There's also a nice "phasor" notation, which uses angle-n-magnitude instead of real-n-imaginary coordinates: 5 ∠ 53.13°, though font designers usually create awful symbols (often very tiny, for some reason), making them unreliable to use in code. [Read more…]
Fri, Apr 15, 2016, 3:38am Ray Tracing à la Metal
So, a couple of days ago, I was feelin' pretty suave getting the ray tracing going in pure Swifty goodness. But I could not resist the allure of the GPU. I decided to stalk the illusive beast known as Metal. And that's kinda what it felt like. I did not jump right in and start coding it up, since I have but a modest idea what's going on in Metal, apart from aping Apple's example code, and transliterating some OpenCL code, earlier in the year. For me the troubles were about how to paint on a texture and to understand the ins and outs of the Metal Shading Language.

For those just wanting to know if it was worth it: The same 1600x800 scene and over 480 reflective objects, went from 702 seconds in the pure Swift version down to 14 seconds! Roughly a 50x speed improvement. That is racing a 12-core Xeon with hyperthreading against a D700 graphics card. Well worth the time invested to compare. [Read more…]
Tue, Apr 12, 2016, 10:28pm Ray Tracing à la Swift
Recently, after a big work push, I needed a break. Something else to work on for fun. While asking around if there was a Slack domain that specifically tried to gather people together interested in doing graphics and GPU programming, I decided to just start it and see if it could draw any interest. The group is called Cocoa3d (email me if you'd like an invite), targeting any kind of use for GPUs on Apple devices, also including gaming in general. A bunch of really great people joined and we started talking about various projects people were up to. [Read more…]
Sat, Jul 12, 2014, 1:56am A Big Year for Programming
So 2014 has turned into an unexpectedly big year for programming for me. As an Apple developer, it's obviously been affected by Swift's arrival, but I was already in the middle of a lot of new projects, making for a crowded learning schedule. I've sort of grouped them into different areas: scientific, functional, parallel and Mac/iOS-related.

And I'm dabbling with going back to blogging. If you find this interesting and are reading, thanks! I'll try to keep things interesting. [Read more…]
(6 comments, in Programming)
Sun, Nov 27, 2011, 7:19pm Journal Article Reading / Tracking
There are times when (a) I'd rather use a Terminal shell to search for something, or it's already where I am, and (b) when I'm in the mood to write a little set of scripts to do something neat. And so it came that I wrote a set of little scripts to keep track of my completely out-of-control PDF collection from various journals. This isn't a blog article about how you should use this tool, since your reading neuroses probably differ, but just a quick "hey, I think this is neat" and something that may inspire someone on to other cool command-line tools (or whatnot). [Read more…]
Tue, Nov 2, 2010, 3:34pm Off-Limits Class Names in Cocoa
I just wanted document somewhere on the internet unprefixed object names in the Objective-C runtime that could potentially trip you up. I'm just talking about capitalized words, not C keywords, and I'm not talking about anything already given a namespace prefix like the NS* types.

There are un-prefixed, capitalized type names lurking in the runtime. [Read more…]
(in Programming » Cocoa)
Sun, Mar 7, 2010, 5:16pm F-Script Switching Options
There are many ways to think through the flow of a program, and times when certain constructs like switch statements are a nice option, even in a language with no syntactical support for it, per se. Philippe Mougin was discussing just such options in F-Script back in the Oughts. I had a need for switching in F-Script, and came up with a few versions that I found useful. [Read more…]
(3 comments, in Programming » F-Script)
Older items:
2010, Mar 1
360iDev Coming Soon!
(in Programming » iOS)
2010, Feb 9
Xcode Shortcuts
(1 comment, in Programming » Cocoa)
(2 comments, in Programming » iOS)
2008, Aug 14
Fun New Art Genre
(1 comment, in Programming » iOS » iGraffiti)
(3 comments, in Programming » OpenMP)
2008, Mar 16
TIOBE #s
(1 comment, in Programming)
2008, Feb 20
OpenMP/GL Brain Food
(2 comments, in Programming » F-Script)
2006, Dec 6
CSS Alignment Styles
(3 comments, in Programming)