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
std::vector<SourceFile*> static_files = this->_source.static_files(); | |
for (auto it_file = static_files.begin(); it_file != static_files.end(); ++it_file) { | |
// for (auto it_file = this->_source.static_files().begin(); it_file != this->_source.static_files().end(); ++it_file) { |
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 numpy as np | |
import time | |
def loss_i(x_i, y, W): | |
delta = 1 | |
scores_i = np.dot(W, x_i) | |
margin = 0 | |
for j in range(scores_i.shape[0]): | |
if j == y: |
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
def loss(X, Y, W): | |
delta = 1 | |
scores = np.dot(W, X.T) | |
rows = np.arange(Y.shape[0]) | |
margins = np.maximum(0, scores - scores[Y, rows] + delta) | |
# Find indices that need to be set to zero. | |
# Case when j == y in loss_i_v. |
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 | |
class AsyncBlockOperation: NSOperation { | |
typealias Block = (Void -> Void) -> Void | |
private let block: Block | |
private var _executing = false | |
private var _finished = false | |
init(block: Block) { |
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
#define TRIGGER1 2 | |
#define ECHO1 3 | |
#define TRIGGER2 4 | |
#define ECHO2 5 | |
void setup() { | |
pinMode(TRIGGER1,OUTPUT); | |
pinMode(ECHO1,INPUT); | |
pinMode(TRIGGER2,OUTPUT); | |
pinMode(ECHO2,INPUT); |
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 "Vector.h" | |
@interface Vector () | |
@property (nonatomic, assign) uint count; | |
@property (nonatomic, assign) size_t size; | |
@property (nonatomic, assign) void **storage; | |
@end | |
@implementation Vector |
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
/* | |
Erica Sadun, http://ericasadun.com | |
Basic Errors | |
*/ | |
import Foundation | |
/// A basic utility error type that stores the reason for |
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
override func viewDidLoad() { | |
super.viewDidLoad() | |
configureGestureRecognizer() | |
RestKitManager.getChannelToken(channel.name) { token in | |
if let token = token { | |
let params = "player=twitchweb&token=\(token.token)&sig=\(token.sig)&allow_source=true&type=any&p=3633125" | |
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 CoreData | |
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
populateDatabase() | |
} | |
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
func passAnyObject(param: AnyObject) { | |
print(param) | |
} | |
class MyClass {} | |
struct MyStruct {} | |
let a: Int = 1 | |
let b = 2.0 |
NewerOlder