roncli.com blog
The blog of roncli
roncli.com blog
roncli.com
blog
Profile
roncli
Houston, Texas, United States
Labels
Coding
CTG Music
Editorials
Games
Miscellaneous
Music
Servers
Silliness
Software
Sports
Trax in Space Beta
Weather
Recent Posts
A Tale of Two Communities
The Final Stretch
A Two Tiered, Untiered OTL
Secretly, you wish you could've done what I did
What have I done since roncli.com v2?
It's Done. It's Finally Done.
The Big Picture is Starting to Wear on Me
A Low Bang to Buck Ratio
win-acme
Overload has truth; next it needs balance
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
June 2010
July 2010
August 2010
September 2010
October 2010
November 2010
December 2010
March 2011
June 2011
July 2011
August 2011
September 2011
October 2011
December 2011
January 2012
February 2012
April 2012
July 2012
November 2012
July 2013
April 2014
July 2014
August 2014
November 2014
December 2014
March 2015
April 2015
May 2015
June 2015
July 2015
September 2015
January 2016
February 2016
May 2016
July 2016
November 2016
March 2017
January 2018
May 2018
June 2018
January 2019
January 2021
February 2021
March 2021
August 2021
October 2021
December 2021
August 2022
November 2022
October 2023
February 2024
Current Posts
Wednesday, December 26, 2007
Lesser Computers
Posted: 12:01:00 AM 0 comments
So here I am in Buffalo on vacation for the next week plus, and having to deal with a lesser computer to do stuff from.

To give some background, I brought a bunch of disks and Kathy's laptop with me in hopes of getting some work done on my projects while I wasn't busy. Well, the laptop tends to overheat and shut off in the middle of anything intensive, like installing software. So I decided not to use the laptop for anything important, and have moved to my mom's computer.

Well, first of all I was plesantly surprised to find an Internet connection whose download speeds rivals my home computer's. But that's where the similarities end. This machine is sluggish and, up until today, outdated in terms of updates. The computer didn't even have the .NET framework on it yet, which in this day and age is amazing considering how many applications require it. It's also bloated with "factory installed" software. The CA Internet Security suite is the worst offender, running a half dozen different applications in the background.

What's worse is that this keyboard is terrible, often not letting me type a key more than once every half second, especially the "N", "W" and "L" keys. It sucks because I type over 100 WPM (I just found out the zero key does it too!), and having to slow down for this just irritates me.

But it's what I've got to deal with, all of its 512 MB RAM, until I leave here on January 2nd, so I've got to use it if I want to do anything, I suppose. At least by the time I leave, it will be all up to date, and less bloated than it was before. I think I'll be running a disk defragmenter tonight, and see if that will help as well.

Labels: ,

Sunday, December 23, 2007
Eleven Hours Later...
Posted: 11:45:00 PM 0 comments
Perhaps I spoke too soon. After tons of delays, we finally got a plane to Buffalo, making me 3 hours late. Oi.

Labels: ,

Shuffle Off To Buffalo
Posted: 4:02:00 PM 0 comments
Vacation time! I am currently writing from Houston Intercontinental Airport, enjoying a pizza from Uno Express. Yes, it's that time of year again, time to shuffle off to Buffalo.

Not learning my lesson from the last several years, I'll be staying through to the second of January. So far, I'm thinking it'll be fun, but that usually fades after a few days. Fortunately, I brought Reason, Visual Studio, and enough equipment to setup a network for the laptop at mom's place, so I'll be fairly well connected while I'm gone.

Amazingly, the airport is empty, and I have plenty of time to relax before my flight. No nightmare travel so far, which is great.

So far so good, see ya on the flip side.

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: , , , ,

Sigh of Excitement
Posted: 2:01:00 AM 0 comments
Someday, I'm going to run out of One Hour Compo material to use for my new music.

Anyway, check out Sigh of Excitement, my latest offering to TiS, OSM, CTG, TNS, WTF, and BBQ.

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
The Nightstalker on Inner Space/KFOS
Posted: 1:41:00 PM 0 comments
An old TiS admin, allen one, has created an online radio station for the musicians of Trax in Space and Second Life. The station is called KFOS Inner Space Radio, and can be listened to in Winamp by visiting http://kfos.fast-serv.com and clicking on the "Listen" link at the top, or simply by clicking here.

Four of my songs, Cent Main Theme, Everytime, the classic Fire In My Heart, and my TiS Exclusive Cent Credits, are part of the playlist, as are dozens of other amazing musicians. Also be sure to check out the Inner Space radio show, playing Saturdays at 3 PM Eastern.

Labels: , , , , , , ,

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: , , ,