osx

Upgrading to Ruby 1.9 on Mac OSX 10.4

I have an older powerbook running 10.4. It has Ruby 1.8.2 on it but I want to upgrade to 1.9. Other people suggested using macports and I tried it but am getting some weird errors. Can anyone assist? sudo port install ruby19 +nosuffix ---> Computing dependencies for ruby19 ---> Configuring gperf Error: Target org.macports.configure r...

How does one configure XTerm on Mac to correctly interpret nulls in man output?

Using XTerm, ssh to a linux box and run this: $ man ascii | grep BEL 007 7 07 BEL â\aâ (bell) 107 71 47 G Do the same from Mac Terminal: $ man ascii | grep BEL 007 7 07 BEL ’\a’ 107 71 47 G od output of above: $ man ascii | grep BEL | od -ta 0000000 sp sp sp sp ...

Detecting debugger on Mac Os X

Hi, I am trying to detect whether my process is being run in a debugger or not and, while in Windows there are many solutions and in Linux i use ptrace(PTRACE_ME,0,0,0) and check its return value, i did not manage to perform the same basic check on Mac Os X. I tried to use the `ptrace(PT_TRACE_ME,0,0,0)` call but it always retu...

How do I access my classes from the python console on MAC OSX?

I'm trying to access my classes via from project import * But from the python console something seems to be off with the paths. How do I set the correct paths to my project so I can import classes? My models are stored in: /Users/username/project/project/model from project import * And the error reads: ImportError: No module...

Apple Carbon/CoreFoundation style guide?

Cocoa is well-documented and there is a lot of information on writing Cocoa code in good form. I'm working on some code that works closely with hardware, requiring me to use CoreFoundation and Carbon APIs often. Is there any sort of 'style' guide for understanding libraries such as Carbon and CoreFoundation from Apple? Apple's example...

Problem using yaml-cpp on OS X

So I'm having trouble compiling my application which is using yaml-cpp I'm including "yaml.h" in my source files (just like the examples in the yaml-cpp wiki) but when I try compiling the application I get the following error: g++ -c -o entityresourcemanager.o entityresourcemanager.cpp entityresourcemanager.cpp:2:18: error: yaml.h: ...

Strange compile error: conflicting types / previous declaration are identical

Hello, I am trying to compile a static library on OSX 10.5 that links to a library that includes . The error message I'm getting is confusing because the conflicting type apparently conflicts with itself. Compiler message: In file included from /usr/local/include/jasper/jas_math.h:79, from /usr/local/include/jasper.h...

What is the `pwd` of a Mac bundled app?

I'm running a GLFW app (that I wrote in C++) I run it as follows: ./prog.app/Contents/MacOS/prog # from the command line However, my code can't read relative-pathed files properly. So I believe what's happening is that this Mac Bundle is changing my current directory. 1) what does it change it to? 2) can I control this? Thanks! ...

Validating input in NSOpenPanel accessory view

I would like to solicit additional information from the user during the NSOpenPanel but need to validate that information before the open panel completes. For example, I may want to allow the user to add a note about the file in the open panel selection but need to validate that that comment is not empty. I have an accessory view whose ...

Remove all spacing in QGridLayout

I'm trying to build programmaticaly (with Qt 4.6) a window containing a series of QPushButton's, all packed together. It should look like so (which I call a toolbox): So, I created a Toolbox class, deriving from QWidget, that has the following constructor: Toolbox::Toolbox (void) : QWidget (0, Qt::Tool) { setWindowTitle (tr ("Too...

OS X Data Storage in PLIST Example or Tutorial?

I have looked for several hours for a good tutorial on how to store data for my command line program that I am writing in Objective-C. It seems like my options are NSUserDefaults, Plists, sqlite, or XML. Now, I think at most I'd have 50kb of data to store, retrieve, and modify, so it seems like from what I read Plists would work just f...

sortUsingSelector Not Sorting an NSStrings Array

This is confusing to me. I have a function that does this: void ListAllStoredLocations(NSString *SearchTerm){ NSMutableDictionary *item; NSString* filePath = [[NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingString:@"/Preferences/yourprogram.plist"]; item = [[[NSMutab...

Strange artifacts after CILanczosScaleTransform

Hello, I'm trying to do image scaling using Core Image, using Lanczos Scale Transform filter. It is fine when I'm doing scaleup. But on scaledown and saving to JPEG I found a class of images which produces strange noise artifacts and behavior. For inputScale multiples to 0.5: 0.5, 0.25, 0.125 etc it is always fine. For others input...

How to enable full coredumps on OS X?

It looks that OS X (10.6) does not generates codedumps by default. Using the ulimit -c unlimited is not a good solution because ulimit does set the limit in an environment variable. This will work only for console applications executed from the shell that executed ulimit. If you have a gui application this will not work. ...

How to speedup xcode builds without any project modifications?

Last version or XCode (3.2.1) is running very slow on OS X 10.6. What kinds of tweaks can you do to your Mac in order to speedup Xcode build process. I'm not looking for general hints like how to restructure your projects, just tweaks that are related to environment. For example I remember that on Windows for Visual Studio two signi...

Python Build Problem on Mac OS 10.6 / Snow Leopard

I'm encountering a build problem for Python 2.6.4 on Snow Leopard. Mac OS X 10.6 Yonah CPU, 32-bit gcc-4.2.1 Update I Solved by removing all non-standard includes and libraries from CFLAGS (there happened to be a uuid/uuid.h in there ...). Still, it compiled despite the error describe below, with /usr/include/hfs/hfs_format.h:765 ...

How to dump out an array of pixels as a png ?

I'm on MacOSX. I have read out an image, as char image[WIDTH][HEIGHT][3]; // row, col, rgb value Now, I want to dump it out as a png file. What is the quickest way to do this? ...

How to build C++ for OSX 10.4, 10.5 and 10.6 in Xcode with dynamic libraries

Hello, I'm building a C++ command line tool in Xcode. The project contains dylibs for curl, boost and log4cpp. Ideally id like to build an i386 universal binary that supports 10.4 through to 10.6. I cant seem to get Xcode to compile, when I target 10.4 it says things like no such file or directory. When i target 10.6 x_64 it builds ...

Mac OS X/Bluetooth: Programmatically disable simple pairing?

The Bluetooth Explorer app from the dev tools (/Developer/Applications/Utilities/Bluetooth/) allows you to turn off Simple Pairing on your device. (Run the app, select menu item: "Utilities>Get Local Device Info", and click on the "Simple Pairing" tab). How would a 3rd-party application do this? ...

How to build boost library and others against OS X 10.4u SDK on OS X 10.6?

Hello, I'm trying to build the boost libraries and others against the os x 10.4u.sdk so I can include them in a project targeting 10.4 upwards. I'm not entirely sure what to do, am I aiming to put the .dylibs in 10.4.sdk/usr/local/.. or in my default 10.6 /usr/local/.. with support for 10.4? Any help much appreciated. Toby. ...