light page 6 - Dave's Blog

Search
My timeline on Mastodon

Guy on highway

2007 Nov 4, 11:20This weekend Sarah and I went to Tariq's house warming party in Issaquah and then to Seattle for Jon's going away party at Pike's Pub. On the drive over, just after getting through traffic on I-5 South, I saw emergency vehicles lights on the North bound side and suddenly found my lane stopped. I found out why when a man ran from the left most lane to my lane the right most, then darted left one lane and back right again. Cars started leaving my lane and I could see the man now lounging on the pavement in front of a jeep. Apparently not hurt, he got up and started walking down the highway. He didn't appear to be in his right mind and after walking by our car Sarah reported it to 911. The rest of the night went on as normal and I had fun with Jon and his friends. It'll be sad to see him go next week.PermalinkCommentsnontechnical

XSL Identity Transfom

2007 Oct 12, 4:08As noted in the XSL Transformations spec you can create the identity transform using the xsl:copy element. With the MSXML implementation of xsl:copy the example the spec gives produces slightly ugly elements. For instance given it produces . In order to ensure empty elements turn out pretty I've modified the example as follows:
    
        
            
                
                    
                
            
            
                
                    
                
            
        
    

This got me thinking about inverting XSLTs. Clearly in general an XSLT isn't invertible since an XSLT can completely ignore the input XML and produce something else entirely but then the above is an example of an XSLT that is invertible. So there is a subset of XSLTs that are invertible, how might you produce the inverse of an XSLT, and would this ever be useful?PermalinkCommentsxml msxml inverse xlst xsl

GPS

2007 Sep 18, 2:16Sarah got me the Garmin StreetPilot c580 for my birthday last month. I really like this because its a small device that makes my life easier without me having to learn anything new. Just the way tech. should be.

The device gets current weather, traffic, and movie times. The information is sent via FM and received via the FM receiver in the cigarette lighter power adapter of the GPS device. MSN sends out this info and I get a free one year subscription. In addition to taking traffic info into account when planning my route it will estimate the number of minutes I'm going to spend in traffic. Just knowing how long I might be in traffic somehow makes it more bareable.

The other day while driving for dinner I got a call. I got my phone out of my pocket and answered it. I heard Jon's saying 'Hello' under my passenger seat. After a moment of confusion I remembered that the GPS device also acts as a bluetooth hands free phone adapter and that it was under my seat.PermalinkCommentsgps garmin personal traffic nontechnical

Awesome Movies Unknown to Me

2007 Aug 12, 2:50Thanks to Netflix I've been able to enjoy several movies that I'd never heard of.



Brick is a classic PI film set in a modern high school. Its fun figuring out which high school students correspond to which film noir archetypes.

Primer is a sci-fi movie but it doesn't focus on action or effects. Its like watching an excellent Twilight Zone episode. I hate to describe this any further for fear of giving something away.

The Amazing Screw-On Head is an animated version of the one shot comic. It feels like the 1800s precursor to the The Venture Bros. and stars Screw-On Head, a steam-punk robot head thing and Abe Lincoln's top spy for occult matters.

The Quiet Earth is the movie version of the book about a man who awakes one day to find himself alone(... or is he?) It was made in the 80s and in Australia but don't hold that against it.PermalinkCommentsscifi primer movie amazing screw-on head personal netflix brick the quiet earth

Two-for Script File

2007 Aug 6, 5:40I was messing with the XSLT to XSL Converter source which is a javascript file that can be run with cscript.exe. I've changed it to be like a very basic version of xsltproc that simply runs an XML file through an XSLT. I also wanted to run this from the command prompt without writing "cscript ..." everytime. I decided to make like perl programmers I've seen and make a JS file that works as a batch file and a JS file at the same time.

Here's a basic version of what I ended doing applied to a 'hello world' script named helloworld.cmd:
/* 2> NUL
@echo off
cscript /e:javascript /nologo "%~f0" %*
@goto :eof

    Hello World
        Says 'Hello world.' when you run it.
*/

var outText = 'Hello world.';
WScript.Echo(outText);
Running this on a command prompt gives the following:
C:\Users\davris>helloworld

C:\Users\davris>/*  2>NUL
Hello world.
However, after a little more experimentation I found this was slightly overkill for my purposes since if I rename the file to helloworld.js and just type its name like a command it is run by cscript:
C:\Users\davris>helloworld
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

Hello world.
So this time I didn't need all that but if ever in the future I need to run a batch file then a JS file I can do it with one file...PermalinkCommentscmd js technical cscript batch xslt xsl javascript

Canadian Wedding

2007 Jul 15, 5:08This previous weekend Sarah and I went to Canada for my friends Palak and Meghal's wedding. Our five day stay took us on the route from Toronto, to Burlington (for the wedding), and then Niagra.

Hotel near CN TowerIn Toronto we visited the CN Tower, the ROM, and the Bata Shoe Museum. We generally acted like tourists walking around taking photos of things, putting on sun block, and not saying 'eh'. But we could have been worse like the drunk American college students in front of us in line for the CN Tower asking the guide if the CN Tower is taller than the Stratosphere in Las Vegas. We stumbled upon the Toronto Outdoor Art Exhibit which was really interesting. Sarah in particular recalls the cute stuffed animal monsters.

Palak And Meghal's Wedding 6After Toronto we drove to Burlington where Palak and Meghal's wedding would take place. We got up early and made it on time to the wedding which was lovely. I hadn't attended an Indian wedding previously so it was a new experience for me. During the ceremony the child in front of me kept peeking over her parent's shoulder and staring at me. It lasted all day with a break after lunch during which we drove around and experienced small town Ontario. After the break cousins performed dances for Palak and Meghal and then we all danced the night away until the wee hours.

Niagra FallsIn Niagra we stayed in a hotel room with a falls view which was lovely. We went on the Maid of the Mist tour that takes tourists right up to the falls in a boat and drenches them. We also went on the Behind the Falls tour which was not as fun. In both we are given rain coats which are essentially glorified plstic trash bags. For dinner we ate in the hotel restaurant which had a lovely view of the falls. At night the falls are lit up in various colors with gigantic lights.PermalinkCommentsniagra wedding personal toronto nontechnical

A desktop robot to light up your life

2007 May 25, 12:50A robotic desklamp.PermalinkCommentsrobot lamp light desk video mit

New XSLT - IE7 XML Source View Upgrade Part 2

2007 May 11, 8:55Last time, I had written some resource tools to allow me to view and modify Windows module resources in my ultimate and noble quest to implement the XML content-type fragment in IE7. Using the resource tools I found that MSXML3.DLL isn't signed and that I can replace the XSLT embedded resource with my own, which is great news and means I could continue in my endevour. In the following I discuss how I came up with this replacement for IE7's XML source view.

At first I thought I could just modify the existing XSLT but it turns out that it isn't exactly an XSLT, rather its an IE5 XSL. I tried using the XSL to XSLT converter linked to on MSDN, however the resulting document still requires manual modification. But I didn't want to muck about in their weird language and I figured I could write my own XSLT faster than I could figure out how theirs worked.

I began work on the new XSLT and found it relatively easy to produce. First I got indenting working with all the XML nodes represented appropriately and different CSS classes attached to them to make it easy to do syntax highlighting. Next I added in some javascript to allow for closing and opening of elements. At this point my XSLT had the same features as the original XSL.

Next was the XML mimetype fragment which uses XPointer, a framework around various different schemes for naming parts of an XML document. I focused on the XPointer scheme which is an extended version of XPath. So I named my first task as getting XPaths working. Thankfully javascript running in the HTML document produced by running my XSLT on an XML document has access to the original XML document object via the document.XMLDocument property. From this this I can execute XPaths, however there's no builtin way to map from the XML nodes selected by the XPath to the HTML elements that I produced to represent them. So I created a recursive javascript function and XSLT named-template that both produce the same unique strings based on an XML node's position in the document. For instance 'a3-e2-e' is the name produced for the 3rd attribute of the second element of the root element of the XML document. When producing the HTML for an XML node, I add an 'id' attribute to the HTML with the unique string of the XML node. Then in javascript when I execute an XPath I can discover the unique string of each node in the selected set and map each of them to their corresponding positions in the HTML.

With the hard part out of the way I changed the onload to get the fragment of the URI of the current document, interpret it as an XPath and highlight and navigate to the selected nodes. I also added an interactive floating bar from which you can enter your own XPaths and do the same. On a related note, I found that when accessing XML files via the file URI scheme the fragment is stripped off and not available to the javascript.

The next steps are of course to actually implement XPointer framework parsing as well as the limited number of schemes that the XPointer framework specifies.PermalinkCommentsxml xpointer msxml res xpath xslt resource ie7 technical browser ie xsl

San Francisco Trip

2007 May 11, 7:48Hotel Diva BedAfter Carissa and Elijah's wedding Sarah and I went to San Francisco. We drove in, well Sarah drove anyway, still in the PT Cruiser Sunday morning and checked into our hotel, Hotel Diva. I was originally concerned that I wouldn't fit in as I don't really consider myself a diva, however the hotel was cool. They have Internet rooms setup in various themes, the front desk is always staffed, our room had a very modern look, and when we entered the flat-screen over the front desk was playing an episode of Aqua Teen Hunger Force.

Outside the SF Museum of Modern ArtWe walked around a bit before going to the SF Museum of Modern Art. There was a Picasso exhibit at the time which we could see for only $3 more. It felt kind of wrong like my ticket was super-sized. I think the most memorable piece I saw was three white panels which consisted of three blank panels. Art. Sure. After that Sarah wanted to see the giant Hello Kitty store she had heard of from her sister. We ended up going to the Westfield Shopping center which has a disappointingly average sized Hello Kitty store. Apparently the giant one is gone. That night we went to First Crush for dinner. I had a flight of wine which consists of three one-third sized glasses of various but complimentary wines. It was a great restaurant in terms of food, drink, atmosphere and service.

Sarah & I Pier 39The next morning we were even more the tourists when we went down to Fisherman's Wharf and Pier 39. We visited the famous wax museum and purchased multiple pounds of taffy. On the way back to the Oakland airport we got to experience a little traffic as part of the 580 freeway had collapsed the morning we arrived and was still under repair on our way out. We survived of course and I think the trip went rather well.PermalinkCommentssanfrancisco personal california sfmoma nontechnical

Resource Tools - IE7 XML Source View Upgrade Part 1

2007 May 9, 4:15I read about text/xml URI fragment resolution a few months ago. I was interested to find another kind of fragment reference other than the text/html URI fragment but of course I didn't find an implementation in IE, Firefox, or Opera. I decided to see how much work would be required to implement this in IE.

In IE and Firefox when you open an XML file that doesn't have an XML stylesheet the XML source is rendered with syntax highlighting. In IE I also noticed that the gold bar appears when you open an XML file off of your local machine. To me this suggested that the XML source was being rendered as HTML which I assumed was produced by running an XSLT on the source XML file. If so, I figured I could modify the XSLT to implement text/xml URI fragments. I ran FileMon to see if iexplore.exe loaded an XSLT file when opening an XML file. Only the XML file and MSXML3.DLL were opened and no XSLTs were loaded as files. My next hope for modifying the XSLT was if it existed as a resource in MSXML3.DLL. I did a findstr on the DLL for SCRIPT and found an XSLT so I decided to check for resources in MSXML3.DLL. Unfortunately my previous resource viewer didn't work correctly so I decided to write my own.

I created resource tools to view and modify resources in Windows modules. The viewer outputs HTML with links to the individual resources of a module using the res URI scheme that's built into IE. The modifier is a simple command line tool that replaces or adds one resource at a time to a module.

Using these tools I found that the XSLT was stored as a resource in MSXML3.DLL. I'll talk more about the existing XSLT and the one I replaced it with next time.PermalinkCommentsresource technical xml msxml res xslt xsl

Roommate Wedding

2007 May 5, 10:05Carissa, Elijah, and KristenCarissa and Elijah are married! Sarah and I flew to Oakland the Friday of two weeks previous (April 27th) into the Oakland Airport. We were on the same flight as Jon which was fun but we weren't seated with him. Instead I was seated between Sarah and a middle aged lady who enjoyed talking to herself. It seemed a bonus if others such as myself listened but not a prerequisite for her speaking.

Church Front Sarah and I rented a car and we drove Jon first to Hayward where he was staying then we drove to our hotel in Dublin. The car we got turned out to be a PT Cruiser which was a surprise of course but actually wasn't that bad. The power windows are controlled by the center console rather than by a switch near the windows themselves which led to several embarrassing seconds when we later tried to pay the toll for the Bay Bridge.

Carissa & Elijah's Reception HallThe next day we went to Carissa's wedding which was lovely. In a small church with white roses Carissa's mom married Carissa and Elijah. Afterward we went to the reception at the Senior Center. "Senior Center" may conjure up images of rolley charis that smell like old people but it wasn't like that at all. It appears to be a community center funded by the Senior Condos next door so it was very nice.

Carissa is the first of the college roommates to get married! I guess I'm just having trouble imagining any of us getting married...PermalinkCommentswedding friend personal california nontechnical

View Flickr Photos in Google Earth

2007 Apr 11, 9:12Show Flickr photos on Google Earth. Its pretty neat. Light on features though like no user selection.PermalinkCommentsgoogel map flickr photos geo

Charles & Marie: LampLamp

2007 Apr 8, 7:59A lamp lamp. Brilliant?PermalinkCommentsdesign shopping light-bulb

Bunny Weekend

2007 Apr 8, 3:46This weekend was fun. Sarah and I went out for Jane's Birthday. We ate at a little Italian restaurant where our group was almost too large for the place and afterwards went to the Viceroy lounge. The website apparently isn't very representative because although I looked at it before going out and I'd been to the place previously, I didn't realize it was the same location until we got there.

I got several games for my Wii through Sarah's connections including Wii Play and The Legend of Zelda: Twilight Princess. We played both of them and I thought Find Mii was especially fun.

Sarah's bunny is getting pretty big. Its been biting through wires now includig part way through the power cord to the cable box. You'd think after getting to the copper that it would learn to stop. At any rate, it didn't hide any eggs. I don't have any new photos but you can see the old bunny photos via my Vizicious tool.PermalinkCommentspersonal nontechnical seatle wii

A New Sith, or Revenge of the Hope

2007 Jan 22, 7:06Essay putting Chewie and R2D2 as key figures of the Rebel Alliance. Reconsidering ep 4 in light of 1-3. Its easy to put words in the mouth of the characters we can't understand.PermalinkCommentsstarwars movies analysis humor essay article nerd nerds scifi

Goggles :: The Google Maps flight sim

2006 Aug 24, 11:19Pat showed me this google maps based flight sim.PermalinkCommentsfree game flight google map web2.0 for:jozhik

FlightStats

2006 Jul 24, 2:38Track flights in real time. Live info on airports and flights. Handles flights with layovers in an intuitive manner.PermalinkCommentsairplane travel flight plan search tool tools free

The Old New Thing : Why Daylight Savings Time is nonintuitive

2006 Apr 3, 7:04I dislike Daylight Savings Time. Also I'm not fond of timezones. Boo on timezones.PermalinkCommentsblog raymond-chen microsoft msdn timezone daylight-savings-time FileTimeToLocalFileTime LocalFileTimeToFileTime programming csharp c++ windows

Plane Wackiness

2004 Apr 22, 6:44My interview was scheduled for Monday starting at 8am, so when I signed up for the trip and MS suggested a departure time of 4:30pm on Monday I thought that'd be good. Unfortunately the entire process ended at 4:15pm and it takes a little more than 15 minutes to get from Redmond to Seattle and then through the whole airport deal. So after the taxi ride to the airport and waiting in line for like 20 minutes its 5:30pm and I'm at the front of the line asking this woman for a new ticket.

Woman: *typing* Well I can get you to LA... Me: Yeah well that's the right state. Woman: *still typing* Oh... Hmm... Uhoh... *other non-words* Me: *waiting patiently* ... Woman: Are you ready to run? Here's your ticket. Gate C11.

I look at the ticket and the plane's boarding at, what do you know?, 5:30pm. So yeah I start running. I hit the security check point line and I know all about this. I take off my belt and shoes and empty my pockets into my backpack, my only luggage. I am Mr. Prepared, or maybe Prepared-ness is my middle name, whatever. I get through the line with no problem, put on my backpack and holding my shoes and belt in one hand I notice a big old clock just to my left. While I'm staring at it, it changes from 5:42 to 5:43. "Oh shit!" I think, so I start running again. I finally get to the appropriate gate and get on the plane all out of breath. I'm walking down the aisle with shoes and belt in hand, and I guess I look a bit out of sorts. I sit in my seat and I'm telling the guy next to me about my whole deal: "Ha. Yeah. I was late and with the running and the security checkpoint..." into incoherent mumbling and gesturing. So it turns out the pilot and copilot's incoming flight was way late and I ended up sitting in my seat for another 15 minutes before we could take off. All that wasted running. What a shame. Coming into LA we've been "landing" for like 20 minutes. We finally get on the ground and its 30 minutes passed the boarding time of my connecting flight. I start thinking about anyone I know who lives in LA. All the other passengers stand up and block the aisle. Then, an announcement "Will Daniel Riesney please come to the front of the plane." OK I can tell that's supposed to be my name, but how the hell am I supposed to get to the front of the plane? The people near me who have heard me talking to the guy next to me about this let me past easily enough. But now I have to explain this to each person out of ear shot to further my progress. "Hi. Excuse me. They called me to the front of the plane. Pardon me. Can I get by." And so on. Its getting more hostile the closer I get to first class. Up to this one guy. He's trying to talk on his cell phone but its not working because everybody is trying to talk on their cell phone now that we've landed. His phone connection has failed. I can't guess at what else has happened to him today but he's decided to make his Custerian last stand here between me and the rest of the plane.

Me: *continuing from previous passengers* Excuse me. Pardon me. Guy: *spinning around* WHAT!? Me: Can I please get by? Guy: What? Why? Were not going anywhere! This whole time I've been forcing my way past him. Guy: There OK your past me now! Your several feet ahead of me! Congratulations! Me: Dude, I'm sorry they called me to the front of the plane. Guy: I find that highly unlikely!

Whatever. I keep walking and like 7 people past the asshole I guess the flight attendants give up on me and start letting people off the plane. Now who feels like an asshole? Its me. I get off the plane and some airport guy has a new schedule for me. Oh good I'm thinking, I've got an hour until the next flight's boarding time at 10:30pm. So I get on a tram to travel to the other side of LAX. I wait for oncoming traffic to stop so I can climb up a stopped escalator (Incidentally right next to it is another escalator which has been closed off. Why would they do that? Escalators cannot break they just become stairs.) I get up there and wait in line for an extreeeeme amount of time and finally get up to claim my ticket. Its 10:20. I get my ticket and, yeah, the departure time is 10:30, the boarding time is 10:10. So I start running again. More security check fun. I finally find my boarding gate. I rush up...

Me: *breathing heavy* Here's my ticket Lady: Oh good your finally here. Just go right out that door, *points* down the stairs, *more pointing* and wait for the tram.

WHAT? Isn't there supposed to be a PLANE somewhere? This is what I'm thinking not what I'm saying. So I walk outside and down these steps. And I'm waiting. The lady from inside joins me.

*awkward silence* Lady: The bus should be here pretty soon. Me: So... I'm going to miss my plane huh? Lady: Oh no, see here? *points at my ticket* Your ticket is confirmed so they can't leave without you. Me: Oh good... I hope they didn't tell the other passengers that.

Lets see how many passengers I can piss off in one night. Eventually this bus shows up. I get in and the guy starts driving. "Do you know where I'm going?" I ask. "Yeah" the guy says. Great. Fine. Whatever. I don't care anymore. So we drive back around to the OTHER SIDE of the airport. You know, the side I started on. Yeah that side. So I get off the bus and walk into the small building set aside for smaller airlines. I see the frantic looking ladies manning another of these gates. They see me, check my ID and ticket, and one of them ushers me out the door next to the gate. Out the door and into a small gated area outside. So me and this new lady are just standing here. Even had I the energy to ask her what was going on its very loud what with all the planes. So we just stand here at this gate facing the planes for a while. I look at her trying to make eye contact and get some sort of acknowledgment that we are in fact waiting for SOMETHING. Eventually one of the day-glow guys appears from between some planes and saunters up. The lady hands him a paper and walks away. At the time I was kind of offended but looking back on it, maybe the lady was a deaf mute and I'm the one being insensitive. So now I follow this guy through a bunch of planes. I'm yelling "San Luis Obispo?" trying to be heard over all the ambient noise and this guy is somehow responding to me with an even tone no yelling required. I don't know how he did that. We finally get to the plane and its 10:40. So I delayed the flight ten minutes. I'm thinking its going to be really awkward when I sit down and we immediately leave. Its going to be suspicious even. But, not to worry, we wait while the flight attendant argues with the guy who brought me to the plane for another ten minutes about how many people are supposed to be on the plane. Whatever.PermalinkComments
Older EntriesNewer Entries Creative Commons License Some rights reserved.