Seapegasus Blog

All | Hacks | Java Mobility | Mac | Misc | NetBeans | NetBeans_de
20071214 Friday December 14, 2007

JDKs for MacOS?

Yesterday, Apple released a JDK update! :-)
... for JDK4 and JDK5. *sigh* :-[

Let's hope the update does something useful. The "more info" link offered by the Software Updater in the German locale was a 404. I searched the Apple support center and only came up with this English info page (which alas doesn't contain more info, but repeats what I already knew, "it's an update").

Also this week, Apple felt compelled to release a little article about Java and Mac OS 10.5 (Leopard). Don't hold your breath. As much as I appreciate Apple improving their Java profiler, and adding support for 64-bit apps, yadda yadda, it's still a pity the whole article says no word about the Apple JDK 6. *sigh* It doesn't even contain the number 6. *SIGH* (Although it contains the digit 6. I checked.)

I still have the JDK 6 Dev Preview released by the Apple Dev connection (a download which seems now gone from the ADC.) Why does Apple develop their own JDK? They do it so they can add these guys to it. (Why they do it so slowly, I don't know.) If you want to know what Java on the Mac looks like without those typical controls, have a look at this BSD port of JDK6 for Mac OS 10.4 and 10.5: Soy Latte JDK 6.

You can download SoyLatte into any directory you like, then expand it (I used bunzip2 soylatte16-i386-1.0.tar.bz2 and tar -xf soylatte16-i386-1.0.tar in the Terminal), and then symlink to it from /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home, so NetBeans can find and identify it as a JDK in the Java Platform manager. Afterwards don't forget to go to the properties of the project you want to use it with, and switch it to use the SoyLatte Java platform.

It seems to make sense to place SoyLatte in the /sw/ directory, but if you save it to a directory in your home dir instead, then you can compile and run the demos and samples that come with it as normal user. I do have X11 installed, but I haven't figured out how I can make NetBeans run the demos directly in X11, although it readily recogizes the projects as netbeans projects. (If you figured it out, leave a comment.) If I run the samples from the commandline in the X11 terminal, they don't look pretty ;-) (as expected), but they work well.

In case you like SoyLatte so much that you want to get rid of the developer preview jdk, read Joshy's blog.

PS: Two people asked recently, so if you don't know either how to set up the javadoc popups in netbeans, here's an 'F'AQ answer to you.

Posted by seapegasus ( Dec 14 2007, 07:03:47 PM CET ) Permalink Comments [1]


20071025 Thursday October 25, 2007

Hi I've Got This Great Idea For Mac OS Leopard

Somebody pointed out to me this Mac rumors thread -- how to get rid of the glassy look of the dock in the new Mac OS X (10.5) Leopard in case you want to. Glassy dock? When we were young, we had no glassy docks! Of course I immediately went to have a look at Leopard to see what this was all about.

Where was I? Oh yeah, the Mac OS Leopard preso. Seems the new dock has a 3D look. And I mean really 3D. The surface reflects stuff. Wow! *Moves nose close to screen* No. Wait. It only reflects open windows on your desktop and stuff. It doesn't really reflect.

Oh come on. I mean, every Mac that can run 10.5 also has an iSight, right? So here's my cool idea: Record the user (with the iSight) and have her reflection in the icons! ... :-D ... No? :-( But hey if this feature shows up in MacOS 10.6, then you know where they got in from.

PS: No Java 6 on Mac OS Leopard?!

Posted by seapegasus ( Oct 25 2007, 05:10:39 PM CEST ) Permalink


20070331 Saturday March 31, 2007

Turbo Quicktime Encoding

I just wanted to show this (macnews) and this (MacWelt) to a colleague of mine, but noticed that there are no English articles to be found describing this new piece of hardware, so I just write one myself.

Elgato Turbo 264 is an external CPU in a USB stick. When you encode a lot of H.264 Quicktime movies (for iPod or Apple TV), you know how it maxes out your Mac's CPU(s), and still takes between 4h and 20h to encode one movie? Right, so the idea is to let this specialized additional CPU do the encoding for you, and take off the load of the main CPU.

The main advantage is of course speed: The tested prototype's statistics for encoding a 1 min long 640x480 video on a Mac with 2 G5 CPUs are: 3.5 min (without turbo), versus 46 secs (with turbo). Presumably, if you already have an uber-fast Mac Pro, the speed gain is less noticable, but for everybody else it should make a big difference.

The included software comes with a plugin that adds the hardware encoding option to the Quicktime Exporter menus, e.g. in EyeTV, iMovie and Quicktime Player Pro. It also support a video format compatible with Sony Playstations somewhere. If you don't have Quicktime pro, you can get the functionality (*) included in the stand-alone version of the product.

And why am I advertising it? Let's say I might know someone who may or may not possibly have had a hand (or two) involved in the development of the software's spiffy GUI. ;-) (Sources: MacWelt and MacNews)

PS: (*) To be more clear, the stand-alone version does not contain a QuickTime Pro license, but something with equivalent functionality by Elgato.

Posted by seapegasus ( Mar 31 2007, 12:36:00 PM CEST ) Permalink Comments [1]


20070323 Friday March 23, 2007

MacOS Screengrabber Death Match

Yesterday night I was looking a for a screengrabber for Mac OS. Something simple to record a video tutorial with, or grab cool scences out of video games. Built-in audio recording would be cool but has lower priority for me.

So I went and I tested the following five screengrabbers: iShowU, Screenography Light, Screenmimic, AlphaOmega Screen Movie Recorder, and Display Eater. All applications were universal builds and ran fine on an Intel core duo Mac with Mac OS X 10.4. In all cases I could just drop the resulting quicktime file into iMovie and start post-editing; if it was a flash movie, I could play it in the browser. (*) When I mention localization, I am referring to the German one.

Welcome to the Mac screengrabber deathmatch:

iShowU (demo)

The demo version runs fast and makes a good impression. It comes with a row of sample settings (high and low quality) to choose from. The customizable settings are clearly structured and cover what you need (mouse visibility, quality, various Quicktime compression formats). The tool is able to record system audio and microphone input. The interface to specify various recording area sizes is well done too (includes even a "follow the mouse" setting). Minor nit: The de(*) localization was only partially finished resulting in confusing dialogs like "Wenn Sie alles löschen wollen, then click yes: Ja/Nein?" (not literally, but similar).

The demo leaves a watermark on the movie to encourage you to spend $20 to unlock it -- which it is certainly worth if you regularly record quicktime screencasts with audio.

Screenography Light (demo)

Screenography Light is basically a screenshot utility that is also able to record movies. The application runs in the background without displaying an icon in the dock. You specify a keyboard shortcut to open the Screenography palette that lets you start and stop recording. The only way to specify the recording area is by dragging the mouse, then you hit the "start" button. Hit the keyboard shortcut again to stop recording, and export the movie as Flash or Quicktime. Minor nits: After generating an SWF file, Screenography tried to open the flash movie with QuickTime, which obviously failed; also the generated flash movie does not come with any generated HTML with size settings, so unless you happen to remember the exact values, the movie will look distorted in the browser.

The demo leaves a watermark on the movie unless you pay $10 for the light version, or $40 for the Pro version that also supports audio, and has more options. Seems worth the money if you need a quick and simple tool, and switch between Flash and Quicktime formats a lot.

Screenmimic (demo)

From the start, Screenmimic guides you through the set-up and recording process with an easy-to-use wizard. It records either full screen, a selected screen area, one specified window, or the recording area can follow the mouse. You can also set a timer after how many seconds the recording should start. Screenmimic records audio from the microphone/line-in only. It can export movies in Flash or Quicktime format, with or without a visible mouse pointer. Minor nit: Going through the wizard to start recording will likely annoy me before long; above all, pressing Apple-N didn't re-start the wizard as I expected, so I had to quit and restart the app to record a second movie.

Unless you shell out $65, the demo version records only 30 sec, and it leaves a watermark on the movie. You might want to consider this tool for easy mass-production of Flash web pages, since Screenmimic also generates the embedding HTML code snippet for your movies.

AlphaOmega Screen Movie Recorder (freeware)

It may not look as professional as the other apps, but it does have the minimum set of features, and the workflow is clear. Choose "start recording" from a green dot menu appearing at the right end of the menubar. Next select the screen area by dragging a rectangle with the mouse, and there you go. After you select "Stop recording" from the red dot menu, Screen Movie Recorder immediately generates a .mov file on your disk. That's it.

Cons: Not 100% stable (crashed my Finder once), supports only one file format (.mov), no options at all, no audio, de(*) localization is faulty.

Pros: Screen Movie Recorder is a no-frills tool that leaves no watermark, it is free, localized, and easy to use.

Check out their homepage, alphaomega have many more small applications to offer.

Display Eater (shareware)

Nice and smooth interface, without having to think twice I recorded a useful screencast. Open Display Eater, click "Start recording", and determine the recording area by resizing a rectangle. (You can also save your custom size setting.) Move the Display Eater window to a spot where you find it again, and hit "capture" to start recording. When you're done, go back to the main Display Eater window and click "stop recording". After recording all the scenes, press "Settings" to specify the movie format (e.g. MPG-4). Then press "save" to convert each scene into a quicktime movie.

Cons: No audio, crashed once, recorded mouse pointer is out of sync.

Pros: Display Eater is a free no-frills recording tool that leaves no watermark, and despite being shareware I encountered no time restrictions in this version (I tried 3 min); it is lightweight, stable, easy to use, and has configurable mouse recording. The author plans to open-source the code one day.

Verdict:

If all you want is a literally quick QuickTime movie, and you don't need any live audio, then you can get pretty far with no-frills freeware. Remember you have the option of adding an audio track using Apple iMovie later. And if your work requires you to output Flash movies, or you cannot do without live audio recording capabilities, you can choose from reasonably priced tools. For the time being I'll stick to Display Eater and see how far I will get.

If you are interested in this topic, read Where's the killer screencast app for the mac? and Mac options for capturing video of your screen.

Posted by seapegasus ( Mar 23 2007, 07:10:50 PM CET ) Permalink Comments [2]


20070216 Friday February 16, 2007

Java Thread Dumps and Other MacOS Hacks

Since recently, my copy of NetBeans ponders the developments of world history after each launch, before it deigns to become responsive after 3-4 minutes. So Petr N. suggested to have a look at the Java thread dump. But how?

First I looked in the wrong place: I noticed the IDE was wasting cycles because I saw it in the Activity Monitor utility that I had put into the dock. You can set this utility to show the CPU state (or network load or RAM usage) in the dock's icon. So, first I clicked the Activity Monitor's Analysis button to get a thread dump; but then I noticed this only shows system threads, and not java threads...

So Petr pointed out to me the generating thread dumps section on the NetBeans QA homepage. The tips there do half the trick. It tells you to start the application from the Terminal, and then hit ctrl-\ to generate the thread dump. Usually, it is output to a file.

But how do I start a MacOS .app file in the Terminal? You can't just type in /Applications/NetBeans.app into the Terminal utility and hit return.

open /Applications/NetBeans.app

only works to execute the app in the Finder, but that's not what we want. What we need is the app's package content. Inside the package you will find the UNIX-style executable.

In the Terminal, the right path to NetBeans' package content looks like this:

/Applications/NetBeans.app/Contents/Resources/NetBeans/bin/netbeans

If you get an error message, go to the Finder and right-click onto the NetBeans.app symbol, then select "show package content" to identify the correct path by looking at the directory structure in the Finder. You can drag and drop the last ...bin/netbeans file icon from the Finder into the Terminal window to make sure to get the path right!

Press enter to start the application in the Terminal. To trigger the thread dump of the running application, hold down the controlkey and hit backslash (ctrl-\). On Mac OS, the output goes straight to the Terminal, not into a file. Copy and paste it into a text editor if you want to keep it. Notice that the terminal is irresponsive after you started NetBeans from it that way -- this is normal, the freshly started foreground process blocks further input to the terminal until you switch the process to the background. If you don't need the Terminal anymore, leave it open.

If you need to use the terminal (and don't want to open another window), do the following:

The latter option is not very useful for applications like NetBeans, but for Terminal applications that actually run in the Terminal window (such as top). If you want to stop such a process for a second to quickly check another command, go back to the Terminal by pressing ctrl-Z, and resume the process by typing fg.

Watch out, if you close the Terminal now, it will take the child process with it -- and thusly force-quit NetBeans! When you click the close button or quit the Terminal utility, you will get a warning. Note how it says "[...] will quit the processes bash [...] and java" -- the java process is of course NetBeans. But you only need to run the IDE this way to get a thread dump once, you would not do that each day.

I detected some other useful MacOS shortcuts this week (you might know them already, but in case not): Most people know they can switch applications by pressing Apple-tab and Apple-shift-tab. Similarly you can switch windows within one application by pressing Apple-`on a US keyboard or respectively Apple-< on a German one. Part of the reason why I never used some of those was my confusion about the various keyboard layouts. I switch so often between different keyboards (Apple, PC, Sun; laptop and desktop), different languages (German, US, British, Czech), and different operating systems (Mac, Linux, Windows) that my brain gave up keeping track with all the shortcuts. E.g. on a standard Mac or PC desktop keyboard, the ctrl key is in a different place as on a Sun keyboard, and it's different again on a MacBook... Aaaargh... But this window-switcher shortcut is always at the bottom left of the keyboard, so I trust my brain will be able to handle it. ;)

Another useful keyboard shortcut from a similar context is the one that switches keyboard layouts. I need it quit often (reason: see above). It used to be Apple-space, but I think this is Spotlight now. This is why I always go to the System Preferences for Keyboard & Mouse first to fix the keyboard shortcuts: The yellow warning sign next to a shortcut means it's double-booked. In this case double-click the entry to change it by typing in the new shortcut. I chose ctrl-space to switch the keyboard layout because that's similar to Apple-space. Now you can quickly switch between international layouts, which is useful for people who are able to touch-type in another language, e.g. if you quickly need a Czech Haček or a Germän Umlaut.

Have a look at the other shortcuts too, while you are there. Did you know that Apple-Shift-D looks up a word in the dictionary? I couldn't get it working with a German locale to look up English words, but it works well in an anglophone locale. (But don't even think of using it while writing a message in Apple Mail, where this shortcut will send your email half-finished!) And if you don't know the screenshot schortcuts yet, they are worth knowing by heart. Tip: If you press Apple-shift-4 and then immediatly the spacebar, you can select a window to take a screenshot of.

PS: Woah, when I wrote that about the dictionary pop-up, I just recalled a dream I had last night. I don't remember anymore who the dream character was, I only remember that I called Apple-shift-D on him while he was walking around... So the window popped up... and he fell over it... *giggle* Children, don't try that at home!

Posted by seapegasus ( Feb 16 2007, 05:21:50 PM CET ) Permalink


20070108 Monday January 08, 2007

Wii is For Whiimps

You know what's really cool? Playing Tilt Scream Pong. With the Apple Sudden Motion Sensor. Yeeeaaah. (Thanks to Talley for pointing out the link)

. Posted by seapegasus ( Jan 08 2007, 02:30:16 PM CET ) Permalink


20060922 Friday September 22, 2006

Polygons! They Are Everywhere!

Woah. Recently, when I look at buildings and streets, all I see is vectors, polygons and vertices. I had taken the first week of September off and, among other things, had a closer look at some 3D (game) engines, and 3D mesh editors. Mesh-editors are those tools to create 3D objects that you use in the 3D engine later. The engine is the piece of software that renders the 3D objects live and - if it has a game physics component with gravity and collision detection included - lets you walk through the 3D scene.

I had tried to write my own 3D engine in Cocoa once, not because I thought it would be better (in fact my demos were quite inefficient), but just to understand how basic 3D rendering algorithms worked. Pretty interesting stuff though!

Well, my own "3D engine" never reached any degree of usefulness beyond a study project. That's the reason why I eventually started looking into existing 3D engines and mesh editors for MacOS:

Have fun playing with 3D stuff on your Mac. :-)

Posted by seapegasus ( Sep 22 2006, 05:42:32 PM CEST ) Permalink


20060723 Sunday July 23, 2006

I've Got No Mouse But I Must MacOS

My Mac's mouse died. Not the fancy green Apple mouse, a plain gray 3-button-mouse that I had bought in the old days when I installed some PPC Linux on a spare partition. (But then I messed up the boot-loader and I haven't seen it ever since. I wonder what became of this partition?) The mouse had already been displaying signs of unwillingness to discern between dragging and clicking for quite a while, so it did not come as a surprise when it stopped clicking for good. Still, I couldn't find the original mouse, and hadn't gotten a new one yet...

So I'm facing the question one night -- how do I use MacOS without a mouse until I get a new one?

I just wanted to check my email, so I hit shift-command-A in the Finder, the shortcut to the Applications directory, where I could select and open the Mail application with the arrow keys and by pressing command-o. (Why not use command-tab for selecting applications in the dock? Well, that only gives focus to applications that are already running.) Luckily, I was reading my main inbox before I quit Apple Mail last time, so the focus was on the right mail folder -- because I had no idea how to select another folder without a mouse...

If you now say "Dude, hit Alt five times and then ctrl-F1" -- you're so clever you're not even kidding! Yes, after a while, I actually remembered that crazy trick. It results in a gear-like sound that makes you expect a Myst linking book to appear in a hidden compartment. But instead it (ta-daa) activates MacOS's hidden Accessibility features. (If pressing those keys doesn't do anything for you, you need to permit its use in the System Preferences.)

Accessibility gives you some pretty cool keyboard shortcuts -- Who needs mice anyway! :-P Need a menu command? Hit ctrl-F2, and then the arrow keys and return to select. Wanna start an App from the Dock? Hit ctrl-F3. Need to switch focus to another window? ctrl-F4. Need to select GUI elements like buttons and textfields within a window? ctrl-F5 and then the spacebar to press a button (But only Apple programs seem to support that feature, e.g. Firefox doesn't).

But for the live of me, I can't figure out how to jump to the next pop-up menu in the preference panels, since the arrowkeys keep on selecting items from the first pop-up -- any ideas? In these cases (and to reach a mail folder or to move a file in the Finder), I still need to move the cursor and click -- I use the numeric keypad and I'm cruising along happily, completely mouseless. Groovy. Did you know MacOS could do that? :-)

Posted by seapegasus ( Jul 23 2006, 02:16:41 AM CEST ) Permalink


20060707 Friday July 07, 2006

New iPottery

The new iPods will either have a phone keypad, a scroll/touchpad, a biometric fingerprint pad, or a Nintendo game controller, or no controller at all (which of course suggests speech recognition capabilities above and beyond the current state of the art). In any case, they will definitely come with two bodacious zebra stripes! Woot! Or maybe not... Maybe Apple just quickly trademarked each and every design they could think of. Just in case... ;-p

Posted by seapegasus ( Jul 07 2006, 01:16:59 PM CEST ) Permalink


20060618 Sunday June 18, 2006

AppleScript, Zombies, and Uncanny Valleys

I liked HyperTalk, but never got anywhere with AppleScript... I like Pixar but can't warm up to Disney... Now this all makes sense! Ever heard of the Uncanny Valley? No, not the one in California. The Uncanny Valley effect is not strictly a scientific theory, still it explains at least one of the weird things in live pretty well. :-)

In case you didn't have a Mac in the early nineties: HyperCard was an all-in-one tool famous for its English-like programming language, HyperTalk. Even if HyperCard today lost its position to the technologies it had inspired (wiki, hypertext browsers), it was the best a programming beginner with a Mac could get those days. HyperCard was cool cause it gave you the opportunity to also program games instead of only playing them.

Today, MacOSX still comes with an offspring of HyperTalk that was extended to be a AppleEvent scripting language: AppleScript. The fact that AppleScript syntax still resembles the English language seemed the perfect solution for users who didn't want to dig into the details of UNIX shell scripting! Unfortunately, AppleScript turned out to be the opposite of Perl: Easy to read, but hard to write.

tell application "Finder" to set my_list to every item of folder "Documents" of home whose name starts with "A"

Possibly, the concept did not scale to work as a systemwide scripting language: Despite the language being modelled on the English language, the vast majority of users never managed to quickly write a semantically correct AppleScript from scratch... I'm pretty sure that AppleScript even was the major reason for many MacOS X users to learn shell scripting. It definitely was for me. =-) Of course, the bash scripts' front- and backslashes coupled with three different kinds of quotation marks are by no means more readable, but the success rates for getting the script to run in the first place are much higher in bash.

I remembered my short dabbling in AppleScript when I read the Uncanny Valley of AppleScript. Interesting theory: Switching your mindset to communicating in "natural language" changes your expectations toward the conversational partner. And when the partner is only a program, it will certainly not fulfil the expectations. Eventually, the discrepancy between the implicit promise of a natural conversation and the program's stupidity can be very infuriating.

What is this 'Uncanny Valley'? When Masahiro Mori plotted people's acceptance of anthropomorphic robots in a chart, he started out with a box on wheels, and worked his way up to C3PO-like robots. As expected, the subjects' acceptance towards the robot character increased. He was however surprised to find that acceptance flipped over to repulsion at a high point of anthropomorphism: Very life-like robots and CGI animated characters were suddenly considered nothing but horribly wrong zombie-puppets. 8-| That may be just perfect for Terminator and I Robot, but I think at least Tom Hanks had different plans in mind for his main role(s) in Polar Express. (Already horror enough to everone who doesn't like Tom Hanks...) ;-)

Some things start slowly making sense: One of the most well-done animation movies, Final Fantasy was quite a dissapointment at the box-offices. Instead, the crowds flocked to Bugs, Nemo, Monsters and The Incredibles, whose characters do act human, but clearly look like cartoon characters. (As an aside: The most loveable Pixar character of all times is Luxo, the desklamp. No face, no eyes, no feet, nothing. A desklamp!) On the other hand, people loved the very human Cyberpunk character Max Headroom. Wanna know why? He wasn't computer-generated at all, but played by Matt Frewer and then post-edited to look like CGI.

The German wikipedia entry mentions two more examples of potential acute Uncanny Valley syndrome: At the CeBIT convention, visitors totally loved the adorable vacuum cleaner bots. These bots were appearantly driven by very human feelings like hunger and got excited everytime a mean visitor blocked their way to an electrical outlet when they wanted to recharge. On the other hand, adults at the same convention shunned the much more carefully designed humanoid robots, and some children where seen running away crying when the androids approached.

Possibly, there are too many small details we are aware of in Real Healthy Living Humans™. Not only in the Final Fantasy movie but also in the great Diablo II cutscenes, I often found myself pondering strange things like the speed of gestures...? inertia of body parts...? visibility of sinews and muscles...? Are those characters dead, hollow, or suffering from an overdose of Botox...? etc. I get the impression that maybe even speech technology applications suffer from a problem very similar to the Uncanny Valley: Users feel mocked by a speech recognition service that e.g. understands perfectly well that you want to order a train ticket for next Sunday evening, but then politely insists on Novosibirsk instead of Nuremberg. Well, good news is, we can look forward to lots and lots more of speech recognition applications, antropomorphic robots, and live-like animations in the near future — so if there is anything to that Uncanny Valley theory, we will have the proof soon enough...

PS: Another example, this innovative leight-weight Android named Lara from Germany was build not to fall into the Uncanny Valley trap. (Click "Bilderstrecke" to see more detailed photographs.) Interesting, let's see how they will fare.

Posted by seapegasus ( Jun 18 2006, 07:38:03 PM CEST ) Permalink


20060410 Monday April 10, 2006

Hot Chocolate, anyone?

Ondřej Čada wrote a series of articles that teach you the basics of programming in Apple Cocoa (Objective C) in Czech: Nastal čas na kakao. (He wrote some more stuff about NextStep, MultiMedia and WebObjects, too.) Looks like a good chance to catch two birds with one stone: Improve my knowledge of Cocoa and my Czech reading skills. And a third bird comes to mind: Why not take the print-outs to Cafe Louvre (around the corner from Tesco near Narodni Trida) and read about Cocoa while drinking hot chocolate... :-)

Posted by seapegasus ( Apr 10 2006, 10:33:35 AM CEST ) Permalink


20060219 Sunday February 19, 2006

Exporting Bookmarks from Safari 1.0

Safari 1.0?? Yep, this is a low-end Mac tip for those of you who are still using an old iMac that was delivered with MacOS 8.6 and that (for some weird reason) let itself be updated up to MacOS 10.2.8 over time. (Forward compatibility will be the death of Apple once -- why should we buy new machines if the old ones run nicely for 7 years?)

Anyway, Safari 1.0 doesn't cut it anymore in 10.2.8 after a while. You can't update it to Safari 2.0 unless you upgrade to MacOS 10.3, though. Which I won't do, because honestly, 10.2.8 is the highest you ever want to go with a G3/333Mhz/288MB RAM machine that was built in a time where you could send a whole Mac usergroup laughing themselves to bits with just considering the idea that MacOS might be based on UNIX once, or -- even more hilarious-- run on Intel chips!

So I had installed Firefox 1.0 and wanted to export my bookmarks from Safari 1.0, or, have Firefox import them for me — an option which alas it didn't support. So, if any of you low-end Mac users are in the same situation, here's the solution: Install Camino >1.0 or Firefox >1.5. For, even if Firefox 1.5 may be a bit slow on a low-end Mac for everyday use, or, even if you are missing your favorite extensions in Camino, you can at least use those browsers now to convert old Safari 1.0 bookmarks from .plist format to more general-purpose HTML, and even export them back to .plist!

Posted by seapegasus ( Feb 19 2006, 12:01:04 PM CET ) Permalink


20060216 Thursday February 16, 2006

MacOS Wanna Have Virus Too

Gosh, dudes, this is exciting: Open iChat and see whether you caught one! Sophos reports in "First ever virus for Mac OS X discovered" that the "OSX LEAP-A worm spreads via iChat instant messaging software."

And? *Sigh* Nope. Nothing in my iChat. I was so looking forward to downloading the worm, double-clicking it, then entering my sudo-password... What? Yes, it seems MacOS is less user-friendly than most people think. ;-)

If you don't know yet how the LEAP worm works, I recommened this extremely enlightening daringfireball article about how you get from smart crash Reports to InputManager hacks -- InputManagers are loaded automatically from the Libraries folder to add new functions to running apps as soon as the user starts them...

Are you thinking what I'm thinking? 8-|

Interestingly, the first (and only!) report of this virus said it came in a tgz-file -- a zipped tar archive that can be set to archive files while keeping the original permissions. Such as... an 'executable' permission on a file with a custom icon that happens to end in .jpg for example...

Preliminary fix?

Phew. We did it. For now... :( See you again at the next worm!

Posted by seapegasus ( Feb 16 2006, 11:29:26 PM CET ) Permalink Comments [2]


20060117 Tuesday January 17, 2006

Remind me to never convert C to Cocoa ever again

I meant the first longer post in the Mac section to be different, but here goes: Aaarrggghh!

Once in my life I go out of my way to learn and implement a real algorithm from scratch -- and then the book's incomplete. I'll tell you another time what kind of demo I'm trying to write (a game), but now it suffices to say I am using Cocoa and it required a very basic scanline algorithm.

Well, I just copied an old version of scanline from the afore-mentioned "Programming 3D games in Macintosh C" book, and changed a couple of lines to make it run in Cocoa. No big deal, it all scales very well to Objective C. The book's author even cleverly relies on a variable xUnit when stepping through the image buffer when coloring pixels. Dispite this clever move, his implementation still only works with 8bit graphics. :-(

In short -- 8-bit-color means the buffer uses 8 bit = 1 byte to store the color information of 1 pixel, boiling down to 2^8=256 individual colors per pixel. Alternatively, you could also use 24-bit-RGB-color, spoiling you with 16777216 different colors. (Using multiples of 8bit is preferable, since bytes usually can be more quickly accessed.) But in the 24-bit case, you have to make sure to make 3-byte steps in the buffer, otherwise everything you draw will slim down to one third its width and suddenly has a very very ugly coloring scheme... Trust me, I saw it.

Basicly, what happened was, that I relied on the authors's claim to be using xUnit consistently throughout his implementation. He, however, designed it with 8-bit in mind, where xUnit always equals 1. So when I tried to adapt the implementation to 24-bit by (roughly) simply setting xUnit=3, my pretty "6-color rotating cube demo" suddenly looked like a happily dancing multi-color architect's dream drawn by a two-year-old in the dark with mittens on. :-C

I spent half the month (well, the Sundays only...) systematically hunting down silly individual pixels in search for an explanation; only to discover that the original 8-bit implementation
a) in one case suddenly used ++ incrementors instead of +xUnit, and
b) in a second case didn't multiply by xUnit, (because xUnit=1 in his case)...
c) And then I noticed, that he had been using bytes per row instead of pixels per row all along...
Grrrmph. Well, it's obvious now, in 8-bit-mode, bytes and pixels per row are the same thing (1). But in 24bit, there are three times as many bytes as pixel, resulting in interesting patterns if mixed up. *SIGH*

Anyway, at least I can claim now in my CV that I'm a specialist in diagnosing typos in scanline-polygonfill by magically looking at crazy lines in an NSWindow... :-)

Posted by seapegasus ( Jan 17 2006, 11:41:58 PM CET ) Permalink


20051130 Wednesday November 30, 2005

Profiling Java Apps on Mac OS X

On the 15th of November, Apple released Java 2 SE 5.0 Release 3 (also known as J2SE 1.5.0_05). This was the biggest of the preliminaries mentioned in the FAQ for the release of a Profiler that would run on Mac OS X.

So today we asked the Profiler team (approximately), oh just by the way, how are things and stuff, and what's the estimate on this, you know, Mac support issue...? And we, like, immediately get an email back where they tell us (approximately), oh, yeah, right, the Mac support, well, you know, we needed to wait for Apple's JSE and all, and then we needed to port all thoses binaries and all, so, the next milestone will be released, at the earliest, let's see, ... tomorrow.

Wow. Now that what quick.

Okay, the NetBeans Profiler milestone 11 covers only so-called experimental Mac OS support, and of course it solely runs in the very latest J2SE 1.5.0_05, but I think that's quite okay for porting it in only half a day's time. ;-)

It will be available from December 1st 2005 from the Profiler Homepage. And until then, why not read this nice article about java performance tuning?

Update: What's new in NetBeans Profiler Milestone 11

Posted by seapegasus ( Nov 30 2005, 06:30:22 PM CET ) Permalink Comments [1]


Calendar

Content

Search

Links

RSS Feeds

Recent...