Dejan's profileDejan's programing adven...BlogLists Tools Help

Dejan's programing adventures

Putting the FUN in FUNCTIONALITY

Dejan Fajfar

Occupation
Location
I rather like to let my deeds speak for me.
November 03

High fps slow motion compillation

 

Quote

YouTube - High fps slow motion compillation
  

What I was doing

A lot of time has passed by since my last blog post. One reason was that I have a little problem with my Internet connection, the problem being that I have non. Because of my constant moving around this does become a problem. But enough of that. The other reason and the one I find more important is my constant reading tick. Since one year I am reading a lot. Well for a person who never read a book for fun I find the last year quite interesting. It has gone so far that I am rather reading a book than watch a movie or the TV. But it has never been so extensive than in the last two months. Just to remind myself I am posting an image of the books I read in the last 60 to 70 days. I think that this is quite a lot.

My books

But all this book reading has quite an interesting side-effect. My friends now have a cheap alternative for Xmas presents.

September 11

Blogging on the go

I just bought and got used to my new little laptop, the ACER aspire ONE. To be hosed this was not the first choice for a laptop. But now that I have payed the 372 € for the Windows XP version I must admit that I am extremely satisfied with it.

Some people say that the screen resolution of 1024x600 px is to small. But if you consider that three years ago 15,4" laptops had a screen resolution of 1024x768 px (I know I had one of those) then you get to understand that this little screen packs quite a punch. In fact I find the screen to be extremely crisp and clear. The only problem could be that some things are to small to be comfortable for the naked eye.

One big thing that is bugging me is the wireless connector which is just failing from time to time and then fails to show up on reboot. But I guess a driver update could fix that issue.

Well all in all this is tech toy worth getting.

August 26

So stupit that you have wath it

 

Quote

YouTube - bobobo-bo bobobo - 001(1/3)
  

August 25

Star wars meets San Francisco

 

So You Think You Can Dance - Popping Battle

 YouTube - So You Think You Can Dance - Popping Battle

  

August 22

Condomned

 

Quote

YouTube - Condomned
  

August 13

Joining the twitter wave

Ok opened my twitter account a few days ago and now lets se if the twitter wave will catch on. If you are interested on following my twitter exploits just take a look at my twitter space at www.twitter.com/dejanfajfar

August 12

Newer before seen

I have been using Gmail for its early beginnings and newer have I had any complains. Since one year I am using Google Apps and again I newer had a problem.

So it comes as no surprise that I did not expect to be greeted with a 502 temporary server error.

Don't get me wrong I think that the service provided by Google are available and reliable 100%. I just think that this image is having some historical value like the first picture of the Earth taken from outer space.

August 06

Easy assembly information management

Everyone who has done at least some development has noticed that you can't cram all the code you write into one project.

Making multiple projects for one solution should come as natural as standing up in the morning. But there is a little hidden danger behind this practice. After you divide your solution into more projects, each project has a assembly.cs or .vb file. This is good for starting little projects but after some time has passed this separation can become troublesome. If you want to increase the version number of your entire solution or change any other assembly data you have to do it in every project separately. Would it not be nice to have all this data in one place. Well in my latest project I had this problem. And after doing a quick Google on the subject matter I found a ton of solution which used custom MSBuild tasks that handled automatically increasing the version number of the assembly but all the other data was still duplicated everywhere. So I searched on. I found a solution that satisfies my needs and does not require you to open every project file and edit is manually. So lets state the obvious drawback of my solution:

It does not autoincrement the file version number!

Well for me this is not really a problem because I want to set the complete version number. Some like to have a version number that looks like this:

[major version].[minor version].[date of build].[revision number]

I on the other hand like to set all four digits my self after doing release branches. And because of that I had to go to every assembly.cd or .vb file and change it there. Well not any more.

So lets take a look at the solution. First of all you must realize that the assembly.cs or .vb file is just a glorified code file and as such the .NET runtime will go through great lengths to assemble it. Just think of partial classes and you'll get the idea. If you take a closer look into that file you fill find the following:

   1: using System.Reflection;
   2: using System.Runtime.CompilerServices;
   3: using System.Runtime.InteropServices;
   4:  
   5: // General Information about an assembly is controlled through the following 
   6: // set of attributes. Change these attribute values to modify the information
   7: // associated with an assembly.
   8: [assembly: AssemblyTitle("??????????????")]
   9: [assembly: AssemblyDescription("")]
  10: [assembly: AssemblyConfiguration("")]
  11: [assembly: AssemblyCompany("")]
  12: [assembly: AssemblyProduct("?????????????")]
  13: [assembly: AssemblyCopyright("Copyright ©  2008")]
  14: [assembly: AssemblyTrademark("")]
  15: [assembly: AssemblyCulture("")]
  16:  
  17: // Setting ComVisible to false makes the types in this assembly not visible 
  18: // to COM components.  If you need to access a type in this assembly from 
  19: // COM, set the ComVisible attribute to true on that type.
  20: [assembly: ComVisible(false)]
  21:  
  22: // The following GUID is for the ID of the typelib if this project is exposed to COM
  23: [assembly: Guid("153b69cf-a102-47d8-ad19-71004d30f454")]
  24:  
  25: // Version information for an assembly consists of the following four values:
  26: //
  27: //      Major Version
  28: //      Minor Version 
  29: //      Build Number
  30: //      Revision
  31: //
  32: // You can specify all the values or you can default the Build and Revision Numbers 
  33: // by using the '*' as shown below:
  34: // [assembly: AssemblyVersion("1.0.*")]
  35: [assembly: AssemblyVersion("1.0.0.0")]
  36: [assembly: AssemblyFileVersion("1.0.0.0")]

Maybe you noticed that there is a lot of common junk in there. After extracting all the common parts you are left with this slimmed down version of the file:

   1: using System.Reflection;
   2: using System.Runtime.CompilerServices;
   3: using System.Runtime.InteropServices;
   4:  
   5: [assembly: ComVisible(false)]
   6:  
   7: [assembly: Guid("618db47a-f74d-4d53-ad36-f4c8bff5b503")]

You can ever remove the ComVisinble attribute and only be left with the assembly GUID but COM visibility is usually determined early in the projects lifetime and seldom changes. So its up to you to decide.

Next you create a file where you will put all the rest. I like to create a solution item and just name it CommonAssemblyData.cs or something in that matter. Which then holds all the rest.

Now comes the magical part which is overlooked by most developers. You can add files as links to a project. So you go through the normal procedure of adding a existing file to a project. But at the add button you press the drop down arrow and not the Add button (yes it is a drop down button and not a normal button). To illustrate this here is a picture.

AddAsLink

And that's basically it. Now in the future you just change data in the common file and all the assemblies are updated on the next build.

I hope this makes some lives a little bit easier.