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.

09 May 2008

Lucky day!

Hey! I won something!
I won a ringtone which my mobile cannot play - it is amr file.

It is strange Friday. I didn't change anything in a framework, instead I had 1.5 hour conference call and fixed 3 bugs.
You might think:
- No, it is NTFS
- No, hard drive is just 1 year old
- No, it is Vista and it has been tested for ages
- No, I always check in as soon as it is ready

But, it happened on Monday. When the deadline was on Friday and you need to finished and ship it "yesterday". Source folder with sources not check in for 2 working days reported corrupted and not accessible. Go change you pants and run check disk.

Post Mortem: I lost 4 hours waiting for data recovery application and check disk. No data has been lost. It was good lesson. Thanks!

11 April 2008

SOAP header between flex client and .net web server

There is no day without invention.
Seems to be a simple code, but I manage to kill two hours to make it work.
This helps. Don't bother chinese. It just works.

10 April 2008

LINQ to SQL readings

Still under impression after LINQ to SQL session from IMTC.
The first thoughts are:
  • wow it is quick and easy;
  • code is generated for me for nice visual tool
  • full way from database to LINQ interface and classes is available to use out of box
To the end of session I remembered TDD and scratched my head with how apply this to it. Also I've samples of ugly t-sql generated - SQL Profiler is you friend forever.

Few days later I noticed the articles in my RSS Reader. And today ate 8 articles by Ian Cooper:

Architecting LINQ to SQL applications, part 1

...
Architecting LINQ To SQL Applications, part 8


He shows samples of unit tests and set ranges for layers. He advices to use class attributes or xml notation files but not a visual designer for craft entities. Oops. :( My dream of software factory blown away.

In my case I have quite complex database (which is far away from ideal). My application one of few and respectably consumes part of tables. My current approach is to generate all classes for whole database and add extensions in partial classes.
My issues are:
  • merging changes of database structure from other branches
  • ugly database content, which I managed to insert into each entity
  • difficulties with testing
  • serialising entity for passing to presenter (which is not .net)

What I learned from these articles:
  • cover only entities the application is using. I got this already. Our generation tool covers whole database when generates nHibernate mapping structure. This automatically transforms each FK into IList. One day this should go...
  • In the examples he stores an entity in a repository - this allows replace it with mock for testing. I have in reverse - each entity must have a link repository in order to operate;
  • My model for user session in not complete. I need to decouple it into module and make it flexible in order to move application onto it;
  • LINQ to SQL is not a magic. It is another ORM created with lessons learnt (are they?) from the past. Yep, there is a visual design, but this is for simple projects.

22 February 2008

Today I meet interesting problem.
I have an XmlDocument and do a lot of manipulations with elements.
It appears that when I do element.SelectNodes(xpath) and in xpath I have something like //value it does search in whole document and not in the element itself.
Surprised and confused. After all what I done in xml to find this bugfeature.