hello - Dave's Blog

Search
My timeline on Mastodon

Shout Text Windows 8 App Development Notes

2013 Jun 27, 1:00

My first app for Windows 8 was Shout Text. You type into Shout Text, and your text is scaled up as large as possible while still fitting on the screen, as you type. It is the closest thing to a Hello World app as you'll find on the Windows Store that doesn't contain that phrase (by default) and I approached it as the simplest app I could make to learn about Windows modern app development and Windows Store app submission.

I rely on WinJS's default layout to use CSS transforms to scale up the user's text as they type. And they are typing into a simple content editable div.

The app was too simple for me to even consider using ads or charging for it which I learned more about in future apps.

The first interesting issue I ran into was that copying from and then pasting into the content editable div resulted in duplicates of the containing div with copied CSS appearing recursively inside of the content editable div. To fix this I had to catch the paste operation and remove the HTML data from the clipboard to ensure only the plain text data is pasted:

        function onPaste() {
var text;

if (window.clipboardData) {
text = window.clipboardData.getData("Text").toString();
window.clipboardData.clearData("Html");
window.clipboardData.setData("Text", util.normalizeContentEditableText(text));
}
}
shoutText.addEventListener("beforepaste", function () { return false; }, false);
shoutText.addEventListener("paste", onPaste, false);

I additionally found an issue in IE in which applying a CSS transform to a content editable div that has focus doesn't move the screen position of the user input caret - the text is scaled up or down but the caret remains the same size and in the same place on the screen. To fix this I made the following hack to reapply the current cursor position and text selection which resets the screen position of the user input caret.

        function resetCaret() {
setTimeout(function () {
var cursorPos = document.selection.createRange().duplicate();
cursorPos.select();
}, 200);
}

shoutText.attachEvent("onresize", function () { resetCaret(); }, true);
PermalinkCommentsdevelopment html javascript shout-text technical windows windows-store

(via Hello, A Remix of Lionel Richie’s “Hello” Made Using Film...

2012 Jan 17, 9:51


(via Hello, A Remix of Lionel Richie’s “Hello” Made Using Film Clips)

PermalinkCommentshumor music video film remix mashup hello

I get better spam than you - Boing Boing

2010 Dec 30, 6:42"Posted here, verbatim, is an example of the sort of spam I get. 'hello I am China dinosaur factory .Hope that you know our product more .Also hope that we can establish long-term cooperative relation.'"PermalinkCommentshumor spam robot dino

The Old New Thing : Can I talk to that William fellow? He was so helpful

2009 Nov 23, 11:47'Bill Gates is being taken on a guided tour of the product support department's new office building...Bill puts on a headset, sits down, and answers the phone. "Hello, this is Microsoft Product Support, William speaking. How can I help you?"'PermalinkCommentshumor microsoft bill-gates raymond-chen support history

Kitchen Garden Planner | Preplanned Vegetable Gardens by Gardener's Supply

2009 Jul 6, 3:47Howto make your own garden including pre-made plans like the 'Plant it and Forget it' garden.PermalinkCommentsvia:jen howto diy garden for:hellosarah

WGMX 4 - Zombocalypse on Vimeo

2009 Jun 30, 4:59"Congratulations on not being devoured and purchasing the Wagglemax Zombocalypse TM Survival Kit"PermalinkCommentshumor video commercial ad apocalypse zombie horror for:hellosarah videogame

Renovated Church Home in Kyloe, Northumberland | SwipeLife

2009 Jun 24, 1:41"A nondescript exterior and a yard dominated by headstones give no indication of the residential nature of this historic church in Kyloe, Northumberland. A couple decided to purchase and readapt the structure, investing nearly three times the purchase price into renovations over the course of several years."PermalinkCommentschurch church-home house home england for:hellosarah photo

Mix an Exploding Drink - Wired How-To Wiki

2009 Jun 4, 3:14You've seen the YouTube clips demonstrating the riotous effect of dropping Mentos into Diet Coke. Why not turn the fizzy fun into an epic party prank of your own? Here's our recipe for a little cocktail we call the Manhattan Project.PermalinkCommentsvia:boingboing mentos meme wired humor coke soda howto alcohol drink for:hellosarah

E309: New Super Mario Bros Wii, the trailer

2009 Jun 3, 3:40The New Super Mario Bros for the Wii looks cool. I always wanted the multiplayer featured here in the previous games.PermalinkCommentsfor:hellosarah mario wii nintendo video videogame

308 - The Pop Vs Soda Map - Strange Maps

2009 May 31, 8:29"When on a hot summer's day you buy a carbonated beverage to quench your thirst, how do you order it? Do you ask for a soda, a pop or something else? That question lay at the basis of an article in the Journal of English Linguistics (Soda or Pop?, #24, 1996) and of a map, showing the regional variation in American English of the names given to that type of drink."PermalinkCommentsmap language visualization statistics english culture soda coke for:hellosarah

ComplimentBot 4000 | Refresh for more love

2009 May 31, 7:35"thanks for using the ComplimentBot 4000"PermalinkCommentshumor compliment psychology for:hellosarah

Wallace and Gromit: A Matter of Loaf and Death | 2009 Seattle International Film Festival | Nick Park | United Kingdom - Films

2009 May 25, 10:19"Wallace and Gromit return-this time as purveyors of the Top Bun bakery, despite the fact that 12 other local bakers have disappeared in the previous year. Now it's up to Gromit to solve the mystery while Wallace woos new love interest Piella Bakewell."PermalinkCommentshumor movie wallace-and-gromit animation claymation for:hellosarah

Dispatches from the Island: Went to a Castle

2009 May 22, 6:37Famous people are just like me! That is, Jorge Garcia (Hurley from Lost) also has a blog on which he writes about and posts pictures of his visit to the Neuschhwanstein Castle in Munich (the basis of the Disney castle). But apparently unlike me he didn't take the Bus of the Year 2005 to get to the castle.PermalinkCommentsvia:kottke hurley lost tv blog germany for:hellosarah

Foruauto Part-III: introducing Fallout 3, the 70s Japanese cop-drama - Offworld

2009 May 19, 2:09"Today's other best Fallout 3 development: Japan's 'agoministrator' re-imagines the game as a 70s TV drama"PermalinkCommentsfor:hellosarah fallout3 video humor tv

An Extraordinary Home. This 3 ++ bedroom 2.5 bathroom Single Family located at 601 Dolores Street, Mission Dolores, San Francisco, California is presented by John L. Woodruff III & Marcus Miller, MA Realtor/Broker Associates of Hill & Co. Real Estate.

2009 May 19, 1:43Lovely, although a bit out of my price range. "Formerly the Golden Gate Lutheran Church, this stunning Gothic Revival style building is now one of the most extraordinary and largest single family homes in San Francisco."PermalinkCommentsfor:hellosarah photo house home church california san-francisco flickr slideshow via:boingboing church-home

Penny Arcade! - Lend Me Your Ears

2009 May 4, 12:17PermalinkCommentsfor:hellosarah

The Sims 3 gets social network, microtransactions - Ars Technica

2009 May 3, 9:38"The online features for The Sims 3 have been detailed, and it will include a new in-game store for purchasing items as well as a heap of social networking features."PermalinkCommentsfor:hellosarah

Bunny Identity Theft

2009 Apr 13, 1:11These have been popping up all over the internet, but I just had to share them with you in time for Easter. I'll take one of each in my Easter basket!PermalinkCommentscute cat bunny easter photo for:hellosarah

Flickr Visual Search in IE8

2009 Apr 10, 9:48

A while ago I promised to say how an xsltproc Meddler script would be useful and the general answer is its useful for hooking up a client application that wants data from the web in a particular XML format and the data is available on the web but in another XML format. The specific case for this post is a Flickr Search service that includes IE8 Visual Search Suggestions. IE8 wants the Visual Search Suggestions XML format and Flickr gives out search data in their Flickr web API XML format.

So I wrote an XSLT to convert from Flickr Search XML to Visual Suggestions XML and used my xsltproc Meddler script to actually apply this xslt.

After getting this all working I've placed the result in two places: (1) I've updated the xsltproc Meddler script to include this XSLT and an XML file to install it as a search provider - although you'll need to edit the XML to include your own Flickr API key. (2) I've created a service for this so you can just install the Flickr search provider if you're interested in having the functionality and don't care about the implementation. Additionally, to the search provider I've added accelerator preview support to show the Flickr slideshow which I think looks snazzy.

Doing a quick search for this it looks like there's at least one other such implementation, but mine has the distinction of being done through XSLT which I provide, updated XML namespaces to work with the released version of IE8, and I made it so you know its good.

PermalinkCommentsmeddler xml ie8 xslt flickr technical boring search suggestions

GRcade.com - View topic - BLH's tour of Chernobyl. Hello Digg/Reddit/world!!

2009 Mar 23, 9:41"So heres my trip to Chernobyl in pictures." Nice photo of the tree growing through the floor next to the chair. The whole set is like Fallout 3 but there's plants. Didn't realize plants could do well in such a situation.PermalinkCommentsvia:swannman photo history science nuclear russia chernobyl
Older Entries Creative Commons License Some rights reserved.