Archive for Tips and Tricks

Drag your Drawers with Afloat

Drag your Drawers with AfloatAfloat is a Cocoa plug-in that allows your windows to float above all others (thus the name), make them transparent, and move them without having to go search for the title bar. This last feature is what I use the most. And I was quite amazed when I realized that I can detach and move the drawers of Cocoa windows as well. Watch the screencast for an illustration. That’s quite a useful thing since I can place them now like regular tool palettes.

When checking out Afloat, make sure you fully utilize its key/mouse bindings. While pressing Cmd-Ctrl use the mouse wheel to increase/decrease transparency, or move the mouse to drag the window.

Comments (2)

Producing Screencastings on the Mac. The cheap Way.

After having read the great article “A Review of Video Screen Capture Software for Mac OS X”, I have finally selected iShowU as my tool of choice for recording my screencastings under Mac OS X. (I tried Snapz Pro X, but it’s not a Universal binary…)

iShowU is a nice tool with a focus strictly on recording. But what about enhancing the movie? Well, of course there are add-ons like OmniDazzle, Mouseposé and others that you can use during recording. These effects really show off. But I mean something for a quick post-editing, like voice-over and text boxes or bubbles.

Enhancing Screencasting It turned out that all tools I was longing for were already installed on my Mac, but I just haven’t been aware. First of all, GarageBand is great for adding voice-over, sound effects and background music. Put each of them into a separate track, adjust volumes, add effects (I like my voice a little deeper…). A perfect, very capable tool, easy too use. 100% Mac-like. And then Quicktime, well, the Pro edition. It has some features that make it a perfect match: text tracks and image tracks with a multitude of options, like transparency, effects and positions. The multi-track editor of Quicktime Pro is not so intuitive, but quite capable. It supports export to mp4, which produces perfect and small movies. For more fancy formats, like Flash (FLV), ffmpegX is the free tool of choice. See the posting “Flash Movie Conversion for Mac OS X” and “How to encode FLV” for an elaborate discussion.

I’ve uploaded my first Screencast to Youtube.com. It shows Quicktime Pro and how to enhance a screencast by adding text tracks and nice speech bubbles (really image tracks with a bubble exported from OmniGraffle; again, shipped with your Mac).

Quicktime Alternatives?

The alternatives to Quicktime Pro would be iMovie HD and Final Cut. Well, iMovie HD is targeted for editing DV material; one show stopper for me was the lack of support for custom dimensions, like 200 x 100. This is also true for Final Cut Express. The next issue with iMovie HD was the inferior export quality. As a result, this leaves only Final Cut Pro as a valid alternative, but it’s way too expensive for me.

Optimal Settings for Exporting Quicktime to Youtube.com

Quicktime Export to YoutubeWhen publishing videos from Quicktime (i.e. .mov files) to Youtube.com, I had to tune the export settings. I’ve taken screenshots of the optimal settings (Photo set on Flickr.com). Without these, my uploaded videos always had some nasty artefacts caused by Youtube’s automatic conversion. (BTW, Youtube can digest a lot of video formats; it always converts them to mp4, NTSC/4, 320×240, 15fps with audio as MP3 at 22050 kHz. The video format is FLV.) But why export at all, and not just upload the .mov file? My .mov files had seperate tracks, which is fine usually, but Youtube only recognizes some of them; specifically it drops text and image tracks, and also video/sound tracks that are positioned at a specific starting time. I can collapse all tracks to just one audio and one video track by exporting to, for example, MP4.

Comments (1)

Random Macbook Shutdowns. Solved. At Last. Hopefully.

Some friends of mine have this nasty issue with their Macbook; it’s shutting down spontanously. Apple’s support forum is full of postings from users seeking solutions, and a web site is just dedicated to this problem. Now, a German news site has posted an article about an IT engineer from Munich, Germany (my hometown! Prost!). It is stated that he has located the problem which is a result of pure physics. The phenomenon seems to be caused by the cable between the heat sensor and the CPU’s heat sink being too short.

Macbook Shutdown VideoThe heat sink expands during operation and gets into contact with the sensor cable and melts the cable’s isolation. This in turn causes a short circuit and, thus, the immediate shutdown of the Macbook. As the heat sink is cooling down, the heat sink contracts to the point that it looses its contact with the cable and breaks up the short circuit. You can now boot again. Just until the processor heats up and the heat sink and the cable have contact again…

If this proves to be the reason then there might be a quick fix, specifically you would not have to exchange your mainboard or RAM.

Update: Besides being picked up by digg.com (again), the news is published by the major German Heise Newsticker (incl. 400+ comments).

Update 2: Apple officially acknowledges Macbook Random Shutdowns. See my blog article.

Comments (120)

Incredible 2D Images using NodeBox (Intel Binary!)

Recently, I’ve been busy exploring 2d graphics algorithms for generating great looking logos, wallpapers, and backgrounds. The article “Blog Redesign” drew my attention to a great tool on Mac OS X. NodeBox is an open-source application for programming 2-dimensional graphics and animation in the Python language. NodeBox lets the user focus on coding graphics without worrying about the underlying technology.

NodeBox ScreenshotIt is based on another open-source project, DrawBot, and is inspired by technologies like OpenGL and PostScript. This means NodeBox is based on vector graphics rather than pixels. As such it’s an excellent tool for generating 2D graphics intended for print, and in particular typographic experiments. NodeBox can generate PDF documents that can easily be used in Adobe Illustrator or any professional vector graphics package. NodeBox can also generate QuickTime movies for animations.

If you’re curious, the NodeBox Gallery shows off some good-looking sketches. Tom de Smedt, one of NodeBox’s authors, has published two good examples: Supercurly uses the modular font Superveloz by Andreu Balius to construct organic compositions, while Photobjects is a database of images which can be queried for images connected to certain keywords. These are then used to create randomized collages of images.
Prism is an algorithm for creating a color palette on any subject. It uses the internet as a semantic database.

NodeBox is available in version 1.0 release candidate 7, and is sophisticated enough to count as a real production tool. However, NodeBox is compiled only as a PowerPC binary for Mac OS X. As a proud owner of a new Intel-based Macbook, I’ve been looking for a way to compile the source (included in the download) as a binary for Intel-based Macs.

So read on for the required steps to compile and build it yourself, or just download my build, NodeBox 1.0rc7 Intel Binary for Mac OS 10.4.

Read the rest of this entry »

Comments (6)

Scientific Plotting on Mac OS X (Intel) using Gnuplot and Plot

Gnuplot under AquaTermAfter having successfully moved my LaTeX publishing environment to the new Macbook, all that was left was a working Intel build of gnuplot 4.1.0 (which has some nice new features over 4.0). This was actually not quite easy, so I’m going to document my steps for producing a Universal Binary of Gnuplot 4.1 here for future reference.

You might also take a look at Plot. It’s a first-rate freeware plotting tool with some really great features (think ProFit or GRACE), AppleScript support, and a full-blown layout engine. All this is nicely integrated in a great looking Mac OS X GUI. I really love it.

Read the rest of this entry »

Comments (36)

How to Remove a PDF Signature (that disallows any document changes)

PDF documents may be secured by an initial signature/certificate for disallowing any changes. This is not to be confused with “password security” or “certificate security”.

I am speaking of the kind of restrictions you will get with “Menu>File>Save as Certified Document” and then selecting “Disallow any changes to the document” (which also implies “Lock the certifying signature so that it can’t be cleared or deleted by anyone”).

This action produces a document which you cannot modify (e.g. add bookmarks or comments), and you also cannot remove the restricting signature. No PDF password remover will help you here, since there is no password!

But I found out that you can do – quite simply – disable the restrictions and render the signature removable, i.e. after these changes, you can manually delete it with Adobe Acrobat Professional:

With the Perl scripting language, this hack is applied with the following script

# Usage: perl invalidate-signing-certs.pl <in.pdf >out.pdf
binmode(STDIN);
binmode(STDOUT);
$/ = "\0";
while(<>) {
  s#(/Perms<</DocMDP.*?>>)#' ' x length $1#ge;
  s#(/Ff 1)(?=.*?/Lock )#' ' x length $1#ge;
  s#(?<=/Lock)(.*?)(/Ff 1)#"$1" . ' ' x length $2#ge;
  s#(/Lock .*?)(?=/)#' ' x length $1#ge;
  print $_;
}

The next time you open the modified document with Acrobat you will still see the signature field. Just click on it with your right mouse button and from the menu popup select “Clear Signature Field”, then “Delete Signature Field”. Now safe it and everything is fine – no more restrictions. (Tip: Use “Save as” to clean up the document of any hidden signature objects.)

Note: Always make a backup of your PDF document before modifying it, since sometimes the hacks just don’t work and you end up with a document that Acrobat cannot repair.

Update August 2006: The procedure of unsigning is now available as a video (AVI, 2,4 mb). Or watch it at Youtube.com. It shows how to unsign a ebook (in PDF 1.6 format) with the batch script using Acrobat 7.0.

Update October 2006: I’ve updated the example code. The earlier version had problems due to platform-dependent handling of line endings. The current script version operates in binary mode and is tested under Window (ActiveState and Cygwin) and Mac OS X.

Download

The archive pdf-scripts.zip contains the script shown above, and some other useful scipts:

  • invalidate-signing-certs.pl: Invalidates all Signing Certificates, thus removing any restrictions imposed by them.
  • bookmarks-fitpage.pl: Change Bookmark display style to “Fit Page”.
  • bookmarks-close.pl: Close opened Bookmark Folders.
  • bookmarks-close-1.5.pl: Close opened Bookmark Folders (for documents in PDF version 1.0-1.5, i.e. Acrobat up to 6.x)

Comments (108)

Setting up Networking for PearPC 0.3.1/MaxOS X (10.3) on Windows

This procedure seems easy, but I did encounter some problems with networking. In the following, I will summarize the procedure for setting up networking under Windows XP (SP1).

First of all, here are some useful links you might visit for troubleshooting:

OK, now on to the steps for getting networking working:

Read the rest of this entry »

Comments (9)

Don’t forget DOCTYPE in your Blogger Templates

It took me 4 hours to figure out why there was a difference in rendered layout between Mozilla/Firefox and Internet Explorer. I chose a template for my blog from the gallery (and did some minor changes, nothing special). Then I tested it and the width of the left part (where the blog items are displayed) was always a lot smaller in IE than in Mozilla. I changed the CSS definitions (“width” property) for the div tag, but again no success.

Next, I viewed the sample of my template from the gallery. Voila, the rendered layout in IE and Mozilla was the same. Why on earth did mine break?

After some minutes of copy and paste I found the problem: the template had no DOCTYPE statement, e.g.

I didn’t know that this statement makes such a big difference in IE!

Leave a Comment

PDF Bookmark Hacks

Update note: Here’s a more recent blog posting on PDF hacks. All scripts, including the ones mentioned above, are contained in the ZIP archive with perl scripts

I found out that you can do – quite simply – two very useful hacks on PDF documents with bookmarks:

Apply “Inherit Zoom” to all Bookmarks

I like to see, by default, the whole page, and set this accordingly in my Acrobat preferences. Some bookmark links, when clicked, modify the current zoom settings, e.g. put you in 100% or worse, in 200%. To modify this annoyance you can directly modify the PDF document in your Text editor.

With UltraEdit, for example, I load the PDF document and open the “Search and Replace” box, enable “Regular Expressions” and replace all occurrences of “R/XYZ*]” with “R/XYZ]”, and then also all occurrences of “R/Fit*]” with “R/XYZ]”. Now safe the document.

With the Perl scripting language, this hack is applied with

perl -pe 's#R/(XYZ.*?|Fit.*?)\]#R/XYZ\]#g#' in.pdf >out.pdf

The next time you open the modified document with Acrobat you will get a message that the document is being repaired. Just safe it again with Acrobat and everything is fine.

Close all Bookmark Folders (recursively, nested)

Unfortunately, PDF documents with a huge folder hierarchy of bookmarks have all folders opened. This creates a large list and I cannot find anything at glance. How can I close all folders, also the nested ones? To modify this annoyance you can directly modify the PDF document in your Text editor.

With Search and Replace, for example, I specify the PDF document, enable “Regular Expressions” and replace all occurrences of “\/Count +[0-9]\/Parent” with “/Count -%1/Parent”.

With Perl, this hack is applied with

perl -pe 's#/Count ([0-9]+)/Parent#/Count -$1/Parent#g#' in.pdf >out.pdf

The next time you open the modified document with Acrobat you will get a message that the document is being repaired. Just safe it again with Acrobat and everything is fine.

Note: Always make a backup of your PDF document before modifying it, since sometimes the hacks just don’t work and you end up with a document that Acrobat cannot repair.

Comments (7)