26 January 2011

New stream

Hey, I am working on my first WP7 application these days.
First one will be very simple - it is just to get a try of the market place. Simplest I could think about - a list of irregular verb. Design is ready and I am loading it with the data.

13 January 2011

New Year Resolution: Disconnecting

I was deeply impressed yesterday after I listened Disconnect chapter of ThisDeveloperLife.
I decided to give up one of social network that eats 5-7 hours of my life every week. Lets stick to this!

23 November 2010

Back to Zimmermann

I did some research on the problem. Yes, previous solutions was mine (apart of permutation generation algorithm). This time I research the problem itself. It is known as Reverse Shuffle Problem and it goes back into 1973.
I found math article. 20 pages, It is half in English and half in Greek symbols. Gash! I haven't seen so many math since university!

It gave me push and I think I can a little bit increase the score. I started from other end and already (3 hours) I got sequence of 1434 reversals for number 97. I am going to run my number crunching recursion starting from their magic starting point. Will see what comes from this.

22 November 2010

Me on Al Zimmermann's Programming Contests

I am taking part in Al Zimmermann Contest Task is complicated because of number of combinations. It is N! and task should be sold for 25 sets for primes from 2 to 97.

Since problem was published on Nov 16 I attacked task from different angles. I optimized code and changed algorithm. Number of n! is huge. Computation power available to me cracks up to 200M combinations per second. 200 millions combinations per second is fast - I started with 100 thousands per second.
I solved all numbers less then 17. But 17! = 355687428096000 and brutal force will review all combination in 41 days. (For comparison, solution for 13 takes 30 seconds). The longest set I manage to found is 389 steps for 43. That gives me 10 (currently 10.47) points of 25 points maximum.

There must be some trick others know and I don't!

Another point I want to express. Last week was the happiest week in professional sight. My brain was spinning around the problem: pen an paper, coding, code profiling, optimisation, leave computer for night, for a days and raising my score. I was so exciting when I invented new approach and this gave me jump from 500k to 10 millions of combinations. Crunch crunch! Then recursion and I have hundreds on millions! Then I was thought I could solve it. I mean like equation. Heart was beating! And nope it doesn't work in that way. But it gave me another couple days to work on it.
Honestly I don't remember when I had such high feeling in professional life. This task raised me beyond and above what I was coding last years.

I also working on solutions for Euler project. This is became a sort of hobby. Besides of brain exercise to find algorithm I am progressing from ad hoc solutions (when amount of task was less then 20) to a framework for library of tasks. My next idea is attach tasks to silverlight facade and host it. It might become a benchmark for heavy computations for Silverlight.
What strike me few days ago is that such platform could he a host for distributed computations. Everyone who has spare processor cycles can open a web page with Silverlight application, click a buttons and help world to solve a problem. I went further - think about mobile phones! you put it on charge and start computation. You give away half an hour of your 500Mhz - 1GHz! What a supercomputer we could build!!!

17 July 2010

Solved next Euler task!
It is relatively simple brutal force solution but on big numbers. It took me longer than expected... My own BigNumber class fails somehow on division operation. Found two new bugs in it! have then fixed. All unit-tests were green and are even more green than ever, but solution is incorrect.
Eventually moved to System.Numerics.BigInteger (thanks .net4). Bingo!

NB: Need to return to .Division and fix it. Can run this calculation and compare result between my BigNumber and BigInteger.

btw, I made good progress since last post. I have 43 solved at the moment and coming. Somebody plays against my clock and even I am pushing problems I stay at the same rank as she or he jumps ahead.

11 October 2009

20 done

20 problems solved!

Now I have routines that can add, subtract, multiply, divide and even get factorial of really big numbers.

05 June 2009

Ages ago I created a structure of nested master pages for a web-site I working on.
It works fine. Not without teething glitches, but it works.

Today I noticed warnings in a build.
We have Page_Load in each masterpage and it warns about the fact one hides another...

Searching for best practice samples I found this article.

26 May 2009

swoopo.com - funny game
List.Find(Predicate) - usage with lambda
TypeMock and asp.net - when and how we are going to test it?
TeamCity and its build server - isn't it just department of Microsoft?
Ford Mondeo 05, 2l, 70kmiles

19 May 2009

It is good to know <div><\div> and <div />  are different

14 May 2009

  • how pass delegate as a parameter
  • how asp Button serve OnCommand event
  • pair of tags for bullets ul and li
  • lots of Citroen C4 reviews

05 January 2009

when *.designer.cs is out of sync

In asp.net every page or control has three parts:
  • asp markup part (*.aspx, *.ascx) - that is where you build a structure of you web page or control;
  • *.cs - that is where you put your code behind
  • *.design.cs - that is werd side which suppose to be controlled by IDE (Visual Studio), it contains all identities of every control on your page.
It happens, it happens too often to me that *.desing.cs file get out of sync with mark-up. It usually happens when I rename or move User Control and fix namespace etc. Code doesn't compile, or could not find a control by name. 

Today I came quite severe case of such misbehaviour and maybe I spent 30 minutes or so back and forward and trying to resolve it.
I found solution browsing forums:
  1. Delete the desing.cs file
  2. Right Click on the file, Convert to Web Application.

It might react with Generic Exception or even NotImplemented Exception. :) Do not worry - Exit Studio, delete all files in bin and obj folders and Open your solution again. Then repeat attempt to Convert to Web Application. 

24 October 2008

rollback a changeset and shelve it

A little bit of history. I commit a changeset a while ago. A client doesn't want to see it in next release. So I like to extract my changes, but save it for future. Yep, my code in TFS.

There is no right-click-command to rollback changes. But! There is tfpt rollback from power tool. You need to run "tfpt rollback /changeset:N "from the source folder. This will take all latest from the server then present you a list of files from the changeset and roll-back it happy ever after. Your change extracted from the code base. Hey, how can I shelve it now?..

First of all it is quite scary to click "Rollback". There is no any kind of disclaimer what actually happen. What is it going to purge your changeset from the history? Nope. It will update your local files to the state they were before the changeset (somehow it will resolve conflicts if any) and you get list of files from the changset but in reverse direction which you can check in.

But there is no way to shelve a changeset.

Addition:
Actually there is one.
Check-in your changes (of roll back) and then note a change set you just created. Perform rollback again but with number of rollback operation. You will get a changes you rolled back which are actually changes you like to shelve. Shelve it. Smile and Enjoy for the moment. Then Undo this changes.



07 July 2008

Magic ~

When you need a local path for your web service or aspx path you may exercise Server.MapPath("~") to get a folder or Page.ResolvePath(@"~/image/"). The key symbol is ~ which is translated to a local path.

Enjoy .net responsive!

03 July 2008

Who noticed the world has flipped over:
"registration fee that's already the lowest in the industry - and we charge in U.S. DOLLARS!" "Use the dollar to your advantage and get the most from your IT budget."

The fact that dollar loosed its positions presented as an advantage...

24 June 2008

Tricks with Flex compiler:

1) "120" + 30 = "12030"

and if you pass this to function with int parameter it will receive 12030 as integer. No warnings given.

2) Alert.show("Warning: " + + message);
appears as "Implicit coercion of a value of type String to an unrelated type Number

19 May 2008

I installed DiffMerge from SourceGear. I like how it highlights changes in a part of expression. But sometimes it go mad and starts showing rainbow of similar symbols in two methods. I need probably show a snapshot of best example.
I am trying to use it as merge tool and it not simple to set command line for it. But thanks
Keith Craig and James Manning as original source.