This file contains 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
// Copyright (C) 2011 by Christoph Hack. All rights reserved. | |
// Use of this source code is governed by the New BSD License. | |
/* | |
This program contains a simple micro-benchmark for a Disruptor [1] like | |
event buffer (or at least what I think that Disruptor might be). There | |
isn't any kind of API yet and this test is currently limited to a | |
single producer - single consumer architecture, but generally the | |
architecture of Disruptor is also well suited for multiple producers and | |
consumers. |
This file contains 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
// Problem: | |
// The green and red area (and the intersection) receive | |
// click events (press and release). | |
// The green area also receives hover events (enter and leave), | |
// but the red one does not. | |
package main | |
import ( | |
"image" |
This file contains 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
//------------------------------------------------------------------------------ | |
// siren.c | |
// | |
// A small example program to demonstrate the handling of binary files. | |
// | |
// Compile with: | |
// gcc -Wall -lm -o siren siren.c | |
// | |
// Group: 11 study assistant Christoph Hack | |
// Authors: Christoph Hack <prog-tutor-hack@iicm.tugraz.at> |
This file contains 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
package main | |
import ( | |
"fmt" | |
"log" | |
"reflect" | |
"tux21b.org/v1/gocql" | |
) |
This file contains 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
package main | |
import ( | |
"html/template" | |
"log" | |
"net/http" | |
) | |
var tmpl = template.Must(template.New("").Parse(` | |
{{define "index"}}<!DOCTYPE HTML> |
This file contains 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 dreitermrek(s, n): | |
if n == 0: | |
return 1 | |
r1 = dreitermrek(s, n-1) | |
a = s(x*r1, r1) / s(r1, r1) | |
if n == 1: | |
return x - a | |
r2 = dreitermrek(s, n-2) | |
b = s(r1, r1) / s(r2, r2) | |
return ((x - a) * r1 - b * r2).expand() |
This file contains 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
// The "atomic.h" file provides low-level atomic memory primitives for the | |
// x86 plattform. All functions in this file provide sequential memory | |
// consistency. | |
// atomic_load atomically loads *addr. | |
static inline int atomic_load(int *addr) | |
{ | |
int val = *(volatile const int*)(addr); | |
__asm__ __volatile__ ("" ::: "memory"); |
This file contains 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
package main | |
import ( | |
"fmt" | |
irc "github.com/fluffle/goirc/client" | |
"html/template" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"net/url" |
This file contains 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
DROP KEYSPACE gocql_wiki; | |
CREATE KEYSPACE gocql_wiki | |
WITH strategy_class = 'SimpleStrategy' | |
AND strategy_options:replication_factor = 1; | |
USE gocql_wiki; | |
CREATE TABLE page ( | |
title varchar, |
This file contains 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
a b c d e f g h | |
8 . . r . . . . . 8 | |
7 . . . . . . . . 7 | |
6 . . . . . . . . 6 | |
5 . . . k . . . . 5 | |
4 . . . . . . . . 4 | |
3 . . . . . N . r 3 | |
2 . K . . . P . . 2 | |
1 . . . . . . . q 1 | |
a b c d e f g h |
NewerOlder