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
App.Router = Em.Router.extend({ | |
root: Em.Route.extend({ | |
route: '/', | |
post: Em.Route.extend({ | |
route: '/:post_user/:post_date', | |
connectOutlets: function (router, context) { | |
// Should give the Post with the user, and the date? | |
} | |
}) | |
}) |
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
class MyClass: | |
value = 0 | |
"""jsspace | |
MyClass.value = 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
int main () | |
{ | |
do | |
{ | |
if(strlen(perstyp[k].namn)==0) break; //räknar ut antal sparade | |
k++; | |
} | |
while(1); | |
} |
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
run_test: test | |
./test | |
run: main | |
./main | |
test: test.c person.c person.h | |
gcc -o test test.c person.c | |
build: main.c person.c person.h | |
gcc -o main test.c person.c |
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 random | |
class Sensor(object): | |
OFFSET = 16 | |
def pop_next_pressure_psi_value(self): | |
pressure_telemetry_value = self.sample_pressure() | |
return Sensor.OFFSET + pressure_telemetry_value | |
def __iter__(self): |
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 random | |
class Sensor(object): | |
OFFSET = 16 | |
def pop_next_pressure_psi_value(self): | |
pressure_telemetry_value = self.sample_pressure() | |
return Sensor.OFFSET + pressure_telemetry_value | |
def __iter__(self): |
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
@lambda func:(lambda *a, **k: (print(repr(a), repr(k)), func(*a, **k))[1]) | |
def my_id_func(*a): | |
return a |
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
# -*- coding: utf-8 -*- | |
""" | |
>>> update_item(Item("a", 1, 2)) | |
a, 0, 1 | |
>>> update_item(Item("a", 1, 1)) | |
a, 0, 0 | |
>>> update_item(Item("a", 1, 0)) | |
a, 0, 0 | |
>>> update_item(Item("a", 0, 3)) | |
a, -1, 1 |
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
window.Models = EM.Namespace.create(); | |
DS.RESTAdapter.map('Models.model', { | |
primaryKey: 'idx' | |
}) | |
Models.model = DS.Model.extend({ | |
init: function () { | |
this.super(); | |
Em.run.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
def check(number): | |
pass | |
def run_tests(): | |
assert check(1) == 1, "one is not devicible with 3 or 5 so leave it alone" | |
if __name__ == "__main__": | |
run_tests() |