PC-BSD 8 Released

PC-BSD 8 released. http://www.pcbsd.org/

Quote from site:

The PC-BSD Team is pleased to announce the availability of PC-BSD 8.0 (Hubble Edition), running FreeBSD 8.0-RELEASE-P2, and KDE 4.3.5


Using QlikView and DistroWatch to report on the most popular open source distributions (BSD, Linux, Unix)

Ok, so I am into FreeBSD and open source software, but I have recently had to do a QlikView implementation for my company LANDesk. QlikView has a feature where you can pull data from the web and report on it. So I needed to learn how to use the web-based reporting, so I decided to do a report from www.distrowatch.com.

Report Goals
There are few things that interests me from the data at DistroWatch:

  • Which base platforms are the most used?
  • Which platforms should software companies focus on supporting?
  • Where does BSD sit in the rankings.

How the report was made
So on the main DistroWatch page, there is a report that will give you the average hits per day (hpd) that a Distro’s web site gets. At the bottom there is a link to full popularity page of just these reports:
http://distrowatch.com/stats.php?section=popularity

So at first glance, you see Ubuntu is the best and Fedora is second and so on. I wanted to take the statistics a bit further. I wanted to know what main base distribution was the most used. What I mean by base distro is this: Ubuntu is #1. But Ubuntu is not a base distribution, instead it is based on Debian. Mint is #3 and is also based on Debian. Debian itself is #6 and it is a base distribution. Fedora is a base distribution.

QlikView can connect to this web page and consume this data. It was also able to loop through and click go to the link for each distribution where it was able to pull the “Based on” results. I did a few little tweaks to clean it up.

So I used QlikView to match each Distribution to its base distribution and built my report. I gathered the cumulative hits per day (hpd) of each base distro by summing the hpd from itself and its child distros. The results are staggering.

Result of the Report
I am going to show you a screen shot of the report, but I am only going to show the top 10 base distributions because otherwise it is to hard to view the report.

# 1 – Debian
Well, I have to say that I new that Debian (13818 hpd) was popular because of Ubuntu, but I didn’t know how far ahead it was compared to other base distributions. I expected Red Hat to be a lot closer but its just not. Lets look at the top ten Debian platforms by hits. In QlikView this is easy, I can simply click on the Debian pillar in the report.

So not only is Debian’s cumulative hits per day first, but it is first by a long ways. The cumulative hits per day of distros based on Debian is more than three times larger than any other base distribution’s cumulative hits. It is pulling away from the pack and nobody is going to catch up any time soon.

What I don’t know is are these new users or are other distributions losing members to Debian or Debian-based distros?

You might be grumbling to yourself and saying some incorrect statement like: Well, Ubuntu doesn’t have Enterprise support like Red Hat. But like I said, that is an incorrect statement. See their support page:
http://www.ubuntu.com/support

# 2 – Red Hat
Now, lets look at the top ten distros under Red Hat.

Ok, can I tell you that I was surprised at these results. I realize that Fedora was huge, I mean it is second on the distro list under Ubuntu, but I had missed the fact that CentOS was getting more than twice the hits Red Hat itself gets. The rest are hardly worth mentioning.

Historically mong Enterprise environments Red Hat is the most known distro, but when you look at these stats, you have to wonder if Ubuntu has taken over. The numbers for Fedora are fine, but for Red Hat they are not really that good. In fact, I keep hearing about companies using CentOS instead of Red Hat and as you can see, CentOS is getting a lot more exposure than Red Hat.

I will make this statement. Based on this data, if you are a software company considering whether to support Debian or Red Hat first, based on this data you have to choose Debian. If you were to make up some fuzzy logic for Red Hat (which due to its enterprise presence may or may not actually be valid) and weight the distributions based on other factors and somehow found a way to say Red Hat and its distro’s cumulative hits per day were worth three for every one, it would still be less than the cumulative hits per day Debian gets.

# 3 and #4 – Mandriva and Slackware
Ok, back to the report. Something that shocked me from the first chart and I had to analyze it further. Slackware? I had no idea that it was third. However, is it really third? It has a lot of very small distros based on it and Slackware itself gets 590 hpd and most the distros get less than 100 hpd. Mandriva is fourth but arguable could be third over Slackware. In fact, I have to call Mandriva third over Slackware. Sometimes you have to look at the data and make a judgment like this. Sorry Slackware, I am not trying to be biased (otherwise I would be talking up FreeBSD). I have no bias to any Linux distribution. I just say this based on the fact that Mandriva (1048 hpd) and the based-on-Mandriva version PCLinuxOS (773 hpd) both get more hits by a long way than Slackware’s top distros. The only reason Slackware got more hpd was because it has a lot of distros that were really small, while there were very few small distros based on Mandriva. The difference in the amount of small base distros is most likely due to the fact that Slackware is one of the oldest Linux distros, if not the oldest remaining distro, so naturally it has more distros based on it.

# 5 – Gentoo
Gentoo’s cumulative 1804 hpd was fourth. I have to apologize to Sabayon (760 hpd) as I had never heard of it until now. Gentoo itself only gets 428 hpd.

# 6 – BSD
What is next. Well, finally BSD shows up at number 6 with 1743 hpd. For those of you that are reading this and only know about Linux, BSD is NOT Linux. It does not run on the Linux kernel and is not likely to use many GNU tools. I hope I don’t drip with too much bias as FreeBSD is my favorite open source distribution.

Lets pull up the chart of BSD distros. There are 15 distributions listed under BSD, which is probably more than most people would believe since BSD often claims that it is not as broken up as Linux, but it has had its share of forks.

FreeBSD (553 hpd) is the main distribution. Of the Linux distributions, only Debian has more software packages available than FreeBSD.

PC-BSD (355 hpd) is to FreeBSD as Ubuntu is to Debian. For being such a new distribution PC-BSD is doing rather well. It is pretty comparable in ease of use to Ubuntu, Fedora, and OpenSUSE. Yes, PC-BSD is fully featured, running a nice windows environment with everything you could want, including a working Flash Player, the ability to configure your wireless card, and more. I recommend that if you are looking for a new desktop distribution, you at least install PC-BSD and give it a try. Ok, so my bias does show a little here.

# 7 – SUSE
So I was very surprised that SUSE wasn’t on this list until #7. Well, OpenSUSE is doing its part getting 1327 hpd. Remember, OpenSUSE is #4 if you just go by distro and not cumulative base distros. I think in time SUSE could be more popular. SUSE is newer than some of the other base distros and so it only has four distros listed. Novell’s SUSE Linux Enterprise (121 hpd) is the second most popular SUSE distro, however, it just not getting any were near the hits I expected it to be getting.

The others
And then there are the rest of the top ten: #8 Arch, #9 Puppy, and #10 Solaris (Or is that Oracle now?). Sorry if your distro was left out, this report is in the control of those who visit the distro’s web pages.

How accurate is this data?
On DistroWatch’s popularity page, it says:

The Page Hit Ranking statistics have attracted plenty of attention and feedback. Originally, each distribution-specific page was pure HTML with a third-party counter at the bottom to monitor interest of visitors. Later the pages were transformed into plain text files with PHP generating all the HTML code, but the original counter remained unchanged. In May 2004 the site switched from publicly viewable third-party counters to internal counters. This was prompted by a continuous abuse of the counters by a handful of undisciplined individuals who had confused DistroWatch with a voting station. The counters are no longer displayed on the individual distributions pages, but all visits (on the main site, as well as on mirrors) are logged. Only one hit per IP address per day is counted.

There are other factors to consider, such as the fact that some of the distributions are Live CD distros and not really platforms meant to be installed. It would be interesting to exclude them and only include installable distros but for lack of time, I didn’t.

I did nothing to verify the accuracy of the data at DistroWatch and any errors you see are not likely mine, as all the data was pulled from DistroWatch, please report any error to them and once they fix these errors, the QlikView report’s data can be reloaded.

Also, this data includes all hits from all areas: Consumer, Enterprise, Education, etc. Unfortunately there is no way I know of to tell where the hits came from. If there is a distribution that is 100% education hits, there would be no way to know that. Obviously if your target is Enterprise, you are left wondering which open source distros are really the most used in Enterprise environments. Unfortunately this report doesn’t answer that question. This is not a report of installed platforms, it is a report of cumulative hits per day. It is what it is.


Copyright ® Rhyous.com – Linking to this article is allowed without permission and as many as ten lines of this article can be used along with this link. Any other use of this article is allowed only by permission of Rhyous.com.


How to process command line parameters or arguments in a WPF application?

UPDATE 10/25/2010:
Avoid using Environment.CommandLine. It appears much easier, but isn’t as robust. I learned a while ago that the command line arguments can be accessed using Environment.CommandLine. This is only different than the process below in that it is way easier and the first argument is the full path of the executable. So all this work is not exactly necessary, right? Wrong! I tried Environment.CommandLine for a while and it didn’t last. There are times when this executable is launched by another executable and the Environment.CommandLine is not set even though the other executable launched this executable with parameters. So I had to return to using the steps below anyway.


Ok, so I wanted to handle command line parameters, which is easy in every other language, however, the need for easy was overlooked in WPF. It is not obvious and you are not going to figure it out without being told how to do it.

Microsoft provides a sample here, you can look at.
http://msdn.microsoft.com/en-us/library/aa972153.aspx

I am going to walk you through creating a new WPF Project in Visual Studio 2008. Then I will walk you through handling command line parameters (arguments).

  1. Open Visual Studio 2008.
  2. Go to File | New | Project.
  3. Under Visual C#, choose WPF Application and give the project a name and then hit OK.
  4. Go to Project | ProjectName Properties (where ProjectName is the name of your project).
  5. In the Properties of you project, click on Debug.
  6. Enter three parameters intothe Command line arguments text field: Param1 Param2 Param3
  7. Close the properties window.
  8. Double-click on App.xaml to open it. It looks like this:
    <Application x:Class="ParametersForWPF.App"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        StartupUri="Window1.xaml">
        <Application.Resources>
    
        </Application.Resources>
    </Application>
    
  9. Add a carriage return after StartupUri=”Window1.xaml” and start type inside the bracket the word Startup=. As soon as you see an equals sign you will get a pop up with the words . Double-click on that. The name Application_Startup will automatically be added.
    <Application x:Class="ParametersForWPF.App"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        StartupUri="Window1.xaml"
        Startup="Application_Startup">
        <Application.Resources>
    
        </Application.Resources>
    </Application>
    

    Note: This will also automatcially update the App.xaml.cs file which originally looks as follows:

    using System.Windows;
    
    namespace ParametersForWPF
    {
        /// <summary>
        /// Interaction logic for App.xaml
        /// </summary>
        public partial class App : Application
        {
        }
    }
    

    But after adding the Startup=”Application_Startup” line, a function called Application_Startup is automatically added.

    using System;
    using System.Collections.Generic;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Windows;
    
    namespace ParametersForWPF
    {
        /// <summary>
        /// Interaction logic for App.xaml
        /// </summary>
        public partial class App : Application
        {
    
            private void Application_Startup(object sender, StartupEventArgs e)
            {
    
            }
        }
    }
    
  10. Now we only want to work with arguments if there are some, so lets add an if statement inside the Application_Startup function as shown:
            private void Application_Startup(object sender, StartupEventArgs e)
            {
                if (e.Args.Length > 0)
                {
    
                }
            }
    
  11. Ok, so the next step is to create a public static string[] member variable to hold the arguments and assign the arguments array to it. I called my member variable mArgs. I use prefix it with m so I know it is a member variable.
    using System;
    using System.Collections.Generic;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Windows;
    
    namespace ParametersForWPF
    {
        /// <summary>
        /// Interaction logic for App.xaml
        /// </summary>
        public partial class App : Application
        {
            public static String[] mArgs;
    
            private void Application_Startup(object sender, StartupEventArgs e)
            {
    
                if (e.Args.Length > 0)
                {
                    mArgs= e.Args;
                }
            }
        }
    }
    
  12. Now, in order to access the data in Windows1.xaml.cs, just call the App.mArgs array in the constructor as shown.
            public Window1()
            {
                InitializeComponent();
                String[] args = App.mArgs;
    
            }
    
  13. Put a break point on the line and start with debugging and sure enough you will see your arguments properly assigned to the String[] args variable. So you now have your parameters accessible in your WPF application.Hope this helps you.

    Copyright ® Rhyous.com – Linking to this article is allowed without permission and as many as ten lines of this article can be used along with this link. Any other use of this article is allowed only by permission of Rhyous.com.


When hiring a technical candidate for a software company, how can you find an Intelligence Asset?

Ok, so we all want the intelligent employee who picks up on things quickly, has a high IQ, and becomes an expert at his job sooner than anyone else who has ever had the position. This type of employee becomes an Intelligence Asset. They can answer any question, solve any problem and help brain storm through any problem.

Imagine you are hiring someone for a Level III technical support position or a as a Technical Sales Engineer or as a Developer for you software or for a your systems administrator or help desk team. You probably don’t just want an employee, you want an Intelligence Asset, someone who can be an expert, solve any problem, be a resource for others and help in ways that cannot even be imagined.

What steps do you take to find the “intelligent employee who picks up on things quickly, has a high IQ, and becomes an expert at his job sooner than anyone else who has ever had the position”. How do you find someone like that.

Well, while it is nice to have someone with experience, experience doesn’t make someone like that. It is also nice to have someone with great social skills, but social skills doesn’t make some one like that either. It is nice to get someone with a degree, but a degree doesn’t necessarily make someone like that either. Maybe they even have a degree in some other field, I do.

However, there are some traits that are common to people who have the ability to become an Intelligence Asset. In over a decade of working in the Networking, Technical Support, Systems Administration, Development, and IT field, I have met a number of Intelligence Assets and I will try to describe the traits that are common among these people.

  1. They enjoy learning, especially learning technology.
  2. They enjoy sharing what they learn.
  3. They can read a lot.
  4. They can read fast.
  5. They retain what they read.
  6. They only have to be shown how to do something once.
  7. They have analytical minds, and analyze everything.
  8. They solve problems faster and more efficiently than others.
  9. They are interested in the field in which they are working.
  10. They are hard workers and have strong work ethics.
  11. They always have to be right and hate being wrong.
  12. They assume other people care about the knowledge they have.
  13. They are not gamers.

So instead of spending time trying to make sure an candidate is going to already know your product or has experience with your product or whether they can be the perfect social talker, instead make sure they can be an Intelligence Asset.

Make sure they have the qualities above and you don’t have to worry about them. So what questions can they ask? Well, lets target some questions at each of the above subjects.

They enjoy learning.
If a candidate enjoys learning, then they are going to spend time learning outside of work. The following questions will show that a candidate enjoys learning.

  • What technology topics are you learning at home on your own?
  • How much time do you spend learning technology away from work?
  • Are you a member of a technical community where you donate your time?

They enjoy sharing what they learn.
These people often participate in online forums/communities where they help others and answer questions, often for free. They may have blogs where they contribute their ideas. Knowledge Retention is an important factor for any company. Knowledge lost can cost a company thousands or more.

  • You just stumbled on the best new software application. Who do you share it with? How do you share it?
  • You had a tough issue with a piece of software, and it took you days. At the end you realize there was really only a dozen simple steps, but there was not documentation so you had to realize it the hard way. Now that you have the solution, what would you do with it?
  • Are you a member of an online forum in your field of work?

Reading
Intelligence Assets consume knowledge by reading. They are reading everywhere. The internet, manuals, white papers, or pretty much anywhere they can get their hands on knowledge. There are simple questions that can let you know how much people read. Reading is part of every job whether you think it is or not.

  1. They can read a lot.
    What types of reading do you do?
    What reading do you do to keep up on your skills?
    What websites do you frequent?

  2. They can read fast.
    This is simple. There are websites you can send them to an check this. Do a simple google search for this term: determine reading speed
    I bet you found dozens of sites that will evaluate a candidates reading speed. One thing to note is that faster readers also usually have greater retention, which is the opposite of what some believe.

  3. They retain what they read.
    Hey, this one is hard to evaluate. During an interview nerves can get in the way of really evaluating this, so I would recommend not trying. If you have determined that they read a lot and that they read fast, retention often comes along for the ride.

They only have to be shown how to do something once.
Have a simple demonstration test prepared. Show the user how to do something either on a computer or even with a gadget or a mind game. Then have them try to repeat it. Make sure it is complex enough that almost no one can repeat it and you can be wowed when someone does.

They have analytical minds, and analyze everything.
How do you find that employee that can look at something and analyze it and understand, and do it quickly. Well, people who are analytical have to think about things. However, be careful, if you throw out a question, just because someone responds with a quick answer doesn’t mean they won’t take time to analyze. Some will give an initial response and then continue to think about it, so speed of response is not a true indicator. Give them something they can analyze and have them describe how it works. Again, it can be a computer program, a mind game and see what things they can analyze about it in a few minutes. If your focus is software, you can give someone an application and thirty minutes to discuss everything they can about this application. For a mechanical engineer, provide a piece of hardware or some schematics and ask the candidate to analyze it.

They solve problems faster and more efficiently than others.
So there are lot of problem solving tests that are common.

“I am thinking of an object in this room, you can ask any question except for, “What is it?”

“You have a a bag of grain, a chicken, and a fox and you need to take them all across a river in a boat. However, there is only a room in the boat for you and one other. You can’t leave the fox and the chicken together and you can’t leave the chicken and the grain together. How do you get them across?”

There are many more problem solving questions and you can find them online or maybe even make some up if you can.

They are interested in the field in which they are working.
Many of the other questions above should be giving you a feel for this by now. However, if you are looking for someone to be an Intelligence Asset for a software company, you should understand that there are often multiple hierarchies in a software company. A technical hierarchy and a management hierarchy are the obvious ones you see. For example, in tech support there is often Level 1, Level II, Level III, or technical leads and then there are managers and directors who may or may not be technical. But most companies have sales teams and other departments as well, so there can be quite a few different hierarchies in a software company.

Don’t be afraid to ask the candidate direct questions. However, “Where do you see yourself in five years” is really not focused enough. Show them your different hierarchies in your company and ask the candidate if they were to be promoted every two years, where would they be. If they are a technical asset they are not likely to choose a route outside their field into management or sales. However, if you don’t pay well, you may be skewing these results because money is a strong motivator and if you are unwilling to pay a technical asset what they are worth and it is obvious, they may choose a route that pays well.

Also remember, an Intelligence Asset enjoys learning. Ask them what they are learning about today that will further their career. If you are an electrical engineer and they say 3D animation, that is a key indicator that they are not committed to the field. It is hard for a candidate to be amazing in a field they are not interested in.

They are hard workers and have strong work ethics.
One of the best workers at my company, and one of our greatest intelligence assets is someone you would consider a farm boy. You might find him herding cows on the weekend. He probably works more hours in a day than he should. His work ethic is obvious. I can’t promise that any hard working farm boy is going to end up being an Intelligence Asset for you. However, you can probably generalize that a farm boy at least fills in the hard worker check box (yes despite what the silly political correct ideals would have you believe, you can and you must both generalize and stereotype during the interview process because you only get a few meetings with a candidate).

How many hours do you work at your current job?

What break room distractions did they have at your previous job? Did they have games and if so what was your choice of distraction?

When you had absolutely nothing to do at your previous job, what did you do? For example, you are completely caught up and you don’t have to do anything task or projects and won’t for the last three hours of the day, what do you do?

They always have to be right and hate being wrong.
I’ll be straight up and honest. Not every trait that indicates an Intelligence Asset is a good one. You need to accept the fact that Intelligence Assets may tell you when you are wrong and they may not know to do it in private. And their is a good change that you are wrong because there is a good change they actually do know better than you.

Also, Intelligence Assets are usually likely to argue when they 100% sure they are correct. There are some that don’t but most do. They argue when they know they are right. Yes, I consider myself an Intelligence Asset and once I was talking to another Intelligence Asset and we both had conflicting answers about a DNS feature and yet we were both correct. He was providing the Microsoft Windows answer and I was providing a FreeBSD/Linux answer and yes, their feature sets are different, so we were both right. Ok, I was unaware that Microsoft lacked the feature I was talking about and he was unaware that BSD/Linux had the feature. Anyway, neither of us would give. We were both right and new it for a fact because we learn and test and know.

Assume they argue when you ask the candidate a question. Every candidate is likely to say no if you ask if they argue. Instead ask: “You are in an argument with someone about something and you know 100% that you are right. How do you convince the other person?” If they take time to say something like, “First, I never argue” then maybe they don’t have this trait. And that is not necessarily bad.

By the way, once you hire them, please coach them to not argue. Remember they are very intelligent and they can learn to not argue, though it may take years.

Another approach is to ask them this: “You have given information to someone and you just found out that for whatever reason your are completely wrong. The person calls you on it, what do you do?” If they spend the whole answer saying how they would apologize and try to regain trust with the person, then they really don’t care about their knowledge. If they focus on how they would go research the issue and make sure that they learned the right answer so they wouldn’t be wrong again, then this is an Intelligence Asset. They probably won’t care much about what the other person thinks so much as they care about the fact they had wrong information.

They are not gamers.
Can I just say that as I analyzed the Intelligence Assets I know, none of them that I know are really gamers. Remember they are computer geeks, so yes they have gamed. But gamers are people who play computer games regularly, if not daily. I play games every Thanksgiving and Christmas holidays but rarely any other time. World of Warcraft, or WOW for short, is one of the more popular games these days. However, not a single one of the Intelligence Assets I know are daily gamers. They usually have something else that fills their time so they cannot really find time to be gamers. Often they spend time that gamers spend doing something like learning, reading, working, programming on the side, etc…

Maybe you find out if they are gamers by mentioning that your company only allows LAN parties and gaming after 7pm. See how they respond.


Why are key executables missing from Windows 7 and previous and where to download such tools free: telnet, ssh, md5, sha1, sha256, and more

Ok, so is anyone else frustrated that Microsoft fails to include certain executable tools that are standard on BSD and Linux? On my FreeBSD system, I don’t have to install anything special to telnet, or ssh, or check any type of hash (md5, sha1, sha256, etc…) and ump-teen other simple free features.

Especially the ability to check a hash, which is a key step to verify that a file was downloaded securely, and was not tampered with. In fact, it is a security risk that Microsoft doesn’t have these tools. We pay a lot of money for a Microsoft operating system and yet they fail to provide me with the tools I need to maintain security, tools that are ubiquitous and free. Also you wrote a tool for this already, were you just too thoughtless to include it in Windows 7? See http://support.microsoft.com/kb/841290.

So here is what you have to do to get these tools added to your windows platform.

Telnet See this post or google for a 3rd party telnet tool. Where is telnet in Windows 7? Or Windows 7 is missing telnet.exe
ssh Download PuTTY from here: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html. I like to rename it to ssh.exe and put it in the system32 directory.

A quick search in Google led me to this download which will provide you with most the tools you need for comparing hashes or check sums.
http://www.nfllab.com/sums/sums611.zip

However, here is what I had before:

md5 I use md5sums which you can get here: http://www.pc-tools.net/win32/md5sums/
sha1 You can use this one: ftp://ftp.gnupg.org/gcrypt/binary/sha1sum.exe
sha256 This will work for you: http://www.labtestproject.com/files/win/sha256sum/sha256sum.exe

And if you want more tools that are ubiquitous to open source platforms but somehow Microsoft has excluded from their operating systems, check these out:

Other GNU Utilities Download them from here: http://gnuwin32.sourceforge.net/packages.html

I hope this page helps you. I mostly wrote it for myself, so I could remember where I find this stuff again.


How read use an ADO.NET DataSet to read XML files designed with nested attributes?

I am working on a project that is XML driven and I am using ADO.NET DataSet functionality to make reading the XML easier. However, I ran into a problem that really just a lack of knowledge on my part.

Problem
So I have DataSet created using an XML. The XML is using Nested attributes. And I just need to know how to loop properly through the DataSet Tables and their columns.

I have the following XML.

<?xml version="1.0" encoding="utf-8" ?>
<Plugin PluginName="TestName" GroupName="Operating System Settings" Type="Single">
  <Title>Plugin 1</Title>
  <StartTime>1:57:47 PM 2/16/2010</StartTime>
  <EndTime>1:58:03 PM 2/16/2010</EndTime>
  <Description>Runs the TestName process to determine something.</Description>
  <Section SectionName="Section1">
    <Field FieldName="Field Name">
      <Value Operand="EQ">Some Correct Setting1</Value>
      <ActionPlugin Name="" Type="Link" URL="">
        <Executable>SomeAction1.exe</Executable>
        <Parameters>Param1 Param2</Parameters>
      </ActionPlugin>
    </Field>
    <Field FieldName="Field2">
      <Value Operand="RG">900</Value>
      <WarningLevel>10%</WarningLevel>
      <ErrorLevel>20%</ErrorLevel>
      <ActionPlugin Name="ActionPlugin1" Type="Link" URL="http://www.somesite.tld/some/path/file.htm" />
    </Field>
  </Section>
  <Section SectionName="Section2">
    <Field FieldName="Field1">
      <Value Operand="EQ">Some Correct Setting2</Value>
      <ActionPlugin Name="" Type="Link" URL="">
        <Executable>SomeAction2.exe</Executable>
        <Parameters>Param1 Param2</Parameters>
      </ActionPlugin>
    </Field>
    <Field FieldName="Field2">
      <Value Operand="RG">900</Value>
      <WarningLevel>10%</WarningLevel>
      <ErrorLevel>20%</ErrorLevel>
      <ActionPlugin Name="ActionPlugin1" Type="Link" URL="http://www.somesite.tld/some/path/file.htm" />
    </Field>
  </Section>
  <Section SectionName="Section3">
    <Field FieldName="Field1">
      <Value Operand="EQ">Some Correct Setting3</Value>
      <ActionPlugin Name="" Type="Link" URL="">
        <Executable>SomeAction3ds.exe</Executable>
        <Parameters>Param1 Param2</Parameters>
      </ActionPlugin>
    </Field>
    <Field FieldName="Field2">
      <Value Operand="RG">900</Value>
      <WarningLevel>10%</WarningLevel>
      <ErrorLevel>20%</ErrorLevel>
      <ActionPlugin Name="ActionPlugin1" Type="Link" URL="http://www.somesite.tld/some/path/file.htm" />
    </Field>
  </Section>
</Plugin>

So the DataSet is created with these tables (this is copied from the debugger):

– List Count = 5 System.Collections.ArrayList
+ [0] {Plugin} object {System.Data.DataTable}
+ [1] {Section} object {System.Data.DataTable}
+ [2] {Field} object {System.Data.DataTable}
+ [3] {Value} object {System.Data.DataTable}
+ [4] {ActionPlugin} object {System.Data.DataTable}

Table [1] {Section} has 3 rows.
Table [2] {Field} has 6 rows.

So the data looks like this:

Sections Table
Row 1
Row 2
Row 3

Fields Table
Row 1
Row 2
Row 3
Row 4
Row 5
Row 6

But I need to read it as follows:

Sections Table
Row 1  
Fields Table
Row 1
Row 2
Row 2  
Fields Table
Row 3
Row 4
Row 3  
Fields Table
Row 5
Row 6

So I had the code below, but for each Section Row it would loop through all six field rows, which is not what I intend.

string mFullPathToXML = "C:\My.xml";
DataSet ds;
ds.ReadXml(mFullPathToXML);

foreach (DataRow SectionRow in ds.Tables["Section"].Rows)
{
    foreach(DataRow FieldRow in ds.Tables["Field"].Rows)
    {
        // Looping through all rows, not just those that pertain to the section.
        // How to get only the two rows that belong to each Section row here?
    }
}

Solution
Well, I set out on a journey to figure this out. In a few search engines I use search phrases like:
DataSet XML Nested
DataSet XML Nested Relation
DataSet DataTable XML Nested Row
DataSet DataTable XML Nested Row

A lot of documentation on Microsoft’s site to XMLs and DataSets showed up, but nothing describing this problem/solution.

I am happy to say that with help from the MSDN Forums, the solution was found. Please read my post here:
http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataset/thread/2d115ba6-49be-4a5c-bf92-054626109f50

So the solutions is to use the Section_Id assigned to each row in the Sections table inside the Field table’s Select() function as shown:

foreach (DataRow sectionRow in ds.Tables["Section"].Rows)
{
	string sectionId = sectionRow["Section_Id"].ToString();
	Console.WriteLine("Section: {0}", sectionRow["SectionName"]);
	foreach (DataRow fieldRow in ds.Tables["Field"].Select("Section_Id = " + sectionId))
	{
		foreach (object item in fieldRow.ItemArray)
		{
			// Do something here
		}
	}
}

This solution works for me.


How to modify the default new class template for C# in Visual Studio 2008 or 2010?

Updated: 5/17/2010 using information aquired from here: How To: Edit Visual Studio Templates

Ok, so I don’t like the way that the default new class template in Visual Studio 2008/2010 looks. I end up typing a lot of things over and over again.

Here is what it a new class looks like:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyNameSpace
{
	class MyClass
	{
	}
}

Here is what I want it to look like:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyNameSpace
{
	public class MyClass
	{
		#region Member Variables
		#endregion

		#region Constructors

		/// <summary>
		/// The default Constructor.
		/// </summary>
		public MyClass()
      		{
		}

		#endregion

		#region Properties
		#endregion

		#region Functions
		#endregion

		#region Enums
		#endregion
	}
}

So making this change is easy to do. All you have to do is edit a text file that is compressed.

Copy the zip file file located here to the desktop:
Visual Studio 2008

  • For 64 bit: C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class.zip
  • For 32 bit: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class.zip

Visual Studio 2010

  • For 64 bit: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class.zip
  • For 32 bit: C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class.zip

Extract the zip file.

Using a text editor, open the Class.cs file.

The file will have the following text:

using System;
using System.Collections.Generic;
$if$ ($targetframeworkversion$ >= 3.5)using System.Linq;
$endif$using System.Text;

namespace $rootnamespace$
{
	class $safeitemrootname$
	{
	}
}

Change it to have this text:

using System;
using System.Collections.Generic;
$if$ ($targetframeworkversion$ >= 3.5)using System.Linq;
$endif$using System.Text;

namespace $rootnamespace$
{
	public class $safeitemrootname$
	{
		#region Member Variables
		#endregion

		#region Constructors

		/// <summary>
		/// The default Constructor.
		/// </summary>
		public $safeitemrootname$()
		{
		}

		#endregion

		#region Properties
		#endregion

		#region Functions
		#endregion

		#region Enums
		#endregion
	}
}

Save the file.

Rebuild the zip file with the new Class.cs.  Be careful to build the zip file correctly.

Copy the new zip file back here and overwrite the existing one:
Visual Studio 2008

  • For 64 bit: C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class.zip
  • For 32 bit: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class.zip

Visual Studio 2010

  • For 64 bit: C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class.zip
  • For 32 bit: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Code\1033\Class.zip

Now, you have to rebuild the template classes.  To do this:

  1. Open a command prompt as Administrator.
  2. Change to the appropriate directory:
    Visual Studio 2008
    64-bit

    cd C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\

    32-bit

    cd C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\

    Visual Studio 2010
    64-bit

    cd C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\

    32-bit

    cd C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\
  3. Run this command:
    devenv.exe /installvstemplates

Now any new class you create will have your new format.


Copyright ® Rhyous.com – Linking to this article is allowed without permission and as many as ten lines of this article can be used along with this link. Any other use of this article is allowed only by permission of Rhyous.com.


My experience installing FreeBSD 8 using the PC-BSD 8 RC2 installer

Ok, so I was interested in the fact that FreeBSD 8 could now be installed using the PC-BSD 8 installer.

So lets see how easy it is. Remember, this a review of installing FreeBSD 8 with the PC-BSD 8 installer. It is not a review of installing PC-BSD 8.

  1. I downloaded the DVD ISO (and since I am using VMWare I didn’t even have to burn it, I just created a new virtual machine and pointed at the ISO).
  2. I started the install at 3:06 PM.
  3. I found everything simple and easy, it was a click next wizard. I only made changes in selecting my keyboard, changing from installing PC-BSD to install FreeBSD, and configuration the user information.
  4. I did not install any optional components.
  5. I finished installing and booted to FreeBSD 8 by 3:12 PM.

Total time: 6 minutes plus some seconds (I didn’t look at the exact second things started.)

I went through the install quite a few times less than an hour, just testing different settings.

What was great

  • Ok, It was easy. Way easier than Sysinstall.
  • It auto-partitioned for me.
  • It had my keyboard available.
  • Custom partitioning was easy. There is an edit option if you make one with the wrong settings or if you just want to change the defaults slightly.
  • I was able to select zfs partitions. Sysinstall can’t do this yet (well at least not with release yet, maybe stable or current can).
  • It wiped previous disk partitions for me when I reinstalled over the top and chose Fresh Install.

What was questionable

  • Do we really want to have 10 seconds at the text-based PC-BSD splash screen for an install disk?
  • I had a hard time finding Mount Time in the Timezone Settings. It was America/Denver:Mountain Time and I was looking for America/Mountain Time. Probably my fault. But I prefer the world map image that allows you to click where you are above the list, which to me is much better than only the long list.
  • I must have missed the opportunity to name my system. I went through the install twice and couldn’t find a place, not even an advanced section. So it appears you will have to rename the system post install. To rename it afterwards you have to edit the /etc/rc.conf and /etc/hosts and then use the hostname command (or reboot).
  • I am left wondering what distributions installed? Obviously these required distributions are installed:
    • base
    • kernel | Generic

    I am pretty sure these two additional distributions are included as well: (which is nice because I recommend these two distributions).

    • games – This is what gives you those awesome tips every time you log in.
    • man – This is the man (manual) pages for all the
    • However, I don’t know if another distribution was selected.

  • I didn’t see anywhere to configure my IP Address information if I planned to have a static IP, not even an advanced section. Well, I actually found that if I choose to install from the network, I could setup my IP Address, but it when I did this, it didn’t work at all. It failed to give me an IP Address and yes I entered the correct information. I am a expert at IP and Networking and I did it multiple times and rebooted and tried through multiple installs. And I still couldn’t name my system.
  • Not because it didn’t work, I also didn’t like the IP Address configuration fields. The width was weird. I get annoyed when I am forced to type 255.255.255.0 when /24 would work. Both methods should be allowed.
  • There are tabs on the left but I couldn’t click on them. That would have been nice. To do a minimal install of FreeBSD, I only need to make a change on Keyboard and Users so this could have even been faster if I could have clicked just straight to those (which I wouldn’t do the first time, but after doing this a lot, an expert would want to skip).
  • When customizing the partitions, I would have liked to have the ability to move partitions up and down if I ordered them incorrectly.
  • When I installed making everything ZFS partitions (except swap), the install failed. Maybe I forgot something important, or it is not yet fully supported to use ZFS on all partitions. Either way, if it doesn’t work, it would be nice to be informed before hand.
  • I was left wondering, if I choose FreeBSD, and add components such as Firefox, am I getting FreeBSD packages or PBIs or nothing? Well, I tried it and sure enough, it appears to have installed the PBIs, but since Xorg wasn’t there, nothing really worked. So when installing FreeBSD instead of PC-BSD, don’t expect any of the options to work.

Were there enterprise features?
Well, when it comes to installing, the enterprise features are the ability to script the install and provide a distinct computer name and other distinct settings when doing so.

The one place where open source and FreeBSD in particular fails to come anywhere close to competing is in the enterprise features surrounding the operating system. Yes FreeBSD is enterprise ready, but it’s installer is not even close. It doesn’t matter if your OS is enterprise ready or not if all the features around the OS are not enterprise ready, such as the installer and its ability to be scripted and reused easily. Even when using an image, Microsoft has Sysprep. Yes, you can script something with *nix, but a scripting developer should not be needed for OS Deployment. No platform is easier to deploy scripted than Microsoft’s operating systems and open source platforms should take a look at what they are doing and find a better and easier way to do it. I have performed scripted installations of FreeBSD on numerous occasions and I am always frustrated with its poor feature set.

Updated: Feb 23, 2010: Please read the comment by Kris Moore. Can I tell you I like it even more after this post.

I never saw anywhere to create or use an installation script. This is a key feature for enterprise customers. If you cannot do a scripted install, you are not an enterprise solution. Maybe there is a different way to do scripted installs of FreeBSD using the PC-BSD installer that is documented somewhere else. I keep waiting for some distro’s installer to get smart and ask at the end of an regular install if the install settings should be saved as a script.

There are many types of focuses for a desktop: email and docs, graphics or CAD, home user, media center, developer, etc… I have yet to find a distro that gives me the option to install differently for different focuses that is not Microsoft and does not cost money. Microsoft doesn’t do a good job, having Home, Professional, Enterprise, Ultimate, Media Center, they are closer, but missed the boat too. I want a list of scripts. Script A will install everything a developer needs. Script B will install everything a Graphic Artist needs. Script C will install everything a technical writer needs…etc.

Conclusion
This is an awesome job by the PC-BSD team. You may look at my notes above and think that there was more negative than positive and be surprised by this assessment.

I can quickly get a FreeBSD system up and running as I like without using the annoying Sysinstall tool which asks me dozens of things I don’t want. Just look at my post for installing FreeBSD (How do I install FreeBSD?) where I list 41 steps (and some of those have sub-steps) just to get a minimal install. PC-BSD has taken the Ubuntu approach where the install is simple and customizations that experts need can be accomplished post installation. I may in the near future be changing my How do I install FreeBSD? post to use the PC-BSD installer.

This is a big deal for FreeBSD, in my opinion. I am not saying there isn’t a long road ahead. But lets face it, FreeBSD has refused to update the install in far too long and NO!, Sysinstall is not good enough and hasn’t been good enough and will continue to fall short in the future. So yes there is a long road ahead, but while FreeBSD has been avoiding that road, PC-BSD is now at least driving down it.


iXsystems announces PC-BSD 8.0-RC2

Hey all,

iXsystems has released PC-BSD 8.0-RC2. This looks to be

On the home page, it says: “The PC-BSD Team is pleased to announce the availability of PC-BSD 8.0-RC2 (Hubble Edition), running FreeBSD 8.0-RELEASE-P2, and KDE 4.3.5.”

If you want to see an overview of the changes they have made, you can view them:
http://www.pcbsd.org/content/view/147/11/

They boast an interesting feature which I will probably have to review sometime soon:

  • Brand new System Installer, allows the install of PC-BSD or FreeBSD

How to restart FreeBSD?

FreeBSD can be restarted in a few ways:

As root run the following:

# reboot

You can also run this command.

# init 6

If you are not logged in as root but you have access to the console, you can initiate a reboot by pressing the common Ctrl + Alt + Delete key sequence.


How to remove a single quote from a string in QlikView?

Ok, so I had a problem today that I couldn’t find any documentation on. I needed to remove a single quote from a variable in a string during a load script but it took some time.

I tried this but it didn’t work:

purgechar(‘It’s got a quote’, ‘\”)

It turns out that QlikView doesn’t seem to have an escape character, so I had to figure out another method. Google searching for this string didn’t help: single quote Qlikview escape character

So I figured it out. You have to use the chr() function.

purgechar(‘It’s got a quote’, char(39))

You can get the correct ascii number to pass to the char() function from here:
http://www.asciitable.com/

So hopefully if you do the same google search you will find my post and not have to spend as much time as I did trying to figure this out.


How to update all your installed ports on FreeBSD using portupgrade?

Ok, this week there is a simple tool that we are going to talk about. It is called portupgrade. This is a handy software that allows you to manage your ports more efficiently.

I use portupgrade when I want to do things the easy way.

Lets give you a use case. You want to install a new piece of software that requires a library that you already have installed, for example, openssl, however the port fails because the dependency is too old of a version. Well, now you have find the updated port for openssl and uninstall and reinstall it. That might seem easy with one port. But now imaging you have a very new piece of software and you have to update a dozen or more ports. That is going to be time consuming. That is where portupgrade comes in. It does the hard work for you.

Step 1 – Make sure you have ports installed and updated
I already have a post on this. It is pretty short. Check it out here.
How to install ports on FreeBSD?

Make sure that even if you have installed ports that you update ports again so you have the latest.

Step 2 – Install portupgrade

  1. Log on as root.
    $ su
    Password:
    #
  2. Change to the ports directory and
    #
    #
    cd /usr/ports/ports-mgmt/portupgrade
    make BATCH=yes install

Step 3 – See which ports are outdated
The following command will show you which packages are up to date and which are not. Ok, you don’t really need portupgrade for this, because you can also run pkg_version which is part of base, but portupgrade seems to make a database and do this faster.

# portversion

Now, if you want to only see ports that are not up to date, do this:

# portversion |grep \<

Step 4 – Upgrade a port
Ok, now that portupgrade is installed, it is easy to upgrade a port.

# portupgrade portname

You can just copy and past the portname from the output of the portversion command.

Step 5 – Upgrade all ports
Ok, maybe you want to upgrade all your ports, and I am not saying you should, but maybe you want to. Here is a nice command that will do that for you.

# portupgrade -a -m BATCH=yes

Now that is not exactly complete, because we need to update the ports tree first. So do this:

# portsnap fetch update && portupgrade -a -m BATCH=yes

Now, on my FreeBSD box with an Xorg and KDE4 install, this has been going for over a day and isn’t done yet. I takes a long time to recompile all the Xorg, GTK, KDE4, and other miscellaneous ports.

Have fun with portupgrade.


Copyright ® Rhyous.com – Linking to this article is allowed without permission and as many as ten lines of this article can be used along with this link. Any other use of this article is allowed only by permission of Rhyous.com.


How to get the relative path (folder the executable was launched in) as a string in C#?

Well, lets say you launch an application and you want to know the relative path.

In C# you can use the System.Reflection.Assembly.GetExecutingAssembly().Location value. I have searched through many online sites that tell different ways, and some of the more experienced C# developers say that some of the other ways are not always accurate or won’t always work, while this one should always work.

So if you make a class and add two String class variables, you can use this function to populate them: Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)


        private void GetPaths()
        {
            mExecutablePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
            mExecutableRootDirectory = System.IO.Path.GetDirectoryName(mExecutablePath);
        }

Ok, so I like to make sure any newbie can pull this off, so the whole file with it working (using a New WPF project):

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TestPath
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1 : Window
    {
        DataSet mDataSet;
        String mExecutablePath;
        String mExecutableRootDirectory;

        public Window1()
        {
            GetPaths();
            InitializeComponent();
        }

        private void GetPaths()
        {
            mExecutablePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
            mExecutableRootDirectory = System.IO.Path.GetDirectoryName(mExecutablePath);
        }
    }
}

BSD Mag is now a free online publication: Download the first issue

Hello everyone,

Many of you may know this, but I didn’t. BSD Mag is now a free online publication.

There is a January and February issue, as well as a few issues from last year and other past years. You can see the issues available for download here:

http://bsdmag.org/pdf-articles

The February issue is titled: BSDs AS SERVERS

The January issue is titled: Infinity. Freedom. FreeBSD

BSD Mag goes right along with my FreeBSD Friday idea of becoming a little more of an export slowly over time. The magazine comes once a month and reading it for a few months probably won’t change your skills much, but over five or ten or more years, the knowledge you gain will help you become an expert.


(Resolved) ShrewSoft VPN Proxy Services Blocks DNS Requests for VMWare Workstation Guests

UPDATE: 3/5/2010
2.1.6 beta 6 addresses this issue, so please install this version and ignore the rest of the comments below.

Ok, so I am big support of ShrewSoft VPN Client and I am also a user of VMWare Workstation. However, I have found an incompatibility between the two.

I tell everyone here at work to use ShrewSoft VPN Client on their Windows 7 64 bit clients. However, they are all running VMWare as well. So I feel it is my responsibility to also inform them of this issue that was found by one of my coworkers.

PROBLEM
Well, a strange problem is seen on VMWare Guests running on a host with ShrewSoft VPN Client installed. No DNS requests are going out for the Guest. A DNS Request never leaves the host.

Troubleshooting
I seached the following term on the VMWare forums: DNS Bridged

The following VMWare Community discussion appeared:
DNS Name Resolution using a bridged network connection not working

Resolution
If you stop the ShrewSoft DNS Proxy Daemon, then the issue goes away.

Also, this is not really a reason to stop using ShrewSoft VPN. There is a post about Cisco’s VPN Client firewall causing the same issue.
Problems with networking using Workstation 7