roncli.com blog
The blog of roncli
roncli.com blog
roncli.com
blog
Profile
Ronald M. Clifford
Houston, Texas, United States
Labels
Coding
CTG Music
Editorials
Games
Miscellaneous
Music
Servers
Silliness
Software
Sports
Trax in Space Beta
Weather
Recent Posts
Visual Studio 2010
SVN turns 1000
Cleaning Up Code
MSDN
Leaving CTG, Closing OSMusic.Net
Riding the Wave
XAML again?
LibWowHeroes 3.2.2
An Experiment
Gate
Archives
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
June 2008
July 2008
September 2008
December 2008
February 2009
July 2009
August 2009
September 2009
October 2009
November 2009
February 2010
March 2010
April 2010
Monday, April 19, 2010
Visual Studio 2010
Posted: 4:40:00 PM 0 comments
I've got Visual Studio 2010 up and running both at work and at home, and so far it's been pretty smooth. A few things that I ran across that I don't particularly care for, but have made a workaround for:

  • You can't use the standard FixedSys font in the editor. Because it's using WPF, it can't use old fonts like FixedSys. The solution is to pick up this TTF replacement. It's the best one out there.

  • I like a dark environment, complete with a black background and a bunch of highlights, especially for comments and literal strings. Apparently, Microsoft doesn't. They make the background of anything that's not the background of the page translucent, resulting in a darker color when seen against a black background. Further, multiple lines with background colors aren't filled in, leaving annoying-looking, thin black lines between each and every line of text that has a highlight in it. This is fail. Fortunately, this fix takes care of both.



I've begun working on getting all of my code into Visual Studio 2010, although the C++ projects are going to prove a little more painful, possibly more so than they are worth. Cent and Constellation may have to remain on 2008 until I can figure out a way to get them working again.

But so far, 2010 kicks ass. Code Analysis is fun to play with, and reducing all my VB.Net properties to one line is just delicious. I'm not going to go to the .Net 4.0 Framework just yet, although that is indeed the next logical step, and with luck it will come possibly next week.

Labels:

Friday, March 05, 2010
SVN turns 1000
Posted: 5:22:00 PM 0 comments
Today, I made my 1,000th commit to my SVN server. It wasn't much of a change, reversing a commit that turned debugging on for one of my websites, but it's a milestone nonetheless.

Building up to this, I did a lot of work with the applications and libraries that currently exist on the SVN. Here's a brief summary of what I've done recently:


  • LibWowArmory got an ItemTooltip class added to it, only a demo application remains before I release version 0.3.

  • Constellation and Cent both got their libraries in the /lib directory of the SVN, allowing me to develop these applications anywhere, not just at home.

  • Six Minutes To Release had a ton of work done on it, including the addition of LibMinifier, my JavaScript and CSS minification/combination/compression library. I also replaced WZ Tooltip with jQuery Tooltip, continuing my move towards jQuery on the Six Minutes website.



For now, I will continue to focus on the Six Minutes website, as there are a lot of guild issues that require me to do a lot of coding. After that, however, Gate will be the focus, as I want to get a copy of that up and running before Google shuts down Blogger FTP on May 1st. Granted, I have a backup plan if I don't succeed in that goal, but I'm hoping I can get something quick done by then.

Labels:

Thursday, February 18, 2010
Cleaning Up Code
Posted: 5:54:00 PM 0 comments
I took some time today to update some libraries in my source code, which is affecting a bunch of my projects. Cent, which runs off of CrystalSpace, is getting a makeover of sorts, as I am switching it over from the traditional CrystalSpace build process of linked libs and using DLLs instead. The process is quite nontrivial, as I am finding that I have to modify the Visual Studio solutions a bit to get things working as I need them to.

The biggest issue I'm coming across is trying to get the plugins into the same directory as Cent.exe so that I don't have to carry around a CSPath environment variable. I thought just adding it as a reference would copy it over, but it's not. I'm sure I can resolve this, but I just ran out of time today.

The other fun makeover I'll need to do involves Constellation, my Planarity clone. It runs off SDL, which, along with a slew of other libraries, are in a bunch of directories outside of my SVN directory. I'm going to try to get those all together and get a functional build of both Cent and Constellation before I continue working on any of the code in there.

Once I'm done, it's back to Six Minutes. I have a LOT of cool stuff planned over there, and a lot of coding to do to get it done. With some extra spare time the last week or so, I'm trying to knock out things that I've been wanting to do for a while but just haven't had the chance. We'll see how far this goes.

Labels:

Saturday, October 24, 2009
XAML again?
Posted: 4:46:00 PM 0 comments
Back in January of last year, I started work on the Six Minutes To Release website using Silverlight. It... didn't go so well. People couldn't use it on Macs, and there were other fugly things about it I didn't like. I ended up abandoning the project and coding it in straight ASP.Net.

Turns out that the XAML experience I got from working on it the first time through the SMTR website came in handy. The Rawr project is using Silverlight for its next major release, Rawr 3. Having taken on the protection paladin module, I was able to write a needed piece for that module to work in Rawr 3 in about 3 days on and off. Of course, the stumbling of not having touched it in nearly 2 years took me some time to get past, but once I did it was smooth sailing.

There's a few things I don't like about it, though. Rawr is going to release a Silverlight web release and a WPF application release. The problem with the two releases is that the XAML used in each is not necessarily compatible with each other in all cases. This results in being unable to use certain features, such as StringFormatting. We also have to use a cheap preprocessing approach to be able to compile the same XAML file in both places.

Is it me, or could Microsoft have done a better job of streamlining the two versions? Why even have two versions of XAML? It seems like a lot of extra work for similar functionality that could be done all in one place.

In any case, I've put a lot on my plate, and I've devoted this weekend to getting it out. Up next, SMTR's new raid performance reporting, which is almost done. Should be fun.

Labels:

Sunday, October 11, 2009
LibWowHeroes 3.2.2
Posted: 4:25:00 AM 0 comments
It appears I'm amassing a nice amount of .Net libraries for World of Warcraft. My latest offering is for WoW Heroes, and is a .Net library for accessing their XML files. It's called, predictably, LibWowHeroes. Yeah, sorry for not being original, but at least you know what to expect!

Unlike my other libraries, this is a full release. With it you can query WoW Heroes for a guild and return lots of WoW Heroes-specific data from it. Unfortunately, I don't have manual character updates working yet, but that will be something I will work on soon. And WoW Heroes data will be coming to Six Minutes To Release very soon.

Labels:

Friday, October 02, 2009
An Experiment
Posted: 5:53:00 PM 0 comments
Six Minutes To Release seems to be my favorite testing grounds for experimental code lately. Fortunately, the RSS experiment was a success.

This one involves moving the ViewState off of the HTML page and on to the database. Some of the ViewStates were getting huge, even when I'd try to manage the size of the ViewState. So I decided to take that out of the HTML to slim some pages down. So far it seems to be working, but it hasn't been up for too long.

This caused me to rethink my ASP.Net model, and I ended up putting data that I usually store in a separate class, such as login information, into the class that inherits System.Web.UI.Page. Makes it much cleaner in my opinion, as I don't have to store references to Response, Request, and Server.

So we'll see how this goes. This is all based on an idea I got for Gate, and if it goes well I'll end up using it in Gate as well. Should be fun.

Labels:

Monday, September 21, 2009
Gate
Posted: 1:39:00 AM 0 comments
In a recent post, I mentioned that I was combining roncli.com, my projects site, and this blog into one website. Well, work on it has begun, and it's called Gate. The name Gate is actually short for Aggregate, which I will somehow work into the main theme.

Gate itself aims to be an open source, modular project. The first three modules will be a wiki, a Blogger-supported blog, and a project management module. I've been working on the SQL Server database setup the last week and a half or so and have it just about completed. Now I gotta write the repair script, which is what happens when installation goes wrong. It's been pretty fun, as I've been using jQuery and jQuery UI for the interface, allowing for the installation to be robust and user friendly.

The challenge is going to be figuring out how I want to do the modules. There are two problems to solve here. First, I need to figure out how to handle database usage between the modules and the core application. I'm using LINQ to SQL to build the data structures and synchronizing them with SMO, so theoretically the modules could use a separate LINQ to SQL file for the same database, but that might not be very optimal.

Second, I need to figure out if I am going to be able to just drag and drop modules into the /bin directory or if I'm going to have to compile it into the main website. The design strategy is to keep things simple for the user to install, so it would be nice if I didn't have to recompile things for every module. I know how to do plugins for desktop applications, as I have in Solar, a TCP/IP text processing engine that I've written that allows users to write their own plugins to process the text however they want to. Would it work for websites, or even make sense for them? That is the challenge ahead of me.

The nice part of it, like I said, is that it's open source. I'm doing this mostly for myself, and if others can get good use out of it, that's great. And if I can get others to help out with the code, that's even better. But until I have a functional version, I'm pretty much just going to write the core module plus the wiki, blog, and projects modules myself. Once the new roncli.com is online, then I'll look into releasing Gate as its own project.

Labels:

Tuesday, September 08, 2009
LibWowArmory 0.2.1 beta
Posted: 4:35:00 PM 0 comments
Blizzard decided in the latest World of Warcraft patch to add items that are only usable by one of the factions while providing an item with exact stats but different looks to the other faction. LibWowArmory, my VB.Net Armory parser, has picked up on this, and thus version 0.2.1 is released.

Labels:

Friday, September 04, 2009
Cleanup day
Posted: 4:56:00 PM 0 comments
I suppose today is cleanup day.

I removed achaea.roncli.com and d3tl.org from my server. The source code to these sites can be found in my Subversion repository at svn://www.roncli.com/ronclipro/old/Websites.

If it's the data you're after, I have backed up all the SQL Server information, which is available upon request.

Labels:

As if I don't have enough to do
Posted: 2:04:00 PM 0 comments
In addition to working on my personal projects (including the Six Minutes To Release website and the associated libraries), leading a 7-day a week WoW raiding guild, and somehow still finding time to sleep, I've decided to participate in the open source development of Rawr, an equipment planner and optimizer for World of Warcraft.

Primarily, I'll be working on the protection paladin module, as the primary handler of that module has stopped working on it. Already I've fixed some bugs from the latest version, and the module should be usable again in the next release. I really don't plan on adding a whole lot, there's already a lot of good stuff in there. My goal is to make sure that there's as little down time as possible between patches so that protection paladins can stay up to date with the kind of gear that they need.

Labels:

Tuesday, September 01, 2009
FeedPage
Posted: 1:48:00 PM 0 comments
Because the code is so short, I've decided to just go ahead and post the code to FeedPage here. Remember, you must have a reference to the ASP.Net RSS Toolkit in order to compile this.


Imports RssToolkit.Rss
Imports System.Web.UI

Namespace roncliProductions.LibFeedPage

Public MustInherit Class FeedPage
Inherits Page

Protected Overrides Sub OnPreInit(ByVal e As System.EventArgs)
MyBase.OnPreInit(e)
Dim strFeed As String = Request.QueryString("feed")
If Not String.IsNullOrEmpty(strFeed) Then
If strFeed = "atom" Or strFeed = "opml" Or strFeed = "rdf" Or strFeed = "rss" Then
Response.ContentType = "text/xml"
Select Case strFeed
Case "atom"
Response.Write(GetFeed().ToXml(DocumentType.Atom))
Case "opml"
Response.Write(GetFeed().ToXml(DocumentType.Opml))
Case "rdf"
Response.Write(GetFeed().ToXml(DocumentType.Rdf))
Case "rss"
Response.Write(GetFeed().ToXml(DocumentType.Rss))
End Select
End If
Response.End()
End If
End Sub

Protected MustOverride Function GetFeed() As RssDocument

End Class

End Namespace


Easy enough. To use, simply change your inheritance from System.Web.UI.Page to roncliProductions.LibFeedPage.FeedPage, and inside that construct and return an RssDocument object. Then, when you add ?feed=xml to the URL of the page, you will get an RSS feed.

Labels:

Fastest. Project. Evar.
Posted: 12:56:00 AM 0 comments
I've decided that I'm going to write a website that combines my three main personal sites: Projects, roncli.com, and this blog.

One of the biggest features of this site is the ability to easily add an RSS feed to a webpage without having to write separate pages or nasty ASP.Net http handlers. Basically what I wanted was to have URL's that look like "...page.aspx" load the usual aspx, but "...page.aspx?feed=rss" load the RSS feed instead of the normal page.

This idea led me to the ASP.Net RSS Toolkit, a very easy to use toolkit with some nice features. Including the ability to quickly make RSS feeds. That, combined with a 34-line class (counting 6 blank lines) that inherits from System.Web.Ui.Page, overrides OnPreInit, and forces inheriting classes to override a GetFeed function, and I'm ready to create feeds not only in RSS, but also Atom, OPML, and RDF as well.

Wow. The demo app was more challenging to write than this gem.

I want to give it a test run, probably on some Six Minutes To Release pages, and see if it's stable. However, shortly thereafter I will probably release this to CodePlex so that other people can get their hands on it. I am rapidly becoming addicted to RSS feeds since my iPhone reads em pretty good using Byline. I have feeds from all over the Internet, and it's nice to be able to have one central place to find out what's going on in my own little corner of the world.

Labels:

Sunday, August 30, 2009
LibWowArmory 0.2 beta
Posted: 7:22:00 PM 0 comments
I finally got around to updating LibWowArmory to include not only the latest changes to the Armory's XML data, but now it also includes information about reputation, achievements, statistics, and character calendar information.

It's taken me 8 months to go from one version to the next, and with all the bouncing around I do on projects, it's really no surprise that it takes me forever to do these kind of things. Although I do have plans to add guild and arena team information, I doubt that's going to come around for a while, unless someone offers some help with the project.

Next on the plate for me? Something to replace trac...

Labels:

Thursday, August 27, 2009
LibWowArmory coming along slowly
Posted: 4:55:00 PM 0 comments
I've been spending a lot of time with LibWowArmory lately, largely because the current version is broken due to 3.2 Armory changes. My two main goals are to finish off the character data (I have 3 tabs left), and create a demo application.

Well, today I finished the demo application with all of the existing data I have. It's basically a command line version of the Armory, a 2,339-lines-of-code monster that took way longer than I had hoped it would. Of course, that's because over half of that has to do with the Item Search feature. It's crazy because of all the filters that exist.

What irks me about that, though, is that the Armory is a version behind on some of the filters. For instance, there is no filter for Emblems of Triumph yet. Because of the erratic updating they do to their own website, I've actually been thinking of making an app that downloads some .xml data, compares versions, and alerts me when there has been changes.

There's just so much I want to do programmatically with WoW, but I just don't have time to make it all happen at once. Sometimes I wish I had help on these things, but finding interested developers that are committed to help is a problem that's tough to solve.

Labels:

Wednesday, July 29, 2009
LibBeImba 0.1.1 beta
Posted: 6:00:00 PM 0 comments
I've updated my LibBeImba project to version 0.1.1 beta. The major change with this version is that I decided to write a function that actually updates the toon's data on BeImba. This means that you don't have to manually update your toons yourself, you just have to call this function. There's also a demo application that shows how to use the LibBeImba library.

I'm working on an update to my other WoW-related project, LibWowArmory, next, as the current version is incompatible with the current Armory due to changes made earlier this month.

Labels:

Tuesday, February 10, 2009
The Finished Product
Posted: 10:58:00 AM 0 comments
It's hard to finish something a year after you intended to be finished with it. It makes you feel like you've got nothing done over that period of time. But with as little as I've been able to work on projects in my free time, the Six Minutes To Release website is finally in a somewhat finished state.

The last week has seen me make various bug fixes and LINQ optimizations to allow the site to run faster, but nothing new has gone in, and I think it'll stay that way for a while. The Equipment Planner's been a big hit with the guild members so far, and I've always thought in the back of my mind about taking that a step further and spinning it off into its own website. Indeed, it may be something I eventually do, but for now I think I'm content with admiring the finished product, and perhaps work on something else for a while.

The biggest thing for me is that I've finished a project. For those that have been following this blog, you may know that it is difficult for me to finish things I start, but I managed to see this one through despite the long time from development to final release. Sure, I'll add things here and there, but the original plans I made were followed. That's a boost to my confidence, and hopefully something I can draw off of for wherever my next project lands.

Labels:

Tuesday, February 03, 2009
LibWowArmory 0.1
Posted: 5:25:00 PM 0 comments
I totally forgot to post this. Not so long ago, I released LibWowArmory on CodePlex. It's a .NET library for interfacing with the World of Warcraft Armory.

It's not complete, but I have it looking up important stuff, like items and characters. You can also extensively search as if you were searching from the Armory itself. Well, you are searching from the Armory itself, really, using the same queries available on their website.

I want to add lots of stuff to this, such as Achievements and Arena Teams, but right now this will do, because that's all I need for the Six Minutes website. I'm hoping at some point I'll be able to revisit this library and complete it, because it's pretty nice to be able to just call this stuff from code and not have to worry about the implementation of HTTP.

Labels:

Thursday, December 18, 2008
LibWowArmory 0.1
Posted: 1:50:00 PM 0 comments
I've finished up the first release of the .Net library I've been working on that queries the WoW Armory. You can grab LibWowArmory from Codeplex. There's still a lot of work I want to do on it, but for now it does what I need it to do, and I can go back and complete the rest of the functionality later.

Labels:

Friday, December 12, 2008
Using the WoW Armory to determine class talents
Posted: 5:11:00 PM 0 comments
First of all, my apologies for not posting in over two months. My main focus has been working on the Six Minutes To Release website and related functions. Believe me when I say I've poured a lot of time into this.

On the heels of my LibBeImba project, I needed a more robust way to access the World of Warcraft Armory than I have been on the website. My research led me to the fact that they are using XML and XLT files to create their web pages, thus leaving the XML data exposed. In addition, using Fiddler, I have been able to find additional files behind the scenes that allow me to mine even more XML data. Serializing the XML in lieu of an XSD and then presenting the information in a developer-friendly format has led me to create the LibWowArmory project, still in development.

So today I went to take a look at the talents, figuring they were in XML as well. Well, this:


<talentTree value="503501523201322531025012511400200000000000000000000050000000000000000000000000"/>


isn't exact useful data. Turns out that string is parsed via JavaScript, and the talent calculator, instead of being created by XML and XLT, is generated on the client side via JavaScript. This included all of the static data, including the names of the talent trees, the individual talents, and the actual tooltip text you get when you mouse over the talents on the page. Very unArmorylike. And very inaccessable from VB.Net. At least, initially.

A while back I had done a bit of work with compiling .Net assemblies on the fly, and had began to wonder if I could somehow take the JavaScript that Blizzard was using, convert it to some .Net-equivalent language, and mine the data through reflection. After looking into JScript.Net and doing a refresher on Reflection, it only took me a couple of hours to come up with this code:


    Public Sub Talents(ByVal strClass As String)
' Gather the source code
Dim lstSource As New List(Of String)
lstSource.Add("var jsLoaded; var document; var pointsTier = new Array(); var templateString; var reqTalentID; var reqTalentPoints; var variableIsSite; var maxRank; var theUpdatedRank; var showTip; var hideTip; var textNextRank; var textPoint; var textPoints;")
Using wcClient As New System.Net.WebClient
lstSource.Add(wcClient.DownloadString("http://www.wowarmory.com/shared/global/talents/includes/variables-live.js"))
lstSource.Add(wcClient.DownloadString("http://www.wowarmory.com/shared/global/talents/includes/functions.js"))
lstSource.Add(wcClient.DownloadString(String.Format("http://www.wowarmory.com/shared/global/talents/{0}/data.js", strClass.ToLower.Replace(" ", ""))))
lstSource.Add(wcClient.DownloadString(String.Format("http://www.wowarmory.com/shared/global/talents/{0}/donotlocalize.js", strClass.ToLower.Replace(" ", ""))))
End Using

' Compile the code
Dim cdpProvider As CodeDomProvider = CodeDomProvider.CreateProvider("JScript")
Dim cpParams As New CompilerParameters()
cpParams.GenerateInMemory = True
cpParams.GenerateExecutable = True
Dim crResults As CompilerResults = cdpProvider.CompileAssemblyFromSource(cpParams, lstSource.ToArray())

' Run the main module of the assembly
Dim lstArgs = New List(Of Object)
lstArgs.Add(Nothing)
Dim objReturn As Object = crResults.CompiledAssembly.EntryPoint.Invoke(Nothing, BindingFlags.Static, Nothing, lstArgs.ToArray(), Nothing)

' Get the type in the assembly that contains the data we want
Dim tType As Type = (From t In crResults.CompiledAssembly.GetTypes() Where t.Name = "JScript 0").First()

' Get the tree names
Dim fiTrees As FieldInfo = (From f In tType.GetFields() Where f.Name = "tree").First()
Dim lstTrees As List(Of Object) = CType(Unbox(fiTrees.GetValue(Nothing)), List(Of Object))

' Get the talents
Dim fiTalents As FieldInfo = (From f In tType.GetFields() Where f.Name = "talent").First()
Dim lstTalents As List(Of Object) = CType(Unbox(fiTalents.GetValue(Nothing)), List(Of Object))

' Get the rank descriptions (some of these are in HTML format)
Dim fiRanks As FieldInfo = (From f In tType.GetFields() Where f.Name = "rank").First()
Dim lstRanks As List(Of Object) = CType(Unbox(fiRanks.GetValue(Nothing)), List(Of Object))

' Get the non localizable tree names... used to mine images like so:
' String.Format("http://www.wowarmory.com/shared/global/talents/{0}/images/armory/{1}/background.jpg", strClass.ToLower().Replace(" ", ""), strTree.ToLower().Replace(" ", ""))
Dim fiNLTrees As FieldInfo = (From f In tType.GetFields() Where f.Name = "nltree").First()
Dim lstNLTrees As List(Of Object) = CType(Unbox(fiNLTrees.GetValue(Nothing)), List(Of Object))

' Get the non localizable talents... used to mine images like so:
' String.Format("http://www.wowarmory.com/shared/global/talents/{0}/images/armory/{1}/{2}.jpg", strClass.ToLower().Replace(" ", ""), strTree.ToLower().Replace(" ", ""), strTalent.ToLower().Replace(" ", ""))
' String.Format("http://www.wowarmory.com/shared/global/talents/{0}/images/armory/{1}/{2}-off.jpg", strClass.ToLower().Replace(" ", ""), strTree.ToLower().Replace(" ", ""), strTalent.ToLower().Replace(" ", "").Replace(":", ""))
Dim fiNLTalents As FieldInfo = (From f In tType.GetFields() Where f.Name = "nltalent").First()
Dim lstNLTalents As List(Of Object) = CType(Unbox(fiNLTalents.GetValue(Nothing)), List(Of Object))

' TODO: Cache lists here for future use
End Sub

Private Function Unbox(ByVal obj As Object) As Object
If TypeOf obj Is ArrayObject Then
Dim aoObj = CType(obj, ArrayObject)
If CInt(aoObj.length) = 0 Then
Return New List(Of Object)
Else
Dim arr As Array = CType(Microsoft.JScript.Convert.ToNativeArray(aoObj, Type.GetTypeHandle(New Object)), Array)
Dim lstReturn As New List(Of Object)
For Each o As Object In arr
lstReturn.Add(Unbox(o))
Next
Return lstReturn
End If
Else
Return obj
End If
End Function


There's a bit to talk about in here, so I'll go ahead and explain the code.

First, JScript.Net differs from JavaScript in that all variables must be defined. That's essentially what I'm doing with that big long line just after declaring lstSource. All of those variables need to be declared, otherwise the code will not compile. Interesting to note that "document" needs to be declared, since we're not running from within the scope of a web page. Fortunately, I'm not doing anything with the document object, so I'm not going to run into any runtime errors accessing the document.

Next, I download all of the necessary code from Blizzard. The second one has a lot of useless functions, but it does have a couple functions that are used in the last two. Those two files contain all of the talents for the specified class.

The next section compiles the code using the JScript CodeDomProvider. The following section actually runs the main module of the assembly, instantiating all the variables and allowing the functions to run. Most of Blizzard's code is written in the global scope, so most of that code runs. This is where the data from the data.js and donotlocalize.js files are put into memory.

Now we have to use reflection to get the type. After some debugging, I found that the type named "JScript 0" is the one with the data I'm interested in. So, using LINQ, I grab that type from the assembly.

Now we get to pull the data we want. I get the FieldInfo object from the type, again using reflection to make it easy to cherry pick the correct field. Then I can use FieldInfo.GetValue to grab my value and...

Not so fast.

Because the assembly I'm pulling from is in JScript.Net, arrays are not of type System.Array, but rather Microsoft.JScript.ArrayObject. This is a monolithic array type that really doesn't let you play around much with it. Trying to LINQ from it doesn't give you the data, you actually have to call the data through the Item property.

Fortunately, JScript.Net provides a way to change ArrayObjects to normal Arrays, via the ToNativeArray function. I packaged this all up into a recursive function called Unbox. This takes an object and spits the object back out if it's not an ArrayObject. However, if it is an ArrayObject, it converts it into a List(Of Object) using some trickery. Note that it tries to unbox each object that it inserts into the list. This is because Blizzard likes nesting arrays, so I needed to make sure that every ArrayObject inside is put into a more friendly list object.

The idea is to cache this data so I don't have to spam Blizzard for their JavaScript files every time I need to access a player's talents, something I already have a bit of a framework setup to do in LibWowArmory.

The result is I can now take that very ugly talentTree XML node, split the string up into individual characters, and assign each of those numbers to each of the character's talents to learn exactly what their build looks like in code.

All in all, I'm pretty happy with my work on this, and plan to release LibWowArmory soon with item search and lookup, as well as player search, lookup, and talent inspection. Further, I am now able to apply the power of the Armory to my own website in an easy-to-use library in what should be a write-and-forget library, much like LibBeImba turned out to be.

I would be doing this post an injustice if I didn't talk about how the guild is doing. So far, we've cleared about half of Naxxramas 10 as people are still working on leveling up. We've also taken out Sartharion 10 with no drakes, and are farming Archavon 10 when we can as well. Wrath of the Lich King brought some great content into the game, succeeding in many places where, in my opinion, Burning Crusade just failed miserably. I'm really happy with this expansion so far, as is Kathy, and it's something we continue to enjoy together, something that's more important to us than the game itself.

Labels:

Wednesday, September 24, 2008
LibBeImba 0.1 beta released
Posted: 4:18:00 PM 0 comments
With everything nearly back to normal in Houston, I'm back to working on my guild's website.

In the course of doing so, I recently added the ability to pull scores from the BeImba website for use on my website. The admin over there just recently opened up a SOAP API, which took me a matter of an hour or so to create something to interface with it.

Well, I took things a step further. I took out the portion of the code from the website and made it its own project called LibBeImba. After playing around and tweaking things, I got to the point where I thought the library should be available to the public.

The result? A CodePlex project for LibBeImba. It was pretty straightforward for me to create the project, upload the source via SVN, and create its first release.

Currently, I use it to capture all of my level 70 guild members' scores once a day and store the information in a database. Then the website can query that information and display it in any number of ways. I hope to get a graph up on individual users' pages, but that might be a while before I can get around to that.

In any case, if you're a .NET coder interested in getting BeImba scores for your World of Warcraft guild, this is the library you need. Check it out.

Labels:

Thursday, September 04, 2008
Reporting Services ReportViewer in browsers other than IE
Posted: 4:57:00 PM 0 comments
So I've been working with SQL Reporting Services at work lately, and was annoyed with how slow it was in Internet Explorer. I tried running other browsers, but it just never rendered right. Well, after an hour or two of research, I finally came up with a method to get these browsers to render correctly.

The syndrome that many users experience is that the table becomes squished, as if the table of results wants to be as thin as possible. The reason for this is because someone at Microsoft in all of their brilliance decided to put the results table inside a cell of another table, and in that same row they added a 2nd cell with 0 height (WTF?) and 100% width (WTF!). The 100% width squishes everything in the first cell to as little width as possible.

JavaScript to the rescue:


    <script type="text/javascript">
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}

function checkEmptyCells() {
var all = document.getElementById("<%=rvReport.ClientID%>").all ? document.getElementById("<%=rvReport.ClientID%>").all : document.getElementById("<%=rvReport.ClientID%>").getElementsByTagName('*');
for (var i = 0; i < all.length; i++) {
if (all[i].tagName == "TD" && all[i].width == "100%" && all[i].height == "0" && all[i].innerHTML == "") {
all[i].width = "1px";
}
}
}

addLoadEvent(checkEmptyCells);
</script>


The first function is simply a function that updates the window.onload event, so that even if you already have an onload event you don't have to mess with that code.

The second function checks for the offending empty TD, and reduces its width to 1 pixel. Change rvReport to whatever the ID of your ReportViewer control is. Take that, empty cell!

Finally, we call the addLoadEvent with our handy checkEmptyCells function. What will happen is the browser will wait until everything is loaded and then execute the script.

If the checkEmptyCells function looks familiar, it should... I borrowed this from my own code. Remember me getting rid of the red X's on OSMusic.Net? I used the checkImages function for that. The code is very similar, but instead of checking for unloaded images and hiding them, we're checking for bloated empty cells and thinning them.

Leave it to Microsoft to figure out how to screw up nested tables. Leave it to JavaScript to be able to provide a quick, easy fix.

Labels:

Monday, July 21, 2008
Ajax Security & User Friendliness
Posted: 6:25:00 PM 0 comments
Currently, I am going through the Six Minutes To Release website and making all sorts of updates and changes to the input interface. Basically, I've decided that UpdatePanels are far too slow for my needs on pages where user interaction is heavy, and I decided to instead go with implementing the ICallbackEventHandler.

I think I discussed Ajax security a while back and came to the conclusion then that it wasn't ready for prime time. Since then, I've been doing a lot of reading up on the subject, and have found that ICallbackEventHandler provides a way to keep page state through your Ajax calls, thus resulting in the important things that I have stored on the server controlable by me, such as whether or not the user is logged in and so on. The added bonus is that I can update the page through JavaScript and THEN send the data to the server to update the database. The result is an instant update as soon as you click on something, and it's very nice.

Now, in reality, things aren't instant, but the user doesn't have to know that. This is also only really useful for non-critical functions... I wouldn't trust any account information with this method. However, signing up for raids, having a raid leader change a raider's raiding status, things that aren't going to make or break the site... these are acceptable to me to use this "instant update" method.

And the main reason I did this was to improve the slow method of using UpdatePanel. I like UpdatePanel for one-time deals, like submitting a form, but when you're using the page's controls over and over again, UpdatePanel is too slow for my taste, and Solitha found that the page kind of sucks to have to wait to update something, wait a second or two, update again, wait, update, and so on. User friendliness is something I know I need to work on with my web sites, and using Six Minutes To Release as a learning ground for this is going to help me in that department a lot. I look forward to being able to use stuff like this.

Labels:

Friday, June 13, 2008
Five months later...
Posted: 6:28:00 PM 0 comments
I don't know if I just get carried away, overestimate my ability, or underestimate my availability. In any case, I finally was able to scratch off Ticket #80 from my projects... about five months later than planned.

This is very annoying to me. It should not take me five months to put one section of a relatively simple website together.

Okay, so it's not so simple. I threw a lot of bells and whistles in, yes, but in the end the code behind it is easy. What the heck took me five months to complete it?

In any case, I'm rather proud of my work at the moment, and invite you to visit Six Minutes To Release and check out the Raids section for the calendar, groups, and all sorts of other WoW-related hoopla that I could throw into it.

Maybe I did get carried away.

Labels:

Friday, June 06, 2008
Unlikely birthday present
Posted: 11:10:00 AM 0 comments
So yesterday was the 10th anniversary of my 21st birthday, and I got quite an unusual birthday present.

Mind you, it wasn't intentionally a present, but Backup sold its first copy on roncli Productions. It was quite a mess. The PayPal return was hitting the wrong page, the website is full of bugs, and nothing seemed to work right. I spent an hour last night fixing everything, and there's probably a lot more work that needs to be done. I can only hope that the software actually works, and this guy isn't trying to use it on Vista.

Labels:

Friday, March 14, 2008
Audiosurf and TraxSurf
Posted: 4:25:00 AM 0 comments
Check out Audiosurf when you get a free moment. It's a game that takes your MP3 music and makes "tracks" out of them that you "surf". There are various modes, but the most common is a match three puzzler where you have to pick up the right blocks at the right time to score the most points.

It's really fun. Especially for those who make music!

I've had a blast running my songs through Audiosurf, especially Cent Main Theme and Deadly Drums: Extended Mix, both of which are pretty difficult for me. You can also run other people's songs through it, and it gave me an idea...

That idea is TraxSurf. Since I already listen to all of the songs on Trax in Space, I should be able to pick out 5 songs every week that can be used towards a weekly Audiosurf competition. So I started coding it, and a lot of that code is already on the SVN. It shouldn't be too long before I have a completed web site, but as with all of my own projects lately, it seems to be taking a longer than expected to finish.

In any case, this is going to be a fun side project to work with, and hopefully it will pick up steam when it's released. I'm looking forward to it.

Labels:

Monday, February 25, 2008
Projects now on IIS, SVN available
Posted: 2:25:00 PM 0 comments
The projects website is now live on my IIS server. I had to fix some problems with the CGI, but once I resolved those it worked just fine. The nice thing about this fix is that it allows me to create other tracs across my server.

I've also made my SVN repository accessable at svn://svn.roncli.com/ronclipro. Currently I have my World of Warcraft Grid modules available along with the initial tests for my Space addon collection. I also added my first attempt at an IRC Bot for Outpost Music, and my ever so simplistic IsItUp application. Both of these I'd like to develop at some point, but it's not something I plan on prioritizing any time soon.

The biggest addition to the repository was the source code to the D3TL, the Descent 3 Teams League website. I haven't touched the code in years, and figured that the best place for it would be out in the open, in case anyone wanted to do something with it.

More stuff will be added as time and energy allows.

Labels:

Friday, January 11, 2008
Six Minutes To Release forums
Posted: 5:27:00 PM 0 comments
I have just finished up what was a relative breeze of coding, the Six Minutes To Release forums. My major stopping point was the fact that I didn't really want to have two instances of the paging control - the control that shows you the pages available in a list of, say, threads or posts - and I spent a real long time trying to figure out how to template it.

I fell quite short and decided that it was just going to be easier to put the control on the page twice. Not a big deal, but it would have been nice to be able to do things easier. I did learn a lot about control templates and such along the way, so it wasn't a total loss.

But everything else was smooth. There were annoying, bite-sized bugs that I had to squish, but that's normal with most code. I still contend that XAML is one of the easiest languages I've ever had to work with, and I've only been working with it for two months or so at the most.

Anyway, if you're a World of Warcraft nut, hop on over to the Six Minutes website and check us out. The site's starting to fill out!

Labels:

Monday, December 10, 2007
Databinding to a XAML FlowDocument
Posted: 11:25:00 PM 0 comments
I couldn't find a full example of this, I had to put bits and pieces together before I got this working.

Let's say you have a datasource, and in that datasource, one of the datamembers is a string that contains some FlowDocument XAML. For example:

<Section xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Paragraph>This is a test.</Paragraph>
</Section>

Unfortunately, there's no way to directly bind a string to a FlowDocument object. However, XAML databinding allows the use of custom converters that allows you to take that string and convert it to whatever you like. To do this, create a class:

Namespace Converters
 
<ValueConversion(GetType(Object), GetType(FlowDocument))> Public Class FlowDocumentConverter
Implements IValueConverter
 
Public Function Convert(ByVal objValue As Object, ByVal tTarget As Type, ByVal objParam As Object, _
ByVal ciCulture As CultureInfo) As Object Implements IValueConverter.Convert
Using msDocument As New MemoryStream((New ASCIIEncoding).GetBytes(CStr(objValue)))
Dim fdDocument As New FlowDocument()
Dim trDocument As New TextRange(fdDocument.ContentStart, fdDocument.ContentEnd)
trDocument.Load(msDocument, DataFormats.Xaml)
trDocument = Nothing
Return fdDocument
End Using
End Function
 
Public Function ConvertBack(ByVal objValue As Object, ByVal tTarget As Type, ByVal objParam As Object, _
ByVal ciCulture As CultureInfo) As Object Implements IValueConverter.ConvertBack
Return Nothing 'Not interested in converting back from a FlowDocument to a String
End Function
 
End Class
 
End Namespace

Now add your xmlns to the page/usercontrol/window/whatever...

<Page ... xmlns:converters="clr-namespace:Converters" ... >

Create yourself some resources...

<Page.Resources>
<converter:FlowDocumentConverter x:Key="FlowDocumentConverter" />
</Page.Resources>

And bind like so...

<FlowDocumentScrollViewer Document="{Binding PropertyName, Converter={StaticResource FlowDocumentConverter}}" />

Just replace "PropertyName" with the name of the property or column that has the XAML FlowDocument string you wish to use.

It's a little counter-intuitive, it would be nice if you could just Document="{Binding PropertyName}" and be done with it, converting it to a FlowDocument on the fly... but the solution here is easy enough.

Labels:

Friday, December 07, 2007
Programming is fun again
Posted: 5:17:00 PM 0 comments
When I started working with WPF for my Six Minutes To Release website, I had no idea that I was going to have as much fun programming this stuff as I am now.

I don't know why, but I have really picked up the XAML syntax with relative ease. I thought that with a whole new language to learn that this was going to really throw off my productivity.

Well, it took a couple of days to get into the swing of things, but once I picked it up, I've been moving along amazingly fast with the new website. Not only is XAML extremely fast to write once you get the hang of it, the backend coding is a lot more streamlined, because you're not dealing with as much interface crap in the code as you do with ASP or ASP.Net.

WCF is annoying at times, but even that has gotten to the point of "it's easy once you know how". And despite the tiny little quirk I have with LINQ to SQL, that's making database coding so much nicer. I can see myself getting a lot of stuff done in the .NET 3.5 framework.

As for Six Minutes To Release itself, I have finished registration, logins, and editing account information, and tonight expect to be moving on to adding news, coding the about us page, and creating the guild application form. And I have a good feeling this is going to be easy and fun.

After that I get into the more challenging stuff, like creating the raid calendar, coding new forums, and making something I am calling the equipment planner that will allow raid leaders to figure out who gets loot from what. Some of this stuff will actually be interfacing with the World of Warcraft Armory, which serves up XML files for players, guilds, items, and other things. This site is going to be sweet when it's finished.

Labels:

Wednesday, December 05, 2007
More XAML fun
Posted: 6:30:00 PM 0 comments
Today I learned the value of the application.xaml file, which basically details your default values for control properties. The nice thing is that it lets you make controls that behave like a button, but can look like anything you want. So, I made me some nice rounded buttons based on a tutorial I viewed on the web. I also did the same with drop downs, which look real slick.

The biggest problem I've come across, surprisingly, is with LINQ to SQL stuff. All of my sites validate users via email, and the user table has a corresponding property called "Validated". I have a DEFAULT constraint setup to initialize it to FALSE, and when the user validates I change it to TRUE.

The problem I am having stems from the fact that when you insert a record through LINQ to SQL, it has no way of knowing what your DEFAULT constraint is, and thus expects a value. So far, I haven't figured out a way that allows the database to assign the value to this record while at the same time allowing me to later update that record without throwing an exception. The exception? LINQ believes that since you assigned a value at the database, you can't go and change it in code.

Well, that's certainly wrong, so I made a post to Microsoft's forums asking how to handle this. Hopefully that'll be up before I get home, and once that's resolved, the registration and validation process for Six Minutes To Release should finally be complete.

Labels:

Monday, December 03, 2007
WCF and XBAP
Posted: 4:56:00 AM 0 comments
I just concluded a weekend of work that got me, well, nowhere really. I've been working on a XBAP (Xaml Browser APplication) for what's going to be my new World of Warcraft guild, Six Minutes To Release. I will be honest. At first, I had absolutely no clue what I was getting into.

XAML is basically Flash on steroids (AKA the .NET framework). It's cool because you can easily run XAML-based applications on the desktop or through the Internet. Since World of Warcraft is an Internet-based game, the obvious choice was to serve up my app from a website.

So I started playing around. I figured out pretty easily how to make a nice banner that rotates images smoothly. I learned how to add some pretty kick ass looking buttons. I've got a nice system that will dynamically load and unload controls as traditional pages or as dialog boxes.

Then I decided I wanted to connect to a database. Oi.

Since a XBAP can't connect directly to a database, WCF - which I've already played around with for Backup - was the obvious choice. Minor problem, though. WCFs are severely gimped in XBAPs. So, what I thought was a wonderfully built news display that ran perfectly in Visual Studio was nothing more than trash code. Wonderful.

It took hours, probably close to 10 or 12, of research and wrestling with a couple of bugs in Visual Studio before I finally got it working right. What went wrong along the way?

  • The flashy banner that I made randomly decides to not compile. I have to clean and rebuild the solution, and then cross my fingers to hope it doesn't happen again.
  • I didn't realize that return types from WCF's can't be interfaces, because you can't serialize an interface.
  • My service wouldn't run on Ox. Granted, Ox is not a server, but it does have IIS7 and everything you need installed to run a WCF service, except for some reason it was emitting text/xml while WCF clients expect application/soap+xml. Never got that working, I just abandoned it after about 2 hours of research and sent it straight to Understudy.
  • One of the WCF gimps is that you can't use wsHttpBinding unless you have certain things setup which I wasn't about to research. Changing it basicHttpBinding works... except if you have already defined the Service Reference on the client. If you have, it'll keep complaining about wsHttpBinding until you remove the service reference and re-add it.


The good news is that I finally got everything working, and have my first page mostly operational. Even though I've seemingly made no progress this weekend, my knowledge of WCF and XBAP has grown quite a bit, and now all of the pieces are in place for me to take off running with this one. I think I'm going to have a lot of fun with this.

Labels:

Tuesday, November 27, 2007
Backup and Vista
Posted: 5:41:00 PM 0 comments
My FTP backup solution, aptly named Backup, stopped working properly when Kathy and I upgraded to Windows Vista. Unfortunately, there is no way for a Windows service to hook into mouse or keyboard messages for the desktop of the user logged in. This is a problem because now Backup can't tell how long the user has been idle, a key component in determining when to backup files. The .NET 2.0 framework did not provide a reasonable way for me to overcome this hurdle, so the project's sat in limbo for months.

Currently, Backup has 3 modules. First is the Setup module which allows the user to select which files they want to have backed up, and what server to back them up to. Easy enough. Second is the Service module that actually does the backing up. Third is the roncli Productions common module that handles things such as registration and about dialogs.

Since the Service module can no longer handle idle time detection, I have to split that piece out, yet somehow communicate back to the Service module when an application is idle. Windows Communication Foundation to the rescue.

With WCF in the .NET 3.0 (and now 3.5) framework, I am able to easily create messages to send from a client app to a server app. I simply alter the Setup piece to be always running in the background when the user logs on, and tells the Service when the user is idle. Of course, there can be multiple users, so all the users would have to be idle at once, which is no big deal to figure out.

This seems like an awful lot of work to get a service to know when its users are idle, but it'll get the job done, and Backup will finally be Vista-ready.

Labels:

Monday, November 26, 2007
Projects, Take 2
Posted: 5:16:00 PM 0 comments
Just dropping a note that I've finally completed the first phase of the Wiki section of the Projects website, and have added my initial tasks for all of the projects I am currently working on. If you want to check out everything I've got my hands in, run through this site and see what's up.

Labels:

Friday, October 19, 2007
Revisiting Numbers
Posted: 2:18:00 PM 1 comments
Some time ago, I decided to rewrite Numbers from scratch. This is now its 5th implementation, the previous versions written in C64 Basic, Apple QuickBasic, C128 Basic, VB6, and now a combination of VB.Net & C#.Net 2005.

This version, while not yet complete, is playable. My original intent with the game was to learn how to get good performance out of GDI+, and I don't think I did too badly with the game running approximately 60 fps on my work computer. But I knew that GDI+ performance blows, and wanted to do better. So, I downloaded the DirectX SDK, and in my free time over the last few days, created a new option to use DirectX for rendering. After much code crunching, I got a version that performs 5 times as well - that's over 300 fps - than the GDI+ renderer.

Granted, DirectX is overkill for a game as simple as Numbers, but the proof of concept for creating rich 2D games - and even 3D games if I ever bother to learn that much - is now there for the taking.

Still to come is a high score list, a full screen option, and a few tweaks to the game to determine what happens when blocks reach the bottom of the display. Once all that's done, I'll give it the ol' freeware release and take what I've learned along the way to the next project.

My goodness. I might actually finish a project for once. What's the world coming to?

Labels:

Friday, July 20, 2007
Changing app.config on the fly
Posted: 1:35:00 PM 0 comments
After banging my head against the wall several times trying to insert a dynamic ConnectionString into my app.config, I figured it out. It's nowhere near obvious, though. Import System.Configuration to get it functional. Here's an example of how to modify the connectionStrings section.


' Load configuration
Dim cfgConfig As Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)

' Gotta try to remove it first, if it exists you'll crash out.
Try
cfgConfig.ConnectionStrings.ConnectionStrings.Remove("conn")
Catch ex As Exception
End Try

' Add new connection
cfgConfig.ConnectionStrings.ConnectionStrings.Add(new ConnectionString("conn", strConnString, strProvider)

' Save the file
cfgConfig.Save()

' Force the application to refresh this section from the file at runtime.
ConfigurationManager.RefreshSection("connectionStrings")

Labels:

Tuesday, June 05, 2007
Revisiting C++
Posted: 11:45:00 AM 0 comments
I've been playing around with Cent again, and realizing just how awfully coded much of it is. One class is over 5,000 lines of code, ugh. And this is just the game settings!

So I've been spending my time separating out the objects and stringing them together in a more logical fashion. I've literally ripped the insides out of the project and rewired them back together. So far it's been worth it, the code is simpler for me to follow, and with static classes, I've no longer been passing common information from one class to the next endlessly.

The end result, of course, is to make further development easier, and get into the main part of the game, the 3D fun.

Labels:

Thursday, May 03, 2007
Textboxes Galore
Posted: 3:45:00 PM 0 comments


One of the things I am trying to do with OSMusic.Net's ASP.Net update is to make the user experience less of a chore and more fun. As I stated in a previous post, my goal was to load the presentation end with AJAX-like stuff, reserving JavaScript for mundane tasks.

Apparently, textboxes are mundane.

Microsoft provides no real way to manipulate textboxes using ASP.Net and its AJAX extensions. Thus, I had to use nothing but JavaScript to create the flashy addons that OSM's new textboxes are going to provide.

OSM's current textboxes are just unmodified textareas, with the occasional JavaScript to limit the input to a certain size. In some cases, you'd get a half-page long description of how the special codes for formatting text worked. It wasn't very intuitive and didn't get a whole lot of use.

So what I did was make a bunch of small 16x16 buttons, one for each possible tag, and two buttons specifically for the mass of smilies OSM uses. When a user clicks on a button that doesn't require anything, such as bold text, it adds a [b][/b] to the textbox, with the cursor in the middle so you can begin typing right away. If you have text highlighted, it puts the [b] in front and the [/b] at the end of the selection, so you don't have to place anything. You also get a reminder as to what the syntax is, so that if you want to type it in yourself, you can.

The other tags are a bit different. Instead of immediately inserting anything, you have to provide some information. In the case of an image, you need the URL and the alignment - left, right, or none - it will have on the page. When you click the Insert button, you get a properly constructed [img] tag at the cursor. Colors are similar, you get sliders for red, green, and blue, and the syntax updates with the color you've selected, along with a preview of what the color actually looks like.

There are two smiley pages. You just point your cursor in the box where you want to add it, click one of the two smiley page buttons, and select a smiley from the box below. No need to remember what the difference between :cheesy: and :laugh:, just select the one you want visually.

It's all packed into a control and three JavaScript source files that manage all of the textboxes on a page. I'm quite happy with how it turned out, and look forward to actually being able to use it. There's not too many sites out there that allow for such easy adding of markup text.

Labels:

Thursday, April 26, 2007
Two Point Oh
Posted: 4:18:00 PM 0 comments
I've been working on a particular music website lately, rewriting it in a different language. The goal is to bring musicians back to a quality, feature-rich site.

No, I'm not working on Trax in Space 2.0, despite the rumors I'm sure are surfacing.

It is OSMusic.Net I am tuning up, moving it into ASP.Net. I haven't had a whole lot of success making a real website with ASP.Net yet, but I've got plenty of experience from working on .Net at work that makes me feel far more comfortable than I did about 6 months ago.

So what's the new OSMusic.Net going to feature? Lots of AJAX, if you can believe that. While I'm still dead set against the security that AJAX offers, I still believe that it can be useful for presentation, and I plan to put a lot into the presentation aspect of OSM. Microsoft has come out with a fairly polished set of AJAX controls for ASP.Net that are really easy to use, keeping ugly JavaScript out of my code. Granted, I'm still going to use it for things like localizing a user's time and removing dead links from a page, but that's nicely tucked away into its own file, and won't be changing from the ASP version to the ASP.Net version.

What else will be new? Well, I have some plans for some new features that will make the user experience more personable, including friends lists, favorite songs, and more. Also, the collaboration features I've been wanting to work on for so long will be added to this version. There will also be a new look, along with the possibility to easily change that look, should someone come with a design that looks better than designs I come up with.

Other projects... well, I'm just not up for coding much else lately. I put a lot of thought into Cent, but never go back to the code, partly because of the time it would take to set up a CrystalSpace environment on my main computer, and partly because of the fact it's in C++, which is a language that just doesn't excite me. Hopefully some day I'll get that drive back that I had going good for a while last year.

Labels:

Monday, April 09, 2007
Extending ASP.Net Controls with Child Controls
Posted: 3:07:00 PM 0 comments
If you've ever tried to extend an ASP.Net control that has child controls in a custom control sitting in your App_Code directory, then you know the frustration of the lack of Intellisense for those child controls. When you try to enter the correct control that should go inside your child control, you get an error saying "Element 'TableRow' is not a known element. This can occur if there is a compilation error in the Web site.

Of course, when you compile and view the page in your browser, everything is okay. What is making Visual Studio find these seemingly phantom errors?

The reason is because you are using different assemblies. When ASP.Net compiles your custom control in the App_Code directory, it puts it in its own assembly. This assembly, of course, is different from the assembly the child controls are in. Since you have not defined any child controls in your custom control, Intellisense has no idea that something can go inside that tag, and likewise the dynamic compiler will throw up errors.

You don't want to reinvent the wheel, however, by recreating those child elements. The solution? Inheritence.

Let's take an ASP Table control for example, since that's the one I've been working on for the past few days. What I wanted to do was to create a sort of wrapper around the table so that all my tables would have the same graphics without having to put the same code over and over in my .aspx files. I also added a title property, and thought about future development where I might want to create various themes for the site. This all can be done easily in a custom control.

Now, the basic child elements of the Table control are the TableRow and TableCell elements. In order to be able to use them, I must extend them in the same assembly as my Table control. Here's what I've done.


Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports Microsoft.VisualBasic

Namespace MyControls

Public Class MyTable
Inherits Table

Private strTitle As String

Public Property Title() As String
Get
Return strTitle
End Get
Set(ByVal value As String)
strTitle = value
End Set
End Property

Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
'Do your custom writing here!
writer.Write(strTitle)
'Do your custom writing here!
MyBase.Render(writer)
'Do your custom writing here!
End Sub

End Class

Public Class MyTableRow
Inherits TableRow
End Class

Public Class MyTableCell
Inherits TableCell
End Class

End Namespace


Note that the classes for the child elements are otherwise empty. They simply inherit from the parent and that's it. Since the Table control is looking to have a TableRow inside of it, and MyTableRow inherits from TableRow, you can now use MyTableRow and Intellisense will pick it up. Same for MyTableCell. What's the .aspx look like? Load up a quick page, and put this after the Master, Page, or Control directive:


<%@ Register Namespace="MyControls" TagPrefix="mc" %>


After that, throw this anywhere in the body:


<mc:MyTable ID="tblTest" runat="server" Title="Testing MyTable" Width="100%">
<mc:MyTableRow BackColor="Yellow">
<mc:MyTableCell HorizontalAlign="Center">
This table is working!
</mc:MyTableCell>
</mc:MyTableRow>
</mc:MyTable>


You will notice that not only do you get Intellisense for the child elements and their attributes, you also get no more errors!

Labels:

Thursday, March 01, 2007
.Net Fun
Posted: 4:54:00 PM 0 comments
Well, it's been 90 days at the new job, and I must say I've learned a lot about what .Net can do. Now, I've been playing around with .Net for a while, but what they do here at work has me excited about .Net again. The ability to work with a class that is based on a row in a database is something that I just was never able to figure out on my own. I'm so used to datasets and queries, this new way of working with data almost makes coding fun.

I haven't been doing too much coding in my spare time, though, as I really haven't had any motivation to get stuff done. I want to get back into Cent again, as I really think that has some potential, especially with CrystalSpace becoming a fully mature 3D engine. I also have my various web projects that have been on hold for many months, and OSMusic.Net is really something I don't want to end up ignoring.

But the problem for me is that I haven't really seen the proverbial light at the end of the tunnel. A finished product (or in OSMusic.Net's case, vastly improved product) isn't materializing in my head, so I feel no immediate reason to work on it. I haven't really coded much in my free time since the third quarter of last year, it's something that I hope doesn't get away from me for much longer.

Labels:

Tuesday, October 31, 2006
ASP.Net v. PHP
Posted: 12:30:00 PM 0 comments
Last night, I was presented with a challenge, or what I consider to be a challenge anyway. The question was raised as to whether or not large websites that have hundreds of thousands to millions of users will scale better in Windows/IIS/MySQL/ASP.Net or Linux/Apache/MySQL/PHP.

Scalability is, in essence, the ability for a solution to still apply to a problem even when the problem is very large. There are piles and piles of articles on how to scale both ASP.Net and PHP, so to me, scalability itself is not an issue.

Performance, however, is directly linked to scalability, because if you have poor performance on a website, you'll be eating up cash throwing hardware at your setup. You have to have good performance, or else you'll end up in trouble.

So this really brings the question down to which performs better, ASP.Net or PHP? It's a question I don't know the answer to, because I don't know a thing when it comes to PHP. Analysis on the web is often biased, and must be taken with a grain of salt.

Thus the challenge in my mind: prove beyond a doubt that one platform is going to be better than the other. Needless to say that is what I'm going to be spending my upcoming days doing. It'll be interesting to see which platform wins.

Labels:

Sunday, July 16, 2006
Next phase of Cent is close
Posted: 3:10:00 AM 0 comments
I have nearly finished the controller setup in Cent, fixing everything that I've found broke along the way. There's still some weird happenings, including a problem with joystick buttons not firing correctly, but that's something that the API needs to sort out, and the CrystalSpace people have been alerted to the problem.

On my end, though, creating a controller setup is finally complete. I want to do a better job with the controller profile selection screen than I had originally planned on, so I'm going to take some time tomorrow to do that. Hopefully, by day's end, I'll be as far as filling out the macro section, which also needs an overhaul. I've decided to allow for twelve macros each (text and audio), but the page only allowed for eight, so that's a redesign right there. Shouldn't be too bad, though.

Once I'm done with that, I can start working on the actual game engine, and hopefully get a chance to do some flying around. Before you know it, I'm going to need 3D models... Yikes.

Labels:

Friday, July 14, 2006
Cent Satisfaction
Posted: 12:47:00 AM 0 comments
I decided over the past weekend that I was getting burnt out, so I decided to push back any work on projects until either Sunday or Monday. That means I get to work on what I want to in the meantime.

So, my project of choice has been Cent. Since it has been so long since I worked in CrystalSpace, I had to redo the event handlers and sound system so that they conformed to the new APIs. After that, I decided to play around a bit and add a preloader, because I absolutely hated the skipping I'd get between game states. The preloader turned out nice, though there was a lot of C++ frustration along the way. I ended up having to completely change the way I handle headers, taking any out of the .h files and putting them all into .cpp files. I also found that because I was referencing enums from one class in another and vice versa, I actually had to move one out so that it would compile right. It seemed really bad at first, as I was getting hundreds of errors, but after a bit of looking around I finally got it working right.

If I decide to continue working on Cent into the weekend, I'll actually be ready to hit new development, which will mean fixing the bits of the control screens I left out, and finishing up the settings editor. Where do I go from there? I'm not sure just yet, and I may have to sit down and actually chart the progress of the application from here on out, which should be interesting.

Labels:

Monday, June 26, 2006
roncli Productions is live
Posted: 9:51:00 PM 0 comments
It's finally done! roncli Productions is complete and live. Backup and Due Process, two pieces of software I've been talking about for many months, are now available for download. I'm quite excited about it, and look forward to see how people use the software and what kind of suggestions they will come up with.

I've yet to submit the software to various download sites, but hopefully I'll be able to wrap that up tonight, so I can concentrate on other things, like providing a blow-by-blow account of Melbourne and Surfers, quote, "Paradise", unquote.

Enjoy the site.

Labels:

Wednesday, June 14, 2006
More work!
Posted: 11:40:00 PM 0 comments
Does the catching up ever end? More questions than answers today, it seems.

Despite doing extra work, I slacked again on the weekend and have forced myself into catchup mode. Right now, I'm an estimated 14 hours of work behind, with STILL most of it being in the Pwned Print category. There's no way in hell I'm getting that done by Australia like I had hoped. The good news is that the 14 hours are spread across 3 tasks, one of them being a 2 hour progress review, so I'm really hoping my time estimations are on the high side.

What I am going to get done for sure is the roncli Productions website, with the official launch planned for Monday, June 26th. Backup and Due Process will be the site's first two offerings, with a new project, Sitemap Generator on the way.

Yes, I decided to write my own, simply because I can't be bothered with adapting other people's ASP code into something that doesn't time out and kill my web server on my larger sites. In fact, that's going to be a primary feature of Sitemap Generator: you can run it on your own webserver and specify a delay between page reads so that it won't completely destroy your server. There are also plans to be able to include or exclude specific pages or directories, and I'm hoping I can manage to write a nice scheduler for it, complete with a little taskbar icon in the corner to be able to control the application. It should be a fairly complete application, and I plan for the free trial version to be able to index up to 100 pages, which is perfect for bloggers and smaller personal sites. I'm wondering how I'm going to be able to deal with ASP.Net pages, though, something I may challenge myself to accomplish should it come down to that. It should be a fun app to create.

I've left both Saturday the 17th open (I leave around 7 PM) and Sunday the 25th open (We return Saturday). Hopefully I'll be able to dedicate some of that free time to projects.

But for now, sleep.

Labels:

Aha!
Posted: 9:11:00 PM 0 comments
After another 5 minutes of struggling, I decided to look at Len(strFile). It was equal to 2! Turns out there was a VbCr hanging around on the end I wasn't expecting.

Oh well, fixed now. And I'm not completely losing my mind. Yet.

Labels:

Why does VB.Net hate me today?
Posted: 7:36:00 PM 0 comments


Rather speaks for itself, doesn't it?

Labels:

Thursday, June 08, 2006
Catching up is hard work
Posted: 12:05:00 AM 0 comments
Now playing: roncli, The Nightstalker - Awakening (5:01)

I made the fatal mistake of not doing any projects this weekend - that's 12 blocks of 2 hours each that I had not completed. My reward for this was spending this entire week playing catch up.

As of this writing, I am still behind an estimated 16 hours, most of it residing in the PwnedCars category, although I did catch up a good 6 hours on one task today, designing a form I thought was going to be hell to design in a relatively short amount of time. I also ran into a stumbling block when working on the roncli Productions forums, not being able to use the DataGrid at a rate of speed I'm accustomed to with classic ASP. But fortunately most of that is out of the way, the only things I am behind on is making a search page for the support section (I'm having an issue with Google AdSense for Search on that one) and forum subscriptions, which I'm not terribly looking forward to.

The good news is that I went ahead and scheduled the rest of the week, leaving nothing but simple-to-accomplish tasks to do through Saturday. Hopefully this will string enough time together to get some of the major tasks I have out of the way. roncli Productions is almost done, although I am having trouble with the Backup software not deleting things again, so I may have to work on that before I officially open roncli Productions for business. Oh, and there's that PayPal thing I keep avoiding...

OSMusic.Net has actually had some excellent progress on the minor changes I've been wanting to make, and hopefully completing the next big thing won't be too far behind. Finally, I am hoping to give Outpost Music the forums that have been largely absent for a couple of months now sometime early next week.

Things are beginning to look up as various projects come to completion, and even though I am behind further than I'd like to be, progress is always a good thing, no matter how slow it may feel.

Labels:

Tuesday, June 06, 2006
JavaScript Red X remover
Posted: 6:57:00 PM 0 comments
After a bit of frustration at the front page of OSMusic.Net having red X images, I decided to write something that will check for bad and broken images and remove them altogether from the display. It's a drity hack, but it works rather well.


function checkImages() {
var all = document.all ? document.all : document.getElementsByTagName('*');
for (var i = 0; i < all.length; i++)
{
if (all[i].tagName == "IMG")
{
if (all[i].complete == false)
{
all[i].style.visibility = "hidden";
all[i].style.display = "none";
}
}
}
}

<body onload="checkImages();">

Labels:

Tuesday, May 30, 2006
The Long Weekend
Posted: 2:13:00 AM 0 comments
Well, the long Memorial Day weekend has come to a close, and to be honest, I have amazed myself with how much I got done. I found the bug with Backup that causes it to run at 100% CPU until you kill it and squished it. That allowed me to repackage and finalize the MSI that will be distributed once roncli Productions comes online. I've also found the bug in Due Process that causes it to tell Windows it didn't startup properly when, in fact, it did. I still have one more feature I want to add to Due Process before I finalize its MSI, which is the ability to never allow a process to run (&%*#% ctfmon.exe!). That shouldn't take terribly long.

On the website front, the forums are slowly moving along, I anticipate 12 hours worth of work remaining before they are online. However, once that's done, I have at least two sites I can port them to, including Outpost Music, something I plan on doing before I leave for vacation.

The problem is that Pwned Print is slipping further than I had wanted it to. I've been quite ignoring this big 8 hour task for the simple fact that it's... well, 8 hours. And overdue. I want to sit down and at least start it at some point, maybe I'll do it tomorrow after work or something.

Overall, I've managed to not slip further behind in my projects than I was a week ago this time, and I'm more optimistic than ever that I can follow these projects for some time to come.

Labels:

Monday, May 29, 2006
So Much To Do
Posted: 3:15:00 AM 0 comments
I did some research as to where I stand for four other projects today... holy crap, do I have a lot to do on so many things. I'm trying to take it one project at a time. I see the light on Backup and Due Process, as all that needs to be done for them is to fix bugs and make the final package. But the roncli Productions website is just going to take forever.

I got some good work done on the forums today, but I got a late start and didn't get as far as I had hoped. Most of that stems from the complexities that exist in my classic ASP forums code. Translating it over to ASP.Net 2.0 is going to be interesting.

I also decided to add the bug fixes necessary for OSMusic.Net into the projects, and hopefully I'll slowly get to those. I'm surprised, after 5 months of nothingness, 8 songs have been added to the site within the past two weeks. I don't know if it's going to become a more active site as a result, but the activity is quite welcome.

I took a good look at Outpost Music, and decided that, when the time comes, I'll simply copy the forum system from roncli Productions into Outpost. In the meantime, there's some additions I want to make to the site to make it more functional for me and the other members of the group.

Finally, I looked at The Nightstalker page, where my music is supposed to go. I decided that I'm going to add all of my current releases there, and eventually I'll go back and add my old tracked releases as well. Maybe some day I'll convert them to Reason, but each song is a project in and of itself - I can see that taking years.

There is no shortage of work for me to do, I have stuff planned out to July 1st, and some of that work is set aside to plan out future work. There's so much to do, and I wish I had more hours in the day to do it with.

Labels:

Tuesday, May 23, 2006
Still Catching Up
Posted: 11:58:00 PM 0 comments
After falling behind badly in the first week of my committment to do 2 projects a night, I feel I'm making a lot of progress. That's good, I didn't want to have to scrap the idea entirely and end up with nothing ever getting done.

The progress for Pwned Print is finally coming along nicely with all but one of the 5 tasks I had scheduled for last week being finished. Yesterday, I cleaned up my desktop and my god does it look empty. But it looks really nice and gives me a lot of space to work with. I was able to review my progress on roncli Productions and scope out another week or two's worth of work in it. I've also been able to figure out what I need to do with Backup, and after this I'll probably do the same for Due Process.

Tonight, after doing a little bit of Pwned Print, I finally sat down and figured out how to backup files in SQL Server 2005, and went a step further by scheduling monthly maintenance on the indexes and database size. Then I dove into Linux, compiled and installed BOINC, SETI@Home, and Einstein@Home (not in the plans, but remarkably easy to do), and wrestled with getting that to run. After a bit of a scare (yes, you CAN accidentally type in rm /*/*), everything was running smoothly.

The three things from last week I still haven't done is correcting the NATd and IPFW configuration for Reborn, a single form for Pwned Print, and review what's left to do for Due Process, which I should get to before I head to bed. All in all, a pretty full Monday and Tuesday, and I'm finally making some real progress on these projects.

Labels:

Catching Up
Posted: 12:07:00 AM 0 comments
Well, on Sunday I managed to finish up the stuff I was working on for the upcoming roncli Productions website. I had a few frustrations with ASP.Net again (as usual), but got by them after a while. I look forward to designing the rest of the sight.

However, I got nothing else done on Sunday, as most of the day was dedicated to fixing my damn NAT. I don't know what I'm doing wrong, the ipfw.rules and natd.config look right, and most things work. However, I can't figure out how to open up ports like I was able to before I last formatted the machine. It will be an open issue for a while.

In the meantime, today I got quite a bit done, including specing out the rest of what will be needed for roncli Productions. I will be, for the second time, writing forums in ASP.Net. This time I won't be building the HTML as I go, I'll actually be using the contrals as they were meant to be used.

I also got two completed forms for Pwned Cars, speced out the rest of what's needed for Backup 2.0, and even got some time to play with BONIC on Linux, as I'm wanting to get SETI@Home running over there. What I had speced out to be 10 hours took me 4 at best.

All this while spending an hour playing tennis after work... and man am I sore. Good thing it's time to sleep, I need it.

Labels:

Sunday, May 21, 2006
Not going well
Posted: 1:35:00 PM 0 comments
Seems the projects aren't going as well as planned.

The messaging system in roncli Productions is nearly complete, though. I did finally get some time to work on that last night, despite wanting it done on Wednesday. However, it's not 100% complete. Further, I never got a chance to fix the NATd and IPFW support on Reborn, and absolutely no progress has been made on Pwned Cars. I also wanted to clean up my desktop and compile and install SETI@Home for both the Reborn and ModPlug servers so that could be running in its idle CPU time. I doubt I'll get to backing up the SQL Server on roncli.com any time soon.

Fortunately, Sunday is a long day, and I've got a lot of time to do a lot of things, and I'm in a good working mood. Let's see what can get done!

Labels:

Thursday, May 18, 2006
Another Long Night
Posted: 1:15:00 AM 0 comments
I knew the night was going to get off to a bad start when I didn't even get sat down in front of the computer until 7 o'clock. It wasn't for a bad reason, though. Saurin called, discussing some possible projects (as if I don't have enough, see last night's post for details on that) that might be on the horizon if I'm interested.

But despite chatting for about a half an hour after work, I decided to open up Pwned Print to play around with the interface. I open Visual Studio.Net, and it opens up a few code screens. Then it tries to open a designer and dies.

Uh oh.

I spent the next half hour trying to figure out what the hell was wrong with my computer. I did a chkdsk on the hard drive that contains the source code, as that drive was known to be bad at one point (don't worry, all the code is in Source Safe and backed up twice onto Reborn), and it returned fine. I had serious thoughts of starting on that reinstallation I've been toying with before I had an idea. I opened up BOINC and suspended it. As soon as I did that, everything worked perfectly. What the heck is going on between Visual Studio and a BOINC application that causes Visual Studio to lock up? I hate it when applications don't play nice with others.

No problem, 7:30 rolls around and Kathy's up and about. I get started playing around in the code and my personal BlackBerry goes off. There's email that I have to attend to, and by the time I finish up with that, it's 11. I work another half hour, then Kathy messages me because she has no money to get any food, so I had to feed her.

12:30, I sit down for the last time, and after another half hour of work and I've at least got half of my daily goal done. Seems to be my standard since starting these projects, I can't get more done than half of what I expected to.

I was supposed to work on the roncli Productions site launch, but never got close to touching it. Here it is almost quarter after one, and quite frankly, after being up for 18 hours, I'm more than ready for bed.

Labels:

Wednesday, May 17, 2006
Projects!
Posted: 1:59:00 AM 0 comments
I decided to jump into Microsoft Project to organize my list of projects. My god, do I have a lot of projects. Not counting weekly tasks, I have 27 projects. Twenty-seven. When am I going to find time to do them all?

I suppose that's what Project is for, finding the time to do them all. It's not very encouraging at first glance, but when I glaze over the details, things do move along, if slowly. I doubt I'll ever complete all 27 projects, though, as certain projects, such as the D3TL 2003 upgrade (yes, I know it's 2006), D3DSN, and MediaSmarts probably isn't going to happen. They are the absolute lowest on my priority list right now, although I will at the very least review where these projects stand before June is out.

My goal is to get PwnedCars done before my vacation in June - by the way, I'm leaving for Melbourne, Australia on June 17th - and get some significant progress done on the new roncli Productions website. After that, I've got some long-term projects, including Cent, which I've mentioned here before. Since I've actually had to use C++ at work, I'm a bit more comfortable with the language, and hope that can help me get more done on Cent.

Here's a large (but incomplete, I must have some secrets!) selection of the 27 projects I have, for your interest:

modplug.roncli.com - Where ModPlug used to be hosted before the first crash, this box now holds some websites for MisterX (Kim), and its future is unknown at the moment. It probably will turn into a hosting box for the next modplug.com, but that's up to Kim & LPChip. (By the way, modplug.roncli.com technically isn't an address, it's just my designation for the computer itself.)

reborn.roncli.com - Reborn is my router, running FreeBSD 6.1 just like the ModPlug box. It's also my network's backup server with 300 GB of storage space. It backs up everything, including my MAME collection, OSMusic.Net, and all of the photo's Kathy's got stored on her computer.

successor.roncli.com - This is my main computer, and the reason it's a project is because I want to reinstall Windows. Yeah. That's going to be a fun day or three.

www.roncli.com - This is the Windows server where all my ASP websites live. The only thing I need to do is figure out how to backup the databases so that Backup can pick them up and put them onto Reborn.

Outpost Music - My music group that I haven't really done much with in a year and a half. Well, it's high time I got the forums working. I'll likely work on that after vacation.

The Nightstalker - Not to be confused with http://www.roncli.com, http://tns.roncli.com is solely devoted to my music. However, there's only 2 songs listed there right now. Considering I've released over 50, that's got to change.

Chess - Not sure what to call this yet, but I'm really interested in making a site with Java that will allow people to solve chess puzzles, play games, chat, and more. Definitely a long termer.

Cent - I really haven't come out and said what this is, but it's my dabbling into CrystalSpace to see if I can write a legitimate 3D first person shooter. It uses Crystal Space as its rendering engine, so once I understand it - and I understand a lot of it right now - writing the necessary code should just be a matter of time. How far I go with it depends on how well it runs.

Solar - Solar is a TCP/IP Text Processing Engine. I can hear it now. Huh? Basically, it is a telnet server that allows multiple connections, allowing them to interact. It would be great groundwork for a MUD-type application, but I really haven't had any plans to do anything with it. Putting it in as a project at least gives me an opportunity to improve it.

ChessCli - This is definitely being called ChessCli, and is my attempt at creating a WinBoard chess engine.

Outpost IRC Bot - Not sure if I even want to continue this project, but it was designed to be a cutthroat one hour compo manager. I had a lot of ideas for this about 4 years ago. Whether I can recall them, well, who knows.

roncli.com Logs - I'd really like to expand http://logs.roncli.com, as I'm recording a lot more information than I'm displaying. I'd also like to work on the performance and get this thing smoking along.

Torrent Keeper - Frustrated with the lack of true multithreading BitTorrent applications, I started Torrent Keeper about a year ago. It hasn't gone anywhere, but I figure this will likely follow Backup and Due Process as one of the first few roncli Productions offerings.

Word Field - A silly idea of mine that I'd like to follow through on eventually. Combine word scramble, mine sweeper, and some aspects of Press Your Luck, and you've got a good idea what this game will be like.

D3TL 2003 - As mentioned above, I started to do an upgrade of D3TL in 2003. The database was really badly designed, even though it was much better than just updating a Flash file every now and again. Problem is, I don't play Descent anymore, and given that there hasn't been a real game played in months, I might be better off saving an idea like this for Cent if I ever finish it.

D3DSN - This is the Descent 3 Dedicated Server Network. Yes, it's still up. No one uses it though, because the software's buggy. When I went from Visual Basic 6.0 to .NET, I really messed up with some timing issues. What I really need to do is add true threading to that application, but the last time I tried to test it with Esa, I ended up giving up because he wasn't seeing the new web services for some reason or another. Again, if I ever pick this up, it will probably be for Cent instead.

IsItUp - Recall September of last year when I high-tailed up to Lubbock, TX, to escape Hurrican Rita. While I was up there, I was interested in whether or not my servers were up. So, I wrote IsItUp, an insanely simple app. I might expand it a bit, but probably will end up being released as freeware.

Numbers - Some people write "Hello World". I write Numbers. I've written this game in many languages, including TI99-4 Basic, Macintosh QuickBasic (OS 7.0 days!), C128 Basic (dual screen!), and finally Visual Basic 6.0. It's a rather addicting game, and over the years I've added some features to it that make it even more challenging. I want to do something with it, I just don't know what yet.

roncli.com Blog - Yes, the very same one you are reading! I'd like to add some things to the blog, maybe my BOINC stats, maybe my Google Calendar agenda, perhaps some other widgets that will make the site more interactive.

Labels:

Wednesday, February 22, 2006
Due Process Close
Posted: 2:40:00 AM 0 comments
Now playing: Korn - Twisted Transistor (2:58)

Actually, Due Process is done! I have it happily running on my workstation and my computer with no problems. I am very pleased with how it turned out.

The reason you don't have a copy of it yet is because I'm working on the website that's going to promote this and other pieces of software I'll be spitting out over the course of time. Backup is going to be the next offering, which is a copy of my FTP file backup service. After that, I'm open to pretty much anything. Who knows, I might even get back to Cent.

Labels:

ASP.Net DataGrid
Posted: 2:33:00 AM 0 comments
Now playing: Korn - Twisted Transistor (2:58)

A while ago, I had resigned myself to the fact that I would have to custom-build my own shopping cart for a site I'm working on. Well, I'm sure I could have bought something to do relatively the same thing, but what fun is that for a coder like me?

Anyway, I got to the part where I actually display the items in the cart. I was happily coding along in my usual ASP mindset, adding forms, hidden input tags, and... whoops. That's not going to work, this is ASP.Net. Doh.

So I switched out to a DataGrid. The first thing I figured out is that I have absolutely no idea how to use a DataGrid. The second thing I figured out, and this one took a while, is that the CssClass property of the styles are applied to the table row, and not each table cell. Very annoying, as I ended up creating my own custom class to fix that. Easy enough:

    Public Class DataGrid
Inherits WebControls.DataGrid

Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
MyBase.OnPreRender(e)
For Each dgiItem As DataGridItem In Me.Items
For Each tc As TableCell In dgiItem.Cells
If dgiItem.ItemType = ListItemType.Item Then
tc.CssClass = Me.ItemStyle.CssClass
ElseIf dgiItem.ItemType = ListItemType.AlternatingItem Then
tc.CssClass = Me.AlternatingItemStyle.CssClass
End If
Next
Next
End Sub

End Class


Next came figuring out how to add a title to the grid. If you notice on all of the sites I host, there's a title bar for each table in the content section. Well, there wasn't an easy way to do this. I couldn't figure out how to access the table control that the DataGrid populates, so I ended up just stacking a one-row table on top of it.

Now I had to figure how to put the total of the order in the footer, but there are enough good articles on how to do that, so that didn't take long. Adding a remove button to remove a product someone doesn't want from the cart was fairly easy as well.

The fun came in having to allow them to change the quantity on the fly. That turned out to be more of a project than I was expecting. There were two approaches I was considering, and of course I took the difficult one: using the onblur method of an input tag to populate two hidden fields with the ItemID I want to update the quantity of and the new quantity, as well as activate a hidden button on the form.

Phew! I wasn't expecting so much work out of what would be maybe an hour of work in classic ASP.

Labels: