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
#!/bin/bash | |
STANDLONE_PREFIX=/Users/palmerc/Development/android-ndk/standalone-r13b | |
HDF5_PARENT_DIR=${HOME}/Development/HDF5-compile | |
HDF5_INSTALL_DIR=${HDF5_PARENT_DIR}/HDF5 | |
EMULATOR_NAME_ARM="nexus19-arm" | |
EMULATOR_NAME_X86="nexus19-x86" | |
function find_device { | |
local UUID=$1 |
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
How to build HDF5 for Android | |
References: | |
----------- | |
[1] http://developer.android.com/tools/sdk/ndk/index.html | |
[2] http://developer.android.com/sdk/index.html |
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
import UIKit | |
public struct Pixel { | |
public var value: UInt32 | |
public var red: UInt8 { | |
get { | |
return UInt8(value & 0xFF) | |
} | |
set { |
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
import UIKit | |
import CoreGraphics | |
func imageFromPixelValues(pixelValues: [UInt8]?, width: Int, height: Int) -> CGImage? | |
{ | |
var imageRef: CGImage? | |
if pixelValues != nil { | |
let imageDataPointer = UnsafeMutablePointer<UInt8>(pixelValues!) | |
let colorSpaceRef = CGColorSpaceCreateDeviceGray() |
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
//: Playground - noun: a place where people can play | |
import Darwin | |
import Foundation | |
let clockFaces: String = "๐๐๐๐๐๐๐๐๐๐๐๐" | |
let sortedClockFaces = Array(clockFaces.characters).sort() | |
let threeOClock = sortedClockFaces[2] | |
let aceOfSpades = "๐ก" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
var sock = null; | |
var ellog = null; | |
window.onload = function() { | |
var wsuri; |
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
function [ Hough, theta_range, rho_range ] = naiveHough(I) | |
%NAIVEHOUGH Peforms the Hough transform in a straightforward way. | |
% | |
[rows, cols] = size(I); | |
theta_maximum = 90; | |
rho_maximum = floor(sqrt(rows^2 + cols^2)) - 1; | |
theta_range = -theta_maximum:theta_maximum - 1; | |
rho_range = -rho_maximum:rho_maximum; | |
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
Eigen::Vector4f planeEq; | |
Eigen::Matrix4f modelViewMatrix; | |
Eigen::Vector4f nPrime = modelViewMatrix.inverse() * Eigen::Vector4f(planeEq(0), planeEq(1), planeEq(2), 1.f); | |
nPrime.normalize(); | |
Eigen::Vector3f clipPlaneNormalObjectSpace = Eigen::Vector3f(nPrime(0)/nPrime(3), nPrime(1)/nPrime(3), nPrime(2)/nPrime(3)); |
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
#import <Foundation/Foundation.h> | |
#define randomNumber() (arc4random() % ((unsigned)1000000 + 1)) | |
@interface MainHelper : NSObject | |
+ (NSArray *)largeArrayCreate; | |
@end | |
@implementation MainHelper | |
+ (NSArray *)largeArrayCreate |
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
- (UIImage *)boxblurImage:(UIImage *)image boxSize:(int)boxSize | |
{ | |
CGImageRef originalImageRef = image.CGImage; | |
CGColorSpaceRef originalColorSpace = CGColorSpaceRetain(CGImageGetColorSpace(originalImageRef)); | |
if (_pixelBuffer == NULL) { | |
_pixelBuffer = malloc(CGImageGetBytesPerRow(originalImageRef) * CGImageGetHeight(originalImageRef)); | |
} | |
vImage_CGImageFormat inputImageFormat = |