Hello
print("hello")
a = a + b
- Hello
static value random_int( value o, value max ) { | |
if (!val_is_int(max)) {fprintf(stderr,"std_random max is no int\n");} | |
else {fprintf(stderr,"std_random max is in fact an int\n");} | |
if (!val_is_int(o)) {fprintf(stderr,"std_random o is no int\n");} | |
else {fprintf(stderr,"std_random o is in fact an int\n");} | |
val_check_kind(o,k_random); | |
val_check(max,int); | |
if( val_int(max) <= 0 ) | |
return alloc_int(0); | |
return alloc_int( (rnd_int(val_rnd(o)) & 0x3FFFFFFF) % val_int(max) ); |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import wx | |
TASKBAR_ICON = "icon.png" | |
class ClipmanIcon(wx.TaskBarIcon): | |
def __init__(self): | |
wx.TaskBarIcon.__init__(self) | |
self.icon = wx.IconFromBitmap( wx.Bitmap(TASKBAR_ICON) ) |
import random, math | |
import re | |
def log_bin(value): | |
return math.log(value) / math.log(2) | |
def cumprod(values): | |
result = 1 | |
for i in values: | |
result *= i |
#include <glib.h> | |
#include <glib-object.h> | |
#include <dbus/dbus.h> | |
#include <dbus/dbus-glib.h> | |
#include "marshal.h" /* The file generated from marshal.list via tool glib-genmarshal */ | |
//VOID:INT,STRING,STRING - put into marshal.list | |
//glib-genmarshal --header --prefix=marshal marshal.list > marshal.h | |
//glib-genmarshal --body --prefix=marshal marshal.list > marshal.c | |
//Compile with: "gcc -MMD -Wall -ggdb -O -pthread -I/usr/include/dbus-1.0 -I/usr/lib/i386-linux-gnu/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -pthread -L/usr/lib/i386-linux-gnu -ldbus-glib-1 -ldbus-1 -lpthread -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0 marshal.c main.c -o main" |
[styling] | |
default=default | |
number=number | |
word=keyword | |
string=string | |
word2=commentdoc,bold | |
classname=type,bold | |
defname=function | |
operator=keyword2,bold | |
identifier=default |
// Syntax notes: | |
// Blah!Int is generic type application, equivalent to C++'s Blah<Int> | |
// Ptr!Type is a pointer to a Type object | |
// Type? is Option!Type, e.g. either a Type object, or None | |
// Semantics notes: | |
// struct is a C-style struct | |
// union is a typed union, e.g. union!(A, B) can be either A, or B, but not at the same time | |
// Type notes: | |
// Splashmap is a map with multiple key and value types, where keys map to only some of the types | |
// For example, in Splashmap!((A, A), (A, B), (B, B)): |
Just some Lua snippets. |
var WOLFRAM_KEY = "<API KEY GOES HERE>"; | |
var local_cache = {}; | |
function wolfram_api_call(query, key) { | |
var response = UrlFetchApp.fetch("http://api.wolframalpha.com/v2/query?input=" + encodeURIComponent(query) + "&appid=" + key + "&format=plaintext"); | |
var xml = XmlService.parse(response); | |
var root = xml.getRootElement(); | |