Thursday, January 27, 2011

Visual Studio Achievements

http://blog.whiletrue.com/2011/01/what-if-visual-studio-had-achievements/

My achievements :)

Falling Down – Created a new SharePoint project

The Portal – Created a circular project dependency

The Multitasker – Have more than 50 source files open at the same time

Highway to Hell – Successfully created a WCF service

Rage Quit – ALT+F4 after a failed bug fix “Fine solution :)”

Warm Bath – Successfully consumed a non .NET SOAP web service

Old School – Defined more than 100 static objects

The Cloner – Copy-pasted more than 50 lines

I like that I wish VS gives us badges.

Thursday, January 20, 2011

Linq Spagetti

 //Property Options
            IDictionaryAdvertPropertyint> advertPropertyGroupList =
    (from r in resultPropertyOption
     where r.AdvertPropertyID != null && r.AdvertPropertyOptionID != null && r.OptionCount != 0
     group r by r.AdvertPropertyID into g
     select
        new
        {
            C = new EmlakMilliyet.Service.Model.AdvertSearch.AdvertProperty
            {
                Id = (int)g.Key.Value,
                Name = this.AdvertLookupDataService.GetAdvertProperty((int)g.Key.Value).Name,
                Options =
                    (from v in g
                     select
                        new
                        {
                            L = this.AdvertLookupDataService.GetAdvertPropertyOption((int)g.Key.Value, (int)v.AdvertPropertyOptionID) ?? new AdvertPropertyOption
                            {
                                Id = 0,
                                Name = "",
                                SearchOptionOrder = 0
                            },
                            TotalCount = g.Where(w => w.AdvertPropertyOptionID == v.AdvertPropertyOptionID).Sum(a => a.OptionCount.GetValueOrDefault())
                        })
                     .OrderBy(o => o.L.Name)
                     .ToDictionary(p => p.L, p => p.TotalCount)
            },
            TotalCount = g.Sum(a => a.OptionCount.GetValueOrDefault())
        }).OrderBy(o => o.C.Name).ToDictionary(p => p.C, p => p.TotalCount);

Wednesday, January 19, 2011

Public Shame

“The public shaming is far more effective than fear of being fired.”

http://framethink.wordpress.com/2011/01/17/how-facebook-ships-code/

A bug can cause bigger effects.

Wednesday, January 12, 2011

Tuesday, January 11, 2011

Tuesday, January 04, 2011

Command Query Separation

http://martinfowler.com/bliki/CommandQuerySeparation.html

http://en.wikipedia.org/wiki/Command-query_separation

Queries: Return a result and do not change the observable state of the system (are free of side effects).

Commands: Change the state of a system but do not return a value.

Saturday, January 01, 2011

Game Theory

http://en.wikipedia.org/wiki/Benjamin_Polak   

http://en.wikipedia.org/wiki/Open_Yale_Courses -- Open Yale Courses

http://oyc.yale.edu/economics/game-theory/contents/syllabus.html -- This lesson I started to watch and learn.

Keynotes of Lesson 1

You should never play a strictly dominated strategy - Pareto Efficiency - http://en.wikipedia.org/wiki/Pareto_efficiency

Rational play by rational players can lead to bad outcomes - Price wars

To figure out what actions you should choose in a game, a good first step is to figure out what are your payoffs (what do you care about) and what are other players' payoffs.

If you do not have a dominated strategy, put yourself in your opponents' shoes to try to predict what they will do. For example, in their shoes, you would not choose a dominated strategy.

Yale students -Let's say people- are evil.

 

I like very much Open Yale Courses and Ben Polack :)