osx

NSTextView - using initWithHTML with tables

Hi, I'm trying to format some text in NSTextView to be placed in a single line with black background. One piece of text needs to be left aligned, the other piece (but still in the same line) needs to be centered. NSString *header = [NSString stringWithFormat: @"" "<table style=\"width: 100%; background: black; " ...

mac os x 10.6.4 launchd cron job stops after 2 days

I have a mac mini os x 10.6.4 which I use to host a web app for private use only. For certain functionality I needed a cron job so i used lingon (http://lingon.sourceforge.net/) to setup a launchd cron job - this creates a plist file in the following folder /library/launchDeamons folder. the job it self is just "curl -s localhost/api?met...

MacOS X TrueType fonts with X11

Is there a simple way to install TTF fonts on macos X so that they work with X11 (and Gimp) ? ...

Including other libraries / files / plugins with nodejs and NPM

I'm using OSX 10.5 and playing around with Nodejs. I've managed to install npm and used it to install a couple of plugins. Well at least the installation says it has worked fine but when I try and load them in I get an error $npm install htmlparser Installs ok, then I create a file called test with var htmlparser = require("node-htm...

Custom USB Driver for Windows? Mac?

I'd like to modify a USB driver to send and receive USB data over a network. Take for example, an iMac and a PC. I have an iPod plugged in to my PC (in NY). I want my iMac (in LA) to recognize the iPod as plugged in to a local USB port and be able to communicate with the iPod. Forget my qualifications, or lack thereof (I have backgroun...

iterm vim colorscheme not working

When I run vim from the commandline in iterm, syntax highlighting doesn't seem to work locally. In vim for example I have installed a nice colour scheme that works quite well in MacVim but it would be great if in iterm it showed the same one. Any ideas how i can turn this on? This is the color scheme I'm trying to use http://www.vim....

Mac OSX 10.6.4 - postinstall/postflight scripts fine in single pkgs but not in metapkgs

Hi all, I'm new to Mac OSX dev, and I'm having trouble with building a metapackage. I have 7 pkgs which I want to wrap up into a metapkg. When I executing each package separately everything works as expected, all scripts run etc. However, when the same packages run as part of a metapackage, none of the scripts execute. The scripts a...

Printing from mono on OS X

I am pretty new to the platform, but I would like to know if anybody tried printing from a Mac using the Mono framework? Seems like the internal namespaces that are usually used to print on other platforms are not fully implemented (System.Drawing, System.Drawing.Printing) so does anybody know of a better way to do printing? Or is MonoM...

Slow face detection on OpenCV ?

Hi, I compiled and installed OpenCV (last version from the SVN) on Mac Os X (this is maybe the source of the problem). The sample works, but the face detection algorithm seems slow to me. The detection time for a face is around 400ms (I just used the example included). The FPS is then quite low. On youtube and all, I see super-smooth ...

Page faults on OS X when reading with MMAP

I am trying to benchmark file system I/O on Mac OS X using mmap. #include <unistd.h> #include <fcntl.h> #include <dirent.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/mman.h> #include <stdio.h> #include <math.h> char c; int main(int argc, char ** argv) { if (argc != 2) { printf("no files...

Command+W Support in wxPython

It's my understanding that in wxPython in OSX, ⌘+w support for closing wx.Window objects. In order to add it, I've had to bind to wx.EVT_KEY_DOWN, checking for event.MetaDown() and event.KeyCode == 'W' explicitly. In my app, I need to have all windows and dialogs support this. I'm still in the process of layout out my GUI, but I got to ...

Programmatic access to Mac OS X system performance statistics?

When you run top or Activity Monitor on OS X, you see a variety of performance data for the whole system - current and historic CPU usage, physical memory and swap space usage, disk activity, and so on. On Linux and some other Unixen, you can access this data in your own programs using syscalls or looking in the /proc and/or /sys pseudo...

Where does a cocoa app main() function go?

I'm trying to build a super-simple Cocoa app, basically one that has one function (for example, main()) with a while loop. It does some stuff, does a curl request, then waits a few seconds before starting over. I've got my project all setup in XCode with all the necessary variables and functions, but I don't know where to put my main() ...

OS X 10.6.4 + Eclipse 3.5 + latest CDT not outputting cout/printf to console.

I spend most of my time in Eclipse these days, so I thought I would check out what Eclipse's C++ support was like (I usually use Xcode on Mac and Visual Studio for Windows). I found the CDT package for Eclipse 3.5, so I installed it. Everything installed properly and the default C++ "Hello World" project compiled nicely, however for th...

Interface Builder Plugin Custom NSView Dragging

I have created a simple custom NSView (plugin item) When i do resize my NSView in interface builder - everything displays normally (black rect) But when i drag NSView to reposition it, nothing is displayed. What method should be implemented to fix this issue? -(void)drawRect:(NSRect)dirtyRect { [super drawRect:dirtyRect]; [NS...

NSIS installer (on OS X) gives 'Invalid command: TargetMinimalOS'

I built NSIS 2.46 on my OS X computer according to the instructions provided at http://nsis.sourceforge.net/Docs/AppendixG.html#G.3. The build worked fine and it correctly creates my installer. My installer is fully working, but I tried to add the command: TargetMinimalOS 5.0 This isn't essential to my task; as I understand it, all i...

Secondary click toggle in OS X

I'm trying to write a program that serves to toggle a secondary click for a one button HID (in this case a touch screen). What I want to do is have the user touch a button on the screen that makes the next touch a right click. I simply don't know where to begin on this. I began by looking to Applescript, but found that this is impossible...

Can I get an automatic dump of unfree'd memory on Mac OS X process completion when running under gdb?

On Windows, I've long been used to the debug CRT's _CRT_LEAK_CHECK_DF functionality. When the program finishes, and once all the atexit callbacks and (in C++) global destructors have been run, it prints out a list of all the still-allocated malloc and new blocks. This is pretty crude, and the output isn't actually terribly useful, but it...

Modifying shutdown script

I'm looking for the location of the system script that calls /sbin/shutdown. I want to change the flags so when the machine is shutdown from the finder, it halts the machine, but doesn't power off. Alternately, I'd like to force the setting that "Start up automatically after a power failure" checks on power applied to start the machine ...

Mongodb and MAMP

I am using MAMP and would like to use mongo with PHP. I am stuck because the version of MAMP I'm using is the latest version I can find, and it's running PHP 5.2.11. The only Mongo PHP install I can find for OSX is for PHP 5.3. Is there any way to get mongo working with PHP using MAMP? ...