osx

SWIG - Problem with namespaces

I'm having trouble getting the following simple example to work with SWIG 1.3.40 (and I also tried 1.3.31). The Foo structure comes through as a Python module as long as I don't wrap it in a namespace, but as soon as I do I get a compilation error in the generated test_wrap.c. test.h: #ifndef __TEST_H__ #define __TEST_H__ #define USE...

For business, which OS is more secure: Windows 7 or OSX 10.6?

I've seen the outcomes of certain hacking competitions yield varied results and the argument over which OS is currently more secure has never seemed to go beyond an anecdotal level. I currently split my development (PHP, MySQL web applications which handle sensitive transcript information, among others) 50% between OSX Snow Leopard and ...

iPhone + OSX targets on the same project

I created a project with two targets, one for iPhone and another for Mac OsX. They both build and run well when I build them the first time (I built the OsX target first then iPhone target next). However, if I build the iPhone target and switch back to OsX target, the OsX target now thinks that it uses the iPhone SDK rather than it's ow...

Get a string representation of Constant or Enum in IOKit, possible?

Hello, Is there a way to get a string representation for the Constants and enums defined in IOKit? I making a forage into IOKit and trying to console log out some parameter which USB devices return. But I'm ending up with lists of numbers. Is there another way to list what these mean? For example in IOHIDKeys.h enum IOHIDElementType ...

What program can I use to create and edit json files?

I'm using osx and want to create and edit json files. Is there a program that I can use to do this automatically? For example I have an excel file that I want to convert into JSON format. I thought I could read in the file using python and write it out according to the json schema, but I was not sure if there was an easier way to do it....

MacOSX Promised files drag&drop howto?

It's not clear to me how to do drag&drop to Finder with dragPromisedFilesOfTypes:fromRect:source:slideBack:event: (NSCollectionView) I call the above method from mouseDown:, but(NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination isn't called at all. Any ideas how this should work (MacOSX 10.6, project compiled ...

Trouble sharing textures with OpenGL/Cocoa

I am a bit of an openGL novice and I am trying to get texture sharing to work between two openGL views. I created two NSOpenGL view classes and then in the interface builder I created a window that had one of each openGL view. The first view has code in its prepareOpenGl that sets up the texture and assigns it to a global variable, the...

zip archive from a directory tree but only include files with extensions xx1,xx2,...?

What's a combination of commands on MacOS that'll start at the root of some directory tree and create a zip file archive of it, preserving directory structure, but only including files with extensions "ext1" and "ext2"? ...

Possible to configure OS X VPN to split traffic between VPN and local interface?

I'm using the built-in OS X VPN tool to connect to my company's network. I notice that, when I'm connected, all traffic goes over the VPN. In the past when I've used the Windows VPN tool I was able to configure it such that only traffic to certain IP ranges and/or host names went over the VPN and everything else went over the local net...

Cocoa animations using CATransition in a single view

I want to use CATransition to provide a fading animation between different states of a view. However, this doesn't seem to work with a single view (all examples I found use CATransition to switch between different views). In contrast, a CABasicAnimation works just fine. My example code shows what I'm doing. I have a custom view (TTVi...

Why can't I use Cocoa classes from my Python script?

Today is the first time I've used Python, so I'm sure this'll be an easy question. I need to convert this Python script from a command line application: webkit2png. The end result will be a URL that returns an image of the webpage passed into it as a querystring param. I've achieved this on Windows with .NET and IE, Gecko and WebKit, bu...

Making a another applications's window frontmost and focused

I've been trying to get any given window from another Application to become front most and focused. Here are the two methods I have tried: AppleScript tell application "Safari" set index of window "Downloads" to 1 activate end tell Why it doesn't work: While it seems to change the z-Order, it doesn't change the focus! The prev...

Installing OpenCV on OSX 10.6 using MacPorts

Hi, I tried installing OpenCV following the instructions for a MacPorts install on http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port, typing sudo port install opencv in the terminal. The install/compilation seemed to go fine, and the files are in /opt/local subdirectories as they should be. As a first test, I then tried inclu...

NPN_ScheldueTimer call brings firefox to crash (Mac OS X)

How I use it: NPNetscapeFuncs* NPNFuncs; // ... timerID = NPNFuncs->scheduletimer(GetNPPInstance(), Interval, 1, Function); At the same time, my plugin work properly both in Safari and Google Chrome. Firefox version: 3.6.9 Mac OS X version: 10.6.4 Crash report: http://crash-stats.mozilla.com/report/index/d1b471c6-4a03-...

Simulating sendmail with dummy script

Hey all, I created a small shell script which logs all of it's input to a log file, with which I had thought I could replace the sendmail binary and thus achieve a simple way to simulate e-mail delivery without actually setting up a working sendmail. This failed, however. For reasons I cannot understand. I've looked at the PHP mail.c ...

Problems compiling TCC on OS X...

Has anyone successfully compiled TCC on OS X? From what I know it should be possible but when I run make I get the following error: $ make gcc -o tcc tcc.c -DTCC_TARGET_I386 -O2 -g -Wall -fno-strict-aliasing -mpreferred-stack- boundary=2 -march=i386 -falign-functions=0 -Wno-pointer-sign -Wno-sign-compare -D_FORTIFY_SOURC...

Upgrading Python in Virtual Env

I have python 2.6.1 installed on Mac OS X. I wanted to play around with python 3.2, so i created a virtual enviromant using virtualenv python3.0 and then activated it using source python3.0/bin/activate if I update the python in the virtualenv will it leave my system python untouched? If yes, do I just install python 3 using pip in...

Lighttpd + fastcgi + django: truncated response sent to client due to unexpected EOF

I'm trying to get my Django based webapp into a working deployment configuration, and after spending a bunch of time trying to get it working under lighttpd / fastcgi, can't get past this problem. When a client logs in for the first time, they receive a large data dump from the server, which is broken into several ~1MB size chunks that ...

Installing Intel's TBB 3.0 framework on MacOS 10.6 (Snow Leopard)

Hey guys, I'm having a bit of trouble installing Intel's Threading Building Blocks (TBB) 3.0 as a framework on my MacOS system. Does anyone know a good tutorial? I've tried using MacPorts, which has TBB 2.2: it installs all the libraries I need, but I don't get a framework. Also, there doesn't seem to have any .dmg installation file on ...

Loads an image from the given NSData of specified format(JPEG).

Previously I ask a question "How to convert data to JPEG Format?" and solution of this is: NSImage * strImage = [[NSImage alloc]initWithContentsOfFile:imagePath] ; NSData *imageData = [strImage TIFFRepresentation]; NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:imageData]; NSNumber *compressionFactor = [NSNumber numberW...