This file contains hidden or 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 | |
protocol SomeDelegateProtocol : class { | |
func firstFunc() -> String | |
func secondFunc() -> Bool | |
func thirdFunc() -> Self | |
} | |
class MyClass { | |
weak var delegate : SomeDelegateProtocol? |
This file contains hidden or 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 ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
addSquareToView(size: CGSizeMake(30, 30), color: UIColor.greenColor()); | |
} | |
func addSquareToView(size s: CGSize, color: UIColor) { | |
var square: UIView; | |
let frame = CGRectMake(10, 10, s.width, s.height); | |
This file contains hidden or 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
var myClosure: (Int, Int) -> String |
This file contains hidden or 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
// Mergesort | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <time.h> | |
int* recombine(int*, int, int*, int); | |
void print_array(int*, int); | |
// Debugging globals | |
static malloc_ctr = 0; |
This file contains hidden or 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
// min_stack.c | |
// Austin Zheng | |
#include <stdio.h> | |
#include <stdlib.h> | |
struct min_stack { | |
int* v; // This array represents the main stack, and contains actual values. | |
int* m; // This array represents the min stack, and contains an index into the v array. | |
unsigned int v_ptr; // This is a pointer to the next free main stack slot. |
This file contains hidden or 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
#include <stdio.h> | |
struct n { | |
int v; | |
struct n* next; | |
}; | |
struct n* split_list(struct n* head, int pivot) { | |
struct n* cur = head; | |
struct n* lh = NULL; struct n* lt = NULL; |
NewerOlder