Skip to content

Instantly share code, notes, and snippets.

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(newChallenge:) name:@"ZZChallengedReady" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(foundPartner:) name:@"NSActivityReady" object:nil];
@morganwilde
morganwilde / .vimrc
Created November 6, 2014 19:24
vimrc
set nocompatible
set expandtab
set autoindent
set smartindent
set softtabstop=4
set tabstop=4
set shiftwidth=4
set showmatch
set ruler
set nohls
#include <sstream>
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
void printVector(vector<string> v)
{
for var i = 0, elements = 0; i < circles; i++ {
x = helixRadius * cos(t)
z = helixRadius * sin(t)
y = pitchInherent * pitchCurrent * t
t += yIncrement
helixAngle = atan2(x, z)
let circleCenter = Float3(x: x, y: y, z: z)
SELECT COUNT(DISTINCT isbn)
FROM stud.egzempliorius
WHERE EXTRACT(MONTH FROM grazinti)=10;
CREATE TEMP TABLE EgzemplioriuSkaiciai(metai, isbn, paimta, pavadinimas)
AS (
SELECT
knyga.metai AS metai,
knyga.isbn AS isbn,
COUNT(egzempliorius.paimta) AS paimta,
knyga.pavadinimas AS pavadinimas
FROM stud.knyga JOIN stud.egzempliorius ON knyga.isbn = egzempliorius.isbn
GROUP BY knyga.isbn);
public class GintvileFile {
private String name;
private String contents;
public GintvileFile() {
this.contents = "";
}
public String getContents() {
return contents;
}
}
#include <stdlib.h>
#include "SocketAddress.h"
#include "Socket.h"
#include "Request.h"
#include "Response.h"
#include "Helpers.h"
int main(int argc, char **argv)
{
func getMinDistanceBetweenRectangles(a: CGRect, b: CGRect) -> CGFloat {
let deltaX = b.origin.x - a.origin.x
let deltaY = b.origin.y - a.origin.y
let delta = abs(deltaX) > abs(deltaY) ? deltaX : deltaY
var distance: CGFloat = 0
switch (delta >= 0, delta == deltaX) {
case (true, true) : distance = b.origin.x - (a.origin.x + a.width)
case (true, false) : distance = b.origin.y - (a.origin.y + a.height)
class Matrix():
def __init__(self, width, height):
self.width = width
self.height = height
# Initialise the matrix grid
self.matrix = []
for row in range(height):
self.matrix.append([])
for column in range(width):