let constant = "Constant cannot be changed"
var variable = "Variable can be changed later"
var x,y: Int
let x = 0, y = 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
#include <iostream> | |
using namespace std; | |
struct Node | |
{ | |
int data; | |
Node *next; | |
}; | |
struct HeadNode |
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
# Exclude the build directory | |
build/* | |
# Exclude temp nibs and swap files | |
*~.nib | |
*.swp | |
# Exclude OS X folder attributes | |
.DS_Store | |
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
*.rbc | |
*.sassc | |
.sass-cache | |
capybara-*.html | |
.rspec | |
.rvmrc | |
/.bundle | |
/vendor/bundle | |
/log/* | |
/tmp/* |
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
test = gets.chomp.to_i | |
test.times do |t| | |
table = [] | |
n = 3 | |
4.times { table << gets.chomp } | |
dummy = gets.chomp | |
x_win = o_win = false | |
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 _ = require("underscore") | |
monsterArray = [{ type: "Attacker", position: 1, isDead: false}, | |
{ type: "Attacker", position: 2, isDead: false}, | |
{ type: "Attacker", position: 3, isDead: false}, | |
{ type: "Attacker", position: 4, isDead: false}, | |
{ type: "Attacker", position: 5, isDead: false}, | |
{ type: "Attacker", position: 6, isDead: false}]; | |
opponentArray = [{ type: "Attacker", position: 1, isDead: false}, |
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
<script src="/socket.io/socket.io.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> | |
<script> | |
var socket = io.connect('http://localhost:8080'); | |
// on connection to server, ask for user's name with an anonymous callback | |
socket.on('connect', function(){ | |
// call the server-side function 'adduser' and send one parameter (value of prompt) | |
socket.emit('adduser', prompt("What's your name?")); | |
}); |
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
NSInteger x = 30; | |
CGFloat y = (CGFloat)x; |
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
let pi: Double = 3.14159 | |
let fpi: Float = 3.14159 | |
let x = Int(pi) // 3 | |
let dpi = Double(pi) | |
let dgf = CGFloat(pi) | |
let array = Array("abc") // array = ["a", "b", "c"] | |
let string = String(["a", "b", "c", "d"]) // string = "abcd" | |
let intConvert = String(44) // let's try String(37.5) |
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
// AnyObject might be used in this way | |
// Properties | |
var destinationViewController: AnyObject | |
var toolbarItems: [AnyObject] | |
// Function or Method Arguments | |
func prepareForSegue(segue: UIStoryboardSegue, sender AnyObject) | |
func addConstraints(constraints: [AnyObject]) | |
func appendDigit(sender: AnyObject) |
OlderNewer