osx

Connect to a remote sqlite3 database with Python

I am able to create a connection to a local sqlite3 database ( Using Mac OS X 10.5 and Python 2.5.1 ) with this: conn = sqlite3.connect('/db/MyDb') How can I connect to this database if it is located on a server ( for example on a server running Ubuntu 8.04 with an IP address of 10.7.1.71 ) , and is not stored locally? e.g. this doe...

How can I create an OS X Snow Leopard in Windows Virtual PC?

I am a windows dev, but I have recently found that I need to create a rich app that is platform agnostic. After a few proofs of concept trials, I am electing to go with Silverlight because is based in WPF, and I am moving my windows development in that direction, so the two will dove tail each other. My latest project requires that I su...

How to add multiple menu items with the same title to NSPopUpButton(NSMenu)?

As docs say it's impossible to add two menu items to NSPopUpButton if they both have the same title. I was trying to add menu items to [popupButton menu], but with no luck. I was also trying to create a new menu, add items to it and then use [popupButton setMenu:newMenu], but no. Menu always display only one item per name. But I know it...

Does Snow Leopard put core dumps somewhere special?

I'm trying to debug a segfault on an application I'm working on (works on linux of course, so I can't use that as my fallback for debugging core dumps). Anyhow, I've set "ulimit -c unlimited" and snow leopard reports "Segmentation fault (core dumped)" but alas there is no core file to be found. Does Snow Leopard put them somewhere spe...

How to compile with --pedantic-errors on OS X?

Here's a simple C file: #include <stdio.h> #include <stdlib.h> int main() { printf("hi there!\n"); return 0; } Compiling with gcc -ansi -pedantic -pedantic-errors gives this: In file included from /usr/include/i386/_structs.h:38, from /usr/include/machine/_structs.h:31, from /usr/include/sys/_struct...

Variations of sed between OSX and GNU/Linux

Hi all- I've got a makefile (developed for gmake on Linux) that I'm attempting to port to OSX, but it seems like sed doesn't want to cooperate. What I do is use GCC to autogenerate dependency files, and then tweak them a bit using sed. The relevant portion of the makefile: $(OBJ_DIR)/%.d: $(SRC_DIR)/%.cpp $(CPPC) -MM -MD $< -o $@ ...

Open window of an application and move it to a different Space in OSX, is it possible?

Hi, for some application I would like to have an "instance" of it running in Space (Apple's workspace) 4 and another one in number 2. How can I somehow tell (in bash/applescript or whatever) to an instance of an application, to "move" to Space number N? Applescript? Bash? External app? I want to do this automatic and for a lot of diffe...

In CoreAudio, what are the pros/cons of setting kAudioDevicePropertyBufferFrameSize?

When recording from a microphone in CoreAudio, what is kAudioDevicePropertyBufferFrameSize for? The docs say it's "A UInt32 whose value indicates the number of frames in the IO buffers". However, this doesn't give any indication of why you would want to set it. The kAudioDevicePropertyBufferFrameSizeRange property gives you a valid mi...

OpenMP with OpenCV on OS X

I'm having a problem getting OpenMP and OpenCV to play nicely with a new project in Xcode. The project in its current state does nothing but grab frames from the default camera and put them into a window. This functionality works. However, I would like to grab the frames in a separate thread, and I was hoping I could get some experience ...

Mac OS X SIGBUG in PostgreSQL JDBC Driver

I am trying to run an application which has worked fine for awhile, and now when I try and run it on Mac OS X, I get SIGBUS. I can't figure out why. This is also printed on the console: Invalid access of stack red zone 0x100401730 rip=0x115ae088e If I turn off PostgreSQL, it fails with connection failed. Current thread (0x000...

dylib on Snow Leopard "file is not of required architecure"

I have compiled opencv on snow leopard and it says it compiled correctly, however when I try to compile my sample program against it, I get output like: g++ -o tm_scons template.o -L/opencv/opencv/build/lib -lcxcore -lcv -lcvaux -lhighgui -lml ld: warning: in /opencv/opencv/build/lib/libcxcore.dylib, file is not of required architecture...

PackageMaker for creating Mac packages on Windows/Linux

We need to build Mac packages on the fly and it would be convenient if there is a way to create the same on Windows or Linux platform instead of using PackageMaker on Mac. Any ideas? Thanks! ...

"No source available for main()" error when debugging simple C++ in Eclipse with gdb

Hi, I'm having trouble debugging a C++ program in Eclipse (the latest RC of Helios, updated with latest CDT from within itself) on OSX. The program is very simple (esentially Lesson 2 from NeHe's OpenGL tutorials), consisting of one cpp file and, using OpenGL and Cocoa frameworks, and linking with libSDL.a and libSDLmain.a. The struct...

How can I pass object to Eric Martin's OSX modal?

From my jsp I have something like <table> <tr> <td>${event.name}</td> <td>${event.type}</td> <td>${event.dateString}</td> <td>${event.virtualMachine.name}</td> <td><a href="#" class="osx">View event</a></td> </tr> </table> I want to pass the event object to the modal content such that It will display more informati...

IOError opening an existing file with Python

Running the following code: import os import datetime import ftplib currdate = datetime.datetime.now() formatdate = currdate.strftime("%m-%d-%Y %H%M") def log(): fqn = os.uname()[1] ext_ip = urllib2.urlopen('http://whatismyip.org').read() log = open ('/Users/admin/Documents/locatelog.txt','w') log.write(str("Asset: %s...

g++ fails mysteriously only if a .h is in a certain directory

I'm experiencing an extremely weird problem in a fresh OSX 10.4.11 + Xcode 2.5 installation. I've reduced it to a minimal test case. Here's test.cpp: #include "macros.h" int main (void) { return 1; } And here's macros.h: #ifndef __JUST_TESTING__ #define __JUST_TESTING__ template<typename T> void swap (T& pT1, T& pT2) { T pT...

looking for a better way to activate and deactive background of text fields in my GUI (Cocoa OSX)

I have a small gui app that consists selectable groups, each groups has a disclosure button to display its sub-group, an image and a text field. When you are editting a text field and select another group or another text field I want to end editting on the old text field. Also, I only want the background of a text field to be display w...

Is it possible to open custom URL scheme with Google Chrome?

I have protocol (like http) with scheme managed with 3rd party App registered in Mac OS X. I.e, x-someapp://someaction or something like that. How can I open this URL with Google Chrome? By default, Chrome starts searching in Google engine instead launching App and passing URL handling to it... Safari launches some registered App. And ...

Perform a batch of queries on a set of Shark performance logs?

I've been using Shark to benchmark a (very large) application and have a set of features I drill down into each time (e.g., focus on one function and remove stacks with particular others to determine the milliseconds for a particular feature on that run). So far, so good. I'd like to write a script that takes in a bunch of shark session...

Strange behavior due to wx.Frame.SetTitle

In a wxPython application, which i am porting to Mac OSX, I set title of app frame every 500msec in update UI event, and due to that all the panels and windows are refreshed. That seems strange to me and almost halts my application which has many custom drawn controls and screens. I wanted to know what could be the reason behind it, is ...