BrT

Musings about technology and other neat stuff

BrT random header image



How to trick an RHEL5 client install to use server RPMs

October 22nd, 2008 · No Comments   

For one of my projects at work, I am using a test install of RHEL5 in “workstation” mode, but I needed to install some packages that are only available in the “server” package list. To temporarily make yum search the server repositories, just change the following line in /etc/sysconfig/rhn/up2date:

versionOverride=5Server

(normally the value is empty).

Posted by email from zzamboni’s posterous

→ No CommentsTags: · · ·




WILTAC #3: NSZombieEnabled

October 17th, 2008 · 2 Comments   

I learned today about the NSZombieEnabled environment variable (this is its correct name, and not NSZombiesEnabled as stated in Hillegass’ book). If you set it to YES, whenever you try to send a message to a deallocated object you will get a message like this in the console:

message sent to deallocated instance 0xe02b790

And the debugger is automatically started. This can be very useful for debugging memory management problems. Instead of a crash, you get an informative error message.

→ 2 CommentsTags: · ·

Apple – MacBook design video – Very interesting video about the design and manufacture of the new MacBooks. The scenes showing the making of the unibody enclosure are awesome. (tags: mac video hardware )
(0)




Easy video conversion in Mac OS X

October 10th, 2008 · No Comments   

After a lot of searching (and trying iMovie) for how to convert an AVI video file to flash (.flv) format, I found ffmpegX, a nice tool that does all the hard work, invoking other tools in the backend as needed.

Posted by email from zzamboni’s posterous

→ No CommentsTags: · · ·

WILTAC #2: Designated initializers

October 10th, 2008 · No Comments   

I learned today the term designated initializer:

When a class has multiple initializers, the designated initializer is the one that actually does the work, normally the one with the most parameters. All other initializers call the designated one, providing different amounts of default parameter values.

I was aware of the concept – many classes have initializers with varying numbers of parameters, with the “simplest” ones setting things to default values, and the more complex ones allowing greater control. I didn’t know the term.

I found two other uses for the term designated initializer:

  • In the C99 language specification, you can selectively initialize elements in an aggregate data structure, this construct is called a designated initializer.
  • It’s the title of a song performed at WWDC 08 by James Dempsey and the Breakpoints (of course, related to the Objective-C definition).

→ No CommentsTags: · · · ·

WILTAC #1: invoking methods on nil in Objective-C

October 7th, 2008 · No Comments   

Welcome to the first installment of “What I learned today about Cocoa” (WILTAC).

I have recently started reading Aaron Hillegass’ excellent Cocoa Programming for Mac OS X, third edition, with the intention of brushing up my very lacking Cocoa skills (all of them learned empirically by looking at other people’s code and reading the documentation). To motivate myself to actually make progress, I have decided to write every day (if possible) a short post describing something interesting I learned. Seasoned Cocoa developers might want to skip this, I’m doing it mostly for my own benefit. So without further ado, here’s the thing I learned today:

In Objective-C, you can invoke methods on nil objects, without causing an error

Not a Cocoa-specific tip, but very interesting nonetheless. And a possible source of hard-to-track errors, if you are not careful and try to call methods on nil objects assuming they are not nil.

One interesting bit is that if the receiving object is of type “id”, it seemingly will accept any method, as long as it is defined for some class. If the method is not defined anywhere, you do get a “warning: no -foobaz method”. If the variable is defined as some specific class, it will accept all the methods for that class, and give appropriate warning for methods from other classes or nonexistent methods.

→ No CommentsTags: · · · ·

Synchronizing 1Password data between two local accounts (howto)

September 29th, 2008 · No Comments   

I am a big fan of the incredibly useful 1Password. The latest beta release (2.8.3.BETA-11) introduces a new keychain format that, among other things, allows 1Password to detect changes made to the file by other programs and reload the changes on the fly. I am using this now to keep my 1P data synchronized between my work and personal accounts on my machine. Here’s what I did:

  1. In my work account (dza), switch to the AgileKeyChain format by following the instructions.
  2. Modify the ACL for my ~/Library/Application Support/1Password/ folder to allow my personal account (zamboni) read/write access. I did this using the “Sharing & Permissions” section of the Info dialog for the folder, and then choosing “Apply to enclosed items” from the cogwheel menu in that same section.
  3. Switch to my personal account.
  4. Quit 1Password, run the defaults command from the instructions, restart 1Password.
  5. Export my existing 1Password data in the “1Password Interchange file” format. To do this, choose File -> Export all -> 1Password Interchange File, and save it to a file in my desktop.
  6. Double click /Users/dza/Library/Application Support/1Password/1Password.agilekeychain and click “yes” to start using that file.
  7. Import the data from step 5: File -> Import, and follow the prompts. Wait for the data to import.
  8. Switch back to my work account and verify that the imported items are seen there as well.
This is incredibly useful. I had been trying to use the my1Password service to achieve this, but the service is still not very mature and I had been unsuccessful. With this, I can access my data from both accounts without having to send the data through the network or use any third-party services, which is great.

Posted by email from zzamboni’s posterous

→ No CommentsTags: · · · ·

Fixing character encoding problems with iWeb pages – In trying iWeb, I noticed that accented characters were displayed incorrectly. It seems the problem is that my web server (over which I have no control) is setting the encoding to Latin1, whereas iWeb pages are encoded in UTF-8. The fix is simple: in .htaccess, specify the correct encoding (tags: howto iweb utf-8 macosx )
(0)