Skip to content

Instantly share code, notes, and snippets.

View jesjos's full-sized avatar

Jesper Josefsson jesjos

  • Mariehamn, Åland
View GitHub Profile
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
entity arbit3 is
port (
reset : in std_logic;
r : in std_logic_vector(2 downto 0) ;
g : out std_logic_vector(2 downto 0)
) ;
@jesjos
jesjos / kangastus.txt
Created March 3, 2011 12:07
Oranssi Pazuzu - Kangastus 1968 (incomplete
Olen matkalla ajatusten taa' // Jag är på en resa (till bakom) bortom tankarna
Matkalla rakenteiden taa' // På en resa bortom strukturerna
Näkymättymän huoneen portista // Ut genom det osynliga rummets port
Autiomaan viileään tuuleen // (In i) till ödelandets svala vind
Olen matkalla ajatusten taa' // Jag är på en resa bortom tankarna
Vihreän savupilven sisään // In i det gröna rökmolnet
Missä unet herävät koomastaan // Där drömmarna vaknar från sin koma
On seinät kuplivia värejä // Väggarna är bubblande färger
-module(test).
-export([t3/0, t5/1]).
t3() ->
T4 = spawn_link(fun() -> t4() end),
T4! {found, {apa, bepa}, []},
io:format("Send message~n").
t4() ->
receive
@jesjos
jesjos / test.erl
Created February 26, 2011 11:35
Erlang test
main2() ->
spawn(callhome(self)),
receive
done ->
io:format("Done!",[])
end.
callhome(Main) ->
callhome(Main, 10).
process mainLoop {
MyTime t;
while (numberOfDrinks < Constants.MAX_DRINKS) {
t = new MyTime(clock.getTime().getValue());
drink = orderQueue(myOrder, t);
if (drink instanceof Landlord.Refusal) {
System.out.println("Customer says: I was refused!!!! I'll return later with an AK-47 and blast the place.");
break;
}
numberOfDrinks++;
@jesjos
jesjos / gist:827639
Created February 15, 2011 15:18
Skitspråk
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_unsigned.all;
entity bcd59 is
port (
clk, ce, reset : in std_logic;
count : out std_logic_vector(7 downto 0);
ceo : out std_logic
) ;
# views/layouts/application.html.haml
!!!
%html
%head
%body
%nav#menu
Some content
#wrapper
%section#content
= yield
@jesjos
jesjos / MMult.java
Created November 1, 2010 21:03
En matrismultiplikationsflärp
class MMult {
public static int[][] mult(int[][] a, int[][] b) {
int rows = a.length;
int elements = a[0].length;
int columns = b[0].length;
int[][] results = new int[rows][columns];
for (int n = 0; n < rows; n++) {
for (int m = 0; m < rows; m++) {
for (int i = 0; i < elements; i++) {
results[n][m] += a[n][i]*b[i][m];
HC1Mon Oct 11 09:00:00 +0200 2010Mon Oct 11 10:00:00 +0200 2010Mon Oct 11 13:15:00 +0200 2010Mon Oct 11 15:15:00 +0200 2010Tue Oct 12 08:00:00 +0200 2010Tue Oct 12 13:15:00 +0200 2010Wed Oct 13 08:00:00 +0200 2010Wed Oct 13 10:00:00 +0200 2010Wed Oct 13 13:15:00 +0200 2010Thu Oct 14 10:00:00 +0200 2010Thu Oct 14 13:15:00 +0200 2010Fri Oct 15 08:00:00 +0200 2010Sat Oct 16 08:00:00 +0200 2010Mon Oct 18 08:00:00 +0200 2010Tue Oct 19 08:00:00 +0200 2010Wed Oct 20 08:00:00 +0200 2010Thu Oct 21 08:00:00 +0200 2010Fri Oct 22 08:00:00 +0200 2010Sat Oct 23 08:00:00 +0200 2010Mon Oct 25 08:00:00 +0200 2010Mon Oct 25 10:00:00 +0200 2010Mon Oct 25 13:15:00 +0200 2010Mon Oct 25 15:15:00 +0200 2010Tue Oct 26 10:00:00 +0200 2010Wed Oct 27 08:00:00 +0200 2010Wed Oct 27 10:00:00 +0200 2010Wed Oct 27 13:15:00 +0200 2010Thu Oct 28 10:00:00 +0200 2010Thu Oct 28 13:15:00 +0200 2010Fri Oct 29 08:00:00 +0200 2010Fri Oct 29 13:15:00 +0200 2010HC2Mon Oct 11 10:00:00 +0200 2010Mon Oct 11 13:15:00 +0200 2010Tue Oct 12 10:00:00 +0200 20
@jesjos
jesjos / calendar.rb
Created October 17, 2010 21:42
model
class Calendar < ActiveRecord::Base
def self.get_rooms
c = Marshal.load(Calendar.last.cal_dump)
events = {}
c.events.each do |c|
if events.has_key? c.location
events[c.location].push(c.occurences.first)
else
events.store(c.location, Array[c.occurences.first])
end