The Snipping tool in Windows Vista has disappeared

by 31. March 2009 21:10

For some time now I was puzzled as to why the Snipping Tool in Vista wouldn't show up when I'd look for it in my start menu. Not paying too much attention to it, I had a workaround - take a screenshot of the screen (using the Print Screen key) and then quickly crop the selection that I need in Paint.

I had forgotten about this 'problem' but recently I was working on something that involves taking screenshots often, so I decided to have a look into it. Quick Google search revealed that I removed that program myself when I decided that I do not want to have the 'Tablet PC optional components' on my desktop computer. I'm not going to portray the feelings I had when I found out that according to Microsoft, capturing images from your screen is a "Tablet feature", instead I'll just say that I was glad that I had my Snipping Tool back.

But the excitement was short lived. I found out that I could not do simple edits on the captured image such as drawing a line or a rectangle. Yes, you can scribble on the image, but if you want to create a straight line you need to have hands of a surgeon. Having lost my faith in the usefulness of the Snipping tool I decided to finally install a proper tool. At work I use SnagIt, a program that is very dear to me so I decided I will go for it even though it has a price tag associated with it. Once I was at the TechSmith's web site (the creators of SnagIt), I found out that they now offer a new freeware product called Jing that does exactly what I need. With a download size of 7.6MB I was a bit skeptical at first, thinking that it is some bloat-ware program, but once I installed it that wasn't an issue any more because it runs fast. It does use a lot of memory (96MB Working set) but for me it is not an issue as I do not use it in combination with other resource hungry applications. In addition to the simple interface to take screenshots, this program even has a dead simple interface to upload the screenshot online so that I can share it with friends.

That issue is solved, next on the agenda "Why can I not install Windows Live Writer on my Windows Vista machine".

Tags:

Interesting blog post discussion about large database tables

by 6. March 2009 12:42

I was reading some stuff on SQL Server optimization and I came across an article by Ben Nadel, called SQL Server NOLOCK / ROWLOCK Directives To Improve Performance. The article is pretty basic as it describes the NOLOCK hint available in SQL Server.

However the thing that I really like about this article are the comments that follow. In the comments Rick Osborne talks about using the NOLOCK hint on a very very large table  (200 columns wide with 2M+ records).

The discussion there just sparked an idea on how I would ideally implement a search program that I’ve been working on recently had I had more time to devote to it. Maybe one day, I’ll have the time for it and this blog post will remind me to do it

Tags:

Creating a temp table for testing databound controls

by 10. December 2008 12:45

Often times while coding, I will have a stub method that needs to provide some data that will be used elsewhere as a source for databinding. What I normally do is create a simple DataTable with the appropriate columns and few DataRows and then return it. And every time I do this I forget the exact syntax to specify the DataType of the columns in the DataTable. This time I decided to record it here for future reference

   1: Dim dt As New DataTable
   2: With dt.Columns
   3:     .Add("SampleColumn", System.Type.GetType("System.String"))
   4:     'add more columns as necessary
   5: End With
   6:  
   7: With dt.Rows
   8:     .Add(New Object() {"Dejan"})
   9: End With

 

Other possible DataTypes for the DataColumn according to msdn are

Boolean
Byte
Char
DateTime
Decimal
Double
Int16
Int32
Int64
SByte
Single
String
TimeSpan
UInt16
UInt32
UInt64

As well as the following array type:

  • Byte[]

Tags:

IIS and Windows Integrated Security

by 10. November 2008 11:43

I had a real head scratching problem today. While working on one of the internal web applications, I was trying to get the identity of the visitor so that I know what roles to assign. But User.Identity.Name kept returning a blank string. I was checking and double checking the settings in IIS to see if the “Integrated Windows authentication” is enabled and every time I’d see that it is indeed on I would come up with some obscure idea why it is not enabled (even though it was). I was misdirected by the fact that on my local IIS instance I did not encounter that problem. So the reasoning was that “there must be something wrong with the settings on the server”.

The problem later on turned out to be with the web.config. I had accidentally removed the deny directive for non-authenticated users (in the 2nd line bellow). Without that line the Windows integrated security would not kick in and hence the User.Identity.IsAuthenticated would be false and User.Identity.Name would be blank. Putting back that line solved the problem.

<authorization>
   <deny users="?"/>
   <allow users="*"/>
</authorization>

Hopefully in the future I’ll be more careful with the web.config edits :)

Tags:

ASP.NET

Handling Session_End events

by 3. November 2008 15:52

After adding error logging features on one of the legacy applications at work the Event Viewer started recording few unhandled exceptions. This was one them

Exception information:
    Exception type: HttpException
    Exception message: Request is not available in this context

The stack trace pointed to Global.Session_End(Object sender, EventArgs e) as the source of the event.

In the Global.asax file, the Session_End event was handled like this

   1: Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
   2:     ' Fires when the session ends
   3:  
   4:     Request.Cookies.Clear()
   5: End Sub

The problem was not evident at first (to me at least) but after some googling around I found out that “Session_End is fired internally by the server, based on an internal timer. Thus, there is no HttpRequest associted when that happens.”  So this meant that the the cookies can not be cleared from the request because there is no request associated with this event.

This link here has a lot more information on the Session State and the different possible modes of handling session state in ASP.NET.

Tags:

ASP.NET