BPSoftware.com
Home   Utilities   Purchase   FAQ   Support   Contact        
Shareware Utilities
 APrintDirect
 AIconExtract
 AFile Attribute Manager
Freeware Utilities
 AddrMon
 AFileSync
 ASysIcon
 B&P Table Utilities
 BPACLer
 BPSNMPMon
 BPSNMPUtil
 CharCount
 Delphi® Components
 MacAddr
Miscellaneous
 BPSoftware Blog
 Purchase Shareware
 Support

 


Sunday, March 26, 2006
Rock Paper Scissors

Rock-Paper-Scissors-Shoot...

This game is an adaptation of the popular Rock Paper Scissors game. Rock Paper Scissors is a popular game that is typically played between two people. It is a game that can be played pretty much anywhere and is fun for all ages. This page allows you to play against a computer.

Rock Paper Scissors has three basic rules:

  1. Each players substitute the three elements of Rock, Paper and Scissors with hand signals.
  2. The hand signals are delivered simultaneously by each player (Typically one player will say ‘Rock Paper Scissors Shoot’ and both players will display their hand signal when as ‘Shoot’ is said)
  3. The Outcome of play is determined by the following:
    Rock beats Scissors
    Scissors beats Paper
    Paper beats Rock

To play, simply click your button choice. As you make your selection the computer will also choose. Let's see how well you do.

ready to play? Click Here

Labels: , ,

posted by Brad Prendergast at 9:35:00 AM (0 comments)
Links to this post
Permalink
Saturday, March 25, 2006
HTML Element

When developing an ASP.NET application with BDS® 2006 the Web Controls allow you to create code and control events to manage the flow of your application. The interaction with HTML elements via code is not as obvious, but is possible. Placing an HTML Div HTML Element on an ASP.NET Web Application page results in the following page code:
<div>Div</div>
Change the code to look something like:
<div runat="server" id="divarea"></div>
Declare a strict protected variable for your ‘divarea’ in your webform class. The variable name should match the id you give your element.
strict protected
divarea: System.Web.UI.HtmlControls.HtmlGenericControl;
Your HTML Element is now accessible in you codebehind page. You have access to the controls properties and can do something like the following in your code to change the text of the ‘divarea’:
divarea.InnerHtml:= ‘This is a HTML Div Element’;
Putting this together with the information in a previous post I created a ‘blogroll’ page that displays the most recent 5 posts from a few feeds I monitor. BDS® 2006 truly simplifies ASP.NET.

Labels: , ,

posted by Brad Prendergast at 8:01:00 AM (0 comments)
Links to this post
Permalink
Saturday, March 18, 2006
ARP! ARP!

(Sound like a seal?)

The Address Resolution Protocol (ARP) is used by the Internet Protocol (IP), specifically to map IP network addresses to the hardware addresses. Each Network Interface Card (NIC)/adapter has a unique Media Access Control (MAC) address. The MAC address is one way a computer can be identified.

It is easy enough to get the MAC address for a local machine by entering the command ipconfig /all in a console window. This command shows detailed information for each adapter installed on a computer. The MAC address of an adapter is identified as the Physical Address. Easy enough, but how do you get this information for a remote machine?



Included with Windows® is a program by the name of arp.exe. Without getting too involved, keeping it simple, and assuming a basic understanding of networking, ARP.exe (console window) is used to display and modify the IP-to-Physical address translation tables. This command has a number of parameters, in particular the –a parameter displays the current resolution table entries. Basically, when you type arp –a each machine that an adapter ‘communicated’ with is listed in this table. Both the IP address and Physical Address are listed for each.




If there is an adapter that you are capable of connecting to and you do not see it the resolution table, initiate some ‘communication’ with it and check the resolution table again (arp – a). Generally, I PING (Packet INternet Groper) the machines/adapters I want to get the information of before I look at the table.

If you haven’t done so yet take a look at AddrMon.

Labels: , ,

posted by Brad Prendergast at 11:20:00 AM (0 comments)
Links to this post
Permalink
Wednesday, March 15, 2006
Rightly So

Writely was picked up by Google. I had taken a look at it before, and well, I think we’ll be seeing a lot more of this in the future. ‘Bill Webb’ hits it pretty well.

Labels: , ,

posted by Brad Prendergast at 7:47:00 PM (0 comments)
Links to this post
Permalink
Tuesday, March 14, 2006
Easy Does It

Well, the commercials are everywhere (my favorite is the guy that gets stuck in front of the great wall) and well who can’t resist it? I am referring to the Staples® Easy button. I have placed one of these on my desk and hit it every so often and it really does work…..
I am surprised nothing like this made its way to thinkgeek.com.


Labels: ,

posted by Brad Prendergast at 6:38:00 AM (0 comments)
Links to this post
Permalink
Monday, March 13, 2006
Syndicate Me

RSS has quickly picked up as an effective way of monitoring updated content on web sites (I even have one for this site). There are many applications available to aggregate these feeds. RSS is common enough that RSS aggregation is available (or soon to be) in popular web browsers. What if you wanted your own application or web site to include RSS feed information?

Aggregating and parsing RSS feed information via System.XML namespace of .NET is a lot easier than it sounds. Fortunately RSS is a standard structure XML file. The sub-elements of each item element contain the update information. I have created three (extremely basic) separate examples (BDS 2006, VB.NET 2005 and ASP.NET) of including feed information in your application. (I also put some together using the MSXML ActiveX library that I’ll probably put in another post)

Setting the sample (WinForm) application up in BDS 2006 (Delphi®) and VB.NET 2005 is pretty much the same. On a form I place a Button, TextBox and RichTextBox (screenshot is the two side-by-side).

The TextBox is where one enters the URL of a RSS feed. When the button is clicked the RichTextBox is filled with the feed sub-element information. They both need to use the System.XML namespace.

VB.NET Code
Private Sub btnProcess_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

Dim XMLDoc As New System.Xml.XmlDocument
Dim rssItems As System.Xml.XmlNodeList
Dim child, cn As System.Xml.XmlNode

RichTextBox1.Clear()
XMLDoc.Load(TextBox1.Text)
' each of the sub-elements of the item element contain the feed information
rssItems = XMLDoc.GetElementsByTagName("item")
For Each child In rssItems
For Each cn In child.ChildNodes
' you could filter and/or process each element by name - depending
' on what you'd like to do with node data (i.e. hyperlink to the
' actual post)

RichTextBox1.AppendText(cn.Name)
RichTextBox1.AppendText(vbCr)
RichTextBox1.AppendText(cn.InnerText.Trim)
RichTextBox1.AppendText(vbCrLf)
Next
Next
End Sub


Delphi® Code
procedure TWinForm.Button1_Click(sender: System.Object; e: System.EventArgs);
var
XMLDoc: System.Xml.XmlDocument;
rssItems: System.Xml.XmlNodeList;
child, cn: System.Xml.XmlNode;

begin
RichTextBox1.Clear;

XMLDoc:= XmlDocument.Create;
XMLDoc.Load(TextBox1.Text);
rssItems:= XMLDoc.GetElementsByTagName('item');
For child in rssItems do
begin
For
cn in child.ChildNodes do
begin
RichTextBox1.AppendText(cn.Name);
RichTextBox1.AppendText(#13);
RichTextBox1.AppendText(cn.InnerText.Trim);
RichTextBox1.AppendText(#13#10);
end;
end;
end;


To display the same information on an ASP.NET web page create a document with the following code:
<%@ Page Language="VB" Debug = true%>
<%@ Import namespace="System.Xml" %>

<html>
<head>
<title>BPSoftware.com - RSS Reader</title>
</head>

<body bgcolor="#f8f8ff">
<%

Dim XMLDoc As New System.Xml.XmlDocument
Dim rssItems As System.Xml.XmlNodeList
Dim child, cn As System.Xml.XmlNode

XMLDoc.Load("http://www.techweb.com/rss/all.xml ")
rssItems = XMLDoc.GetElementsByTagName("item")
For Each child In rssItems
For Each cn In child.ChildNodes %>
<%=cn.Name%>

<br />
<%=cn.InnerText.Trim%>
<br />
<%
Next
Next
%>


</body>
</html>

After you get the basic connectivity and processing working, it is easy to filter our and process only the sub-elements that you’d like to include in your application or on your web page. There is a lot that can be done with this inside of an application; I figured I’d go with the basics to help spark some interest. For some unknown reason I've abandoned C some time ago, but if anyone wants to follow up with the same in C please do....

Labels: , , ,

posted by Brad Prendergast at 6:08:00 AM (0 comments)
Links to this post
Permalink
Recent Posts
 Command Line: Visual Source Safe
 SQL: Remove / Delete Orphan Users
 SQL Delete/Drop a User from each Database
 Is there an 'I' in phone?
 SQL Optimization: Am I missing any indexes? - Part...
 Meaningful Signature File Quotes
 My Shared RSS Items
 Edit those XML files
 A little System.Diagnostics
 Wi-Fi Detector Shirt


Labels



Archives
 October 2005
 November 2005
 December 2005
 January 2006
 February 2006
 March 2006
 April 2006
 May 2006
 June 2006
 July 2006
 August 2006
 September 2006
 December 2006
 January 2007
 February 2007
 March 2007
 September 2007
 October 2007
 November 2007
 July 2008
 November 2008
Powered by Blogger