mac

check CPU type at RUN time for C program on MAC

How does a C program determine, at RUN time (not compile time), whether it's running on Little-Endian or Big-Endian CPU? The reason why it must be "run-time" check, not "complie-time", is because I'm building the program in MAC OSX's Universal Binary format, using my MAC with Intel-CPU. And this program is expected to run on both Intel...

64-bit Java VM runs app 10x slower

I have a Java app which is packaged up using JarBundler. The app is fairly CPU intensive (lots of big Collection.sort() calls). On Mac OS, the app runs slow and sluggish when using the 64-bit JavaApplicationStub. This JavaApplicationStub file is launching the Java 64-bit VM. I found an old JavaApplicationStub file which is 32-bit onl...

How do I uninstall Python 2.5?

I recently upgraded to Mac OS 10.6 and didn't realise that it shipped with Python 2.6. I installed Python 2.5.4 and now it is the default Python installation. Can I uninstall Python 2.5.4 and keep 2.6? ...

mysqldb build error

i remember installing Python + Django + MySQL + MySQLdb on my 32-bit Mac with Leopard 10.5.7. I tried the same procedure with Mac Snow Leopard. But have unfortunately ran into a lot of errors... i dont know but something weird is happening. Please look at the error log: Amit-Vermas-MacBook:mysql-python-1.2.2 amitverma$ python setup.py b...

Remove project from SCM in Xcode

I have an iphone project on a mac. I set up an SCM repository and then ignored it for a while. Now I've decided to back up my source to my main PC and do source control there. I'm finding that the SCM wants to roll back my changes seemingly at random. How can I kill SCM in Xcode on the mac? I need to tell it to leave my source files ...

Non-Admin Developer on Snow Leopard

I use a standard user account for my daily tasks on Mac OS. Since upgrading to Snow Leopard I am asked to do the following when a program is run from within Xcode: "Type the name and password of a user in the 'Developer Tools' group to allow Developer Tools Access to make changes" While I know the admin username/password, this is annoy...

"Overwrite Project Package" option in PackageMaker — What does it do?

PackageMaker's Project menu contains an "Overwrite Project Package" option. I can't find any documentation of this option, nor any references to it online. Does anybody know what its function is? ...

Restore app from dock

Hello I'm new to programming desktop applications for Mac (though a have a small experience with programming for IPhone). Suppose I create a new Cocoa project in XCode. This application does nothing just shows its window. I click on the cross in the red circle and my app minimizes to the dock and it has a blue dot on its icon showing t...

Compiling for both Intel and PPC CPUs on OSX

I have a MacBook Pro with a 64-bit Intel Core 2 Duo processor, and I'm using gcc (i686-apple-darwin9-gcc-4.0.1) to compile executables which I can run ok on my own machine. Recently someone tried to run my application on a PowerBook G4 and got a 'Bad CPU type in executable' error, which I think is because their CPU is PPC rather than Int...

Check if Screensaver is Active using Mac Bash Script Command

I've found many useful Bash commands that can execute OS X behaviors from the command line such as: screencapture -x -C $FILENAME Is there such a command that can check if the screen saver is active? ...

Merging tag into trunk with Subversion

I have this folder structure: \myproject\branches\v1.2 \myproject\trunk I need to merge v1.2 back into trunk. v1.2 has revisions 104 and 105. Trunk goes from 57-65 and 106. The 106 revision is deleting a folder that doesn't exist in the v1.2 folder. My setup is file based. I've tried this in trunk: MacBook:trunk myuser$ svn merge...

Finding out if a Window is being Dragged

I am trying to write a program that requires to know if a window is being dragged (moved around). The catch is that it's not the program's window, but rather any window in the OS (eg. Safari, iTunes, Adium, TextMate, etc.), and what program it belongs to I was thinking AppleScript would be a potential way to do this, but there doesn't s...

localhost working 127.0.0.1 broken in Safari

I'm running an http server on a non-standard port on a Mac Powerbook G4 running OSX 10.5.8 and attempting to open a page in Safari 4.0.4. When I use the IP address 127.0.0.1 in the url Safari shows an error: Safari can’t open the page “http://12.34.56.78/” because the server where this page is located isn’t responding where the IP ...

Developing GUI projects with MonoDevelop on Snow Leopard

I just installed MonoDevelop on my Mac (Snow Leopard). I'm a .NET developer, but have no Mono experience. I want to create a simple GUI app, but there doesn't seem to be a Gtk# 2.0 template under C#. There's one under VB.NET. I've installed the latest MonoTouch-enabled release (as I may want to try MonoTouch in the future). Should I ...

Ad Hoc Wifi Connection Between iPhone & Mac - Possible?

Hey guys, I was just wondering if it is possible to set up a data transfer tunnel between an iPhone and a Mac using the Wifi hardware present on both devices? My main objective is to transfer data from my iPhone to my Mac through an app along an ad hoc wifi connection. If there are any other methods you would like to suggest, then pleas...

Why do I not get strcpy errors on the Mac while I do on Windows?

-- All of the revised code still refuses to run well, please help -- When I compile my code in Windows, I get memory errors. However on the Mac, where I initially coded this code, it works fine. I need to get this working on Windows. It's something to do with the way I handle my char strings using strcpy that the Mac seems to be fine w...

AppleScript to take text and turn it into pasteable HTML

Hi all, We work with bugzilla. Whenever you need to query a ticket you just need to know the bugid (integer) and you simply prepend this to it. http://<bugzilla_server>/bugzilla/show_bug.cgi?id=<bug_id> Suppose I have a bug link which looks like this 777. If I select and copy this it is preserved on the pasteboard so wh...

Does FlexBuilder 3 work with Eclipse 3.5.1?

I m trying to install Flex Builder 3 into Eclipse 3.5.1 as a plugin on Mac 10.6.2. During the installation phase, FB3 says it only support eclipse 3.3 & 3.4. But I started the installation anyway. After the installation was done, I can't find Flex perspective from Eclipse. So I google around and found out the possible way to manually ...

Detecting attached USB devices under Mac OSX

Hello, First of all a statement: I'm a newbie when it comes to programming for the Mac. However I have an assignment which requires USB communication with a device so I thought I'll start with something basic. I took the code from here, built it and ran it from the Terminal. It starts up and writes: Looking for devices matching vendor...

Cocoa PDFKit Unlocking Encrypted Files

Hi all I have a PDF document that has an owner password set but no user password. Therefore it is encrypted. I know the owner password and want to use PDFKit to confirm when the document has been decrypted. I have used the PDFDocument unlockWithPassword method which returns YES when the file is unlocked. However this method also retur...