160@dynamic – Provide methods dynamically at runtime

"don't worry about it, a method is on the way."

http://theocacao.com/document.page/516

158Google Map Links

http://open.atlas.free.fr/GMapsTransparenciesImgOver.php http://mapki.com/wiki/Add_Your_Own_Custom_Map http://econym.org.uk/gmap/ http://code.google.com/apis/maps/documentation/v3/

156“testMode” for Quartz Composer Javascript

function (string recent[3], number log) main (__structure images) { var result = new Object(); if (!_testMode) { result.log = images.length; return result; } }

Otherwise structures are set to NULL and not exectued. Looks like an error.

154Arduino, Force into 32Bit Mode after Java Update

Arduino does not start and complains of the following error:

Uncaught exception in main method: java.lang.UnsatisfiedLinkError: /Applications/arduino-0016/Arduino 16.app/Contents/Resources/Java/librxtxSerial.jnilib: no suitable image found. Did find: /Applications/arduino-0016/Arduino 16.app/Contents/Resources/Java/librxtxSerial.jnilib: no matching architecture in universal wrapper. To fix this, click on the Arduino application (e.g. Arduino 16.app) in the Finder, and select Get Info from the File menu. In the info panel, click the Open in 32 Bit Mode checkbox. You should then be able to launch Arduino normally.

http://arduino.cc/en/Guide/Troubleshooting#toc2

148iPhone: Checking Network Availability

Checking whether network is present and active. By way of: http://70.40.216.232/forums/viewtopic.php?f=21&t=425

UIApplication-Network.h


//
//  UIApplication-Network.h
//
//  SystemConfiguration.framework will need to be added to your project
//
//  To use just call as a class function [UIApplication hasNetworkConnection]
//

#import 
#import 

@interface UIApplication (NetworkExtensions)

+(BOOL)hasActiveWiFiConnection;     // fast wi-fi connection
+(BOOL)hasNetworkConnection;     // any type of internet connection (edge, 3g, wi-fi)

@end

UIApplication-Network.m

//
//  UIApplication-Network.m
//

#import "UIApplication-Network.h"

@implementation UIApplication (NetworkExtensions)

#define ReachableViaWiFiNetwork          2
#define ReachableDirectWWAN               (1 << 18)
// fast wi-fi connection
+(BOOL)hasActiveWiFiConnection
{
    SCNetworkReachabilityFlags     flags;
    SCNetworkReachabilityRef     reachabilityRef;
    BOOL                              gotFlags;

    reachabilityRef     = SCNetworkReachabilityCreateWithName(CFAllocatorGetDefault(), [@"www.apple.com" UTF8String]);
    gotFlags          = SCNetworkReachabilityGetFlags(reachabilityRef, &flags);
    CFRelease(reachabilityRef);

    if (!gotFlags)
    {
        return NO;
    }

    if( flags & ReachableDirectWWAN )
    {
        return NO;
    }

    if( flags & ReachableViaWiFiNetwork )
    {
        return YES;
    }

    return NO;
}

// any type of internet connection (edge, 3g, wi-fi)
+(BOOL)hasNetworkConnection;
{
    SCNetworkReachabilityFlags     flags;
    SCNetworkReachabilityRef     reachabilityRef;
    BOOL                              gotFlags;

    reachabilityRef     = SCNetworkReachabilityCreateWithName(CFAllocatorGetDefault(), [@"www.apple.com" UTF8String]);
    gotFlags          = SCNetworkReachabilityGetFlags(reachabilityRef, &flags);
    CFRelease(reachabilityRef);

    if (!gotFlags || (flags == 0) )
    {
        return NO;
    }

    return YES;
}

@end

Also, don't forget to add the SystemConfiguration.framework to the Frameworks folder in your application.

In case you get errors like that:

         
"_SCNetworkReachabilityGetFlags", referenced from:
              +[UIApplication(NetworkExtensions) hasActiveWiFiConnection] in UIApplication-Network.o
              +[UIApplication(NetworkExtensions) hasNetworkConnection] in UIApplication-Network.o
          "_SCNetworkReachabilityCreateWithName", referenced from:
              +[UIApplication(NetworkExtensions) hasActiveWiFiConnection] in UIApplication-Network.o
              +[UIApplication(NetworkExtensions) hasNetworkConnection] in UIApplication-Network.o
        ld: symbol(s) not found
        collect2: ld returned 1 exit status
Build failed (2 errors)
Picture 4

146Embedding Youtube Video in UIWebView

http://iPhoneIncubator.com/blog/audio-video/how-to-play-youtube-videos-within-an-application

not tested

141Getting Javascript Properties from Objective-C

Access Javascript properties from Objective-C...

NSString *href = [[webView windowScriptObject] evaluateWebScript:@"location.href"];

http://developer.apple.com/documentation/Cocoa/Conceptual/DisplayWebContent/Tasks/JavaScriptFromObjC.html

... and forwarding it to Quartz Composer: [quarrzComposerView setValue:href forInputKey:@"location"];

HTML <html> <head> <script language="JavaScript1.2">

document.captureEvents(Event.MOUSEMOVE); document.onmousemove = getMouseXY;

var tempX = 0; var tempY = 0;

function getMouseXY(e) { tempX = e.pageX; tempY = e.pageY;

if (tempX &lt; 0) tempX = 0;
if (tempY &lt; 0) tempY = 0;  

document.Show.MouseX.value = tempX;
document.Show.MouseY.value = tempY;

console.log();
return true;

}

function getKey() { document.Show.keyOutput.value = document.Show.keyInput.value; keyconsole.key(); return true; } </script>

<style>

d {

//display: none;
//background: #f00;

} </style> </head> <body> <form name="Show" id="d"> X <input type="text" name="MouseX" value="0" size="4"><br> Y <input type="text" name="MouseY" value="0" size="4"><br> KeyInput <input type="text" name="keyInput" size="4" onChange="getKey()" ><br> KeyOutput<input type="text" name="keyOutput" size="4"><br> </form> </body> </html>

Obj-C - (void)webView:(WebView )sender didClearWindowObject:(WebScriptObject )windowScriptObject forFrame:(WebFrame *)frame { [windowScriptObject setValue:self forKey:@"console"]; [windowScriptObject setValue:self forKey:@"keyconsole"];
}

/* // deprechiated

  • (void)webView:(WebView )webView windowScriptObjectAvailable:(WebScriptObject )windowScriptObject {

    [windowScriptObject setValue:self forKey:@"console"]; [windowScriptObject setValue:self forKey:@"keyconsole"]; } */

  • (BOOL)isSelectorExcludedFromWebScript:(SEL)selector { if (selector == @selector(doOutputToLog:) ) { return NO; } else if (selector == @selector(doOutputToKey:) ) { return NO; } return YES;

}

  • (NSString *) webScriptNameForSelector:(SEL)sel { if (sel == @selector(doOutputToLog:)) { return @"log"; } else if (sel == @selector(doOutputToKey:)) { return @"key"; } else { return nil; } }

  • (void) doOutputToLog: (NSString*) theMessage { int mx = [ [[theWebView windowScriptObject] evaluateWebScript:@"document.Show.MouseX.value"] intValue]; int my = [ [[theWebView windowScriptObject] evaluateWebScript:@"document.Show.MouseY.value"] intValue]; NSLog(@"%i, %i", mx, my ); }

  • (void) doOutputToKey: (NSString*) theMessage { key = [[theWebView windowScriptObject] evaluateWebScript:@"document.Show.keyOutput.value"]; NSLog(@"%@", key ); }

139QC Show/Hide Private Patches

Run from Terminal:

defaults write -g QCShowPrivatePatches 1 defaults write -g QCShowPrivatePatches 0

137My First Core Filter. Make Alpha Accessable

/ A Core Image kernel routine that manipulates the alpha of an image. /

kernel vec4 multiplyEffect(sampler image, float alpha) { vec4 i = sample(image, samplerCoord(image)); i.a = alpha; return i; }

128Adding Alpha Blending Mode to Quartz Composer

Courtesy of Kineme.

http://kineme.net/QuartzComposerPatches/GLTools/1.1