Tuesday, January 31, 2006

Tony Royster Jr. on the Drums

Monday, January 30, 2006

On the way back from lunch...

I saw two guys on motorcycles you know the crotch rockets and they were going down the highway at 65 mph at least doing wheelies down the road.


I never so wanted to see a whip out in my life.  But they landed them just fine.

Looked cool but what dumb asses.

Blonde Joke

This is the best blonde joke!

Friday, January 27, 2006

Man talk about a nasty week

I spent most of the week just trying to get by.   I have had this head cold that is just enough of a nuisance to make me feel not a 100% I feel fine enough to do everything I need to but the motivation just isn't there. 

Sore Throat
Pressure headache
and a very mild fever. (just enough to knock you down a bit)
stuffy nose (an after effect of the pressure headache I am sure)

But all this isn't going to stop me from going out and having a couple of drinks tonight with the wifey wife.  I invited the office but got a slew of terrible explainations of why they can't go out tonight.  My favorite?  "My cat is sick."  Choosing pussy over drinking?  Well I can't say that's the first time I have heard that.

Monday, January 23, 2006

More Nested Repeater Control

I spent some time on Saturday working on my new navigation system.  The one the required the use of Nested Repeater Controls.  While working with them a little more I found it rather challenging to write to a Literal control that was in the Header Template of the nested repeater control.  The problem I was having was figuring out how/when the ItemDataBound event got fired.  The typical place to put the event declaration is in the InitializeComponent method but this would cause a runtime error as the nested Repeater wasn't in scope just yet.

I found through some frustrating trial and error that if you put the event declaration in the main repeaters ItemDataBound event and set it before you bound the nested repeater, the event would fire correctly.

Here is the code:

   1:      private void repMenu_ItemDataBound(object sender, RepeaterItemEventArgs e)
   2:          {
   3:              repSubMenu.ItemDataBound += new RepeaterItemEventHandler(repSubMenu_ItemDataBound);
   4:              repSubMenu.DataSource = page.SelectAllWSectionIDLogic();;
   5:              repSubMenu.DataBind();
   6:          }
   7:   
   8:          private void repSubMenu_ItemDataBound(object sender, RepeaterItemEventArgs e)
   9:          {
  10:              
  11:              if (e.Item.ItemType == ListItemType.Header)
  12:              {
  13:                  litSpan = (Literal)e.Item.FindControl("litSpan");
  14:                  litSpan.Text = "<span class=\"submenu\" id=\"sub" + _count.ToString() + "\">";
  15:              }
  16:          }

Oh and if you want to see the finished Navigation you can see it here.  Used two nested Repeaters, LLBLGen Data code generation and some expanding javascript.  I am waiting on the go ahead to drop that control into the site.

Friday, January 20, 2006

The Slanket

Interesting Blanket with Sleeves.

Slanket

Thursday, January 19, 2006

Nested Repeater Controls

I am working on this variation of a main menu navigation where the submenu will display below the main navigational element once it is clicked.  Basically I was struggling with how I was going to databind the submenu to the main menu item it was related too.

I went about solving this problem by using nested repeater controls.

   1:  <asp:repeater id="repMenu" runat="server">
   2:        <itemtemplate>
   3:          <%#  DataBinder.Eval(Container.DataItem, "Name") %><br>
   4:          <asp:repeater id="repSubMenu" runat="server">
   5:               <itemtemplate>
   6:                    <%# DataBinder.Eval(Container.DataItem, "MenuTitle") %>
   7:               </itemtemplate>
   8:          </asp:repeater>
   9:       </itemtemplate>
  10:   </asp:repeater>


The above HTML defines two Repeater Controls.  The first one will display my DataBound Column Name from a Table in SQL Server. The second Repeater will display a column called Menu Title from a second DataBound Column.

Looking at the C# Code:

   1:          /// <summary>
   2:          /// Repeater Control
   3:          /// </summary>
   4:          protected System.Web.UI.WebControls.Repeater repMenu, repSubMenu;
   5:   
   6:          private void Page_Load(object sender, System.EventArgs e)
   7:          {
   8:              Section section = new Section();
   9:              repMenu.DataSource = section.SelectAll();
  10:              repMenu.DataBind();
  11:          }
  12:   
  13:          #region Web Form Designer generated code
  14:          override protected void OnInit(EventArgs e)
  15:          {
  16:              //
  17:              // CODEGEN: This call is required by the ASP.NET Web Form Designer.
  18:              //
  19:              InitializeComponent();
  20:              base.OnInit(e);
  21:          }
  22:          
  23:          /// <summary>
  24:          ///        Required method for Designer support - do not modify
  25:          ///        the contents of this method with the code editor.
  26:          /// </summary>
  27:          private void InitializeComponent()
  28:          {
  29:              this.Load += new System.EventHandler(this.Page_Load);
  30:              this.repMenu.ItemDataBound +=new RepeaterItemEventHandler(repMenu_ItemDataBound);
  31:          }
  32:          #endregion
  33:   
  34:          private void repMenu_ItemDataBound(object sender, RepeaterItemEventArgs e)
  35:          {
  36:              RepeaterItem item = e.Item;
  37:              repSubMenu = (Repeater) item.FindControl("repSubMenu");
  38:              DataRowView drv = (DataRowView) item.DataItem;
  39:              Page page = new Page();
  40:              page.SectionID = (int)drv.Row.ItemArray[0];
  41:              repSubMenu.DataSource = page.SelectAllWSectionIDLogic();;
  42:              repSubMenu.DataBind();
  43:   
  44:          }

I use LLBLGen to generate DataLayer Code automatically, your code may use DataTables, DataSets, XML, etc. The key to the code, however, is the ItemDataBound function (Lines 34-44).  Within this function is where the magic happens.  The first line (line 36) sets the line item that we are on in the first Repeater so that we can work with the data.  In the second line (line 37) we need to find the Second Repeater so we know how to work with it.  Line 38 we need to move the DataItem Row into a DataRowView so that we can access the columns.  I then initialize my datalayer class from LLBLGen and assign the sectionID from the DataRowView from the first Repeater into it. SectionID is specific to my database and tables.  I use the methods/Properties Row.ItemArray from the DataRowView class.  What ItemArray does is return the columns and the data that is bound in the first Repeater as an array.  I found from debugging and looking at the variables while stepping through the code that the column I needed SectionID was at the 0 index of the array.

I then call the method again within the LLBLGen class and methods to bring back a DataTable of all the pages that relate to the section that I am in.  I DataBind the repeater and I set the databound column I want to display MenuTitle in the HTML within the second Repeaters ItemTemplate.

The output of the nested table above would look something like this:

Section
Page
page
Page
Section
Page
Page
Page

I need to do more work to get the navigation menu to be useful like making the Section Name a linkbutton that hides/shows the nested Repeater.  I'll blog on that when I figure that part out.


Update: based on comments from Travis I was able to update my code to streamline it a little better. Instead of this line:
  40:              page.SectionID = (int)drv.Row.ItemArray[0];
I was able to replace it with:
  40:              page.SectionID = (int)drv["ID"];
Thus making it easier to get at the columns needed from the parent repeater. Thanks Travis.

Wednesday, January 18, 2006

Interesting Link: Zipcode finder

Interesting flash link that zooms in on a area of the country as you type in the zip code.

http://acg.media.mit.edu/people/fry/zipdecode/

Friday, January 13, 2006

Nick Tahous Crew have a little fun with me

Went to Nicks today for lunch and when we got back and took out our orders I found this.



HAHAH love it.  Oh and the plate was del.icio.us.

Thunderbird 1.5 RSS Engine has taken a step back

I am really disappointed in Mozilla Thunderbirds latest release 1.5 and it's built in RSS Reader.  It has basically taken steps back in terms of progress.

Let's take Robert Scoble's blog for example.  In 1.0.7 I could read the whole story within Thunderbird now I only get a description and have to read the whole story on Scobles site.  This defeats the purpose of RSS.  I originally thought Scoble changed his feed but looking at the raw RSS XML I see there is a description element and a content element description is before content and description holds the summary lines that I am getting.  There is no way to change the feed (that I know of) in Thunderbird to say display content in the body and not description.  Again this is something that has changed in 1.5 and it made the RSS engine worse.

Let's look at BrandLogic's Internal Blogs I use at the office.  I post daily on my blog what it is I do during the day simple list multiple lines.  I don't add any html or anything just drop in line item after line item.  In 1.0.7 they would show up as I typed them. In 1.5 they show up as one line.  Talk about a step back in progress.

Other bugs I have found:
  • Editing a feed is not possible the text box does not allow you to type in it.
  • When you create a new feed and you right click you only get "Copy this Link" as an option not the desired "Paste."
  • When I lose my connection on my laptop (put it in hybernate or go out of the hotspot area) RSS feeds won't update without restarting Thunderbird.
These issues have made me think about switching back to 1.0.7 until 1.5 is fixed in 1.5.1.  I am not the only one who thinks this Travis Hardiman (coworker/friend [I did make this months payment right?]) tried installing yesterday and the application wouldn't open for him.  He is currently back on 1.0.7.  At the time I thought he was full of shit when he was blaming Mozilla and talking trash about how bad this version of Thunderbird is.  Well I now agree with him.  I am downgrading.

But Thunderbird 1.0.7/1.5 is still better and less bloated then Outlook, IMO.

My Experiment with Mobile Web

So after I wrote last week asking who really browses on their phone anyways I decided to pony up the dough and see what all the fuss is about.  Many people said they read News Items and/or RSS feeds.  OK!  I'll try setting that up on my phone.  I have a Samsung A850 through Verizon (Yes I can hear you now!).  I went in and purchased the internet plan.  $5.95/month.  OK I try it. It's loading......

Loading....


Loading....

After like two minutes it finally comes up to a menu screen of other menu's...this is obviously a failure in UI on Verizons part as thier AOL styled portal is just terrible. If I want to navigate to a separate URL I have to go to search then there is a sub menu for go to url.

I decided after like 5 minutes of waiting for a crappy page to load that this wasn't for me.  I was planning on going into verizon and cancelling the service.  Then I stumbled apon Googles Personalize Page for mobile phones.  I tried this out.  And I'll say this is what I would want as my home page. RSS Feeds, News Feeds whatever you can put in the online version of Google Personalization. 

Now all I need to do is find a quick way to access it from my phone.  This might make it so that I like checking my phone for RSS feeds.  But it's still slow as hell and totally unusable.  I'll keep you posted on my progress.

Thursday, January 12, 2006

Mozilla Thunderbird 1.5 Released

Get it now

Here's what's new in Thunderbird 1.5:

  •  Automated update to streamline product upgrades. Notification of an update is more prominent, and updates to Thunderbird may now be half a megabyte or smaller. Updating extensions has also improved.
  • Sort address autocomplete results by how often you send e-mail to each recipient.
  • Spell check as you type.
  • Saved Search Folders can now search across multiple accounts.
  • Built in phishing detector to help protect users against email scams.
  • Podcasting and other RSS Improvements.
  • Deleting attachments from messages.
  • Integration with server side spam filtering.
  • Reply and forward actions for message filters.
  • Kerberos Authentication.
  • Auto save as draft for mail composition.
  • Message aging.
  • Filters for Global Inbox.
  • Improvements to product usability including redesigned options interface, and SMTP server management.
  • Many security enhancements.

Wednesday, January 11, 2006

Interesting Remote Desktop Error

I got this error when my laptop lost it's connection to the wireless router here in the office.  Remote Desktop crashed and provided this error.



Flickr

Tuesday, January 10, 2006

Monthly Elders Meeting ... Wine Tasting?

I had my monthly elders meeting tonight.  The usual go in get an update from the pastor on the state of the church, vote on any upcoming events or special needs.  Open discussion on how to get more communicates involved and attending, yada yada.

Tonight was totally different.  Walk in and I am handed a small plate with five little cups and five saltine crackers.  There are bags of cheese on the table as well.  Turns out we were taste testing a few different wines as the currect communion is too sweet for diabetics and the alternative was too dry.

So the folks at Marketview Liquor provided us with five bottles of wine.  Three of which were way to dry, two were really nice smelling and had a sweet but not to sweet taste.  But tasting between the two it was determined that one was better as it was a screw off top which was beneficial to the ladies that would have to open the bottles as well as had more contents per bottle making it more cost effective then the other bottle.

But forgetting all that after we were done with the tasting we had to run the normal meeting and I found that I was completly buzzed.

Hahaha I love church.

Monday, January 09, 2006

Burger King trying Viral Marketing again

I am not entirly sure where these pictures came from but if I had to make an educated guess it seems Burger King is trying something new after the success of it's last viral marketing try with Subserviant Chicken

Somehow paparazzi pics of the King and Brook Burke have surfaced on the internet.  The pictures show the two walking/shopping together then out onto a beach together where the King is applying sunscreen on a topless Burke.

It's pretty funny and simple and it seems to be working for Burger King if this is in fact what they are trying to do.

You can view all the pictures here.









Thursday, January 05, 2006

Photoshop Tutorial - Gift Tag

Over at the Photoshop Tutorials Blog they have a very easy tutorial on how to create a gift tag (like the one I did to the left) with Photoshop.

With this tutorial I am going to show you how to draw a gift tag like the one below. Of course this tutorial isn’t going to teach you something that you are going to use everyday, but I believe it’s useful because learning to draw simple objects like that is going to help develop your Photoshop drawing skills and gradually move on to more complex objects.

You can see my finished tutorial example to the left with my own extra twist (literally) added in. Here is my Photoshop file if you are interested.

GiftTag.psd (224.55 KB)

I learned a bunch of neat things in this tutorial What the Pen Tool can do, Custom Shape Tool, the Eclipse Tool and it's Subtract from Shape option and Gradients (although it's not specified on how to create your own gradient I did figure it out on my own).



Wednesday, January 04, 2006

Got my test results back

I went in last Wednesday to get tested for Diabetes, I have history in the family and I was showing some symptoms (excessive thirst, tired easily, heal times getting slower).  So I had some blood work done.  Results all came back normal except for my Triglycerides which were high (350 when they should be under 200).   It all just means I am a big galute and I need to exercise and lose some tonage.

Triglycerides if not kept under control can cause stroke and/or heart disease. Guess I'll have to get this under control.

Tuesday, January 03, 2006

Web Developer Extension Toolbar releases 1.0 version

Web Developer  Extension Toolbar releases the official 1.0 version.


Get it here



UPDATE: Version 1.0.1 was just released.






CNNSI Highlights The Buffalo Sabres

CNNSI is surprised at how well the Buffalo Sabres are doing.  I am not.  I knew before the lockout that they were a team up and coming.  They got a owner that truly cares about the team/sport first and making money second.  Tom Golisono is the best owner they have had, ever.

After the lockout as the rest of the league was squeezing inflated salaries into their salary caps the Sabres set a budget of $10 million under the cap.  They got rid of Satan and Zhitnik who in my opinion were useless anyways, although they were fan favorites.

It will be nice to have a playoff season again.  It's been a few years. The playoffs is were hockey really gets exciting. And if they win the Stanley Cup this year all the better (as long as they call it no goal this time).


Monday, January 02, 2006

Who really browses on their cell phone anyways?

OK so I been chewing on something Scoble blogged about a couple of days ago.  He's going to start calling web sites out that don't look good on a cell phone.  Why?  Well he says and quotes other people that back him up that Cell Phone Browsing is a trend that is hugely important coming into 2006.

I don't get it.  Are people actually spending their time waiting for sites to load on their phone to make it worth the trouble to download my site?  I don't think so.  How would I be turning away customers if my site isn't mobile compatible?  Do people actually shop online with their phone? 

Maybe it's different on the West coast (as Scoble is in Washington) then it is here in the East Coast (Rochester, NY) but I've only known a couple of people that have their mobile web activated on their phone.  And the two times I seen them use it it was to look up a movie time or look up an answer to a trivia question we absolutely needed to know...of course it wasn't at that minute as it took forever for the pages to load then the T9 typing then the post back I think it took 10 minutes on the phone what would take 20 seconds on a computer.   But it certainly wasn't to look at and answer e-mail.

I bought a Samsung a couple of months ago and I elected not to get the mobile Internet package. Why? because I felt I would never use it.  And I am right.  I would never want to read RSS feed on there as it would be to slow and for the content that required some sort of plug-in what use would it be reading it on the phone?  Buying things online through your phone?  No way I would never do that.  I would sit down at my computer and do that. Don't get me wrong I have bought stuff with my phone but it was games for my phone and it was terribly slow and I won't do it again.

So I ask what is it that makes my web site so important to be viewed on a cell phone?  What would I be missing out on if I didn't have a mobile ready page of my site?  Wouldn't my RSS feeds handle any mobile users that are interested in my site? 

Look to the left for a list of my other sites...MediaGab actually has products that are for sale.


Time for a new Avatar

It's 2006 time to change from the Santa Avatar I use on Forums to this one:


Sunday, January 01, 2006

AJAX for dummies

AJAX is the latest buzz word going around the internet.  But what is it?  Well it's basically a way to send data with Javascript with XML calls.  But for some reason it sounds complicated and hard.  But here is a 30 second AJAX Tutorial I found that gets you up and going quick.  Here is the article posted below.


I find a lot of this AJAX stuff a bit of a hype.  Lots of people have
been using similar things long before it became "AJAX". And it really
isn't as complicated as a lot of people make it out to be. Here is a
simple example from one of my apps. First the Javascript:

function createRequestObject() {
var ro;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
ro = new ActiveXObject("Microsoft.XMLHTTP");
}else{
ro = new XMLHttpRequest();
}
return ro;
}

var http = createRequestObject();

function sndReq(action) {
http.open('get', 'rpc.php?action='+action);
http.onreadystatechange = handleResponse;
http.send(null);
}

function handleResponse() {
if(http.readyState == 4){
var response = http.responseText;
var update = new Array();

if(response.indexOf('|' != -1)) {
update = response.split('|');
document.getElementById(update[0]).innerHTML = update[1];
}
}
}

This creates a request object along with a send request and handle
response function. So to actually use it, you could include this js in
your page. Then to make one of these backend requests you would tie it
to something. Like an onclick event or a straight href like this:

<a href="javascript:sndReq('foo')">[foo]</a>

That means that when someone clicks on that link what actually happens
is that a backend request to rpc.php?action=foo will be sent.

In rpc.php you might have something like this:

switch($_REQUEST['action']) {
case 'foo':
/ do something /
echo "foo|foo done";
break;
...
}

Now, look at handleResponse. It parses the "foo|foo done" string and
splits it on the '|' and uses whatever is before the '|' as the dom
element id in your page and the part after as the new innerHTML of that
element. That means if you have a div tag like this in your page:

<div id="foo">
</div>

Once you click on that link, that will dynamically be changed to:

<div id="foo">
foo done
</div>

That's all there is to it. Everything else is just building on top of
this. Replacing my simple response "id|text" syntax with a richer XML
format and makine the request much more complicated as well. Before you
blindly install large "AJAX" libraries, have a go at rolling your own
functionality so you know exactly how it works and you only make it as
complicated as you need. Often you don't need much more than what I
have shown here.

Expanding this approach a bit to send multiple parameters in the
request, for example, would be really simple. Something like:

function sndReqArg(action,arg) {
http.open('get', 'rpc.php?action='+action+'&arg='+arg);
http.onreadystatechange = handleResponse;
http.send(null);
}

And your handleResponse can easily be expanded to do much more
interesting things than just replacing the contents of a div.


Happy New Year

Happy New Year 2006!!!!

We went out to the Chineese Buffet tonight, it was great we had the place to ourselves and they had crab legs.  Hope and I spent so much time cracking those legs open.  I went for the sushi which was surprisingly good tonight.  At the end of dinner they bring us a couple of boxes of take out to take with us as it was getting close to closing time and they were trying to get rid of the food still left out on the bar.  I still haven't looked to see what they gave us.

On the way home the Dome Arena was setting off fireworks as the had a family New Years night where they celebrate New Years at 9PM for the kids.  We pulled over and caught the last 10 minutes of the fireworks.

We came home and watched Dick Clark on ABC. I had totally forgot that he had a stroke the year before and it was kind of a shock to watch him slur through the broadcast.  It's good for him that he feels good enough to go throught the whole show but I think we will find out that many people will switch over to Regis on FOX. It was hard to stomach watching Dick Clark tonight.

Well anyway here is to the new year may it be healthy and prosperous to you all.

The Official jQuery Podcast

with Ralph Whitbeck & Rey Bango

You can subscribe to the show in iTunes or via the raw RSS feed

My Twitter Updates

View Twitter Page