osx

Bundle a python script into an OS X App, but...

I currently have a script that I'm using to update files for me from a couple repositories. The script works fine if I execute it using: python myscript.py However, when I attempt to bundle into an App, it no longer functions correctly because a part of my script requires user input. There is no interface, however, for it to use. I've...

CoreData customize mapping model

Hi, I have a problem mapping the following situation from v1 to v2 of a core data model. In v1 of the model I had an entity named book with an attribute author. There I saved the first and last name of the author and even first and last names of several authors. Very poor design I know, but that's how it was. In v2 of the model I made...

OSX, static variable sharing same address

In OSX I have the following code. Using gcc 4.0.1. I'm new to OSX development so I'm not sure what other system information would be useful here... static int textstrArgs[] = { 1, 1, 1 }; void func() { static int first = 1; if (first) { first = 0; // stuff } /* other stuff */ } where func() is ...

Launching a program so that it opens in center of the launching application

Launching a program so that it opens in center of the launching application. Platform: Mac Launching mechanism: a c++ program launches using system() Currently I observe the program launched pushes it to left most part of the screen. ...

Mac Vim: How can I change the default text color to be green? Default font? Macvim manual?

I have installed MacVim but I cannot figure out how to do some formatting things. The screen shot below shows: the file class1.jak (custom file type I have defined) open in both macvim and vim the left one is macvim the right one is the terminal Here is what I would like to do: The default color of my terminal is green. I wou...

iPhone sdk for OSX 10.4

On the apple website I can only see offered the iPhone sdk4 which indicates it will only operate on OSX10.6/Snow Leopard. Is this the case? And if so, where can I get the previous sdks so that I can work on my computer with OSX10.4? ...

How to tell Transmission app to not show its window every time the system is restarted ?

I have set autolaunch for Transmission app. Every time, the system is restarted, Transmission shows it's window. Is it possible, to keep it hidden after restart ? ...

p4v getting files as writable

Perforce is downloading files to the external hard-drive connected to my MacBookPro as writable ("777"). It's as if the "allwrite" option is set in my workspace, but it's not. I thought Perforce was supposed to mark the files read-only until I check them out. Is there a setting somewhere I missed? Rev. P4V/MACOSX104U/2009.2/236331 Ma...

What is a good way to rewrite ActiveX functionality?

All of the internal web pages at the place I work were designed and built specifically for IE 6, but now they want me to research what it would take to move to Firefox and Safari and other major browsers... and ActiveX does not work in Firefox. So what would be a good way to take what is currently the ActiveX functionality and totally ...

How to find an FSRef from a directory ID and a volume number?

Given an FSRef of a directory, one can use FSGetCatalogInfo to find the volume reference number and the directory ID. Together, these two numbers should be enough to identify the directory. One way to go the other direction would be use FSMakeFSSpec( vRefNum, dirID, "\p", &fileSpec ) and then FSpMakeFSRef( &fileSpec, &dirRef ). Howeve...

Ellipsizing an NSMenuItem's title to the width of the menu

I want to programatically change an NSMenuItem's title, but ellipsize it so that this modification never causes the menu to increase in width. how can i do this? ...

How do I build Universal binaries (ppc/i386) using Xcode 3.2.2 for OSX?

I am trying to build a universal binary for a project at work, but I can't seem to get Xcode set up properly to do so. I am familiar with the Apple Documentation regarding this, but apparently I am not reading it correctly. The Xcode build options in question seem to be: Architectures Base SDK C/C++ Compiler Version Mac OS X Deployme...

error while compiling dsniff on mac 10.6

I got this error when macport automatically attempted to compile it Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_net_dsniff/work/dsniff-2.3" && /usr/bin/make -j2 all " returned error 2 Command output: /usr/bin/gcc-4.2 -O2 -D...

Mac OSX + Eclipse + Subclipse + SMB - Not able to commit files

I use Eclipse+Subclipse on my Mac to edit a code base that resides on a RHEL5 desktop, via an SMB share connection. Everything works like a charm, except the SVN commit part. A JavaHL exception is thrown on commit, that looks like the following. org.tigris.subversion.svnclientadapter.SVNClientException: org.tigris.subversion.javahl.Cli...

How to interpret a crash report ?

Hi all, I have got a crash report from one of my application's users, who found application to be freezing and then he has to force quit it. I am having trouble to extract information from it which can help me to resolve its cause. Can some one help me to interpret it or can give me some initial push so that I can interpret it my self?...

Permanently removing a JAVA_TOOL_OPTIONS environment variable

I am trying to run jake on OS X 10.6.4 but get the message Narwhal on Rhino requires Java 1.5 or higher. You have JAVA_TOOL_OPTIONS:.-Xmx512m. This is left over from a previous project where someone told me to set it to get Flash to export without dying. I have java 1.6 installed. The JAVA_TOOL_OPTIONS seems to be the issue. I removed ...

Installing Valgrind on OS X

Hi, I'm trying to install valgrind on os x (snow leopard/10.6.3). When I run the provided ./configure script I get an error saying: checking for the kernel version... unsupported (10.3.0) configure: error: Valgrind works on Darwin 9.x (Mac OS X 10.5) Has anyone else had experience with this? Can I just delete that line in the config...

Find Longest Line in a .txt File and fill all Lines to that Length with 'blank Spaces'?

How can I find the longest line in a .txt file and then fill all other lines at their end to that length with blank spaces? My guess is this is easy to answer. I know very little about using the awk, paste command and such. Maybe someone can help me out. Thanks! A little more specific... so far I can do the following. This would get th...

How to create an inaccessible window on Mac OS?

I mean a window which will not be accessible via Cocoa, Carbon or other CoreGraphics API for obtaining NSWindow *, WindowRef and others. Like X11 application on Mac does. Such a window that if you pass its window ID to [NSApp windowWithWindowID] or HIWindowFromCGWindowID() they both return NULL. Thanks! ...

Faking an NSTextField using an NSTextView to get nice coloring?

Trying to change the selected text background color for an NSTextField (we have a dark UI, and selected text background is almost the same as the text itself), but only NSTextView seems to allow us to change this. So we're trying to fake an NSTextField using an NSTextView, but can't get text scrolling to work the same. The closest we g...