## _Neue Lern- und Partizipationsformen_
Workshop auf dem Sozialpolitischen Fachkongress des ASB am 26. April 2013 | Henning Wötzel-Herber
Workshop auf dem Sozialpolitischen Fachkongress des ASB am 26. April 2013 | Henning Wötzel-Herber
enum Sum<L,R> { | |
case Left(@auto_closure () -> L) | |
case Right(@auto_closure () -> R) | |
} | |
protocol GShow { | |
func gshow() -> String | |
} | |
extension String : GShow { |
enum PageType { | |
case Markdown | |
case HTML | |
case XML | |
} | |
extension PageType : DebugPrintable { | |
var debugDescription : String { | |
switch self { | |
case .Markdown: return "Markdown" |
// This code accompanies a blog post: http://chris.eidhof.nl/posts/json-parsing-in-swift.html | |
// | |
// As of Beta5, the >>= operator is already defined, so I changed it to >>>= | |
import Foundation | |
let parsedJSON : [String:AnyObject] = [ | |
"stat": "ok", | |
"blogs": [ |
// | |
// main.swift | |
// Accelerate | |
// | |
// Created by Chris Eidhof on 17/08/14. | |
// Copyright (c) 2014 Chris Eidhof. All rights reserved. | |
// | |
import Foundation | |
import Accelerate |
// | |
// main.swift | |
// Routes | |
// | |
// Created by Chris Eidhof on 17/08/14. | |
// Copyright (c) 2014 Chris Eidhof. All rights reserved. | |
// | |
import Foundation |
import Foundation | |
// Executes an array of blocks in parallel, but only returns after they're all done. | |
func parallel(blocks: [() -> ()]) { | |
let group = dispatch_group_create() | |
let queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) | |
for block in blocks { | |
dispatch_group_async(group, queue, block) | |
} |
id nilResultAfterTimeOut(int64_t timeoutInNanoSeconds, ResultBlock block) { | |
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); | |
dispatch_time_t timeoutTime = dispatch_time(DISPATCH_TIME_NOW, timeoutInNanoSeconds); | |
__block id result = nil; | |
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); | |
dispatch_async(queue, ^{ | |
result = block(); | |
dispatch_semaphore_signal(semaphore); | |
}); |
\lstdefinelanguage{swift} | |
{ | |
morekeywords={ | |
func,if,then,else,for,in,while,do,switch,case,default,where,break,continue,fallthrough,return, | |
typealias,struct,class,enum,protocol,var,func,let,get,set,willSet,didSet,inout,init,deinit,extension, | |
subscript,prefix,operator,infix,postfix,precedence,associativity,left,right,none,convenience,dynamic, | |
final,lazy,mutating,nonmutating,optional,override,required,static,unowned,safe,weak,internal, | |
private,public,is,as,self,unsafe,dynamicType,true,false,nil,Type,Protocol, | |
}, | |
morecomment=[l]{//}, % l is for line comment |