Archive for the ‘Uncategorized’ Category

building mod_python for leopard

Wednesday, August 13th, 2008

Copied from http://matterkkila.com/2007/12/20/building-mod_python-for-leopard/ in case it goes away in the future

 

Leopard itself comes with recent versions of php, python, and apache. However it does not have mod_python, so if you want to play with things like django you must build mod_python from the source. Just running ./configure, make, make install won’t cut it either. You need to edit the make file built during the ./configure step to include specific compiler flags. I found a lot of sites on the internet with ideas how to fix it, after trying 4 of them that didn’t work I came across one that did. 

Run: 

./configure 

Edit: src/Makefile and after the ‘INCLUDES=’ line add 

INCLUDES+= -Wc,-arch -Wc,ppc -Wc,-arch -Wc,i386 -Wc,-arch -Wc,ppc64 -Wc,-arch -Wc,x86_64
INCLUDES+= -Wl,-arch -Wl,ppc -Wl,-arch -Wl,i386 -Wl,-arch -Wl,ppc64 -Wl,-arch -Wl,x86_64
export ARCHFLAGS='-arch i386 -arch ppc -arch ppc64 -arch x86_64'
 

Now run: 

make 
sudo make install

How to install mysql-python on Leopard

Wednesday, August 13th, 2008

http://www.keningle.com/?p=11

Test from iPhone

Saturday, April 12th, 2008

testing with iPhone

How to set up a simple ripple transition filter in Cocoa

Thursday, April 10th, 2008

This code will show you how to do a Core Animation ripple transition between two views.
This code does not take into account any memory management so make sure to do proper releases where appropriate or use garbage collection.

First, download these images that you will use in your project:
Shine image Transition Mask Image

You should add these two images into the Resources group in your XCode project.

You need to load these two images in your application. I suggest to do it in the awakeFromNib function.
You should define your images somewhere, preferably in your header file:

	CIImage         *inputShadingImage;         // an environment-map image that the transition filter may use in generating the transition effect
    CIImage         *inputMaskImage;            // a mask image that the transition filter may use in generating the transition effect

Load the images:

NSBundle *bundle = [NSBundle bundleForClass:[self class]];
	// Preload shading bitmap to use in transitions (borrowed from the "Fun House" Core Image example).
    NSData *shadingBitmapData = [NSData dataWithContentsOfFile:[bundle pathForResource:@"restrictedshine" ofType:@"tiff"]];
    NSBitmapImageRep *shadingBitmap = [[[NSBitmapImageRep alloc] initWithData:shadingBitmapData] autorelease];
    inputShadingImage = [[CIImage alloc] initWithBitmapImageRep:shadingBitmap];
 
    // Preload mask bitmap to use in transitions.
    NSData *maskBitmapData = [NSData dataWithContentsOfFile:[bundle pathForResource:@"transitionmask" ofType:@"jpg"]];
    NSBitmapImageRep *maskBitmap = [[[NSBitmapImageRep alloc] initWithData:maskBitmapData] autorelease];
    inputMaskImage = [[CIImage alloc] initWithBitmapImageRep:maskBitmap];

Set up a custom animation

CATransition* animation = [[CATransition alloc] init];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];
[animation setDuration:1.0];



Second, define the Core Image filter to use for the transition

CIFilter *rippleFilter = [CIFilter filterWithName:@"CIRippleTransition"];
        [rippleFilter setDefaults];
		[rippleFilter setValue:[CIVector vectorWithX:(rect.size.width/2.0) Y:(rect.size.height/2.0)] forKey:@"inputCenter"];
		[rippleFilter setValue:[CIVector vectorWithX:rect.origin.x Y:rect.origin.y Z:rect.size.width W:rect.size.height] forKey:@"inputExtent"];
		[rippleFilter setValue:inputShadingImage forKey:@"inputShadingImage"];
		[animation setFilter:rippleFilter];




Lastly, you need to set the animation onto the view that you want to use it for. In this example I am using an NSBox that contains an IKImageView. When I swap the IKImageView with a new IKImageView that has a different image in it, the transition between it will be the above ripple animation/transition.

//imagewell1 is IKImageView
NSView *holder = [imagewell1 superview];
[holder setAnimations: [NSDictionary dictionaryWithObjectsAndKeys:animation, @"subviews", nil]];
[[holder animator] replaceSubview:imagewell1 with:imagewell2];
[animation release];