osx

Repeat a unix command every x seconds forever.

There's a builtin unix command repeat whose first argument is the number of times to repeat a command, where the command (with any arguments) is specified by the remaining arguments to repeat. For example, % repeat 100 echo "I will not automate this punishment." will echo the given string 100 times and then stop. I'd like a similar ...

Native looking GUI framework for Mac and Windows

I am currently searching for a GUI framework that looks and works native under Mac and Windows. Further I dont want to use C++ but e.g. C#, Java, Ruby or Python. Thx a lot. ...

Zsh tab-completion for "cd .."

How can I configure the Zsh tab-completion such that when I type cd ..<TAB> it expands to cd ../ and after pressing <TAB> again proposes the folders in the parent directory for completion? E.g. it should show the same behavior as when typing for example cd Documents<TAB> which expands to cd Documents/ and after pressing <TAB> again prop...

Mac OS X equivalent for TerminateProcess(GetCurrentProcess,0);

I am looking for a simple and uncatchable way to terminate the Mac port of my C++ application. In Windows I was using TerminateProcess(GetCurrentProcess, 0); What's the equivalent command I can use with Mac OS X / XCode / GCC? ...

Mac OS X: Where should I store common application data?

Hi, What's the standard path on MacOS X for storing application data that is to be shared by different users? I am not talking about temporary data, but data which is used by one particular program on a regular basis and belongs to no particular user. For example a game highscore table. Thanks, Adrian ...

How do I select the next message outside of a selection in Mail using Applescript?

I wrote a short Applescript to move the selected messages to the relevant archive for that mailbox. However when it runs there is no longer a selection. (If I then press up or down, it selects either the first or last message in the entire mailbox). I can't work out how to select the next message outside of the current selection using...

Compiling PHP-GD on Mac OSX 10.5

I've followed the helpful instructions here: Install GD for PHP on Mac OS X 10.5 Leopard And I have my extension directory in php.ini file like this: extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/" But when I try and load GD, I get an error: PHP Startup: Unable to load dynamic library '/usr/local/php/lib/...

How can I access informations about connected storage devices on Mac OS X?

I'm looking for a way to list all connected storage devices, like Disk Utility does. That means also for not mounted volumes. The second thing I'm looking for is more detailed information, to what port a device is connected, the size of it and the block size of it. Is there an API to do this? I prefer Cocoa, but a unix API is also ok. ...

Unable to serve pages on Mac OS X using default Apache Web Server

I have enabled the Web Server on my Mac OS X (10.5.6) by going to the System Preferences -> Internet & Network -> Sharing and clicking on the Web Server option. It gives me the IP address of my system as the Web Server, but even after clicking on it, it does not show the page, but gives an error: Failed to Connect Any help on this would...

[OSX .app] How to reference Resources folder in code

I'm porting a c++ Qt application from Windows to OSX and cannot wrap my head around the .app bundle concept. I hope someone can help me understand. My executable lives here: MyProgram.app/Content/MacOS/MyProgram.exe My resource folder lives here: MyProgram.app/Content/Resources/ In my code I use a relative path to reference items in t...

How to determine number of files on a drive with Python?

Howdy! I have been trying to figure out how to retrieve (quickly) the number of files on a given HFS+ drive with python. I have been playing with os.statvfs and such, but can't quite get anything (that seems helpful to me). Any ideas? Edit: Let me be a bit more specific. =] I am writing a timemachine-like wrapper around rsync for va...

How to open an HFS+ file by file ID?

Given an HFS+/HFS volume and the catalog node ID (CNID) of a file it should be possible to open that file, and technote 1150 describes the algorithm for doing just that, yet nowhere can I find the corresponding API call. As far as I can tell, the whole API requires either the file's name or its parent catalog node ID. What gives? ...

WxWidgets / GCC / MacOs X: How can I build and link the WxWidgets library properly?

Hi, I am trying to port a windows application based on WxWidgets 2.8.9 to MacOS X. I've gotten to the point where everything compiles successfully, except from a few missing symbols related to WxWidgets. I've tried compiling WxWidgets with the command line and with XCode and I've tried several different configuration options, but none o...

Best way to escape characters like newline and double-quote in NSString

Say I have an NSString (or NSMutableString) containing: I said "Hello, world!". He said "My name's not World." What's the best way to turn that into: I said \"Hello, world!\".\nHe said \"My name\'s not World.\" Do I have to manually use -replaceOccurrencesOfString:withString: over and over to escape characters, or is there an easie...

What Languages are Windows, Mac OS X and Linux written in?

I was just wondering who knows what programming languages Windows, Mac OS X and Linux are made up from and what languages are used for each part of the OS (ie: Kernel, plug-in architecture, GUI components, etc). I assume that there are multiple languages for each and obviously I know the Linux kernel is written in C. I'm totally guessi...

GD2 and PHP on OS X

There are tons of links on this topic - but all have a different approach. I have a clean install of os x 10.5.6. I'm using the version of PHP that came with the OS. I have installed GD using FINK, it has installed associated packages. My question is, how do I now get GD support in PHP? (pref no macports or marc liyanage suggestions as...

Error installing PostgreSQL on Mac OS X 10.5 using MacPorts

I've installed PostgreSQL using MacPorts on a couple of different computers, no problem, but when it comes to my own laptop, I cannot get it to build. When I do this command: sudo port install postgresql83 I get this error: checking test program... failed configure: error: Could not execute a simple test program. This may be a prob...

Best book for getting started with professional Mac Development?

I'm looking for a best of breed book which will help me to get started with professional Mac development. I would expect that professional development is done with Cocoa, Objective C and/or XCode. But it needs to be a single excellent book for a professional coder who is new to Mac development. ...

Mac OS X: Can one process render to another process's window?

Greetings! I'm currently porting a web browser plugin from Win32 to MacOSX. One of the features of the plugin is that when the plugin is loaded, it spawns a separate process that serves as the "engine" of the plugin and executes drawing operations into the window of the plugin (specifically, by attaching an OpenGL context to the parent ...

GCC without Xcode on OS X

I've just unwrapped my new MacBook Pro (yay!) and am now setting it up properly for development. Since I want to avoid clutter, I'm wondering if I really need to install the Xcode tools at all (I never use the IDE or Mac specific tools), since I'll install a newer version of GCC anyway, using MacPorts. So, is there any benefit in instal...