Install the two dependencies, ImageMagick and Ghostscript.
$ brew install imagemagick
$ brew install ghostscript
#include "Halide.h" | |
#include "Halide/tools/halide_image_io.h" | |
#include <iostream> | |
// This code calculates a block based mean on some a-priori known image-dimensions (1 uint8_t channel) | |
// An example image to process: http://i.imgur.com/Eyo0Xvc.png | |
// No customized scheduling within this code, but the SO-answer gives some recommendation! | |
int main(int argc, char **argv) { | |
Halide::Buffer<uint8_t> input = Halide::Tools::load_image("TestImages/block_example.png"); |
Greetings and salutations, NSHipsters!
As the year winds down, it's a tradition here at NSHipster to ask you, dear readers, to offer up your favorite tricks and tips from the past year as gifts to your fellow hipsters. With iOS 9, El Capitan, brand new watch- and tvOS's, and the open-sourcing of some minor Apple-related tech, there's bound to be lots to share.
Submit your favorite piece of Swift or @objc
trivia, helpful hints, unexpected discoveries, useful workarounds, useless fascinations, or anything else you found cool this year. Just comment below!
If you need inspiration, try [the list from last year][2015], or [from the year before][2014], or [from the year before that][2013].
//setting up the first video based on previous recording | |
CMTimeRange videoDuration = CMTimeRangeMake(kCMTimeZero, [self.previousRecording duration]); | |
AVAssetTrack *clipVideoTrack = [[self.previousRecording tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0]; | |
AVAssetTrack *clipAudioTrack = [[self.previousRecording tracksWithMediaType:AVMediaTypeAudio] objectAtIndex:0]; | |
[compositionVideoTrack insertTimeRange:videoDuration ofTrack:clipVideoTrack atTime:nextClipStartTime error:nil]; | |
[compositionAudioTrack insertTimeRange:videoDuration ofTrack:clipAudioTrack atTime:nextClipStartTime error:nil]; | |
//our first track instruction - set up the instruction layer, then check the orientation of the track | |
//if the track is in landscape-left mode, it needs to be rotated 180 degrees (PI) | |
AVMutableVideoCompositionLayerInstruction *firstTrackInstruction = |
#!/bin/sh | |
# This script was written by Jay Graves for the 360iDev Conference. | |
# You can find the full slides available at http://skabber.com/ | |
# This script requires Xcode and s3cmd http://s3tools.org/s3cmd | |
# You will need your own Amazon S3 account to upload files. | |
# Put your distribution certificates and keys in the System Keychain | |
# otherwise you will need to use security unlock-keychain | |
TARGET=GroupA | |
PlistBuddy=/usr/libexec/PlistBuddy |
from __future__ import print_function | |
from keras import backend as K | |
from keras.engine import Input, Model, InputSpec | |
from keras.layers import Dense, Activation, Dropout, Lambda | |
from keras.layers import Embedding, LSTM | |
from keras.optimizers import Adam | |
from keras.preprocessing import sequence | |
from keras.utils.data_utils import get_file | |
from keras.datasets import imdb |
// Based off example code from Hal Robertson | |
// https://github.com/halrobertson/test-restify-passport-facebook | |
// See discussion: https://groups.google.com/forum/?fromgroups#!topic/passportjs/zCz0nXB_gao | |
var restify = require('restify') | |
// config vars | |
var FB_LOGIN_PATH = '/api/facebook_login' | |
var FB_CALLBACK_PATH = '/api/facebook_callback' | |
var FB_APPID = '<<YOUR APPID HERE>>' |
# use pkg-config for getting CFLAGS and LDLIBS | |
FFMPEG_LIBS= libavdevice \ | |
libavformat \ | |
libavfilter \ | |
libavcodec \ | |
libswresample \ | |
libswscale \ | |
libavutil \ | |
CFLAGS += -Wall -g |
# import os | |
# os.environ["THEANO_FLAGS"] = "mode=FAST_RUN,device=gpu,floatX=float32" | |
# import theano | |
# import the neural net stuff | |
from keras.models import Sequential | |
from keras import optimizers | |
from keras.layers.core import Dense, Dropout, Activation, Flatten | |
from keras.layers.convolutional import Convolution1D | |
from keras.layers.normalization import BatchNormalization |