Isaac about to lose the night time nappies? March 31, 2009
Posted by a1291762 in : isaac , add a commentIsaac has been toilet trained for ages now except at night. Despite what we thought were signs of readiness back in September he has proved consistently unable to handle himself at night.
That is until now. He got up yesterday and the day before that to do a wee (a first for him) so his nappy was actually dry when we got him up. I told him he had to go 6 days with a dry nappy before he could have undies on like a big boy. He seems quite determined to make it.
Update 10 April 2009
Nope. Must have been a lucky streak. He’s back to wetting the bed again. He does want to get rid of the nappies, he’s just not able to wake up before he does a wee at night. Oh well.
CodeWarrior vs GCC and sting literals March 31, 2009
Posted by a1291762 in : computers , add a commentSo one of my favourite Palm games is called Pocket Rogue. Finding the binary on the internets isn’t too hard but the source code is another issue altogether. The source is something I’ve wanted to get access to ever since I got my Treo 650 because there are things the game could do better on this system (eg. high-res bitmaps, better support for the keyboard). I eventually stumbled onto the code one day a while back and re-did the work to make it build under PRC-Tools (I originally did this years ago when I had a Visor Edge).
So anyway, the app randomly crashed on me and I couldn’t figure out why.
Thanks to my recent discovery of How to debug apps under POSE I now know the reason. It’s because of this:
static char *pos = “1007010304050206″;
…
pos[x] = pos[y];
That is, the ‘pos’ buffer is meant to be initialised to a particular value, is preserved across invocations of this function and may be modified (this ‘may be’ is why the crashes were random).
The Pocket Rogue source code is a CodeWarrior project so clearly this construct works with the CodeWarrior compiler but it fails in GCC because *foo ends up referring to data in the storage heap and modifying that without using DmSet causes a crash.
WTF?
Actually, it does make sense. You see “some string” is a literal string and modifying a literal string has undefined behaviour (according to the standards). A literal string should be considered a ‘const char*’ (or for C++ people, char const *). That is, you get a pointer to data that is constant. While some implementations/compilers happen to put string literals into memory that can be overwritten, this is not guaranteed. In the case of GCC for Palm OS, the pointer you get points to the string inside the binary, which of course resides in the data heap (or for NVFS devices, DBCache).
The correct way to initialise this is with code like this:
static char pos[10] = “1007010304050206″;
What’s the difference?
The bad version said “assign to this pointer the value of this string literal” which gives us an address to read-only memory. The updated version says “copy this string literal into this 10 byte character array” which means a memcpy is done behind the scenes.
I would guess that this is what CodeWarrior was doing implicitly.
AttnGrab gets a debug log March 18, 2009
Posted by a1291762 in : programs , add a commentThe problem with trying to debug an app like AttnGrab is that it’s really hard to actually use it properly unless you’re running on a device bug on-device debugging facilities are basically nil. I tried once before to write a debug log facility for AttnGrab bug I failed miserably. It turns out my understanding of how to write to databases was way off and the recent 3.0 work showed me where I was going wrong.
So now AttnGrab has a debug log. The app itself just has a small routine for writing the debug. You turn the facility on and view the log from a companion app called ATGDebug.
I did all this to try and track down a bug reported by someone. While I haven’t been able to track down their bug I did find 2 other bugs as a result of debug messages I inserted. Hooray.
Using Qt Extended 4.4 with Qt 4.5 March 18, 2009
Posted by a1291762 in : Uncategorized , add a commentMy last act as the Qt Extended build system maintainer was to make it possible to use Qt Extended 4.4 with Qt 4.5. I’m happy today to be sharing this work with the community. Perhaps it will enable Qt Extended to stay relevant for a while longer.
I’ve written up instructions and patches over here.
Enjoy!
Nokia 5800 on the way March 17, 2009
Posted by a1291762 in : 5800 , add a commentSo there’s a Nokia 5800 on the way here but it’s not for me.
This one is for Bree. She really wants it and since it seems like local phones won’t be available without “comes with music” we went for an import model. With any luck it’ll be here before the official launch.
I did noticed something rather sloppy about the stores selling this phone.
Most listed an incomplete or incorrect description. The phone may be quad-band GSM (which they got right) but it is also a 3G phone and the frequencies it uses are important (since there’s 2 models and one works on Telstra/NextG while the other works on the other 3G networks). Most shops failed to mention this and one shop utterly failed to comprehend why I might want to know which model they had (though I think most shops have the “everyone else” version since NextG uses US frequencies and that phone is newer and hence more expensive).
The official phone package comes with an 8GB micro SD card. Most shops failed to mention this. Some even appeared to be removing the card so they could sell you one with the phone!
In the end I went with Mobicity because they actually seem to have a clue about what they are doing. They weren’t the cheapest but their shipping was about half the price the other shops were charging so they weren’t too far off the mark.
Anyway, Bree says I can play with this phone a bit so I’ll definitely be trying out some Qt/S60 development on it.
iTunes 8.1 hates my iPod Shuffle (rev1) March 17, 2009
Posted by a1291762 in : computers , 6commentsI got bitten back when iTunes 7 first came out. It took quite a few versions before I could upgrade from iTunes 6 because the handling of my iPod Shuffle (rev1) was problematic.
It has happened again.
This time it’s iTunes 8.1 and the behaviour is very strange indeed.
Here is my iTunes workflow.
Process:
1) Plug in iPod Shuffle. iTunes opens and shows the shuffle playlist.
2) Sort by last played.
3) Select everything played now*, handily sorted to the top.
4) Sort by order (this reveals any songs I skipped over). If there were skipped songs, add them to the selection and drag the lot over to a holding playlist.
5) Click Autofill. While waiting for this to complete, process the holding playlist.
6) Click Eject.
7) Quit iTunes.
* iPod Shuffle does not record the last played time so iTunes puts in the sync time for any songs that were played. It’s not an ideal solution but it’s better than what we had when the shuffle first came out (last played was not updated at all).
The point of the holding playlist is for me to be able to change things about songs. Usually it’s because I don’t like a song anymore but I’ll also use it to notify myself of problems in audio (eg. bad panning).
The sorting bit requires that I listen to songs “in order” on the iPod. Since iTunes creates a randomized playlist this is fine (no sense in randomizing a randomized list). I have a fairly complicated playlist system setup so my music rotates onto the shuffle more or less frequently based on ratings and last played dates. Perhaps similar to the “play higher rated songs more often” but much more tuneable.
So after installing iTunes 8.1, I noticed a problem. When I sorted the playlist, the songs I had been listening to were not at the top. This has occasionally happened in the past due to the iPod randomly deciding to start in the middle of the playlist but a soft reset of the iPod (press play 3 times quickly) was enough to fix that. With iTunes 8.1 the problem was consistent. Actually, no matter how I looked at it I could not discern a pattern to how the on-screen view of the list was translated into what the device played. When I synced, the on-screen list changed such that the songs the iPod played were in order, though at the wrong end of the playlist. Occasionally I have had the on-screen view in iTunes fail to match the device but “Copy to play order” always fixed this. Now it doesn’t seem to do anything.
I have no idea what is going on. It’s like there is some kind of randomization going on underneath the covers that I cannot control or turn off. I have reverted back to iTunes 8.0.2 and now all is good again. Sadly, my playlists have been set back a few days but I suppose it could have been worse. You generally have to revert to the saved iTunes Library when downgrading. Luckily the only changes to my library in that time were a few days of last played updates.
Chrome tabs, cheating? March 11, 2009
Posted by a1291762 in : computers , add a commentSomething I didn’t quite notice until after I wrote this scathing retort about Safari 4 is that Chrome cheats with its title bar.
The screenshot I took is here:
It’s not at all obvious from that screenshot but Chrome is running on a Windows XP machine with the Classic theme. Why? Because not one of the widgets visible there is drawn through Windows. Interestingly though, this doesn’t bug me (which is strange, because I’m normally the kind of person to be bugged by UI inconsistencies).
When it comes to everything other than the title bar/tab area, I can understand the lack of native widgets. Browsers generally have their own L&F that doesn’t match the platform. All the browsers I have near me have at least some custom-looking widgets on their title bars. Mind you, I don’t think this should extend beyond the toolbar area. Safari 3 on Windows didn’t have anything native. It looked like a Mac app down to the scrollbars and font rendering. That’s not a good way to do things. Chrome seems to use native (or at least native-appearing) widgets where possible. Safari 4 matches this behavior which is something I applaud. Firefox used to (possibly still does?) use non-native Windows-looking widgets. I always remember being annoyed at how Firefox never fit with the desktop style on Linux. Mind you, my current Firefox 3 build does seem to match the desktop style so perhaps they’ve fixed it. Either that or I patched the Firefox package when I installed it.
So the title bar…
I’m not sure if Apple is replacing the title bar completely and emulating the look and feel of the system. If they are, they’re doing more work than Google did since there are at least 3, possible 4 styles they’re emulating – Classic, XP, Vista Basic, Vista Aero (I’m not sure if Aero is a separate style or not).
Despite being non-native the Google title bar doesn’t concern me. Perhaps it’s because it looks like a Vista title bar and that was familiar enough. Perhaps it’s because it gets the controls close enough to their correct locations. Could Google have used/emulated the look of the Classic and XP themes and still had their awesome tab bar? I think so. Why? Google have come out and said they’re not going to monkey around with title bars on Linux and Mac. The first screenshots of Chrome on Mac show they’re not kidding. I think it also clearly shows what Apple should have done with the tab interface in Safari. See how clearly the tabs stand out? See how there’s a title bar above the tabs to click on? You most likely won’t end up with the same seamless transition between title bar and tool bar area on Linux (depending on your Window manager/theme setup perhaps) but I think it’ll be fine. Supporting the Classic and XP themes would likely involve the same trade off, losing the seamless transition that’s there now. For all I know, using native Vista title bars would have the same problem. Perhaps that’s why they cheated in the first place?
Oh yeah… and Safari 4 once again failed because I went to click on a Window while writing this post and managed to close a tab instead. I could rant about this, or just point you to this rant that nicely mentions how click-through should be handled.
Palm Pre vs Nokia 5800 XpressMusic March 9, 2009
Posted by a1291762 in : 5800, computers, pre , add a commentSo I’m just not that into the iPhone and the Pre hasn’t materialized yet. Palm’s delay could cause them to lose a fan because my eye has been caught by the 5800.
Working at Nokia means that I get to see various prototype devices. If it wasn’t for this, I would probably not even know what a 5800 was. I saw one at the office, got to play with it and even though it was a prototype running pre-release software I was impressed.
The UI is no iPhone/webOS killer but I’ve always been a function over form guy. Symbian/S60 is a solid platform capable of getting the job done. If I need it, there’s StyleTap for running my legacy Palm apps (an option the Pre cannot have while apps must be written in JavaScript).
Development is superior to webOS. I’ve tried to get excited about Mojo but it’s really hard. In contrast the 5800 will run native code and thanks to Qt for S60 I’ll be able to use an API I’m already familiar with. The only downside could be a need to use a Windows machine for development. Hopefully this will let me avoid that though.
The phone comes with 8GB of removable storage (“something or other”-SD). There are already 16GB cards available for that slot too. Not that I necessarily think I’ll need more than 8GB of storage but knowing I have that option is certainly nice.
The 5800 officially goes on sale in Australia in 11 days.
After almost 200 builds, AttnGrab's profile makeover is complete March 4, 2009
Posted by a1291762 in : programs , add a commentPhew!
There’s almost 200 builds between the last version of AttnGrab and the new version. Considering how much on-desktop debugging I had to do that’s a lot.
The app has had a massive overhaul of its prefs/profiles system. It now supports “unlimited” profiles and stores them in a database (instead of the system prefs). The ringer switch no longer changes profile but it can change prefs within a profile. Hard to describe but it works much more sensibly.
AttnGrab still imports your old prefs but you’ll probably want to change what it’s done to take advantage of the new functionality.
So the new prefs code gave me a heap of grief. I spent quite a bit of time trying to figure out why it was crashing but you don’t get anything useful on the device and POSE just says to connect a debugger. At least I managed to find one. It’s part of EzAsm and I heartily recommend it to anyone testing crashes under POSE. Build with PRC-TOOLS and use -g and -mdebug-labels then you’ll be able to print a stack trace.
Turns out I had some assumptions about memory that don’t work (eg. you MUST use DmWrite to write to memory in the data heap. You cannot just write to a pointer).
Since AttnGrab is ostensibly an “OnBoardC app” the .zip only contains the files you need to build under OnBoardC but it also builds and runs just fine with PRC-TOOLS (that’s how I do my on-desktop testing). I haven’t included the infrastructure needed for this but if anyone is interested in it, let me know and I’ll package it up. I tend to do most of my development on the device and use a command-line text to pdbdoc converter to convert the .pdb files to .c and back again. I store everything in git as text and generate the .pdb files for the package (or for uploading to my device).
Of course, most Palm developers probably use PODS but I have a Mac so that’s not an option for me. At least webOS supports Mac as a development host.
