160@dynamic – Provide methods dynamically at runtime
"don't worry about it, a method is on the way."
"don't worry about it, a method is on the way."
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.
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.
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)
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 < 0) tempX = 0;
if (tempY < 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>
//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 ); }
Run from Terminal:
defaults write -g QCShowPrivatePatches 1
defaults write -g QCShowPrivatePatches 0
/ 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; }
Courtesy of Kineme.