So I have a couple of pages on our site that use javascript to display the date and or time. And of course none of them have the same format. Right now each page has a different javascript to display the date. And if course that isn't very modular. So I wrote an fairly complete javascript function, that if you tell it the format you want it in it will give today's date in the format.
Here are the formats available:
shortdate: 3/2/2004
shortdatetime: 3/2/2004 10:35
shortdateUTCtime: 3/2/2004 18:35:27
longdate: March 2, 2004
longdatetime: March 2, 2004 10:38
longdateUTCtime: March 2, 2004 18:40:12
longweekday Tuesday, March 2, 2004
longweekdaytime Tuesday, March 2, 2004 10:41
longweekdayUTCtime Tuesday, March 2, 2004 18:42:18
You can download the source code here.
Download the text file and change it to a iDate.js. The file is commented on how to use it.
Feel free to use it in your projects.
Tuesday, March 02, 2004
Monday, March 01, 2004
Which Forgotten 80s Cartoon Character are you?
I got this link from PixieStitch. She was Butterbear from the Wuzzles. Too Funny!
You are He-Man from Masters of the Universe! You
take life very seriously, and you should, considering you are the keeper of all that is good and right in the universe! However, your nonstop suspicion of Skeletor and his henchman can start your friends wondering why you don't loosen up once in awhile.
Which Forgotten 80s Cartoon Character Are You?
brought to you by Quizilla
The funny thing about this, is He-man was one of my least favorite cartoons. I always thought if it as filler. I always thought I would me more like Lt. Quicksilver, from the Silverhawks.
take life very seriously, and you should, considering you are the keeper of all that is good and right in the universe! However, your nonstop suspicion of Skeletor and his henchman can start your friends wondering why you don't loosen up once in awhile.
Which Forgotten 80s Cartoon Character Are You?
brought to you by Quizilla
The funny thing about this, is He-man was one of my least favorite cartoons. I always thought if it as filler. I always thought I would me more like Lt. Quicksilver, from the Silverhawks.
Sunday, February 29, 2004
"This land was once, green and good"
Yesterday I bought the movie "The Dark Crystal". I knew what all of the characters where named for the most part, but I didn't remember the story. The details of the story anyway. So my Beautiful Wife and I are watching the movie. The narrator is telling the history of the story. He says, "This land was once green and good, before the crystal cracked". I thought, hold the phone, I have heard that recently; in fact I know all of this. It isn't that my memory was that good. It's the opening lyrics for "The Crystal Method" song "Trip like I do". Which I thought was very hip. It's not the same voice as the narrator in the movie, which somehow I like even more. I forgot how beautiful and enchanting this film is. It is simply amazing to me that this film was made in 1982. Jim Henson was a genius.
I have seen "The Dark Crystal" tons of times when I was a kid. Not in the movie theater though, we didn't go to the movies that often. You see when I was growing up we had the movie on CED disc. Our first CED player was a Zenith and we got it at GEMCO. Mom and Dad had put it on layaway. I remember when we picked it up. It was a Friday night and we even got the movie "Dumbo". I remember going home and watching it all the way through and feeling like I had stayed up really late (9:30pm). I must have been 8 or 9 years old. Then the next morning we got up early to watch it again.
It’s really funny the flood of memories that comes back thinking about these CED movies. The little store in Arcadia that we use rent the CEDs from, the library of CEDs that Grandma and Grandpa use to have. In fact we had just come home from the Video store when I got my finger partial cut off in the car door of our old 1973 ford pinto station wagon. I had the movie ”Alice in Wonderland” in my left hand, and I took the tip of my ring finger off with the car door on my right hand. The same car door, that my Brother and I would ask Mom to leave the window rolled down so that we could jump through it like they did in “the Dukes of Hazzard”.
I remember when Dad figured out to hook up the CED player to the stereo. (This was like in 1985-86 mind you) and Dad had these big tower speakers that he had built. They were taller than I was at the time. Anyhow us kids were watching the movie “The Neverending Story” and Mom was ironing. It got to the scene where the Rock Biter was riding his stone scooter and the floor shook. It was so cool. It felt like you where in the movie. I looked over at Mom grinning and she smiled at me and pointed at the measuring cup full of water on the ironing board and you could see the ripples in the cup from the stereo. We also use to watch the CEDs that were music videos for kids, It was called DTV (Disney TV). and it would have a montage of cartoons edited to go with songs like Hall and Oats’ “Private Eyes”.
I just did a search on ebay for CED. I was amazed with what came up. Hmmm, I may have to pick a couple up for Nostalgia.
I have seen "The Dark Crystal" tons of times when I was a kid. Not in the movie theater though, we didn't go to the movies that often. You see when I was growing up we had the movie on CED disc. Our first CED player was a Zenith and we got it at GEMCO. Mom and Dad had put it on layaway. I remember when we picked it up. It was a Friday night and we even got the movie "Dumbo". I remember going home and watching it all the way through and feeling like I had stayed up really late (9:30pm). I must have been 8 or 9 years old. Then the next morning we got up early to watch it again.
It’s really funny the flood of memories that comes back thinking about these CED movies. The little store in Arcadia that we use rent the CEDs from, the library of CEDs that Grandma and Grandpa use to have. In fact we had just come home from the Video store when I got my finger partial cut off in the car door of our old 1973 ford pinto station wagon. I had the movie ”Alice in Wonderland” in my left hand, and I took the tip of my ring finger off with the car door on my right hand. The same car door, that my Brother and I would ask Mom to leave the window rolled down so that we could jump through it like they did in “the Dukes of Hazzard”.
I remember when Dad figured out to hook up the CED player to the stereo. (This was like in 1985-86 mind you) and Dad had these big tower speakers that he had built. They were taller than I was at the time. Anyhow us kids were watching the movie “The Neverending Story” and Mom was ironing. It got to the scene where the Rock Biter was riding his stone scooter and the floor shook. It was so cool. It felt like you where in the movie. I looked over at Mom grinning and she smiled at me and pointed at the measuring cup full of water on the ironing board and you could see the ripples in the cup from the stereo. We also use to watch the CEDs that were music videos for kids, It was called DTV (Disney TV). and it would have a montage of cartoons edited to go with songs like Hall and Oats’ “Private Eyes”.
I just did a search on ebay for CED. I was amazed with what came up. Hmmm, I may have to pick a couple up for Nostalgia.
Friday, February 27, 2004
Quick observation
If you don't get much sleep the night before, and you have a lot of busy work to do in the morning, A Quad (4 shoots of espresso) White Chocolate Moca is the only way to go. I just got three hours worth of work done in an hour. On the flipside, I am hoping that I will be able to blink again fairly soon.
Thursday, February 26, 2004
A musical interlude
How about a little break from all of the technical mumbo jumbo that I talk about all of the time? How about music? I was talking about music with a friend tonight on the train home. We were talking about what we were each listening to, and what we liked or didn't like about each band or artist. Then we got on the subject of music that we didn't like.
Interesting enough for me, it is music that is over produced. Music that feels like it has been overcrafted by the A and R man at the record company. For example any song where the band or artist has their name in the song more then two times, definitely out. If all of the human qualities are carefully edited out of the track, thah is another one that is out. The other thing that I don't like is the band in their songs, or interviews telling me that they are hip and that I should listen to them. That's not how It works, they get to play the music and we as fans get to tell them if they are hip. Of if they shouldn't quit their day jobs.
I listen to a fairly wide variety of music. Techno to Jazz, Singer Song writer to Big Band. And some of my favor music has little mistakes in it. It makes it human. When the singer stands back to take a breath and you hear it. The sounds of the guitars fretting the strings as he moves his hands up the neck of the guitar. The drummer slowing down just enough to notice at the end of a long set. I like these things in a recording. I think that some people have gotten away from the true meaning of a album or a recording. It to me was to represent the live peformance, that you were either present at, or wished you were. Now don't get me wrong, I am not saying that all bands should peform each song exactly as it is on the album. I mean almost the opposite. The albums should have a flow, and a freedom that a live concert has. The freedom leave those little mistakes in.
So when I got home, I was in the mood to listen to some Jazz. So I grabbed my copy of Blue Miles, Miles Davis. This is an amazing album. I forgot how good it really is. This album isn't the kind of Jazz that has musical runs for the sake of the musicians. Nothing like that, you can tell, that Miles felt that each note was valuable and that runs like that was wasting a commodite of music. Each song is a master piece in Jazz. The best way I can describe it is, the he plays these very logically musical phrases, and them builds on them, and lets them build on themselves. Each note feels handcrafted. When he plays it, you completely expect it to be there. Which is simply stunning. Think about the songs that you add an extra note to, or leave one off when you hum or sing. That is because something about that note didn't make sent to you. Your mind says this should be added or this should be removed. There isn't any of that with this album. Every note needs to be exactly where it is. It is quite amazing.
Something about music that I have always loved is that it can be completely logical and completely emotional all at the same time. That the music has this structure yet in our minds we link a song to a time, place, feelings, people. There is something so strong in that.
So what is your favorite thing about music?
Interesting enough for me, it is music that is over produced. Music that feels like it has been overcrafted by the A and R man at the record company. For example any song where the band or artist has their name in the song more then two times, definitely out. If all of the human qualities are carefully edited out of the track, thah is another one that is out. The other thing that I don't like is the band in their songs, or interviews telling me that they are hip and that I should listen to them. That's not how It works, they get to play the music and we as fans get to tell them if they are hip. Of if they shouldn't quit their day jobs.
I listen to a fairly wide variety of music. Techno to Jazz, Singer Song writer to Big Band. And some of my favor music has little mistakes in it. It makes it human. When the singer stands back to take a breath and you hear it. The sounds of the guitars fretting the strings as he moves his hands up the neck of the guitar. The drummer slowing down just enough to notice at the end of a long set. I like these things in a recording. I think that some people have gotten away from the true meaning of a album or a recording. It to me was to represent the live peformance, that you were either present at, or wished you were. Now don't get me wrong, I am not saying that all bands should peform each song exactly as it is on the album. I mean almost the opposite. The albums should have a flow, and a freedom that a live concert has. The freedom leave those little mistakes in.
So when I got home, I was in the mood to listen to some Jazz. So I grabbed my copy of Blue Miles, Miles Davis. This is an amazing album. I forgot how good it really is. This album isn't the kind of Jazz that has musical runs for the sake of the musicians. Nothing like that, you can tell, that Miles felt that each note was valuable and that runs like that was wasting a commodite of music. Each song is a master piece in Jazz. The best way I can describe it is, the he plays these very logically musical phrases, and them builds on them, and lets them build on themselves. Each note feels handcrafted. When he plays it, you completely expect it to be there. Which is simply stunning. Think about the songs that you add an extra note to, or leave one off when you hum or sing. That is because something about that note didn't make sent to you. Your mind says this should be added or this should be removed. There isn't any of that with this album. Every note needs to be exactly where it is. It is quite amazing.
Something about music that I have always loved is that it can be completely logical and completely emotional all at the same time. That the music has this structure yet in our minds we link a song to a time, place, feelings, people. There is something so strong in that.
So what is your favorite thing about music?
Quote of the Day
<quote source="DuckSoup">you are consumed with thoughts of ASP.boring </quote>
Okay DuckSoup I will try (I make no promises) to not go more than two entries in arow about Programming. Hummm I may have to start pickup the news paper again, or I can use Google News.
A little .Net issue reminder
Ed asked me if I had used hidden field in ASP.NET. I said, "I think so?". So we went to check out the issue. And it is simply this, even if you are using an html control in ASP.NET, if you are going to fill the value of that hidden field from a function or programmatically, the html control needs the attribute runat="server".
when you think about it, it makes sense, how else would ASP.NET know that the html control exist. Ah the joys of programming for a stateless protocol
Wednesday, February 25, 2004
things to do at 3:30 AM
I guess I couldn't sleep last night. So at about 3:30am I gave up trying to. Now there are a couple things you can do at 3:30, I mean hey, the 7-11 is open, some of the finest informercials are on at that time. So what would I do? Humm, I think I'ill start studying and creating an XML Schema for our real estate rates at work. Now, I know what you are think, 'hey man, you can't have that kind of fun at the time of the morning, it is illegal or something.' And in all truth it should be, but it isn't.
So I started looking around for some good sites on XML Schema. The first site the showed up on my google search was of course the W3C. They are the people that create most of the standards that are using on the internet link HTML,XML and XHTML. I am thankful they are there, but I have never been able to sucessfully read any of the documentation on their site. So I looked a little more and I found w3school. This was a little more like it, they broke the content in to byte size pieces, and in an hour I had the startings of my first XML Schema.
So I started looking around for some good sites on XML Schema. The first site the showed up on my google search was of course the W3C. They are the people that create most of the standards that are using on the internet link HTML,XML and XHTML. I am thankful they are there, but I have never been able to sucessfully read any of the documentation on their site. So I looked a little more and I found w3school. This was a little more like it, they broke the content in to byte size pieces, and in an hour I had the startings of my first XML Schema.
Monday, February 23, 2004
.Net Rocks and the CMS goes on
So I finally got to hear the .NET Rocks show with Scott Hanselman. Well what can I say, the guy is brilliant. He introduced a concept that was very new to me, but instantly made sense. It's called "Declarative Programming". He talked about writing code that generated the code for you. So you write an XML schema that follows the business logic of the application you are writing. Then you write an engine to render your schema. So now you can change parts of the schema at will, without having to rewrite all of your code. Also you can test sooner and faster. Like I said, this is a new concept to me, but I plan on studying it.
I am still working at putting the content in to the CMS. I have approximately 120 pages of the site in the CMS now. It is looking really good. Now I have to track down all of those pesky orphan pages and give them some structure. Also I think that I am going to rewrite the Site Map page to take advantage of the fact the CMS is so structured. That way I never have to update the Site Map. I can just let the CMS take care of that.
Well, my handy dandy Sony laptop just keeps plugging away. I took it to work today, because I usually do so work on the train or work at home, and needed to sync up with my station at work. Man, am I glad I did, It seems this weekend the power supply or more specifically the power supply fan had felt the need to give up the ghost. The fan still spins, kind of, it sounds terrible and you just know that at any minute that the thing is going to freeze up. So I worked from my laptop today, and left the workstation shut down. That means this little machine has been going for almost 14 hours today. What a great computer. It's hard to believe it is already three years old. This laptop is more reliable then some people I know.
I am still working at putting the content in to the CMS. I have approximately 120 pages of the site in the CMS now. It is looking really good. Now I have to track down all of those pesky orphan pages and give them some structure. Also I think that I am going to rewrite the Site Map page to take advantage of the fact the CMS is so structured. That way I never have to update the Site Map. I can just let the CMS take care of that.
Well, my handy dandy Sony laptop just keeps plugging away. I took it to work today, because I usually do so work on the train or work at home, and needed to sync up with my station at work. Man, am I glad I did, It seems this weekend the power supply or more specifically the power supply fan had felt the need to give up the ghost. The fan still spins, kind of, it sounds terrible and you just know that at any minute that the thing is going to freeze up. So I worked from my laptop today, and left the workstation shut down. That means this little machine has been going for almost 14 hours today. What a great computer. It's hard to believe it is already three years old. This laptop is more reliable then some people I know.
Sunday, February 22, 2004
Is that a Peacock in my livingroom or are you just happy to see me
So Friday I didn't have much excitement. I worked from home. I was going to drive in for the interview we had for the eMarketing position, I got about halfway there and my boss (The coolest boss in the whole world ) called and said, 'hey, if you haven't already just turn around and go back home'. And being that I had already been driving an hour and the way traffic was going it was going to be another hour before I got to work. I took his very wise advice. So I had them call me in to the interview and I did my part on the cell phone on the way back home.
Oh, on Friday Scott Hanselman was going to be on .NET Rocks. And I made sure I told everyone at work that would even be remotely interested. So what did I do? I forgot that it was on 9am PT and missed it! D'oh!
Friday night, over at the Folk's playing darts on the new dartboard my brother had just bought for Dad. (It's a really nice one, way to go big-little brother!) So we are joking around and I let something out of my mouth that was sharper and flew truer than the darts. You see Dad has been a city inspector now for about a year and four months. Before he was, we always had this saying about inspectors, but no one had said it since Dad became one. So I did. <quote src=”me”>You know what they say big-little brother, those that don't do, inspect!</quote> So my two brothers, I and my Dad and laughing so hard we are crying. What can I say, it had to be done. Of course Dad has a great sense of humor, and took it great!
Saturday I worked from home, on getting content into the CMS. It's a lot of tedium but in the end it is going to be a good thing. Saturday night we went to my Folks house, for my Cousin's anniversary dinner. What can I say never a dull moment at the Folks'.
Today was a nice day, this afternoon My Beautiful Wife and I where just relaxing and decided to go to the movies. We saw “Something's Gotta Give”. It is the second time we've seen it and we laughed harder than the first time! It's a great movie and very funny, however it is not made for the 18-35 year old demographic. You need a little life experience to get how funny this movie is.
Anyhow so we come home and what do I see in my living room? A peacock! No, I am not talking about the terrible sunday night lineup on NBC, I mean a real life, bird brain, crapping on the carpet peacock! I have to admit this took me back a moment. It isn't everyday that you walk into your living room and see live poultry.
It seems that my step-daughter's friend found it and brought it over for us to see. I don't like birds, I really don't! All I can say is being 10 years old and watching Alfred Hitchcock's “The Birds” at 2am will scar anyone for life, okay! So they are telling me what the thing eats (mind you there is a flippin' peacock in my living room!) and so I ask how it feels about garlic. The look at me with a puzzled look and I suggested that it would be best served with garlic and walked out of the room.
Oh, on Friday Scott Hanselman was going to be on .NET Rocks. And I made sure I told everyone at work that would even be remotely interested. So what did I do? I forgot that it was on 9am PT and missed it! D'oh!
Friday night, over at the Folk's playing darts on the new dartboard my brother had just bought for Dad. (It's a really nice one, way to go big-little brother!) So we are joking around and I let something out of my mouth that was sharper and flew truer than the darts. You see Dad has been a city inspector now for about a year and four months. Before he was, we always had this saying about inspectors, but no one had said it since Dad became one. So I did. <quote src=”me”>You know what they say big-little brother, those that don't do, inspect!</quote> So my two brothers, I and my Dad and laughing so hard we are crying. What can I say, it had to be done. Of course Dad has a great sense of humor, and took it great!
Saturday I worked from home, on getting content into the CMS. It's a lot of tedium but in the end it is going to be a good thing. Saturday night we went to my Folks house, for my Cousin's anniversary dinner. What can I say never a dull moment at the Folks'.
Today was a nice day, this afternoon My Beautiful Wife and I where just relaxing and decided to go to the movies. We saw “Something's Gotta Give”. It is the second time we've seen it and we laughed harder than the first time! It's a great movie and very funny, however it is not made for the 18-35 year old demographic. You need a little life experience to get how funny this movie is.
Anyhow so we come home and what do I see in my living room? A peacock! No, I am not talking about the terrible sunday night lineup on NBC, I mean a real life, bird brain, crapping on the carpet peacock! I have to admit this took me back a moment. It isn't everyday that you walk into your living room and see live poultry.
It seems that my step-daughter's friend found it and brought it over for us to see. I don't like birds, I really don't! All I can say is being 10 years old and watching Alfred Hitchcock's “The Birds” at 2am will scar anyone for life, okay! So they are telling me what the thing eats (mind you there is a flippin' peacock in my living room!) and so I ask how it feels about garlic. The look at me with a puzzled look and I suggested that it would be best served with garlic and walked out of the room.
Thursday, February 19, 2004
Blog Blog fun for boys and girls
So I was listening to dontNetRocks and Robert Scoble was the guest for their November 04, 03 show.<warning>This is a geek radio show put on my computer nerds and geeks for computer nerds and geeks, yes they wear glasses with tape in the middle and pocket protectors and yes I am sure they can quote every line from the entire Monty Python library. However they are specifically discussing the programming language that I write in more of everyday than I do english, so I have to listen.</warning>
And it was all about blogging. Which was pretty cool. One of the sites them mentioned in the show is a site called feedster.com. Feedster is the google of blogs. Which is very nice. So I thought lets see if my little blog was on it. It was, I was amazed, I did a search on "BBQ and the ZOO" , the title of my blog on Monday, Feb 16th, and it came up, not only did it come up but it came up in the second position. (Whoa!) So I now have search on my blog, and it uses feedster as it's search engine!
It has been fairly quiet here today. Infact it has been almost 24 hrs since I threw my little hissy fit walked away from my desk and threaten not to come back. Everyone was very nice to me today and just wanted to know if I was okay. (IE these are the people that won't be targets when the repeater rifle and belltower scene plays out) Anyhow today is nice and quiet and I am gettings lots of work done!
And it was all about blogging. Which was pretty cool. One of the sites them mentioned in the show is a site called feedster.com. Feedster is the google of blogs. Which is very nice. So I thought lets see if my little blog was on it. It was, I was amazed, I did a search on "BBQ and the ZOO" , the title of my blog on Monday, Feb 16th, and it came up, not only did it come up but it came up in the second position. (Whoa!) So I now have search on my blog, and it uses feedster as it's search engine!
It has been fairly quiet here today. Infact it has been almost 24 hrs since I threw my little hissy fit walked away from my desk and threaten not to come back. Everyone was very nice to me today and just wanted to know if I was okay. (IE these are the people that won't be targets when the repeater rifle and belltower scene plays out) Anyhow today is nice and quiet and I am gettings lots of work done!
Wednesday, February 18, 2004
Wednesday and XML
Are we sure that it was a wednesday? It really felt more like a thursday to me. Anyways it was a day and that is good enough. I was about to wake up and take a deep breath. (and cough immediately afterwards) I'm not sure that I was completely ready for the day. But it came anyway and in the end I am glad I was a part of it.
Well on to more constructive things. XML and XSL. XML and XSL are a great way to handle some of the navigation choirs that we have to deal with day in and day out. For example you have a page that some users want links to sites, and other users want links to blogs. Why not keep all that data in one place.
<?xml-stylesheet type="text/xsl" href="links.xsl"?>
<navroot>
<link id="1" name="google" navlevel="1">http://www.google.com</link>
<ink id="2" name="builder" navlevel="1">http://www.builder.com</link>
<link id="3" name="tech republic" navlevel="1">http://www.techrepublic.com</link>
<link id="4" name="lockheed" navlevel="1">http://www.lockheedfcu.org</link>
<link id="5" name="Computer Zen" navlevel="2">http://www.computerzen.com</link>
<link id="6" name="Chardy" navlevel="2">http://chardy101.blogspot.com</link>
<link id="7" name="Adventures in Real Life" navlevel="2">http://o2bjang.blogspot.com</link>
<link id="8" name="Pixie Stitch" navlevel="2>http://pixiesitch.blogspot.com</link>
</navroot>
As you can see the site links have a navlevel of 1 and blog links have a navlevel of 2. Easy enough right. So how are we going to show these links to our users? This is where XSL comes in. What we are going to do is write an XSL that will show only the navlevel we specify, lets say navlevel 2. It would look something like this:
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="/navroot/link[@navlevel='2']">
<a>
<xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
<xsl:value-of select="@name" />
</a>
<br />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
What we see in this example is that the XSL is looping through all of the <link> elements and looking for the attribute navlevel='2' when if finds it, it writes and a href from the <link> element and the name attribute with in the link tag. So in the browser it looks something like this:
Computer Zen
Chardy
Adventures in Real Life
Pixie Stitch
Let's go over the xsl in a little more detail of what the XSL is doing. First we are have the XSL loop through all of the link elements in the XML document and take an action when it finds a navlevel='2'. This is handled in the <xsl:for-each select="/navroot/link[@navlevel='2']">. Think of this as XSL's for loop. This was a fairly simple example of what can be done with XML and XSL but I hope that you find it helpful.
Well on to more constructive things. XML and XSL. XML and XSL are a great way to handle some of the navigation choirs that we have to deal with day in and day out. For example you have a page that some users want links to sites, and other users want links to blogs. Why not keep all that data in one place.
<?xml-stylesheet type="text/xsl" href="links.xsl"?>
<navroot>
<link id="1" name="google" navlevel="1">http://www.google.com</link>
<ink id="2" name="builder" navlevel="1">http://www.builder.com</link>
<link id="3" name="tech republic" navlevel="1">http://www.techrepublic.com</link>
<link id="4" name="lockheed" navlevel="1">http://www.lockheedfcu.org</link>
<link id="5" name="Computer Zen" navlevel="2">http://www.computerzen.com</link>
<link id="6" name="Chardy" navlevel="2">http://chardy101.blogspot.com</link>
<link id="7" name="Adventures in Real Life" navlevel="2">http://o2bjang.blogspot.com</link>
<link id="8" name="Pixie Stitch" navlevel="2>http://pixiesitch.blogspot.com</link>
</navroot>
As you can see the site links have a navlevel of 1 and blog links have a navlevel of 2. Easy enough right. So how are we going to show these links to our users? This is where XSL comes in. What we are going to do is write an XSL that will show only the navlevel we specify, lets say navlevel 2. It would look something like this:
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="/navroot/link[@navlevel='2']">
<a>
<xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
<xsl:value-of select="@name" />
</a>
<br />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
What we see in this example is that the XSL is looping through all of the <link> elements and looking for the attribute navlevel='2' when if finds it, it writes and a href from the <link> element and the name attribute with in the link tag. So in the browser it looks something like this:
Computer Zen
Chardy
Adventures in Real Life
Pixie Stitch
Let's go over the xsl in a little more detail of what the XSL is doing. First we are have the XSL loop through all of the link elements in the XML document and take an action when it finds a navlevel='2'. This is handled in the <xsl:for-each select="/navroot/link[@navlevel='2']">. Think of this as XSL's for loop. This was a fairly simple example of what can be done with XML and XSL but I hope that you find it helpful.
Monday, February 16, 2004
BBQ and the Zoo
Today is president's day, so as many people do, I had the day off. Being that my wonderful Wife was away at a seminar all weekend this was our day to spend sometime together. And of course the little boy had the day off too! So we planned to go have some serious (Yet not to expensive) fun. So we decided on the Zoo, it was close and fairly cheap. (we thought that before we got there) On the way to the LA Zoo we decided to stop and have lunch at the "Black Cow Cafe" in montrose. It is someplace that we used to eat at all of the time when we lived in pasadena and montrose. Of course we get there and they are closed for presidents day.
<sidenote>It's amazing how irritating it is when a restaurant closes for a holiday. But that it's fine for you to have it off.</sidenote>
So we walked around downtown montrose and found this little place called Zeke's Smokehouse.It looked great and had things on the menu I can eat. (It's amazing how limiting being allergic to wheat is in your food choices) So we thought we would give it a try. It was fantastic! This is just hardcore food, no apologize, no tree hugging vegan entrees! Ribs, Beef Brisket, Meatloaf, Beef and Pork links! It's the first time that I have seen real hushpuppies in southern california. The meal was great! My wonderful wife had the BBQ chicken sandwich, the little boy had the chicken and I had the Beef and Pork links. It was all so good that I kept eating long after I was full.
So now that we are all fed, and in need of a walk. We were off to the Zoo. There was an issue with this, that we didn't know of before we left the house. Everyone else was off to the Zoo too! I haven't ever seen so many people their. You would of thought that they were giving money away. There was a 20 minute line to get tickets. There was a line for everything. Don't get me wrong it was a lot of fun. The little boy was nothing but a kick. He is such a ball of energy. Zooming from here to there to here again. Keep up! He would cry dragging My Wife and I behind him. After a little bit we need a little treat. We weren't really hungry just needed something sweet. So I went to the little Zoo cafeteria there to get some Ice Cream. Now here is where they get you, by the time you have stood in the line long enough to get up to where you can see the prices on the sign you aren't going to leave. So with credit report in hand I was able to finance three small ice cream cones with a fairly good interest rate for the next 36 months. (They told me that my credit score wasn't good enough for three large cones.)
We got to see some skunks, monkeys, deer, elephants, weasels, camels, flamingos, pimps and hoes. (funny enough not all of the creatures listed above where in cages some where walking around the park looking for mates). The hours of the Zoo are officially 10am - 5pm. However I feel these are a little inaccurate. True enough that it opens at 10am. However the closing at 5pm is a little deceiving. What they really mean is that if you are in the park at 5pm find a safe place to sleep because they have closed the gates and left for the evening. Really and truly leaving at 4:50pm is pushing it.
In the end we had fun and it was a good day off. However there were two lessons learned. One never go to the Zoo on a holiday. Two, don't even eat breakfast before you go to Zeke's for lunch.
<sidenote>It's amazing how irritating it is when a restaurant closes for a holiday. But that it's fine for you to have it off.</sidenote>
So we walked around downtown montrose and found this little place called Zeke's Smokehouse.It looked great and had things on the menu I can eat. (It's amazing how limiting being allergic to wheat is in your food choices) So we thought we would give it a try. It was fantastic! This is just hardcore food, no apologize, no tree hugging vegan entrees! Ribs, Beef Brisket, Meatloaf, Beef and Pork links! It's the first time that I have seen real hushpuppies in southern california. The meal was great! My wonderful wife had the BBQ chicken sandwich, the little boy had the chicken and I had the Beef and Pork links. It was all so good that I kept eating long after I was full.
So now that we are all fed, and in need of a walk. We were off to the Zoo. There was an issue with this, that we didn't know of before we left the house. Everyone else was off to the Zoo too! I haven't ever seen so many people their. You would of thought that they were giving money away. There was a 20 minute line to get tickets. There was a line for everything. Don't get me wrong it was a lot of fun. The little boy was nothing but a kick. He is such a ball of energy. Zooming from here to there to here again. Keep up! He would cry dragging My Wife and I behind him. After a little bit we need a little treat. We weren't really hungry just needed something sweet. So I went to the little Zoo cafeteria there to get some Ice Cream. Now here is where they get you, by the time you have stood in the line long enough to get up to where you can see the prices on the sign you aren't going to leave. So with credit report in hand I was able to finance three small ice cream cones with a fairly good interest rate for the next 36 months. (They told me that my credit score wasn't good enough for three large cones.)
We got to see some skunks, monkeys, deer, elephants, weasels, camels, flamingos, pimps and hoes. (funny enough not all of the creatures listed above where in cages some where walking around the park looking for mates). The hours of the Zoo are officially 10am - 5pm. However I feel these are a little inaccurate. True enough that it opens at 10am. However the closing at 5pm is a little deceiving. What they really mean is that if you are in the park at 5pm find a safe place to sleep because they have closed the gates and left for the evening. Really and truly leaving at 4:50pm is pushing it.
In the end we had fun and it was a good day off. However there were two lessons learned. One never go to the Zoo on a holiday. Two, don't even eat breakfast before you go to Zeke's for lunch.
Saturday, February 14, 2004
A great waste of time
So I found this little game online that I can't stop playing. It's the only Trials game I've ever seen. You only have the arrow keys to balance, accelerate, and jump. To begin wasting your time on an addictive little game click here
Quote of the Day
<quote src="PixieStitch"> PH34R His Madskillz. < funtion run="translation" value="True" > Fear his abilties. </quote>
Thanks PixieStitch, this made me smile! :-)
Thanks PixieStitch, this made me smile! :-)
Starbuck flows through my blood
I know that I haven't blogged since Wednesday. And lets face it, that one wasn't terribly exciting. (Not that this one is going to be some great literary work either) It's just that work has been so nuts. We are implementing the CMS from Bravo Zulu. It's called SiteSolution. I really can't speak highly enough about it. It uses XSL to translate the XML extract from the database in to, well your website.
So now that I have this amazing web publishing and content management tool, I have to get the entire web site into it. That doesn't sound that bad right? I didn't think so either, until I did the spreadsheet. I listed the pages, and the elements that need to be on each of those pages. It looks like I am creating star charts. The thing is huge. And of course, I need to have this all done yesterday. So I haven't been sleeping too much here lately.(IE the complete lack of creativity.) Don't get me wrong, I am really happy to do this project, it is something I have wanted at work for 2 years now. But it is a lot of work. I have to not only touch every page, but every element on the page. I was working from my memory as to what was done and what wasn't till yesterday. I can't believe I did that. It was so much to keep track of. So like I said, not sleeping great. And you know what that means. Yes more coffee. Starbuck Venti Quad Soy White Chocolate Mocha.(I believe that in the future this may replace fossil fuels in cars) Starbucks flows through my blood, currently it is the replacement for oxygen. (being asthmatic oxygen and I have always had a sketchy relationship as it is.)
So now that I have this amazing web publishing and content management tool, I have to get the entire web site into it. That doesn't sound that bad right? I didn't think so either, until I did the spreadsheet. I listed the pages, and the elements that need to be on each of those pages. It looks like I am creating star charts. The thing is huge. And of course, I need to have this all done yesterday. So I haven't been sleeping too much here lately.(IE the complete lack of creativity.) Don't get me wrong, I am really happy to do this project, it is something I have wanted at work for 2 years now. But it is a lot of work. I have to not only touch every page, but every element on the page. I was working from my memory as to what was done and what wasn't till yesterday. I can't believe I did that. It was so much to keep track of. So like I said, not sleeping great. And you know what that means. Yes more coffee. Starbuck Venti Quad Soy White Chocolate Mocha.(I believe that in the future this may replace fossil fuels in cars) Starbucks flows through my blood, currently it is the replacement for oxygen. (being asthmatic oxygen and I have always had a sketchy relationship as it is.)
Wednesday, February 11, 2004
prepare for the documentation
So I was up till just about 1am last night getting all of the documentation and programming standards completed and ready for presentation at our meeting today. So of course we ran long and no one even got to see all of the hard work that Ed and I have into it. In less than two days we have come up with out programming standards, a group version and install of VSS and documentation coding standards. Now that rocks. The next things we are going to have to work on are application standards and modular code practices.
Documentation from Comments in C#
Documentation is one of the hardest thing for a developer to do. Not because we don't understand what needs done. No that isn't it at all, it is because it is boring. However it is amazingly necessary. Have you ever written something down and dirty and then later have to go back and update it, and find that it takes 2 hours to figure out what you were thinking when you wrote that? I know I have. This is where C# comes in. More specifically C# in Visual Studio. In C# there is inline documentation. So if you comment as you code, you can actually build your documentation as you build your project. Here are some great links that explain it all very well
Monday, February 09, 2004
New Must have App
So Ed today finds this new "Must have" app. And he was right. A little background is order. At work we are a Microsoft shop. So we have applications that are written just for IE 5.5 and above. These are internal applications where some of the MS-only functionality is helpful and allowable. However I hate the fact that Internet Explorer doesn't have tabs. Netscape had it, Opera has it, Firefox has it but not IE. So what Ed found was MyIE2. So not only did they write it to use the Internet Explorer Engine for Rendering pages, it will also use the Gecko engine too. This is the best of both world for me. I can see how pages will render in two different browsers types and use tabs. Tabs are so nice, because you can have multiple browsers open in one window. Which beats having three or four IE windows up like I had to do before today.
Jim, my friend from the train has started a new site, http://goberserker.com. This is his second EverQuest related site. For those of you who don't know EverQuest is the largest Online RPG. He also runs another EQ (EverQuest) site called EQ Interface which is focused on EQ interface mods and improvements. If EQ is your cup of tea, I suggest checking out Jim's sites.
Jim, my friend from the train has started a new site, http://goberserker.com. This is his second EverQuest related site. For those of you who don't know EverQuest is the largest Online RPG. He also runs another EQ (EverQuest) site called EQ Interface which is focused on EQ interface mods and improvements. If EQ is your cup of tea, I suggest checking out Jim's sites.
Sunday, February 08, 2004
Sunday Night ... Where did the Weekend go.
So today was my only day off. It wasn't plan'd that way it just happen'd. (Yes, I am going to be doing the Walt Whitman 'd thing) Anyhow, yesterday I spend a good portion of the day tracking down and fixing a strange server problem. Then in the afternoon I was able to help my dear friends move. Which is what I want'd to do with my day.
Subscribe to:
Posts (Atom)