Finally, New Alec Pics

I’ve finally added new pics of Alec, about five months worth. The pictures really show how fast he is growing. I hope you enjoy them.

New Gallery, New Baby Alec Pics

I’ve finally updated my blog and added a much needed photo gallery so that I can show off my newborn son, who happens to be the cutest baby in the world :o) Here is the link to the gallery if you need proof. As a new and first time mom, he is probably going to be way over photographed. I find myself taking pictures of every event and every new facial expression. We even got pictures of the first time he vomited on me…Thus, I created this gallery to share these photos with my friends and family.

Learning C# for VB.NET Programmers

I’ve finally decided that it’s time to learn C#. I’ve just graduated from a year long VB.NET certificate program at the University of Washington so I’m feeling really comfortable with the Visual Studio 2005 IDE and with the .NET Framework classes etc. Given that, I figured the learning curve shouldn’t be too steep. So, I thought I’d talk about some of the differences I noticed between the VB.Net and C# environments the very first time I created a new C# project. This isn’t a debate about which language is superior or even two cents from a super great C# veteran. It’s just what a VB.NET programmer noticed the first time I ventured onto creating a C# application. In fact, some of this may seem trivial, but if you’ve never created a C# application before…well, there’s a first time for everything, even the little stuff. So if you’re making the switch from VB.NET to C#, I hope you will find this interesting.

  • Refactoring built into the IDE. This is really cool. It’s a tool that will change all the instances of a variable in your program when you decide to rename it, help you move blocks of code, delete code, and much more. It’s built in so when you change the name of a variable, or do anything that might require its assistance, it will automatically prompt you for help. For those of you who are VB.NET programmers and don’t know about refactoring but would like to try it out, there is a free refactoring tool available for VB.NET from here. They have versions for VS 2002, 2003, and 2005.
  • Ok, this one took me some time to figure out. In VB.NET, the code window has two dropdown boxes at the top, the left dropdown box has the name of the controls/classes/form instances and the right one has the built in events for the selected control. However, in C#, the dropdown boxes are there, but the controls and events are not. It seems that they are populated with existing types and members only. It took me a fair amount of time to find the built in events. So hopefully, if you are reading this and are considering trying out C#, this will save you some time. The events are available through the properties window in the design view. At the properties window for the control you want to program an event for, click on the yellow lightning bolt to view the available event. Then double click on the event you want and a method skeleton will be built for you in the code window.
  • No Me or My keywords. This is unfortunate. I really got used to those two little words and I would have to argue they should be in C#, especially My. I love My.Computer. It gives me direct access to the system sounds, the clipboard, the keyboard, the mouse, etc. I will also miss My.Settings very much when using C#. This was the handiest way to store, access, and persist application and user settings. I haven’t figured out how to save user and application settings in C# yet, but when I do, I will post it here.
  • Of course, the syntax is very different and resembles C++ and Java. Fortunately, this did not prove to be trouble for me. Actually, it brings me back to college. My instructors were Unix gurus and only allowed us to use C, C++ and Java for our projects. Unmanaged C++ was the very first language I learned and even though I haven’t used it in a couple of years, I think this is the reason learning the C# syntax was so easy for me. In fact, there really wasn’t any learning, I just started typing it out. For those of you who are pure VB.NET developers and never really delved into the Java or C++ world, you might encounter a slight learning curve. But in reality, it’s not that big of a deal and you will be able to catch on quickly with a little practice.

Things that are the same:

  • Of course, both languages use the .Net Framework and thus both have access to the same namespaces, classes, and libraries. This is what makes it so easy to switch from one language to another. Managed code definitely is cool!
  • Both are fully OOP languages.
  • Both have the same design view, same controls are available, etc.

My preference:

Frankly, I don’t prefer one over the other and I think it would be unfair of me to pick one because of my lack of experience with C#. As I start to use features available in VB.NET but not in C# and visa versa (C# lets you write “unsafe code (pointers)”), I think I will be able to make a more fair assessment. Then again, this isn’t about which language is better…why is it so easy to start making comparisons :)

WMI Programming with VB.NET

Introduction

This blog entry does not provide a comprehensive explanation of WMI. It is intended to provide a basic overview for the beginner to get their feet wet.

Overview

Windows Management Instrumentation (WMI) is a subsystem of the Windows operating system. It is accessible programmatically through the System.Management namespace. Through WMI, a developer can provide event monitoring, change hardware and software settings, or simply query hardware and software information and display it.

WMI is included with Windows 2000, Server 2003, ME, and XP. For older operating systems, namely Windows 95 and 98, you can download an installation package from microsoft.com.

Important! Only a user with administrative permissions can install the WMI package.

WMI Classes and Properties

Each WMI class represents a physical entity or resource on the local computer or on the network. Developers have access to numerous classes with several properties each. For example, Win32_Processor is a WMI class that has 48 properties such as “Architecture”, “Description”, and “MaxClockSpeed”. If you are unfamiliar with the classes that are available to you, here are some tools that will help you out:

  • A complete list of classes and their properties are available on MSDN. This is a great resource. I use it all the time.
  • wmic.exe is a Windows command line utility that lets you view WMI classes and execute queries. I’ve never used the tool, however, I thought I would mention it just in case you find it useful.
  • The server explorer in Visual Studio.NET 2005 has a graphical user interface that displays the classes and the details of each class in the properties window. This feature is standard in VS.NET 2005. However, for VS.NET 2002 and 2003 you must download and install WMI Extensions to have this feature. The installation packages are available for download from MSDN. Here are the links to download VS.NET 2003 and VS.NET 2002 WMI Extensions.

    Server Explorer

WMI Query Language (WQL)

WQL is the query language a programmer uses to retrieve system information from the operating system. WQL is very similar to SQL. If you’re familiar with SQL you’re in luck because you will catch on quickly. As mentioned above, each WMI class represents a physical entity or resource on the local computer or on the network. So, just as SQL is used to query databases, WQL is used to query WMI classes and properties.

Here is an example of a simple select statement that retrieves the Name, Version, and BuildNumber properties from the Win32_OperatingSystem class :

"SELECT Name, Version, BuildNumber FROM _
Win32_OperatingSystem"

Here is another valid query:

"SELECT * FROM Win32_OperatingSystem"

Note! Unless you intend to use all of the properties in your code, it’s best not to use * (select all) in your query.

Example

Now that you know what WMI is and what is available to you, I’ll give you a demonstration on how to use it in VB.NET. The following is a simple class I created that queries operating system information and stores the returned values in variables.

Note: I am assuming you are familiar with object-oriented design.

Option Strict On

'need to import the system.management namespace
'to have access to the system management classes
Imports System.Management

Public Class OSInfo
    'used to retrieve a collection of ManagementObject
    'objects
    Private objOS As ManagementObjectSearcher

    'a managementObject to use to iterate
    'through each object in the collection.
    'Used in the for each loop
    Private mgmtObject As ManagementObject

    'declare private class variables
    Private m_strOSName As String
    Private m_strOSVersion As String
    Private m_strOSBuildNum As String

    Public Sub New()
        'select all properties for OS object in the
        'Win32_OperatingSystem class
        'and store object collection
        objOS = New ManagementObjectSearcher _
            ("SELECT Name, Version, BuildNumber _
            FROM Win32_OperatingSystem")

        'iterate throuch each object and read and 
        'assign their properties
        For Each mgmtObject In objOS.Get
            m_strOSName = mgmtObject("Name").ToString
            m_strOSVersion = _
                mgmtObject("Version").ToString
            m_strOSBuildNum = _
                mgmtObject("BuildNumber").ToString
        Next
    End Sub

    Public ReadOnly Property OSName() As String
        Get
            Return m_strOSName
        End Get
    End Property

    Public ReadOnly Property OSVersion() As String
        Get
            Return m_strOSVersion
        End Get
    End Property

    Public ReadOnly Property OSBuildNum() As String
        Get
            Return m_strOSBuildNum
        End Get
    End Property

End Class

To retrieve the information, create an instance of the class (create an object) in the main form. Once you do this, you will have access to the read-only properties that I created in the class. For example:

'declare new OSInfo object
    Dim myOS As New OSInfo

    Dim tblSysInfo As New DataTable

    tblSysInfo.Rows.Add(New Object() _
        {"OS Name", myOS.OSName})
    tblSysInfo.Rows.Add(New Object() _
        {"OS Version", myOS.OSVersion})
    tblSysInfo.Rows.Add(New Object() _
        {"OS Build Number", myOS.OSBuildNum})

The following screenshot is a simple WMI application that I made. This just provides an idea of what you could do. The possibilities are endless, depending on your programming goals.
Sample Application

Resources and Downloads

Should husband and wife keep their money separate or combine their accounts and assets?

Should husband and wife keep their money separate or combine their accounts and assets? It seems that the person whom holds the most currency is the quickest to say, “Keep the money separate”, as they perceive that they have the most to lose.

If a couple decides to keep their money separate (assuming this is a mutual decision, as one might want to keep their money separate and the other doesn’t agree) should the person who makes or owns the most money control it and decide how it’s spent? If so, what about those unwanted circumstances such as a spouse loses a job. Or what about when children come into the equation and one parent stays home to raise the kids? Does the partner earning all the money control it and decide how it’s spent even under these circumstances? It seems to me this would create lopsided power in the relationship, and even worse, a parent-child relationship if one spouse is forced to ask for money whenever he/she needs it. It’s not the fact that one or the other makes more money but the fact that they have full control. I think the power should be equal and having lopsided power in the relationship is a recipe for a divorce waiting to happen.

How would it be decided who’s going to pay on date nights? Who pays for dinner and a movie? Who pays for the late night Dairy Queen Blizzards? How does a couple whose finances are completely separate decide this? Personally, I wouldn’t want to have these conversations. If money is valued as the families then these issues wouldn’t even arise. Date night, weekend getaways, etc. are taken together, as a couple. I think it would just plain suck to have the “money” conversation every time I wanted to get a blizzard.

Would each partner be responsible for exactly fifty-fifty of the bills and each gets to keep what they personally have left over? Or are only mutual bills paid fifty-fifty and each spouse is left to pay their own left over school loans and earlier debt? Is each spouse responsible for his or her own investment decisions? If one spouse makes significantly more than the other, is it fair that he or she should have a much nicer car, nicer clothes etc? I don’t think so. So why do some marriages work and others don’t when couples decide to handle their finances this way? I suppose it’s the way couples communicate that ultimately decides.

Why don’t couples choose that all money that comes into the relationship, no matter from where, be considered family money and as a couple decide how it is spent? I think when a couple gets married at that very point in time, each partner should have decided that everything they own is no longer “mine”; it’s now “ours”. The problem is that people are so worried about divorce. I think people should be focusing on the fact that their partner is worth more than any assets they own and take a risk at making the relationship happy. See, I would rather lose my money than my spouse. We are so obsessive with the mine-yours relationship, what ever happened to partnerships? If couples worked and made decisions as a team, both would be working towards the same goals and same financial dreams. Both would have the same budget to stick to and the same responsibilities and equal power. Wouldn’t that make your relationship stronger?

Ten of My Favorite Things

  • Shoes. I love shoes and I’m so happy summer is arriving because I love summer sandals.
  • Days on end of hot weather. I love it when its hot all night and day. I love summer and I dream of moving away from Washington to a place where the climate is warmer and dryer.
  • God. I love the Lord.
  • Tropical places. I love the smell of the air, the colors, the blue warm ocean, the hot sand, and the exotic colorful amazing animals. All things typical of a tropical climate.
  • Pets. All kinds of pets. They know how to tug at my heartstrings.
  • Shopping. I love shopping for new clothes and stuff to decorate my apartment.
  • Visiting places that I’ve never been.
  • Hanging out with friends and enjoying a glass of wine with them.
  • My computer.
  • Peace, love and compassion between nations, ethnic and racial groups, religious groups, and gay/straight communities.
  • What are your favorite things?

How to Make Your Feeds Auto-Discoverable in WordPress

One of the first things I discovered after installing WordPress and customizing my theme is that not all of the feeds were auto-discoverable by the browser. My first entry describes how to enable this feature using simple html pages, so I knew what needed to be done to enable this feature, but I didn’t know how to do this in WordPress. So here is what I learned. Oh, by the way, I’m using version 2.0.2 so I don’t know if this applies to previous versions or not.

  • The tags described below go in the header.php file included with your theme. Files that come with the WordPress installation do not need to be updated.
  • Most themes come with the standard RSS 2.0 and Atom feed tags already included in the header.php file, but you can check your file to see which ones are included and delete or add which ever feeds you like.
  • I quickly learned that WordPress, or the browser, or my theme (not sure exactly which) is very picky about spreading PHP code over more than one line. I kept getting a parse error until I put all the code on one line. After that, it worked perfect. Something to keep in mind…
  • WordPress comes with 5 built in feeds. Here are the tags you would add to your header.php file for each of them:

RSS 2.0


<link rel="alternate" 
type="application/rss+xml" 
title="RSS 2.0" 
href="<?php bloginfo('rss2_url'); ?>" 
/>

RSS 2.0 Comments

<link rel="alternate" 
type="application/rss+xml" 
title="RSS 2.0 Comments" href=
"<?php bloginfo('comments_rss2_url'); ?>" />

RSS .92

<link rel="alternate" 
type="text/xml" 
title="RSS .92" 
href="<?php bloginfo('rss_url'); ?>" 
/>

Atom

<link rel="alternate" 
type="application/atom+xml" 
title="Atom 0.3" 
href="<?php bloginfo('atom_url'); ?>" 
/>

RSS 1.0/RDF

<link rel="alternate" 
type="application/rss+xml" 
title="RSS 1.0/RDF" 
href="<?php bloginfo('rdf_url'); ?>" 
/>

(I’m not exactly sure what the type would be for RSS 1.0/RDF as I didn’t include it in mine)

Good luck!

My Cat Is Fat

I know my cat is fat because the first comment by anyone who comes to our apartment is along the lines of “whoa your cat is huge!”

Hello World!

I’ve recently installed WordPress on my new site and this is my first blog using WordPress. So far, WordPress seems really cool. When I first started my website, I wanted to start a blog as well as have syndication capabilities. I didn’t know the first thing about the technical aspects of syndication so after a lot of reading I created my own blog and RSS 2.0 feed by hand using standard HTML and XML. I wanted to create them by hand for learning purposes but I have quickly found out how much work it is to maintain a blog and feed manually. I am satisfied that I have learned the fundamental technical aspects, so I decided to find blogging software to use on my site. I’ve found Wordpress, and I really like it!

Below is the one and only blog entry I made on my “hand-made” blog. Since I’ve made the switch to WordPress and I’m no longer using my old blog, I will post it here because I think it’s very interesting and I hope you will to.

How to Create Your Own RSS Feed
Posted: 2/27/2006

My exploration of RSS started when I decided that I wanted to have a blog of my own. I started by visiting sites where I could create an account and all the technical aspects would be done for me. All I had to do was sign in and write my blog entries. But I wanted to host a blog on my own website. That is when I discovered that if I wanted to syndicate my blog I would need an RSS feed. Sure, I could have taken a much easier route and downloaded software that would take care of everything for me, but I wanted to learn how to implement this technology on my own. I wanted to do this primarily because I have just as much fun learning and creating the technology than I do blogging. In fact, I suspect that the maintenance of my blog and feed will be just as fun as blogging itself. I also believe that when I’m learning something new it’s always a good idea to learn the stuff under the hood before going to a system that does all the work for me. This way I develop a solid set of fundamental skills. So, voila, the urge to have a blog of my own turned into an entire weekend project.

When I first started my research, I had some knowledge about web technologies. I would consider myself an expert with HTML and Cascading Style Sheets. If you don’t have this knowledge you will have quite a bit more learning to do than I did. I am an absolute beginner with XML and XSL however.

What is a feed?
A feed is simply an XML file that contains certain tags that will enable your browser and reader to identify the file as an RSS feed. The XML file contains the titles of your blog entries, a link to each entry and a description. Here is a great link describing the required tags for an RSS file. The XML file is uploaded to the server that is hosting your website. Here is my simple XML file for an example:


<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" 
  href="feedStyle.xsl"?>
<rss version="2.0">
  <channel>
    <title>Keri Jenson's Blog</title>
    <link>http://www.kerijenson.com/myblog.htm</link>
    <description>Keri Jenson's Weblog</description>
    <language>en-us</language>
    <pubDate>Mon, 27 Feb 2006 22:32:10 GMT</pubDate>
    <lastBuildDate>Thu, 09 Feb 2006 15:59:10 
     GMT</lastBuildDate>
    <ttl>1440</ttl>
    
    <item>
      <title>How to Create Your Own RSS Feed</title>
      <link>http://www.kerijenson.com/myblog.htm#001
          </link>
      <description>My exploration of RSS started...
          </description>
    </item>

    <item>
      <title>The Second Item to Check Out</title>
      <link>http://www.kerijenson.com/myblog.htm#002
         </link>
      <description>This is the second article on my 
          Web site!</description>
    </item>
    
  </channel>
</rss>

Why have a feed?
A feed is not necessary to have blog. A blog, after all, is just a weblog; a web page with your entries. However, a feed allows users to keep track of updates to your blog without having to visit your website. People who are interested in your blog simply visit the URL your feed (XML file) is located at, copy the URL and then paste that URL into their reader. Whenever you update your XML file (your feed), the users’ reader will detect a change and download the new blog entries (or whatever kind of media you wish to syndicate).

What is XSL and why is it relevant?
XSL provides a way to convert XML to HTML so that the XML file is rendered in the browser in a more readable fashion. It’s a good idea to apply a XSL stylesheet to your XML file to pretty it up. If you don’t, people who visit the link will see the contents of the XML file exactly as it written. This could confuse non-technical users who could mistakenly believe they got there by mistake or that there is some kind of error. Applying a simple and basic style would avoid the possibility of this happening. Technically, it doesn’t matter whether or not the user can read the webpage at all because the purpose is just to copy the URL. Despite this, it is more user friendly and will help those that are not very technical.

I’ve recently installed Internet Explorer 7 beta 2. IE 7 renders RSS feeds in a standard format. I actually like this because your personal feed looks more professional and credible when it conforms to standards and looks exactly like the feeds that belong to a company who they have come to trust. I believe that there is a way to turn the “auto format” feature off, so it is still a good idea to have a stylesheet for those who don’t use this feature.

What about the blog entries?
Your blog or news entries will be located in separate html or asp web page(s). After you make a new entry to your blog, you will then update your XML file to reflect the new entry so that your user’s readers will detect a change and download your new entry. It is a good idea to have the standard RSS orange icon that links to your feed on this page so that browsers who come upon your page know where to go to subscribe.

How to make feeds discoverable?
IE 7 and Mozilla have a discovery feature where an RSS button lights up on the browser when the browser recognizes that the current page has a link to an RSS feed. To add this functionality to your own page simply add this tag into the head of your html file:


<link rel="alternate" type="application/rss+xml" 
title="The Title of Your Feed" 
href="http://www.yourURL.com/rss.xml">

Of course, there are more complex subtopics of RSS such as Trackback where websites communicate with pings so that receiving sites are informed that the sending site has referred to a post. But I am also new to this technology and I will make posts as I continue to learn. In the near future, I will post a blog on how to display syndicated news via RSS on your own website. For example, I may want to display the latest headlines from MSDN and have them updated automatically.

Happy blogging!

Glossary:

  • Syndication: The sharing of news and web content or the publishing of a feed as an information source.
  • Web Feed: A document which contains items of summaries of blog post with web links to the full version. The most popular web feed document formats are RSS and ATOM. A web feed allows users to subscribe to a website that change or add content regularly such as a blog, similarly they provide a way for a website owner to distribute their news.
  • RSS: Really Simple Syndication is a web feed format specified in XML that allows syndication of news and web content.
  • ATOM: A second web feed format specified in XML that allows syndication of news and web content.
  • XML: Extensible Markup Language is a text-based language that is capable of describing different kinds of data in a tree-based structure.
  • XSL: Extensible Stylesheet Language is used to transform XML to HTML for better presentation in a browser.
  • Blog: Short for weblog where conversations are posted on a web page. Blogs are often focused on an area of interest or personal experiences.
  • Render: How an image is generated on the monitor.
  • Reader/Aggregator: An application (Windows based or web based) that reads and organizes RSS and ATOM feeds and displays updated articles it finds.
price of zithromax buy accutane cheap order cialis from us cheap synthroid cheapest accutane cheapest lasix levitra for sale synthroid no prescription buy cialis generic cheapest levitra prices acomplia online buy cheap propecia order generic cialis cialis cheap price viagra cheap price cialis prices acomplia discount cialis no rx buy synthroid cheap cheap cialis on internet find no rx viagra order viagra from us lasix cheap cheap zithromax tablets soma cheap order cialis overnight delivery buy cialis online order zithromax online propecia online cheap cialis pharmacy cheap generic zithromax no rx cialis cheap cialis in uk purchase levitra cialis discount purchase propecia online discount acomplia cheapest accutane prices cialis bangkok viagra online pharmacy viagra pill best price for cialis cheap cialis no prescription online cialis purchase acomplia online buy zithromax online fda approved viagra compare cialis prices lasix without a prescription pharmacy viagra buying viagra online cheap cialis from uk clomid discount propecia online buy accutane without prescription cheap generic synthroid compare viagra prices cheapest lasix prices synthroid sale cheap cialis in canada viagra medication buy soma cheap viagra order no prescription cialis cheap cialis online synthroid pills soma online order viagra online viagra no online prescription online clomid acomplia without prescription buy cheap levitra online find discount cialis