Niklas

Hi. I’m Niklas Saers, often called Nik, and this is my weblog. I make great iOS, Mac and Java software, play the recorder and enjoy life with my beautiful wife.

You can learn more about me, view my résumé, or grab me via LinkedIn or Facebook.

In addition to this site I am frequently posting thoughts on Twitter and photos on Flickr.

You can read more about me and how to get in touch with me here.

Jun 272011
 

Some of you might have thought that I’m perhaps a bit too happy about the iMac, and of course too cheap to get a Mac Pro. (Yes, I’m just as excited as anyone to see what the new Pro will be like now that Thunderbolt is a great bus-alternative, but that’s for another topic) Let me dedicate this post to the minus points for the iMac.

To be clear, my complaints are with the top-of-the-line 27″ i7 3.4 Ghz iMac with 16GB of RAM and SSD disk. Yes, my delivery agent messed up and it’s “only” 1GB of VRAM instead of two, but if you wanted to know what’s the trouble with the top-of-the-line iMac, this is it:

Heat, heat, heat…. yes, every computer I’ve had has been pushed to its limits, and this one will be no exception. But heat isn’t bad while running doing some crazy 8-virtual-core video-encoding with Handbrake, heat is a problem when the monitor is turned on! Try holding your hand on top of it after having used it for a couple of hours: I dare you! It’ll be scorched in no time!

The top of the monitor is where the heat vents are, and it gets crazy hot. My office is on the first floor, so it’s the hottest place in our house to start with, having a couple of other hot-running macs there to begin with doesn’t help, and my 24″ Dell really knows how to warm up a room. But this iMac has really added a couple of centigrades to the room temperature. To make it short: I’m adding some vents to the room!

Next up: reflections, reflections, reflections…. man do I look good! I get to look at myself the entire day if I want to!! If I don’t want to, I need to look away, because the iMac is a 27″ mirror! I’ve always gone with the matte / anti-glare options, except for the iPhone and iPad where it wasn’t available. I love using my iPad, and it doesn’t reflect THAT much, so I didn’t think much about it, until I packed the iMac out and turned it on! Crazy! I need to go shave!!!! A quick shave later, what I see on the screen looks way better, but it’s still me. I’ve got my Dell 24″ matte display next to the iMac, and it takes the full blow of the window and the window-lit me, but still I see no reflection. On the iMac, though, did I mention I use it as a mirror, without turning the camera on?

But these, and the lack of a thunderbolt/USB KVM, are really the only objections I have. Throw in a 24″ Dell in 90 degrees rotation, one of the upcoming MacBook Airs for using XCode on the road and a Mini and one of those nice HP airprint printers, and you have yourself a great both home and office setup!

So expecting the upcoming Mini and Air soon, and already knowing Lion and iOS 5, there is really no reason not to work with this and enjoy its benefits full time. This is an awesome setup for developers, media producers and probably your average Mac gamer alike.

 Posted by at 9:26 pm
Jun 262011
 

Back when the new iMacs were released in may 2011 I ordered one with 4GB RAM, expecting to replace them with 32GB. However, getting four 8GB blocks turned out to be incredibly hard, and very expensive, so I settled for 4x4GB blocks for a total of 16GB RAM 1333Mhz SO-DIMM RAM. Two sets of 2x4GB from Crucial was very inexpensive (about 800 DKK plus tax), and they arrived a couple of days before the iMac.

While almost all servicing of parts for the iMac starts with having to remove the display and risk getting dust stuck under the glass, replacing the memory was very easy. Remove three screws on the bottom of the screen (surprisingly not Philips 1 screws, something a bit wider), take out some easy-to-use handles and pull. I was surprised at how hard I had to pull, I was afraid I’d break the handles, but no problem there, they didn’t even seem the least bit strained when the old memory came out with a pop. Gently take out the old memory, replace it with the new memory (again, push a bit harder than what I expected), screw it together again and voila, one memory maxed iMac. :-) Very easy, and very cheap.

So what is performance like with this memory? Well, I’m not a good case for comparing with as I run too much early-stage pre-release software, too much software at all and generally abuse my computer. And since I transferred my MacBook Pro setup to the iMac (after first deactivating Adobe’s CS5 suite) it’s just as messy as my setup always is. But it works beautifully. No lock-ups, and all the memory is in use! Perhaps a bit surprisingly, but I had 14GB of inactive memory before I started writing this post. That is, it’s loaded and ready to go, but not in use as I’ve quit whatever was using it. ;-) So a waste perhaps? No way…

Using the computer like this has been a breeze so far, but let’s see. Custom is that I’ll max out the memory within three months of using the computer. Yes, 16MB RAM in a 486DX was great, can’t remember what my Pentium 90 had, nor many of the AMD machines. The “lamp” iMac was also filled as much as it could (that was good fun servicing), as were my Powerbooks and subsequent MacBooks and Minis. That’s why I always wanted a Pro, but always opted for something else. Cheapskate me ;-)

 Posted by at 10:08 am
Apr 302011
 

Fair warning: This is speculation on my part

Fact 1: The Intel desktop chipset Z68 will be released in a week or two to the general public.
Fact 2: Apple cares about user experience
Fact 3: Intel has given Apple preferred access to its components before

The iMac, Apple’s Desktop offering, is long overdue. I had my bets for a refresh in February, that never happened. In March it would be logical to release an update with Sandy Bridge and Thunderbolt. That in itself would he a huge gain.

The Intel Z68 chipset will allow Apple to let the user have a small SSD drive for caching, so that all frequently run program data will be there. That’s not that different from what Samsung (and I’m sure others) already do on regular hard drives: keep a small bit of SSD for caching so that data that is frequently accessed is faster available than it would be reading from a drive. Except for this: the SSD drives used with the Z68 would typically be 64GB or around there.

Toms Hardware has a nice benchmark of using this chipset with SSD drives and whether larger drives make a substantial difference: http://www.tomshardware.com/reviews/z68-express-lucidlogix-virtu-ssd-caching,2888-4.html

Adding this would make the iMac the fastest Mac there is, at least when it comes to user experience, another blow to the Mac Pro for sure. It should also have a refresh, poor thing.

So while this is just speculation on my part, I think it makes sence, timing wise and logically. And, I really need a new Mac, so with the speculation about a special happening on May 3rd, with Apple Store employees being required to be present there, an iMac happening after “let’s get back to the Mac” makes very much sense to me.

PS, Apple, please allow me to add 64GB of RAM this time :-)

Update: Yes, I was right on this one! :-)

 Posted by at 8:34 pm
Apr 202011
 

One thing that I seem to forget from project to project (after all, you only need to take care of this once pr project) is that a deployed Spring project is two parts: model, business and controllers is one part, views are another.

This means that in your web.xml you’re likely to have two parts defined, the org.springframework.web.context.ContextLoaderListener servlet which contains model, business and controllers, and the org.springframework.web.servlet.DispatcherServlet that contains your view resolvers and views.

This distinction is important, if nothing else than because it’s easy to set the url-pattern for the view servlet too broad, for instance to /*, and this will surely mingle your requests so that you don’t really know if it goes to the controller or to the view resolver.

 Posted by at 6:30 pm
Oct 222010
 

Wow, the libpd guys make it possible to put Pure Data patches in your iPhone app. I’m definitely going to make an app based on this, if nothing more then just for the heck of it. Time to brush up on my PD skills, I’ve been using Max/MSP for too long ;-) See the article

 Posted by at 12:11 am
Oct 162010
 

I don’t know if you’ve noticed yet, but I’m a big fan of both Roo and the guys behind Roo. Big thanks to Alan & James from the forum post, ROO-1537 and ROO-1538, as of git version a474dc7b95613fae564f0e0fa50d89a6818bd753, and tested today one day later, my scripts run flawlessly through the tests! :-) Which means, we can continue with Tiles. Stay tuned!

 Posted by at 9:00 pm
Oct 152010
 
Ever seen this before? Got fatal error 1236 from master when reading data from binary log: ‘Could not find first log file name in binary log index file’ I had that after a MySQL server in my replication loop went down. When it came up, the next server in line gave this replication state ‘Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master’s binary log is corrupted (you can check this by running ‘mysqlbinlog’ on the binary log), the slave’s relay log is corrupted (you can check this by running ‘mysqlbinlog’ on the relay log), a network problem, or a bug in the master’s or slave’s MySQL code. If you want to check the master’s binary log or slave’s relay log, you will be able to know their names by issuing ‘SHOW SLAVE STATUS’ on this slave’, which was quite logical since the end of the bin-log had been corrupted due to external circumstances.
This should be a simple
STOP SLAVE;
CHANGE MASTER TO
MASTER_LOG_FILE=’bin.000nnn’,
MASTER_LOG_POS=1;
START SLAVE;
on the node that had stopped replicating, but this is when the 1236 error kicked in. As very often with 1236, the node that had gone down hadn’t updated it’s binary log index file (servername-bin.index in this case, yours might have a different prefix) so I had to manually add that in the index file. One more thing to remember, restart the MySQL server after updating the index file. Then replication should happily resume again once you hit </i>START SLAVE;</i> on the next mysql server in the replication ring.
PS, take care, the CHANGE MASTER seems to flush the tables or something, it doesn’t simply set some variables, so depending on the load on your server this might take several minutes
Oct 102010
 

While resolving the test problems in the last code, let’s look at what we get by doing a

mvn jetty:run

The application has a header on top, a footer in the bottom, and a menu on the left hand side. This is in line with the Composite View pattern described in the Tiles tutorial:Composite View. To recompose this layout, see src/main/webapp/WEB-INF/layouts/layouts.jspx. In there you find that what we want to work with is <tiles:insertAttribute name=”body”/>, but working with this file will let you get the basic layout you want. The different attributes are found in layouts.xml, and they reference their respective files in /WEB-INF/views, so that should get you started making a nice template

 Posted by at 11:41 pm
Oct 102010
 

I love Roo! Ben Alex and his team have made a great job making starting a Spring project a breeze. However, I’ve shied away from using Java for XHTML/JS/CSS since 2003, so while I know the underlying technologies with Roo (JPA, the databases, Spring, JUnit, Tomcat, etc etc) I don’t know Apache Tiles at all. So I figured I’d like to learn it, at least until Roo 1.1 hits in a few weeks, when I’ll probably want to learn GWT. ;-) Stay tuned…

So, for learning this I’m going to make a project I’ve been planning ever since I released my awesome tuner for early music musicians: Well Tempered for the iPhone:  Open Temperament. It’s going to be an open database for tuning temperaments. So, first step, register the domain (let’s hope this isn’t going to be one of those many great ideas that are parked on a domain due to lack of time ;-) ), done, and let’s get the basic Roo script up:

project –topLevelPackage net.opentemperament
persistence setup –provider OPENJPA –database HYPERSONIC_PERSISTENT

entity –class ~.entities.Family –testAutomatically
field string –fieldName name

entity –class ~.entities.Temperament –testAutomatically
field string –fieldName title
field string –fieldName description
field string –fieldName originalAuthor
field reference –type ~entities.Family –fieldName family

entity –class ~.entities.OnlineUser
field string –fieldName fullname
field string –fieldName email
field reference –class ~.entities.Temperament –fieldName onlineAuthor –type ~.entities.OnlineUser

entity –class ~.entities.Note –testAutomatically
field string –fieldName name
field reference –type ~.entities.Note –fieldName enharmonicTwin
field number –fieldName indexFromA –type java.lang.Integer

field reference –fieldName startingNote –type ~.entities.Note –class ~.entities.Temperament

entity –class ~.entities.Comma –testAutomatically
field string –fieldName name –notNull
field number –fieldName ratio –type java.lang.Double
field number –fieldName ratioInCents –type java.lang.Double
field reference –type ~.entities.Comma –fieldName alias

enum type –class ~.enums.IntervalType
enum constant –name MinorSecond
enum constant –name MajorSecond
enum constant –name MinorThird
enum constant –name MajorThird
enum constant –name PureFourth
enum constant –name PureFifth

entity –class ~.entities.Deviation –testAutomatically
field reference –type ~.entities.Note –fieldName lowestNote –notNull
field enum –type ~.enums.IntervalType –fieldName intervalType –notNull
field reference –type ~.entities.Comma –fieldName deviationType –notNull
field number –fieldName deviationValue –type java.lang.Double

field set –class ~.entities.Temperament –element ~.entities.Deviation –fieldName deviations

controller all –package ~.web
logging setup –level DEBUG
security setup

json add –class ~.entities.Family
json add –class ~.entities.Temperament
json add –class ~.entities.OnlineUser
json add –class ~.entities.Note
json add –class ~.entities.Comma
json add –class ~.entities.Deviation

perform eclipse
perform test

 Posted by at 10:23 pm
Oct 022010
 

The new AppleTV with iOS inside has me very excited as a developer and a media consumer. But, unfortunately, after the new AppleTV was announced, the old Apple TV is still on sale here in Denmark, Norway and Sweden. What gives, Apple? You neglect the most technophile part of Europe, both with the iPad and now with the AppleTV, without an obvious reason. I emailed support a few weeks ago, and they asked me to check back when the AppleTV started shipping. So now I guess we’ll have to drive to Germany to pick one up, just like with the iPad. Lucky for me that’s easier than for the Norwegians.

 Posted by at 11:05 am
Jun 282010
 

In my SheetMusic iPad application I want my users to be able to import new sheet music, get it back again for printing, and still keep the database and other working files away from the user. Luckily, hiding files is easy, even with file sharing enabled. Just prefix your files and directories with a dot, and they will be as hidden to iTunes as they always have been to Finder

 Posted by at 8:06 am
Jun 262010
 

I got an email today from two of my friends who had sent an email to everyone notifying that their email had changed. Not willing to do this work every time someone changes something I thought, I can just grab this via Facebook. A while back I used Address Book Sync (http://danauclair.com/addressbooksync/) and that was great, but one day it stopped working. I checked it out again, and although the new version 1.4 locks up while syncing, it actually does some work while appearing locked, and after a while it had chewed through my friends list and was ready to update my friends. It categorized them in matched and unmatched, so I started by syncing everyone who was matched. That seemed fine, but it synced photos more than phone numbers and email addresses, which is what I’m after. A couple of tests revealed that I was missing emails, adresses, phone numbers and homepages. Hmm… not quite there yet. What do you use? What do you recommend?

 Posted by at 5:58 pm
Jun 112010
 

To convert a certificate generated for Apache to a PEM file usable for Pound, do this:

openssl x509 -in mycert.crt -out mycert.pem
openssl rsa -in mycert.key >> mycert.pem

Now your certificate that was generated for Apache’s SSL is ready to be used by Pound

 Posted by at 9:46 am
May 312010
 

Frustrated about having Faces in iPhoto and not in Lightroom? Frustrated that it’s then in Aperture, but not Lightroom 3 beta 1 and 2? Frustrated about not hearing about it being a priority in Lightroom at all? And still addicted to Lightroom? Yupp, me too. But this night, for reasons not related to this post, I thought, hey, perhaps Picasa can help out? What I found is too good to be true, so it’s probably going to have all kinds of weird side-effects. But for now it seems to be great! You see, Picasa doesn’t move the files out of place, and it works with XMP (which Aperture does not, even though it claims to). And of course, I save all changes in an XMP sidecar. This great article simply states that all face detection will be written back as metadata in the file, and even updated into the XMP, so that I can just read it back into Lightroom! That sounds fantastic! So right now I’m scanning my entire library and look forward to a lot of tagging! :-)