osx

Why is this sed RegEx expression chopping off digits in certain circumstances?

sed -e 's/ *-\{0,1\},\{0,1\} *[Pp][Aa]\{0,1\}[Rr]\{0,1\}[Tt].\{0,1\} *\([0-9]\{1,\}\) *$/ (\1)/' I'm piping titles through this from an iTunes AppleScript. This should convert any title with a Part designation at the end to a parenthetical format For instance, Best of Both Worlds, Part 2 becomes Best of Both Worlds (2). The trouble r...

Coverflow for mac os

Hi all. Is their any apple sample code to implement coverflow in MacOS. Apple core animation documentation shows example of coverflow. But I could not find related sample code. Parden me if I overlooked. -Thanks in advance shakthi ...

How to use an Applescript app bundle as the default browser in os x ?

My goal is to make it so that links clicked on one osx machine are loaded into safari on a remote computer with apple events enabled. To do this, I am trying to create an applescript application which i then make the default browser on the system. My applescript looks like this: on run argv set theurl to item 1 of argv set dest...

What is the equivalent of "aptitude" in Mac OSX?

How to do "sudo apt-get install " on OSX? ...

What does NSPOSIXErrorDomain mean (iPhone)?

Hey Guys, I am trying to use the ASIHTTPRequest libraries to simulate a form post and gather the resulting cookies; however, when I am running the post, I get an error. I have traced through the request and narrowed it down to a NSPOSIXErrorDomain error. The site I am trying to connect too is an HTTPS: site and this error makes me th...

Is there any way to get ps output programmatically?

I've got a webserver that I'm presently benchmarking for CPU usage. What I'm doing is essentially running one process to slam the server with requests, then running the following bash script to determine the CPU usage: #! /bin/bash for (( ;; )) do echo "`python -c 'import time; print time.time()'`, `ps -p $1 -o '%cpu' | grep -vi ...

Displaying progress indicator inside an NSSearchField

I am using a NSSearchField to run a query over the internet and display the results in a table view. Whilst the query is running I would like to display a progress indicator inside an NSSearchField? I think I have seen this done in another application before. Is there an open source component that I could use to accomplish this? How wo...

Validating file paths

We want to validate file paths, e.g. foo/bar, which the user can enter. Is it possible to create files with leading or trailing space on OS X or Linux, e.g. foo/ bar /bazz? ...

Running an Rscript on Mac OS X

Hi All, I have a BATCH File script on a Windows machine that consists of the following line: c:\R\bin\Rscript.exe "c:\Users\user\Documents\Shares.R" I want to do the same thing but using Mac OS X at the moment I am using Automator => Run Shell Script and the following line: open "/usr/bin/Rscript" "/Users/usr/Documents/Shares.R" ...

Reserve memory on OS X

Hey, What's the equivalent to Windows's VirtualAlloc in OS X? That is, how can i reserve a contiguous address space without actually commiting it and then commit chunks of it later? Thanks, Alex ...

Why doesn't jEdit work with the 'open' Unix command?

I recently installed jEdit on my Mac OS 10.6 system. I would like to be able to run jEdit in the terminal as I would emacs, i.e. 'emacs FILE.NAME'. My plan was to write a script jedit.sh containing... touch $1 open -a /Applications/jEdit.app $1 ...where the argument is the filename. Strangely, jEdit is opened but only with the default...

Dragging pasteboard is nil when remote debugging from Xcode

I'm writing an app that needs to work in both 10.5 and 10.6 (We still have PPC machines). My development machine is 10.6.4 with Xcode 3.2.3, and I have a 10.5.8 machine with Xcode 3.1.2 on it. I use remote debugging to test out the app on the 10.5.8 machine, and I've run into a problem with a Drag and Drop method that only occurs when r...

Slow down playback speed?

How can I slow down an audio file (for playback only) on Mac OS X, but preserve good quality? I tried using QTKit to slow down audio but the quality is bad. Edit: I'm using this code: QTMovie *audio = [[QTMovie alloc] initWithFile:mediaClipURL error:&error]; // ... (error handling) [audio setRate:0.5]; ...

Linux as a guest on MacOS X: VirtualBox or Parallels?

I'm going to develop mostly Django sites on a MacBook Pro and would like to use Ubuntu VMs for testing purposes. Which product is better suited for this purpose? Can I connect to the VM via TCP/IP (so I can have apache running on the VM and access it from Safari on my MBP)? Thanks! ...

OS X transparent panels in Qt?

Is there a way to create a transparent panel as described by the Apple Human Interface Guidelines in Qt 4.6 (built for OS X 10.6/Cocoa)? If not, are there any alternatives similar in look and function? I understand that Qt is a cross platform toolkit, but I want my application to feel as »native« as possible… ...

Sorting words in lines in a file and output sorted lines again

I want to sort the words on lines in a file line by line and I want the ouptut to be lines with the words sorted alphabetically. for example: queue list word letter gum another line of example words ... I want the output to be: gum letter list queue word another example line of words ... I can't seem to get it to wo...

Is it worth developing support for OSX 'services' (does anybody ever use it?)

Mac OSX has this feature called (I think) 'Services'. It is available in the menu bar under the filename of the application (e.g. Finder) and then selecting 'Services'. This gives you access to a list of applications that provide 'services'. For example, if you are browsing a website with firefox and you have some text selected on the pa...

Set cursor position in Mac OS

Hi, I want to write a little vnc similar program that moves the Mac OS cursor to a position (x, y) given through a protocol which gets data from Bonjour service. The problem is that I don't know how to move the cursor! I'm working with Cocoa. Thanks for help! ...

What's the difference between 'Day' and 'Weekday' in launchd StartCalendarInterval?

I'm working with launchd to run some automated tasks, and I was wondering what the difference is between 'Day' and 'Weekday'. According to http://discussions.apple.com/thread.jspa?threadID=1361809 there is a 'subtle' difference that can cause launchd to misbehave. Ultimately, I'd like to have a plist that runs every weekday (Mon - Fri...

Bash script absolute path with OSX

I am trying to obtain the absolute path to the currently running script on OS X. I saw many replies going for readlink -f $0. However since OS X's readlink is the same as BSD's, it just doesn't work (it works with GNU's version). Any suggestions for an out of the box solution to this? ...