Bowling FRI

28
May
2

Danes je ŠOFRI organiziral bowling za FRIjevce. Na žalost sem prišel šele kasneje in nisem igral. Od znancev, ki so igrali, je bil daleč najboljši Jure Ham. Vse skupaj se je odvijalo v BTC Areni (poleg Koloseja). Če je komu uspelo izvesti “strike” 3x zapored, je dobil žirafo (veliko piva :) ). Uspelo je kar 4im, potem pa je ŠOFRIju očitno zmanjkalo denarja :P Nam na žalost ni uspelo, je pa Hamu uspelo 2x zapored :)

Dve (slabši) slikci:

27052009029 27052009030

Btw tisto na mizi v resnici niso anal-plugi, ampak podložki za žirafe.

Posted under Social

Utrinki: NT Konferenca

26
May
0

Prihod:

25052009015

25052009016

Vmes smo šli malo v morje:

25052009018

In zaključek v pivskem stilu:

25052009021

25052009022

25052009027

Slikca iz webmaster piknika

26
May
0

Evo sem le dobil eno kjer sem gor (na levi):

HAD_0184

Tole pa je en video iz piknika ko je nekdo igral rock band in so failal pred koncem komada :)

Webmaster piknik

24
May
0

Fun. Sem bil in je blo zakon :)
wwwp
Več:
http://www.had.si/blog/2009/05/24/wwwp-www-piknik-je-bil-odlicen/
http://www.mikec.si/2009/05/webmaster-piknik-milje-pri-kranju.html

Kameleon – Uletu sm u disko

23
May
0

Neverjetno.

Youtube komentar: “o lol, ti bi bil v šoli za posebne potrebe častni gost”
”A ti sploh veš kaj je rima pa flow???”

Posted under Stuff

100% bosanac

23
May
1

msn2

lol.

Jogurt

20
May
0

548_big_0-1841Jogurt je zakon :) Najbolši je tekoči jogurt od ljubljanskih mlekarn… Mleko mi pa nikol ni preveč pasal. Kaj pa vi?

Tukej je en zanimiv blog post o tem: http://www.medrants.com/index.php/archives/2682

New idea for Windows Touch Remix

20
May
3

I’m going to do a quick-dial feature for Windows Touch Remix. I want to keep the code nice so it’ll take me a few days to get there, but this is how it looks at the moment (and how it’s supposed to look, anyway):

wtr2

Personally i kind of like the shading, what do you think? :)

F#.NET

17
May
0

F#.NET is a new functional language from Microsoft. It looks very promising, and here you can see a very good video presentation Luca Bolognese gave about it.

Fibonacci function

Snippet of the day: C#.NET configuration files

17
May
0

I’ll start with a longer snippet – handling configuration files in C#.NET. I used this in Windows Touch Remix.

This is the base class I use for my configuration classes:

[Serializable()]
public class XmlConf
{
    public static T FromFile<T>(string filename)
    {
        if (!File.Exists(filename)) return default(T);
        XmlSerializer ser = new XmlSerializer(typeof(T));
        StreamReader fs = new StreamReader(filename);
        T t = (T) ser.Deserialize(fs);
        fs.Close();
        return t;
    }

    public void Save(string filename)
    {
        XmlSerializer ser = new XmlSerializer(this.GetType());
        StreamWriter fs = new StreamWriter(filename, false);
        ser.Serialize(fs, this);
        fs.Close();
    }
}

Just subclass it and add your configuration properties:

    [Serializable()]
    public class MyConf : XmlConf
    {
        public int IntVal { get; set; }
        public string StrVal { get; set; }
    }

Make sure you use getters and setters like in the above example, so the values get serialized properly. Most .NET classes (like List) are serializable, but if you have properties of your own class, make sure they are serializable.

Here’s a usage example of saving and loading the configuration:

// Save
MyConf conf = new MyConf();
conf.IntVal = 100;
conf.StrVal = "hey";
conf.Save("my.conf");

// Load
conf = MyConf.FromFile<MyConf>("my.conf");
if (conf == null) new Exception("Configuration file not found.");
Console.WriteLine(conf.IntVal);
Console.WriteLine(conf.StrVal);