January 2007 Entries

I'm attempting to figure out how to do a MVC with a comport that has the ability to loop for my orb.

If I spawn a new thread, terminating may be a pain with an open com when a new request comes in.

Doing the time delay may be hard too. A Thread.sleep would sleep the entire thread. wonder if I could do a timer style event.

my head hurts from work.

code that I have so far:

private static string createPagerBurst(bool EnablePaging)
{
return "~" + Enums.GetName(Enums.TransmissionType.Pager) + ((EnablePaging) ? "F" : "T");
}

private static string createAnimationBurst(Animation animation)
{
return "~" + Enums.GetName(Enums.TransmissionType.Animation) + createFirstByte(animation) + createSecondByte(animation);
}
#region animation data
private static char createFirstByte(Animation animation)
{
return createFirstByte(animation.Color, animation.AnimationStyle);
}

private static char createFirstByte(int color, Enums.AnimationStyle animation)
{
return (Char)Math.Round((double)((color + (37 * (int)animation)) / 94) + 32);
}

private static char createSecondByte(Animation animation)
{
return createSecondByte(animation.Color, animation.AnimationStyle);
}

private static char createSecondByte(int color, Enums.AnimationStyle animation)
{
return (Char)Math.Round((double)((color + (37 * (int)animation)) % 94) + 32);
}
#endregion
public class Animation
{
public int Color
{
get { return _color; }
set { _color = value; }
}
private int _color;

public Enums.AnimationStyle AnimationStyle
{
get { return _animationStyle; }
set { _animationStyle = value; }
}
private Enums.AnimationStyle _animationStyle;

public int TimeDelay
{
get { return _timeDelay; }
set { _timeDelay = value; }
}
private int _timeDelay;
}

and Global.cs:

protected void Application_BeginRequest(Object sender, EventArgs e)
{
string[] requestDispatch = stripBlanks(Request.Url.LocalPath);
}

private static string[] stripBlanks(string localPath)
{
StringCollection sc = new StringCollection();
sc.AddRange(localPath.Split('/'));
for(int i = sc.Count - 1; i >= 0; i--)
if( string.IsNullOrEmpty(sc[i]) )
sc.RemoveAt(i);

string[] temp = new string[sc.Count];

sc.CopyTo(temp, 0);

return temp;
}

It doesn't load CD Rom Drivers and Ethernet Drivers ... Yet I'm able to install it.

doodie

Things I did

  1. Go to Eric Porter's Wedding (congrates)
  2. Spend 16 glorious hours in bed. This is chances are the most amount of sleep I've gotten in the past few months. Not all alseep, but 16 hours of not getting out ruled.
  3. Work on the MVC base work for my Ambient Orb Build Status machine
  4. Get part of the ControlThink Z-Wave home automation gear I got working with my fish tank (Chuck Norris thanks Z-Wave for now having a proper light schedule.)
  5. Plot out how to create a MVC for my Z-Wave device even though their software does what I need by default. (Who needs stock software anyways, ok, my mom does)
  6. Talk with Dave Welch and remind Thad that he needs to antique Dave still.
  7. Get ddf boards ordered
  8. Test for work on compiling our solution with VS SP1 installed
  9. Modify a PDF service with an upgraded component

Things I should have done

  1. Finish the MVC
  2. Order Peapod cause my food supply is dramatically low
  3. Not be in bed for 16 hours cause I won't be able to sleep tonight
  4. Actually have corrupt PDFs to test against with the PDF service with me
  5. Do more planning / prepping for Seattle
  6. Build excel sheet for cost break down points regarding buying a condo
  7. Get some done on Where's Chuck Norris
  8. Figure out a decent webcam to track Chuck Norris (he's my clownfish in my nano-saltwater tank)

Ok, well, I've been playing around with how to pull off a Model-View Controller for my Ambient Orb.

Why? Because I want something dynamic and at my work I do the builds.

If a build fails, normally I don't realize it since I have 8 other windows covering up the virtual machine for our builds. So I'm going to create a cool MVC for the kit. Figure the URLs will be constructed something like

/pager/Enable
/pager/Disable

/anim/loop/COLOR/PATTERN/TIME(Milliseconds)/COLOR/PATTERN/TIME(Milliseconds)/....
/anim/COLOR/PATTERN/TIME(Milliseconds)/COLOR/PATTERN/TIME(Milliseconds)/....

THEN I condensed the data I need from the Orb Developer PDF into pretty much what I need. I just need to do something like

// this is all freehand without VS so syntax will be off
public static char createFirstByte(int color, int animation)
{
return (Char)Math.Round((color + (37 * animation)) / 94 + 32);
}

First Byte: (Color + (37 * anim)) / 94 + 32
Second Byte: (Color + (37 * anim)) % 94 + 32

Solid Red 0 0 "~A " (two spaces)
Solid Blue 24 0 "~A 8"
Slow pulsing red 0 2 "~A j"
Medium Pulsing
Yellow
6 4 "~A!\"

Ignore pager data ~GT
Don't ignore pager data ~GF

0 None - Solid color
1 Very Slow Pulse (pulsing is just barely perceptible)
2 Slow Pulse
3 Medium Slow Pulse
4 Medium Pulse
5 Medium Fast Pulse
6 Fast Pulse
7 Very Fast Pulse (pulsing is annoyingly fast -- no longer an ambient signal)
8 Crescendo Pulse
9 Heartbeat Pulse

Good times.

Ok, rule 1, uninstall WAP project for VS if you already have it.

Rule 2, figure out how you ran out of disk space after letting it run for an hour.

Update
Cleared some space, ran it again, worked like a very slow charm.

i got my dev kit. Now time to write a sweet web service app for build status.

http://www.ambientdevices.com/developer/Orb%20AML%202_0%20v2.pdf

So I got a snowboard at Thanksgiving. It hasn't been cold enough to go snowboarding.

SNOW DAMN IT. SNOW A LOT.

Update:
I walk out of my apartment this morning and it was snowing. Damn right mother nature. You snow when I tell you to. Now pretty please snow some more? I'll buy you some chocolate and take you to a movie ...

in 1 week, my desk has over 6" of crap on it.

Damn it.

if I close my eyes, it will go away, right? lets not even talk about laundry or dishes.

So I've been fighting a cold the past few days and I did literally nothing. I watched the entire season of Rome in 3 days, beat 1/2 of Fable and realized today I really didn't eat.

Here was what happened:
8pm - Damn, I'm hungry, lets see what is in the fridge? Milk? (and I play more fable)
9pm - Damn, I'm hungry, lets see what is in the kitchen? Cereal but I don't have milk (didn't bother checking for the milk and I play more fable)
10pm - Damn I'm hungry, OH snap, I have cereal ... and milk! (this time I looked in both placed)

As I go on and play more fable with my milk and cereal.