osx

Understanding the Unix file system and ruby installs without Sudo

I'm trying to comprehend the Unix file system on my OSX. I'm following wikipedia Filesystem Hierarchy Standard. I understand when I install ruby gems I must use the command sudo gem install but if I omit sudo, problems may occur. Where are gems installed within the file system when I omit sudo? How can I delete these gems? A Fun side ...

PHP fork promblems in OSX

HELP :) I was trying to copy the Zend_Tool stuff into /usr/etc/php (according to 'which php' command). I don't know what went wrong but if I try and run php from the command line I get this error : /usr/bin/php: fork: Resource temporarily unavailable I can't find any help online. Anyone have any suggestions ? Brian ...

Create new document programatically in cocoa

Hi!!! I'm wondering if it is possible to send a message (programatically) to a document-based application to create a new document with some special content inside it. I'm creating two applications and the first has to call the second one sending it some data. I've tried with the Apple Events but it doesn't seem to work. Thanks in adv...

OSX/Darwin unresolved symbols when linking functions from <math.h>

I'm in the process of porting a large'ish (~1M LOC) project from a Window/Visual Studio environment to other platforms, the first of which happens to be Mac OS X. Originally the project was configured as Visual Studio solutions and projects, but now I'm using (the excellent) Premake (http://industriousone.com/premake) to generate proje...

Which dynamic libraries on OS X can be taken for granted?

If I want to make an OS X program as self-contained as possible to ease installation, what dynamic libraries can I expect everyone or most people to have? If I know that, I won't have to compile static libraries for everything. ...

git: How to diff changed files versus previous versions after a pull?

I'm new to git, using it via Terminal on Snow Leopard. When I run "git pull" I often want to know what changed between the last version of a file and the new one. Say I want to know what someone else committed to a particular file. How is that done? I'm assuming it's "git diff" with some parameters for commit x versus commit y but I ...

Controllers in Document-based application

Hi I've tried to setup a controller for a document in a document based application, and i'm not sure what is the correct for doing that. In MyDocument.xib I have set the File's Owner as MyDocument class and the I connected the outlets and actions to it but it doesn't seem to work Could anybody give me a hand on this? Cheers ...

Level Creator for iPhone Game

I'm making an iPhone game that has several maps with graphics attached. The graphics may allow the player to pass through them or block them. Is there an application for OS X that will allow me to pass some of this work off to a designer without having to reinvent the wheel and develop a map creator. ...

On MacOSX, in a C++ program, what guarantees can I have on file IO

I am on MacOSX. I am writing a multi threaded program. One thread does logging. The non-logging threads may crash at any time. What conventions should I adopt in the logger / what guarantees can I have? I would prefer a solution where even if I crash during part of a write, previous writes still go to disk, and when reading back the lo...

Can I change the default directory on my local drive for all Git activity?

So I just started using Git and GitHub. It's still a steep climb, but I'm starting to enjoy it. One thing I've noticed from when I clone a repository is that it always downloads to my home folder /users/username. Is there a way to change this? I went searching through the Git manual and thought I might be able to use --git-dir=GIT_DIR, ...

Is the method addSubview of NSView inherently slow? (Cocoa OSX)

I am trying to speed my gui that loads very slow slow when I am loading a large project (the gui is a representation of groups and sub groups and is made up of many views). During this process I was looking at how long certain code segments take to execute and I have found that a call to addsubview is taking between 10 and 20 millisecon...

Tagging files with colors in OS X Finder from shell scripts

One can tag files and folders with a color in the Mac OS X Finder. Is there a way to do this from a shell script? ...

GUI HTTP client

Does anyone know of a good GUI HTTP testing client that runs on OS X? Something that will allow me to enter a request (URL, headers, body, etc.), and view the response, preferably in different formats (hex, text, etc.). I found one called HTTP Client, but it's kind of buggy. Google is failing me. EDIT: Thanks for the responses so far....

MacOSX: OSAtomic vs OSAtomicBarrier

For the functions here: #include <libkern/OSAtomic.h> there are OSAtomic and OSAtomicBarrier versions. However, the documentation does not show sample code for: When is it safe to use just OSAtomic, without the OSAtomicBarrier version When is it that OSAtomic would be unsafe, but OSAtomiBarrier would be safe. Can anyone provide e...

FSEventStream best practice. Single stream watching multiple directories? Or one stream per directory.

Title should be self explanatory. I'm interested in first hand experience, or specific documentation that describes which approach is preferable and why. ...

View plain text files with different background colors in Mac OSX, for different programming languages

Hi, I work with Mac OS X Leopard. I usually have 5 or 10 text files opened at the same time with different programming languages; one for a bash script, another for a python one, etc. When I use exposé all of them look the same, so it is difficult to select them. I wonder how could I work with just plain text files in OSX, so when the...

Raw socket sendto() failure in OS X

When I open a raw socket is OS X, construct my own udp packet (headers and data), and call sendto(), I get the error "Invalid Argument". Here is a sample program "rawudp.c" from the web site http://www.tenouk.com/Module43a.html that demonstrates this problem. The program (after adding string and stdlib #includes) runs under Fedora 10 b...

Setting custom php include path in .htaccess on mac os x

in /Users/username/Sites/somesite/.htaccess I have AllowOverride All php_value include_path ".:/Users/username/Sites/somesite/inludesFolder:/usr/lib/php" I have also modified /etc/apache2/httpd.conf to AllowOverride All and restarted websharing, but it's not finding the additional include path. I'd like to avoid modifying t...

Bluetooth proximity hooks on OS X. How? (i.e., automatically lock screen if I move away)

I have a macbook pro. I would like to have my screen lock when I (my phone) moves away from the laptop. I'm sure third party solutions exist, but if I'd like to code something from scratch, what libraries or hooks should I be looking at? ...

Getting SSL to work with Apache/Passenger on OSX

I use apache/passenger on my development machine, but need to add SSL support (something which isn't exposed through the control panel). I've done this before in production, but for some reason I can't seem to get it work on OSX. The steps I've followed so far are from a default apache osx install: Install passenger and passenger pre...