John Cox

Blogs · @wyome · Now · Shelf

Interesting

Optimizing the MySQL IN() Comparison Operations Which Include the Indexed Field – MySQL Diary

A 2010 MySQL tuning tip: when a query filters on an indexed column with IN() and also uses ORDER BY ... LIMIT, MySQL evaluates each IN value fully and unlimited before merging and trimming the results, which gets expensive on large tables. The fix is to rewrite the IN as a UNION ALL of per-value subqueries, each with its own ORDER BY and LIMIT, then sort and limit the combined result. The example uses a composite index on (b, c, a) with FORCE INDEX. Side notes: when selecting many columns, fetch only the primary key first and join back for the rest, and replacing IN with OR doesn't help.

Permalink

(500) http://news.ycombinator.com/item?id=709713

This is a comment thread under an article on storing hierarchical data in SQL with nested sets. It opens with a proposal for materialized paths, where each row stores its full root-to-node path (ideally built from primary keys). That makes inserts cheap and makes subtree queries, depth and ancestry easy via prefix LIKE matches, at the cost of rewriting every descendant path when a subtree moves. Commenters argue over whether string indexes make it slow on large or deep trees, and whether nested sets suit very large, read-heavy data. Others suggest in-memory caching and PostgreSQL's ltree, and one experienced implementer criticises the article's reliance on MyISAM and table locks. That person recommends transactions, small tree scopes, keeping an adjacency list for rebuilds, taking the write lock before reading the left/right values, and Joe Celko's books.

Permalink

MySQL :: Managing Hierarchical Data in MySQL

The saved text is only Oracle's standard forward-looking disclaimer, not an article with an argument or findings. It says that any statements about product development plans are informational only, that Oracle makes no commitment to deliver particular features, code, or timing, and that none of it should be relied on for purchasing decisions or written into a contract. Whatever page you meant to keep was probably lost in the capture, so it's worth re-saving from the original source if the real content mattered.

Permalink

The Strange Economics of Water, and Why It Shouldn’t Be Free: A Guest Post

Charles Fishman, in a guest post promoting his book *The Big Thirst*, uses the Cleveland Cavaliers' secret removal of all 18 water fountains from Quicken Loans Arena, which pushed fans toward $4 bottles of Aquafina, as an entry point into the strange economics of water. He argues that bottled water is about convenience, coldness and branding rather than the water itself, and that it costs roughly 2,000 times more than tap, yet people protest small increases in their home water bills (average $34 a month in the U.S.). His main point is that "free" is the wrong price for water: underpricing it breeds waste and starves infrastructure, as shown by Americans spending $21 billion a year on bottled water against $29 billion on the whole water system, and by Philadelphia's 160-year replacement cycle for its water mains.

Permalink

Yale Rolls Out 10 New Courses – All Free | Open Culture

Yale's latest release of open courses, its first since October 2009, adds ten new titles and brings its free catalog to 35. The additions span the humanities, social sciences, and physics: Capitalism: Success, Crisis and Reform; Cervantes' Don Quixote; Tudor and Stuart England; Environmental Politics and Law; Epidemics in Western Society Since 1600; Financial Theory; Foundations of Modern Social Theory; Fundamentals of Physics II; The American Revolution; and The Moral Foundations of Politics. Each is listed with its professor and links to download lectures as video or audio through iTunes, the Yale site, or YouTube (Financial Theory has no YouTube link), and the courses are also folded into a running list of 350 free online courses.

Permalink

Google Maps API Library for CodeIgniter Framework | BIOSTALL

Announcement of the first release of a Google Maps API library for the PHP framework CodeIgniter, built by a developer who kept needing maps on nearly every site he made and wanted to cut the repeated setup work. It offers a downloadable zip and a 61kb PDF of documentation, invites bug reports and feedback, and promises further enhancements. A note at the top says a newer version now exists that uses Version 3 of the Google Maps API, so this original release is the older, superseded one.

Permalink

Freakonomics » Ten Things You Need to Do if You Were Hired Today

James Altucher's guest post on the Freakonomics blog lays out ten rules for thriving after being hired, drawn from his years as a junior programmer at HBO in the 1990s. The advice runs from immersing yourself in the company's products, history, executives, and industry, to making your boss look good, befriending secretaries and HR, and testing your market value through outside offers, with the final rule being to leave and start a competing or supporting business, using the contacts you've built. He frames it with the story of a nearly fired, awkward new hire who survived by obsessive study and an "I am the company" mindset, opening with a jarring anecdote of a woman killed by a taxi on his first or second day.

Permalink

HTML5 Rocks - Improving the Performance of your HTML5 App

A practical guide to making HTML5 animations feel smooth, built on the claim that a steady 30 fps beats 60 fps with dropped frames. It covers letting the browser use GPU acceleration (CSS transitions, translate instead of left/top, requestAnimationFrame), then a profiling workflow with Chrome's JS profiler and Timeline: isolate one behavior, repeat runs, measure before and after. The bulk is a list of DOM-performance fixes with before/after code: cache nodes and attribute values, keep DOM work out of loops, batch reads before writes to avoid repeated reflows, initialize lazily, use event delegation (except on high-frequency events), and avoid slow things like localStorage writes or Flash wmode during animation.

Permalink

France to require unhashed password storage - Boing Boing

I can't summarise this one: the text that came through is only Boing Boing's site boilerplate (terms of service, affiliate disclosure, cookie and privacy notice, forum rules, Creative Commons license) and not the article itself. The only hint of content is the stray line "Who will be eaten first?", which looks like a comment-section prompt rather than the piece's subject. If you paste the article text or share the title or link, I can write a summary that would let you tell it apart from similar saves.

Permalink

The Management Myth - Magazine - The Atlantic

A former management consultant with a philosophy PhD argues that management theory has never been the science it claims to be. He traces it to Frederick Taylor's pig-iron experiments, whose numbers were fudged and whose results Bethlehem Steel discarded, and to Elton Mayo's Hawthorne studies, whose results were muddied by replaced workers and higher pay. Nearly all later management literature, he says, just replays the rationalist (Taylor) versus humanist (Mayo) debate, with fads presented as revolutions and no accountability for consultants. He concludes that the M.B.A. mostly confers signaling, networking, and recruiting-pipeline value, and that management is really a branch of philosophy, since its core questions are about values, so philosophers should reclaim it.

Permalink

The Current State of HTML5 Forms · Wufoo

A reference page on the state of HTML5 form support, with browser-compatibility tables (Firefox, Safari, Chrome, Opera, IE, Android) for the new input types, input attributes, and form elements like meter, progress, output and datalist. Its main point is that HTML5 forms are a progressive enhancement: new types fall back to plain text inputs, so forms still work in older browsers. It also covers practical extras: a JavaScript attribute-support test (with Modernizr as the sturdier option), custom validity messages, stepUp/stepDown, CSS pseudo-classes such as :valid and :required, attribute selectors, and vendor-prefixed placeholder styling.

Permalink

Untitled (http://27.org/isocountrylist/)

A developer who got tired of rebuilding the same lookup table for the fourth time posts a downloadable MySQL file of ISO 3166 country names and codes, meant to back a registration form's country dropdown via a foreign key so the data stays clean for reports and mailing labels. The page includes import instructions, a sample registration table, PHP code for generating the select list, and sample join queries. A running changelog covers added UN-sourced 3-letter and numeric codes, a printable-name column, a companion USPS state/territory file, and a decision to leave Taiwan listed as "Province of China" because the data comes straight from ISO and the UN.

Permalink

Of the 1%, by the 1%, for the 1% | Society | Vanity Fair

Joseph Stiglitz's essay argues that American inequality, with the top 1 percent taking nearly a quarter of income and holding 40 percent of wealth, is not a natural market outcome or harmless to growth. He says it is largely engineered by the wealthy through tax breaks, weak antitrust enforcement, financial deregulation, and campaign money, and that it rebuilds itself as wealth buys political power. He lays out the costs: wasted talent and lost opportunity, underinvestment in infrastructure, research, and education, a warped foreign policy, and an eroded sense of fairness. He compares this to the conditions behind the 2011 Middle East uprisings and closes by invoking Tocqueville's "self-interest properly understood," warning that the rich will eventually learn too late that their fate is tied to everyone else's.

Permalink

10 Rock Solid Website Layout Examples | Design Shack

A designer's cheat sheet of ten reusable web page layouts to fall back on when stuck: three boxes, 3D screenshots, advanced grid, featured graphic, five boxes, fixed sidebar, headline and gallery, featured photo, power grid, and fullscreen photo. Each is shown as a simple silhouette, then paired with real sites and HTML or WordPress templates, with notes on what suits it (portfolios, app landing pages, news sites, photographers). The central argument is that clients mostly want clean, usable pages, so familiar structures are fine as long as you mix them, modify them, and make the styling your own.

Permalink