December 2007 Entries

I've created a portfolio application a while back called Peace Love Code but have never really been happy with it.  It requires a code rebuild and the layout isn't terribly flexible.

So time to fix this.

I'm going to create, step by step, how to create your own code portfolio web application.  It will include caching, XML based file system, ability to reload it when the XML file is updated, and some form of a layout system.  In addition, it will support multiple languages so if I release a VB and c# version of an application, I can give both out without creating a new item.

Another nice thing is this system doesn't require to  be based around source code and applications.  The system

Here is what I've been thinking about XML file system.  It is simple yet

<?xml version="1.0" encoding="utf-8" ?>
<portfolio>
    <item>
        <title></title>
        <description></description>
        <imageUrl></imageUrl>
        <files>
            <file major="" minor="" build="" revision="" rootFilePath="">
                <version language="" fileName="" />
            <file>
        </files>
    </item>
</portfolio>

image So I got a copy of Pinnacle Studio Ultimate 11 from work and I'm up in the air on it.  For what I do, it isn't a great jump from Windows Movie Maker.  It costs about $110, I don't think I used any of the "ultimate" features too.  After sitting back, most of my problems with the product are from a pure user interface standpoint.  This is a problem since I view the UI to be the most important part of an application.

First what sucked

  • The UI for doing getting to transitions and captions is confusing.
  • The fade transition effect I wanted was on the last page.
  • Items acted "weird" from time to time.  I was editing a text caption and I had to close out and reenter it to continue a few times.
  • 2 gig footprint?  Seriously?  I expect that from Visual Studio.  Not from a Video editing program.  I think Adobe Premiere Elements has this type of footprint though so I may have to shut up.
  • Value of it versus Windows Movie Maker.
  • Can't resize the top areas to make parts bigger or smaller.
  • I want to use my arrow keys from time to time to forward / reverse a movie, can't do this without using the mouse on either the time line or the clock by clicking.
  • I have to hunt for commonly used functions like adding in a video effect.

Then what I liked

  • The program didn't crash.  (give me time on this)
  • I liked some of the text overlays I could do.
  • Encoding was nice, told me the size of the final file.
  • I can have multiple audio streams.
  • Uses both my CPU cores (faster encoding).  This would be very nice on my Quad-Core at home.

And now Clint questions the meaning of life

  • I'm not sure if it can't pan / zoom.  I couldn't find this feature.  I could only figure out how to do a picture in picture.  Found this in the Toolbox menu.

Final Verdict:  Leaves some stuff to improve but not bad.  I'd be wary of giving this to someone that requires training/books to learn new products due to the user interface issues.

Adobe Premiere Elements will be my next program to try out.  Elements is $90 on Amazon while Pinnacle Studio Ultimate is $110.

It has to deal with file paths and the relative path. 

We've all seen "../" when we want to go up 1 directory.  My problem was

"images/background-images/" is not the proper path for 100% absoluteness with any URL doing a Server.MapPath.  I need "/images/background-images/".

Warning:  Content most people won't care about but should

When doing a Server.MapPath, the server thinks you're currently in a virtual path of your URL.  So if I'm at http://localhost/archives/2007/article.aspx  and do a Server.MapPath("images/");  I'm going to get back C:\pathToWebApp\archives\2007\images\ in return.

NOW if I did Server.MapPath("/images/");  I'd get back C:\pathToWebApp\images\

Make sense?  Ready ... break.

  1. Industrial touch screen monitor for my automated bartender system.
    IMG_4044
  2. A Plastic Helicopter I already broke
    IMG_4040
  3. Color Calibration Huey Pro
    IMG_4041 
  4. That fact I'm not evidentially Irish, I'm actually Scottish.  Of the Fraser clan.

code bugI knew my background solution worked too flawlessly.  Always be afraid when you code something with no bugs in it.  I thought I tested this locally but it turns out I didn't since if you viewed an article, it would throw a hard exception.  I think it is since I did a Server.MapPath.  I remember adding that in at the very end so I'm betting I tested my solution before this was added in.  No matter what, I see 2 easy improvements I could do on that code.  1st is create a string for the Server.MapPath and the 2nd is do a Directory.Exists(mapPath) if statement.  This will prevent the source from bombing.

Crap. 

Since it is technically Christmas, I'm going to hold off fixing the problem.  I don't want Santa to find me still awake at 3:00am.  For now I reverted the skin back to the modified Origami skin that comes with SubText.

I just rocked the Casbah and released my new subtext skin live.  I'm going to update PeaceLoveCode tomorrow I think in an all out coding fest and make it XML data source driven.  Maybe record the entire process of coding it too while I'm at it.  Hopefully my mom won't request me to do any tasks but I think that is doubtful.

As for the skin, I think there is still 2 more small CSS tweaks I want to do.  Make the blockquote element have some snazziness and I'm not 100% happy with the shading yet too.

Source for this can be found at PeaceLoveCode.  To add in the skin if you want to, you'll need to go into your Admin folder in your subtext instance this in your Skins.config folder.

<SkinTemplate Name="Better Than Everyone" TemplateFolder="BetterThanEveryone">
      <Styles>
          <Style href="Styles/print.css" media="print" />
          <Style href="Styles/Main.css" media="screen" />
      </Styles>
      <Scripts>
          <Script Src="scripts/rounded_corners_lite.inc.js" />
          <Script Src="scripts/jsWorker.js" />
      </Scripts>
</SkinTemplate>

Cool things about the skin is the top background image.  I added in some caching / smart directory searching for images.  Here is the source I added into the header.ascx file in the skin, by downloading it, you can see what I did too.  One interesting thing I didn't know was I had to do this for the source to run, I thought I could do a <% and it would have worked.

<script language="C#" runat="server"></script>
c# code
private const string cacheKey = "headerImageList";
private readonly Random r = new Random(DateTime.Now.Millisecond);

public string GetBackgroundImage(string filePath)
{
    System.Collections.Specialized.StringCollection fileList;
    if (Cache[cacheKey] == null)
    {
        fileList = new System.Collections.Specialized.StringCollection();
        fileList.AddRange(System.IO.Directory.GetFiles(Server.MapPath(filePath), "*.jpg"));
        fileList.AddRange(System.IO.Directory.GetFiles(Server.MapPath(filePath), "*.gif"));
        fileList.AddRange(System.IO.Directory.GetFiles(Server.MapPath(filePath), "*.png"));
        Cache.Add(cacheKey, fileList, null, DateTime.Now.AddHours(1), 
           TimeSpan.Zero, System.Web.Caching.CacheItemPriority.Normal, null);
    }
    else
    {
        fileList = (System.Collections.Specialized.StringCollection)Cache["headerImageList"];
    }

    return filePath + (new System.IO.FileInfo(fileList[r.Next(0, fileList.Count)]).Name);
}

ETA for links on PLC is tomorrow afternoon CST.

I've been poking around SubText's SQL area and it can be done but not very effectively since how things get updated.  I can modify subtext_GetConditionalEntries with "AND DateAdded < getdate()" but when you update the post and want to modify the viewable date, this isn't enough.  So I thought the DateUpdated would work and it would work for the 1st time you post but afterwards, it updates with the current time, not the wanted to post time.

SubText, in my opinion, as it currently stands cannot support future posting.  I'm not willing to modify the engine this much to add in this ability for fear of breaking too much stuff.  Shame since this is one of my favorite features in Community Server.

I've been playing, compiling, tweaking Subtext for the past few days and created a new skin.  It is based off Andy Konkol's skin which was based off the Naked skin along with parts borrowed from the origami skin.  Here is a screen shot from my local instance of SubText on my laptop.

image

 

What is new:

  • Searching's z-index problem
  • Enter when in a search box submits the search (should be live already)
  • new favorite icon (should be live already)
  • random header backgrounds
  • rounded corners with background images via JS, not with rounded corner images.  I'm using Curvy Corners, Nifty Corners couldn't do the background image properly. 
  • site now under Creative Commons license
  • Modded the SingleColumn.cs control to reordering some stuff on the right.  I find it weird subtext has 800 modular things yet this I had to modify the CS file for.

This left to do:

  • Left side bar need to be fully implemented, still missing stuff on current skin.
  • Mod subtext's stored procedures to allow for post dating (IE it is the 12th and I have a post that should appear on the 15th but can only post it on the 12th).  Right now SubText will reflect the 15th date and still show it even though it is the 12th.  Community Server allows for this and it is rather nice when I have to update Coding4Fun and lack time the rest of the week.
  • Implement the random background image with caching.

I'm going release the source for all my subtext mod's and this skin right after get everything done 100%.

I ordered motors (E-150), a left and right gear box, and an AmpFlow Speed Control.  All of these parts can be bought from Battle Kits (http://www.battlekits.com).

ampFlowMotor ampflow4 GearBox

Why?

It goes back to my attempt to get all off the shelf parts for this and adopt the KISS (Keep It Simple Stupid) acronym.  I want anyone to be able to go "click click click" the with minimal tools build this.

large_MM642-2Since I lost my CO2 Double Regulator, I had to reorder it.

Drunktender should be up and demo-able as soon as the regulator gets in.

So I've been rebuilding drunktender for the past few months now in my off time.

Here is my CO^2 tank and it is pressurized and ready to go.  The problem is I can't find the stupid regulator for it.  It may have been lost in the great moving of 2007 to St. Louis, maybe when drunktender was shipped back from Maker Faire.  All I know is if I can't find it by tomorrow I'll have to order a new one.

IMG_4017

Final wiring

IMG_4016

More wiring, the tubes flaring out aren't attached, they are for something else

IMG_4015

Power supply, terminal block is used to branch out the common.  The brick can do 12V, 24V and 5V

IMG_4014

Bottom view of the cart with my feet in the picture

IMG_4013

Made by Evil mad scientist (http://www.evilmadscientist.com/) and I must say, this kit is extremely well put together.  Everything is put in zip bags and they even printed out in color the instructions for you.  I'm really happy with how they did this kit.  The physical table aspect will be built the one of the managers on my team, Philip DesAutels.  He'll be posting how he builds the table and will make it so he can ship it from Boston to St. Louis.

The goal of this project is to be as eco friendly as possible.  RoHS and all that good stuff.

Parts can be bought at http://evilmadscience.com/

What can it do?  already done version

Here are the unboxing pictures.  Too much stuff going on right now to get really wrap this up.

IMG_4003

IMG_4005

IMG_4004

IMG_4001

IMG_4000

IMG_3998

IMG_3997

IMG_3996

IMG_3995

IMG_4002

IMG_3994

ralphRalph Wiggum is my a personal hero of mine since I tend to do stuff that ends up making me feel like I have his IQ.  I was uploading a few new fixes and toys I have prepped.  Andy Konkol had a pretty nice subtext skin I used as a base and is almost prepped for better than everyone.  Then I got this error after I did all my nice pretty proper QA.

Server Application Unavailable

The web application you are attempting to access on this web server is currently unavailable.  Please hit the "Refresh" button in your web browser to retry your request.

Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.

This is the error I dread when I lack access to do easy things like cycling application pools or doing an iisreset to kick the server back up.  Was I about to take this error without a fight?  Let me count the ways I tried to fix this.

  1. Create a small aspx that used System.Diagnostics.Process.Start("iisreset");
  2. Created a small php file that used shell_exec
  3. Have friends mock you.
  4. Attempted to do a SQL cmdshell only to remember I don't have SA access and that is on a different box.
  5. Delete everything and reupload
  6. Reupload
  7. Smash head against wall
  8. Finally I filed a ticket with the hosting provider even at 3:30am, they reset it and I'm happy again.

So what caused this break?  I think someone hit up the site while I was in the middle of uploading the dll's and IIS freaked.  I don't know if this is true or not.  Back when I was a developer (all 6 months ago), I would see this error and do a quick IIS reset and bam, fixed.

... still can't believe I killed a webserver uploading my instance of subtext.  Worked fine on my testing ground domain too.  frack.  Now time for 3 hours of sleep before the influx of email starts.

Specifications make me happyAfter a few hard years doing development, I realized one thing, you should know what you are developing before you start.  Why?  You end up with crap 80% of the time you didn't need to code.

SO ... who wants to see the internal specification to Visual Studio 2008.  I got a hold of them ... well, actually, they are on MSDN.

So here are some interesting things to note:

  • One feature per specification
  • They use ample visual, detailed images to help aid in development.  Personally, having a picture makes life so much easier
  • Everything is written down
  • Questions are highlighted then striked out when finished.
  • The specification is as long as it is needed to be.
  • On that same note, they can be easily read in under 30 minutes for even the most slow person ( aka me )
  • They all follow the same format.  Even when features didn't need a were missing, the section was still there, just blank.

Via Larry Clarkin's blog

What is XAML (pronounced zammal)?  It is a new way to do form layout and is pretty neat.  It is primarily used for WPF (windows Presentation Foundation and Silverlight also.

The problem I'm running into is with a 3rd party plugin to Visual Studio that I've gotten addicted to called Resharper.  Resharper is just trying to do its job yet it becomes the most annoying thing ever due to the fact I want it to ignore XAML files.  I'm not 100% sure how to do this yet.

image

This happens on every node in the XAML.  So annoying.  When doing c#, this is a god send if I don't have the namespace already declared however.  Typing in StringBuilder, that prompt will come up if I haven't already declared the "using System.Text;"  Resharper does some other cool stuff too.

y1p66DNdILNLFzp8IKdeUvU3GQaPoJVcsQkoat-2lkb19ynZrow3X_U4ZZbdhTAd34wUDz_-FqRzq02nuM9cg5S05bKvAoc5iO9[1] Martin Schray created a nice program that helps to reinforce things like taking a break and to stop slouching.  I helped Martin test drive a few early builds of the application and he finally got it ready so people can use it.

Try it out, more info at his blog.

IMG_3929

IMG_3930

IMG_3936

IMG_3937

IMG_3935

IMG_3933

IMG_3934

323556 Valve #1: 12 VDC pulls .5 amp
Valve #2: 24 VDC pulls .78 amps

So the power supply at Jameco I'm leaning toward has everything I need. 5, 12, and 24V. At 24V@1.5A, I can only have 1 valve open at a time. however it does pull enough to open 2 12VDC valves.

One power supply to control all 3 needed power levels.

Here is what I'm going to get.
MEANWELL PWR SPLY,SW,65W,5V@4A,24V@1.5A 12V@1A,88-264VAC,UL/TUV/CE/CB, Jameco #323556PS

So I had a little video editing mental break down.  So I sent Rory Blyth an email since he was once a Channel 9 member over at Microsoft and generally awesome guy.  While I didn't exactly say Windows Movie Maker sucks per say, I'm not going to disagree with that statement either.  However I will say after Dan Waters, another ADE on my team, showed me some tricks with WMM, it sucks far, far less.  My one HUGE problem is the lack of multiple audio tracks along with if you alter the time line, the audio doesn't shift with everything.

Rory has answered my question with a massively funny post saying what he recommends for editing software and way on both Windows and Mac.    For those who can't read more than the 200 words I normally write, he recommends Adobe Premiere Elements which is only $100 for a full edition.

If you haven't read Rory's comics, I suggest you do.  Good times.

clintOnRorysBlog

I whipped out the Coding4Fun Holiday Gift Guide over at MSDN.  I have to admit, creating these things is a lot more effort than I think anyone would have ever realized.

That is why everyone I know is getting beer.  Simple and sweet.  And maybe RAM, since who doesn't have enough RAM in their computer.  And a muffin.

I have about 15 gigs worth of photos with another 5 gigs unsorted.  I also have an full flickr account.  With PhotoSync and my WHS, the world will never be without whatever random crap I'm doing that day, like figuring out a plot to go curling this Thursday when I'm in Fargo.  That's right, I'm going curling and you're not.   HAHHAHA, I will finally be able to say I've done it!  Man, I wonder how long this will take to upload.

http://www.flickr.com/photos/betterthaneveryone <-- seriously, I love my domain name SO much.  And yes, if I could, I'd marry it ... well, maybe not that far.

IMG_3931

Rory cracks me up.  I must be sleep deprived since I can only understand maybe 1/15th of what he just said.  Plus how many people can say they met him?  OH, I can!  And I got interviewed by him too on Channel 9 and he hugged me!  Look at how nervous I was, its so cute!

Here is the email thread I had with him regarding video editing software.  I've already expressed my hatred for all things video editing.  However helping do the first version of the refract project, I've gotten a better grasp at Movie Maker, too bad it crashes every 5 minutes.  Then again, I don't think it was designed to deal with multiple 1 gig files....

Hey Rory, I’m going to start to do more and more webcasts and I was wondering what video editing software do you use?  I’m about ready to hurt Windows Movie maker.

What does Channel 9 use?

Clint Rutkas - crutkas@microsoft.com - blog

Academic Relations Team - Microsoft

Oopsies. Your email was filtered out by one of my many middleman servers that holds back anything suspicious, and there was a word in the subject line - one I'm afraid to even mention here lest *this* email gets pulled along the way (the first letter is 's' and it refers to a processed pork food - also to a certain kind of message that nobody wants).

What I said was something like this:

I'm totally hardcore gon' do something or other with this all post-like 'stead of the emails.

It'll go up on Wednesday.

Rock your face, motha[edit]'.

Good to hear from you.

And, yeah, Windows Movie Maker is like a burning digital poker right in the eyeball.

There are some good solutions - I'll right 'splain 'em.

In the meantime, we ask that you be patient and continue to be frustrated with WMM until such time as we can provide the information you'll need to dig yourself out of this inferior-video-editing-product shaped hole.

By then, you might even have an answer. However, I'll post anyway for the benefit of everybody who's looking for a cheap alternative to free crap.

Toodles,

- Rory

So if I deciphered his email properly So looks like Rory is going to rock the house with free / cheap video editing alternatives.  hell yeah.  better yet, I don't have to track down and test out 8 bagillion programs to find a decent one.

So last week I was in the urban sprawl known as Dallas at Silverlight bootcamp (of which I think I'll post a few silverlight demos here that I'll create).  Two of my coworkers and myself, Dan Waters and Cy Khormaee, decided to enter an internal contest and this is what we whipped up in under two days.

Refraction


Video: Microsoft Refract

If you have any additional suggestions, post them here.