Errr, some catchy title.... RSS 2.0
 Tuesday, January 22, 2008

This post is a more of a reminder for myself as I have to do this every few months and I end up googleing it every time, because I don't remember what exactly needs to be done.


The problem:

How to get your hands on the DLL (as a file) that is stored in GAC.


The solution:

When you go to Windows\assembly directory you will see something like the screen below.





The above Shel extenstion is great for quickly checking which versions of GACed DLLs are installed on the machine.

The problem arises when you want to copy the DLL itself (as a file). In this shell extension (Assembly Cache Viewer (SHFusion.dll) you're not allowed to do that. You may wonder why would you want to copy those DLLs in the first place. Well, for example when you want to install the DLL on the machine and the only copy of the DLL you've got is in GAC.


Ok, enough foreplay. Here's the actual solution:


For first time on each machine add key:

DisableCacheViewer in

HKLM\Software\Microsoft\Fusion

Set the DWORD value to 1.


Now if you go to the assembly directory you'll see the following screen.





For all future usage, simply toggle the registry value.


NOTE: There are other ways of doing this, such as disabling SHFusion via command line, but I find this one the easiest.


Tuesday, January 22, 2008 4:55:34 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Other | Tools
 Wednesday, January 09, 2008

I've updated the blog engine. I have moved from ThinkJot to dasBlog version 2.0.

The move has been really easy. I've simply copied all the new files to the directory. Moved the files from the old 'content' directory to the new directory and that's it!

Oh yeah, I've also edit some configuration files.

Now that's a true XCopy experience!

While updating the blog I've decided to use a new theme. I've moved from essence to business (I've modified it slightly...). I hope everyone likes it.

I really like the new engine, it's got a few fixes that I was waiting for...

Wednesday, January 09, 2008 11:38:24 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Other
 Tuesday, September 18, 2007

If you’re a Vista laptop owner you definitely want this application installed on your machine.

It’s a Vista Battery Saver !

 

 

 

 

What it does, is when you switch from A/C to batter it will disable Sidebar and Aero (all of this is of course configurable). I can squeeze out over 40 minutes more of battery time with this little application. Also, this is and open source project written in C#. Here’s the code. It’s a very interesting read.

Hope it helps.

Tuesday, September 18, 2007 12:34:30 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Other | Tools
 Thursday, August 09, 2007

Developing an application that supports plugins is not an easy feat. Below are some links that will help you start the ball rolling:


One from CodeProject. Next one is from Roy Osherove on MSDN. Actually, it has two parts. Part one and two. After reading those you will have general idea what you should do. How to start, how to look for appropriate plugins and so forth. I would like to point out a few things more you should take into consideration.


First of all, what will the communication between the application and other plugins look like. How and if the plugins send any information to the hosting application. This of course depends on your applications requirements.


Another big one after communication is how will you visually present the plugins. If they are to be presented in the UI (added to be MainMenu or ContextMenus) the framework must allow it. Also remember not to pass references to your menus, because plugins would be able to delete some entries there. Rather allow a plugin to specify location and items that should be added to menus. This will be safer. (When returning those objects the plugin should already have attached the required event handlers).


Exception handling is also very important. How will you act when your plugin will throw an unhandled exception? Will the whole application crash or will it report gracefully that there was a problem with a certain plugin? For WinForms development there are two events you should register to: Application.ThreadException

AppDomain.UnhandledException.



On the final note, there is dnrTV Show on plugins in .NET. Be sure to watch it.

Thursday, August 09, 2007 2:32:09 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Other
 Monday, July 09, 2007

Here is an essay I wrote for my Masters course. I think it could be an interesting read...

 

"Comparison between DTD and XML Schemas"

 

Introduction

Document Type Definition (DTD) and XML Schema are XML schema languages, therefore both of them are used to express a set of rules to which an XML document must conform in order to pass validation. We need schema languages in order to check whether a given document conforms to all the rules given business must enforce.

DTD is native to XML schema language. It has been around for a long time; however it has some shortcomings which will be discussed later.

XML Schema has been developed later with the same purpose as DTD in mind; however it tries to negate DTD’s shortcomings. Furthermore, XML Schema is the first schema language that has been recommended by W3C (World Wide Web Consortium). An instance of XML Schema is called XML Schema Definition (XSD). As, XSD has been designed later it isn’t as limited in functionality as DTD.

DTD versus XML Schema

DTD lacks a couple of important constructs that are vital to working with XML documents. The biggest concern is that DTD syntax is based on SGML not the XML itself. Therefore from the technological standpoint, there is a need for two parsers. First one to validate XML file (just for structure integrity, not for conforming to set rules) and the second one to validate DTD file (again, just the structure). XSD is simply an XML file; therefore we can validate structural integrity of the XSD and the target XML document with just one parser.

As DTD was designed to be a schema language it is very troublesome, that it lacks a very important feature. It lacks data typing. It is impossible to specify what should be the type of the given element. For example it is impossible to enforce a rule that the amount of transaction is of type double. One could still pass a string and DTD parser would state that the XML document is valid. In XSD, one is actually forced (it is a required attribute) to specify the type of an object for each element; hence this problem has been completely mitigated in XSD. XSD also has type called ‘anyType’ for those special situations when type is not important, or it differs for different documents.

Another important shortcoming of DTD is the fact that it is impossible to specify the number of occurrences of a given element. Therefore, a lot of the validation must still be done even after the parser says that the given document conforms to the DTD schema. XSD on the other hand has properties: ‘minoccurs’ and ‘maxoccurs’ which obviously are not perfect but are definitely a step in the right direction. Of course, there are situations where these properties will not be sufficient to specify the business rules required and again the work lies on the shoulders of the developer that must check whether the file corresponds to the standards.

Since the creation of DTD, XML has evolved, newer constructs have been created. Unfortunately, DTD has not been up to par with those. An important feature of XML files are namespaces. They have been created due to the fact the XML has become a mainstream standard and therefore the documents have started to grow very large. It is not uncommon for a document to use two different set of vocabularies. If those vocabularies have the elements with the same name then it would lead to unmanageable files. Creation of XML namespaces has solved those problems. Unfortunately, there is no support for XML namespaces in DTD. This is a big limitation in most modern systems they are simply a must. On the other hand when creating an XSD file, one must specify the namespace of the specification. This and the fact that since XSD is an XML file and has its own namespace shows that this feature of XML documents is deeply supported.

Corollary

DTD is an old technology (it is based in SGML which was developed in 1960s). XML Schema came into being when XML became very popular and it became clear that DTD cannot meet the needs of the businesses. XSD was developed with all the shortcomings of DTD in mind. It was supposed to mitigate all the problems that DTD has. It is believed that the XML Schema is the successor of Document Type Definition.

To sum up, there are a lot differences between the two technologies, even though they attempt to solve the same problem. It is important to note, that even though XML Schema seems far more superior it is simply because it was developed much later then DTD. Most legacy systems still use DTD, however new systems tend to lean toward the usage of XML Schema. To ease in this transition there are a lot tools that allow translating DTD files into XSD format.

Monday, July 09, 2007 7:01:17 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Other
 Monday, March 26, 2007

Last week I've passed 70-229 exam by Microsoft. It was the final one out of 5 exams required. Hence, now I am Microsoft Certified Solution Developer and I can use those logos (MCAD is a subset of MCSD):

 

                                                                 

 

To sum up: Awesome :D .....

Monday, March 26, 2007 4:27:00 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Other
 Thursday, March 22, 2007

I just finished week long second trimester of my Masters course. The module was about Design Patterns. Every day we had lectures in the morning and then labs in the afternoon. During the lectures we went through most of the Gang of Four patterns, they were pretty interesting even though I knew most of the stuff. What I really loved about the course were the labs.

 

Every day we were given some working application and we were supposed to apply some specific pattern to extend the functionality of the application. I always believed, that it’s impossible to learn design patterns just by reading a book, you gotta look at the code and try to incorporate it into it, or just ‘get it’. What was good about the exercises in the lab is the fact that the applications were easy enough to understand their inner workings immediately, but complicated enough to see, that some pattern would help here a lot.

 

Oh yeah, and I was able to refresh my memory of Java and Swing. Win-win situation.

Thursday, March 22, 2007 3:00:34 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Other
 Wednesday, February 14, 2007

For most situations we want the users, not the computers to be the audience of our websites. Therefore, there are situations when we must protect ourselves from automated bots that obtain information from our website, eat the bandwidth or just consume our services (create new email accounts, send text messages to cell phones and so on). The tool for this job is called CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart). If you’re interested how it came into being go to CAPTCHA on Wikipedia.

 

Below is a list of three CAPTCHA solutions that vary from easiest to implement and of course least secure to the safest one (which also involves most work).

 

Hidden input

 

The simplest of the techniques is to embed in the page a HTML input element.

 

<input name="address2" type="text" runat="server" />

 

Next, we make it invisible on a page by applying CSS style (just one of the possibilities). On the submit, we check if the value has been filled. If it has, then that means a bot was going through the page, not the user (as user could not see the textbox). This solution is very easy to implement and should work if the bot is completely automated (there was no recording of what type of fields should be filled in).

 

NoBot from AJAX Control Toolkit

 

One security level higher is the NoBot from ASP.NET AJAX. It is again, a solution that does not need user interaction; therefore it is not very reliable. Also, as it is part of ASP.NET AJAX it will only work in AJAX enabled environment. On the plus side, the user is not bugged by filling out some extra fields.

 

NoBot employs several techniques to prevent bot attacks:

  • Forcing the client's browser to perform a configurable JavaScript calculation and verifying the result as part of the postback. (Ex: the calculation may be a simple numeric one, or may also involve the DOM for added assurance that a browser is involved)
  • Enforcing a configurable delay between when a form is requested and when it can be posted back. (Ex: a human is unlikely to complete a form in less than two seconds)
  • Enforcing a configurable limit to the number of acceptable requests per IP address per unit of time. (Ex: a human is unlikely to submit the same form more than five times in one minute)

 

If you want to see a live demo, go to NoBot Sample from Ajax Control Toolkit

 

CAPTCHA Image Control

 

Safest on the list is CAPTCHA Image Control. Since everyone has used these CAPTCHAs as user it’s best to just show how this solution looks.

 

 

The image displayed is distorted not to allow machine to find out the text on a picture. There are a lot commercial solutions that offer these controls for ASP.NET, however there is also a bunch of them free. I particularly like the one written by Jeff Atwood, author of the brilliant www.codinghorror.com blog. He published this control on CodeProject, it is located here. Go check it out!

 

Note:

 

Last solution is not suitable for blind or visually impaired users. Therefore, sometimes you can find sound CAPTCHAs for these scenarios.

Wednesday, February 14, 2007 4:15:46 PM (GMT Standard Time, UTC+00:00)  #    Comments [3] -
Other
 Friday, February 09, 2007

I stumbled upon an amazing explanation of Web 2.0. Not only it's highly entertaining, but also shows what Web 2.0 is all about. Now, if anybody asks what is Web 2.0 I'll point them towards this clip.

Friday, February 09, 2007 12:07:57 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Other
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008
Marcin Waligora
Sign In
All Content © 2008, Marcin Waligora
DasBlog theme 'Business' created by Christoph De Baene (delarou)