osx

How do I re-bind a socket in MacOSX/Ubuntu? A second time

I have the following code: if ( ( m_mainSocket = ::socket( PF_INET, SOCK_STREAM, IPPROTO_TCP ) ) < 0 ) { throw Exception( __FILE__, __LINE__ ) << "Unable to create socket"; } int on( 0 ); if ( setsockopt( m_mainSocket, SOL_SOCKET, SO_REUSEADDR, &on, sizeof( on ) ) ) { throw Exception( __FILE__, __LINE__ ) << "Can't make server...

how do you extract a header from a private framework on OSX?

I've tried class-dump ( http://www.codethecode.com/projects/class-dump/ ) and class-dump-x ( http://iphone.freecoder.org/classdump_en.html ), but neither works on /System/Library/PrivateFrameworks/CoreSymbolication.framework on Snow Leopard (OSX 10.6.2). Are there are any other ways to retrieve the headers for this framework? ...

Beginner's question, trying to understand how the linker searches for a static library

I have a working setup, where all files are in the same directory (Desktop). The Terminal output is like so: $ gcc -c mymath.c $ ar r mymath.a mymath.o ar: creating archive mymath.a $ ranlib mymath.a $ gcc test.c mymath.a -o test $ ./test Hello World! 3.14 1.77 10.20 The files: mymath.c: float mysqrt(float n) { return 10.2; } te...

on mac osx, is fprintf thread safe?

If so, where is this documented? Thanks! ...

Get router mac (without system call for ARP) in Objective-C

Ok - I am writing a daemon in Objective C that checks the connected router mac address every 5 seconds. I am completely new to objective C, and I am looking for a better way to do what I'm already doing. I'm currently calling "arp -a" and parsing the results via "Task": NSTask *task; task = [[NSTask alloc] init]; [task setLaunchPath...

How do I get ruby-svm to look for libraries in macports' /opt/local?

I want to install Ruby SVM. I already have macports with normal settings, and installed libsvm via port just fine. But when I go to compile rubysvm, it barfs. :( Ruby SVM: http://rubysvm.cilibrar.com/download/ (most links are 404 though) libsvm: http://www.csie.ntu.edu.tw/~cjlin/libsvm/ Try this: sudo port install libsvm wget http://d...

How to remove deletedObjects from ManagedObjectContext?

Hi, I have two enities: path <-->>> node. (one to many) In nodes ArrayController I override -DeleteObjects: to remove path if the last node is removed. Everything works perfect, but it's impossible to save edited document, because nodes are left in [ManagedObjectContext deletedObjcets]. It gives error on save. How to clean them up? Bab...

Convert Chrome history date/time stamp to readable format

I originally posted this question looking for an answer with using python, got some good help, but have still not been able to find a solution. I have a script running on OS X 10.5 client machines that captures internet browsing history (required as part of my sys admin duties in a US public school). Firefox 3.x stores history in a sqlit...

MySQL InnoDB insertion is very slow

We use MySQL server 5.1.43 64-bit edition. InnoDB is used as engine. We have a sql script which we execute every time we build the application. On ubuntu machine with MySQL server and InnoDB engine it takes about 55 seconds to complete the execution. If I run the same script on OSX, it takes close to 3 minutes! Any ideas why OSX is s...

Putting a 'terminal' in my application?

Are there any frameworks for say, putting a display like in Terminal.app in MY app, and then displaying text on it like usual output to STDOUT? Complete with scrollback and etc.? ...

How do I use an NSProgressIndicator as the view of an NSToolbarItem and have it show in the customisation sheet?

I have an NSToolbar set up in my app. It was created in IB. One of the toolbar items uses a spinner-style NSProgressIndicator as its view, the rest are images. When the toolbar's customization sheet is showing, the spinner does not show in the sheet. I initially thought that this was because the spinner's -displayedWhenStopped was set ...

LaunchDaemons and Environment Variables

For a while now, I've been noticing that my MacPorts-installed Apache2 instance hasn't been starting when I start up (http://stackoverflow.com/questions/2042992/macports-apache2-stopped-launching-on-boot). The LaunchDaemon is loaded. Today I bumped into something in a log file that may point to an answer, but I can't find any confirmatio...

Where is stdout for a Mac App?

It used to be that stdout went to the console log, displayed by Console.app. I've been having some problems with a firefox plugin (see other questions, sorry about the spam...) and I was trying to use printfs to at least see if I was STARTING my plugin. I just noticed today that my console log hasn't been updated since January 6. (Yes,...

New to Mac Platform, Trying to get back to default python install

Hi Everyone, I've been trying to follow this blog post to get my python version back to the snow leopard default. I have followed the first two steps without a problem but am lost when it comes to 3 and 4. I installed Python 2.6.4 but I assume the instructions are pretty similar. Thanks for your help! ...

Where are the OpenGL header files located on MacOSX?

In /usr/include , I tried grepping for GL gl and OpenGL .. .but can't find it. Where are these header files located? ...

Is there non-daemon FTP server application fot Mac OS? (like MAMP)

I'm finding an non-daemon, interactive-mode only, portable(moveable) FTP server for Mac OS X. Like MAMP. This will be used temporarily for local development only. Not for service. Just file listing and serving(download) features required. Complex features like account management or SSL are not required. This should be run as an UI appl...

Conkeror Keybindings on Mac OSX

Has anyone figured out how to change the keybindings for the meta and control keys for Conkeror on Mac OSX? For example, in Emacs I have my C mapped to the apple command key and my M mapped to the option key. Is there any way to do this for Conkeror? Can anyone supply the javascript for the .conkerorrc file? ...

Xcode completion doesn't recognize the type of my variable

I'm creating an object with: NSMenu *appMainMenu = [[NSMenu alloc] initWithTitle:@"MyApp"]; (Ignore the fact I'm creating this menu programmatically and not using a Nib File. I understand the disadvantages of doing so) The menu appears correctly in the menubar. However, when I try to call any instance method such as: [appMainMenu...

How to clear shell buffer in Terminal in Mac OS X?

I know 'clear' command clears current screen, but the cleared contents just scrolled up. Is there a way to clear all cleared buffer contents? I'm figuring this to prevent scrolling up on Terminal. ---(edit)--- I'm finding a way which can be used in shell script. Or program. ...

Bash: Copy a folder full of files and folders to an external hdd, but only if there is enough space to complete the copy.

I want to copy a folder from my X-Serve RAID to an external HDD on an X-Serve. Both disks are on the same server, so copying is fairly easy. I use the ditto command: ditto -rsrc /Volumes/WadXServeRaid/Users/ $destinationpath/Users/ However, I only want the copy to start if there is enough space on the destination disk. I know I can us...