So upon reading Scott Hanslemans blog, one of my favorite blog contributors for .NET and technology alike, I noticed he is trying out some "dark" settings in Visual Studio. Now let me say I have had some serious issues at work where I would get into a zone and be staring at the screen non-stop for 5-8 hours non-stop only to get up and realize my eyes are burning like crazy. So last week I changed my Visual Studio settings at work. Today I switched my home computers over to the darkside after enjoying it quit a bit at work. Other than the occasional comment from my fellow employee wondering what the hell I got going on with my Visual Studio, its a pretty enjoyable experience. So posted below is an example image capture of my settings, along with the Visual Studio 2005 settings application. Note that I am using the Consolas font from Microsoft which only looks good on ClearType enabled systems. If you have Visual Studio 2005 I would highly recommend that font, I use it in Visual Studio 2003, just copy the fonts from your font directory once you install it and you can pretty much use them anywhere! I keep them on a handy USB thumb drive. :)
ElucidWeb-TheDarkside.vssettings.xml (39.04 KB) (Fixed problem with first upload)I went through every single setting tediously and made sure everything looked proper, if I missed something that looks a bit off shoot me a comment or email your settings file and I will try it out. Enjoy!! Eric
This has to be one of the coolest and most functional things I have seen in a long time! I use NUnit every single day at work, I have written tons of unit tests. Whats most painful for unit tests is the code duplication, you have to duplicate so much code you end up with this massive hunkin test fixture with hundreds of tests that do nearly the same thing but slightly different. Some of them expect exceptions and some of them dont, it just ends up being a mess. Welcome to MbUnit, very very cool, I will borrow a code snippet below from Scott Hansleman to show you why: 1 [RowTest]
2 [Row("James", "myemail@email.com")]
3 [Row("James", "", ExpectedException=typeof(InvalidUserException))]
4 [Row("", "myemail@emai.com", ExpectedException = typeof(InvalidUserException))]
5 [Row("James", "mybademail.com", ExpectedException = typeof(InvalidUserException))]
6 public void AddValidUser(string name, string email)
7 {
8 User u = new User();
9 u.Name = name;
10 u.Email = email;
11
12 u.Save();
13
14 User newUser = User.Retrieve(u.ID);
15 Assert.IsNotNull(newUser, "User not found");
16 Assert.IsTrue(newUser.Name == u.Name, "Name not saved correctly");
17 Assert.IsTrue(newUser.Email == newUser.Email, "Email not saved correctly");
18 }
So if you still dont get it take a look closer, they have written a rather generic unit test here, no big deal. Where the beauty comes in is that it takes parameters! You specify your test data in your attributes and you also specify the expected behavior of the test, this is absolutely brilliant!! So instead of four seperate NUnit tests its 4 unit tests condensed into one unit test block. As Scott would put it, "NUnit on Crack!!"
Very very cool stuff, and much much cleaner and functional than NUnit testing! Brilliant!
I have been running Vista build 5600 for about 2 1/2 weeks now and while the performance is relatively good the reliability is not all that great. While this is to be expected since most of the third party drivers are still in beta and the OS itself is a release candidate I wonder how Microsoft is going to pull off their release in about 2 months. So far my gaming experience has been great, was able to play Half Life 2 and Episode 1 without a single hitch, well an occasional blue screen but that was after about 4 hours of gameplay usually. In some instances my screen will get all corrupt and I will have to reboot but this is all really to be expected with all this new code they have written. After reading Scott Hanslemans blog about this issue I decided to post my own thoughts and my own reliability screenshot. Its interesting the downward trend that I have and scott has on his, quit interesting. The tool itself is so cool it almost makes up for the unreliability graph it shows! View Graph
Ok, I know its been quit a while since the last time I have posted a blog entry, but then again the only reason I keep this blog up is for informational purposes only. So on that note, I have started work again on my LucidTorrent project which is a BitTorrent client written using the .NET Framework using the C# language.
So a couple of things to note, I am not porting any existing BitTorrent application to this framework. It is being designed from the ground up using BitTorrent Protocol Specifications, lacking that they are I may resort to looking at the source code to the original BitTorrent client written by Bram Cohen which was written in Python. So I have been debating whether or not to post a blog on my progress or not, it's a very difficult project, not because of technical hurdles but because sheer lack of documentation on the protocol. There is documentation but it is very vague and the wording is not very intuitive, so most of the work I have done thus far is reverse engineering and LOTS of testing.
So far I have the Bencoding working, I also have the Metainfo being loaded into an object oriented class that maps to the attributes that .torrent file normally specifies. It works using Single File torrent data and Multi-file torrent data. The next step will be to get some connection code going so I can start exchanging data between clients. I will post the code as soon as I get a skeleton framework up with the connection code going so that anyone interested can take a look at it and built their own solution from it if they needed.
Windows PowerShell RC1 (Previously Monad) has been released! I must admit I sorta like PowerShell better than Monad. This however is more than a name update, this is RC1. Which is a step up from the previous version. Hopefully this fixed a bunch of the issues I was having with the previous version, I was trying to convert all of my scripts I use at work to CmdLets and I kept getting an error and the documentation provided to fix the error was incorrect. Ill check it out and see if its fixed, then I can get converting all my VBScripts to CmdLets - that's gonna be freaking awesome! Plus the geek factor will make me cry and curl up in a ball! :)
You can download it here!
I have finally reached a point with Xavier where its actually usable. Been working on it for about 1 1/2 weeks now and its pretty stable. This is an Alpha 1 release, especially since I have none of the TreeMap code in their so all you get is a simple File System view with file sizes right now. It is multithreaded, not sure how the speed compares to WinDirStat but I think its pretty good at the moment. I will start optimizing it once I get everything complete and working the way I want it to, but you can look at the source if you want by downloading the zip here.
I have also attached some screenshots in case your curious, and yes I borrowed the TreeListView control from Code Project, its got its problems but its much nicer than using just a flat ListView.
Screenshots: Select Path | Working | Results | Results Expanded
While writing a utility that I will soon release, in the near future I found that unusually .NET doesnt support a method to get the "Actual Size" of a file on the disk. To know what I am talking about, right click a file in Windows Explorer and look at its properites. You will notice there are two sizes listed, the file size and the actual file size. The difference being that based on your file system, a small file can be larger and a large file can be smaller which is all deteremined by cluster size differences. Normally this isnt a huge issue, but if you want to know how much space something is using up on your disk, you will want to know exactly how much space its using, otherwise you may get a distorted outlook on space usage.
With that said, I have written a method that can be used in .NET that will offer the information needed to write this functionality. To get the "Actual Size" you need to know the ClusterSize. Since I couldnt find anything from searching the net I thought I would offer this in case someone wanted to do the same thing, I wrote this so it will give you the same object oriented feel that .NET gives you so it shouldnt feel unusual to use.
[DllImport("kernel32.dll", CharSet = CharSet.Auto)] static extern bool GetDiskFreeSpace([MarshalAs(UnmanagedType.LPTStr)]string rootPathName, ref int sectorsPerCluster, ref int bytesPerSector, ref int numberOfFreeClusters, ref int totalNumbeOfClusters);
public static DiskInfo GetDiskDiskInfo(string rootPathName) { DiskInfo diskInfo = new DiskInfo(); int sectorsPerCluster = 0, bytesPerSector = 0, numberOfFreeClusters = 0, totalNumberOfClusters = 0; GetDiskFreeSpace(rootPathName, ref sectorsPerCluster, ref bytesPerSector, ref numberOfFreeClusters, ref totalNumberOfClusters);
diskInfo.RootPathName = rootPathName; diskInfo.SectorsPerCluster = sectorsPerCluster; diskInfo.BytesPerSector = bytesPerSector; diskInfo.NumberOfFreeClusters = numberOfFreeClusters; diskInfo.TotalNumberOfClusters = totalNumberOfClusters;
return diskInfo; }
public struct DiskInfo { public string RootPathName; public int SectorsPerCluster; public int BytesPerSector; public int NumberOfFreeClusters; public int TotalNumberOfClusters; }
//Forgot to add this on my initial post, and I just noticed. public static int GetActualFileSize(FileInfo file) { double clusterSize = 0; double numberofClusters = 0; int actualSize = 0; DiskInfo diskInfo = new DiskInfo(); diskInfo = GetDiskInfo(file.Directory.Root.FullName);
clusterSize = (diskInfo.BytesPerSector * diskInfo.SectorsPerCluster);
//Added this, seems if the file length and clustersize are exact it would over-report the size if ((file.Length % clusterSize) > 0) clusterSize += 1;
numberofClusters = Math.Round(file.Length / clusterSize);
actualSize = (int)(numberofClusters * clusterSize); return actualSize; }
So unless you have been living under a rock, you know Monad is the new console that Microsoft is going to release that greatly enhances automation in the Windows world! Well I started to play with it a bit after reading Scott Hanslemans blog and it is pretty deep stuff, it takes some getting used to since most consoles arent very "programmer" oriented. This on the other hand is VERY "programmer" oriented and it can do nearly anything. Its actually quite amazing what you can do with it.
Download Monad
Download Monad Documentation
Rockford Lhotka has released his second edition of Business Objects, this time for .NET 2.0 with his new CSL.NET 2.0 code. Its is a business framework designed to help programmers implement distributed applications using business objects. I read the first book and learned a ton from it so I highly recommend you pick the book up, its an intense and in depth read on architecture design and framework design! If you arent familiar with the conepts he thoroughly explains everything in the beginning and then starts to break the framework apart as you go along. Near the end of the book you setup test projects to see how it all comes together in a real world scenario!
Expert C# 2005 Business Objects, Second Edition
CSLA.NET 2.0
Have fun!
Its funny how many times a day I get asked this at work, what is the best way to protect myself against data theft, or how can I hide my data from other people, etc.
I always give them the same answer and its why my computer has 8 drives instead of 5, TrueCrypt! Its very very fast, you dont even notice your using a TrueCrypt volume its actually so fast!
Below is a list of features from the site, its free and its open source!! Cant get any better than this!!
Main Features:
- Creates a virtual encrypted disk within a file and mounts it as a real disk.
- Encrypts an entire hard disk partition or a device, such as USB flash drive.
- Encryption is automatic, real-time (on-the-fly) and transparent.
- Provides two levels of plausible deniability, in case an adversary forces you to reveal the password:
1) Hidden volume (steganography – more information may be found here). 2) No TrueCrypt volume can be identified (volumes cannot be distinguished from random data)
- Encryption algorithms: AES-256, Blowfish (448-bit key), CAST5, Serpent, Triple DES, and Twofish.
- Mode of operation: LRW (CBC supported as legacy).
- Based on Encryption for the Masses (E4M) 2.02a, conceived in 1997.
Yeah, I know I havent posted in a while so I am getting rid of a backlog of links I posted to Del.icio.us and never posted to my blog!
Interesting read about Generics in .NET 2.0
Snippet from the blog... ".NET 2.0's Best New Language Feature It didn't take long after the release of .NET 2.0 for me to start finding all kinds of uses for what I consider to be the best new framework / language feature - generics. As a long-time C++ developer who used templates and the STL at every opportunity, I didn't realize how much I missed parameterized types until they were put back in my toolbox. I'm going to focus here on a concrete application of .NET generics and, in the process, point out some of their features and syntactic elements. For an excellent overview of .NET generics with comparisons to their counterparts in Java and C++, see Bruce Eckel's Interview with Anders Hejlsberg."
Well they have finally released Visual Studio 2003 Service Pack 1 Beta for testing, wow thats a mouthfull. Remember this is a service pack for Visual Studio 2003, NOT the .NET Framework so this will not affect your project in any way, well unless it starts deleting lines of code randomly and then saves the project before you can click anything!! Im joking thats unlikely to happen, but might not want to use it on a production machines as nil as the chances are there may be something, some incompatability!
But anyways you can go here to apply for the testing. (Note: I couldnt directly link it since its some kind of control their using, but if you login using passport and navigate to that site you will see it on the bottom of the list of products you can test!)
Have fun!
So Microsoft has delayed vista again? That really does suck but if you read into the entire ordeal it really doesnt mean much to us the cosumers. Why? Because we probably wouldnt be able to get ahold of it anyways, it goes to OEM sales first right? After all they sale the most copies through OEM so us geeks wouldnt get to buy a standalone version of Vista Ultimate until sometime into 2007, probably say around February! We will see, I just cant wait to give it a try! Of course I am also one of the ones that said "Wait til they can put everything they want in Vista, dont cut ANYTHING out! I want WinFS, Monad, EFI Support, etc." which I wish they did!
I feel like I am getting a "Ghetto" version if Windows Vista now, but I am still happy since it looks like one nice ass piece of technological wonder that are creating, some people dont realize that it alot of the features may "look" like OS X (Apple) but thats where it stops, it only looks like OS X. What they are missing is that WinPF the new Graphics foundation layer is revolutionary, using Vector graphics so anything can scale to any size without ever pixelating or looking blurry! In fact the new Alt-Tab where the windows are cascaded so you can browse through them has been said to be a copy of OS X, well if you notice OS X uses static images to do it, while Vista does it with the "Real" window so the video is still playing as you do it!
But anyways off of my rant! Its a shame they are delaying! Darn! or SH#@!!!
Scott Hansleman is one of my favorite bloggers to read on a daily basis with great computer, technology, and programming info. He is supporting this cause and as an avid reader and having several family members lost to it I feel the need to support. You can read more about this at his blog here. I personally donated, donate now its worth the cause!
Link: http://www.hanselman.com/blog/teamhanselmananddiabeteswalk2006.aspx
|