Welcome to MSDN Blogs Sign in | Join | Help

March 2006 - Posts

SYSK 95: Expand Your Horizon – Learn About NUMA

NUMA stands for Non-Uniform Memory Access or Non-Uniform Memory Architecture. NUMA is a computer memory design used in multiprocessors, where the memory access time depends on the memory location relative to a processor. Under NUMA, a processor can access
Posted by irenak | 2 Comments

SYSK 94: as, is, where keywords in C#

There are a few keywords one should be aware of: The as operator is similar to a cast but on any conversion failure null is returned as oppose to raising an exception. Note: it will not do the conversion (cast != data type conversion)! Personally, I prefer
Posted by irenak | 9 Comments

SYSK 93: SQL 2005 – How to Script Database One Object per File

In SQL 2000, there was a feature many of us loved and used heavily – ability to script all database objects one per file. This allowed the scripts to be stored in a source control tool for versioning purposes. Unfortunately, this feature is missing from
Posted by irenak | 6 Comments
Filed under:

SYSK 92: How to Clear or Remove Certain Items from “Recent Projects” List in Visual Studio

If you create or view a lot of sample projects or demos, you’d love this. While there is no GUI for this, all the recently opened projects are stored in the registry under HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\ProjectMRUList key. All you
Posted by irenak | 0 Comments

SYSK 91: Cool Trick -- Move an Entire Paragraph with a Key Stroke

The other day, I accidentally discovered an easy way to move a line (or number of selected lines) up or down in your Word document… Say, you had a bullet point or a paragraph (or any other selected text) that you wanted to move up or down within a document.
Posted by irenak | 6 Comments

SYSK 90: SQL: What Is a Hash Join and When Should You Use It?

Did you know that hash join is most efficient when one of the tables is significantly different in size than another one? Want to know why? Then read on… SQL Server uses different kinds of join operations – e.g. nested loop join, merge join, hash join…
Posted by irenak | 0 Comments
Filed under:

SYSK 89: Hashing Explained...

So, you hear all the time – Hashtable, hash value, etc. You’ve seen GetHashCode method in Object type. But what is hashing? Hashing is a process of applying one of many hash algorithms. It’s frequently used to create/use hash tables, which significantly
Posted by irenak | 2 Comments

SYSK 88: How to Avoid Hardcoding Stored Procedure Names

Say you want to return the name of the stored procedure where an error occurred… How can you do that without hardcoding the stored proc name? The answer is simple – by using the system variable @@ProcID and converting it to name. Execute the following
Posted by irenak | 0 Comments
Filed under:

SYSK 87: A Better MaskedTextBox For Currency Fields

You may want to save this one off and put it in your personal toolbox… The MaskedTextBox that comes with .NET has a few limitations – it does not automatically shift your digits. For example, if I enter a mask of 0000.00, and enter number 12, I’d expect
Posted by irenak | 13 Comments
Filed under:

SYSK 86: .NET Reflector Revisited

In SYSK 7, I discussed a tool created by Lutz Roder that can be used to decompile and analyze .NET assemblies. The tool is available at http://www.aisto.com/roeder/dotnet/ . This tool disassembles the raw assembly and translates the binary information
Posted by irenak | 4 Comments
Filed under:

Attachment(s): obfuscation example.gif

SYSK 85: What are the key features of TFS (Team Foundation Server)?

As was announced yesterday by Rick LaPlante, the Team Foundation Server has been released to manufacture (RTM). The bits should be available to customers for download via Microsoft’s Developer Network (MSDN) within a few days. And did you know that Microsoft
Posted by irenak | 1 Comments

SYSK 84: Where Do GAC Assemblies Live?

Ever wondered where shared assemblies actually are stored, and how “side-by-side” is made possible? Well, the secret is about to be revealed…. Ok, so it’s somewhere in the file system… But where exactly? You’ll need to open the console command prompt
Posted by irenak | 2 Comments
Filed under:

SYSK 83: On the Importance of Calling TrimToSize

Like StringBuilder (see SYSK 16), ArrayList, Queue and SortedList double the buffer when the existing capacity is exceeded and a new element must be inserted. Try it for yourself – create an ArrayList and call its Capacity property. By default, it initializes
Posted by irenak | 2 Comments
Filed under:

SYSK 82: Compression Example in .NET

As many of you may know, .NET framework 2.0 contains a built in support for compressing the file or any generic stream such as FileStream, MemoryStream, TextWriter, XmlWriter, NetworkStream, etc So, now, you can compress/decompress using GZip algorithm
Posted by irenak | 7 Comments
Filed under:

SYSK 81: How compression works

In essence, file-compression programs simply get rid of the redundancy. Instead of listing a piece of information over and over again, a file-compression program lists that information once and then refers back to it whenever it appears in the original
Posted by irenak | 3 Comments

SYSK 80: Keyboard Shortcuts to Comment/Uncomment Code in SQL Server Management Studio and in Visual Studio 2005

If you’re a keyboard person, try this combination to comment out selected lines (works in both, SQL and Visual Studio) – press Ctrl-K, keep pressing Ctrl key and hit key C (Ctrl-K Ctrl-C). To uncomment selection, use Ctrl-K Ctrl-U.
Posted by irenak | 0 Comments
Filed under: ,

SYSK 79: Good SQL Interview Question -- What is the Left Anti Semi Join?

The left anti semi join is a logical operator (read: you’ll see it referred to in the execution plan, but there is no explicit T-SQL equivalent) which returns each row from the first (top) input when there is no matching row in the second (bottom) input.
Posted by irenak | 0 Comments
Filed under:

SYSK 78: Avoiding Infinite Loops Due to Error Handling Retries

Ok, so you want to do error handling, not just error logging… So, you catch exception, examine it’s type and contents and try to resolve the problem… Then what? Then you want to retry the logic that failed before. So, in many cases, you call yourself
Posted by irenak | 0 Comments

SYSK 77: The Difference Between Microsoft.Security.Application.AntiXSSLibrary.HtmlEncode and System.Web.HttpUtility.HtmlEncode

As many of you may know, on Feb. 26 Microsoft has released Microsoft Application Security Anti-Cross Site Scripting Library. The download is available at http://www.microsoft.com/downloads/details.aspx?familyid=9A2B9C92-7AD9-496C-9A89-AF08DE2E5982&displaylang=en
Posted by irenak | 3 Comments

SYSK 76: When Should You Call AddMemoryPressure?

If memory consumption happens in the unmanaged code called by your managed code, GC has no way of knowing that your small managed object has big memory footprint. For example, your code might call some legacy API, which allocates memory, and your object
Posted by irenak | 0 Comments

SYSK 75: Do You Use Your Computer From Public Places? If Yes, Read This...

With public access points available across town in coffee shops, restaurants, libraries, hotels, and airports, web access on the road is both abundant and convenient. But there's a big problem with all this openness: there's no way of knowing how secure
Posted by irenak | 0 Comments

SYSK 74: Are You Using SecureString Class?

The new System.Security.SecureString type (introduced in .NET 2.0) uses DPAPI to help ensure that sensitive data stored in string form is not exposed to memory or disk-sniffing attacks. The data is held in memory in the encrypted format, and is only decrypted
Posted by irenak | 1 Comments

SYSK 73: On the Importance of allowExeDefinition Attribute

When you create an application scoped setting, the allowExeDefinition attribute on the <section> element is omitted. For user setting, it’s added by VS and set to value “MachineToLocalUser”. The valid values for this setting are: - MachineOnly =
Posted by irenak | 7 Comments
 
Page view tracker