osx

How to trace a program from its very beginning without running it as root

I'm writing a tool that calls through to DTrace to trace the program that the user specifies. If my tool uses dtrace -c to run the program as a subprocess of DTrace, not only can I not pass any arguments to the program, but the program runs with all the privileges of DTrace—that is, as root (I'm on Mac OS X). This makes certain things t...

What is the setup proceedure for an AUConverter for use in an Core Audio AUGraph

I want to convert from pcm 44100khz 16bit signed 2 channel interleaved (packed) format to 44100khz floats 2 channel non-interleaved (2 buffers) format for use in an AUGraph. I have been messing with it for a few days. whats the best way to set up an AUConverter to do this ...

How to use OpenType fonts in a PostScript program?

I am writing a PostScript program to print name badges and would like to include an OpenType font such that I can use it later on. OpenType files are binary files and I am looking for advice how such fonts are included into PostScript files as they are sent to a printer. I am developing on Mac OS X which might be relevant if I need con...

How to install scons on Mac OS X

Hi, Can you please tell me how can I install scons on MacOSX? I don't see a mac specified download from http://www.scons.org/ Thank you. ...

Rubygame + OSX hello world crashes at startup

I have this crash-at-startup problem with rubygame and OSX. Anybody knows what might be causing it, and how to fix it? Versions: OSX 10.5.7, ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9], rubygame 2.5.3 installed from a rubygem, most software installed with MacPorts (up to date). Different versions of ruby and rubygame seem to...

To change $USER in OS X's terminal

I would like an other way to change my current user than by GUI. It would be great that if you can change the user as fast as you can your login shell by chsh. How can you change the user in OS X's terminal? ...

“Right Click” keyboard short cut for Eclipse?

I am switching back and forth between eclipse and intellij and am really missing the ability to "right click" using the keyboard when I am in eclipse. I am running OSX Leopard. Does anyone know if this can be setup in the keys preferences, or is there a plugin that handles simulating a context menu at the current focused component? ...

Extract text from hostname

Using OS X, I need a one line bash script to look at a client mac hostname like: 12345-BA-PreSchool-LT.local Where the first 5 digits are an asset serial number, and the hyphens separate a business unit code from a department name followed by something like 'LT' to denote a laptop. I guess I need to echo the hostname and use a combinat...

OS X Command-line URL filter

Hi, I have a bash script that uses bash's "read" builtin to obtain a username and password from the user and then uses them as part of an AFP URL. I'm encountering some problems, however, when passwords contain characters that affect URL parsing (';' for example). I've looked around for a command-line utility that can do URL-filtering b...

Standalone SVN client for Mac OS X

Tortoise SVN on Windows allows a single user without a network connection to create a repository on the user's machine to check code into, without needing any separate server installation or configuration. This is very useful for lone developers. Is there an SVN client for Mac OS X with this feature? ...

In my code how to launch application responsible for an UTI

My Mac OS X application receives a file over the network (in this case, text/x-vcard). In my code, how can I open the related application (typically the Address Book) without hard-coding paths or application name so that it processes the file ? ...

Multiple versions of Python on OS X Leopard

Hi, I currently have multiple versions of Python installed on my Mac, the one that came with it, a version I downloaded recently from python.org, an older version used to run Zope locally and another version that Appengine is using. It's kind of a mess. Any recommendations of using one version of python to rule them all? How would I go a...

How do I set an OS X application bundle's working directory?

Is there a key I can set in my application bundle to set what the working directory will be for the executable? It needs to be the $BUNDLE/Contents/MacOS directory (because of some library dependencies that do runtime loading that I can't easily modify). I'm aware this can be done by wrapping with a script instead but I'd rather not. ...

Newbie Question: GTK# (Mono) on OSX

I am taking my first steps (or perhaps my last steps) in GTK# on Mono for OSX. I write a .cs file and then try to compile with mono: gmcs -pkg:gtk-sharp-2.0 one.cs this results in this message error CS8027: Couldn't run pkg-config: ApplicationName='pkg-config', CommandLine='--libs gtk-sharp-2.0', CurrentDirectory='' Which would, ap...

Installing Mysql gem on OSX error - 'Marshal data too short'

Getting a 'marshal data too short' error when trying to install the mysql gem on OSX. Poking around I've heard suggestions to clear out .gems, but can't seem to locate it on the system. Can anyone offer help? apple$ sudo gem install mysql --backtrace --debug Exception `NameError' at /Library/Ruby/Site/1.8/rubygems/command_manager.rb:1...

Equivalent of a Windows Service on OSX with Mono

What do I need to do to have my .NET-Mono application run as a background process on OSX and start when the OS starts up? (Assuming the application is otherwise ready to go on OSX) Related Build an installer for .NET app that can run on Windows and OS X? ...

How can I make a java FileDialog accept directories as its FileType in OS X?

I am trying to switch from using a JFileChooser to a FileDialog when my app is being run on a mac so that it will use the OS X file chooser. So far I have the following code: FileDialog fd = new FileDialog(this); fd.setDirectory(_projectsBaseDir.getPath()); fd.setLocation(50,50); fd.setFile(?); fd.setVisible(true); ...

How do I pause a function in c or objective-c on mac without using sleep()

Hi I would like to pause the execution of a function in an cocoa project. I dont want to use sleep() because the function needs to resume after user interaction. I also want to avoid doing this with multiple calls to sleep. Thanks for your responses. Ok I started the code while waiting for some answers. I then realized that sleep or...

sed on OS X - can't seem to use + in regexps

Now according to all the literature echo 1234abcd|sed "s|[0-9]\+|#|g" should return #abcd. And echo abcd|sed "s|[0-9]\+|#|g" should return abcd. But on OS X 10.4.11 the first expression returns 1234abcd. Using * instead of + works for the first example but fails on the second, returning #abcd, because the [0-9] pattern is matched ...

Free UML Modelling tool for OS/X

Hi Guys, are there any good free native UML modelling tools for OS/X that allow you to quickly whip up simple UML diagrams. I know about ArgoUML, great for a java app (its usable), but certainly painful to use under OS/X wit the number of bugs and issues it has. ...