View unique_ptr_basics.cpp
#include <iostream>
#include <memory>
using namespace std;
class Foo {
Foo(int a, int b) {
this->a = a;
this->b = b;
View functionandbind.cpp
#include <iostream>
#include <functional>
using namespace std;
using namespace std::placeholders;
int add(int a, int b) {
return a+b;
View CMakeLists.txt
cmake_minimum_required (VERSION 2.8)
project (ChaiTutorial)
add_library(myModule SHARED myModule.cpp)
install(TARGETS myModule DESTINATION /usr/local/lib/chaiscript)
#!/usr/bin/env python3
from csv import reader
letter_template = """
<p>{0} {1}</p>
View interpolate.nim
#string interpolation is similar to python - be sure to import string utils
import strutils
var output = "a $1 parrot" % ["dead"]
for time in countUp(1,10):
echo("I like traffic lights $time" % ["time", intToStr(time)])
echo("But only when they're green")
View helloworld.nim
#simple hello world in nimrod
echo("Hello World!")
View Type check
from functools import wraps
class Boat(object):
def __init__(self,color):
self.color = color
def hello(self):
print("I'm a {} boat".format(self.color))
View install pip log
/usr/bin/pip3 run on Sat Mar 1 09:10:17 2014
Downloading/unpacking cryptography
Getting page
URLs to search for versions for cryptography:
Analyzing links from page
Skipping link (from; unknown archive format: .whl
Skipping link (from; unknown archive format: .whl
View writing python well
Getting docstrings right:
Getting syntastic to work on windows:
from flask import render_template
from random import randrange
#create the app object
app = Flask(__name__)
#get the database
from tables import engine, temperature_table
def before_request():