John Cox

Blogs · @wyome · Now · Shelf

Interesting

Understanding the Principles of Algorithm Design | Nettuts+

A beginner-oriented introduction to algorithms for working developers, arguing that an algorithm is less a special kind of code than an efficient pattern for reaching a goal, illustrated by contrasting brute-force search with binary search over a 50,000-item array and by the Facemash matchup problem from The Social Network. It then turns practical, saying everyday code benefits from the same thinking: know your input, understand your tools' hidden overhead (a jQuery append inside a loop versus building a string first), understand the wider environment, and cut the number of steps with a short checklist. It closes with suggestions for further study such as Knuth, coding competitions, and reimplementing built-in functions like sort.

Permalink

Uniform - Sexy forms with jQuery

A beginner-oriented comparison of JavaScript and jQuery that frames jQuery as a free, open-source library built on JavaScript, not a separate language, and says it needs fewer lines of code for things like animation, Ajax, and event handling. Its one worked example sets a page background colour in a single jQuery line versus a function plus an onload attribute in plain JavaScript. It concludes that neither is better, jQuery is enough for most sites, and newcomers should learn both before choosing. The writing is loose and has some dubious claims, such as calling JavaScript slower and describing it mainly as a slideshow tool, so it's more a rough intro than a reliable reference.

Permalink

Chrome Dev Tools: Markup and Style | Nettuts+

A beginner's walkthrough of Chrome's developer tools (using Canary), covering two panels in detail. The Elements panel section shows how to delete nodes, edit tags and attributes, locate elements, read the box model in the Metrics pane, and live-edit CSS with autocomplete, a color picker, and auto-generated rules. The Resources panel section covers inspecting a page's fonts, images, scripts, and stylesheets, plus its cookies, localStorage, and application cache, with Twitter and a Sencha Touch app as examples. It opens with a quick comparison of how to launch the tools in Safari, Firefox, IE, and Opera, and it's the first of a series, with performance tooling saved for part two.

Permalink

jwerty - Awesome handling of keyboard events

jwerty is a small, dependency-free JavaScript library (about 1.5kb minified and gzipped) that smooths over the messy native keyboard event API with readable key-combo strings. Its `key` function binds callbacks globally or to a selector, accepting modifiers, Unicode symbols like ⌃⇧⌘, alternatives (`/`), sequences such as the Konami code, and regex-like ranges (`[0-9]`). Companion functions let you wrap handlers as event decorators (`event`), test a combo against an event (`is`), and programmatically dispatch key events (`fire`). It works standalone or alongside jQuery, Zepto, or Ender, and is tested with QUnit.

Permalink

iOS6 gives us two new CSS3 properties | css3files.com

A short post on how iOS 6 brings two WebKit-only CSS3 features to mobile: filters (blur, greyscale, saturation and similar effects) and cross-fade for blending two images. The author is enthusiastic about filters and sees them as practically ready for app development, with a demo and links to the spec and Adobe's CSS FilterLab. He considers cross-fade merely "nice" and unlikely to see wide use. Outside iOS, both work only in Chrome and Safari 6, with Firefox and IE10 support uncertain, so desktop use is still a long way off.

Permalink

jQuery Blog » jQuery 1.8.2 Released

jQuery 1.8.2 is a bug-fix release for the 1.8 line, addressing several bugs and performance regressions from the previous couple of versions. The announcement gives download links for the compressed and uncompressed builds, asks users to test against their own code and file bug reports with jsfiddle or jsbin test cases, and credits the patch contributors by GitHub handle. The change log is dominated by selector fixes (`:last`, `:contains`, `:nth-child`, `:focus`, and double `:not()` in IE6/7), with smaller fixes to `.offset()` on old browsers, delegated-event performance with pseudo-classes, Deferred's `promise(target)`, and a conflict with anti-keylogging software in IE7+.

Permalink

Vintage effects for your images with HTML5 | Webdesigner Depot

vintageJS is a jQuery plugin that uses HTML5 canvas to apply Instagram-style vintage effects to images directly in the browser, so designers don't have to pre-process every photo in Photoshop or worry about clients uploading unfiltered images that break a site's look. It covers presets (default, sepia, green, grayscale, custom) and lets you build your own filter with options like vignette, noise, screen, desaturate, multi-effect, and a viewfinder frame. The piece is a short tool recommendation, pointing to vintageJS.com as a demo of what the plugin can do.

Permalink

TaxVox » Blog Archive » About the 47 Percent Who Don’t Pay Federal Income Tax: Mitt, Meet Andrea

Written in response to Romney's "47 percent" remarks, this piece uses a profile of Andrea, a 22-year-old single mother working 50-hour weeks as a home health aide at $8.40 an hour, to argue that the EITC and Child Tax Credit don't breed dependency but reward and encourage work. Her income tax bill is wiped out by the credits, yet she still pays payroll taxes and ends up a barely net federal taxpayer, and most EITC recipients use the credit only briefly before earning too much to qualify. The author also contends that the taxpayer/non-taxpayer divide is misleading, since a household earning $20,000-$30,000 got an average EITC of $866 while millionaires got over $7,000 from the mortgage-interest and property-tax deductions alone.

Permalink

CSS-Only Sticky Headers for Tables, Using ‘position: sticky’

A early-adopter walkthrough of the then-new CSS `position: sticky`, which keeps an element like a table header pinned on screen for as long as its parent container is still visible. The author's main example is a long table whose `<thead>` stays put while scrolling, done with a few lines of prefixed CSS and `top: 0` instead of the jQuery-style scroll-handler plugins that used to do this job. It's candid about the limits: it only worked in bleeding-edge WebKit builds, needs vendor prefixes and an explicit offset, and degrades to an ordinary scrolling header elsewhere, so a JavaScript solution is still the safer choice for real users.

Permalink

Michael Lewis: Obama’s Way | Vanity Fair

Michael Lewis's profile of Obama, reported over months of access, uses the 2011 Libya intervention to show how he decides and what the presidency costs him. It cuts between his daily life (the pickup basketball game where nobody defers to him, the routinized mornings, the Oval Office, Air Force One) and the story of the Benghazi decision. The Pentagon offered only a pointless no-fly zone or nothing, and every senior adviser opposed intervening. Obama overrode them after polling junior staff and working through his thinking alone with a pencil, much as he had written his Nobel speech. The thread tying it together is navigator Tyler Stark, shot down on his first combat mission. His survival, helped by a Libyan who had no idea he was American, kept the decision from becoming a political disaster, and it shows how thin the margin was ("51–49") between a quiet success and a story that would have defined Obama.

Permalink

PHP 5.5 should reduce password sloppiness - The H Open: News and Features

What you saved looks like a tech-news front page: a run of unrelated headlines and teasers rather than one article, so there's no single argument. The items cover AI's uneven impact on German cardiology, where digitalization lags behind the hype, and a $4.5 million judgment against a Switch game pirate who skipped court. Google's plan to launch a test satellite with four TPUs as a step toward space-based AI data centers sits alongside a study putting US AI data-center spending at 3.6% of GDP for years, an unprecedented level. Other items include ChatGPT Voice gaining access to email, calendar, and Slack, Google Health adding insulin and blood pressure trend features for Pixel Watches, Austria legalizing fully AI-generated official notices, and a third turbine at DLR's Wivaldi research wind farm. If you kept it for one story, the space data center and GDP spending pieces are the most substantial, but you'd need the original link to find the full text of any of them.

Permalink

PHP: Hypertext Preprocessor

This is the php.net news feed, covering May to late September 2026. It logs a steady cadence of point releases across the 8.2, 8.3, 8.4 and 8.5 branches, most of them security fixes, with a few bug-fix releases in between. The thread worth remembering is PHP 8.6's pre-release run: Alpha 1 on 2 July, through Beta 3 on 10 September, then RC2 on 24 September, which replaced RC1 after a packaging mistake, with RC3 planned for 8 October. It also carries a late-August last call for the PHP Foundation and JetBrains "State of PHP" survey, whose results and anonymized dataset are due later in the year.

Permalink

WebKit HTML5 Search Inputs | CSS-Tricks

A rundown of how WebKit treats `<input type=search>`, which is just a plain text box in other browsers. WebKit locks down padding, font, border and background so the field matches the native search box, while color, text-align, letter-spacing and the like still work. Text-indent behaves erratically, and the field comes in only three sizes, set by font-size thresholds. It also covers the undocumented `results` and `autosave` attributes for a recent-searches dropdown, the built-in clear (x) button, and how to restyle the placeholder and that button with `-webkit-` pseudo-elements. It closes with a tip about a non-standard `search` event that fires when typing pauses.

Permalink

HTML5 inputs and attribute support

A browser-support test page for HTML5 form inputs, laid out as a set of tables that cross each input type (text, search, url, tel, email, password, the date and time family, number, range, color, checkbox, radio, file) with the attributes that apply to it, such as autocomplete, autofocus, list, pattern, placeholder, required, min/max/step, and multiple. Each cell is meant to turn red with frowny faces when the visiting browser doesn't support that combination, so it works as a quick visual compatibility check from the early HTML5 era. It was made by Michael Taylor in 2009 with thanks to Paul Irish, is MIT licensed, and links to companion pages on HTML5 forms UI support and textarea attributes. The saved text is mostly the empty table skeleton, so the value lies in the attribute-to-input-type matrix itself.

Permalink

Sidestep

Sidestep is a free, open-source Mac OS X utility, pitched as the answer to Firesheep-style session hijacking on open Wi-Fi. When it detects an unprotected network, it opens an SSH tunnel to a proxy server you supply and sets the system-wide SOCKS proxy to route all traffic through it, doing nothing on WPA-secured networks. The page also covers where to get a proxy (your own web host, a home machine, a roughly $0.50/month Amazon EC2 instance, or a donation-based server from Silence Is Defeat, with trust tradeoffs noted), plus Keychain or RSA-key logins, optional VPN support (PPTP, L2TP/IPSec, Cisco), and a fix for stuck proxy settings.

Permalink