Posts

Showing posts from 2010

iOS 4.2.1 battery drain on iPad

The Battery Life ThreadFollowing the iOS 4.2.1 release in the news and in forums I came across a discussion thread in Apple’s forums that is about the issue of some users having extremely poor battery life after the upgrade from iOS 3.2. I have not yet upgraded to 4.2 and I might in fact hold on to 3.2 for a little longer for other reasons, so I don’t know yet, if I will be affected the same way. There are some users claiming that this is what is to be expected now with multitasking and several apps taking up resources at the same time. Reading through these, I could not help to notice that there seems to be a fair bit of confusion and misinformation going on about how multitasking might contribute to this issueSo from a developer point of view, let me just state a few things. Please note that the general tone of this is that the “Apple/iOS version” of multitasking is by no means comparable to what you know from Mac OS or Windows, so many analogies are just not correct.

Collection Performance - Don't become too lazy

SituationA few weeks ago I was performance tuning some code that ran quite regularly and took more time than it should, judging from the complexity of what is was doing. As usual, by merely looking that the code there was nothing blatantly, obviously, complete and ridiculously wrong - after all, it worked correctly.So I fired up trusty old JProfiler and had a look, just to find out that sometimes you can become just too lazy and reliant on libraries without realizing their characteristics deeply enough.

No Google Apps for me

I am a huge Google fan and especially love GMail. I have been a member from very early on and gone through all their improvements. Currently there is a mail archive of about 1GB in my account, going back to February of 2005.Recently my friend and colleague Udo made me aware of the fact that Google Apps for your domain offers a free standard edition for up to 50 users. That seemed to be the perfect solution for me, because I figured that would allow me to use a custom sender address when sending mail from my iPad or iPod Touch instead of my @gmail.com address. Right now, if you want push notifications for new mail, you need to set up an Exchange account for GMail on the iOS device, but this will not allow for custom sender addresses. In the end I am not even sure this would have worked, but for other reasons I decided to abort the setup half way through for a IMHO very stupid limitation.

Code Generation with Xtext

Image
Recently I attended a local rheinJUG meeting in Düsseldorf. While the topic of the session was Eclipse e4, the night’s sponsor itemis provided some handouts on Xtext which got me very interested. The reason is that currently at work we are developing a mobile Java application (J9, CDC/Foundation 1.1 on Windows CE6) for which we needed an easy to use and reliable way for configuring navigation through the application.
In a previous iteration we had – mostly because of time constraints – hard coded most of the navigational paths, but this time the app is more complex and doing that again was not really an option. First we thought about an XML based configuration, but this seemed to be a hassle to write (and read) and also would mean we would have to pay the price of parsing it on every application startup.
Enter Xtext: An Eclipse based framework/library for building text based DSLs. In short, you just provide a grammar description of a new DSL to suit your needs and with – literally – j…

[SCR] Found components with duplicated names inside their bundle!

Today I was briefly confused by an error message issued by the OSGi Equinox runtime’s Declarative Services runtime which I did not understand immediately. For your – and my own – reference find the solution here.
First, this was the error message I got:
1281104579615=1::[SCR] Found components with duplicated names inside their bundle! This component will not be processed: Component[ name = networksimulation factory = null autoenable = true immediate = true implementation = com.danielschneller.sim.network.NetworkStateSimulation properties = {devicevendor=DanielSchneller, simulation=true} serviceFactory = false serviceInterface = [com.danielschneller.network.NetworkState] references = { Reference[name = LOG, interface = org.osgi.service.log.LogService, policy = static, cardinality = 0..1, target = null, bind = null, unbind = null] } located in bundle = com.danielschneller.sim.network_1.1.0.qualifier [49] ] Apparently the comp…

Java Object Initialization Order - Know your JLS!

Recently I came across an interesting problem whose solution eluded me at first glance. Consider these three classes:
package com.ds.test; public class Upper { String upperString; public Upper() { Initializer.initialize(this); } } package com.ds.test; public class Lower extends Upper { String lowerString = null; public Lower() { super(); System.out.println("Upper: " + upperString); System.out.println("Lower: " + lowerString); } public static void main(final String[] args) { new Lower(); } } package com.ds.test; public class Initializer { static void initialize(final Upper anUpper) { if (anUpper instanceof Lower) { Lower lower = (Lower) anUpper; lower.lowerString = "lowerInited"; } anUpper.upperString = "upperInited"; } } What output is to be expected from running the Lower class?

Set Scaled OS X Desktop Wallpaper via Automator

Image
I regularly enjoy the pictures Romain Guy posts on his blog. Often they make for great desktop backgrounds, but at a whopping 20 megapixels they are just a little too big for my iMac's 1920x1200 screen.
When today I came across his most recent picture called False Kiva I went through my usual list of steps:
Go to the "original size" version of the picture on FlickrDrag it to the desktopOpen the file with a double clickScale it to 1920x1200 in Preview.appSave it to the Pictures folderSet it as the wallpaper It occurred to me, that apart from liking and downloading a picture, all the remaining steps could be automated with a little Automator service. So I recorded this sequence of steps and saved it as a service.

On Writing a Book, Pt. 4 – The Tools (II)

Image
This is part four of an ongoing series about my experiences while writing the MySQL Admin Cookbook for Packt Publishing. All previous parts can be found under the mysql-admin-cookbook label.This part will be about more software used in the process of writing the book. The last episode covered writing tools, file/version management and backups. What's up now is graphics programs, virtualization and PDF handling.

On Writing a Book, Pt. 3 – The Tools (I)

Image
This is part three of an ongoing series about my experiences while writing the MySQL Admin Cookbook for Packt Publishing. All previous parts can be found under the mysql-admin-cookbook label.Even though I said I would be presenting things in mostly chronological order, I think after the previous - rather dry - part, a little more technical and fun information would be nice for a change: The tools used to create the MySQL Admin Cookbook (well, at least those used by Udo and me). To give a detailed account of what software products we used during the whole experience I will split this topic up into multiple posts. Otherwise it would just become either way too long or I would have to leave out too much stuff than I am willing to.

On Writing a Book, Pt. 2 – Outline and Schedule

Image
This is part two of an ongoing series about my experiences while writing the MySQL Admin Cookbook for Packt Publishing. All previous parts can be found under the mysql-admin-cookbook label.While last time I focused on the initial contact with the publishing company (just referred to as "Packt" from now on), this issue is about the process of putting together an outline proposal and coming up with things to write about in the first place. As from this point on in the process Udo was involved with everything, I will be referring to "us" and write "we" most of the time from now on. The Publisher's ExpectationsThe only thing we knew about the books would-be content was a chapter template for Packt's cookbook series as well as the general description provided by Sarah earlier: As I'm sure everyone is aware, MySQL is a relational database management system. Administrators of MySQL will be tasked with things such as maintaining the database, tuning t…

On Writing a Book (Pt. 1)

Image
This is the first part of an ongoing series about my experiences while writing the MySQL Admin Cookbook for Packt Publishing. All parts can be found under the mysql-admin-cookbook label.In a few past posts I wrote about different aspects of my book writing project already. However those posts were not very contiguous, and I was asked a few times what my general experiences were and what caveats to look out for when taking on such a project for the first time. It might be of interest to some if I write down my experiences in a little more structured form. This will be a series of several posts, because for one I do not think it would be feasible to have a single very long one, and also because this allows me to span writing it over a longer time. I will try to keep everything roughly chronological, but will deviate when I think it makes things clearer or better to understand. Please be aware that I do not have extensive experience with multiple publishers, their processes and so on. …

Amazon + DHL delivery speed - just great!

Image
Instead of all the bashing that's usually to be found in blogs, I think one should give credit where credit is due.Yesterday in the late afternoon I ordered some hardware from amazon.de with standard delivery options.This is what my email inbox looked like today:
The oldest mail (the last one in the screen shot) is Amazon's confirmation of my order. Unfortunately this cannot be seen directly, but the mail arrived - seconds after I placed the order - at 17:50h (5:50pm). The next mail - today at 09:53 (am) - informed me about the package leaving Amazon. Only about 5 hours later I was informed that it had been delivered at my chosen destination!With this kind of speed, I do not think I will be buying an Amazon Prime membership anytime soon, otherwise they would probably deliver the stuff, even before I ordered it ;-)

iTunes 9.1 to check for iPod Software Update on Apr 3rd

Image
When I just heard about iTunes having been updated to 9.1 I went ahead and installed it via Software Update on my iMac. When connecting my iPod Touch I was immediately curious about this:
Is it just me, or do I see a very special date for the next update check of the iPod's software version? Usually this is set to be something like every two weeks. I cannot be sure if this is the same date as before the update, but I think this might be a hint of the iPhones and iPod Touches being updated along with the iPad release as well.

Even when hitting the "Check for Update" button, the date does not change...

New blog template – and the problems entailed

Image
Last week I was happy to see that Blogger.com (where this blog is hosted) introduced a new template layout editor. While marked “beta” – or “Blogger in Draft” as they call it – I had thought about updating the layout of my site for quite some time, but never managed to sit down and do it. Now with this new editor, there seemed to be no reason not to go for a redesign.You can see the result – I did not go crazy with the layout, but I think it is a nice, refreshed variation of the previous style. I replaced the header image and went for a slightly different color scheme. Temporarily I had picked a more colorful background image, but after some feedback decided against keeping it; it was just too noisy.In general, I have to say the new editor is very nicely done and offers a very quick way to come to a reasonable design. However, there are some problems, too. Just to be clear: Even though I did not see any big-lettered warning signs in the new editor itself, by using the “Blogger in Draf…

MySQL Admin Cookbook Available

Image
Finally, it is available for orders: The MySQL Admin Cookbook is the first book I have written and it is now ready for shipping. You can find more information about it at the publisher's website, including a free sample chapter!I have yet to receive my sample copy, however that should not keep you from going ahead early and ordering it, e. g. from amazon.de. For your convenience, here is a direct link: On Amazon you can also have a look at the index and a few pages of the first chapter.More international points of sale can be found on the publisher's website, as well.

15 months – And it is done

Finally: Not quite 65 million years in the making (Jurassic Park, hint, hint), but it took about 15 months to get my first book to the printer. A few days ago Udo – my co-author – and I approved the final version of the MySQL Admin Cookbook for publishing. From what I see the book has not been added consistently to the online book stores around the net, but I will most certainly put links on here, as soon as it is available.I think, before I begin the next one, at least a few months of relaxing are in order….

OS X’s Preview fails to display PDF annotations

Image
Today I went through a set of changes the proof reader had made to the book’s preface. I could see his annotations in the document and was seriously wondering what the heck he wanted to tell me. I even went so far as to reply that I thought his changes would make matters worse. Turned out to be quite embarrassing, because apparently Mac OS X’s Preview.app does not do a very good job of displaying annotations inside PDFs.See this screenshot:The bars on the left each signify a single annotation in the document. Unfortunately neither are they aligned vertically with where the change is (see the red one saying “Swap order” – this is related to the red squiggly line right below the “Preface” heading.Hovering over these bars will highlight the corresponding marker on the right, but will not reveal the comment associated with it. From what I can tell there is no way to get the text to show up. Zooming in and out changes the layout somewhat and makes a subset of the text visible – as in the s…

Finishing touches

Image
The book is in its final stages. Right now I am putting the finishing touches to the illustrations and going through the editors’ most recent comments and suggestions. Takes a lot more time than expected, though…

HP ScanJet G2410 Mac OS X 10.6 driver (Snow Leopard) download

In my previous post I promised to post follow ups regarding the missing Mac OS X 10.6 (Snow Leopard) compatible drivers for the HP ScanJet G2410. Today I got a response to my support case, including a download address which I would like to share. On the website you still cannot find the software directly. HP ScanJet G2410 Mac OS X 10.6 driver download pageI have not yet tried to install it, but will certainly do tonight when I get home. However anyone interested could go ahead already.As an aside, I was not able to download the disk image using my Windows based Chrome browser - for some reason it told me the link was broken. With Firefox it works just fine and has just finished. The file name is slightly different from the one I was able to download earlier (see previous post), it now ends in ...Ph2.dmg instead of ...Ph1.dmg. We'll see tonight.

HP Mac Software Support - Ridiculous

When a few weeks ago my Canon LIDE70 scanner died, I went and looked for a Snow Leopard compatible replacement. I found the HP ScanJet G2410 which is labeled compatible with 10.6. Little did I expect what “compatible” means in HP’s terms.So I went ahead and bought one at a local electronics store. Inside the box there was a leaflet informing me about the software on the CD only being suitable for Leopard (10.5) and that I would need to download the most recent version from HP’s homepage, which I did.Downloading it took a long time, because apparently they are throttling the bandwidth to about 30kb/s – not so nice when you have to download 120MB for a driver. Once it was finished, I launched the installer and everything seemed to work just fine.However I noticed that Apple’s Image Capture application did not recognize the scanner, even though their own tool “HP Scan” works flawlessly (not considering the 100% CPU load on both cores for about 30s before the first scan starts). The tool …

Blog Statistics 2009

Image
Others have done it, so why shouldn’t I do it, too? Well, usually that’s not my line of thought, but when today I read David Linsin's blog post about his stats I thought I might follow along.Overall statsThe overall visits to my blog – and countless others with no doubt – display the workday/weekend jagged line one would expect. The summer months seem to be a little lower on average, but that’s ok, people deserve their vacations. Blue line is 2009, green line is 2008 for comparison.Overall traffic increase in the 40% range with slightly more time per page – nice. The bounce rate is constantly high, but since almost all posts are about some particular narrow-focused topic, this is expected. Usually when looking for the solution to a problem bugging me, I do not have the time to browse around for other, unrelated stuff on the sites I come to, either.Top ContentsThe top 8 content pages in 2009 were:MySQL: Add primary key to table with duplicates (5666 page views) Migrate VM from Virt…