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 | |
// Tuple result | |
// Get contents of directory at specified path, returning (filenames, nil) or (nil, error) | |
func contentsOfDirectoryAtPath(path: String) -> (filenames: String[]?, error: NSError?) { | |
var error: NSError? = nil | |
let fileManager = NSFileManager.defaultManager() | |
let contents = fileManager.contentsOfDirectoryAtPath(path, error: &error) |
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
// A basic spring in Processing, based on: | |
// Hooke's law: F = -kx | |
// Newton's law: F = ma | |
// For more examples, see this lecture: | |
// http://cmuems.com/2015c/deliverables/deliverables-10/springs/ | |
float restLength; | |
float vx; | |
float px; |
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
ArrayList<Rect> rects; | |
float mx, my, mm, time; | |
void setup() { | |
size(720, 720, P2D); | |
generate(); | |
} | |
void draw() { |
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 | |
public enum TruncateMode: Int { | |
case Head = 0 | |
case Middle = 1 | |
case Tail = 2 | |
} | |
public extension String { | |
func nilIfEmpty() -> String? { |
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
/** | |
* Simple UART module to explore basic HardwareC concepts. | |
* | |
* HardwareC is a working name for a new hardware description language. The | |
* goal is to make FPGAs easier for hobbyists to take advantage of. To achieve | |
* this goal, some design choices have been made: | |
* | |
* 1. Use familiar syntax. C/C++ syntax is borrowed everywhere, no reason to | |
* reinvent the wheel. Where C/C++ falls short, borrow from Verilog/SystemVerilog. | |
* 2. Interrop with C/C++. A HardwareC module should be able to be used seamlessly |
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
#pragma mark - Phone Number Field Formatting | |
// Adopted from: http://stackoverflow.com/questions/6052966/phone-number-formatting | |
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string | |
{ | |
if (textField == self.mobileNumberField || textField == self.homeNumberField || textField == self.workNumberField) { | |
int length = [self getLength:textField.text]; | |
if(length == 10) { | |
if(range.length == 0) |
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
// A C++ object that generates uniformly distributed random numbers in [0,1]. | |
// Inspired by the built-in value of the same name in nano ᴊᴀᴍᴍᴇʀ | |
// (see https://morgan3d.github.io/nano/doc/specification.md.html) | |
#include <iostream> | |
#include <random> | |
static class RandomXi | |
{ | |
public: |
List of Machine and Deep Learning Articles and Tutorials that Non-Machine Learning and/or Non-Computer Scientists Can Understand
This is a list of articles and tutorials I find helpful for gaining a cursory understanding of machine and deep learning.
Thank you to the many scientists who are sharing their research!
OlderNewer