Mar 5, 2010

Telerik OpenAccess ORM Q1 2010 will introduce its DSL Designer, Mapping Details Editor, new Schema Explorer, Update From DB Schema Wizard, Entity D...

A lot of tools I wanted to see live in this product. Finally, from Q1 2010 you can enjoy those really soon!

I will also ;).

Kudos to the team that made it all happen!

Some screenshots from Telerik blog:

The DSL Designer:




Mapping details editor:



Schema Explorer:




Update From Database Model’ Wizard:





Stay tuned ...

Feb 18, 2010

How do you unit test encryption?


I wrote two extenders to be used on the string type.
So you can say "test".Encrypt() and "encrpyptedtest".Decrypt().

I was wondering how to unit test this thing.
The first approach which was really obvious was to encrypt the string and then decrypt it, if you get the string before you do those two actions on it - the encryption is correct.

The question in this approach is : What do you test? do you test the encryption or the decryption?
You can get a false positive result this way. For example if the Encrypt method returns the same string without changing it and the Decrypt method returns the same string without changing it - the test will be passed (the string after encrypt -> decrypt will be the same as it was before).

The other approach is to hardcode encrypted and decrypted string, then pass the decrypted string to the Encrypt() method and see if the result matches the encrypted string.
Then pass the encrypted string to the Decrypt test method and see if it matches the decrypted string.
The question here is "What happens if someone change either the key or the initialization vector for the encryption?".
The test will fail as the strings no longer match (unless you are very very lucky to hit some collision case :), but the methods are valid and they work correctly.

For now - I will use the second method. I will hardcode an encrypted / decrypted pair as well as the key and the IV used for the encryption / decryption.
I will first check if the key and the vector match the one that were used to generate the pair and if they don't - the test will be inconclusive so the guy who changed either the key or the vector can easilly find the problem and resolve it.

Anyway I am really interested in how would you do such a task?

Feb 10, 2010

Some telerriffic T-Shirts

It's time telerik fans to pick up the T-Shirt they like the most.
You can vote for the T-Shirt that you like most here :
Telerik Facebook Page

Here are all the variants you can choose from:



















Now go vote ;)

Feb 9, 2010

One more bar green :)

I am just writing to inform you that I managed to make another bar green, yesterday I successfully passed the "Electronic devices" exam and I have two more exams before I get back to the software world :).

It was obligatory for the exam to write some reports (not quite sure what is the real english word for this) - we had 10 practices during the session. Each one goal was to examine an electronic device (I think 7 analog and 3 digital or something like that).



After we made all the research we had an exam, we had to write a reports for each of the practices we made (you miss one and you can't have an exam, you need to re-work it with other students, which means more days off and more headaches).
I can't be unhappy that I passed it :). I have 4.5 / 6 which is kind of high score (for me, not for the university :).

Anyway now I have the same thing but related to optics, we need to do 10 different experiments, do the reports and pass an exam where they will ask us what did we measured for a random experiment we did, if the answer satisfies the profesors - you pass :). If not - you have another chance to take the exam, you fail on the 2nd chance and you need to re-work all the experiments again :(. So I will do my best in order to pass it from the first time (or in the worst case - from the 2nd :).

I also have some experiments (not exactly experiments) in something that will probably sound like "Probability theory and physical statistics" in english. We will study the probability theory and some statistical laws, then we will be given a set of data and will be asked to perform some actions on it (find the chance for each result to occur, find co-relations between data and so on and so on).

The rules for the exam are the same ;). You have two chances before you go to re-work all the classes.

I really hope I will not look like my idol at the end of this session:




Hopefully I will not write any more posts that are not related to IT but we will see ;).

Wish me luck ...

Feb 4, 2010

Wish me luck :)

I had some really long days. At telerik we are doing some nice but hard to do stuff, I have some university things to do. Some exams to take, some mathematics (Oh, my JustGod :(. My day is about 15-19 hours long (with few short breaks my brain is working all those long hours :).

But I don't write this post to complain. Exactly the opposite - I am writing to share how happy I am to be so busy those days as the bars are getting green, one by one, constantly they are getting green :).

I know I have some amount of tasks to do and I am trying to make all of them green (it is my code for "deliver what was expected", the green bars are "deliver more than expected").

Today for about 40 minutes I did 3 counters at the university - one which was counting up to 5, 1 - that was counting up to 10 (BCD code) and one that was having 10 states but wasn't actually counting :). (3 tasks - yellow :).



Few days ago I managed to fix about 200 comments on the chapter I am writing for the Introduction to C# programming book (seems kind of stable now, should be in CTP state ;).

I actually started this post to inform you about something that happened yesterday :).
This summer (I think it was July or somewhere around July) I was involved in a very interesting project - I was asked by a friend to write a software that will manage a machine.

The machine was having a printer (not simple printer but M600 Advanced printer, it has 4 heads, very hard to work with API and a TCP interface that was blocking the printer if two threads are sending command at the same time).
It was about printing something. So the program should check if the printer heads have enough ink, check some other sensors if everything is OK, and if not - it should stop the machine ...

Nice task that gave me some insight on how the OPC things work (don't ask :).



It appeared that OPC Servers aren't something to easilly deal with.
The main reason - not enough information, some closed standards - the paradise for a developers :)
Anyway we managed to finish most of the things.
Then I got a job at telerik and almost forgot about this adventure :).
Yesterday I heard from that friend and he told me that the machine was at Hannover and that it performed well (means no crushes :).

Now to finish - the nights while I was writing the code for that machine were as long as now. I didn't have time to sleep much. Now I feel happy with the result.
I wonder will I be feeling so happy once again after I manage to finish my sessions at the university ;).

Hopefully yes ;).
Sorry for making you read all this crap :).
Just remember - when you are so tired and is so hard to continue - recall your last victory and the next one will come ...

Jan 24, 2010

Take a time to watch those things. The future is comming ...

I can't hide that I am very excited about what's happening with the technology.
About one year ago (maybe a bit more) I found an open source project called Touchless SDK you can find the post and the video (here).

I played a bit with the SDK back then and managed to do some trivial tasks - move my cursor with fingers, rotate an Open GL 3D globe etc.

I had some great ideas about this, yet I didn't have time to try to implement them.
Yesterday I was browsing to see if there are some TED Talks I haven't already watched and found this one (two parts):

Part 1:


Part 2:



I think that this technology is not yet implemented as it is shown in the video. My guess is that guy has some of it implemented and some of it - not yet. Anyway it seems very promising.

Hope you like it!

Jan 22, 2010

Working faster with Visual Studio 2008 website

I just wanted to share with you that you can actually start using the page and debug before all the actions that are known as a build are performed by Visual Studio 2008.

You can actually skip the "Validating WebSite" part.
Here is how I do it:

1. Hit Build button
2. View -> Output window
3. Watch the output window, when it says "Validating website", check out your Errors List (View -> Errors List).

Seems that Visual Studio will know the errors in your website / projects in the solution, before it finishes validating the website itself. It simply waits the validation to finish in order to popup this window.

If there are no errors - you can start debugging the site.
If there are - you can press CTRL + Break to stop validating the web site and fix the errors.

Jan 19, 2010

Unexpected fatal error -- Not enough storage is available to process this command. While building a project.

It is very strange error.
Anyway - if you experience it - deleting the events from the Application event log solved it for me should work for you to ...

Telerik is Red Herring Global 100 Winner

Just to let you know that telerik is Red Herring Global 100 Winner.

Telerik is Red Herring Global 100 Winner

I hope this is just the beginning ;)

See full list of Red Herring winners here:
Red Herring Global 100 Winners

Jan 18, 2010

Public Issue tracking system launched today!

If you haven't heard yet - we have a brand new Silverlight Public Issue tracking system.

It was built to help you track your issues and features and be instantly informed about the new things we are doing here.
You can also vote for your favourite feature, thus rising their priorities.



The PITS is still tagged beta but it is very usable, so you can start using it right away.

Are you still here?
Click here to be taken directly to PITS so you can start subscribing for the stuff you like ;).

http://www.telerik.com/support/pits.aspx#/home

Jan 16, 2010

Two-way binding is only supported for properties exception.

That was very strange. I used #Bind in the markup of a user control in order to set a property value and got this nasty exception.

It told me nothing. I couldn't figure out what was wrong with the property and what does it mean that the property is not valid.

I did what every one of you will probably do ;)
Google with the exception and found that if you convert the property from the type it has to string it should work.

Couldn't make it.
Probably my scenario is different.
I will write another blogpost as soon as I find the solution. For now I worked it around another way - using the code behind ;)

Jan 13, 2010

Do it worse!

Here is a very interesting blog post a collegue of mine accidently found and posted to me:

http://thedailywtf.com/Articles/The-Utlimate-State-Selector.aspx

It is PHP but a regular web developer (even being ASP.NET developer) would realise the problem and the great mind behind this code :).

Lesson learned - your code is great as there can always be a worse solution :).

Jan 7, 2010

The access to the path bin\ is forbidden exception while building - Visual Studio 2008 and TFS

I had this strange error yesterday and it took me some time to understand what is going on.
It appeared that the bin folder of the main project is under source control, so TFS was locking the folder, the subfolders and the files.
In order to resolve it - checkout the bin folder in Visual Studio and then build.
The build should be OK.
Then you can Undo Changes on the folder and everything should work as it was before.

Hope this helps someone ...

Jan 6, 2010

Have you tried the Windows 7 God mode?

I did and it really exists :D

In order to try it:

1. Create new folder under Windows 7
2. Name it : "GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}" (without the quotes).
3. The folder will change its icon, double click it ...


Source : CNet

Jan 5, 2010

My chapter in the C# book is almost done!

I am about 80% ready with the first chapter of the book "Introduction to programming with C#" (this one was assigned to me on the initial meeting).
Lot's of things borrowed from the Java version of the book, still lot of things are new.

In the first chapter I teach the reader what he / she needs in order to create a simple console application.

Both ways are shown - using simple text editor (notepad in our case) and csc and using Visual Studio 2010 Express Edition (as being free for students).

I will mention #Develop. How to debug is also mentioned in the book.
I will soon (probably today) include some information about the .NET Reflector.


Wish me luck!

Jan 4, 2010

2012 and some other stuff

I just couldn't resist to take a few minutes of my time and post this picture just to make you stop working for a minute or two :D

I accidently found this picture:

2012

It is kind of mix of Y2K problem but for the next "end of the world" :).



You can take a look at http://bizarrocomic.blogspot.com/, you may find some more funny pics.

Good night :)

Dec 3, 2009

Introduction to programming with C#

As Vesko Kolev stated in his blog - a new bulgarian book about C# programming is in progress.
I decided to take part because it seems very interesting. I haven't much experience in publishing so it will be very beneficial for me to work on this.
Actually I was author in a software magazine few years ago (as far as I remember I was about 17 years old so it must have been about 6 years ago). It should help me as I took the first chapter - introduction to programming where I will show the readers how to install Visual Studio 2010, how to start their first project and how to write their first program, some diagrams of the .NET framework 4.0 will also be included in this chapter.

We decided not to include any advanced features in this book, just core programming language, no extensions, no lambda expressions, no var, no automatic properties, no nothing.
This is because this book targets potential software developers and not software developers. It should show the developer how to code, how to think etc. We decided that if a man / lady without any software experience may think that auto property won't take memory after it doesn't involve variables (at least visualy :).
That is why we do only core things.

Wish us luck. We would really love to expand bulgarian software development community with few more people :). After all if even one guy / gal of all the people that will potentiall read the book becomes an expert - our mission would be completed (we are dreaming for more impact ofcourse :).

As Svetlin Nakov and Vesko Kolev said - telerik is sponsor for this book so it should be published easilly than their prеvious book - "Introduction to programming with Java" and would probably joy some more marketing efforts.

That was it about the book.
Now about my motivation to join the project no matter my personal engagements and all the work I have at telerik and at the university.
The first reason is that I am a self - taught (almost) developer.
I never had degree that will help me find my work, join some society of developers that will help me when I hit a difficult problem.
There wasn't even internet in my hometown. A friend of mine gave me a book on programming with Delphi (that Sams 21 days brick :).
The Delphi help also helped me and I also downloaded html files to read later when I was at school.

Then I applied for a job in the city where I was studying (Veliko Tyrnovo).
It was all my collegues that helped me improve my skills.
I don't feel as a worldwide recognised expert or something but getting to the intermediate level from nowhere is achievement to me.
So reason #1 to join this book is to give something back.

Another reason is that I would like to see how a book is written, are there different proccesses than in the software development. It has something to do with the blog posts I guess :)
So reason #2 is to steal some knowledge :)

And some kind of nostalgy would be the last reason to join :).As I said, I was an editor in a software magazine, it was very nice thing to do. The article, then the readers asking for some more information. I miss this a bit :)
Reason #3 - to feel the old days when I was an editor :)

The specified service has been marked for deletion error message when removing a service

If you receive this message while trying to delete a windows service - check if the Services.msc application is open.

You will need to restart in order to delete the service, but you will know to first close the Services.msc application the next time PRIOR uninstalling the service (using installutil /u service_exe_name).

Hope this helps someone outthere...

Edit : I found another scenario when this can happen and it seems to be more .NET specific and common to software developers - if your service creates some worker threads, Windows will attempt to kill the main thread, the main thread will attempt to kill the main thread but the worker threads if not marked as BackgroundThreads via the IsBackgroundThread property will remain. The GC will wait for them to reach a safe point so they can be terminated and the service will most probably be only marked for deletion, requiring you to restart windows.

Please note - if you are using the ThreadPool class you will probably not hit this problem as the ThreadPool internal threads are automatically marked as background threads.

Edit 2: Another case when you will receive The specified service has been marked for deletion error message is when you try to uninstall service which wasn't stopped first or it was marked as unstopable.
This is done if you have this.CanStop = false in your service code.
Windows knows this service shouldn't be stopped and it will only mark it for deletion but will not delete it right away.
Be careful with CanStop property.

Nov 24, 2009

Limiting your Internet connection speed with Fiddler.

In some cases you may need to limit your connection for testing purposes.
This is / should be extremely easy using Fiddler.
Here is a simple walkthrough on how to do this:

1. Go to Fiddler site and download Fiddler latest version (http://www.fiddler2.com/fiddler2/)
2. Install it and start it.
3. Click on Rules -> Customize Rules:

4. An instance of notepad should open. Find the line that says something like "oSession["request-trickle-delay"]":

This setting tells Fiddler how much milliseconds should halt the request. (not quite sure how a request halt will help you though)
5. Find the line that says "oSession["response-trickle-delay"]" and change it:


Save the file.
You should have a connection limitation.
Now, when you want your connections slowed down, you will need to check the following option:

6. Rules -> Performance -> Simulate Modem Speeds (should be checked):


Please do not forget to switch off fiddler when you don't need it as you may find yourself wondering why is your connection significantly slower than usual ;).
Hope it helps someone out there.