- UI Changes
- Updated bootstrap to v3.0
- Redesigned playlist controls
- Redesigned channel moderation settings
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
| func selectionSort(inout arr:[Int]) { | |
| var min:Int | |
| for n in 0..<arr.count { | |
| min = n | |
| for x in n&+1..<arr.count { | |
| if (arr[x] < arr[min]) { | |
| min = 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
| import Foundation | |
| typealias NormalCallback = (AnyObject?) -> Void | |
| typealias MultipleCallback = (AnyObject?...) -> Void | |
| func on(callback:NormalCallback) { | |
| callback(1) | |
| } | |
| func onMultiple(callback:MultipleCallback) { |
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
| infix operator ! {} | |
| var n = 10 | |
| func !(lhs:() -> Void, rhs:Bool) { | |
| if rhs { | |
| lhs() | |
| } | |
| } | |
| ({n += 10} ! n == 10) |
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
| func quicksort(inout list:[Int], var left:Int = -1, var right:Int = -1) { | |
| if left == -1 && right == -1 { | |
| left = 0 | |
| right = list.count - 1 | |
| } | |
| func partition(left:Int, right:Int) -> Int { | |
| var i = left | |
| for j in left+1...right { |
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
| typealias MyFunction = (Int...) -> Int | |
| func makeFunction(b:Int) -> MyFunction { | |
| return {n in | |
| let d = n.reduce(b) {$0 - $1} | |
| return d | |
| } | |
| } |
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 | |
| class Converter { | |
| static let queryString = "http://www.freecurrencyconverterapi.com/api/v3/convert?q=" | |
| static let requestQueue = NSOperationQueue() | |
| static func convertFrom(from:String, to:String, amount:Double, callback:(Double) -> Void) { | |
| let query = "\(from)_\(to)" | |
| let q = queryString + "\(query)&compact=y" | |
| let req = NSURLRequest(URL: NSURL(string: q)!) |
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 | |
| let valids = [">", "<", "+", "-", ".", ",", "[", "]"] as Set<Character> | |
| var ip = 0 | |
| var dp = 0 | |
| var data = [UInt8](count: 30_000, repeatedValue: 0) | |
| let input = Process.arguments | |
| if input.count != 2 { |
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 app = require('express')() | |
| var server = app.listen(8080) | |
| var io = require('socket.io')(server)//8080, {path: "", transports: ["polling"], pingInterval: 500}) | |
| var fs = require("fs") | |
| // io.use(function(socket, next) { | |
| // if (socket.request.headers.cookie) { | |
| // console.log(socket.request.headers.cookie) | |
| // return next() | |
| // } |
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
| object Main extends App { | |
| val fibs: Stream[BigInt] = BigInt(0) #:: BigInt(1) #:: fibs.zip(fibs.tail).map { n => n._1 + n._2 } | |
| fibs take 20 foreach println | |
| } |
OlderNewer