Jan 18, 2012

Find and open a file in Visual Studio.

I remember that a collegue of mine used that a lot. I forgot it so I will just post it here so anyone (including me can benefit of it).

In order to find a file / class in Visual Studio - use the "Find In Files" toolbar combobox. You will however need to write a magic word before it starts searching, just type "> of" before the file name, like "> of User". VS will help you with some of the files that contain this name:



Hope this raises a bit more of productivity out there.
If you need more - you may want to try Telerik Just Code ;).

Nov 23, 2011

Scroll event not fired in some Telerik Windows Forms Controls (maybe WPF as well)


First of all - this is not quite an issue.
Since the Telerik controls are compound controls (for example the list view has Root Element, List Element, things like that), what scroll are you subscribing to?

Do you subscribe to the whole control?
Do you subscribe to the RootElement? To the ListView?

To remove that kind of questions, Telerik came up with the idea that it will be better to rise the appropriate control scroll, instead the entire control scroll.
Consider this:

radListControl1.Scroll

vs:

radListControl1.ListElement.VScrollBar.Scroll

If you are called like the first one, how do you know who called you?
If you are called in response to the second one, however, you will know that the ListElement (the items placeholder) has changed its vertical scroll so you can respond to this easilly (for example in a case of Virtualization it will mean it may be hungry for some more items ;).

To be honest at first I was a bit frustrated but now when I got it it makes a lot of sense.

Disclaimer: I am not part of Telerik anymore so this is just my guess, why they did it that way and my own explanation. I may be wrong :).

Sep 29, 2011

Kindle Fire is comming! Amazon is taking orders on the new Kindle In Color (Kindle Fire)

Are you ready to get one?
Lot's of rumors that this little thing will be one of the main competitors to the Apple iPad. No one knows yet. With date of release set to 15 november, the Kindle Fire is a long awaited addition to the old Kindle.

Here is the old one (I have one and I'm pretty happy with it):


and here is the new, shiny tablet that Amazon will offer at the end of this year:




Honestly, I am thinking to get one, although pretty happy with the old Kindle, I need to stay in the business :). I would be happy to be able to optimize some of my upcomming products to work well in both - Kindle Fire and the old Kindle, so having both will be of great help to me.
On the other hand if you just need to read stuff, I belive to old Kindle will be enough.


+

= Happy developer.

Sep 2, 2011

LinkedIn API - request failed with 401 - unauthorized (cause #1 of N)


If you experience that, make sure you are encoding your request properly. For example http://api.linkedin.com/v1/people-search:(people:(id,first-name,last-name,picture-url,headline,location:(name)),num-results)?keyword=" + HttpUtility.UrlPathEncode(user.FullName).

In the above example if the user full name is Pavel Donchev, if you use HttpUtility.UrlEncode(user.FullName) the result will be Pavel%Donchev.
It should be Pavel%20Donchev, which is result of calling HttpUtility.UrlPathEncode instead HttpUtility.UrlEncode.

Almost unnoticeable difference mixed with generic message that may cause lots of head aches for you.

Aug 16, 2011

SQL Server–have another instance redirecting to existing SQL Server

I was in a need to have an SQL instance renamed.

This is because I have SQL instance on my server and wanted to have it on other computers as well so I don’t need to change the Connection Strings each time I deploy.

I first tried to rename it but to no avail. Then I found this little neat trick to have another instance that can “redirect” to the original server (e.g. you have (local)\Instance and want it to redirect to (local)).

To do this follow the instructions bellow:

1. Go to Start Menu => Microsoft SQL Server 2008 => Configuration Tools => SQL Configuration Manager.

image

2. In the SQL Configuration Manager expand the SQL Native Client 10.0 configuration node

image

3. Right click Aliases node and select “New alias”

image

4. In the Alias – new popup, in the Alias Name field type the name you want to have for redirection, in the server field type the server the alias will redirect to:

image

5. Go to management studio and type the new instance name in the server name text box to test the connection:

image

It worked pretty well for me, hopefully it will work for you as well!

Aug 9, 2011

A book is born!!!

As most of you know, I was involved in writing a book about C# programming (we were 30 authors, each had to write a chapter and edit a chapter).You can click on its cover in order to be taken to download the PDF version:

Hope you will enjoy it.

Oh, almost forgot – it is in BULGARIAN Winking smile. There were some plans to have it translated but as I am not a part of telerik anymore, I don’t have any information from the kitchen how far this project went.

Please be sure to say a great thanks to telerik for sponsoring this book!

Jul 14, 2011

Application suddenly becomes slow

I experienced this while I was developing my application in Visual Studio.
It happened for no apparent reason (I didn't remember to make any signifficant changes in this application).

It was really frustrating. The thought that I may need to rething the whole application was a nightmare.

I was in panic and started to think what the problem for this sudden degradation might be.

And guess what?
It appeared to be because of a conditional breakpoint I have set in one of the complex modules.

The program flow was passing through this line of code hundreds of thousand of times so Visual Studio was kind of slow determining if the condition for the breakpoint is true or not.

So remember this for the rest of your life:
"Conditional breakpoints may slow your application considerably, before doing stupid things in case of sudden performance degradation - be sure to remove your breakpoints first (Debug Menu => Disable All Break Points), then check the performance again.".