after page 5 - Dave's Blog

Search
My timeline on Mastodon

URLs are tough - Anne's Weblog

2009 Apr 7, 1:30I really dislike how IE deals with non-US-ASCII in URLs. I should write up a post on what exactly IE does with non-US-ASCII characters in URLs. "Just like IRIs the URL is mapped to a URI using UTF-8. Except for the query component of the URL (the bit after the question mark). Here for legacy reasons the encoding of the document is used instead. Except if the encoding of the document is UTF-16, in which case UTF-8 is used. Effectively, using non-ASCII characters in URLs in documents not encoded as UTF-8 or UTF-16 will give you surprising results, to say the least. Yay for browsers!"PermalinkCommentshttp encoding html5 url uri unicode iri

New Dollar Sign Proposed by Congress to Reflect Economic Conditions | Typophile

2009 Apr 1, 9:32'To help stem the downward spiral of the United States economy Congress has proposed a new dollar symbol. "Updating fonts on the world's computers and devices would be a huge economic stimulus" said one representative after a late night session of the newly formed House Subcommittee - Font Economic Stimulus Technology Relief (FESTR). "The dollar is a shadow of its former self and the new design reflects this."'PermalinkCommentsart design humor font dollar-sign typography government economics

Twitter switch for Guardian, after 188 years of ink | Media | The Guardian

2009 Apr 1, 9:20"Consolidating its position at the cutting edge of new media technology, the Guardian today announces that it will become the first newspaper in the world to be published exclusively via Twitter"PermalinkCommentshumor news twitter journalism newspaper

Notes on Creating Internet Explorer Extensions in C++ and COM

2009 Mar 20, 4:51

Working on Internet Explorer extensions in C++ & COM, I had to relearn or rediscover how to do several totally basic and important things. To save myself and possibly others trouble in the future, here's some pertinent links and tips.

First you must choose your IE extensibility point. Here's a very short list of the few I've used:

Once you've created your COM object that implements IObjectWithSite and whatever other interfaces your extensibility point requires as described in the above links you'll see your SetSite method get called by IE. You might want to know how to get the top level browser object from the IUnknown site object passed in via that method.

After that you may also want to listen for some events from the browser. To do this you'll need to:

  1. Implement the dispinterface that has the event you want. For instance DWebBrowserEvents2, or HTMLDocumentEvents, or HTMLWindowEvents2. You'll have to search around in that area of the documentation to find the event you're looking for.
  2. Register for events using AtlAdvise. The object you need to subscribe to depends on the events you want. For example, DWebBrowserEvents2 come from the webbrowser object, HTMLDocumentEvents come from the document object assuming its an HTML document (I obtained via get_Document method on the webbrowser), and HTMLWindowEvents2 come from the window object (which oddly I obtained via calling the get_script method on the document object). Note that depending on when your SetSite method is called the document may not exist yet. For my extension I signed up for browser events immediately and then listened for events like NavigateComplete before signing up for document and window events.
  3. Implement IDispatch. The Invoke method will get called with event notifications from the dispinterfaces you sign up for in AtlAdvise. Implementing Invoke manually is a slight pain as all the parameters come in as VARIANTs and are in reverse order. There's some ATL macros that may make this easier but I didn't bother.
  4. Call AtlUnadvise at some point -- at the latest when SetSite is called again and your site object changes.

If you want to check if an IHTMLElement is not visible on screen due how the page is scrolled, try comparing the Body or Document Element's client height and width, which appears to be the dimensions of the visible document area, to the element's bounding client rect which appears to be its position relative to the upper left corner of the visible document area. I've found this to be working for me so far, but I'm not positive that frames, iframes, zooming, editable document areas, etc won't mess this up.

Be sure to use pointers you get from the IWebBrowser/IHTMLDocument/etc. only on the thread on which you obtained the pointer or correctly marshal the pointers to other threads to avoid weird crashes and hangs.

Obtaining the HTML document of a subframe is slightly more complicated then you might hope. On the other hand this might be resolved by the new to IE8 method IHTMLFrameElement3::get_contentDocument

Check out Eric's IE blog post on IE extensibility which has some great links on this topic as well.

PermalinkCommentstechnical boring internet explorer com c++ ihtmlelement extension

MyFonts Blog - Blog Archive - Introducing WhatTheFont for iPhone!

2009 Feb 11, 10:05"With the iPhone version of WhatTheFont you can use the phone's built-in camera to photograph the text in question (or choose an existing image from your photo albums)... After confirming which characters are used in the image, the app provides a list of possible matching fonts."PermalinkCommentsfont iphone camera typography

Google: If You Commit a Felony, Don't Google It or You'll Go to Jail

2009 Jan 20, 11:40"But, when police searched his computer, they found Google searches from a couple days after the accident like, "auto parts, auto dealers out-of-state; auto glass, Las Vegas; auto glass reporting requirements to law enforcement, auto theft," according to the prosecutor. The coup de grace? He searched for "hit-and-run," which he followed to a page about the hit-and-run he committed."PermalinkCommentsprivacy google internet crime

9NEWS.com | Colorado's Online News Leader | Three small canisters ...

2008 Nov 11, 3:57Grandpa's old films contain some surprises: "There was another reason why the Library of Congress wanted the original films. They are a treasure trove of historic video of the aftermath of D-Day."PermalinkCommentsvideo history library-of-congress

I Voted

2008 Nov 9, 11:18

I Voted 2008 - Farewell to Polls by RedRaspusThis past Tuesday I voted in my first presidential election. Of course I was eligible twice before so don't tell my social studies teacher. I read about folks who stood in line for twelve hours waiting to vote but I personally had no issues. I found the voting location around 10am and it seemed appropriately busy: There were people voting but no lines. I came in and looked confused until an elderly lady gave me a paper to bubble in. The voting booth was more like a fold out voting table at a very awkward height and in the end my back ached. It feels better to vote in person and have a back ache after. Its more like I've accomplished something.

PermalinkCommentspersonal voting

Word Wrapping IE's Plain Text

2008 Oct 28, 11:23

If you view a plain text document in Internet Explorer 8, for instance the plain text version of Cory Doctorow's book Little Brother and press F12 to bring up the developer toolbar, you can see that IE simply takes the plain text, sticks it inside a

 tag, and renders it.  This means that word wrapping isn't supplied and the only line breaks that appear are those in the document.  However, since the text document is converted to HTML it means I can implement word wrap myself using a bookmarklet:
javascript:function ww() { var preTag = document.getElementsByTagName('pre')[0]; preTag.style.fontFamily="arial"; preTag.style.wordWrap='break-word'; }; ww();
After adding a favorite and setting the favorite's URL to the previous, I can view plain text documents, and select my Word Wrap favorite to apply word wrap and non-fixed width font.
PermalinkCommentsbrowser technical ie wordwrap

Signs of Fall Tree

2008 Oct 28, 9:01

sequelguy posted a photo:

Signs of Fall Tree

Immediately after Sarah took this photo, a truck pulled into the empty parking spot and the driver jumped out to apologize for messing up the photo. The driver was a zombie.

PermalinkCommentsseattle tree nature gasworkspark sarahtookthisphoto

Failing Electronics

2008 Oct 22, 12:54

Electronic devices shouldn't fail, they should just sit wherever I place them and work forever. A while back my home web server started failing so I moved over to a real web hosting service. And this was the home web server I built from pieces Eric gave me after my previous one died during the big power failure the year before. The power socket on my old laptop has come undone from the motherboard so that it can no longer be powered. Just a week or two ago my Xbox 360 stopped displaying video. The CPU fan on my media center died. I also want to put my camera and GPS in this list, but the camera died due to accidentally turning on in my pocket and the GPS was stolen so those aren't the devices just arbitrarily failing.

PermalinkCommentsboring personal complaining nontechnical

STGC Enumeration (Windows)

2008 Oct 1, 1:49One of the values in this enum is named 'STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE'. After reading (and re-reading to make sure I word broke correctly) I'm left with the lingering impression that I've had an extensive conversation with whoever named this variable. Anyway, I thought it was a fun name.PermalinkCommentshumor software msdn microsoft reference

Radiohead Extends Remix Voting as Entrants Bellyache | Listening Post from Wired.com

2008 Sep 15, 1:50This just in: people on the Internet are complaining. Also Radiohead has a remix contest. Neat. "No good deed goes unpunished. After letting fans pay whatever they wanted for In Rainbows and releasing stem tracks via iTunes so that one of the songs on the record could be remixed, Radiohead is facing accusations that its "Nude" remix contest is unfair."PermalinkCommentsmusic wired radiohead remix contest

Epeus' epigone: Fear of the new - the Internet, Tea, and MapReduce

2008 Sep 8, 10:26"This is what I call the "cup of tea" problem, after Douglas Adams: Newsreaders still feel it is worth a special and rather worrying mention if, for instance, a crime was planned by people 'over the Internet.' They don't bother to mention when criminals use the telephone or the M4, or discuss their dastardly plans 'over a cup of tea,' though each of these was new and controversial in their day."PermalinkCommentsinternet security humor douglas-adams via:sambrook

Deriving a Non-Recursive Fibonacci Function Using Linear Algebra

2008 Aug 20, 10:51

In my Intro to Algorithms course in college the Fibonacci sequence was used as the example algorithm to which various types of algorithm creation methods were applied. As the course went on we made better and better performing algorithms to find the nth Fibonacci number. In another course we were told about a matrix that when multiplied successively produced Fibonacci numbers. In my linear algebra courses I realized I could diagonalize the matrix to find a non-recursive Fibonacci function. To my surprise this worked and I found a function.
The Nth Fibonacci value is (1 + sqrt(5))^N - (1 - sqrt(5))^N all over sqrt(5) * 2^N
Looking online I found that of course this same function was already well known. Mostly I was irritated that after all the algorithms we created for faster and faster Fibonacci functions we were never told about a constant time function like this.

I recently found my paper depicting this and thought it would be a good thing to use to try out MathML, a markup language for displaying math. I went to the MathML implementations page and installed a plugin for IE to display MathML and then began writing up my paper in MathML. I wrote the MathML by hand and must say that's not how its intended to be created. The language is very verbose and it took me a long time to get the page of equations transcribed.

MathML has presentation elements and content elements that can be used separately or together. I stuck to content elements and while it looked great in IE with my extension when I tried it in FireFox which has builtin MathML support it didn't render. As it turns out FireFox doesn't support MathML content elements. I had already finished creating this page by hand and wasn't about to switch to content elements. Also, in order to get IE to render a MathML document, the document needs directives at the top for specific IE extensions which is a pain. Thankfully, the W3C has a MathML cross platform stylesheet. You just include this XSL at the top of your XHTML page and it turns content elements into appropriate presentation elements, and inserts all the known IE extension goo required for you. So now my page can look lovely and all the ickiness to get it to render is contained in the W3C's XSL.

PermalinkCommentstechnical mathml fibonacci math

Paris Hilton Responds to McCain Ad from Paris Hilton, Adam "Ghost Panther" McKay, and Chris Henchy

2008 Aug 6, 1:43"Paris Hilton Responds to McCain Ad An ad for The Paris Hilton Presidential Campaign. Paid for by Funny Or Die". Found this just after I saw the McCain Ad mocked on the Daily Show.PermalinkCommentsparis-hilton humor politics video mccain

New office, new cubes

2008 Aug 5, 6:32

Second Window OfficeNew Patent CubesMy previous window office was ripped from me when our team moved buildings but now I've got another. The photo is poor because I didn't get the lighting correct and it depicts the office before I've moved all my crap into it. I have a lovely view of our parking lot and freeway which Jane spun as an 'urban view'. At any rate I'm not complaining: I like knowing what its like outside and that there is an outside. The day after I found out about my office, I also got two new patent cubes. I didn't have any pictures last time so I took some now and blacked out their text for fear of laywers.

PermalinkCommentsmicrosoft patent cube office nontechnical

Dark Knight and Mariners Baseball

2008 Aug 4, 8:39

The weekend before last I saw Dark Knight with some friends from work and then we all ate at Z'Tejas after. Like everyone has said and as the name implies Dark Knight is... dark. Dark Knight was a little over the top at times as compared to Batman Begins but I really enjoyed it. Two times during the movie I thought it had ended but I was wrong. The Joker is both frightening (Cringe inducing line "Wanna know how I got these scars?") and humorous ("Where is Harvey Dent? ... You know where Harvey is? You know who he is?", as well as the pencil magic trick). I can certainly recommend it to anyone who enjoyed Batman Begins. The previews included Burn After Reading a new Coen Brother's comedy that I look forward to, and Quantum of Solace which hopefully does the same thing Dark Knight has, keep up the new direction on the refreshed franchise.

Safeco Field Suite photoThis past weekend Sarah and I went to a Mariners baseball game. I think this is the first MLB baseball game I've seen in person. Sarah's company gave out tickets for the game and the use of a suite. Its a room half way up the stadium with comfortable chairs, a mini-fridge built-in to the marble counter-topped center table, and a big flat screen television with the game on it. I suppose that's in case you don't want to turn to the right and sit at the window, or walk out onto the balcony which features three rows of comfy chairs overlooking the field. Anyway there was free food and drinks and I met some of the people Sarah works with.

PermalinkCommentsbaseball batman nontechnical

BBC NEWS | Entertainment | Your American accents

2008 Jul 23, 5:19"Everyone can do an American accent... at least everyone thinks they can. After the BBC's Stephen Robb took a lesson from one of the movie industry's top accent coaches, we asked readers to record their best US accents."PermalinkCommentsbbc audio accent language english

Kirkland Uncorked Weekend

2008 Jul 21, 10:36

Kirkland Uncorked posterSaturday we went to Kirkland Uncorked, a wine tasting festival near our home. We took the bus and after finding the correct one (they really should have different numbers for buses that are on the same route but traveling in different directions) made it to the festival. Unfortunately I don't remember any of the names of the wines just which ones I enjoyed by order. Recalling that I enjoyed the first one I had and the second to last one, doesn't really help me find them again. There were local artists who had setup booths and Sarah got a lovely necklace. After that we ate at Cactus which, because it was such a lovely day, had all its windows and doors open.

Sunday was quieter. A few household chores and plenty of GTA4. I almost got the One Man Army achievement but I found that after four minutes with six stars I eventually dropped back down to three stars without realizing it.

PermalinkCommentswine weekend nontechnical
Older EntriesNewer Entries Creative Commons License Some rights reserved.