osx

NSBundle pathForResource failing in shell tool

I've noticed some weird behavior with NSBundle when using it in a command-line program. If, in my program, I take an existing bundle and make a copy of it and then try to use pathForResource to look up something in the Resources folder, nil is always returned unless the bundle I'm looking up existed before my program started. I creat...

OSX open error 2 : something changed

Something changed recently in OSX. Some legacy code used to test for the existence of a file by opening it in read only mode. This has worked "since forever". For some recent versions of OSX, including snow leopard, this process fails with errno=2 "No such file" if the file is a network share which is alreday open for read/write acce...

How do I automatically activate an item in the OS X Services Menu

I need to have a service I created enabled by default in the services menu. I've created a service for my OS X app (running on Snow Leopard). I've configured the Info.plist like so: <key>NSServices</key> <array> <dict> <key>NSSendTypes</key> <array> <string>NSStringPboardType</string> </array> ...

How do you bind Home/End to act like Cmd-Left/Cmd-Right in Eclipse on Mac?

Hi guys! This is my first question on SO, so please be gentle :) I've recently started a new job in which I do all of my development in PyDev on Eclipse 3.4.0 on OSX 10.6. Thus, I've been looking for a way to make Home and End act like they do on Windows (my native OS, and where I developed my muscle memory). I've mostly succeeded, b...

WebKit Crashes trying to play _any_ flash content.

Hi, I have a curious problem with WebKit and WebView. All my other URLs seem to work fine, but when I try to load a site with a lot of flash content, the whole app crashes. The app again functions fine if I customize webview to prevent plugins from running. What's more curious is my dev machine seems to be the exception with all the co...

Display System Keyboard Mac application?

Hi, I need to display the system keyboard if any text entry fields are selected with in my app. I can't seem to find any resources on how to do this. Any tips? Edit: I'm asking this question because I'm making a full screen application and need to show/hide based on user selection. Thanks, Teja ...

How do I add authorizations to code sign an app from new keychain without any human interaction

I'm trying to automate the process of building iphone apps with a particular certificate. So imagine if different users uploaded their cert into the system and it was immediately available to code sign against. I want to do this without any interaction. I also don't want to clutter up the system or logon keychain with different user cert...

Flash CS5 output on OSX

Solution: I was looking into the wrong library. There are two libraries in mac OSX; Macintosh HD and system. In order to fix this issue need to get to the Macintosh HD and full url is: Macintosh HD/Library/Application Support/Macromedia/mm.cfg open the file i text editor and change the following code; AS3Trace=1 to AS3Trace=0. ...

Draw portion of image in CGBitmapContext

I have created a CGBitmapContext of 256 x 256 and I have a CGImageRef that I want to draw into this context. My goal is to crop the image (and ultimately create tiles of an image), but if I use CGContextDrawImage, Core Graphics scales the image to fit the context. So the question is, how do I make sure that only a portion of the CGImage...

Countless warnings with SDL/OpenGL on OS X when dynamic graphics device switching is active

On Snow Leopard with a macbook pro that has two graphics devices the following error is printed to stderr multiple times a second: Wed Oct 6 02:35:27 nausicaa.local TestApp[92464] <Warning>: CGDisplayIsCaptured: Fixing up display ID 0x4272ec2 for offline mux head to 0x4272ec0 When I force the graphics device to be either Nvidia or In...

how do i see the url my computer is currently hitting?

I am on Mac OSX. I wrote a program to parse a few websites. The websites are being accessed using curl. How can I view which url my computer is currently hitting? ...

Possible Apple JVM bug: java.lang.OutOfMemoryError: Java heap space at apple.awt.CRobot.getRGBPixels(CRobot.java:204)

I'm having issues when I take screenshots. This is my test code. import java.awt.Robot; import java.awt.AWTException; import java.awt.image.BufferedImage; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.Dimension; public class Test { public static void main(String[] args) throws AWTException { Di...

Is there a CADisplayLink equivalent for macos/cocoa/opengl ?

I've discovered CADisplayLink for IOS 3.1+ which triggers events when the display has been refreshed, effectively allowing you to synchronise with display updates without having to use NSTimer. Is there an equivalent for timing when writing opengl applications under macos/cocoa? ...

How to solve Maven dependency on rt.jar for OS X?

I have the following dependency in my pom.xml <dependency> <groupId>javax.sql</groupId> <artifactId>jdbc-stdext</artifactId> <version>2.0</version> <scope>system</scope> <systemPath>${java.home}/lib/rt.jar</systemPath> </dependency> My problem is I'm trying to build on a Mac (10.6.4) which doesn't have an rt.jar. Is t...

MacOSX API for CPU load on each core

How do I get the load on each CPU core on my Mac, just like Activity Monitor does? Is there an API or a command line tool whose output I can parse? ...

OSX Ruby Gems Add to ruby path?

I am just starting to learn ruby. It seems that the default gems install path is not part of Ruby. Is this normal behavior? How can I set the default ruby path? Example: [11:53:33]wuntee:/Library/Ruby/Gems/1.8/gems/packetfu-1.0.0/examples$ sudo ruby arphood.rb Fetching the oui.txt from IEEE, it'll be a second. Avoid this with arphood.r...

boost example failed to build

Hello, I'm a newbie about boost. I compiled boost libraries with success (under mac os x). Now, I tried to build the very first example mentioned at boost website (including boost/ as include directory and boost/stage/lib as library directory, with netbeans) and got the following error "/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAK...

php strftime('%P') on osx gives P instead of pm with setlocale(LC_TIME, 'en_CA')

This code ... <?php setlocale(LC_TIME, 'en_CA'); $time = strtotime("07:00 PM"); echo strftime('%l:%M %P', $time); ?> provides this result on OSX 10.6.4 with stock PHP 5.3.2 or PHP 5.2.13 from macports: 7:00 P however I get the desired result on Ubuntu 9.10 with PHP 5.2.10: 7:00 pm Why the difference? How can I fix it? ...

Logging Window Bounds (dimensions) with Appleccript

It's been ages since I've dealt with Applescript, so advanced apologies for screwing up terminology here. Using the following snippet, I can resize a window tell application "BBEdit" activate set the bounds of the first window to {100, 0, 700, 700} end tell I'm interested in using a similar statement to read and then log the...

Can I use OSX AUGraph from monomac?

I have an mp3 playing application written in C# which I would like to port to OSX. As it uses DirectShow to play mp3 I realise that I will need to recode the audio playback part. I found Apple's playfile sample which uses AUGraph. The Binding Cocoa section of http://www.mono-project.com/MonoMac mentions the "much simpler AudioToolBox ...