27
FlexProgressBar Ported over to BitFlex 2.0
0 Comments | Posted by David Anderson in .NET Development
I originally was going to leave the FlexProgressBar control out of the new revision of BitFlex, however I bit the bullet and ported it over as ‘UIProgressBar’. The problem was the original was made up of several tightly-coupled classes:
* FlexControl
* FlexControlRenderer
* FlexBorderStyles
* FlexProgressBar
* FlexProgressBarRenderer
* FlexProgressBarStyles
* FlexProgressBarMarqueeStyles
So, there was a lot of work. In BitFlex 2.0 however, I went ahead and ported them all into a single object (excluding the required enumerations). So yes, BitFlex 2.0 will include the Progress Bar, and it will have more and improved features as well, such as custom image progress bars.
6
Cna yuo raed tihs? Olny 55 plepoe out of 100 can.
0 Comments | Posted by David Anderson in Personal
To my ’selected’ strange-minded friends:
If you can read the following paragraph, forward it on to your friends and the person that sent it to you with ‘yes’ in the subject line.
Only great minds can read this
This is weird, but interesting!
fi yuo cna raed tihs, yuo hvae a sgtrane mnid too
Cna yuo raed tihs? Olny 55 plepoe out of 100 can.
i cdnuolt blveiee taht I cluod aulaclty uesdnatnrd waht I was rdanieg. The phaonmneal pweor of the hmuan mnid, aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it dseno’t mtaetr in waht oerdr the ltteres in a wrod are, the olny iproamtnt tihng is taht the frsit and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it whotuit a pboerlm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. Azanmig huh? yaeh and I awlyas tghuhot slpeling was ipmorantt! if you can raed tihs forwrad it
FORWARD ONLY IF YOU CAN READ IT
It’s about 3:39 AM. I can’t sleep. Today at work I drank almost six energy drinks and a coffee, so I’m pretty wired. I’m thinking though about all the things in my life.. especially about that girl at work that I like. Sitting here thinking how because I did not behave myself, that God took everything away from me. My old job I loved, my old girlfriend who I had, at one point, thought I wanted to marry. He took everything away.
I fear God. I fear that if I ever fall he will crush me further. I put my life in his hands. My hope. Everything. I can’t really do anything on my own, and without him I would surely be laid to dust.
God, I fear you. I’m afraid to the very bone.
30
God is simply amazing.
0 Comments | Posted by David Anderson in Personal, Religion and Politics, Uncategorized

I can honestly say that God really is amazing. I have learned so much from him, and I continue to do so. I have been fleeing from my bad and horrible habits and ways slowly over time. It’s a lengthy journey and I have a long way to go. I have been behaving myself pretty well and not getting in trouble or anything, fleeing from sin. I have been praying about a couple of things, asking him questions and things. The other day at work he answered one of my prayers in front of my face! It was really cool. I had prayed for it the night before, and the next day, without anything of my own doing I was given what I had prayed for. Conversation, with a coworker. A girl who I kind of like, but haven’t really clicked with because she kind of locks herself away it seems like. She is really quiet, and kinda depressed/sad looking. Seeing her sad makes me sad, so lately I’ve really been enjoying talking to her when time allows, and making her smile. It’s pretty cool. I remember when I was depressed and sad all the time, and I still do get that way a lot, but on my own time.
I think it’s just out-right cool that God will answer his servant’s prayers like that. I will continue to pray and put my hope in the lord. I will also continue to flee from sin and my old ways!
18
Outrageous Current Events
0 Comments | Posted by David Anderson in Personal, Religion and Politics
The Fish
Can you actually believe that the federal government turned off the water supply to approximately 40% of California’s farmland to save a fish? There are hundreds and thousands of farmers who cannot farm now, who are out of work and starving because they have scarce food. What is sad is that we can do other things to save fish species.. fisheries or simply moving the fish are some that come to mind. But instead, the federal government, who works for the people, has decided to choose a small species of fish, over their fellow man. There are two parts to this story though. One, the water has been sold to another source, thus not belonging to the California farmer’s anymore. And two, saving a fish in a inappropriate manner. Outrageous.
The Health Care Plan
If you do not read the bills that the government puts forth, you better do so. Listen to the media, the talk, but also do your own research. If you actually read the health care bill, you will find a segment in there that states after a certain date, you will be forced to select a public option, because a private option will not be available. Barack and his other lackies will tell you “you can keep your current private health care providers”. Yes, CURRENT. That means, that YOUR children, YOUR grandchildren for generations to come will be forced into a public option, because after a certain date, the private options will no longer be available to new people. So yes, you can keep your current health care, if you already have it.
Socialism
Let’s face it. Barack Obama is a deceitful, sweet-talking, charming socialistic dictator. His speeches are filled with fluent and flattering words, and graceful and charismatic talk, but lie with empty lies and deceitful meaning behind them. “His plan”, “His goal”, “His ideas”, “His way”, “For the people”, Barack Obama and the federal government (among many others probably) want to control your lives. People need to wake up and realize, “Hey! If we don’t do something, they WILL control our lives!”. I can garuntee, at some point or another, there may be Civil War here in the United States.
I am a free man!
I, David Scott Anderson am a free man. The federal government is to stay not only out of my life, but away from me. I am willing to defend myself and others, uphold my freedom and the freedom of others. I am a free man, and will die a free man. If someone is to threaten me, my home and sanctuary, my life, I will defend myself.
This is serious business!
What the government is doing, what is going on in the world, how corporations and fellow people threat one another is serious business. We here in America should not take this lightly, for this is what we have stood and fought for our entire lives. Not only do we need to look out for one another, but we need to uphold and defend what we believe to be right. To quit giving in to what is wrong, and defending what is right.
Barack Obama, the Federal Government, and any alike:
STAY OUT OF OUR LIVES AND DO ONLY THE JOB THAT WAS GIVEN TO YOU, BY THE PEOPLE, FOR THE PEOPLE, NOT FOR YOURSELVES.
4
Test Driven Development (TDD) Benefits
0 Comments | Posted by David Anderson in General Development
I started doing test driven development, but not fully. I started out to get comfortable with, by writing my unit tests for some existing code. So far from the experience, I can say that testing objects, and making sure they do what you want is absolutely awesome. With unit tests, I do not have to write example programs to test me code, or full implementations. I can simply test individual methods and properties. It’s great!
Now I am going to venture into writing my tests before I write any code (objects). I will be posting some great feedback on this experience and the benefits after a while.
TDD, do it! It will help you tremendously!

…and ate it’s dinner! This picture is not only amazing, but scary and awesome at the same time.
Initialization files are pretty cool, but they’re really just around for compatibility now. I ventured into Xml and went crazy with it awhile back, but Xml is actually very hard to read when you start to dive into large and complex configuration files. If you’re like me, you often find yourself editing configuration files in notepad for either testing reasons, or other. I got tired of having flat configurations (INI) as well as reading through messes of brackets (Xml). So what does this entail? I created my own configuration format, and wrote an entire working-set of classes and objects to manipulate said format using the .NET Platform. So let’s take a look shall we!
The XDF is a fairly simple format, take the following snippet:
Configuration:Begin
IsXdfCool = True
EnableUpdates = False
UpdateSystem:Begin
Enabled = False
Host = www.dcomproductions.com
Port = 80
UpdateSystem:End
Configuration:End
So, as you can see just like Xml, XDF can have nested elements. The styling is that of VB similarity, so it is very readable, and even when you start to get into very large configuration files, XDF is still very readable and easy on the eyes. Wonderful! Moving forward, let’s take a look at some of the classes I have developed into BitFlex Framework.
DCOMProductions.BitFlex.IO.XdfBuilder
DCOMProductions.BitFlex.IO.XdfDocument
DCOMProductions.BitFlex.IO.XdfElement
DCOMProductions.BitFlex.IO.XdfElementTypes
DCOMProductions.BitFlex.IO.XdfException
DCOMProductions.BitFlex.IO.XdfFileAssociation
DCOMProductions.BitFlex.IO.XdfKey
DCOMProductions.BitFlex.IO.XdfKeyList
DCOMProductions.BitFlex.IO.XdfRegularExpressions
DCOMProductions.BitFlex.IO.XdfSection
DCOMProductions.BitFlex.IO.XdfSectionList
There are still a few other objects I have yet to create, but the core of XDF is done. How would you actually use XDF in say, C#? In Xml, you can use XElement objects from the System.Xml.Linq namespace. I have created my own version for XDF as closely as possible (without all the overhead of their insane details). We can simply declare our XDF like:
XdfElement xdfTree =
new XdfElement("Configuration",
new XdfElement("Common",
new XdfElement("KeyOne", true),
new XdfElement("KeyTwo", 1.25)
),
new XdfElement("Updates",
new XdfElement("KeyA", "DefaultValue"),
new XdfElement("KeyB", new Byte())
)
);
You will also notice that each key element can take a System.Object as a parameter to the XdfElement constructor. This makes storing values of .NET types very easy. Under the hood, System.Object.ToString() is called, so for some types you will have to do a little extra work to store your values correctly. This part of XDF is still under design too, because I only wrote basic functionality so I can test this and get an idea of how everything works. The full release implementation will be very flexible, and I hope I can mature XDF over time.
Now just like Xml, I have also created a XdfDocument class, where you can read and write directly to and from file on disk.
XdfDocument xdfdoc = new XdfDocument(@"D:\src\DCOM Productions\BitFlex\Documents", @"config.xdf");
xdfdoc.Load();
xdfdoc.SaveAs("C:\\test.xdf", true);
So you can very easily manipulate Xdf by doing something like this:
xdfdoc.Sections["Configuration"].Sections["Common"].Keys["KeyOne"].Value = false;
Now I hope that eventually I can actually get it to look something like this:
xdfdoc["Configuration"]["Common"]["KeyOne"] = false;
I think that would be just outrageously awesome and super cool in code. It would definitely make things a bit easier when typing. Right now, that’s about all I have to talk about in regards to XDF. Look forward to some more goodies soon!
A buddy of mine has been bugging me to write a Linq to Xml tutorial, so here we go. First off, I want to point out that using Linq to Xml you can rapidly generate Xml Documents without creating tons of objects. Take a look at the following code segment:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace LinqToSql {
class Program {
static void Main(string[] args) {
XElement users =
new XElement("Users",
new XElement("User", "David Anderson"),
new XElement("User", "Bob Marley"),
new XElement("User", "Elvis Presley")
);
Console.WriteLine(users);
Console.ReadKey(true);
}
}
}
The output of Console.WriteLine would actually print the fully qualified Xml tree, which you could simply write to file. Now don’t worry about references, while working in .NET 3.5 you already have a default reference to System.Xml and System.Xml.Linq, so all you have to do is import the using statement.
Moving on, how would we actually work with our tree now? Let’s say we wanted to query our users tree, and pull out the user “Bob Marley”. This is very simple, using lambda/linq expressions:
var user = users.Elements().Single(u => u.Value == "Bob Marley"); Console.WriteLine(user.Value);
The output of user.Value would be “Bob Marley”. So it’s very simple to navigate through a collection of XElements using the Linq model.
Now how would we actually work with a file doing this? XDocument. The XDocument object is similar to a XmlDocument, but yes, this works with Linq. I won’t really go into details here, because the rest is self-explanatory.
Oh, and for those of you who are lazy, you can actualy just call users.Save(“pathtofile”);

