Skip to content

Instantly share code, notes, and snippets.

/**
* The Distribution type assumes works as follows:
* For any x Water Cells (._1) there are y Fishes (._2) and z Sharks (._3)
*/
type Distribution = (Int, Int, Int)
/**
* This object holds the Stream factory which
* is used to fill the Ocean with a given distribution.
* Needs the Ocean object to query an empty cell, but does
  • projekt
    • data (nicht im VCS)
      • typo3temp
      • uploads
      • fileadmin
    • src (im VCS)
      • typo3conf
      • resources
  • css
import scala.collection.mutable._
class Foo {
}
object Foo {
trait Transform[-A >: B, B, +R[_] <: Set[_]] {
def apply(a: A) : R[B]
}
ERLC = erlc -v +debug_info
SRC = src/
TARGET = bintest1/
DIRS = client/ server/ /
compile:
-mkdir $(TARGET);
set_neighbors([VeryFirst | [VerySecond | Tail]]) ->
set_neighbors([VeryFirst | [VerySecond | Tail]], VeryFirst, VerySecond).
set_neighbors([SecondToLast | [Last | []]], VeryFirst, VerySecond) -> % Only two elements left
%.io:format("L: ~p M: ~p R: ~p~n", [SecondToLast, Last, VeryFirst]),
%.io:format("L: ~p M: ~p~n", [Last, VeryFirst]),
log ! { "GGT Prozess (~p) über linken (~p) und rechten (~p) Nachbarn informiert~n", [Last, SecondToLast, VeryFirst] },
log ! { "GGT Prozess (~p) über linken (~p) und rechten (~p) Nachbarn informiert~n", [VeryFirst, Last, VerySecond] },
ok;
var produkteZuAngebot = (
from u in produkte
let produkt = Produktverwaltung.ProduktMitId(u.Key)
select new ProduktZuAngebot {Angebot = angebot, Menge = u.Value, Produkt = produkt}
).ToList();
angebot.ProduktAngebote = produkteZuAngebot;
#!/usr/bin/env python
# -*- coding: utf8 -*-
# T → g(b|c)d
import sys
parseInput = sys.argv[1]
from Queue import Queue
from Queue import Empty
import threading
import time
def queueGetNowait(queue):
try:
return queue.get_nowait()
except Empty:
@x3ro
x3ro / gist:1917473
Created February 26, 2012 16:06
Weird PHP file-upload form behaviour
<?php
if( isset($_POST['submitted']) ) {
var_dump($_POST);
var_dump($_FILES);
}
?>
<!DOCTYPE html>
<html>
<head>
<title>PHP File Upload</title>
@x3ro
x3ro / net_http_debug.rb
Created May 2, 2012 17:16 — forked from kaiwren/net_http_debug.rb
Enable debug for all Ruby HTTP requests
require 'net/http'
module Net
class HTTP
def self.enable_debug!
class << self
alias_method :__new__, :new
def new(*args, &blk)
instance = __new__(*args, &blk)
instance.set_debug_output($stderr)
instance