demo - Dave's Blog

Search
My timeline on Mastodon

Tweet from Šime Vidas

2016 Nov 17, 3:14
Chrome Canary has enabled scroll anchoring which prevents “jumps” when the layout above the viewport changes (demo: https://output.jsbin.com/parujo/quiet#heading2 )
PermalinkComments

Tweet from David Risney

2016 Oct 11, 5:52
@David_Risney But OTOH he also demonstrated viability of explicitly racist populism - just avoid the misogyny - for future misanthropes
PermalinkComments

Tweet from Justin Wolfers

2016 Sep 13, 12:05
Here comes the latest income and poverty statistics... Be prepared to adjust your talking points... http://www.census.gov/content/dam/Census/library/publications/2016/demo/p60-256.pdf 
PermalinkComments

Tweet from David Risney

2016 Jun 1, 1:51
Cool JS image diff'ing including browser webcam based demos https://twitter.com/lonekorean/status/737630487913455616 
PermalinkComments

Retweet of JustRogDigiTec

2015 Nov 29, 2:58
@JustRogDigiTec A fiddle as well http://jsfiddle.net/xb3gheqb/  in case it clarifies. Note: An older browser may not demo properly
PermalinkComments

Tweet from David_Risney

2015 Nov 18, 2:53
Old time tintype photograph of Adam Savage looks really good. Photographer Michael Shindler explains & demos process https://www.youtube.com/watch?v=T_gQgkCfj7w …
PermalinkComments

Retweet of tombkeeper

2015 Nov 11, 11:07
Another demo of our talk "BadBarcode" in PacSec 2015: start a shell by one single boarding pass.
PermalinkComments

Retweet of kumailn

2015 Jul 20, 9:56
"President Donald Trump" is something even Demolition Man would have considered too ludicrous.
PermalinkComments

Retweet of anatudor

2015 Mar 22, 10:24
Collection can be found here - over 100 demos showing what can be done with just 1 range input http://codepen.io/collection/DgYaMj/8/ … pic.twitter.com/CAndEDATj9
PermalinkComments

Tweet from David_Risney

2015 Feb 12, 1:02
The Verge explains and demos binaural audio in which a dummy head with two mics records audio as if you were there: https://www.youtube.com/watch?v=Yd5i7TlpzCk …
PermalinkComments

Tweet from David_Risney

2015 Jan 28, 3:09
Speedrunner Stephen Kiazyk demos Psychonauts bugs to dev team incl Tim Schafer https://www.youtube.com/watch?v=lsDc1YVxHA0 … Funny reactions from the game's devs
PermalinkComments

Debugging anecdote - the color transparent black breaks accessibility

2014 May 22, 10:36

Some time back while I was working on getting the Javascript Windows Store app platform running on Windows Phone (now available on the last Windows Phone release!) I had an interesting bug that in retrospect is amusing.

I had just finished a work item to get accessibility working for JS WinPhone apps when I got a new bug: With some set of JS apps, accessibility appeared to be totally broken. At that time in development the only mechanism we had to test accessibility was a test tool that runs on the PC, connects to the phone, and dumps out the accessibility tree of whatever app is running on the phone. In this bug, the tool would spin for a while and then timeout with an error and no accessibility information.

My first thought was this was an issue in my new accessibility code. However, debugging with breakpoints on my code I could see none of my code was run nor the code that should call it. The code that called that code was a more generic messaging system that hit my breakpoints constantly.

Rather than trying to work backward from the failure point, I decided to try and narrow down the repro and work forwards from there. One thing all the apps with the bug had in common was their usage of WinJS, but not all WinJS apps demonstrated the issue. Using a binary search approach on one such app I removed unrelated app code until all that was left was the app's usage of the WinJS AppBar and the bug still occurred. I replaced the WinJS AppBar usage with direct usage of the underlying AppBar WinRT APIs and continued.

Only some calls to the AppBar WinRT object produced the issue:

        var appBar = Windows.UI.WebUI.Core.WebUICommandBar.getForCurrentView(); 
// appBar.opacity = 1;
// appBar.closeDisplayMode = Windows.UI.WebUI.Core.WebUICommandBarClosedDisplayMode.default;
appBar.backgroundColor = Windows.UI.Colors.white; // Bug!
Just setting the background color appeared to cause the issue and I didn't even have to display the AppBar. Through additional trial and error I was blown away to discover that some colors I would set caused the issue and other colors did not. Black wouldn't cause the issue but transparent black would. So would aqua but not white.

I eventually realized that predefined WinRT color values like Windows.UI.Colors.aqua would cause the issue while JS literal based colors didn't cause the issue (Windows.UI.Color is a WinRT struct which projects in JS as a JS literal object with the struct members as JS object properties so its easy to write something like {r: 0, g: 0, b: 0, a: 0} to make a color) and I had been mixing both in my tests without realizing there would be a difference. I debugged into the backgroundColor property setter that consumed the WinRT color struct to see what was different between Windows.UI.Colors.black and {a: 1, r: 0, g: 0, b: 0} and found the two structs to be byte wise exactly the same.

On a hunch I tried my test app with only a reference to the color and otherwise no interaction with the AppBar and not doing anything with the actual reference to the color: Windows.UI.Colors.black;. This too caused the issue. I knew that the implementation for these WinRT const values live in a DLL and guessed that something in the code to create these predefined colors was causing the issue. I debugged in and no luck. Now I also have experienced crusty code that would do exciting things in its DllMain, the function that's called when a DLL is loaded into the process so I tried modifying my C++ code to simply LoadLibrary the DLL containing the WinRT color definition, windows.ui.xaml.dll and found the bug still occurred! A short lived moment of relief as the world seemed to make sense again.

Debugging into DllMain nothing interesting happened. There were interesting calls in there to be sure, but all of them behind conditions that were false. I was again stumped. On another hunch I tried renaming the DLL and only LoadLibrary'ing it and the bug went away. I took a different DLL renamed it windows.ui.xaml.dll and tried LoadLibrary'ing that and the bug came back. Just the name of the DLL was causing the issue.

I searched for the DLL name in our source code index and found hits in the accessibility tool. Grinning I opened the source to find that the accessibility tool's phone side service was trying to determine if a process belonged to a XAML app or not because XAML apps had a different accessibility contract. It did this by checking to see if windows.ui.xaml.dll was loaded in the target process.

At this point I got to fix my main issue and open several new bugs for the variety of problems I had just run into. This is a how to on writing software that is difficult to debug.

PermalinkCommentsbug debug javascript JS technical windows winrt

 “The disc itself is about 5 inches in diameter. It can record...

2012 Oct 1, 8:21


 “The disc itself is about 5 inches in diameter. It can record one hour of stereo music on one side — and it is only a one-sided disc, it’s not meant to be played on two sides…”

Sony demos the CD at TED in 1984 (by TEDBlogVideo)

PermalinkCommentsvideo cd ted music

Newsroom: Miscellaneous: New Online Tool Gives Public Wider Access to Key U.S. Statistics

2012 Jul 28, 2:35

The U.S. Census Bureau today released a new online service that makes key demographic, socio-economic and housing statistics more accessible than ever before. The Census Bureau’s first-ever public Application Programming Interface (API) allows developers to design Web and mobile apps to explore or learn more about America’s changing population and economy.

PermalinkCommentstechnical api census statistics stats web restful rest

Sergey Brin’s Google Glass skydiver demo from I/O keynote...

2012 Jun 27, 10:31


Sergey Brin’s Google Glass skydiver demo from I/O keynote (via 9to5Google) (by jkahnjkahn)

PermalinkCommentsgoogle google-glass skydive video

Microsoft Research make breakthrough in audio speech recognition (technet.com)

2012 Jun 22, 2:33

MAVIS indexes audio and video so you can do text search over the contents. For example search for ‘metro’ in all of the BUILD conference talks.

PermalinkCommentstechnical voice-recognition microsoft research mavis search

Line Simplification

2012 Jun 3, 12:47

Neat demo of Visvalingam’s line simplification algorithm in JavaScript applied to a map of the US.

To simplify geometry to suit the displayed resolution, various line simplification algorithms exist. While Douglas–Peucker is the most well-known, Visvalingam’s algorithm may be more effective and has a remarkably intuitive explanation: it progressively removes points with the least-perceptible change.

PermalinkCommentsline-simplification demo technical javascript

JavaScript in JavaScript (js.js): smaller, faster, and with demos (princeton.edu)

2012 Apr 19, 3:36

Unlike Inception, running a JS engine in a JS engine does not make the inner JS engine go faster.

PermalinkCommentstechnical javascript programming interpretter

Using CSS without HTML (mathiasbynens.be)

2012 Feb 20, 6:11

Implied HTML elements, CSS before/after content, and the link HTTP header combines to make a document that displays something despite having a 0 byte HTML file.  Demo only in Opera/FireFox due to link HTTP header support.

PermalinkCommentstechnical humor hack css http html

Chris Harrison | A New Angle on Cheap LCDs

2011 Oct 25, 5:33
Its not a bug -- its a feature! Very cool unread mail demo.
PermalinkCommentstechnical
Older Entries Creative Commons License Some rights reserved.