May 2007 Entries

So last night I was on my way home from work after I lost a bid on ebay for a cheap segway. I was irked but what are you going to do. Chatted on the train with a friend then on the walk from the El to my apartment, I saw Bernadette across the street. For those who don't know B, she is the force in the group of friends that prevents us from hurting ourselves. If your group of friends lack's a figure like B, we rent her out to help prevent the Darwin Effect for a nominal fee.

But I digress. So I was on my way home and see B. And bam, I get offered a Cubs ticket for the night’s game. Score. The lost (big suprise) but still. So long story short, I didn’t get home until 2. all because I took the long way home to avoid the cubs traffic, I still end up in it.

I really do love how you randomly meet friends in the street due to the fact of you're a retard if you drive around everywhere in chicago. I don't think too many other cities are really like that. New York and Boston would be too I guess.

I guess I learned, when you really don't have anything better to do on the way home, take the long way because you'll end up going to a night cub's game.

It is coming along. I ported it to VB but need to verify it works. Hopefully I'll get the article done this week too for Coding4Fun.

I need to shove source code app's on a different site soon. BetterThanEveryone currently hosts too many and lacks a good way to display them.

- clint

So Memorial Day weekend rocked (awesome pics, be up shortly) but I woke up. I woke up after 2 hours and now I can’t go back to sleep. This isn’t a new problem for me you see.

I can’t stop thinking. When I think, I can’t go to sleep. I have all these awesome problems I want to solve or do something about. I should hit myself in the head to become stupider or something so I don’t suffer from insomnia anymore. The simple life, where all I worry about is where my next meal is coming from. Which 9 times out of 10, is my refrigerator … or subway.

Gallery is back up and working

However the smart link isn't working. Sucks but eh, fact of life. Another thing I still need to do is actually update all the links on past blogs due to smart linking not working. I'll fix these one set at a time. There are a ton to fix and to be honest, they'll get done when they get done.

The guys over at Robotics Connection rule. I met them over at Maker's Faire and we've been shooting emails back and forth.

I've been chatting with them on how to power parts of v2 of the bartender. One huge thing is having the system powered by Windows Embedded. Hopefully they'll also help out on a second method front too. More on the 2nd thing as it develops.

ok, so ditched the img/ directory and did images/

Now on an attempt to get the gallery back up and working.

So close yet so far

I'm assuming these exist already but I wrote my own. It cleans out the bin, obj, SVN directories so you don't have to. It also removes the resharper directory since no one wants that. If you don't have resharper, i suggest getting it.

XML Code

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="folderPatterns" value=".svn|_Resharper*|bin|obj"/>
    <add key="filePatterns" value="*.resharper|*.resharper.user|*.suo"/>
  </appSettings>
</configuration>

Application

private void button1_Click(object sender, EventArgs e)
{
    if (folderBrowser.ShowDialog() == DialogResult.OK &&
        folderBrowserBackup.ShowDialog() == DialogResult.OK)
    {
        DirectoryInfo di = new DirectoryInfo(folderBrowser.SelectedPath);
        DirectoryInfo backupDir = new DirectoryInfo(
            Path.Combine(folderBrowserBackup.SelectedPath, di.Name));

        textBox1.Text = string.Empty;
        CopyAll(di, backupDir,
            RegexFilePattern(ConfigurationManager.AppSettings[
                "filePatterns"]),
            RegexFilePattern(ConfigurationManager.AppSettings[
                "folderPatterns"]));
    }
}

public static string RegexFilePattern(string input)
{
    return Regex.Replace(input, "\*", "[\w\W]*");
}

public delegate void CopyAllMethod(object state);
public void CopyAll(DirectoryInfo source, DirectoryInfo target,
    string deleteFilePatterns, string deleteFolderPattern)
{
    if (InvokeRequired)
    {
        CopyAllMethod method = delegate {
            CopyAll(source, target, deleteFilePatterns, deleteFolderPattern); };
        BeginInvoke(method, null);
    }
    else
    {
        // Check if the target directory exists, if not, create it.
        if (Directory.Exists(target.FullName) == false)
        {
            Directory.CreateDirectory(target.FullName);
        }

        // Copy each file into it's new directory.
        foreach (FileInfo fi in source.GetFiles())
        {
            Console.WriteLine(@"Copying {0}{1}", target.FullName, fi.Name);
            if (!Regex.IsMatch(
                fi.Name, deleteFilePatterns, RegexOptions.IgnoreCase))
            {
                fi.CopyTo(
                    Path.Combine(target.ToString(), fi.Name), true);
            }
            else
            {
                textBox1.Text += fi.Name + Environment.NewLine;
            }
        }

        // Copy each subdirectory using recursion.
        foreach (DirectoryInfo diSourceSubDir in source.GetDirectories())
        {
            if (!Regex.IsMatch(diSourceSubDir.Name, deleteFolderPattern,
                RegexOptions.IgnoreCase))
            {
                DirectoryInfo nextTargetSubDir =
                    target.CreateSubdirectory(diSourceSubDir.Name);
                CopyAll(diSourceSubDir, nextTargetSubDir,
                    deleteFilePatterns, deleteFolderPattern);
            }
            else
            {
                textBox1.Text += diSourceSubDir.Name +
                    Environment.NewLine;
            }
        }
    }
}

So I've just started the process of porting stuff to my new servers. And I've run into a little problem. My img directory is acting weird. I've filed a ticket and hopefully it will resolve itself. Going to make another attempt at running Gallery. nGallery is having issues too.

With that said, atleast I won't have SQL errors anymore due to the server maxing out its partition without any action taken.

I just upgraded my wordpress install. My old layout didn't seem to play nicely SO I'm using the default one for now.

I'm attempting to get everything to a new server and get 3 new domains up. One for drunktender, porting this one, karate chop action, and actually going to branch off the dance floor stuff since better than everyone has pretty much turned into my primary blog now.

I love the movie Real Genius. I've wanted this t-shirt forever.

And now .... I have it. This company found item clothing actually had it. And the gorilla one too!

best ... t-shirt ... ever.

And looking at that picture, my hair is oddly close to how that looks. Accident or on purpose? I'll let that one sink in.

me, me, me if the videos had been done, and ... Brian Peek

Drunktender being shown off

Jimmy Kimmel prepping to bust my balls

Why nerds should never drink in mass

Getting stuff prepped up on Friday

  1. Use sys admin priv's to modifiy his HOST file and point www.betterthaneveryone.com to point to an internal apache server
  2. Tell him his site is down
  3. Update the page to say it got hacked

Konkol ... well played, well played indeed.

So now that things have settled down and I actually unpacked and now doing legendary stuff, here is what I learned from maker's faire.

  • Halls cough drops help reduce damage to your throat if you have to talk 10 hours for 2 days.
  • Always bring backup parts (I didn't and had a hardware failure I couldn't do anything about)
  • Bring backup tools also, I broke a flat head screw driver. Ok, I threw it against the wall
  • Pack your own stuff to ship there since you'll have to unpack it and then repack it.
  • Don't trust books, they lie but they help making fires. Ikea instructions need to be burned.
  • It isn't about your stuff working, it is about your stuff looking like it worked. Or getting a hot girl to man your booth ... I didn't have a hot girl though.
  • Make your stuff easier to build on-site.
  • You won't have time to do anything expect present. So have water and some snacks handy.
  • I over commited myself and couldn't handle my entire area, next year I'll scale it back or see if I can bring more people.
  • Get a bouncer, they come in handy. People do show fake id's from Texas to you.
  • I was here for actually too long. Get in Friday morning to setup, leave Sunday night. If I wanted to sight see, add 1 day.
  • Don't be afraid to ask for help. Everyone wants everyone else to look good and to have a fun time.
  • The TSA loves my luggage. If you saw my boxers, they have spider-man on them, you'd want touch my boxers too.

Finally home. One big thing I noticed between Chicago and San Francisco is Chicago is a lot greener. I'm not saying in terms of carbon, I'm refering to plant life. A bit jarring actually.

So it was a hard 3 days.

Day 1 - Friday:
Building everything ... holy shit this was an interesting experience. So I estimated about 3 to 4 hours to do both projects since I figured I was in a good spot. Boy was I wrong. Dave built the dance floor while I did the bartender. Brian Peek (I still say it is pronounced differently) helped dave out too.

I should have had it up in an hour. I realized I miswired the boards (again) and also had to wire in the capacitors. THEN the relay boards decided to die ... again. Chris and Ryan from Home Server popped by and helped out but with little success. Around midnight we called it a night and gave up.

Day 2 - Saturday:
Attempted to revive the relay board again and got everything up and working around 11am. The dance floor too was acting up. I wasn't having the best of days. Actually, if there was a baby in the room, I may have punched it just so I could feel worse. And then the home server guys came to the rescue again and gave me a great bit of advice. With that advice, magically everything fixed itself.

Also USB Thumb drives are life savers. From now on I'm going to have 3 or 4 with everything needed to get stuff running.

Throughout the day, the evil remaining relay board still failed randomly but after showing off the program so many times, it was easy to recover from those failures.

After 6 hours of doing this, the Microsoft PR woman rushed over and told me that Jimmy Kimmel (yes, from TV) was going to interview me for the bartender application. It was actually a lot of fun. I had my balls busted slightly since Kimbal wanted an orange juice and coke (seriously, I know you're hung over but dude, orange juice and coke?)

Then Microsoft took us out to dinner. Stories have been made here. Also like to thank Dan, Jaquiline (who's name I just destroyed), and the rest of the MS gang that I left out.

Day 3 - The final day:
From the dinner, everyone got cheese garters ... don't ask.

Today seemed smaller and I finally got a chance to check everything out. I really still want to do stuff with a Monome and I there was a few random things that made me how I could do something like that.

I also got to ride a 1st generation segway since a nice chap loved my bartender enough and noticed the drool from my chin. I want one, I seriously want one now. Not yesterday, not tomorrow, now. I'll ride back to chicago on it too.

What really made my day is Rory from Channel 9 popped by and actually hugged me (again). From my understanding, this is something he just doesn't do so it was weird and awkward since I really care for the body contact stuff other than knuckles or shaking a hand but still cool. This time I had room and wasn't on a couch attempting to flee which helped too.

Grabbed lunch with Doug Handler from Microsoft and came up with a REALLY awesome idea for next year. I think the wind may screw that up but jesus, combining the three technologies into one package ... awesome. I also came up with another idea that I think would be rather tight to do too. I think I'll chat more with Chris Walker who does home automation about this since he loves segways and my idea is along those lines but cooler and might use blue tooth ( finally a good use for it other than a head set)

I also realized that what I ship must come back. I disliked this partly because I didn't really think about that while unpacking and should have broken stuff down sooner to be out the door quicker.

I also chatted with the guys over at Robotics Connection and they are some really nice guys. They might actually be helping me out designing some custom relay boards for the next version of the dance floor.

All in all as I sit here in the hotel, I'm happy with how stuff turned out. I'm tired and cranky, but happy. And I think I'm going to go to sleep at 11pm for once.

I have pictures and movies and source code to post after the break of me and a pillow making out for the next 12 hours.

I was informed about how to many any windows mobile phone be a modem through USB or blue tooth.

It ruled. I knew my data plan would finally be worth the 50 dollars.

TJ is a coworker of mine. He tends to say stuff like " You are unprepared, go away" and it makes me laugh.

However at maker's faire, I thought dave and myself would have been finished up and then on our way within 4 hours of getting there.

Holy shit was I wrong. 10am-11:30pm. Dance floor work finished up around 11 and the bartender wasn't much better.

The relay boards ... god I hate those things. The board that controls 16 items isn't working. The guys over at Home Server helped out but with little avail. Looks like the system just lost 8 drinks.

On the plus side, this event looks like it will be utterly crazy. And atleast the dancefloor is working.

it is now 2:30 am in SF. AKA 4:30 am chicago.

God I love delays.

Ok, so I created the vista power savings app. However I do believe that Windows already has a solution for this. I found it through a comment on the primary thread for the Vista Battery Saving application.

Vista already disabled Aero to a degree JUST by being on battery mode in Power Saver mode.

So i'll be flying with my relay boards due to the issue listed below. As I was about ready to go to sleep, I realized how many times my luggage will be searched.

I had enough comments about shipping the stuff, just imagine airport security. If something will look like a bomb through an x-ray machine, 10 to 1 they will.

Now the question is do I put them in my take on bag OR the suit case. I almost have to say with me cause if they get lost, I'm screwed. Plus who knows what type of man-handling they'll take if they are in the luggage.

So the tubing mistake, no biggie. Easily fixed. What isn't is the relay issue i've been having. After a volley of emails and a phone call, I think we came up with a solution.

The problem is the relay would short out due to an influx of power (a power spike) causing the board to work. The work around is to put a capacitor between the neutral and hot cord starting at the relay board This appeared to do the trick so I rush ordered 20 higher, better quality (and properly rated) capacitors to Chicago.

This means I have to create 24 Y connectors (done), create 24 daughter boards with literally no wire to the relay board (or just do a splice with some heat shrink and solder), create the 24 extra wires (figure 4 feet each?) for the extra wire run.

This is still going in blind to a degree since I only have 1 spare motor and just because my few tests didn't cause it to happen doesn't mean the problem still doesn't exist. I think the relay boards will have to be swapped out due to this.

Wheels up in 44 hours. Plenty of time, right?

I think i just miswired it

Ok, so I didn't calculate for one thing, head pressure.

I'm going to have to replace the current air pumps with something more powerful.

They work for fine under a small distance but not the distance that I require. time to start chaining them together to see what pressure works to clear it.

Past 24 hours have been fairly crazy. I've done a ton of progress, released version 3.8 over at SpringCM with the new user interface that soaked up so much of my time, and shipped all of the dance floor along with parts of the bartender over to San Fran for Maker's Faire.

Tomorrow's list of stuff is to call my mom and wish her a happy mother's day, test out the wiring, do a wet run, put on the finishing touches on the application (of which Ian wants to redo the layout / graphics for) then get it prepped up to get shipped out on monday. After that I need to tweak the drink adder application to allow both me and Dave to add in drinks at the same time (aka one will be doing an insert, other will be appending to a text file). Come next Saturday and Sunday, party at Oak Hall at the San Mateo Fairgrounds.

Ok, Here was my hit list:

  1. Mount the additional Co2 regulator.
  2. Create faucet for drinks (1 inch for 12 tubes, thinking maybe 2 1/2" or 3/4" that merge into a 1")
  3. Mount Relay boards
  4. Mount a power strip
  5. Run eletrical wiring (Neutral)
  6. Wire cleanup
  7. Test wiring layout
  8. Do a wet run test
  9. Deconstruct it
  10. Ship Dance floor to Maker's Faire
  11. Ship Bartender to Maker's Faire

Relay boards mounted, wired up

A close up

2 complete, wired, tubed, ready to mount and run drunktender modules.

Ok, so mounted the relay boards, I also got a bunch of stuff ready for shipping. Primary stuff for dance floor #2 but actually I can deconstruct majority of the table I believe to ship out.

nuetral wire mess.

Relay boards mounted ... hidden under the table.

getting ready to ship out

For the Vista Laptop Battery Saver Application, I've done an update. I added in the alt-tab fix, override fix, and memory fix. It now runs on 3.2 MB instead of the 14MB before.

The Alt-Tab fix was thanks to Bela Istok. The memory fix was thanks to ow who pointed me to the correct function to google for.

Thanks to OffBeatMammal also. His drive made me go the extra mile and crank this out.

Sorry but I lack time right now to fix the sleeping tweak issue and adding in an auto updater. Maker's Faire is taking priority.

Source code for version 1.0.0.1 of the Vista Laptop Battery Saver Application
Application for version 1.0.0.1 of the Vista Laptop Battery Saver Application

  1. running the tubes to from the valve to the drink.
  2. Mount the Co2 manifolds.
  3. Mount the additional Co2 regulator.
  4. Run Co2 lines from manifolds to drinks.
  5. Create faucet for drinks (1 inch for 12 tubes, thinking maybe 2 1/2" or 3/4" that merge into a 1")
  6. Mount Relay boards
  7. Mount a power strip
  8. Slightly tweak the current power layout scheme to fit 6 on each side.
  9. Run eletrical wiring (Neutral)
  10. Run eletrical wiring (Hot)
  11. Test wiring layout
  12. Do a wet run test
  13. Deconstruct it
  14. Ship to Maker's Faire

A little FYI, crimping wire sucks

Showing a bit of leg

Tubing finally done

Wide view, only thing left to do is running 1 more wire

Co2 manifolds are mounted and ready for hooking up

Ok, so tonight's progress was finishing up the wiring racks which house the valves, check valves, air pumps, and the tubing that will serve the drink.

That leaves:

  1. running the tubes to from the valve to the drink.
  2. Mount the Co2 manifolds.
  3. Mount the additional Co2 regulator.
  4. Run Co2 lines from manifolds to drinks.
  5. Create faucet for drinks (1 inch for 12 tubes, thinking maybe 2 1/2" or 3/4" that merge into a 1")
  6. Mount Relay boards
  7. Mount a power strip
  8. Slightly tweak the current power layout scheme to fit 6 on each side.
  9. Run eletrical wiring
  10. Test wiring layout
  11. Do a wet run test
  12. Deconstruct it
  13. Ship to Maker's Faire

2 fully mounted racks, pumps and valves

Locked and stocked

Tubes run for the valves, wires and entry tubes are only what is left

Looking better than what I thought.

Bottom with check valves

Top with valves exposed

Side view

The reason why I suck as a roommate

Ok, so the cat's out of the bag and I'm part of Coding4Fun's Maker's Faire booth.

So I guess I can say what my two projects I've been working on have been since that page already told you.

Project Blinky Light was ever so well named since it is a 8 foot by 8 foot disco dance floor.
Project Liquid Fortitude is a project I'm calling Drunktender. What is Drunktender? It is an automated bartender. Say what? Yes, I'm too lazy to make myself mixed drinks other than beer so I invented one.

Here is the state of my apartment right now with everything I'm prepping.

I don't have enough

The ikea table I just got which is PERFECT for this

One of 2 wiring posts I got, I think this solved all my problems overnight.

Wood for the dance floor, relays, wiring, phidgets, dance floor boards, and pressure I/O devices

One of 12 valves to get the necture of the gods from

My two Control Anything Relay boards

A close up of the big box of stuff that needs to be wired into the ikea table

dance floor wiring

Power supplies and extra LEDs

Ok, where am I with everything? Busy as hell. Project Liquid Fortitude is pretty much wrapped up. More data into the DB needs to be added along with one more stored procedure. User auditing, RFID, PSI monitoring, Relay board, UI polishing, ... all done.

Going to Ikea tomorrow to get the Table everything will mount to. Ian Hall is driving me since I'm carless. (working and living in Chicago makes it almost pointless to own a car). I really do like the Ikea table I picked. It is movable, everything can mount to it without great problem, and it isn't ugly. It looks way better than anything I could build too.

So what needs to be done? I still need to build out whateverything mounts to. Shipping to California (and back to Chicago) too needs to be done. Wood is heavy as crap too. The shipping costs really scare me.

Why might you ask does this crap need to be shipped to California? I'm attending an event out there the 19th and 20th. More info when it gets closer. I'll also release a live video of testing Project Liquid Fortitude. I'm assuming there won't be a shortage of beta testers for this event.

I get a bit irked when I see stuff that can be solved but people just complain about it. News.com, slashdot, zdnet ... list goes on and on about people jumping on the bandwagon. So you know what, I attempted to fix it.

Ok, here is my solution. I spent more time prepping this post than writing the application. Two source materials are a coding 4 fun post by Arian Kulp that handled the power management and a MSDN magazine article by Ron Fosner.

New version here


Download Source
Download Executable

using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;

using Microsoft.Win32;

namespace VistaLaptopBatterySaver
{
    public partial class Form1 : Form
    {
        /* 
         * Copyright Clint Rutkas May 2007
         * 
         */
        [DllImport("dwmapi.dll", PreserveSig = false)]
        public static extern void DwmEnableComposition(bool bEnable);

        [DllImport("dwmapi.dll", PreserveSig = false)]
        public static extern bool DwmIsCompositionEnabled();

        public Form1()
        {
            InitializeComponent();
            enableToolStripMenuItem.Checked = DwmIsCompositionEnabled();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged);
            UpdatePowerInfo();
        }

        private void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
        {
            UpdatePowerInfo();
        }

        private void UpdatePowerInfo()
        {
            if (enableToolStripMenuItem.Checked)
            {
                PowerStatus ps = SystemInformation.PowerStatus;

                DwmEnableComposition((ps.PowerLineStatus == PowerLineStatus.Online));
            }
        }

        private void enableToolStripMenuItem_CheckStateChanged(object sender, EventArgs e)
        {
            UpdatePowerInfo();
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Close();
        }

        private static void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AboutBox ab = new AboutBox();
            ab.Show();
        }
    }
}

So there has been some rumblings on the internet about Vista with Aero enabled draining batteries a tad too fast. So instead of bitching about it, I'm going to solve it.

Here is the start to a possible programmatic solution to how to turn on and off Aero if your power source is plugged in.

http://msdn.microsoft.com/msdnmag/issues/07/04/Aero/

Use DwmEnableComposition and DwmIsCompositionEnabled

Now just need to determine how to detect when the AC is plugged in. From there, have a small app that runs in your sys tray on start up and Bam, you're done.

Who's your daddy ... exactly ... not me.

Update
Turns out Coding 4 fun has a coding example for battery life on mobile devices. I think a lunch hour and this will be cranked out.
http://blogs.msdn.com/coding4fun/archive/2006/11/12/1066558.aspx

I managed to get the relay board to stop freaking out so the application could pour more than one drink without the board having to be physically reset. The trick was not to close the serial port on dispose. The interesting part is the code still has to open the port on every use. Seems a tad counter intutative.

The pour user control is also coming along nicely. I need to get it to work in a multithreaded environment still but that is another conversation for another reason.

Now the only major tasks left are to build the mounting structure, add in the RFID front end, wire up the logout button, and do the final touches to the pour screen. Then once all that is done, throw a party to do a real world test and finally write an article about it.

This project truely does have the best type of output too.