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 org.tensorflow.contrib.android.TensorFlowInferenceInterface; | |
/** One time initialization: */ | |
TensorFlowInferenceInterface tensorflow = new TensorFlowInferenceInterface(); | |
tensorflow.initializeTensorFlow(getAssets(), "file:///android_asset/model.pb"); | |
/** Continuous inference (floats used in example, can be any primitive): */ | |
// loading new input | |
tensorflow.fillNodeFloat("input:0", INPUT_SHAPE, input); // INPUT_SHAPE is an int[] of expected shape, input is a float[] with the input data |
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
@interface A : NSObject | |
- (int)foo; | |
@end |
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
appdir() { | |
dir=$(ps ax | grep $1.app | grep -v grep | grep -v AppCode | awk '{print "\""$5" "$6" "$7"\""} ' | sed "s/$1\.app\/$1//g") | |
eval cd "$dir" | |
} |
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
+ (void)maskView:(UIView *)targetView withImageView:(UIImageView *)maskingImageView { | |
CALayer *maskingLayer = [CALayer layer]; | |
maskingLayer.frame = CGRectMake(maskingImageView.frame.origin.x - targetView.frame.origin.x, | |
maskingImageView.frame.origin.y - targetView.frame.origin.y, | |
maskingImageView.frame.size.width, | |
maskingImageView.frame.size.height); | |
maskingLayer.contents = (id)maskingImageView.image.CGImage; | |
targetView.layer.mask = maskingLayer; | |
} |
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 | |
while [ 1 == 1 ]; do | |
curl http://www.leaan.co.il | grep Lean-Logo.png 2>&1 > /dev/null | |
if [ $? == 0 ]; then | |
open http://www.leaan.co.il; | |
fi | |
sleep 1 | |
done |
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 class Main { | |
public static void main(String[] args) { | |
doSomething(7); | |
} | |
private static void doSomething(int num) throws Exception { | |
if (num > 10) { | |
throw new Exception("abcd"); | |
} else { | |
System.out.println(num); |
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
class A { | |
private int x; | |
public A() { | |
this(7); | |
} | |
public A(int x) { | |
setX(x); | |
} |
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 abstract class A { | |
private int x = 7; | |
public A(int x) { | |
this.x = x; | |
System.out.println("A::A, x=" + x); | |
} | |
public int getX() { |
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
''' | |
Created on Jan 30, 2012 | |
@author: yonits | |
''' | |
import unittest | |
def flip_indices(new_list, first_idx, second_idx): |
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 <SenTestingKit/SenTestingKit.h> | |
@interface MyTest : SenTestCase | |
@end |
NewerOlder