Thursday, December 17, 2009

Textblock Inlines - Accepting Custom Markup As Content

If you've ever used Textblocks in your Silverlight and WPF applications, i'm sure you've initially found some of the same kinds of limitations that i have with formatting the text of the control.

There are built in ways around these limitations. I'm going to show you how to dynamically add content to your silverlight or wpf app's Textblock while giving it formatting specific to your custom markup!

First we'll start by adding content to our XML file!

<?xml version="1.0" encoding="utf-8" ?>
<MyData>
  <MainPageText>
    Sometimes in life, you take a step back and think to yourself <i>"Wow, i really lucked out"</i>. <br /><br />That's how i feel about my girlfriend <b>Ashley</b>. She is amazing and i'm <u>definitely</u> going to ask her to marry me!
  </MainPageText>
</MyData>

I'm not going to cover the loading of the XML into your app, if you need help with that, you can go read my previous blog about Spawning Random Textblocks here.

Now we're going to make ourselves a little method to call from the codebehind
that will use our markup to format the textblock how we want it

public static void Format(TextBlock source, string value)
{    
  List<Run> afterBreaks = new List<Run>();
  foreach (string sp in Regex.Split(value, "<br />"))
  {
    Run beforeBreak = new Run();
    beforeBreak.Text = sp + '\n';
    afterBreaks.Add(beforeBreak);
  }

  List<Run> afterBold = new List<Run>();
  foreach (Run r in afterBreaks)
  {
    foreach (string sp in Regex.Split(r.Text, "</b>"))
    {
      string[] tempBold = Regex.Split(sp, "<b>");
      Run myRun = new Run();
      myRun.Text = tempBold[0];
      afterBold.Add(myrun);
      if (tempBold.Length > 1)
      {
        Run myBoldRun = new Run();
        myBoldRun.Text = tempbold[1];
        myBoldRun.FontWeight = FontWeights.ExtraBold;
        afterbold.Add(myBoldRun);
      }
    }
  }
            
  List<Run> afterItalics = new List<Run>();
  foreach (Run r in afterBold)
  {
    foreach (string sp in Regex.Split(r.Text, "</i>"))
    {
      string[] tempItalics = Regex.Split(sp, "<i>");
      Run myRun = new Run();
      myRun.Text = tempitalics[0];
      myRun.FontWeight = r.FontWeight;
      afterItalics.Add(myRun);
      if (tempitalics.Length > 1)
      {
        Run myItalicRun = new Run();
        myItalicRun.Text = tempItalics[1];
        myItalicRun.FontWeight = r.FontWeight;
        myItalicRun.FontStyle = FontStyles.Italic;
        afterItalics.Add(myItalicRun);
      }
    }
  }
  List<Run> afterUnderline = new List<Run>();
  foreach (Run r in afterItalics)
  {
    foreach (string sp in Regex.Split(r.Text, "</u>"))
    {
      string[] tempUnderline = Regex.Split(sp, "<u>");
      Run myRun = new Run();
      myRun.Text = tempUnderline[0];
      myRun.FontWeight = r.FontWeight;
      myRun.FontStyle = r.FontStyle;
      afterUnderline.Add(myRun);
      if (tempUnderline.Length > 1)
      {
        Run myUnderlinedRun = new Run();
        myUnderlinedRun.Text = tempUnderline[1];
        myUnderlinedRun.FontWeight = r.FontWeight;
        myUnderlinedRun.FontStyle = r.FontStyle;
        myUnderlinedRun.TextDecorations = TextDecorations.Underline;
        afterUnderline.Add(myUnderlinedRun);
      }
    }
  }
  foreach (Run r in afterUnderline) source.Inlines.Add(r);
}

Usage for this is easy, you pass it two parameters, first being the Textblock we are going to put the formatted text into and second being the string of text that has the markup that needs formatting!

Format(textBlock1,myvaluefromXML);

You can modify the function to accept and format more HTML-like values, or just use it as is! I have attached my class file below that you can easily add to your project ready for use!

TextFormatting.cs

Friday, October 23, 2009

Silverlight Eyecandy - Spawning A Random TextBlock

We will cover Storyboard Animations, Loading Data from Dynamic XML Files, and Using the Silverlight Random Class

I will show you how to load a list of words from a dynamic XML file, and display those words on a canvas at random sizes and using random fonts just like the Silverlight application below.




If the above silverlight app does not show up for you, try clicking on the link of the topic, the pathing got screwy with Blogger no longer allowing publishing to ftp.

For this project you will need to Add Reference To System.Xml.Linq


Step 1.
Start by creating a new Silverlight Application project in Visual Studio

Step 2.
Inside your LayoutRoot Grid, create a Canvas & inside that Canvas create a Textblock. Created a Loaded callback for the Canvas. Set Opacity to 0.

<Usercontrol x:Class="CanvasTextblock_EyeCandy.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
  <Grid x:Name="LayoutRoot">
        <Canvas x:Name="canvas1" Background="#303030" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Loaded="Canvas_Loaded" >
            <TextBlock x:Name="textBlock1" Opacity="0" Foreground="WhiteSmoke" />
        </Canvas>
    </Grid>
</UserControl>

Step 3.
Create storyboard in the UserControl resources for fading the Textblock's Opacity in and out using a DoubleAnimation. We'll set To to 0.85, Duration to 3 seconds. Also, set AutoReverse to True and then create a callback for the DoubleAnimation being Completed

Then create 2 more DoubleAnimations to change the Canvas.Top and Canvas.Left attributes of the TextBlock, set their To to 1

Your code should look something like this:
<UserControl x:Class="CanvasTextblock_EyeCandy.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480" >
    <UserControl.Resources>
        <Storyboard x:Name="textBlockFader">
            <DoubleAnimation  Storyboard.TargetName="textBlock1" Storyboard.TargetProperty="(Canvas.Top)" To="1" Duration="00:00:00" x:Name="tbPositionTop" />
            <DoubleAnimation  Storyboard.TargetName="textBlock1" Storyboard.TargetProperty="(Canvas.Left)" To="1" Duration="00:00:00" x:Name="tbPositionLeft" />
            <DoubleAnimation Storyboard.TargetName="textBlock1" Storyboard.TargetProperty="Opacity" To="0.85" AutoReverse="True" Duration="00:00:03" Completed="DoubleAnimation_Completed" />
        </Storyboard>
    </UserControl.Resources>
  <Grid x:Name="LayoutRoot">
        <Canvas x:Name="canvas1" Background="#303030" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Loaded="Canvas_Loaded" >
            <TextBlock x:Name="textBlock1" Opacity="0" Foreground="WhiteSmoke" />
        </Canvas>
    </Grid>
</UserControl>

Step 4.
Now we create the XML file that will store our Words, Fonts, and FontSizes we'll be using for our randomness. You can either use my XML file for your sample or the code below. For my example, if the webpage hosting my silverlight control is at http://domain.com/index.htm then my XML file is going to be in http://domain.com/Data/SmileWords.xml :

<?xml version="1.0" encoding="utf-8" ?>
<Data>
  <Words>
    <Word>Smile</Word>
    <Word>Smirk</Word>
    <Word>Grin</Word>
    <Word>Whiter Teeth</Word>
    <Word>Laugh</Word>
    <Word>Laughter</Word>
    <Word>Happiness</Word>
    <Word>Success</Word>
    <Word>Straight Teeth</Word>
    <Word>Beam</Word>
    <Word>Joy</Word>
    <Word>Joyful</Word>
    <Word>Happy</Word>
    <Word>Shine</Word>
  </Words>
  <Sizes>
    <Size>18</Size>
    <Size>20</Size>
    <Size>24</Size>
    <Size>28</Size>
    <Size>30</Size>
    <Size>32</Size>
    <Size>36</Size>
    <Size>40</Size>
    <Size>44</Size>
    <Size>48</Size>
    <Size>50</Size>
    <Size>54</Size>
    <Size>58</Size>
    <Size>60</Size>
    <Size>66</Size>
    <Size>72</Size>    
  </Sizes>
  <Fonts>
    <Font>Arial</Font>
    <Font>Arial Black</Font>
    <Font>Calibri</Font>
    <Font>Cambria</Font>
    <Font>Cambria Math</Font>
    <Font>Comic Sans MS</Font>
    <Font>Candara</Font>
    <Font>Consolas</Font>
    <Font>Constantia</Font>
    <Font>Corbel</Font>
    <Font>Courier New</Font>
    <Font>Georgia</Font>
    <Font>Tahoma</Font>
    <Font>Times New Roman</Font>
    <Font>Trebuchet MS</Font>
    <Font>Verdana</Font>
  </Fonts>
</Data>

Step 5.
We'll now go to the code-behind. You'll need to add 3 code references that are not added to your project by default:

using System.Xml;
using System.Xml.Linq;
using System.IO;

You'll also want to make 3 List<> declarations to store the values we load from our dynamic XML file and declare an instance of the Silverlight Random class:
List<string> words = new List<string>();
List<string> fontnames = new List<string>();
List<double> fontsizes = new List<double>();
Random myrand = new Random();

Inside the DoubleAnimation_Completed callback we have the code for setting up the next randomization:
private void DoubleAnimation_Completed(object sender, EventArgs e)
{
    textBlock1.Text = words[myrand.Next(0, words.Count - 1)];
    textBlock1.FontFamily = new FontFamily(fontnames[myrand.Next(0, fontnames.Count - 1)]);
    textBlock1.FontSize = fontsizes[myrand.Next(0, fontsizes.Count - 1)];
    tbPositionTop.To = myrand.Next(1, Convert.ToInt32(canvas1.ActualHeight - textBlock1.ActualHeight));
    tbPositionLeft.To = myrand.Next(1, Convert.ToInt32(canvas1.ActualWidth - textBlock1.ActualWidth));
    textBlockFader.Begin();
}

Then in the Loaded function for the Canvas you're going to download the XML file for loading.

private void Canvas_Loaded(object sender, RoutedEventArgs e)
{
    WebClient client = new WebClient();
    client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
    Uri url = new Uri("/Data/SmileWords.xml", UriKind.RelativeOrAbsolute);
    client.DownloadStringAsync(url);
}
In the callback for DownloadStringCompleted:
void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
     StringReader stream = new StringReader(e.Result);
     XmlReader reader = XmlReader.Create(stream);
     XDocument xmlDoc = XDocument.Load(reader);
     words = (from at in xmlDoc.Descendants("Words").Descendants("Word")
              select at.Value.ToString()).ToList();
     fontsizes = (from at in xmlDoc.Descendants("Sizes").Descendants("Size")
              select Convert.ToDouble(at.Value)).ToList();
     fontnames = (from at in xmlDoc.Descendants("Fonts").Descendants("Font")
              select at.Value.ToString()).ToList();
     DoubleAnimation_Completed(null, null);
}


That's it! Your program should now download the XML file upon loading, parse and store the information into memory, and begin the eyecandy!

You can further customize the randomness by giving a seperate Random class for each attribute you're randomizing, and initializing the Random class each with a different seed. You could also add in FontWeights, RenderTransforms, or even import custom Fonts.

The solution for this project can be found here: Silverlight_EC1.zip

Monday, October 12, 2009

Abbreviation And Extension Pronounciation

When you're talking to a friend about a file you sent them, that was created using Microsoft Word, how do you refer to it? Do you say call it a "doc" file? A "dee-oh-see" file? Or a word document?

What about SQL? My co-workers and i held a discussion about which abbreviations and file extensions we pronounce in what ways. I've always said "ess-cue-el" and both of them have always used "sequel". I still disagree with them on which is right for SQL, but we all agree that .xaml files are called "ecksamel", and that .xml is "ex-em-el".

"Did you get that PDF file?"
 Now say the sentence above, but sounding it out as if PDF was a word. "Did you get that pedif file?". If you're not laughing or offended, you didn't say it right. Try again!

Yeah, we're pretty much going straight to hell. But hey, at least we did get a good laugh out of it, saying it over and over. It reminded me of that scene in Zoolander where Ben Stiller says "Uh, no, I don't think you do. Listen. It's not like we think we're actually in a control tower trying to reach outer space aliens or something, okay?" and Owen Wilson says "Hello. Hello." and they were all just kind of giggling. Yeah...that's what we were doing, saying it over and over and just laughing it up.


Here's a list of more abbreviations and how I pronounce them (Want to add to the list? Send me a message!):


.doc      dock
SQL     ess-cue-el
.pdf       pee-dee-eff
.txt        text
.xls        ex-el-ess
CNN    see-en-en
SNL     ess-en-el
.jpg       jay-peg
.bmp     bitmap
.png      ping
.gif        gif
.psd      pee-ess-dee
.exe      e-ex-e
.dll        dee-el-el
.ocx      oh-see-exe
.vox      vox
.cs        see-ess
.vb       vee-bee
LDS     el-dee-ess

Thursday, October 8, 2009

Kaboodle & Twitter Open Job Postings

My sister had made me aware of a job opening at the company she works for, Kaboodle, so i thought i'd pass the information along in case any of you lived in that area or planned on moving out to that area :)

Sr. User Interface Designer
http://hotjobs.yahoo.com/job-JPVA96SVGD4

And also today Al3x, from Twitter, tweeted about a job opening there for Twitter..

Developer Support
http://static.twitter.com/jobvite_frame.html?nl=1&jvi=oWCcVfwp,Job&jvs=AlexTwitter

Sunday, September 27, 2009

The Comcast Police

You're internet seems to be down, but it looks like you'll have no problem getting to our sponsors!

Over the past few years comcast has been involved in many a lawsuit, from class actions regarding traffic blocking, and their man in the middle attacks on their own customers, to individual lawsuits from illegal disclosure of customer's bank & bill information.

All throughout this, i've had only the choice of Comcast or Qwest in my area. Qwest's internet speeds aren't really even comparable to Comcast (yet), but their uptime is much more reliable. Because of comcast's poor uptime, and random blocking of protocols, we have both Comcast and Qwest at my home. When comcast is up, we're using comcast. When it goes down, which is quite often, we hop on our Qwest internet. It's a pretty nice system, except the bandwidth throughput is much smaller for Qwest so we would prefer our Comcast to be more reliable. It's not like we're paying customer's or anything...oh wait we are!

The reason for the "backup" internet wasn't only for convenience, but also because of what a waste of time it is trying to get in touch with their technical support for help. So when my internet went down 2 weeks ago, my first reaction wasn't to call their technical support because i had a backup. When my internet stayed down for almost 6 days, i finally made the call. After spending over an hour going through their phone system, getting hung up on multiple times by it, and waiting in queue for the remainder of that time, i finally got to a person. For the first time i had someone who was actually willing to help me, and we got an appointment setup to have them come out and look at my router.

The guy arrived on time, bonus points, but immediately started telling me about how he plays Horde in World of Warcraft, and my family plays on the wrong side (Alliance), there went the bonus points. He does his tests and decides that my router needs to be replaced, and makes some insulting remarks about the tech who previously installed my router saying that the splitter installed was the wrong kind and is the reason the router was fried.

He then says to me:

"You shouldn't host a Ventrilo Server from here."

Now, i don't host a ventrilo server from home...but i used to. So the fact that he knows that just from the small visit he made to my house means that my router not only monitors my traffic and protocols, but it stores that information either on the router, or on their own servers somewhere.

"Hey, so i was looking through your dresser...can i borrow some socks?"

He then proceeds to tell me he thinks comcast has a right to restrict what you run from your home, and he can't wait until they pass legislation to will make it legal for them to do so. So i'm allowed to pay for the service and bandwidth they advertised, but i'm not allowed to utilize that bandwidth? Bandwidth is bandwidth, plain and simple. A certain protocol isn't more harmful to hardware than another, it's the amount of bandwidth that goes through. However, wear and tear is expected as a business.

If you owned a gym, you wouldn't advertise "New 15 speed treadmill!" then only allow people to go up to speed 8 because if you go higher it wears out the gears quicker. Wear and tear of your hardware is expected and why you charge the prices you do, to make sure you have enough money to maintain the hardware that your business runs on.

Comcast will overextend itself, and won't bother with installing more lines or upgrading their equipment because that means less money in the corporate pocket. So instead, they throttle "certain protocols" (any protocol that allows the the user to utilize the full amount of bandwidth they pay for). And when they're worried that the program has extra logic to use multiple ports, they'll start doing man-in-the-middle attacks (against their own customers) and sending stop packets for whatever program they think is being used.

If i had to describe Comcast in 3 words, it'd be Illegal, Immoral, Irresponsible.

Thursday, September 24, 2009

The Infallible Giant

It's not secret the majority of the population relies on technology in some form to just get by from day to day. If you were to search Twitter right now for:
http://twitter.com/#search?q=Gmail
 you would find many 140 character complaints about todays downtime for Gmail and for Gtalk.

Outages like this in my company are a big deal. Although we have our phone systems and email servers setup and actively running, the main form of communication the majority of of us have between our many offices is through use of GoogleTalk. Today, we're thinking of how bad of a business plan it is to have our main form of communication a free 3rd-party service, but considering Google's track record you wouldn't normally have Google downtime as your top concern.

Unfortunately for me, 30% of my Googletalk work contacts have email addresses that i know they actively check for work related emails, and of those only 15% have extensions i can directly reach them at.

Our reliance on the Cloud is expected as the convenience for it's use for the general public's shortsighted wants and needs outweighs the potential for disaster that may occur in the long run, but today...i just wish i had thought to get secondary contact information for some of the people i need to work with today!

Wednesday, September 16, 2009

The Duckware Hunt

One the latest ways makers of spyware are trying to get you infected with their crap is by playing on your inner child. I'm sure many of you grew up playing Duck Hunt on the Nintendo and feel like you had become a pro at it.

The Being Alive facebook fan page has either been compromised or was created by someone with malicious intent. It's possible makers of the spyware created fanpages they knew would get "fans" then after they reached a certain amount they start advertising their spyware infected links.

It has recently been updating the fan page with links to a Duck Hunt game at GameVance.com. GameVance.com requires you to install one of their .exe's to play their game which installs Trackware.Dogpile on your machine, as verified by Norton, and possibly other unwanted items of spyware. They lure you in by claiming you could win prizes and money and since everyone knows how to play Duck Hunt, everyone feels like they have a chance at winning!

So what's so wrong with a Search Toolbar like Dogpile? Well unlike most toolbars, this one isn't easily uninstallable. If you try to remove it, it hides itself and reinstalls itself. It tracks your searching on your computer and submits it to one of the makers servers.

Now if you're okay with all of this, go ahead and install their spyware on your machine. But realize if you have one unwanted malicious piece of software on your machine, there's a good chance that item could bring in friends!

If you want to play the game without risk of being infected, go to a reputable site, maybe one that uses flash for their game without need to install another program, like http://www.cyberiapc.com/flashgames/duckhunt.htm

This may not be the first facebook profile or fanpage that will be posting links like this so be warned!


-Edit-
Fan Pages that have been compromised:
Saturdays
Being Alive

Blue Movie Nights

Living so far away from my girlfriend, Ashley, makes our date nights and movie nights a bit more unique than just the average night out on the town. Meeting and falling in love with someone who lives so far away from you is never something that you planned on. When you do fall in love, the distance no longer matters, you do whatever you can to feel close to each other until you are able to remove that distance.

With the use of today's technology we've been able to keep our relationship going strong while we work to fix this distance problem. Our main form of communication is nothing new, our cell phones. We both bought bluetooth headsets to allow us to be able to talk without having to stop our lives just to hear eachother's voice.

You remember your first time watching a movie with a person of the opposite sex? You're there sitting on apart from eachother, afraid to touch eachother because of how the other might react?

You're thinking "Maybe if i use the big fish story...what if she notices and defends against my moves, crap! I'll just put my hand right here and hope she grabs it..."

Well, Ashley and i will rent the same movie, and setup camp on the couch. We'll sync the movie up to within a second of eachother's and watch it together, listening over bluetooth, pausing together if someone needs to go do something or if the dvd is scratched. Every movie night is like our first date all over again! We can hear eachother's responses to the movie, but we just can't touch. The only "good side" to not being in person is she can't see when i cry because Tiny Tim dies! (too bad she has such good ears...)

Don't let distance keep you from spending time with the one you love! For the times you can't be together, there are still things you can do together! Its all about taking on life together as one!

Friday, September 11, 2009

The Magician From The IT Department

For some of the applications we've develop here at work, we used 3rd party libraries. To save on costs for licensing these 3rd party libraries we've taken advantage of, we have a machine that is nobody's "main machine" but rather one that we VNC to when needing to make changes to those specific projects.

Our Systems department has a few "server rooms" scattered throughout our buildings. I use quotations because 80% of these computers aren't actually servers, but rather isolated desktop machines with no monitor sitting on a shelf somewhere. Yes I'm sure they know all about Server Virtualization, but we like to roleplay the ghetto here!

Well sometime between Wednesday around 2pm and Thursday around 7am, the server went offline. Being i as a lowly programmer do not have access to the server rooms directly, i called our Systems Department. As anyone in a big company would expect when calling the people who are supposed to make sure your machines are all up and running, nobody answered. Knowing we had people who were scheduled to be in, i walk over there and see one guy coming out of his office as i walked in his door (which means he ignored my call!). After getting several people involved, including he who tried to dodge my call, none of them knew where this machine was!

It is now friday, the weekend is here, and there is still no idea as to where the machine could be!

My guess??

Manager
"Hey we found this machine in that room over there, "capricorn", we need one, can we have it?"
 Systems Guy
"Sure, i dont know what it's used for! One sec..let me wipe the harddrive.."
**Harddrive Wipe Complete**

Random Manager
"Sweet! Thanks!!!!"
Me

 "Hey..has either of you guys seen the capricorn machine?"

Manager & Systems Guy
"Nope, haven't seen it..."

I'm thinking conspiracy, on the grounds that we need a good conspiracy around here! I have no evidence, just a that departments history of "hmmm didn't think of that ahead of time..." situations. If by Monday it's not found, guess i get to request a new machine...hopefully it's faster :D

Wednesday, September 9, 2009

How Many Database Admins Does It Takes To...

Nowadays, businesses store all their company and customer records in a database. Having a qualified database administrator is almost a necessity for things to run properly. Subjective? I know.

So what does it take to be a qualified Database Administrator?

I don't have the answer to that, but if you were hoping to land a job as the Database Administrator for HostDepartment.com, you may be in luck. It doesn't take much to beat stupid, and after you hear my story..."stupid" is what you'll be thinking!

I used to host all my sites at HostDepartment. Why? No reason. Once i was there, switching hosts was the last thing on my mind since moving your websites is a pain in the neck. Hostdepartment keeps their servers 'specific to function', so they refuse to install .NET libraries on a linux machine, and refuse to install PHP libraries on a Windows or .NET machine (wait they have 2 different windows machines?). If i ever had a domain name that i needed to use 2 different language types with, i'd have to forward a subdomain's dns to my home machine (which i conveniently setup to handle EVERYTHING) to get around this limitation. FTP rarely worked, so most of the time i'd have to use their webclient and use browse dialogs to upload. Why did i stay? I had workarounds, and moving was inconvient. I DID end up switching hosts.

So what changed my mind?

I began work on one of my longtime "todo list"'d projects, MSS, and i wanted to use some direct SQL to LINQ methods in my Silverlight, and decided i would use a MSSQL database instead of a MYSQL database so i could.  So using their Cpanel (Hsphere) i created a user, and a database. The webclient they had "available" for me to use from the cpanel went to a page that was no longer there so i tried to connect with my SQL Management Studio Client. I had no rights to view or create any databases. After opening a ticket regarding the issue, and waiting a few weeks for a response, i decided to make temporary database on my local machine that i could move later.

4 months pass..

Still no word. I decide to talk with their live chat, and they end up making a new ticket for me about the situation. Almost a week passes and i get a response from some "delightful" lady named Sara. Sara responses gave me hope that things would get fixed this time and we sent a few messages back and forth clarifying the problem. After "fixing it" and creating my database, i could no longer log into my account even after changing my password. Upon her fixing that, the database still wasn't there. About 2 weeks passed and they asked me to send them the queries for creating and populating the tables. I zipped them up and tried to attach them to the support ticket system using their attachment feature...but i got an error saying they did not have rights to do this.


The people relied on to give me rights, couldn't even give their own program proper rights to use all of it's features. I'M DOOMED!

I had a good laugh about that one, but i don't think they found it amusing. I put it available for them to download from my home webserver.  I don't know if they tried my queries, and if they did i don't know what the problem may have been, but she then asked for me to send her a "generated backup" of my database. I gave her my generated backup, and 4 days later i get a response saying this:

"Sorry for the delayed response. I tried to restore the back up (MSS.bak)present at your webspace but it gives me an error message as the .bak file is incorrectly formed. Revert back to me with correct .bak file so that I could restore it for you at the server end."

So my format is incorrect. I didn't have options to give any other kind of format, nor did she specify what the correct format was. At this point i'm questioning why i even have to go through the process of creating my tables elsewhere and then restoring them to the server i pay for.

Sir, you can't wash your car here right now, if you could go down the street and buy some soap, come back & load the machines then we might be able to help you.
I'm sorry sir, that's the wrong kind of soap.

I contemplated making my local MSSQL database available to use outside my network when i realize that almost all of the things i pay for monthly from my webhost, i end up having to do on my own machine at home!

Being comcast sucks (which is a whole other story), i decide i need to switch webhosts. I moved to GoDaddy The first thing i did was create my database for my MSS project, and it took me just a few minutes to create them and populate them. Aside from the ease of DB creating, their site functions much quicker and i'm paying $10 less then i was with HostDepartment! With HD, on windows based machines, i could not create extra ftp logins. GD does not have that limitation :D

So how many database admins does it take to create a database? 

Setup a login? Create my tables? Screw in a light bulb? Who knows...i've yet to deal with someone who would be considered a qualified DBA from my webhost, but i was able to do it!

Wednesday, August 26, 2009

Results 1 - 10 of about 29,400,000 for Shoes

If you search the word "Shoes" in google you get over 29 million results. Which is more than any other article of clothing or accessory. The closest article of clothing is the shirt with 23 million results. Not even jewelery has a higher search result!
So what's the world's fascination with shoes?

I myself only have 6 pairs of shoes, unless you count my 2 pairs of flip-flops. I have 2 pairs of dress shoes (1 brown & 1 black) and 2 pairs of DrMartens (for work, 1 brown & 1 black). I then have 1 pair of "skate shoes", which are really referred to as my comfortable shoes and 1 pair of basketball shoes, which i use for anytime i do something physical. 6 doesn't seem like alot, especially when you hear the function of each shoe.

My better half, Ashley, boasts 32 pairs of high heels alone! That's a pair of high heels for every day of the month with option to change shoes on a few of those days! I fully support her high heel "addiction", not only because that's what a good boyfriend would do, but because she looks sexy as hell in them. Though, it does make you wonder how many other pairs of shoes she has!

"My what a big shoe collection you have!"

"What better eat up my income with?"

So why are shoes the number one clothing item? Personally, i blame Disney. Even though it was Charles Perrault who first introduced the shoe as a Glass Slipper in his version of the fairytale Cinderella, it was Disney who made it an icon. They solidified the idea that a shoe that can change your life, even though real life changes are nearly as drastic. Why do you think so many girls, and even men, will go shopping for shoes when they're upset or unhappy with where their life is at?

Let's face it, no outfit is complete without the right pair of shoes to go with it! So next time that special someone in your life is unhappy and you're not sure what to do...take them shoe shopping! And if you need help knowing what shoes would look good with what...ask an expert **cough** Triplyksis **cough** ..wait who said that?

Monday, August 24, 2009

Surviving As An Insurance Company During The Recession

"Sir, It looks like you're covered! ....Just kidding!"
So at the end of my workweek last week, i got into my car prepared to drive home and enjoy my weekend. That day had been extremely hot, and having that heat around me in the air was unbearable. I rolled down my windows to let out the air, and then hit the buttons to roll them back up. As i was backing out of my parking space, it starts sounding like glass was breaking. I look around and see my rear driver's side window was the only one not on it's way up, so i pushed the reverse button for it to stop.

I'm thinking "Crap, i broke my window!". As if i wasn't upset over all this as it was, as i was driving home trying to explain why i was upset to my girlfriend Ashley, the air going over that window as i drove home on the freeway was making a very loud and very annoying noise, giving me a headache. She was very patient with me and tried to calm me down before suggesting the possibility of my insurance covering this. Right after i hung up with her the window fell all the way into the door.

Having no experience with using my car insurance for claims, and knowing my mother goes through the same insurance agency, i call her to try and explain my situation and ask what to do. She proceeds to yell through the phone that she can't hear me, to roll up my window.

"Roll up your window. It's too loud, i can't hear you!"

After explaining the situation to her, and her telling me she couldn't give me any direction other than to call my insurance agent, i called American Family Insurance. Of course, why would my agent have his office open on a friday afternoon around 3pm? So i have to call the non-personal line and deal with the call-center people rather than the people that know me.

Now that i had the first problem of knowing what to do out of the way, calling my insurance, the second problem was figuring out which phone options was right for me. It didn't take long till i was routed to an agent. I explained my situation in full, she said it sounds mechanical and so it wouldn't be deal with by their department specific to glass repairs. She transferred me to a older man named Jim Reid. Explaining my situation again, he agreed it sounded like it might be mechanical, but that i was covered with my Comprehensive Insurance in full, with a $0 deductible. NICE! So he recommends i go through one of their shops, says it will be covered by a lifetime warranty, and that this place had quick turn-around. After giving me all the necessary info, i hang up with him and call the shop, Abra

Quickly setting up an appointment for the falling morning, i finally felt less stressed and let myself breath again. The following morning i got up, and showed up much too early (as i have a habit of doing) and sat in my car playing on my T-Mobile G1, waiting for them to open. I went there with no information (since i asked if i needed it and my insurance guy said i didn't) and the people there were very helpful in helping me get them the information they needed. They even called the nearby Enterprise Car Rental and told them to come pick me up, since my insurance fully covered a car from there.

The weekend goes by and I get a call at work today stating that my window and the window regulator had been repaired and that they were sending my car off to get the window re-tinted. He said he'd call me when that was done, but that it'd probably not be until the following day. My experience so far, had been pretty painless!

Then Jim called back. Said that they changed their mind, that this was considered "wear and tear" and not comprehensive. WHAT?

First, i have nobody in the back seat using that window to be causing any kind of wear and tear because i dont have kids yet, and i don't have passengers back there. Second, even if the first was true, i was told i was covered and the work was already done. I get that people make mistakes, but it shouldn't be me who pay's for Jim's mistake, it should be his employer. I thought part of my insurance was to pay for other people's mistakes anyway!

After getting off the phone with Jim, i think about it. After deciding i'm not okay with the results, i call back, got jerked around by some other Agent who said that he could help me, and i didn't need to go to Jim, i let them know i wasn't okay with their decision. I then call my personal agent's office, and speak with their receptionist and let her know my frustrations and how i feel like i'm being dealt with fraudulently, she says she'll get my agent in touch with me in the morning. Not wanting the mechanic to be out of the loop, i call him up and let him know my situation with my insurance company. Brian, my mechanic, begins to tell me that he was very surprised that they "took back" their previous classification of my claim. He said they sent over as a comprehensive claim, saying i had a $0 deductible and also said:

"I looked at your regulator, and it didn't show any signs of wear and tear. Yeah the cable looked a mess in the pictures, but that's because it just snapped, but because of wear and tear!"
Thanking him for his help and understanding in the matter, i agree to keep him informed of any changes. Jim then called back, having gotten the notes of my disagreement on my account. As of right now, they are currently "looking into it" with his manager, to see if they should cover it. We'll see what happens.

So my advice for surviving through this economic recession as a car insurance company, is to claim you'll cover your customers, and then after everything is done, take back that coverage! 90% of the time, you'll be dealing with someone who just takes what life gives them, and won't know that it's okay to speak up and say they don't agree! There's a good chance you won't get someone like me. So not only will you continue to get their premiums, but you won't have to pay a dime! Your survival relies on you finding those loopholes, confusing your customers, and pressuring them into submission!

Even better, buyout a repair shop & car rental company and direct those repairs to that shop. Referral of business without and "liability" and assurance that the work has been done and so payment is due is the the best way to not only survive, but climb back up that mountain!

"So i know a guy that can get that done for you..."

Sort of reminds of those Home Improvement episodes where that guy was every department. All he had to do was switch the sign at his counter, and he was the department they wanted to talk to!

Saturday, August 15, 2009

Thunder, Prayers, & Alot of Brake Lights

I did not wake up to my alarm today.

It's not that it didn't go off, and it's not that i slept through it, though to be quite honest with you, i fell asleep last night much to early! I was extremely tired, kept drifting in and out of sleep while talking to my better half on the phone. (It's nice to know that the girl of my dreams will talk to me before she goes into my dreams, and during the transition!).

God was bowling early this morning, and he sure was causing making all kinds of noise. The thunder woke me up, numerous times. I finally got up after it sounded like a bomb went off outside and the flash of light through my window finally made it seem like it was daytime. After taking a shower, i zombie'd around getting ready, and put on my suit. Ashley loves thunderstorms.

Driving through the downpour, utah was full of it's normal moron drivers. Driving scares them, randomly while driving, and they just decide to break...go a little and break again..all with nobody in front of them! If you were watching from an eagle eye perspective, I'm sure you couldn't help but laugh seeing me stuck behind two people going well under the posted speed limit. Patience is one of my better life skills and i'm very lucky to have it. My freeway entrance ramp to I-15 was closed. I decided to get on the ramp going the opposite direction, planning on getting off at the next exit and getting back on going in the direction i wanted to be going. Bad idea.

As i'm getting on the backtracked exit, i can easily see how wrong i was. Traffic was backed up all the way to where i was. Now i tried to think logically, and since my ramp was closed... i assumed there might be an accident, so i chose to rest in the left lane moving with the top and go traffic. 9:12am, just entered the freeway from the backtracked exit. 9:44, still not back past the exit i originally started from. Any other saturday morning, and this wouldn't really be a problem, however i had somewhere i need to be.

Today, was the funeral of my grandmother. My mother's husband's mother passed away this week, and things got handled quickly and this weekend was picked up the date for her day. 10:30am was the family prayer, and 11am was when the funeral started. Being it normally took ~60minutes to drive from my house to my destination, i had left at 9am giving me plenty of room for traffic...or so i thought! Construction was moving us from a 5 lane freeway down to a single lane freeway as it turned out, and i chose the wrong lane. I didn't get out of heavy traffic until 10:30am, having only made it 1 exit past my original location. It was at that point that i decided today was a good day to break the law.

My driving record is completely clean for the first time in my life since i began driving. I decided if there was any good excuse for speeding, this was it. Going around 100mph nearly the entire time, i began weaving in and out of traffic. Breaking all kinds of lane switching laws, driving in the carpool lane, even passing a carpool lane car on the left side in the lane that doesn't exist! I said a silent prayer that god would understand my intentions and make cops turn a blind eye to my speeding. I passed one cop, right after Centerville.

Now anybody who knows Centerville...knows there is close to no crime in Centerville and that the cops there have been known to fabricate that you've broken the law and try and convince you that you have!
I was going 100 when i first saw him, and only got down to 85ish before i passed by him. He didn't budge at all, God must have heart my prayers! I walked in with 1 minutes to spare before they began the funeral talks, I suppose i could have done without a few of my highly illegal maneuvers. Don't worry kids...on my way home, i followed every traffic law :)

Today wasn't all tears, it was mine and my baby's anniversary! I love this girl, and I'm glad she puts up with me and my geeky ways :) It's days like this that make me especially glad that i have her!



Thursday, August 13, 2009

Making Wishes On Space Rocks

The world feels rather small when you're staring at the sky.

When the girl you love lives thousands of miles away, something like looking at stars can make you feel closer knowing that compared to the vast universe...you really aren't that far away.

10pm my time, midnight her time, we both went out of our respective houses and began looking for these meteors. I've never seen a meteor before and so i wasn't quite sure what i was looking for. Eventually i started seeing a few shooting stars here and there, and we decided those were what we were looking for.

Ashley is adorable. Enough said, she just is whether she's getting excited from seeing, or upset from not seeing..you can't help but just want to hug her. It was the best thing in the world hearing her getting excited when she would see one! It was even better when we saw one at the same time, because there was a chance we were looking at the same one! :)

It was hard to get the best view because i was on my front yard in the grass and our streetlights were shining bright. My left view was obstructed by streetlights, my right view by the roof of my house. Ashley had trees blocking parts of her sky, but we were doing what we could with what we had! After having seen 5 meteors that looked like shooting stars, i saw a much bigger one go across my sky from north to south with a good size trail. As i was talking about how cool it was to see that one, a really bright one came from the south-east horizon and it looked like it was coming straight at me! It was a small dot of white to begin with then it got really bright and kept getting bright it; was lighting up that portion of the sky. Then the light started to fade and it disappeared.

I was so amazed i immediately jumped up, Ashley having to listen to my, I'm sure, garbled words as i failed to describe what i just saw. I went inside to tell my dad, his wife and her kids that they're missing out (they all were playing World of Warcraft at the time). I was able to convince one stepbrother to come out, and he did get to see a few smaller ones. Another stepbrother came out and replaced the other one (good to know they're interchangeable like that!) and we sat for a while waiting for more to show up.

Brian Regan says:
"Is this a good activity??"

I kept seeing small ones here and there, but Miles (the current step-in stepbrother), 8 years old, wasn't seeing them...even though he pretended to see them lol. After i finally was able to show him one, he knew what he was looking for, this was a first time experience for all of us (Ashley,Miles, and Myself). Miles and I started seeing some huge ones that would disappear behind our roof. Fearing we were missing the best part of the show, we walked to clear to the end of our neighborhood where there was only one street light, and laid down on the sidewalk on the corner. We could see almost the entier sky, and the occurrence of sighting was more than doubled!

Watching the meteors was great experience and i hope i get to do it again someday. The only thing that could have made it better, is if the distance between Ashley and I was reduced to nothing ;)

Cuddling while watching meteors? What could be better?

"Some days all i do is watch the sky..."

I made a wish on every single meteor i saw, each one was the same wish. Next time..i'll come prepared with a list of wishes to read off!

Sunday, August 9, 2009

Man sells his wife for twitter business

Ever wondered what goes on behind the scenes of twitter or your favorite twitter app\site? What kind of people are running\developing that 3rd party twitter app that you use to make your posts and read your tweets?

Ever since the recent ddos attacks against twitter, facebook, and other social media sites in the "Social Media Outage of 2009", many twitter developers are up in arms as they continue to encounter issues with their 3rd-party applications working properly with the twitter API. While many of the developers are understanding about the situation and very hopeful that it gets resolved soon, there are still a handful that are being rather obtuse about it all.

At risk of giving one such developer undeserved publicity, http://twitter.com/DewaldP , has been one such developer ranting about twitter's "lack of information" and how their API's downtime is costing him money. As the main person behind tweetlater.com, Dewald has taken advantage of twitter's free API by creating a tool that allows you to schedule tweets, automate following of folowers, among many other useful features. As per good PR, Dewald has put an announcement on his site explaining the reason for certain features not working on his site, but behind the scene's he's letting his short temper show saying things such as

I would hope that Twitter engineers are all in force at the
office on a day like this to solve this issue and get our applications
back up and running, regardless of whether it is Saturday, Sunday, or
Christmas Day.
As supportive as some people are of twitter's efforts to get things back up and running, there are still those who think that Twitter is obligated to provide a fully 24/7 supported gateway from their site to twitter's data. Twitter is not obligated, legally or financially, to any 3rd party developer or site. In good confidence and in effort to keep the talent in favor of their site, i am positive they are doing everything they can to get things back up and running. The developers and technicians working on getting this sorted out are not your servants, nor are they your paid employees.

Keep in the back of your mind that as much as your 3rd-party app may have contributed to help them grow, they could easily close their API and develop their own applications to take the place of your own. They have the manpower to do it now, thanks to all of us developers! As stated directly from their ToS:
We reserve the right, in accordance with any applicable laws, to refuse service to anyone for any reason at any time.
Now you're probably wondering, how did i get the title of this article? In my attempts to portray my stance on this situation between 3rd-party developers and twitter's IT team, i wrote a story in the twitter-dev group (keep it mind it was directed at the developers):

***Scenario***

A band broadcasts their music on a radio station all the time, and people are able to freely tune into it, or go buy their music online. They go and play in a city park for free every day just because it's a much nicer experience for the listener then to be just sitting at home listening on their radio, and it gives them more exposure.

You, as an up and coming entrepreneur go buy a hotdog & drink stand and setup camp in that park to make some cash off of the flow of people who come to see this free event every day. You being there, giving the ability for people to eat & drink without leaving the park allows for more of this bands songs to be heard, in effect increasing the chance that their music might be purchased. So you're essentially helping them, by taking advantage of them for your business.

The band gets in a car crash, and alot of equipment is damaged to the point of not being able to be used, along with their main source of transportation. The band starts working to find and replace all that is damaged in their equipment and repair their band van.

Now you can imagine that little hotdog stand guy standing on their doorstep while they recover yelling profanities and how they should be skipping the shipping company, who's delivering their parts & equipment, and to get their parts themselves to save time. Yelling that they shouldn't be sleeping, they should be working on their band van right now to make sure it can take them back to the park so he, the hotdog guy, can make some money.

"People aren't coming to my stand anymore! They're going to fast food restaurants and going home!!"
"WTF i sold my wife for this stand!!!"

Now of course, this little hotdog stand man may not have really sold his wife, depending upon which one of you people who are still up in arms about this was put in his place, but i think you get my point.

Now, the band could easily move to a venue that has their own hotdog/drink stand making your services not necessary, but instead of doing that and capitalizing on the profit they could get from that, they're still planning on going back to the same park they do their free shows at, and allowing you to continue earning your money.
My point in writing this, was not only to express where i stood on things, but also to give some perspective on how narrowminded people are being about this. Yes, i get that some of you 3rd-party developers rely solely on the income you make from your site. Yes, i get that you may lose users due to this. But keep in mind, you're not alone! Twitter, you, and many other 3rd-party developers are in the same boat.

Twitter user http://twitter.com/nefaru said it best

"The wrongdoers in this are the DDoS people. Everyone else is collateral in
someone else's stupid war."

And this even-headed individual went on to suggest another way someone could monetize this situation, to make up for their other money lost by suggesting we make a Tech Soap Opera regarding twitter and the google twitter-dev group's drama behind the scenes as (suggested by http://twitter.com/tibbon) the part of the show where the actors talk to the camera. All great ideas :)

Support goes 2 ways. If you want twitter to continue supporting this API, be a little more supportive of them and their efforts of trying to get back on track. We're behind you 100%