Wednesday, October 13, 2010

Slackware 13.1 and VMWare Fusion 3

I had been having some problems with Parallels and VirtualBox running Slackware virtual machines, so I decided to give VMWare Fusion a try. *

VMWare Fusion works with Slackware pretty well, but it makes a couple assumptions about Linux distros that are not true of Slackware:

1. You are using PAM (Pluggable Authentication modules)

2. You are using RedHat-style init scripts (/etc/rc.d scripts that start programs when your computer boots).

The following steps got me around all the issues I encountered installing the tools:

1. The install scripts expect /etc/pam.d/ to be present. It's not since Slackware doesn't use pam. Just run the "mkdir /etc/pam.d" as root before installing the VMWare tools. The installer won't run unless it can put a VMWare piece into that directory.

2. Set up the init script structure as VMWare tools expects it. This step may not be required **

cd /etc/rc.d
for V in {0,1,2,3,4,5,6}; do ln -s /etc/rc.d /etc/rc.d/rc${V}.d; done
cp /etc/rc.d/rc.inet1 /etc/init.d/network
cp /etc/rc.d/rc.inet1 /etc/init.d/networking

3. Install the tools as normal. When you run, it may give you a weird message about X11 not finding some drivers and appear to hang. If this happens, run "killall mkinitrd" as root. This kills off whatever process is stuck there and will let the install finish.

* Parallels issue: Parallels tools don't support Ubuntu 10.10 yet, the kernel modules won't build. I haven't had much luck with them at all in Slackware. They assume you are on an RPM or Debian based system. Virtual Box randomly shuts down my Slackware VM. Yes, I'm going to file a bug report. Decided to try out VMWare Fusion because it is currently only $9.99 for existing Parallels Desktop users until sometime in December 2010. Check out the full details on their VMWare Fusion promo site.

Tuesday, August 17, 2010

Universal iOS apps

I'm still developing my first iPhone app (iOS app as of version 4.0 of the OS) and have been coming to the conclusion that XCode makes many, many things easy to do, but it isn't always easy to do these things right.

Example: universal apps - having one app that runs on both iPhone/iPod Touch and the iPad. When you create an application, you have the choice of making it Universal. Basically the .xib files (XML version of the .nib files) that define your user interface will have an iPad version and an iPod/iPhone version and the application will load the correct one at launch time.

The downside: if you want ANYTHING to be different besides the user interface between the iPhone/iPod and iPad, you must write special code to handle those cases.

Friday, April 16, 2010

Thanks a heap, Apple

I've been going through some tutorials for developing on the iPhone (and now iPad) and found this cool utility digging around the developer docs:

There's this cool little utility called "heap" in OS/X. If you find the pid (process id) of a running process and just run "heap PID" on the process, it will dump out how memory is allocated in the heap for that process.

The only two limitations are: you need to have access to that process, so you either have to do it on a process running as the user you are currently logged in or be running as root. Also, I think it has to be a native Objective C, C++, or maybe C binary.

It attempts to figure out what type of object each thing allocated in memory is, and breaks it up class. Included stats are total count, total size, average size, and if it can figure out what library the variables are coming from, it includes that too.