JOD now runs on the Mac

The J addon JOD now runs on Macs. You can update JOD, or install it for the first time, with JAL. JOD now runs on all the major J hosts: Windows, Linux and the Mac.

To keep track of host specific features I have started a series of version documents. The Mac document is here.

At the upcoming J conference, (July 23-24, 2012), in Toronto I will show an iPhone version of JOD. And, as a reward for attending the conference and my little presentation, Writing Portable J addons, I will be raffling off hardcopy printed versions of the JOD manual.

An updated PDF version of the JOD manual is available here. For more see The JOD Page.

Turn your iPhone into a jPhone

J for iPhoneJsoftware recently released a free J app for the iPhone. Search for “jsoftware” in Apple’s app store and you will land right on it. There are many excellent free iPhone apps, I have half-a-dozen on my iPhone, but this little jewel sets a new standard for power in your palm.

Let’s start with the good news; this is not a crippled version of J. It’s the same high-caliber interpreter that J programmers have used on Windows, Linux and Mac machines for years. Anything this app’s big desktop brothers can do this little app can do. You won’t see the same blistering desktop speed but I think you’ll be pleasantly surprised at how fast this app munches numbers. I have run desktop J since the 1990’s and J on the iPhone 4 matches or beats what I was seeing on laptops ten years ago. This is the real J deal.

Now for a few caveats — this J app is not a complete J development environment. To meet Apple’s restrictive app store rules C-style APIs, JAL addons, GUI tools and third-party libraries like opengl and lapack are not included. With this app you get the J interpreter and a few of the most useful J addons like plot. Despite these limitations this J app is probably the most powerful, purely local, calculator available for the iPhone.

Don’t believe me? Turn off Wi-Fi and set your iPhone to Airplane mode: Airplane mode cuts off phone and internet access.  Now try computing the following on your favorite iPhone calculator.

NB. generate one million random numbers and average them
(+/ % #) ? 1000000#10000

NB. generate a 50 50 random matrix, invert it and multiply with the
NB. original - rounding to the nearest 0.0001 to form an identity matrix
round=: [ * [: <. 0.5 + %~
matrix=: ? 50 50 $ 10000
invmat=: %. matrix
identity=: 0.0001 round matrix +/ . * invmat

NB. sum of the diagonal elements of matrix (identity) is 50
50 = +/ (<0 1) |: identity

NB. multiply two polynomials with complex number coefficients
polyprod=:  +//.@(*/)

NB. complex number coefficients - AjB is J's notation for A + Bi
poly0=: 2j5 3j7 0 1
poly1=: 1j2 0 3j7 0 0 2
poly0 polyprod poly1

NB. prime factorization table of 50 random integers less than one billion
(<"0 nums) ,: -.&0 &.> <"1 q: nums=.50?1e9

The J app blows through these examples on my iPhone 4 in a few seconds. Of course this is only a tiny taste of what J on the iPhone is capable of. I have managed to run 1000+ line J scripts on this app. The only desktop J code I have not been able to run depends on external compiled libraries like regex.

Cell phones are powerful little computers and it’s gratifying to finally see software that can focus that power on something other than Angry Birds.  If you’re interested in learning an array oriented functional programming language or if you’re already familiar with J and want to pack serious computational heat then this app is for you!

J iPhone app

J running on the iPhone

Revenge of the PhD Camera

Hipstamatic water meter

Hipstamatic water meter

Cameras come in two flavors. There are expensive serious cameras used by serious photographers to take serious photographs and then there are PhD, (Push here Dummy), cameras. Serious cameras meet the highest technical standards, lenses are diffraction limited, chromatic aberration approaches zero, pixel counts match Nyquist limits, ISO’s exceed retinal sensitivity, auto-focus is instantaneous, color spaces are wide, calibrated and range into the infra-red and ultra-violet. PhD cameras don’t go there! PhD cameras provide a button for dummies to push. Over the years I’ve ying’ed and yang’ed from serious to PhD cameras. It’s not that I cannot make up my mind. Camera choice is another eternal struggle sort of like that squabble between good and evil or light and regular beers.

When I’m on a serious photography kick I put time, expertise and money into my pictures. For me serious photography is exhausting. I  seek out worthy subjects, wait for the right light, agonize over composition, experiment with lenses, tweak f-stops, adjust shutter speeds and take as many exposures as light and time allow. Then the post shutter ordeal begins. Digital imaging processing makes anything possible. You can take your exposures and like some mad photo-shopping Rumpelstiltskin spin straw into gold.  But, as in the fairy tale, there is a high price, perfect images will suck years out of you. Photographers often talk about workflow and they aren’t kidding. When I start tweaking my workflow I know I’m reaching the end of my serious rope. Photography is one of my hobbies and I never ruin hobbies by turning them into jobs!

The World's largest Photo Libraries 2011

Eventually I snap out of it and resume PhD’ing. Unlike serious photography PhD’ing is effortless and fun. It’s always been fun, remember Brownies and Instamatics, but this is the golden age of PhD photography! In the last decade PhD cameras have evolved and mutated from cheap plastic boxes filled with grainy high-speed ISO film to sophisticated little internet photo-shopping engines that ride around in our pockets as cell phones. I don’t even know why they are called cell phones. My iPhone takes hundreds of images for every phone call it processes. It’s really more of an iCamera+iBrowser that can, on rare occasions, be used as a phone. Based on surveys of web image sites I am not the only iCamera user. PhD photography is growing faster than the national debt.

Mixing up cell phone color channels

Mixing up cell phone color channels

Explosive growth attracts armies of sinners and saints. Every two-bit whore chasing a buck is now writing image processing software for cell phones. In the last two years we’ve seen apps that stitch panoramas on the fly, apply cheesy photo-shop effects and automatically create HDR images by blending two or more exposures.  As Sturgeon’s law predicts most of these apps are crap but that’s not a problem for PhD photography. The goal is to offer a fun button for dummies. My favorite PhD app is a great little toy called Hipstamatic. Hipstamatic simulates crappy old PhD film cameras loaded with expired film. You can choose a lens, a film and a flash or you can just shake your iPhone and let it randomly select these parameters. Shake and shoot; it’s the revenge of the PhD camera.

Hospital Staff Training

Yesterday I transferred from Surreyplace to St. John’s rehabilitation hospital. St. John’s is a mainstream rehab hospital and is better equipped to deal with my situation. Now that I am allowed active leg movements the therapy will get more intense. To be honest I am not looking forward to longer and more painful sessions. Yes, I am a complete girly man when it comes to searing pain! I will have a better idea of what’s in store for me after tomorrow.

Whatever happens in therapy they will not be waking me up at 4:30 am to draw blood! You can imagine my delight at being roused from a crappy nights sleep, (try sleeping in python tight leg braces), and then being poked by a zealous staff vampire that took singular delight in telling me this little suck would be a daily ritual. Whoa cowboy: there had better be really good medical reasons for waking me up!

Half an hour later another nurse came in and tried to make me take a stomach lining pill. People it’s 5:00 am I am not going to start pointless drugs at such an hour. Then, shortly after refusing the stomach pill another nurse was back to administer an EKG. Clearly sleep was not on the agenda.

I’ve been told all these tests were part of a baseline workup and that I will not be subjected to many of them tomorrow. The vampire will have to suck elsewhere.

I went through the same thing at St. Luke’s and Surreyplace. I don’t want to train hospital staff in the delicate art of me maintenance but it appears unavoidable.