I came across some cool tips for use inside VS.Net.
1. A Cool feature of VS.NET is its ability to launch multiple projects and have a debugger attached to them. If I have an application which is using .NET Remoting, so I have a remoting host, which is an exe, I have a client who’s is going to launch remote objects. Also I’m going to have them in separate exes. I can normally run only 1 Exe at a time within the same solution. And so typically what I have to do is after I launch the client I have to go to the host and explicitly start the host to get the second exe I need to work with and then the two are actually going to be talking with each other.
Now this is kind of tedious. What I can do instead is I could go to the solution properties, select multiple startup projects and select the projects I want to start, in which case I want to start the host and I want to start the client. I can even change the order in which the client or the host are going to be started. Now when I click okay if I click the go button VS.NET is going to launch the two exes and it’s going to attach itself to them so I’m going to have the same debug session for both exes. Very handy and useful when dealing with multiple exes.
2. If I try to compile a new project and deliberately add some compilation errors to i. After trying to build, If I look at the task list I'm going to see that the errors of compilation is being added as a task for me to fix. I can also explicitly go and add a task in my task list. Now you can also do // and type to do. And it turns out that to do is a recognized token by VS.NET and the moment you say to do it would add that line to the task list. And you can actually your own constants and your own token to the task list. If you go to tools, options, task list you can add your own custom Task List. Having your own custom task list will be helpful when you’re looking for other things to do in your project you don’t have to literally do a search in all files and look for to dos. Just look at the task list, it will show you all the things you need to do.
3. In C# only there’s something called pre and post build action. This allows you to run a command line before and after a build. I want to do some pre and post-build action in that class library. So if I go to the project properties I have build Events. This command line, the pre-build defense is going to be executed before the build starts. A typical thing to do in the prebuild is to do a clean build, meaning remove all bin folders. A post-build allows you to run something after the build. A typical thing you want to do is you’re going to maybe install this class library in the GAC on every build.
I read these tips from an MSDN article by Jual Lowy the Great(yup ... a Software Legend too). I found it very useful.
Prem's views on life, .net and software development (everything contained in one strongly typed weblog).
Wednesday, October 26, 2005
Tuesday, October 18, 2005
Tip of the Day
I found this really cool tip for keyboard users in Visual Studio .Net.
If you go to the find combobox (Ctrl+D with the default keyboard mapping) and you type "> open" (without quotes). The ">" flips the find combobox into a mini Command window. The "open" part is the aliased command to the "file open" action. The super part is when you press space and the first character of the file you want to open anywhere in your solution, a dropdown window pops up with the files and folders that start with that letter. (thanks to Peter Provost)
If you go to the find combobox (Ctrl+D with the default keyboard mapping) and you type "> open" (without quotes). The ">" flips the find combobox into a mini Command window. The "open" part is the aliased command to the "file open" action. The super part is when you press space and the first character of the file you want to open anywhere in your solution, a dropdown window pops up with the files and folders that start with that letter. (thanks to Peter Provost)
Thursday, October 13, 2005
Cool Tools
It's been a long time since I blogged.. As always I am gonna blame it on work :) We had a tough work schedule for the last couple of months.. But really feeling happy about how things turned out in the end.. learnt to configure/administer Websphere MQ in the course of the project. we have earlier used MSMQ for our internal Message Queuing purpose and we were forced to use MQ since the client we were interacting with was using MQ.
I havent checked/used and new tool for a long time now. So I started exploring the new tools that are available. I came across couple of cool tools.
1. del.icio.us is a social bookmarks manager. I always had problem storing my favourite links and sharing it between my laptop at home and work. I am sure this is gonna solve all my issues. It allows you to easily add sites you like to your personal collection of links, to categorize those sites with keywords. You can also share your collection between your own browsers, machines and also with others. (coollll)
2. EverNote. I have been using OneNote to store information like website experts, to-do lists. It was a nice tool but i think it lacks thinks that are present in Evernote like Timeband, Encrypion. I dont think I will go back to OneNote after using this tool.
Let me know if anyone knows about any other cool tools they came across.
I havent checked/used and new tool for a long time now. So I started exploring the new tools that are available. I came across couple of cool tools.
1. del.icio.us is a social bookmarks manager. I always had problem storing my favourite links and sharing it between my laptop at home and work. I am sure this is gonna solve all my issues. It allows you to easily add sites you like to your personal collection of links, to categorize those sites with keywords. You can also share your collection between your own browsers, machines and also with others. (coollll)
2. EverNote. I have been using OneNote to store information like website experts, to-do lists. It was a nice tool but i think it lacks thinks that are present in Evernote like Timeband, Encrypion. I dont think I will go back to OneNote after using this tool.
Let me know if anyone knows about any other cool tools they came across.
Friday, June 10, 2005
Transactions in .NET 2.0
After procrastinating the installation of VS .NET 2005 beta 2 for almost a week now .. I finally got it installed and running on my laptop..
The first thing that caught my attention is the revised Transaction support. .Net v1.1 supported two transaction programming models.. explicit transaction programming model (using IDbTransaction interface) and Declarative transaction flow model(using System.EnterpriseServices). The explicit programming model cannot be used when you have distributed transactions. But the Declarative transaction comes with the price of COM+ hosting model which many Configuration Managers find intimidating ;). and it has the overhead of using DTC transaction even though only a single resource is involved. So there is no clean and easy way of transaction management in .Net 1.1.
.Net 2.0 addresses all the above issues with the addition of two new transaction managers Lightweight Transaction Manager LTM(similar to .Net 1.1 explicit programming model) and OleTx Transaction Manager OTM(Similar to .Net 1.1 Enterprise Services) and helper classes available in System.Transaction namespace. As developers we need to be aware only about the usage of System.Transaction namespace and .NET internally takes care of using the appropriate resource manager.
Suppose a object is accessing only a single durable resource(SQL server 2005) .NET would use LTM internally to provide the best throughput and performance. If at any point the object accesses another durable resource(MSMQ) then the transaction will automatically be promoted to use OTM. This transaction will remain in this state till its completion.
A simple usage of TransactionScope:
using(TransactionScope ts = new TransactionScope())
{
// do any transactional work here
// The transactional work could be spanning one resource or multiple resource.
// calling complete will commit the work.
ts .Complete();
}
Make sure to call the Complete() method or else your transaction will be rolled back..
One important thing worth noting is the existing enterprise services like Oracle, SQL server 2000 and MSMQ cannot participate in an LTM transaction. So by default they use only the OTM manager.
The first thing that caught my attention is the revised Transaction support. .Net v1.1 supported two transaction programming models.. explicit transaction programming model (using IDbTransaction interface) and Declarative transaction flow model(using System.EnterpriseServices). The explicit programming model cannot be used when you have distributed transactions. But the Declarative transaction comes with the price of COM+ hosting model which many Configuration Managers find intimidating ;). and it has the overhead of using DTC transaction even though only a single resource is involved. So there is no clean and easy way of transaction management in .Net 1.1.
.Net 2.0 addresses all the above issues with the addition of two new transaction managers Lightweight Transaction Manager LTM(similar to .Net 1.1 explicit programming model) and OleTx Transaction Manager OTM(Similar to .Net 1.1 Enterprise Services) and helper classes available in System.Transaction namespace. As developers we need to be aware only about the usage of System.Transaction namespace and .NET internally takes care of using the appropriate resource manager.
Suppose a object is accessing only a single durable resource(SQL server 2005) .NET would use LTM internally to provide the best throughput and performance. If at any point the object accesses another durable resource(MSMQ) then the transaction will automatically be promoted to use OTM. This transaction will remain in this state till its completion.
A simple usage of TransactionScope:
using(TransactionScope ts = new TransactionScope())
{
// do any transactional work here
// The transactional work could be spanning one resource or multiple resource.
// calling complete will commit the work.
ts .Complete();
}
Make sure to call the Complete() method or else your transaction will be rolled back..
One important thing worth noting is the existing enterprise services like Oracle, SQL server 2000 and MSMQ cannot participate in an LTM transaction. So by default they use only the OTM manager.
Wednesday, June 08, 2005
Difference between Hashing & Encryption
Many people tend to think of Encryption & Hashing being one and the same :(
Encryption and hashing are completely different. With encryption, you have the ability to decrypt. Its usage is like a you encrypt the text, you will be able to decrypt, whether it is with one symmetrical key or with a pair of keys.
Hashing is a one-way function. When you hash a value, you are always guaranteed to get a certain result. But with that result, you will not be able to reverse it and retrieve the clear-text. Also with hashing, the size of the hashed data will always be a certain sized specified by the hashing algorithm.
When to use encryption versus hashing depends on the application. Hashing is fast and only one-way. That's the key difference. One-way versus Two-way.
Encryption and hashing are completely different. With encryption, you have the ability to decrypt. Its usage is like a you encrypt the text, you will be able to decrypt, whether it is with one symmetrical key or with a pair of keys.
Hashing is a one-way function. When you hash a value, you are always guaranteed to get a certain result. But with that result, you will not be able to reverse it and retrieve the clear-text. Also with hashing, the size of the hashed data will always be a certain sized specified by the hashing algorithm.
When to use encryption versus hashing depends on the application. Hashing is fast and only one-way. That's the key difference. One-way versus Two-way.
Thursday, May 19, 2005
Free Wireless Internet
I booted my new laptop with the inbuilt wireless in my house last night ... to my surprise i had too many unsecured wireless network available for me to choose... I think there are too many people out there who dont have enough idea of how to go about setting up a secure wireless network... I am not a networking/wireless guru nor I haven't setup a wireless network of my own yet.. but I was googling around for the steps to make a wi-fi secure.
- Change the default SSID. Most people don't even bother to change the default SSID provided by a wireless access point. If your neighbor knows that you are using a Linksys wireless access point (say, by seeing the boxes you throw away), they could easily try the default SSID. Always change the SSID to something obscure, and never try to use your company name or your personal name. These names are too easy to guess.
Disable SSID broadcast. By default, most wireless access points will broadcast the SSID to all wireless devices; anyone with a wireless network card can detect the SSID you use in your network and gain access to your network. - Use MAC address filtering. If you have a small number of users in your wireless network (which is usually the case), you can use MAC address filtering. With MAC address filtering, you enter the MAC address of your network card and manually enter this number into your wireless access point. Only MAC addresses that have been registered with the wireless access point are able to gain access to your network. You can usually locate the MAC address of your network card on the device itself.
- Always change the default user name and password for your wireless access point. It's too easy for people to guess the default user names and passwords used in wireless access points.
- Turn off DHCP. Use static IP addresses if the number of users on the network is small. Turning off DHCP will prevent wireless sniffers from seeing the IP addresses being used.
Refrain from using the default IP subnet. Most wireless routers use the default 192.168.1.0 network. It is easy for people to guess the IP addresses used and illegally gain access to the network. - Use WEP for encryption of packets. If you are concerned about the confidentiality of information transmitted by your wireless network, you may wish to enable WEP encryption. Though WEP has been proven to be "crackable," it still acts as a deterrent against packet sniffing for everyone but ardent hackers.
Wednesday, May 18, 2005
New Laptop
I got my laptop delievered from DELL today .. It's Inspiron 700M model with Intel Pentium M 1.6 Ghz processor, 1 GB SDRam, 80 GB Hard disk drive, 8X CD/DVD burner and integrated 802.11 b/g wireless .. I made sure I am getting the latest configuration b'cos it will be really expensive to upgrade these laptops if needed in the future..
I went down my memory lane and the year was 1995.. second year in my college when my dad decided to buy me a computer.. He got the latest configuration for me then... an Intel 486 processor with 4 MB Ram and 512 MB Hard Disk Drive and had a 1.44 Floppy Disk Drive... I am just amazed by how fast things have changed in the last 10 years.. My new laptop has RAM twice the size of my old Hard disk drive, even a CD drive was an expensive thing in the past and now I have a CD/DVD burner. Floppy Disk Drive have become totally absolute. Even modem is not a common thing when you buy a computer.. nowadays we have gone from wired - wireless modems..
I cant even imagine what's going to happen 10 yrs from now.. But I am sure we will have computers with 80 GB RAM ...
I went down my memory lane and the year was 1995.. second year in my college when my dad decided to buy me a computer.. He got the latest configuration for me then... an Intel 486 processor with 4 MB Ram and 512 MB Hard Disk Drive and had a 1.44 Floppy Disk Drive... I am just amazed by how fast things have changed in the last 10 years.. My new laptop has RAM twice the size of my old Hard disk drive, even a CD drive was an expensive thing in the past and now I have a CD/DVD burner. Floppy Disk Drive have become totally absolute. Even modem is not a common thing when you buy a computer.. nowadays we have gone from wired - wireless modems..
I cant even imagine what's going to happen 10 yrs from now.. But I am sure we will have computers with 80 GB RAM ...
Wednesday, April 20, 2005
Toilet Paper and Thread Synchronization
I am sure anyone reading this post to see the wierd title. what does Toilet Paper has anything to do with Thread Synchronization??? Mike Woodring has used Toilet Paper as an analogy to teach people about Thread Synchronization.. and he does it pretty well. take a look at this article and I am sure you will appreciate it :)
http://pluralsight.com/blogs/mike/archive/2004/12/13/3905.aspx
http://pluralsight.com/blogs/mike/archive/2004/12/13/3905.aspx
Monday, April 11, 2005
What movie are you ??
I just came across this link "what movie are u ?? ".. found it interesting and thought will try it.. and this is my result. But not sure whether I answered all my questions correclty ;)
Friday, April 01, 2005
Wanna write a Computer book.
One of my long time goal is to write a technical book... (something like "Programming .Net components" by Juwal lowy.. I know I am trying to set too high a standard here.. but there's nothing wrong in aiming for the star :) ..
I was not sure the things I need to develop to write my own book... I was lucky to read this article written by Eric Gunnerson .. read this article if you aspire to become an author someday..
http://blogs.msdn.com/ericgu/articles/396328.aspx
I was not sure the things I need to develop to write my own book... I was lucky to read this article written by Eric Gunnerson .. read this article if you aspire to become an author someday..
http://blogs.msdn.com/ericgu/articles/396328.aspx
Subscribe to:
Posts (Atom)
Loading...
