Blog Stats
  • Posts - 94
  • Articles - 0
  • Comments - 10
  • Trackbacks - 0

 

Tuesday, March 09, 2010

So I got a fake Intel Core i7-920

Perhaps you have seen the hub-bub about the counterfeit Intel Core i7-920 chips that were sent out across the country between March 1st and March 4th from NewEgg.com (via their distributor)? Well, I got one of these "chips" myself!!

Here's the write-up on the box I received over at GearLog.com from Dan Evans:

Hands On: Unboxing the Fake Intel Core i7-920

Check it out!

(By the way, NewEgg dealt with this efficiently and quickly offering me either a full refund or another chip via expedited delivery.  Their service rocks! )

Friday, March 05, 2010

March 2010 IT Toolbox - TechNet Magazine Online

The March 2010 TechNet Magazine posts on the website. Check out my IT Toolbox column here:

March 2010 TechNet Magazine IT Toolbox

In this issue I covered:
  • Alloy Navigator Express: Asset, Help Desk, and Inventory Tracking
  • CleanAfterMe: Clean up your tracks
  • KBAlertz.com: Hot fix and security bulletin website
Check it out and let me know what you think!

And if you have a tool you want to see me review, please suggest it to me here: tntools@microsoft.com.

Thursday, February 18, 2010

February 2010 IT Toolbox - TechNet Magazine Online

The February 2010 TechNet Magazine posts on the website. Check out my IT Toolbox column here:

February 2010 TechNet Magazine IT Toolbox

In this issue I covered:
  • Input Director: Control multiple Windows systems with one keyboard and mouse
  • IPNetInfo: Query multiple WHOIS servers on sets of IP addresses
  • QweryBuilder: Manage multiple database types through one interface
Check it out and let me know what you think!

And if you have a tool you want to see me review, please suggest it to me here: tntools@microsoft.com.

Thursday, February 04, 2010

Shrinking your Transaction Log with SQL Server 2008 to Free Disk Space

If you have been used to clearing up disk space on your development and test SQL server instance file systems with SQL Server 2000 or SQL Server 2005 by using the famous TRUNCATEONLY option on your transaction logs, you might be disheartened that they have removed this option from SQL Server 2008 (with good reason some might say).

If you do try to use it, you will get the infamous:

'TRUNCATEONLY' is not a recognized BACKUP option.

To achieve the same effect with SQL Server 2008, you can toggle the recovery mode for the target database and then call your DBCC SHRINKFILE to clear up disk space hogged by your transaction log.

USE MyDatabase
GO
ALTER DATABASE MyDatabase SET RECOVERY SIMPLE
GO
ALTER DATABASE MyDatabase SET RECOVERY FULL
GO
DBCC SHRINKFILE('MyDatabase_log',1)
GO

(Of course if you are already using simple recovery, you wouldn't need to toggle.)

Hope this helps!

 

Wednesday, January 27, 2010

Don't get caught by ANSI PADDING, VARCHAR, and trailing whitespace!

One thing to be aware of when you have VARCHAR columns and are using ANSI PADDING: trailing whitespace is trimmed and not counted in your equality ( = / <> / LIKE) statements, so you might not get the results you are looking to be returned from your query. 

In the same vein, the len() function will return the same value for two strings if one has trailing whitespace.  If you need to compare those two fields including trailing whitespace values, use datalength() instead.

Here's some example T-SQL:

DECLARE @Table TABLE (Field VARCHAR(50))

INSERT @Table VALUES ('some text')
INSERT @Table VALUES ('some text       ')
INSERT @Table VALUES ('    some text')

-- returns 2 : -- trailing spaces trimmed,
--
leading spaces count
SELECT '"' + Field + '"'
FROM @Table
WHERE Field = 'some text'

-- also returns 2
SELECT '"' + Field + '"'
FROM @Table
WHERE Field LIKE 'some text'

-- shows the difference between len()
-- and datalength()
SELECT Field, LEN(Field) AS 'Length', DATALENGTH(Field) AS 'DataLength'
FROM @Table

 

Hope this helps!

Tuesday, December 08, 2009

December 2009 IT Toolbox for TechNet Magazine

The December 2009 TechNet Magazine is on the website. Check out my IT Toolbox column here:

December 2009 TechNet Magazine IT Toolbox

In this issue I covered:
  • Eraser: Eradicate Sensitive Information
  • SQL Server Backup Pro from Red Gate: Streamline SQL Server Backups
  • MindManager: Map Out Ideas, Notes and Projects
Check it out and let me know what you think!

And if you have a tool you want to see me review, please suggest it to me here: tntools@microsoft.com.

Thursday, November 05, 2009

November 2009 IT Toolbox Column for TechNet Magazine

The November 2009 issue of TechNet Magazine is out on the website. Check out my IT Toolbox column here:

November 2009 TechNet Magazine IT Toolbox

In this issue I covered:
  • BeyondCompare 3: Compare, Merge And Synchronize Files And Folders
  • WhatIsMyIp.com: Get IP Details; Test Connection Speed
  • ADRecycleBin: Find and Restore Deleted AD Objects
Check it out and let me know what you think!

And if you have a tool you want to see me review, please suggest it to me here: tntools@microsoft.com.

Also, as some of you know, this was the last print issue of TechNet Magazine. :( But the digital edition will continue, so read on I say, read on! :)

Monday, November 02, 2009

Retrieve Image from Windows Clipboard via .Net C#

If you want to snag clipboard data from a different application into the context of your running .Net application, here's how you can do it:

        private static Image _clipBoardImage = null;

        private static Image GetImageFromCopyPasteBuffer()
        {
            Thread t = new Thread(new ThreadStart(GetClipboardBitmap));
            t.SetApartmentState(ApartmentState.STA);
            t.Start();
            t.Join();
            return _clipBoardImage;
        }

        private static void GetClipboardBitmap()
        {
            IDataObject data = Clipboard.GetDataObject();
            if (data == null || !data.GetDataPresent(DataFormats.Bitmap, true))
                throw new ApplicationException("No clipboard image data was present.");
            _clipBoardImage = (Image)data.GetData(DataFormats.Bitmap);
        }

 

Hope this helps!

 

Wednesday, October 21, 2009

.Net Friend Assemblies

Have you ever want to create a "friend" assembly while programming with the .Net framework?  They can be very useful for segmenting your codebase amongst different projects.

Friend Assemblies allow an assembly to see the internal methods and properties of a different assembly by specifying an attribute on the primary assembly that specifies the assembly name of the friend.

The simplest way to do this is to add something like the following to your AssemblyInfo.cs file in your primary project:

[assembly: InternalsVisibleTo("my.friend.assembly")]

This would allow my.friend.assembly to have access to all of the primary project's internals.

If you need to worry about security of the assemblies (I suppose we all should), then you should also consider using strong names in conjunction with the compiler attribute.

More information on .Net Friend Assemblies can be found here:

http://msdn.microsoft.com/en-us/library/0tke9fxk.aspx

Hope this helps!

Friday, September 25, 2009

October 2009 IT Toolbox Column for TechNet Magazine

The October 2009 issue of TechNet Magazine is out on the website. Check out my IT Toolbox column here:

October 2009 TechNet Magazine IT Toolbox

In this issue I covered:
  • AxCrypt: Secure Sensative Information
  • KaVoom! KVM: Software-based KVM Switch
  • (Book) Malware Forensics: Investigating and Analyzing Malicious Code
  • filext.com: Extension Discovery Site
Check it out and let me know what you think!

And if you have a tool you want to see me review, please suggest it to me here: tntools@microsoft.com.

 

 

Copyright © Greg Steen