Gotta love a new desktop computer.

by tracker1 7. March 2010 14:50
CPU Usage

Okay, so I've been coveting some new hardware for some time now, I setup pretty much my whole family and most of my friends with updated hardware over the holidays, and wanted to get something for myself after the tax return came in.

I tried to pick hardware with decent value along with some higher customer ratings on various sites like newegg and amazon. For the most part I wanted to strike a performance balance. With my son's computer I went with a Core i7-750 and a massive ATI Radeon HD 5870. My goals were slightly different, I don't have a need for maximum gaming performance, and wanted a bit more CPU oomph for today's video encoders, and for my virtual machines. I went with Windows 7, simply because I like the UI. I considered Ubuntu's 10.04 development release, but decided to go for the stability of Windows 7. Cable management is usually a concern for me, as I like to be proud to show what's under the hood, so to speak. I also really wanted the performance boost that an SSD gives, I'm really happy the pricing has come down to a fairly reasonable point. All in all, the build cost me around $1350 altogether. I'm including links to the products I used on Amazon, but you can find it all on newegg pretty easily as well.

Okay, IMHO, this is awesome. :) My Windows Experience Index in Windows 7 is a solid 7.4, and most of the hardware I picked comes in around the same values. Very nice indeed. I'm going to go ahead and list the hardware below.

Windows Experience Index

Case - Cooler Master CM-690

Cooler Master CM-690 Case

I went with this case for a few features. Aesthetically, I like fairly straight forward cases, my last case was a nice Lian-Li mid tower. I like a lot of the features in this case. The 3.5 inch bays mount to the side, so it's easy to get drives in and out. The trays are screw-less, and work well. The 5.25 inch bays have a quickmount, in addition to the screws that are mounted to the case, so you don't loose them. The motherboard mounts are a standard threading. There's a nice set of cable management clips mounted inside the case. I had to remove one of them as it did block a couple of the side-mounted SATA ports. They're also just beyond the edge of a standard ATX motherboard, so if you have a long video card this may be an issue. I'm not using a large video card, and wanted the cable management. The bottom mounted PSU position is nice as well, you can mount so a modern PSU can take in air directly from the bottom, or mount upside down to draw from inside the case. The PSU mounts have some rubber around them to limit vibration and noise. The large fans also keep the noise down a bit, my GPU fan is the loudest in the case. It would be nice to have the option of a solid side panel, so that you can apply some foam padding to reduce the noise a bit further. I think the only gotcha is the effort to remove the front panel in order to clear the 5.25 inch drive plates for your external drives.


Power Supply - Cooler Master Silent Pro M600

Cooler Master Silent Pro M600 Modular Power Supply

This thing is awesome. The modular cables are flat, which actually makes the routing for them look really nice. The PSU itself is rated and sold at 600W, but it is comparable to a lesser 700W PSU. It's a solid unit. Lately I've been going with Antec, Corsair and Cooler Master power supplies, they tend to do really well in the middle tiers, and aren't priced too high. If you are planning on a dual-GPU powerhouse you may want to consider a bigger PSU, since some of the higher end video cards will drain over 200W each at load. This had dual-GPU ability, and if you are going with more modest cards, this will work. There is also a 700W version in this line, if you do go dual GPU that I'd recommend. This unit has plenty of overhead for a typical setup, or even one with a few extra drives if that's what you need.


Drive Bay - StarTech Trayless Hot Swap

StarTech SATA 5.25 to 3.5 Trayless Hot Swap

It's nice to have a quick bay you can eject a drive from and swap a new one in. The controller port this is plugged into should be set to AHCI mode so you can do an eject/swap of the drive while the computer is on. Windows 7 and Linux both support this pretty well. I really wish that there were an option in windows to add an Eject to the context menu for the drive bay though. Overall, it works quite well, but I wouldn't suggest putting anything that gets VERY hot in there, as there is no direct cooling over the bay. There are some bays that do, and multiple bay adapters that do. The fans on single-bay devices are very noisy though.


DVD Drive - LITE-ON 24x DVD Writer

LITE-ON 24x DVD Writer

It's a DVD burner. The reliability is decent, but to be honest, I don't use it much aside from archiving so I'm a bad judge here. Just the same, it's working well. I've used plenty of LITE-ON drives and have found them to be as good as any others. Though at the $30 price point, there isn't much point in worrying much about it. I will probably go with a BluRay drive in the near future, for now DVD works for me.


Motherboard - Gigabyte P55A-UD3

Gigabyte P55A-UD3 i7/i7 LGA-1156 Motherboard

I've been really happy with Gigabyte boards the past few years. This one is no exception. The only short coming for my needs was the lack of firewire ports. USB3 is nice as well. I wound up setting the SATA 3 controller to AHCI mode for my external ports and left the Intel controller to IDE (Native) mode. AHCI is needed to support the hotswap and eSATA bays properly. It would be nice if there were an option to set a couple of the Intel ports to AHCI while keeping the rest in IDE mode. I may get a PCIe SATA controller specifically for the external SATA drives (the hotswap and the eSATA port). It has every feature you'd want in a desktop board. If you don't have a big case, you may want to look into a Micro ATX equivalent. The Intel P55 chipset has been very solid, a lot of the work has been migrated into the CPU. This limits you to one PCIe x16 slot, which is a non-issue if sticking to a single GPU.


CPU - Intel Core i7-860

Intel Core i7-860 LGA-1156 CPU

What can I say, it's a great CPU. If you need more than 8GB of ram, the extra cost for a 1366 based CPU would be more than offset by the price difference of going from 2GB sticks to 4GB sticks. If you aren't doing video editing or re-encoding, you may well be best served by a Core i5-750. For me, this is a great fit. I tend to work in Virtual Machines so the extra CPU oomph is helpful. Along with some video edits, and re-encodes. I may bite the bullet and go up to 16GB of ram in the future. I really didn't have the need for more than 8GB at least at the moment, and I don't feel the 1366 platform is worth it for most people. The biggest limitation is the onboard PCIe controller is pretty limited, so you won't get a dual GPU setup that works optimally. However, there are some REALLY fast GPUs out there, some with two procs on a single PCB card.


HSF - Cooler Master Hyper 212 Plus

Cooler Master Hyper 212 Plus

This thing is a beast. It's a bit on the large side, and if you aren't overclocking, I'd suggest looking at Cooler Master's TX3 instead. It's big and heavy. It honestly is less than a quarter inch from the side of the case (no second side fan here). The fan when mounted to push air through to the back overlaps one of the memory slots on my motherboard. Meaning if I need to change out the ram, the fan needs to be removed. Thankfully this is easy with the clip mount. It comes with an extra set if clip mounts for a second fan though. Beyond this, I did a short CPU burn with Prime95 64-bit and it never went above 55C, and my apartment's ambient temperature is around 78F. I'm not overclocking currently, but it's nice to have that head room in the future.


Memory - G.Skill 4GB DDR3 1600 (x2)

G.Skill 4GB DDR3 1600 CL9 Kit

What can I say, it runs, it's relatively quick. I never really saw the point in spending a lot on Uber-RAM that needs to be bumped up to higher voltages. I've run "Performance Memory" in the past, and didn't see any real difference. This time around I got the highest rated (via newegg) memory for DDR3-1600 that was available. I had to manually set it to 1600 (vs 1333) in the BIOS, but it's running great.


Video Card - HIS ATI Radeon HD 5770 1GB

HIS Radeon HD 5770 1GB GPU

I actually got this video card a few weeks ahead of everything else. When I removed the old video drivers and tried installing this card's it was like pulling teeth. On a fresh install, the first thing I did after install was to install the latest drivers, and it all went in smooth. The performance is decent for my resolution 1920x1080 (1080p), and to be honest I tend not to install any games with DRM, so my gaming is rather limited. Runs what I have thrown at it great just the same. Accelerated video playback runs smooth as well, really wish AMD/ATI would get the lead out and get OpenCL drivers out the door already. It does support MS DirectCompute already though, so that's a nice thing. I mainly got this card looking a bit to the future, as I do a bit of video archival and re-encoding to MP4+AVC (h.264).


SSD - Intel X25-M 80GB

Intel X25-M 80GB SSD

Love it, love it, love it! This thing is wicked fast. I migrated my old AppData over, and did a search for something in my profile with CubicExplorer (I was looking for a particular file) and it was done so quick, I had to do it twice. This thing seeks like butter melts in a hot pan, quick. I went with this drive because it was the best option in my price range. I've got it about half full after installing windows and all my applications. If you go with a smaller drive, you will probably want to get familiar with the mklink command to create symbolic directory links. I think 80 is probably a good size when combined with a spinning disk for large storage.


HDD - Western Digital AV-GP 1.5TB

Western Digital AV-GP 1.5TB

This drive is supposedly geared towards "Long Term Storage", but only comes with a 3 year warranty. To be honest, I was a fan of Seagate drives for quite a while until their reliability slipped a little. I'd really like to see a return to 5 year warranties for drives. At least this one works properly connected to a controller in AHCI mode. This is currently seated in my hotswap bay, so I can use it for mass/media storage.


Firewire - Syba SD-VIA-FW1E1H

Syba SD-VIA-FW1E1H PCI Firewire Adapter with internal 9-pin header

I mainly wanted this to be able to hook a camera to the top port on my case, since my motherboard choice didn't come with firewire ports. I haven't used it yet, and there's an alert icon over the device in Device Manager. I have another card I'll swap out to see if it works better.


OS - Windows 7 Ultimate (64-bit)

Windows 7 Ultimate

I have to be honest here, I absolutely love Windows 7, but if you're going to be buying it, you'll probably be best off with the Home Premium edition, or Professional. I have an MSDN account, so I went with the Ultimate version, but to be honest don't gain much from it. The add-ons for ultimate aside from BitLocker are about useless. Even then, I'm not using BitLocker on my desktop. Professional does get you some networking functionality if you are running on a Windows Domain though. Overall, I find Windows 7 simply performs better than XP or Vista. The features started in Vista are more polished and completed in Windows 7. The new task bar is awesome, it takes the best of what I like about the Vista start menu, and combines it with all the features I like in the OSX dock.



Tags:

Hardware

Paged Results in T-SQL

by tracker1 23. February 2010 19:08

Okay, so I wanted to return a paged result set from a Stored Procedure in Microsoft SQL Server in T-SQL. The results in question can be easily fed via a web service endpoint to a Silverlight, DHTML or other dynamic grid. My own use is to populate a jqGrid.

The features I need are to be able to return only the relevant results for the current page, as well as a count of the total rows available. I need to be able to input the current page number, an arbitrary page size, as well as dynamically sort on a given column. My real world use is a fairly complex set of joined tables, with several input parameters, so I am going to limit me queries to one table with the following format:

CREATE TABLE MyList (
    [id] UNIQUEIDENTIFIER PRIMARY KEY DEFAULT NEWID(),
    [created] DATETIME NOT NULL DEFAULT GETDATE(),
    [name] NVARCHAR(100) UNIQUE NOT NULL DEFAULT '',
    [description] NVARCHAR(250) UNIQUE NOT NULL DEFAULT ''
);

More...

Tags: , , , ,

Databases | jQuery | SQL Server | Tables | T-SQL | Web Development

JS Function arguments and optional arguments

by tracker1 19. February 2010 12:13

I hate to admit it, but I do read Stephen Chapman's Blog, and to be honest I tend to find a lot of the things he covers as incomplete, or outright not the best way to do something. A lot of entries are simple repeats of past entries as well. In the past I've had comments censored, specifically when he stated that you should just ignore IE in a prior post, I had a bit of a strongly worded response. In any case, today's entry covered Optional Function Arguments. There's one small point he missed the boat with here regarding the arguments instance.

"That is as far as the similarity to arrays goes though as none of the other methods and properties that can be used with arrays can be used with the arguments object."

It is possible to easily convert the arguments object to an Array instance though. Here's a simple example.

function argumentsToArray() {

  //convert object arguments to args Array
  var args = Array.prototype.slice(arguments, 0);

  //alerts true
  alert(args instanceof Array);

}


I've thought about, and may actually do more of these annotation posts. I've also been thinking about doing some compilation posts with information from Ajaxian, DailyJS and a few other sites.

Tags: , ,

JavaScript

Detect empty values in JavaScript

by tracker1 15. February 2010 11:14

Okay, this is a quick one. There are several states that can be considered empty in JavaScript, a non-numeric value in a number, an invalid date, and empty string, an undefined value, and a null value. The issue is that some of these require testing against isNaN, and others will evaluate as matching null or an empty string (ex: the number zero and the boolean false). What I wanted was a simple method to check for a non-empty object or string, here it is.

function isEmpty(obj) {
    if (typeof obj == 'undefined' || obj === null || obj === '') return true;
    if (typeof obj == 'number' && isNaN(obj)) return true;
    if (obj instanceof Date && isNaN(Number(obj))) return true;
    return false;
}


How it works, is first it tests for an 'undefined' object, an object that is explicitly equal to null, or explicitly equal to an empty string. If it matches, it's empty. From here there's some more specific checking, if it's a number type of variable, and isNaN (Not a Number), then it's empty. If it's a date, and Number(obj) (which gets the value of the date as a Number) isNaN, then it's an invalid date, and ergo isEmpty. Otherwise the isEmpty returns false (valid, non-empty value). Hope this helps some of you. :)

Tags: , , ,

JavaScript | Web Development

Classy JavaScript - Best Practices

by tracker1 11. February 2010 13:26

Okay, so you really want to be able to have some of your JavaScript methods to have access to a variable that is private, but maintains state between calls. The first piece of knowledge, is that you can have the contents of a function execute itself at runtime.

(function(){ /*Your actions here*/ })();

This is a very common method of defining complex classes and libraries, that can have their own variables or methods that aren't otherwise available to the object model outside this closure. When you utilize "this" within the function's closure it will be default to the global object, which in the Browser DOM is "window".

(function(){
    this.test = "Test Value";
})();
alert(test); //alerts "Test Value"

Usually when creating libraries in JavaScript it's a good idea to create namespaces for your library. More...

Tags: , , ,

JavaScript

EcmaScript 5's Date Extensions

by tracker1 7. January 2010 10:44

Okay, so you want to utilize some of the niceties of the new EcmaScript 5 extensions to Date.  Namely they've added a nice instantiation from an ISO-8601-style string, as well as a Date.prototype.toISOString method definition.  In addition there are Date.UTC and Date.now methods defined.  As the nice guys over at Mozilla have offered script based extensions to Arrays to support their method extensions there, I wanted to do something similar for Date instances.  I've managed to do this, and have had it done since the ES5 specs were released, but figured I should put this out there for anyone interested.

var epoch1 = new Date("1970-01-01T00:00:00.000Z");
var epoch2 = new Date(0);

if (epoch1.getTime() == epoch2.getTime())
    alert("Epochs match!");
    
alert(epoch1.toString()); //localized date instance of the JS epoch
alert(epoch2.toISOString()); // "1970-01-01T00:00:00.000Z"
alert(epoch1 instanceof Date); // true
alert(epoch1.constructor == Date); //true
alert(Date.UTC(1970,0,1,0,0,0,0)); // 0

I also have a few convenience methods for handling Microsoft's JSON encoded strings. As well as rolling a date from a "Local" or "UTC" version.

DateExtensions.js (11.67 kb)

Edit 2010-01-08: I added missing support for .constructor == Date

Tags: , ,

JavaScript

Intelectual Property Tax

by tracker1 19. November 2009 10:32

If intelectual property in this country is to be treated and protected like real property, then why isn't it taxed as real property.  Why aren't infringement settlements taxed at the point of transaction,the same as with physical goods?  If we are so short of funding for government programs, why isn't the copyright and patent industry taxed like the physical production industries?

Tags:

New Monitor

by tracker1 12. September 2009 16:43

New MonitorOkay, it's a TV, but I'm only using it as a montitor.  It's currently connected to my computer via DVI-to-HDMI and works pretty well.  I'd been thinking about doing this since the 32" LCD TV's with 1080p started getting pretty reasonable in price.  It doesn't have the super resolutions of some computer monitors, but 1920x1080 is enough for me to work with, and this way the image is larger, instead of most things just being rendered wrong, or stupidly small, at least for now.  I went with a 42" LG (Model 42LH50) display.

For comparison's sake, that is a Unicomp Customizer 104 keyboard (IBM Model M Style).  The thing is freakishly huge, and I love it.

Tags:

Hardware

Getting the Server-Side Offset to the JavaScript Epoch in C#

by tracker1 3. September 2009 16:50

Just in case anyone else needs it, here's my method for getting the millisecond offset of a server's local time to UTC time in milliseconds, for use in client-side JavaScript.

private int ServerSideJsUtcOffset
{
    get {
        DateTime epoch = new DateTime(1970,1,1);
        int offset = (int)epoch.ToUniversalTime().Subtract(epoch).TotalMilliseconds;
        return offset;
    }
}

There's really not much to it, it's mainly so that I can handle converting serialized dates to a proper local time on the client. The DateTime objects in question are stored in a database as the UTC date-time, via an ORM tool, and sent to the client with System.Web.Script.Serialization.JavaScriptSerializer. All the server-side code uses the same ORM tool, and all the client-side JSON is processed via the same local parser. So it was simply easier adjusting the client-side parser than it was to adjust the server-side class hierarchy.

I should note that I could have set the initial date to DateTime.Now instead of implicitely using the JS epoch, as the difference would be the same for any localized DateTime, just felt the clarity was worth it.

Tags: , , ,

.Net | JavaScript

Compressing Bytes In .Net

by tracker1 20. August 2009 10:57

Okay, this started when I wanted to store a bit of JSON that gets rendered into the ASP.Net cache.  Each entry would be unique to a given user, and I wanted to save a little memory, each entry would be about 8KB in size.  I looked into this and found the System.IO.Compression namespace that is available in .Net 3.5.  I created a small class with some helper extensions to be able to compress/decompress an array of byte, and handle to/from a native string.  Here's what I came up with.


CompressionExtensions.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.IO.Compression;

namespace Sample
{
    public static class CompressionExtensions
    {
        const int KB = 1024;

        public static byte[] Compress(this byte[] input)
        {
            using (var ms = new MemoryStream(input.Length + 8))
            {
                ms.Write(BitConverter.GetBytes(input.Length), 0, 4); //record original length

                if (input.Length < KB)
                {
                    //if less than 1KB, don't compress original
                    ms.Write(input, 0, input.Length);
                    return ms.ToArray().Take(input.Length + 4).ToArray();
                }

                //compress the original input
                using (var ds = new DeflateStream(ms, CompressionMode.Compress))
                {
                    //send the original input to the compressed stream
                    ds.Write(input, 0, input.Length);

                    //add null padding. the decompress gets wonky without it.
                    ds.Write(new byte[4], 0, 4);
                    ds.Flush();
                    ms.Flush();
                    return ms.ToArray();
                }
            }
        }

        public static byte[] Decompress(this byte[] input)
        {
            if (input == null || input.Length < 4)
                throw new ApplicationException("Invalid compressed bytes, no length header.");
        
            var bitlen = BitConverter.ToInt32(input, 0);

            //if less than 1KB, return the non-compressed original
            if (bitlen < KB) return input.Skip(4).ToArray();

            var buffer = new byte[bitlen];
            using (var ms = new MemoryStream(input.Length - 4))
            {
                ms.Write(input, 4, input.Length - 4);
                ms.Flush();
                ms.Seek(0, SeekOrigin.Begin);
                using (var ds = new DeflateStream(ms, CompressionMode.Decompress))
                {
                    //this always returns a -1 for the first read
                    //    subsequent reads will work properly
                    ds.ReadByte();

                    //read the input stream into the return buffer
                    if (bitlen > ds.Read(buffer, 0, bitlen))
                        throw new ApplicationException("Invalid compressed bytes.");
                }
            }

            //only return the number of bytes originally saved, trim excess
            return buffer;
        }

        public static byte[] ToCompressedBytes(this string input)
        {
            return Encoding.UTF8.GetBytes(input).Compress();
        }

        public static string ToDecompressedString(this byte[] b)
        {
            return Encoding.UTF8.GetString(b.Decompress());
        }
    }
}

I found that without adding some padding of at least two null bytes, the decompression of the data would sometimes give me an invalid final byte. I also push in a 4-byte length header for a sanity check. This also helps me to not compress anything under 1KB in size, where compression really doesn't work very well.

The conversion of the string to UTF8 helps more with strings that will mostly contain values within the ASCII character set. It is worth noting that if there are mostly multibyte characters, the byte array itself could get bloated. For my usage, I'm getting an 8KB string down to around 2KB, you could extend this to support UTF8/Unicode encoding by appending a character to the end before compressing. This may be useful if the string is >2KB and more than 1/3 is multibyte characters, this would take a little more CPU time to inspect the input string in this case.

Your milage may vary. Void where prohibited. Quantities limited. Some restrictions may apply. Batteries not included.

Tags: ,

.Net | Architecture | C# | Databases | mono

Powered by BlogEngine.NET 1.5.0.7

About Tracker1

Michael J. Ryan aka Tracker1

My name is Michael J. Ryan aka tracker1 (or azTracker1) and I've been developing web based solutions since the mid 90s.  My contact information and resume are online at tracker1.info.

Books

Ads