Update: feeling adventurous? Clone or fork the xkcd clock! If you just want to see it in action or get a glimpse of how it works, keep reading.
The date in [xkcd's comic number 1340][1] [does not change][2].
Update: feeling adventurous? Clone or fork the xkcd clock! If you just want to see it in action or get a glimpse of how it works, keep reading.
The date in [xkcd's comic number 1340][1] [does not change][2].
| #include <curses.h> | |
| #include <stdlib.h> | |
| #include <time.h> | |
| int b[32], *d=&b[16], q, v, y; | |
| char*m[]={ | |
| "CBA@GFEDKJIHONML", | |
| "@DHLAEIMBFJNCGKO", | |
| "LHD@MIEANJFBOKGC", |
| M[16],X=16,W,k;main(){T(system("stty cbreak") | |
| );puts(W&1?"WIN":"LOSE");}K[]={2,3,1};s(f,d,i | |
| ,j,l,P){for(i=4;i--;)for(j=k=l=0;k<4;)j<4?P=M | |
| [w(d,i,j++)],W|=P>>11,l*P&&(f?M[w(d,i,k)]=l<< | |
| (l==P):0,k++),l=l?P?l-P?P:0:l:P:(f?M[w(d,i,k) | |
| ]=l:0,++k,W|=2*!l,l=0);}w(d,i,j){return d?w(d | |
| -1,j,3-i):4*i+j;}T(i){for(i=X+rand()%X;M[i%X] | |
| *i;i--);i?M[i%X]=2<<rand()%2:0;for(W=i=0;i<4; | |
| )s(0,i++);for(i=X,puts("\e[2J\e[H");i--;i%4|| | |
| puts(""))printf(M[i]?"%4d|":" |",M[i]);W-2 |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| extension UIImage { | |
| public func imageRotatedByDegrees(degrees: CGFloat) -> UIImage { | |
| let radiansToDegrees: (CGFloat) -> CGFloat = { | |
| return $0 * (180.0 / CGFloat(M_PI)) | |
| } | |
| let degreesToRadians: (CGFloat) -> CGFloat = { | |
| return $0 / (180.0 * CGFloat(M_PI)) | |
| } | |
| // calculate the size of the rotated view's containing box for our drawing space |
| // | |
| // Contact.swift | |
| // FriendLender | |
| // | |
| // Created by Logan Wright on 9/22/14. | |
| // Copyright (c) 2014 lowriDevs. All rights reserved. | |
| // | |
| import UIKit | |
| import AddressBook |
| #!/bin/bash | |
| # usage: get [ RESOLUTION [ YEAR [ IDS... ] ] ] | |
| resolution=${1:-SD} | |
| year=${2:-2015} | |
| shift | |
| shift | |
| ids=$* | |
| RESOLUTION=$(echo $resolution | tr '[:lower:]' '[:upper:]') |
| function extractPatterns(sample){ | |
| var markers = {}; | |
| sample.forEach(function(element, i){ | |
| if(isNaN( Number(element) )){ | |
| var parts = element.split(/(?=[A-Z])/); | |
| parts.forEach(function(part){ | |
| if(!markers[part]){ | |
| markers[part] = []; | |
| } | |
| markers[part].push(i+1); |
| #import <Contacts/Contacts.h> | |
| @implementation ContactsScan | |
| - (void) contactScan | |
| { | |
| if ([CNContactStore class]) { | |
| //ios9 or later | |
| CNEntityType entityType = CNEntityTypeContacts; | |
| if( [CNContactStore authorizationStatusForEntityType:entityType] == CNAuthorizationStatusNotDetermined) |