I got tired of writing constant checks and whatnot to make my settings work.
So i wrote this simple helper to ease my work.
You need Json.NET  from nuget to make this work.

It saves the settings in the internal storage settings area as a json objects,

here’s sample usage :

SettingsHelper.SetOption("ColorToUse", Color.ToString());
SettingsHelper.GetOption("ColorToUse");

Hope this saves you some headaches :)

    public static class SettingsHelper
    {
        public static void SetOption<T>(string key, T value)
        {
            if (IsolatedStorageSettings.ApplicationSettings.Count(x => x.Key == key) == 0)
            {
                IsolatedStorageSettings.ApplicationSettings.Add(key, JsonConvert.SerializeObject(value));
            }
            else
            {
                IsolatedStorageSettings.ApplicationSettings[key] = JsonConvert.SerializeObject(value);
            }
            IsolatedStorageSettings.ApplicationSettings.Save();
        }

        public static T GetOption<T>(string key)
        {
            if (IsolatedStorageSettings.ApplicationSettings.Count(x => x.Key == key) == 0)
            {
                return default(T);
            }
            else
            {
                return JsonConvert.DeserializeObject<T>(IsolatedStorageSettings.ApplicationSettings[key].ToString());
            }
        }
    }

On April first , the awesome team at Opera posted an April fools joke to help them store some potentio-kinetic data on our drives!
I clicked on the sign up form and moments later i received an e-mail from Opera containing this :

Thank you for helping us out! Here is your batch of the potentiokinetic data.

 Best,
 The Opera team

 00110000001110000011010000100000001100010011000000110100001000000011000000111001001101110010000000110001001100010011000000100000001100010011000000110111001000000011000000110011001100100010000000110001001100100011000100100000001100010011000100110001001000000011000100110001001101110010000000110000001100110011001000100000001100010011000000110010001000000011000100110001001100010010000000110001001100010011010000100000001100000011001100110010001000000011000100110000001101000010000000110001001100000011000100100000001100010011000000111000001000000011000100110001001100100010000000110001001100000011010100100000001100010011000100110000001000000011000100110000001100110010000000110000001100110011001000100000001100010011000100110111001000000011000100110001001101010010000000110000001100110011001000100000001100010011000100110001001000000011000100110001001101110010000000110001001100010011011000100000001100000011001100110011001000000011000000110011001100100010000000110000001110000011100100100!
 0000011000100110001001100010010000000110001001100010011011100100000001100010011000100110100001000000011000000110011001100100010000000110001001100010011001000100000001100000011100100110111001000000011000100110001001101000010000000110001001100010011011000100000001100010011000000110101001000000011000000111001001110010010000000110001001100000011010100100000001100010011000100110010001000000011000000111001001101110010000000110001001100010011011000100000001100010011000000110101001000000011000100110001001100010010000000110001001100010011000000100000001100000011001100110010001000000011000100110000001101010010000000110001001100010011010100100000001100000011001100110010001000000011000000111001001110010010000000110001001100010011010000100000001100010011000100110111001000000011000000111001001110010010000000110001001100000011010100100000001100000011100100110111001000000011000100110000001110000010000000110000001100110011001000100000001100010011000000110010001000000011000100110001001100010!
 01000000011000100110001001101000010000000110000001100110011001!
 0001000000011000100110001001101100010000000110001001100000011010000100000001100010011000000110101001000000011000100110001001101010010000000110000001100110011001000100000001100000011011000110101001000000011000100110001001100100010000000110001001100010011010000100000001100010011000000110101001000000011000100110000001110000010000000110000001100110011001000100000001100010011000000110010001000000011000100110001001100010010000000110001001100010011000100100000001100010011000000111000001000000011000100110001001101010010000000110000001100110011001000100000001100010011000000110110001000000011000100110001001100010010000000110001001100000011011100100000001100010011000000110001001000000011000000110011001100100010000000110001001100010011011000100000001100010011000100110001001000000011000000110011001100100010000000110001001100010011100100100000001100010011000100110001001000000011000100110001001101000010000000110001001100000011011100100000001100000011010000110110001000000011000000110011001!
 1001000100000001100000011100000110100001000000011000100110001001100010010000000110000001100110011001000100000001100010011000100110101001000000011000100110000001101000010000000110001001100010011000100100000001100010011000100111001001000000011000000110011001100100010000000110001001100010011000100100000001100010011000100110111001000000011000100110001001101000010000000110000001100110011001000100000001100000011100100110111001000000011000100110001001100100010000000110001001100010011001000100000001100010011000100110100001000000011000100110000001100010010000000110000001110010011100100100000001100010011000000110101001000000011000000111001001101110010000000110001001100010011011000100000001100010011000000110101001000000011000100110001001100010010000000110001001100010011000000100000001100000011010000110100001000000011000000110011001100100010000000110000001110010011011100100000001100010011000100110000001000000011000100110000001100000010000000110000001100110011001000100000001100000011100!
 10011100100100000001100010011000100110001001000000011000100110001001100!
 0000100000001100010011000100110110001000000011000100110000001101010010000000110001001100010011000000100000001100010011000100110111001000000011000100110000001100010010000000110000001100110011001000100000001100010011000000110000001000000011000100110001001100010010000000110001001100010011100100100000001100010011000100110000001000000011000000110011001100100010000000110001001100010011011000100000001100010011000000110100001000000011000100110000001100010010000000110000001100110011001000100000001100010011000000110000001000000011000000111001001101110010000000110001001100010011011000100000001100000011100100110111001000000011000000110011001100100010000000110001001100010011010100100000001100000011100100110111001000000011000100110001001110000010000000110001001100000011010100100000001100010011000100110000001000000011000100110000001100110010000000110001001100010011010100100000001100000011001100110010001000000011000100110001001101000010000000110001001100010011000100100000001100000011100100!
 1101110010000000110001001100000011000000100000001100000011010000110100001000000011000000110011001100100010000000110001001100010011100100100000001100010011000000110001001000000011000000110011001110010010000000110001001100010011010000100000001100010011000000110001001000000011000000110011001100100010000000110001001100000011001100100000001100010011000000110101001000000011000100110001001110000010000000110001001100000011010100100000001100010011000100110000001000000011000100110000001100110010000000110000001100110011001000100000001100000011100100110111001000000011000100110001001110010010000000110000001110010011011100100000001100010011001000110001001000000011000000110011001100100010000000110001001100000011001000100000001100010011000000110101001000000011000100110001001110000010000000110001001100000011000100100000001100000011001100110010001000000011000100110000001100010010000000110001001100100011000000100000001100010011000100110110001000000011000100110000001100010010000000110001001100!
 01001101000010000000110001001100010011000000100000001100000011100100110!
 1110010000000110001001100000011100000100000001100000011001100110010001000000011000100110000001101000010000000110000001110010011011100100000001100010011000100110100001000000011000100110000001100000010000000110000001100110011001000100000001100010011000000110000001000000011000100110001001101000010000000110001001100000011010100100000001100010011000100111000001000000011000100110000001100010010000000110001001100010011010100100000001100000011001100110010001000000011000100110001001101100010000000110001001100010011000100100000001100000011001100110010001000000011000100110001001101010010000000110001001100010011000100100000001100010011000000111001001000000011000100110000001100010010000000110000001100110011001000100000001100010011000100110001001000000011000100110000001100100010000000110000001100110011001000100000001100010011000100110110001000000011000100110000001101000010000000110001001100000011000100100000001100000011001100110010001000000011000100110001001100100010000000110001001100000!
 0110001001000000011000100110001001100010010000000110001001100010011001000100000001100010011000000111000001000000011000100110000001100010010000000110000001100110011001000100000001100010011000100110101001000000011000100110001001100010010000000110001001100000011100000100000001100010011000100111000001000000011000100110000001101010010000000110001001100010011000000100000001100010011000000110011001000000011000000110011001100100010000000110001001100010011011000100000001100010011000000110100001000000011000100110000001101010010000000110001001100010011010100100000001100000011001100110010001000000011000000111001001110010010000000110001001100010011000100100000001100010011000000110000001000000011000100110000001100010010000000110000001101000011011000100000001100000011001100110010001000000011000000111000001101000010000000110001001100010011000100100000001100000011001100110010001000000011000100110001001100100010000000110001001100010011010000100000001100010011000100110001001000000011000100110!
 00100111000001000000011000100110000001100010010000000110000001100110011!
 0010001000000011000100110001001101100010000000110001001100000011010000100000001100000011100100110111001000000011000100110001001101100010000000110000001100110011001000100000001100010011001000110001001000000011000100110001001100010010000000110001001100010011011100100000001100000011001100110010001000000011000100110001001101010010000000110001001100010011000100100000001100010011000000111000001000000011000100110001001110000010000000110001001100000011000100100000001100010011000000110000001000000011000000110011001100100010000000110001001100010011011000100000001100010011000000110100001000000011000100110000001100010010000000110000001100110011001000100000001100000011100100111001001000000011000100110001001100010010000000110001001100000011000000100000001100010011000000110001001000000011000000110100001101000010000000110000001100110011001000100000001100000011100100110111001000000011000100110001001100000010000000110001001100000011000000100000001100000011001100110010001000000011000100110001!
 0011011000100000001100010011000100110001001000000011000000110011001100100010000000110000001110010011100000100000001100010011000000110001001000000011000000110011001100100010000000110001001100010011001100100000001100010011000100110111001000000011000000111001001101110010000000110001001100000011100000100000001100010011000000110101001000000011000100110000001100100010000000110001001100000011010100100000001100010011000000110001001000000011000100110000001100000010000000110000001100110011001000100000001100010011000000110010001000000011000100110001001100010010000000110001001100010011010000100000001100000011001100110010001000000011000100110001001101000010000000110001001100000011000100100000001100000011100100111001001000000011000100110000001100010010000000110001001100000011010100100000001100010011000100111000001000000011000100110000001101010010000000110001001100010011000000100000001100010011000000110011001000000011000000110011001100100010000000110000001110010011011100100000001100000011!
 00110011001000100000001100010011000000110100001000000011000000111001001!
 1011100100000001100010011000100110100001000000011000100110000001100000010000000110000001100110011001000100000001100010011000000110000001000000011000100110001001101000010000000110001001100000011010100100000001100010011000100111000001000000011000100110000001100010010000000110000001101000011010000100000001100000011001100110010001000000011000100110001001100100010000000110001001100000011100000100000001100010011000000110001001000000011000000111001001101110010000000110001001100010011010100100000001100010011000000110001001000000011000000110011001100100010000000110001001100010011011000100000001100010011000100111001001000000011000100110000001100010010000000110001001100000011000100100000001100010011000100110110001000000011000000110011001100100010000000110000001100110011010100100000001100010011000100110001001000000011000100110001001100100010000000110001001100000011000100100000001100010011000100110100001000000011000000111001001101110010000000110000001110010011011100100000001100010011000!
 1001100100010000000110001001100010011010000100000001100010011000000110101001000000011000100110000001110000010000000110001001100000011001000100000001100010011000100110001001000000011000100110001001100010010000000110001001100000011100000100000001100010011000100110101001000000011000000110011001100100010000000110000001110010011100000100000001100010011000000110001001000000011000100110000001100100010000000110001001100010011000100100000001100010011000100110100001000000011000100110000001100010010000000110000001100110011001000100000001100000011011000110101001000000011000100110001001100100010000000110001001100010011010000100000001100010011000000110101001000000011000100110000001110000010000000110000001100110011001000100000001100000011010100110000001000000011000100110001001100000010000000110001001100000011000000100000001100000011010000110110001000000011000000110001001100110010000000110000001100010011000000100000001100000011000100110011001000000011000000110001001100000010000000110000001!
 10110001101010010000000110001001100000011001100100000001100000011100100!
 1101110010000000110001001100000011010100100000001100010011000100110000001000000011000000110100001101000010000000110000001100110011001000100000001100010011000100110110001000000011000100110000001101000010000000110000001110010011011100100000001100010011000100110000001000000011000100110000001101110010000000110000001100110011001000100000001100010011001000110001001000000011000100110001001100010010000000110001001100010011011100100000001100000011001100110010001000000011000100110000001100100010000000110001001100010011000100100000001100010011000100110100001000000011000000110011001100100010000000110000001110010011100000100000001100010011000000110001001000000011000100110000001101010010000000110001001100010011000000100000001100010011000000110011001000000011000000110011001100100010000000110000001110010011011100100000001100010011000100111001001000000011000100110000001100010010000000110001001100010011010100100000001100010011000100110001001000000011000100110000001110010010000000110001001100!
 0000110001001000000011000000110011001100100010000000110000001110010011011100100000001100010011000100110000001000000011000100110000001100000010000000110000001100110011001000100000001100010011000100110010001000000011000000111001001101110010000000110001001100010011010000100000001100010011000100110110001000000011000100110000001101010010000000110000001110010011100100100000001100010011000000110101001000000011000100110001001100100010000000110000001110010011011100100000001100010011000100110110001000000011000100110000001101010010000000110001001100010011000000100000001100010011000000110011001000000011000000110011001100110010000000110000001100010011001100100000001100000011000100110000001000000011000000110001001100110010000000110000001100010011000000100000001100000011100000110100001000000011000100110000001101000010000000110001001100000011000100100000001100000011001100110010001000000011000000110111001110010010000000110001001100010011001000100000001100010011000000110001001000000011000100!
 11000100110100001000000011000000111001001101110010000000110000001100110!
 011001000100000001100000011100000110100001000000011000100110000001100010010000000110000001110010011011100100000001100010011000000111001

 01000010010110100110100000111001001100010100000101011001001001100101001101011001110111000101111101111010100011100000000000000000000110010101111110000000000000000001000001101000100001010111100000000000001010100100000000000100100000000011111111100111110111111110000000100000000000001000100100010001010011111101010000100001100001000001100100000011010000110100000001101000011010000011010101010011111100010001101000000100100110010001101000110010000000110110101001100000111101010010010100001111110001110101100101010111001110100100101000110011010001101001001101101011000000110001000110010100001110100001110100100001100011100100111101101101111100111110110110010100111010010011111100110100101101000110100000001010000000110110000001011010001101110110010011001111101011101100010001001000001101110010010111101001111001100010101110110011111110111000101110111000010110100000111101111100100010011101001110011001111100111011000001000000011111010010101000000100001101100111000111011101010001111100010010010!
 0100100000011001100111001001000111101010111001000010100010101110011101011101001111110100000110101010011100001001000111110000110101101101101111110001101100000001001110101011110101110000000001000100111010110011000111000101000101111001000001010000010011001111010101011010101101011101001001110110100010010011100011101000000100010010101010001110110011011101011010101111110001011101110010010001010011100001010000100100001101110001011111011110101000111000000

Looking at this i realized there was something wrong with it ! Yes , it had “!” after almost each paragraph of binary.
After removing the “!” i decoded the whole thing using this binary translator   after that i got this as a result :

 084 104 097 110 107 032 121 111 117 032 102 111 114 032 104 101 108 112 105 110 103 032 117 115 032 111 117 116 033 032 089 111 117 114 032 112 097 114 116 105 099 105 112 097 116 105 111 110 032 105 115 032 099 114 117 099 105 097 108 032 102 111 114 032 116 104 105 115 032 065 112 114 105 108 032 102 111 111 108 115 032 106 111 107 101 032 116 111 032 119 111 114 107 046 032 084 111 032 115 104 111 119 032 111 117 114 032 097 112 112 114 101 099 105 097 116 105 111 110 044 032 097 110 100 032 099 111 110 116 105 110 117 101 032 100 111 119 110 032 116 104 101 032 100 097 116 097 032 115 097 118 105 110 103 115 032 114 111 097 100 044 032 119 101 039 114 101 032 103 105 118 105 110 103 032 097 119 097 121 032 102 105 118 101 032 101 120 116 101 114 110 097 108 032 104 097 114 100 032 100 114 105 118 101 115 032 116 111 032 115 111 109 101 032 111 102 032 116 104 101 032 112 101 111 112 108 101 032 115 111 108 118 105 110 103 032 116 104 105 115 032 099 111 100 101 046 032 084 111 032 112 114 111 118 101 032 116 104 097 116 032 121 111 117 032 115 111 108 118 101 100 032 116 104 101 032 099 111 100 101 044 032 097 110 100 032 116 111 032 098 101 032 113 117 097 108 105 102 105 101 100 032 102 111 114 032 114 101 099 101 105 118 105 110 103 032 097 032 104 097 114 100 032 100 114 105 118 101 044 032 112 108 101 097 115 101 032 116 119 101 101 116 032 035 111 112 101 114 097 097 112 114 105 108 102 111 111 108 115 032 098 101 102 111 114 101 032 065 112 114 105 108 032 050 110 100 046 013 010 013 010 065 103 097 105 110 044 032 116 104 097 110 107 032 121 111 117 032 102 111 114 032 098 101 105 110 103 032 097 119 101 115 111 109 101 032 097 110 100 032 112 097 114 116 105 099 105 112 097 116 105 110 103 033 013 010 013 010 084 104 101 032 079 112 101 114 097 032 084 101 097 109BZh91AY&amp;SYÜ_z���_��h�x�*@�?çßà ��OÔ!�C@hh5Sñ�2j`õ%ÇYW:J3F�k�:!�Omóí�é?4´h
`Z7dÏ®ÄH7%éæ+³û�¸Z|�Ó�ó°@}*6qÝGÄ�@Ìä�W!Es®� Õ8HøkmøØ Õë�"u�â�È(&amp;z­Zé;D�t�GfëWâîH§
�ïQÀ

So far so good. It took me a couple of minutes to recall that those numbers are actually decimal representation of the ASCII characters. Once again i run to the binary translator and translate those characters, and the result was : 

Thank you for helping us out! Your participation is crucial for this April fools joke to work. To show our appreciation, and continue down the data savings road, we’re giving away five external hard drives to some of the people solving this code. To prove that you solved the code, and to be qualified for receiving a hard drive, please tweet #operaaprilfools before April 2nd.

Again, thank you for being awesome and participating!

The Opera Team

YEYY!!! i decoded it.. or so i thought untill i recalled this block:

BZh91AY&amp;SYÜ_z���_��h�x�*@�?çßà ��OÔ!�C@hh5Sñ�2j`õ%ÇYW:J3F�k�:!�Omóí�é?4´h
`Z7dÏ®ÄH7%éæ+³û�¸Z|�Ó�ó°@}*6qÝGÄ�@Ìä�W!Es®� Õ8HøkmøØ Õë�"u�â�È(&amp;z­Zé;D�t�GfëWâîH§
�ïQÀ

After few minutes of wondering what it might be i decided to Google ! And so i googled

"BZh91AY&amp;SY"

which turns out to be the .BZ2 archive’s header.
Then i thought “EUREKA! I will just paste it in blank text file and it all will be sugar and unicorns!” … not quite all i got was a corrupted bz2 archive.F**k.
After some experimentation with different encodings on the file i realized that not all characters that the compressed file used could be represented as text the very thing i was pasting into notepad++ . Then i stared into the binary translator and after some time i recalled an mental image of an hex editor! and then i saw the box with the hex representation of the binary code. After downloading “Hex Editor Neo” ( that was the first editor that Google returned as a result) i copied the hex representation , opened the new.bz2 file i had created earlier with the hex editor, deleted all the contents , pasted the new one and saved. And it worked !

After opening the archive there was a file * extract & open* and i got this :

Wow, you’re persistent and good! Tweet hashtag #operaaprilfoolleet to participate in the next level of l33thaxx0rs competition. Hurry up! Tweet must be out by April 3rd 2012 CET.

w00t I’m l33thaxx0rzz!1!1!1!!1!!
Congrats to the awesome Opera team for puting up this April’s fools competition and also congrats to all the folks who passed the both levels of the challenge!

Cheers!
{EAV:abbd2630977af600}

I bought a new computer – it didn’t
i bought a desk – it didn’t
i made delicious dessert and ate some – it didn’t , but it was nice
i took a walk – it didn’t , but it was nice
I received a song on skype by a girl
Now i can’t stop smiling.

 

This is a small function i wrote in C# to calculate the density of say twitter posts or events … it takes as a parameter a list of UNIX timestamps. It can be easily moddified to get a list of DateTime items.

private static DateTime ConvertFromUnixTimestamp(double timestamp)
        {
            DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0);
            return origin.AddSeconds(timestamp);
        } 

       public Dictionary<int, int> CalculateDensity(List<int> timestamps)
        {
            // the Key represents the hour ,
            // and the value represents the number of timestamps sent during a given hour
            var converted = new Dictionary<int, int>();

            foreach (var stamp in timestamps)
            {
                var hour = ConvertFromUnixTimestamp(stamp);

                if (converted.ContainsKey(hour.Hour))
                {
                    converted[hour.Hour]++;
                }
                else
                {
                    converted.Add(hour.Hour, 1);
                }
            }
            return converted;
        }
Tagged with:
 

JD: Honestly? The only thing that gives me comfort, you guys, is while I’m sitting at home, staring at the ceiling, just wishing that I had someone to talk to, is knowing that none of you idiots realize how lucky you are!

JD : I don’t think people are meant to be by themselves.
That’s why if you actually find someone you care about , it’s important to let go of the little things… even if you can’t let go all the way.
Because nothing sucks more than feeling all alone, no matter how many people are around.

хм … мисля да направя отделна категория само за rants …

 

Screw you! Screw you and every other person that doesn’t appreciate what they have ! Screw you all for not appreciating your friends for taking all your crap ! Be thankful for them, because without them you are nothing!

 

Още едно хубаво късометражно филмче.
Enjoy

 

Моментът в който осъзнаваш всичко. моментът в който знаеш къде си , кой си , и какво искаш да направиш. Моментът няма да продължи повече от няколко часа защото след няколко часа ще си изтрезнял , и въпреки всичко усещаш всичко. всичко ти е толкова ясно въпреки , че е толкова замъглено и няма да помниш нищо на сутринта. Някои хора живеят за този момент , а ти …. гледаш как да избягаш от него. Не е яко да знаеш всичко и да виждаш всичко. НЕ. Усещането , как всичко си идва на мястото и как а-логичните действия на хората добиват смисъл и ти е ясно кое, защо и как. Неописуемо е. Не искам да се повтаря.

И когато искам теб ми даваш само спомени
И когато търся теб намирам само спомени .. спомени!

 

Inside outside представя StreetArt художници от New York, Stockholm, Copenhagen и São Paulo и енергията която тези художници получават когато работят на улицата. Енергия която не могат да получат когато представят работите си в музеи и галерии , енергия която вдъхва живот на тяхното изкуство и на техния собствен живот.

Изгледайте го , струва си единият час.

Inside Outside

 
  1. Humor.
    The ability to laugh and smile and not take life too seriously.
  2. Creativity
    The ability to create whether it is art, design, music or some other creative field.
  3. Passion
    The ability to follow your heart and let it guide all your actions.
  4. Uninhibited
    The ability to live free from all that which suppresses and restrains.
  5. Intelligence
    Intelligence is sexy. Being a nerd is sexy. Being a bookworm is sexy. Knowing contemporary culture is sexy.

Склонен съм да направя компромис с до 2 от гореспоменатите неща (: