|
|
Wednesday, December 26, 2007 |
Lesser Computers
Posted: 12:01:00 AM
|
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: Buffalo, Life
|
Sunday, December 23, 2007 |
Eleven Hours Later...
Posted: 11:45:00 PM
|
Perhaps I spoke too soon. After tons of delays, we finally got a plane to Buffalo, making me 3 hours late. Oi. Labels: Buffalo, Life
|
Shuffle Off To Buffalo
Posted: 4:02:00 PM
|
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: Buffalo, Life
|
Monday, December 10, 2007 |
Databinding to a XAML FlowDocument
Posted: 11:25:00 PM
|
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: Coding, Databinding, FlowDocument, VB.NET, XAML
|
Sigh of Excitement
Posted: 2:01:00 AM
|
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: Music, Sigh of Excitement
|
Friday, December 07, 2007 |
Programming is fun again
Posted: 5:17:00 PM
|
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: Coding, Six Minutes To Release
|
Wednesday, December 05, 2007 |
More XAML fun
Posted: 6:30:00 PM
|
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: Coding, Six Minutes To Release
|
Monday, December 03, 2007 |
The Nightstalker on Inner Space/KFOS
Posted: 1:41:00 PM
|
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: allen one, Cent Credits, Cent Main Theme, Everytime, Fire In My Heart, KFOS Inner Space Radio, Music, The Nightstalker
|
WCF and XBAP
Posted: 4:56:00 AM
|
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: Coding, Gaming, Six Minutes To Release, World of Warcraft
|
|