See Clear, SQL
One thing I often enjoy doing during the summer is tinkering with my long time coding project SAFARI, the system that powers asisaid and numerous other sites I've designed. Other than pragmatic, urgent changes here and there, I rarely have time to mess with it during the academic year, and while I by no means enjoy programming enough that I would want it to be my “day job,” I do enjoy the change of pace. To that end, over the last three summers, I've been modernizing SAFARI's code base, slowly removing dead code — some of which has been non-functional for the better part of a decade — and adding little features here and there.
Today I undertook cleaning out a lot of dead code from the component that puts together the lists of posts such as you find on the front page of this blog. That particular component probably has some of the messiest code of the entire program and, worse, a few parts still depend on an otherwise retired old theming system I replaced during the summer of 2010. I have been wanting to eliminate that dependency so that I can be completely rid of the inefficient old theming system and stick to the much cleaner, object oriented one I put together two years ago. As part of that, I needed to rewrite the subroutine that lists recently commented upon posts. Previously, that subroutine required several different SQL queries to list those posts, but I wanted to get it down to just one, more efficient query.
To accomplish this, I not only had to unleash my old friend “JOIN,” but also played around with non-JOIN subqueries. The result is not beautiful, but it allows me to get the data I need using just one SQL query:
SELECT uninet_articles.*, UNIX_TIMESTAMP(uninet_articles.gmt), uninet_comments.commentcount, uninet_comments.lastposter, UNIX_TIMESTAMP(uninet_comments.maxgmt) FROM uninet_articles RIGHT JOIN (SELECT aid, (SELECT poster FROM uninet_comments AS a WHERE b.aid = a.aid ORDER BY gmt DESC LIMIT 1) as lastposter, COUNT AS commentcount, MAX AS maxgmt FROM uninet_comments AS b GROUP BY aid ORDER BY maxgmt DESC LIMIT 10) AS uninet_comments ON uninet_articles.aid = uninet_comments.aid LIMIT 10
If any of my SQL inclined friends have suggestions for making the query more efficient, they certainly would be welcomed.
FiOS Quantum
This is the sort of thing that could make one wish one lived in a Verizon local telephone service area:
What's faster than FiOS internet service? FiOS Quantum evidently, as Verizon's latest high-speed internet service gets an official name and pricing. Effectively doubling every tier — except the entry-level 15/5 — each can be acquired with or without a custom bundle, double or triple play, and range in price from $65 to $175 a month — except the 300 down / 65 up which is only available by itself for $210 a month.
300Mbps down — that's incredible.
200
A lot of great looking new features appear to be on tap for Mountain Lion next month. I think it will be $20 well spent.
WWDC 2012
MacRumors has a nice roundup of the best rumors going into Monday's Timnote:
Apple has already announced that it will be previewing iOS 6 and OS X Mountain Lion at the event, and with Apple also expected to introduce a number of new Macs and perhaps make some additional announcements, the schedule appears to be packed.
Given that Tim Cook has promised that Apple is going to “double down” on secrecy and yet it seems like there are more highly certain rumors this year than in the past, I'm going to wager that something big is lurking in the shadows as a “one more thing”-type of surprise. While launching an Apple TV app platform wouldn't fill that role, perhaps demonstrating the Apple TV as a full fledged gaming system with an innovative controller might do the trick…
Leaked MacBook Pro Details?
Quite a few sites, including MacRumors, have been reporting about an allegedly leaked label from the next 13” MacBook Pro. The specs seem plausible, though I'm dubious as to whether Apple will give in and offer USB 3.0 when doing so might hurt Thunderbolt's chances of adoption.
My dubiousness feels like it receives some confirmation via another detail: the box refers to Mac OS X being pre-installed. As of OS X Lion, Apple dropped “Mac” from almost all references to “Mac OS X,” yet this label follows the old style. I suspect this was a slip by whomever created the label.
The X-37B
The Daily Mail has an interesting — albeit, overly conspiratorial, perhaps — little article on the X-37B space plane that is preparing to land after orbiting for about a year.
Last May, amateur astronomers were able to detect the orbital pattern of the first X-37B which included flyovers of North Korea, Iraq, Iran, Pakistan and Afghanistan, heightening the suspicion that the vehicle was being used for surveillance.
Is it really being used for surveillance, I wonder? If so, what could it possibly do that existing satellites could not do?
ownCloud
This is an interesting, Free Software combination of what appears to be a upstart Dropbox competitor and an iCloud calendar and contacts syncing competitor. But, unlike those services, this one will run on your own server or hosting account. It looks like it could have the potential to be an intriguing lightweight groupware option.
The Problem with Trade Shows
Scott Stein writes for CNet:
Apple, the 800-pound gorilla of the industry, never has an official presence at shows like CTIA (mobile), CES (consumer electronics), and Computex (PCs). But if you read between the lines of the press conferences and press releases, every company at those shows is implicitly talking about — and reacting to — the latest Apple gadgets, new or anticipated.
And now, as we approach the annual E3 trade show, the focus naturally turns to Apple's role in the video game industry.
Naturally.
If Separated from Apple, "iPhoneCo" Would Be...
Henry Blodget, not typically a huge fan of Apple, notes some of the more incredible aspects of Apple's latest financial results report. If the iPhone portion of Apple were a separate company, for example, it alone could be the world's most profitable company:
Seriously… here's how we get there. Apple's overall profit margin is 30%. We estimate that the iPhone's profit margin is slightly higher, say 35%. The iPhone is currently generating annualized revenue of nearly $100 billion. The iPhone's annualized profit, therefore, may be as much as $35 billion a year. That's bigger than the $30 billion of profit ExxonMobil generated last year.
Incredible.
HT: Gassee.
Who Copied Whom?
Since Apple has been busy with their patent suits against Android phone manufacturers, certain parties have made claims about how Android was already going where Apple headed with an all touchscreen phone before the iPhone. Thus, a presentation the Verge discovered which presents what an Android phone was originally suppose to look like is enlightening:
Exact specs for those first concepts aren't detailed, but Google does spell out what it had in mind for the least common denominator across Android devices. […] At that time, touchscreen support wasn't a requirement — in fact, the baseline specs required two soft menu keys, indicating that touchscreens weren't really in the plan at all.
Keep in mind that this plan was communicated a month or so before the iPhone launched and over year before Android finally came to market in the United States. Google was clearly aiming to copy the BlackBerry until the iPhone completely changed what people wanted in a phone. To his credit, Thom Holwerda, who has been a vocal critic of this suggestion in the past, has admitted that this new revelation shows he was wrong.