This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// List all font families and font names in iOS | |
for (NSString *familyName in UIFont.familyNames) { | |
NSLog(@"%@", familyName); | |
for (NSString *fontName in [UIFont fontNamesForFamilyName:familyName]) { | |
NSLog(@" %@", fontName); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public synchronized float[] solveWithDeviceMemory() { | |
// Allocate native (device) memory for the input data | |
CLBuffer<Float> bufIn = _context.createFloatBuffer(CLMem.Usage.Input, _input.length); | |
// Allocate native (device) memory for the output data | |
CLBuffer<Float> bufOut = _context.createFloatBuffer(CLMem.Usage.Output, _input.length); | |
// Map input/output buffers for implicit copy | |
Pointer<Float> ptrIn = bufIn.map(_queue, CLMem.MapFlags.Write); | |
Pointer<Float> ptrOut = bufOut.map(_queue, CLMem.MapFlags.Read); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var EventEmitter = require('events').EventEmitter; | |
module.exports = function() { | |
var queue = new EventEmitter(); | |
var locked = false; | |
this.lock = function lock(fn) { | |
if (locked) { | |
queue.once('ready', function() { lock(fn); }); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* base64.js: An extremely simple implementation of base64 encoding / decoding using node.js Buffers | |
* | |
* (C) 2010, Nodejitsu Inc. | |
* (C) 2011, Cull TV, Inc. | |
* | |
*/ | |
var base64 = exports; |