The telephone call (a true story)
My love, Whilst i normally find myself content to listen as you regale me with tales of dental status, and to congratulate you on your scheduling prowess, when amongst the first words that escape my lips comes the phrase "i'm trying to get out of work," i would appreciate it all the more if such could wait until we see each other again. Fondly, me.The Puppet World Museum had an Exposition of Large Significance
The Puppet World Museum had an Exposition of Large Significance, invading a sleepy town of some thousands of people. In a surprising and inexplicable move, Nissan Motor Company announced that it was paying for admission of any and all comers. I was just about to find out what all the fuss was about when I woke up.
What? Where's my iPhone 5?!
Unless you're living under a rock, you know that Apple did not introduce the iPhone 5 last week, but instead introduced the iPhone 4S. I've been asking what, exactly, was missing from the iPhone 4S that the iPhone 5 would have had. I've gotten back two responses: WiMAX and LTE support.- WiMAX support is a non-starter. While it is a true 4G technology, it's also a Sprint-only technology, and doesn't have pervasive deployment in the US, much less worldwide.
- LTE is a standard that enjoys support from carriers all over the world. Also a true 4G technology, it's in its earliest stages of deployment. In the US that turns out to specifically mean that it's only in larger markets, and only used for data, not voice.
A simple hands-on test for tablets
Here's all you have to do: bring up the home screen, swipe your finger across it to move between pages, and watch how fluid the motion is.Yep, that's it.
Try it with the iPad 2. It scrolls between pages smoothly whether you drag your finger slowly or quickly. It responds immediately. In short, it acts like you expect it to.
On the other hand, most Android-powered tablets fail this test miserably. The well-made and (relatively) popular Samsung Galaxy Tab is markedly poor in this respect. Thinking it was related to the 10" display, I tried the smaller 7" Tab. If it performed any better, I couldn't tell. Toshiba's Thrive was no better, and maybe even worse, in spite of flowery marketing informing me of its status as a "media monster" (or some such thing). At least half of that is true, incidentally, even if I misremember the exact phrase.
Faring much better than these abysmal offerings, the Motorola Xoom also offered fit and finish comparable to Samsung and Apple's gear. It couldn't be considered smooth, though, and it barely passed the test.
The surprise came from Acer in the form of its Iconia A1500. It wasn't built to the same standards as the top sellers, but this was the only tablet I picked up that was on the same playing field as the iPad 2. Responsive? Yes. Fluid? Check.
The Android tablets are still fighting a pretty stiff uphill battle against the king of the hill. None of them was particularly attractive; why get something that's almost as expensive as the iPad, but not almost as responsive, with fewer apps, and still waiting for "the next release of Android, which will be the best... evar"?
Making CSSTidy tolerate browser-specific properties
I've been working on an application that combines CakePHP, jQuery UI, CSSTidy, and jsmin-php under the same roof. Unfortunately, both CakePHP and jQuery UI use browser-specific CSS properties as well as browser-specific values to specify gradients. CSSTidy, the good soldier that it is, tries to do something intelligent with these things. It fails miserably.
I'd regale you with tales of the adventures that went into resolving this, but let's dispense with those and simply say that the one solution you'll find is (a) a hack, and (b) doesn't apply to CSSTidy 1.3. This solution has replicated a bit but you'll find it's the same idea in each instance: hard-code some bits to allow -webkit-gradient and -moz-linear-gradient to pass through unscathed. However, that's not really where the problem lies.
To fix the issue in a more robust way requires an understanding of what's going on. You can get most of the way there by telling CSSTidy to be more forgiving of non-standard properties using the "preserve_css" flag. There were two additional problems that this flag didn't address.
- My code was including jquery.ui.all.css. This in turn used @import to pull in the rest of the jQuery UI CSS files. I only had a subset of files necessary for what I was doing. CSSTidy hates hates hates this. Solution: use an all-in-one CSS file from the jQuery UI distribution, instead.
- Background gradients are styled using unusual property values (instead of new properties) that start with a hyphen, followed by different (alphabetic) prefixes for the different rendering engines. CSSTidy naively looks only for a leading digit, "+", or "-" and decides that "-moz-linear-gradient(top, #a8ea9c, #62af56)" is, in fact, a number, and that it evaluates to zero. Solution: teach CSSTidy to be wise.
To do that, apply this patch:
Index: class.csstidy_optimise.php
===================================================================
--- class.csstidy_optimise.php (revision 240)
+++ class.csstidy_optimise.php (working copy)
@@ -389,6 +389,10 @@
{
continue;
}
+ if (!(strlen($temp[$l]) > 1 && $temp[$l]{0} == '-' && is_numeric($temp[$l]{1})))
+ {
+ continue;
+ }
// Fix bad colors
if (in_array($this->property, $color_values))Problem: solved.
For bonus points, you can tell CSSTidy to discard comments anyway, even though you're using preserve_css, by implementing a "discard_comments" flag. (Like preserve_css, you'll need to enable discard_comments using set_cfg() after instantiating a new csstidy object.)
Index: class.csstidy.php
===================================================================
--- class.csstidy.php (revision 240)
+++ class.csstidy.php (working copy)
@@ -268,6 +268,7 @@
$this->settings['css_level'] = 'CSS2.1';
$this->settings['preserve_css'] = false;
$this->settings['timestamp'] = false;
+ $this->settings['discard_comments'] = false;
$this->load_template('default');
$this->print = new csstidy_print($this);
@@ -317,7 +318,7 @@
* @version 1.0
*/
function _add_token($type, $data, $do = false) {
- if($this->get_cfg('preserve_css') || $do) {
+ if(($this->get_cfg('preserve_css') && !($type == COMMENT && $this->get_cfg('discard_comments'))) || $do) {
$this->tokens[] = array($type, ($type == COMMENT) ? $data : trim($data));
}
}As in the past, I'm sorry, but I'm not really able to help with applying patches.
On space, time, and the fourth dimension
I was thinking this morning - a dangerous confession, I realize - and out of the blue came this thought:
Contrary to common thought, time is not the fourth dimension.
Let's simplify the question a bit. In geometry, we're taught about two- and three-dimensional objects. Upon first learning how to describe the latter, for example, you were probably shown that a sphere can be thought of a circle that has been rotated along a line though its center. A cube is simply a square that has been extended along a vector perpendicular to the plane of that square to a distance equal to the length of its sides. In each case, and countless others like it, we've imposed time as we visualize these objects, even if it's only in a "before" and "after" sense.
What's important to understand here is that three-dimensional objects are describable mathematically in their own right and in a way that does not depend on time. Time is merely a mechanism that we can use to describe a three-dimensional object in terms of two dimensions. Instead of a rotated circle, we might instead describe a sphere by passing it through a plane and stacking each resulting circle-slice. In the medical world, X-ray computed tomography (CT) scans use a similar idea, creating a three-dimensional dataset from a series of two-dimensional X-ray images. This is accurate enough, at least to the point that we can't perceive that the slices have any thickness. It is nevertheless an imperfect representation.
Mathematics handles this cleanly and elegantly. We are taught about limits and integration, and if we're very lucky we've had instructors who are clear on the point that while it can be helpful to think of these things in terms of time, there is nothing that binds math to time.¹ And hence, my epiphany: we are wont to describe the fourth dimension in terms of three physical dimensions and time, but this is an imperfect representation in exactly the way that describing the sphere in terms of circle-slices and time is imperfect. Four-dimensional (and in fact, N-dimensional) objects can be described mathematically in their own right and in a way that does not depend on time; thus, time is not a dimension, no matter how much it behaves as such.
Update: A reader challenge made me realize that I'm lacking a good summary. My fundamental observation is that you can use time in any n-space to describe an n+1-space, but this doesn't imply that time defines the n+1-space.
¹ In fact, Barry Peterson - my favorite math instructor - seemed to have little regard for time, both in the abstract and in the physical world. I'm not implying that he was disrespectful or frequently late, but I should probably just leave it at that.



