Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
| #import <UIKit/UIKit.h> | |
| #import <ImageIO/ImageIO.h> | |
| #import <MobileCoreServices/MobileCoreServices.h> | |
| static UIImage *frameImage(CGSize size, CGFloat radians) { | |
| UIGraphicsBeginImageContextWithOptions(size, YES, 1); { | |
| [[UIColor whiteColor] setFill]; | |
| UIRectFill(CGRectInfinite); | |
| CGContextRef gc = UIGraphicsGetCurrentContext(); | |
| CGContextTranslateCTM(gc, size.width / 2, size.height / 2); |
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
In python, you have floats and decimals that can be rounded. If you care about the accuracy of rounding, use decimal type. If you use floats, you will have issues with accuracy.
All the examples use demical types, except for the original value, which is automatically casted as a float.
To set the context of what we are working with, let's start with an original value.
| import java.awt.BasicStroke; | |
| import java.awt.Color; | |
| import java.awt.Dimension; | |
| import java.awt.FontMetrics; | |
| import java.awt.Graphics; | |
| import java.awt.Graphics2D; | |
| import java.awt.Point; | |
| import java.awt.RenderingHints; | |
| import java.awt.Stroke; | |
| import java.util.ArrayList; |
Single-line comments are started with //. Multi-line comments are started with /* and ended with */.
C# uses braces ({ and }) instead of indentation to organize code into blocks.
If a block is a single line, the braces can be omitted. For example,
The git command-line utility has plenty of inconsistencies http://steveko.wordpress.com/2012/02/24/10-things-i-hate-about-git/
A GUI like http://sourcetreeapp.com is often helpful, but staying on the command line usually quicker. This is a list of the commands I use most frequently, listed by functional category:
git status list which (unstaged) files have changed
Author: Yotam Gingold
License: Public Domain (CC0)
This document is intended as a reference or introduction to JavaScript for someone familiar with a language like C/C++/Java or Python. It follows best practices and gathers the scattered wisdom from matny stackoverflow questions and in-depth JavaScript essays. It relies on no external libraries.
| # Compiled source # | |
| ################### | |
| *.com | |
| *.class | |
| *.dll | |
| *.exe | |
| *.o | |
| *.so | |
| # Packages # |
| Events & Delegates | |
| ------------------ | |
| Events and Delegates were something I struggled with when I was first learning how they worked. Once I figured it out it became one of the most useful and powerful techniques for games. Its especially useful for helping to decouple classes while allowing for messaging. | |
| Delegates - Simply a container for a function that can be used as a variable. | |
| Events - Allows you to specify a delegate that gets called when some event in your code is triggered. | |
| Overview |
| import QuartzCore | |
| func executionTimeInterval(block: () -> ()) -> CFTimeInterval { | |
| let start = CACurrentMediaTime() | |
| block(); | |
| let end = CACurrentMediaTime() | |
| return end - start | |
| } | |