Archive for the 'tip' Category

What to do if XCode won’t add a source code file to a Project

Monday, November 30th, 2009

Sometimes XCode won’t let you add a source code file to a project when you click “Add, Existing Files…” from the “Groups & Files” context menu: you find that the filename is greyed out and cannot be selected.

To work around this, you can drag the file from the Finder to the “Groups & Files” pane.

Neat Mac tricks

Sunday, January 21st, 2007

Every Mac comes with tons of hidden features. The problem is that they’re hidden, and the Mac doesn’t come with much of a manual. Here are a few that I’ve stumbled upon:

Search audio!

Thursday, January 4th, 2007

Splashcast is reporting on a new technology from BBN technologies: a search engine that searches for words in audio streams. Their demo is at Podzinger.com. It lets you search the words inside YouTube videos. When it finds a word within the audio it tells you how many minutes into the video the word is.

MacHeist opens and Pzizz review

Saturday, November 4th, 2006

MacHeist is now live on an invitation only basis. Like Gmail, invited people will be able to invite their friends. It seems to be another Phill Ryu and friends initiative, with some nice graphics, and upcoming cheap/free mac shareware.

Which segues nicely into Pzizz. I was given a free license by voting in the MyDream App competition. Initially I was very skeptical, given how poorly their webpage reads. “Following great success with pzizz hardware we have now developed pzizz software, powered by pzizz nap technologyâ„¢.”. Aha! I don’t see… I downloaded it only to find that it comes as an installer package which makes it impossible to know where it’s installing itself :-( . So much for first impressions!

Trying it out reveals its function: it is a mashup of various relaxation techniques, namely the Alexander technique, autosuggestion, binaural tones overlaid with your standard soothing asian bell music…

But, unlike most of the free software I’ve tried, this one has survived on my hard-drive because I actually use it. It works! I perceive the low frequency binaural tone to be moving around inside my head, but it causes me to start falling asleep. At the end of the nap it wakes you back up.

So why use it? Sometimes I work late at night until I fix some bug, but I make breakfast for my wife at 6:45am. Once I’ve woken up I can’t sleep during the day. It’s too bright and I have too much energy even just to lie down… I feel like getting on. Meditating is an option, but sometimes I’m too tired to do that too. I think Pzizz helps me because I feel that I am doing something (relaxing) rather that nothing (wasting time). After 20 minutes I usually feel refreshed enough to get on with my day, or to go meditate.

Awfully quiet around here…

Wednesday, October 4th, 2006

Sorry about that! Usually I’m quiet when I’m working too hard. The good news is that I will be entering beta soon.

The first alpha testers received their copies a week ago, and the first lesson is that Find It! Keep It! doesn’t work on Intel Macs, even with Rosetta emulation. In the mean time, I’ve been busy writing documentation, building the website’s content, and fixing bugs and rough edges. There’s still a lot to do, but the end is in sight.

While I’m blogging, I want to mention this post by bbum. On Linux I used Valgrind. It was invaluable, and I would love to have it on Mac OS X. I’ve tried various Mac tools (OmniObjectMeter, ObjectAlloc) and while they’re pretty they slow Find It! Keep It! too much to be useable. As usual, with Apple, all along I had a tool called “leaks” on my harddrive… Would have been nice to know about it! Quoting bbum:

To summarize:

In a Terminal window….

setenv MallocStackLogging /path/to/foo.app/Contents/MacOS/foo
… you should see a diagnostic message like …

malloc[PID]: recording stacks using standard recorder
… then, in another Terminal window…

leaks PID
… do whatever it is in the app that you suspect causes leaks. The leaks process will print detailed information about the leak, including the backtrace of the appropriate thread within the application at the time the memory was allocated.

Bbum’s link doesn’t work right now, so this is the Google Cache, and the post he references is still on the Wayback machine.

It turns out the Webkit crew use it too

Watch YouTube/Google Video in FullScreen

Thursday, September 7th, 2006

When I waste my time, I like doing so in style. I hacked the save embedded bookmarklet to watch flash videos in full screen mode. Note that it only works on WebKit based browsers and that it assumes only one embed.

FullScreen!

To use the bookmarklet, drag it to your bookmarks bar. Then click it when watching something on Google Video or YouTube, and you’ll see it in full screen.

Why subclass from NibClassBuilder.AutoBaseClass?

Saturday, September 2nd, 2006

In PyObjC, one can either subclass Objective C accessible objects from NSObject or NibClassBuilder.AutoBaseClass.

NibClassBuilder.AutoBaseClass reads the Nib and adds to your Objective C object the outlets you declared in Interface Builder’s Class Inspector. NSObject doesn’t.

Gdb Tip: Associating a command with a breakpoint

Saturday, August 26th, 2006

Gdb can associate commands with a breakpoint!

For instance (lifted wholesale from Louis’ page):


(gdb) b myFunc
Breakpoint 1 at 0×900107a8
(gdb) commands 1
Type commands for when breakpoint 1 is hit, one per line.
End with a line saying just “end”.
>bt
>c
>end
(gdb)

The biggest problem with the web is, as Arthur C Clarke said: “Why should I go to the Niagara Falls when all I want is a glass of water?”. The same can be true of overly feature rich tools. Having spend a few fruitless hours googling for this, I have been resorting to piping python scripts into gdb.

Mac Tip: Adobe PDF plugin and Google

Tuesday, August 22nd, 2006

Google now adds a fragment to URLs to PDFs it finds:
#search=%22 search-terms-seperated-by-spaces %22

For example:

http://www.biozentrum.unibas.ch/~schwede/Teaching/BixII-SS05/Semantic_Networks.pdf#search=%22Rappaport%20sneps%22

The Adobe PDF plugin seems to use this fragment to find every occurrence of any of the search terms. I hadn’t seen that before.
Because the PDF plugin only works in Safari, this is currently only supported in Safari.