(assuming that you already have a residence permit card)
(from the day when you have your residence permit)
- ~2-3 weeks to get a Chalmers student union card
- ~2-3 weeks to receive personnummer
import qualified Data.ByteString as B | |
import Control.Monad.ST( runST ) | |
import Codec.Picture.Jpg.DefaultTable | |
import Codec.Picture.BitWriter | |
import Data.Word(Word8) | |
import Control.Monad(forM_) | |
goodTree :: HuffmanTree | |
goodTree = Branch (Leaf 1) (Branch (Leaf 2) (Leaf 3)) |
diff --git a/Codec/Picture/Jpg/DefaultTable.hs b/Codec/Picture/Jpg/DefaultTable.hs | |
index d1ff914..4582ecd 100644 | |
--- a/Codec/Picture/Jpg/DefaultTable.hs | |
+++ b/Codec/Picture/Jpg/DefaultTable.hs | |
@@ -75,7 +75,7 @@ packHuffmanTree tree = runST $ do | |
aux (Branch i1 i2@(Leaf _)) idx = do | |
ix1 <- aux i1 (idx + 2) | |
_ <- aux i2 (idx + 1) | |
- (table `M.unsafeWrite` idx) (fromIntegral ix1) | |
+ (table `M.unsafeWrite` idx) (fromIntegral $ idx + 2) |
{-# LANGUAGE ExistentialQuantification #-} | |
import Control.Applicative | |
import qualified Data.Vector as V | |
data Tree a = Node (V.Vector (Tree a)) | |
| Leaf a | |
deriving Show | |
class Switchable c where |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
-- import Data.Monoid | |
-- The associativity order does not matter, | |
-- emphasizing it by omitting parantheses. | |
infixr 5 :& | |
type a :& b = (a,b) |
{-# LANGUAGE BangPatterns #-} | |
import Data.List | |
import Data.Int | |
import Data.Maybe | |
import qualified Data.ByteString.Lazy.Char8 as BS | |
-- ------------------------------------------------ | |
data TEventType = Start | Finish -- XXX: Start < Finish |
import random | |
from collections import deque | |
class GBNSender: | |
def __init__(self): | |
self.to_send_idx = 0 | |
self.transmitted = 0 | |
def get_msg(self): | |
msg = {'idx': self.to_send_idx} |
{-# LANGUAGE | |
GADTs | |
, FlexibleContexts | |
, RankNTypes | |
, ScopedTypeVariables #-} | |
import Data.Word | |
import Data.List( find, sortBy ) | |
import Data.Maybe( fromJust ) |