osx

How to use a VM to create a Rails staging environment

My app is in development and I do all my testing using WEBrick (I like the terminal output). On the production server it will run on Phusion Passenger. I'm running Snow Leopard and wish to test the app in an environment similar to the production environment. Can I use Parallels to run a Debian install with Apache and Passenger and con...

Mac/iPhone: Is there a way to get a thread identifier without using Objective-C?

Is there a way to get any kind of thread identifier of the currently running thread without resorting to Objective-C's NSThread. I'm improving our custom debug tracing system to handle multiple threads properly. For each line of trace output, I'd like to print a thread id or a thread name. Threads are instantiated in various ways, e.g....

Reading in an ascii 'maze' into a 2d array

I'm writing code to read in a 7x15 block of text in a file that will represent a 'maze'. #include <iostream> #include <fstream> #include <string> #include "board.h" int main() { char charBoard[7][15]; //the array we will use to scan the maze and modify it ifstream loadMaze("maze"); //the fstream we will use to take in a maze...

Java5 on Snow Leopard

Hi, I need Java5 (not 6), but Snow Leopard comes with only Java6. There is /System/Library/Frameworks/JavaVM.framework/Versions/1.5, but that just points to 1.6.0: $ ls -la /System/Library/Frameworks/JavaVM.framework/Versions/ lrwxr-xr-x 1 root wheel 5 Sep 24 20:12 1.3 -> 1.3.1 drwxr-xr-x 3 root wheel 102 Jul 21 07:35 1.3....

Mac L&F problems: Differing behavior of JTextField.requestFocus()

I have a problem with JTextField.requestFocus() behavior that appears to be different on Mac OS X. Here is my situation: I have a dialog with a JList and a JTextField. The user is supposed to write a boolean expression in the text field, and the list contains the names of all the variables that might be entered in the expression. Becau...

Calculating hdiutil's compression ratio

In my app I'm using Apple's hdiutil command line utility to create compressed disk images (DMGs) of folders/volumes. Is there any way to calculate the compressed size of a given source path? I've already checked in the man pages, nothing there. ...

localhost django dev server vs. postgres slow on mac os?

Hi StackO, Long time fan, first time posting. Hi! Anyone notice slowness from a django dev server running on Mac OS and connecting to a remote (postgres) db? It doesn't seem to be the DNS problem referenced elsewhere. We've got a staging instance running the exact same code on the same remote staging box that's hosting the db, and the ...

How to connect to server via ssh but use native "Connect to Server" in OS X?

I have a remote server I manage via command line on Snow Leopard. I ssh into it, etc. All of my ssh keys are setup, and I have configured a local alias that lets me login with one command. What I'd also like to do is be able to connect to it via ssh, but have it mounted locally as a remote drive. I've tried the Connect to Server, comman...

Standard (32/64-bit Universal), WebKit, Flash Plugin and Leopard

I have an Xcode project which builds a Cocoa desktop Browser application. My Browser links to the standard WebKit.framework on the system (it does not embed its own WebKit.framework). The "Base SDK" for my Xcode project is set to "Mac OS X 10.5". The "Valid Architectures" for my Xcode project is set to "i386 ppc ppc64 ppc7400 ppc970 ...

Ruby: cannot parse Excel file exported as CSV in OS X

I'm using Ruby's CSV library to parse some CSV. I have a seemingly well-formed CSV file that I created by exporting an Excel file as CSV. However CSV.open(filename, 'r') causes a CSV::IllegalFormatError. There are no rogue commas or quotation marks in the file, nor anything else that I can see that might cause problems. I suspect the...

Force a Mac OS X 32/64-bit universal binary to run 32-bit on Leopard only?

I want to ship a single 32/64-bit universal binary of my desktop Mac OS X Cocoa app. I don't want to ship two versions. I want it to run as a 64-bit process on Snow Leopard. However, if the app is launched on Leopard, I want to always force it to run as a 32-bit process. NOTE: I know that in the Finder 'Get Info' window you can click ...

Mac OS X Terminal Colors

I'm new to Mac having just got one after working with Ubuntu Linux for some time. Among the many things I'm trying to figure out is absence of colors in my the terminal window - like the ones that are shown (on linux) when you run 'ls -la' or 'git status'... I just can't figure out how to activate them in the actual shell. ...

Auto-hide the OS X menu bar system-wide

I wish to write a utility to auto-hide the menu bar, much like the dock. This would replicate the a OS X 10.4-only application "Menufela", but for Snow Leopard. [[NSApplication sharedApplication] setPresentationOptions: NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationAutoHideDock]...

How to tell if a menu item is 'checked'?

I'm building an Applescript that will scan my network every X minutes, checking for my house's Xbox360 or PS3 and enabling my Transmission BitTorrent client Speed-Limit Mode when either console is online. Currently I can only Pause all transfers or resume all transfers using applescript, as there are separate key-commands for start/stop...

What is CHUD Remover? (Came with Xcode on OS X)

I accidentally stumbled across an application called CHUD Remover that claims to remove CHUD files. It lives in /Developer/Applications/Performance Tools/CHUD. What is CHUD and why would I want to remove CHUD files from my system? ...

CoreImage patches problems in 10.6

Hi All, In 10.6 with some systems CoreImage CIPerspectiveTransform (And other api's too) results in colored patches in output image. (It seems like hardware related issue And it occurs only with images with resolution above 4000X2500) Is there ay way to come out of this bug? At-last is it possible to use NSAffineTransform instead? If...

How to set Image Perspective

Hi, I am working in Mac OS X, 10.6 How can i set the image perspective of any image? I do not want to use CoreImage. Is it possible to do it via NSAffineTransforms. Regards, Dhana. ...

Perl Digest::SHA1 not being imported on OS X Leopard Server

Hi there, I've been trying to get SVN to connect to Atlassian Crowd for authentication but have been running into issues with OS X Leopard Server (10.5.8) and Perl's Digest::SHA1. I've installed it from the source (http://search.cpan.org/~gaas/Digest-SHA1-2.12/SHA1.pm) and if I call it directly from a Perl script it works fine, but in ...

xUnit Testing Framework for Mac/iPhone

Does anyone know of any xUnit testing frameworks for the Mac OS, more specifically for the iPhone OS? I've seen a couple online, google-toolbox-for-mac & objcUnit, but they don't seem to have had any development on them for a long time. Are there any Objective-C developers out there that perform unit testing and if you do what tools do...

Getting multiple properties at the same time in Appscript

I am using Appscript - a Python interface to AppleScript - in a project of mine that basically gets data from a Mac application. Here is a sample code: asobj = app('Things').to_dos()[0] self.id = asobj.id() self.name = asobj.name() self.status = asobj.status() Every invocation of the properties (id, name, status) does...