osx

Problems starting MySQL on Mac OS X

I am not able to start MySQL server on Mac OS X 10.4.11. MySQL was installed using Macports. MySQL was running fine until it suddenly died without any obvious reason. When running "mysql", I get the error message: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2) If ...

Running external tools in Eclipse on Mac OS X

I'm using Flash Builder 4 on a mac. I've created a JSFL file for building a few fla's and then testing my main SWF file. I'm trying to run this JSFL file as an external tool from Flash Builder 4 but when I select Adobe Flash CS4.app as the file to run the JSFL Eclipse warns "External tool location specified is not a file." I have Parall...

OSX Weak Linking - check if a class exists and use that class

I'm trying to create a universal iPhone app, but it uses a class defined only in a newer version of the SDK. The framework exists on older systems, but a class defined in the framework doesn't. I know I want to use some kind of weak linking, but any documentation I can find talks about runtime checks for function existence - how do I ch...

I've installed xapian via macports, so why does this python app tell me that xapian needs to be installed?

I'm trying to run a python application on my system. When I try to execute it I get a traceback which ends with something saying I need to install Xapian. So I went ahead an installed xapian-core and xapian-bindings using macports. Then I tried to run the python application again, but got the same traceback. Any ideas about what I should...

Rewinding std::cout to go back to the beginning of a line

I'm writing a command-line tool for Mac OS X that processes a bunch of files. I would like to show the user the current file being processed, but do not want a bazillion files polluting the terminal window. Instead I would like to use a single line to output the file path, then reuse that line for the next file. Is there a character (or...

Make Windows application work on Mac OS X

Please suggest ways to deliver Windows application (.NET) to Mac OS X. Mono isn't an option, I'm looking for a solution that requires no code changes. I'm considering VirtualBox virtualization (http://www.virtualbox.org). Any other suitable options? Thanks! ...

How to programmatically allow access to the KeyChain for my application?

Need to avoid the conformation dialog. ...

JFileChooser returns incorrect path in OS X (folders only mode)

I have a problem in java swing where the user has to select a folder, so I am using the code below. JFileChooser fc = new JFileChooser(); fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); if(fc.showDialog(singleton, SELECT) == JFileChooser.APPROVE_OPTION) { File folder = fc.getSelectedFile(); String path = folder.getPath() + ...

How do I set bash environment variables from a script?

I have some proxy settings that I only occasionally want to turn on, so I don't want to put them in my ~/.bash_profile. I tried putting them directly in ~/bin/set_proxy_env.sh, adding ~/bin to my PATH, and chmod +xing the script but though the script runs, the variables don't stick in my shell. Does anyone know how to get them to stick a...

Compiling a library for Ruby with SWIG on Mac OS X

I tried to compile the following library and everything went smooth until the last step. /* File : computation.c */ int add(int x, int y) { return x + y; } /* File: computation.i */ %module computation extern int add(int x, int y); $ swig -ruby computation.i $ gcc -c computation.c $ gcc -c computation_wrap.c -I/opt/local/lib/ruby/1....

Accessing objects on one nib file from another nib file

I have two nib files - Main.nib and Preference.nib In Main.nib file I have an instance of NSView class.Its window has a NSPopUpButton which on clicking shows a menu .In the menu I have show Preferences menu item. Menu item on clicking shows a preferences panel containing a color well item. On clicking color well a color panel is displaye...

Applescript uses wrong python version, how to change?

I recently installed python 2.6.5 over 2.6.1 on OS X. Everything works fine except when I try executing python scripts via the Applescript editor. If I execute the following line I get version 2.6.1: Applescript: do shell script "python -c \"from sys import version; print version\"" But if I execute the similar line in the OS X termi...

Porting getifaddrs to Win XP

Hi all, I'm trying to port a MacOSX app to windows and I've come up against a problem around getifaddrs. Basically windows does not support it. I'm trying to figure a way to re-implement it (for AF_INET and AF_INET6) but the "equivalent" functionality on windows appears to be nothing like the MacOSX support. Has someone done this sor...

Copy window content between applications on Mac

In my application I have a NSWindow with some drawing which is quickly changing (i.e. animation or video). Also I have another application, emulated via X11, which created GtkWindow. How can I copy all the drawings from the first Cocoa window to the second Gtk one in real-time? Or, let me better divide the question on two parts: How...

How to use pkg-config for setting include paths in Xcode?

For example, if I need Gtk+ include paths. How to use pkg-config gtk+-2.0 --cflags in Xcode project settings? ...

How can I determine the arguments for a private API function?

I want to create a replacement for the app switcher (aka 'cmd + tab'). I know that it's possible because Lite Switch X does it. What I've got achieved so far: By force quitting the dock and calling CPSRegisterForKey() (which is a private API function) I can prevent the default cmd+tab from working. The second step is two register the...

scripting addition : doing code injection in the mac os x dock

Hello, I am trying to inject code in the dock using scripting additions methods. I've searched on the net but was unable to find a correct example showing all the necessary steps. Do you have documentation to acheive this? thanks in advance for your help. regards, ...

Programmatically created AirPort connection persistence

I have a Mac software client that sets up a Mac for a new internet connection via a DSL modem. Some devices have a WiFi access point and so the software sets up the user's Mac so it can connect to it wirelessly as well. This all works fine on Mac OS X 10.4.x to 10.6.x (the latter via CoreWLAN framework now). Once. The problem is that t...

How do I stop the phusion passenger spawn server from restarting?

I have Phusion Passenger running my Ruby on Rails application on my local machine, but I'd like to be able to kill the process entirely and run a different (non-Apache) service on the same port. Unfortunately, when I kill the passenger spawn server and the httpd processes, the spawn-server restarts: 15:30:37 /usr/bin $ ps ax | grep pas...

"GNU Make not found. Try setting the environment variable GNUMAKE."

I am trying to install Steel Bank Common Lisp as described in this article. However, when I do this step: sh-3.2# INSTALL_ROOT=/usr/local sh install.sh I get this error: GNU Make not found. Try setting the environment variable GNUMAKE. How, exactly, do I install GNU Make and set the environment variable GNUMAKE on Mac OS X? ...