Sunday, 10th January 2010

I really like the colours of the syntax highlighting in Apple’s XCode, I apply the colouring to all of the other code editing applications I use, these being Netbeans and BBEdit.

XCode Colours (RGB)
Selection 173, 206, 253
Comments 0, 116, 0
Documentation Comments 0, 116, 0
Documentation Comments Keywords 0, 116, 0
Strings 196, 26, 22
Characters 28, 0, 207
Numbers 28, 0, 207
Keywords 170, 13, 145
Pre-Processor Statements 100, 56, 32
URLs 14, 14, 225
Attributes 131, 108, 40
Project Class Names 63, 110, 116
Project Functions and Method Names 38, 71, 75

Wednesday, 17th December 2008

On Mac OS X 10.5 the default compiler is GCC 4.0.1, Apple does provide GCC 4.2.1 as part of the XCode Developer Tools releases for 10.5 but it isn’t setup as the default.

The main tools are located in /usr/bin. In this folder you will find both gcc 4.0 and 4.2 along with g++ 4.0 and 4.2. The commands gcc, g++, cc, and gcov are all symbolic links to the default 4.0 versions. To make 4.2 the default we just need to modify the symbolic links.

To do this we need to go in to the Terminal and issue the following commands:

cd /usr/bin
sudo ln -Fs c++-4.2 c++
sudo ln -Fs gcc-4.2 cc
sudo ln -Fs g++-4.2 g++
sudo ln -Fs gcc-4.2 gcc
sudo ln -Fs gcov-4.2 gcov

Now you should have a complete working gcc 4.2.1 tool chain. If there is a problem you can verify the symbolic links are pointing at the correct targets by typing ls -l Hope this helps someone else.

Saturday, 13th December 2008

I’ve been having some rather odd Safari problems today for the first time since I can remember. I really dig Safari, it’s everything I want in a browser and getting better with each release. I’ve been using Safari since the public beta back in January 2003 back when Mac OS X 10.2 was the main OS.

Anyway this afternoon I noticed that Safari kept using 100% CPU and becoming un responsive. I kept force quitting it but the problem kept coming back after about 10 mins. I tried the usual repair permissions, delete preferences and caches etc to no avail. I then thought I would try the Safari 4 Developer Preview, I downloaded it and installed it. It was perfectly stable and very fast, can’t wait for the finial release of that badboy! At this point I was still stumped as to why 3.2.1 was holding the CPU hostage but Safari 4 was fine. I uninstalled Safari 4 and reinstalled 3.2.1.. On restarting everything seemed fine but yet again it took all the CPU, back where I started. Just launching Safari and then closing the window and waiting would cause the CPU to be held hostage again.

I ran a filesystem trace to see what files Safari was touching, I basically sat and waited until the high CPU condition happened then took a look to see what files were accessed. After an hour of watching and timing the problem it seemed that Safari was continuously reading from the filesystem which is what was causing the massive CPU load. It was triggered by an unusual cache file hit, I did a check to see what network connections were established and saw some odd looking google server addresses, it then dawned on me that Safari 3.2 features anti-phishing protection that uses a blacklist provided by google.

This also explained why the the Safari 4 Developer Preview worked correctly as it doesn’t yet have the anti-phishing stuff. I turned off the anti-phishing stuff in Safari 3.2.1 and sure enough everything went back to normal. Me being me I was still bothered because why would it suddenly cause problems, it’s been working fine until today. I went back and took a look at the cache files it was using for the blacklists, I thought that corruption of some kind was most likely so I deleted them. I then re-enabled the anti-phishing mode in Safari 3.2.1, now been three hours and all is well again.

To kill the blacklist cache (which is rebuilt afterwards) first quit Safari then open the Terminal and type the following:

sudo rm -r /private/var/folders/*

Relaunch Safari and all should be well. I couldn’t find any references to this problem online so I though I would post something.

Thursday, 9th October 2008

I thought I would check my old email account and got a nice total of 4124 messages! Every single one was junk. Apple Mail’s Junk mail filter caught 4122 of them so thats an accuracy of 99.95% very impressive! I thought I would dig a little deeper and ran a virus check on the emails, 37 were infected with various trojans, viruses, and general nasty spyware. Pretty interesting, I haven’t actively been using that account since about 2003 / early 2004, since then I haven’t sent anything from the account and have been looking now and then at what comes in, and from who. I think it’s time to forget that mailbox.

Wednesday, 16th April 2008

I decided to have a go at building FLAC from source today which was very simple. I built two versions of FLAC, one was a normal Mac OS X Universal Binary with both the PowerPC and Intel binaries, the other was a pure PowerPC binary optimized for the G4 (the PPC7450 line).

I then decided to test the performance of them, I wasn’t very scientific I just used the stopwatch on my iPod to time the encode of a song. I encoded the same song using the –best option three times with each just to make sure that no caching was happening and the result was as accurate as I could get it. The outcome was pretty interesting.

PPC/x86 Universal Binary
28 Seconds

PowerPC G4 Optimzed
10 Seconds

Thats quite a difference!

I then found something pretty odd, if I encoded the track with the G4 version and tried to decode it using the Universal version I would get the error “ERROR, MD5 signature mismatch” and vice versa when encoding the other way round, very odd. I tried decoding both encodes with a third party app and that decoded both fine. I’ll encode a song and see if someone else has a problem decoding it.

If anyone wants a copy of my binaries let me know and I’ll package them up for you to play with.

Saturday, 22nd December 2007

Well it’s only taken me a few years to get to version 1.0. I started my Phasecam widget back before Mac OS X 10.4 Tiger came out, around January 2005 from what I remember. Last year around Christmas I released a brand new rebuilt version which I did using the beta version of Dashcode. Well this year as a small Christmas present for my fellow Mac OS X users here is 1.0, and in true christmas style as per last years post here is a shot from Pushkin Square in Russia.

Whats New:

  • Completely new Javascript.
  • Links checked and fixed, some removed and new ones added.
  • More Update options.
  • Updated looks and Phasenoise logos.
  • Smaller Download

Merry Christmas!

Grab it from the downloads section or click here

Thursday, 20th December 2007

About a week or so before my wedding my good old HD which was a Toshiba drive which came pre-installed in my PowerBook started to show the old age death signs, it wasn’t much of a surprise as I had noticed quite a few bad blocks showing up on the disc and a general increase in noise from the drive. I can’t recall the model of the drive but it was a nice 80-Gig drive running at 5400 rpm and with a massive 16 megabyte cache, overall I was very happy with this drive, I use my machine for roughly 8 to 12 hours a day and over a period of 3 years the drive has never caused any problems. Even with the drive making odd gestures it still wasn’t really missing a beat, but like many things it’s best to take note of the signs and do something about it before the end.

I needed a replacement drive and looked in to the 100 gig version of the drive only to find out that it had been discontinued. I did some looking and my only real options seemed to be drives from Hitachi and Seagate, the Seagate drives were described as being much quieter so I went for the Seagate Momentus 7200.1 drive. As the model name indicates this is a 7200 rpm drive and I have noticed the speed boost.

Overall I was quite happy with the new drive apart from a loud ticking noise, I did some digging around and found out that this noise is related to the APM (Acoustic Power Management) built in to the drive, this tick that APM causes happens roughly every 20 to 30 seconds, this doesn’t sound too bad at first until you dig a little deeper, every tick and the Hard drives Load_Cycle_Count is incremented by 1, so roughly 69 Cycles an hour. The drives life span is rated at 600,000 cycles. At my current usage rate this drive isn’t gonna live too long.

Please note that this isn’t an isolated case either, this is known to Seagate and it’s not just Seagate that seam to have the problem, Toshiba drives fitted to MacBooks like Louisa’s also have high Load_Cycle_Counts Hitachi are also suffering with these problems. The cause of the problem is that the drive makers are setting the default APM values to the most aggressive value, the Operating System of the machine will normally set these values to a more moderate setting when booted up. There are however some systems that do not change these settings Mac OS X being one of them. So from this we can see there is no person that can correctly be blamed for this mess.

All I can really say is thankgod for Timemachine :) I guess I will just have to use the drive till one day in the future when it pings once too many. If your using a PowerBook, iBook, MacBook, MacBook Pro etc… then get hold of the smartmontools from sourceforge and check out your load cycles!

Sunday, 8th July 2007
If you can’t be arsed to read all this, or your don’t want to build it yourself here is a pre packaged version, check out the note about including your paths at the bottom of the page This is a PowerPC Package as I coulnd’t get it to compile for Intel, the package will still run on Intel via Rosseta. Streamripper 1.62.3 PowerPC (Download) Package Removed as it needs some patches

A couple of years back I used an application called StreamRipperX which had a pretty bad rep as it was said to contain some form of spyware, this was an open source GUI on top of the open source StreamRipper application for Unix / Windows / Linux etc…. StreamRipperX (The GUI with the spyware) no longer works so I had a look around and the same guy now offers a new application that does the same thing but it’s now for pay (git).

Me just wanting to rip a stream I had a look around and couldn’t find any other apps so I headed over to http://streamripper.sourceforge.net/ and downloaded the latest source code for the main application (1.62.1) and tried to compile it, well no cigar seems there are some problems that I will get around to reporting. Next I tried the previous release 1.62.0 and again I couldn’t get it to compile. I then downloaded the old source code for 1.0.5 which is well old (November 2004) and that built ok and worked fine.

Not wanting to give up I looked around and found that MacPorts / DarwinPorts has 1.62.0 listed as a package, this meant that it would compile on Mac OS X. MacPorts is a ports system that has a catalog of unix apps, it downloads all the source and dependencies and builds the apps for you. On my main system I do not have the Apple Developer tools installed and also I like to keep the system nice and clean, so no big dependency libs for a small command line applications. I did some digging around and found the information needed to build a full install of StreamRipper, to do a full install you would need libogg libvorbis and libiconv. Since I don’t want to rip ogg streams libogg and libvorbis weren’t needed, OS 10 has iconv so that was no problem. At this point I could get the application to build but not install. This was a simple fix I just changed the permissions on the install script and all was well at last.

I noticed that StreamRipper 1.62.0 built quite a few extra bits for the TRE library and some other bits, this was fine I installed it and tried using it. For some reason it would start getting the stream but not the track info so every stream would overwrite the previous as they had the same name. I was getting really pissed off by this point so went to the last stable build on the last branch which was version 1.61.27. This built fine in the same way with the changes and works great, no TRE dependencies just two nice files :). Anyway here is the instructions I pieced together and got it going with.

StreamRipper 1.62.3 Mac OS X Build Instructions

  1. First grab the Apple Developer Tools from developer.apple.com and install them.
  2. Download the unix source code from http://streamripper.sourceforge.net/ and unpack it to your desktop.
  3. You should now have a folder named streamripper-1.61.27 on your desktop or where ever you put it. Open up the Terminal and navigate to the folder. cd ~/desktop/streamripper-1.61.27 Next we need to change the permissions on the install-sh file, so just type chmod 755 install-sh
  4. Now comes the all important configure command, for what ever reason the standard ./configure doesn’t work too well, my example doesn’t use ogg so if you want it you have to sort it. Ok well type the following.
    env CFLAGS=”-O3 -g -isysroot /Developer/SDKs/MacOSX10.5.sdk -fno-omit-frame-pointer” CXXFLAGS=”${CFLAGS}-felide-constructors \
    -fno-exceptions -fno-rtti”./configure –without-ogg –without-vorbis –with-included-tre –disable-dependency-tracking

    Next you will see the configure stuff going by.
  5. Once the prompt is back just type sudo make installThis will build and then install StreamRipper into /usr/local/bin
  6. You should be done. Type streamripper -h and you should see the help options. Your now done, Enjoy!

If you can’t get it to run best to check it’s installed correctly. Still in the Terminal go to cd /usr/local/bin and then type ls -a if you see streamripper then it’s installed ok. You can test it here by typing ./streamripper -h. Once you have verified that it is working you might as well add /usr/local/ to your path so that you can just type streamripper in any Terminal window.

To add this path and the man path to your system go in to your home folder using cd ~/. Next we need to create a Terminal profile, this is pretty simple type nano .profile once inside the nano editor copy and paste the code bellow in.

# export the users executable and man page paths.
export PATH=”/usr/local/bin:$PATH”
export MANPATH=”/usr/local/man:$MANPATH”

Now just press control and X to exit, answer Y to save the file. Close the current Terminal window and open a new one and test your new streamripper install! Once you have set this path you won’t need to do it again, it will work for all apps you install.

Streamripper 1.62.3 Universal (Download) Package Removed as it needs some patches There are other packages in the Downloads section of the site.

Sunday, 3rd June 2007

If you fancy using BlueJ on Mac OS X, head over to bluej.org and and grab the stable 2.2.1 version for OS X. Once downloaded you will have the BlueJ folder, just put this where you keep your other apps. This is a stock BlueJ install so you will need to add the OU components.

1. Right click, or control click if you have a single button mouse on the BlueJ icon. Select the option “Show Package Contents” this will open a window with a folder named “Contents”. 

2. Navigate to the userlib folder Contents > Resources > Java > userlib.

3. Pop in the Course software CD, at the root of the CD is a folder named “libraryfiles” go inside here and copy the files “bsh-2.0b4.jar” and “ou.jar” to the userlib folder opened in the last step.

4. Next navigate to the folder Contents > Resources > Java > extensions.

5. From the root of the course CD copy the jars “eaextension.jar” and “ouwextension.jar”.

6. In the finder navigate to the folder named Library in the root of your hard drive and scroll down to the folder Java, copy the same two jars “bsh-2.0b4.jar” and “ou.jar”
to the folder named “Extensions”. 

Quick listing:
Inside BlueJ application bundle:
Resources > Java > Extensions should contain the following:
eaextension.jar
ouwextension.jar

Inside BlueJ application bundle:
Resources > Java > userlib should contain
bsh-2.0b4.jar
ou.jar

In the Library Folder in the Hard Drive and not in your home folder.
/Library/Java/Extensions should contain the following:
bsh-2.0b4.jar
ou.jar

If your still stuck let me know :)

Thats it done. Now your good to go!

I have seen another site that says to put “bsh-2.0b4.jar” and “ou.jar” in /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ this location is the actual Java system and should not really be touched. The Location /Library/Java/Extensions is the official location for additional jars and classes specified by Apple, all extensions are loaded when the JavaVM is started up. Another advantage of this approach is that if Apple updates the Java installation which is common this location is static and will just work with future versions.

If you want some more info, or find this useful leave me a comment.

Wednesday, 21st March 2007

This is by far the best OS 10 mod I have ever found. There are quite a few simple mods in the system, but this is the most useful of all of them. I’ve been using this particular mod since around OS 10.2 and it’s great, the only time is can get in the way is on really tiny windows, but as there aren’t many of those don’t let it stop you!

To enable the mod open up the Terminal and enter:

defaults write “Apple Global Domain” AppleScrollBarVariant DoubleBoth

You can turn it off again pretty easily in one of the control panel options. You can also use Onyx to enable and disable this mod.

Try it you might like it!