Monday, September 23, 2013
Reminder for Jamulians: Yuki Sushi is closing forever, and this coming Sunday (September 29th) is the last day Jenny can keep it open. She's not being allowed to renew her lease, and her current lease expires at the end of the month. After 10 years in Rancho San Diego, she's an icon for all the local sushi lovers. We talked with her today, along with her daughter Lena – she's very sad about the end of this part of her life, but cheered a little bit by the thought of taking a vacation. A nice, long vacation...
All hail GMail! I've been using GMail on a web browser for five or six years now. A few weeks ago, GMail was upgraded with a bunch of new features. Most of them I thought were great, but one I absolutely hated – to the point where I started looking at alternatives for GMail. But this morning I discovered an easy work-around that has restored my GMail happiness. If you're a GMail user too, you may find this useful...
The problem is with the new “Compose” window. When you click on the COMPOSE button, you get a small window with highly compressed menus. Amongst numerous related annoyances, one stands out for me: it takes two clicks to use the formatting menu. If you can remember the keycodes (like CTRL-I for italics), they still work ok. But if you want to italicize some text you've highlighted with your mouse, then welcome to the world of two-click menus.
The work-around I just discovered is simple: just hold the SHIFT key down when you click on the COMPOSE button. When you do this, you'll get a larger (and adjustable sized) window that pops over your inbox – and the formatting menu is there at the bottom in all its one-click glory. Hallelujah!
The problem is with the new “Compose” window. When you click on the COMPOSE button, you get a small window with highly compressed menus. Amongst numerous related annoyances, one stands out for me: it takes two clicks to use the formatting menu. If you can remember the keycodes (like CTRL-I for italics), they still work ok. But if you want to italicize some text you've highlighted with your mouse, then welcome to the world of two-click menus.
The work-around I just discovered is simple: just hold the SHIFT key down when you click on the COMPOSE button. When you do this, you'll get a larger (and adjustable sized) window that pops over your inbox – and the formatting menu is there at the bottom in all its one-click glory. Hallelujah!
It's not fair! That word – “fair” – is a far more complex word than I'd ever imagined. The OED's definition alone runs to five pages. Used in the context of economics and politics, it's even more complicated. Plus, you can't translate it into any foreign language! Who knew?
“He had all the charm of a skin rash...” Says Dave Carter, writing at Ricochet, about Ed Schultz, whom Dave calls “MSNBC's resident maniac”. There's ever so much more goodness in his post...
Deny all health care access to Obamacare non-believers! So thundered Stephanie Handler, a development assistant (whatever that is!) at the University of California (of course), San Francisco (double of course!). Later she apparently thought better of her tweet and deleted it. Now her account has also been suspended. At right is a screenshot of her tweet before all that.
So sweet and caring, those lefties are...
So sweet and caring, those lefties are...
I wonder if my dad knew about this place? My dad had a lifelong interest in the plant world before being stricken with Alzheimer's last year. He would have been fascinated with the bizarro-world plants (like the Adenium obesum at right) on Socotra Island in the Indian Ocean...
My mom sends me stuff. Sometimes they're funny:
Researchers for the Massachusetts Turnpike Authority found over 200 dead crows near greater Boston recently, and there was concern that they may have died from Avian Flu. A Bird Pathologist examined the remains of all the crows, and, to everyone's relief, confirmed the problem was definitely NOT Avian Flu. The cause of death appeared to be vehicular impacts.And sometimes it's a good thing she lives 2,500 miles away, where I can't throw something at her!
However, during the detailed analysis it was noted that varying colors of paints appeared on the bird's beaks and claws. By analyzing these paint residues it was determined that 98% of the crows had been killed by impact with trucks, while only 2% were killed by an impact with a car.
MTA then hired an Ornithological Behaviorist to determine if there was a cause for the disproportionate percentages of truck kills versus car kills.
The Ornithological Behaviorist very quickly concluded the cause: when crows eat road kill, they always have a look-out crow in a nearby tree to warn of impending danger. They discovered that while all the lookout crows could shout "Cah", not a single one could shout "Truck."
When you've lost the comedians... A nice collection of recent spiels from various TV comedians, via my lovely bride:
President Obama was in Russia last week. I couldn’t swear to it, but I think he was seeking asylum.
The United States has no choice but to attack Syria because Dictator Bashar al-Assad is killing his own people with chemical weapons. Before, he was just killing them with bullets. But if America cared about shooting people, we'd be invading Chicago.
Syria's President Assad referred to President Obama as weak. Obama is so angry he plans to ask Congress for permission to come up with a good comeback.
I guess we're getting ready to attack Syria. But if we win, in the semifinals we face Iran.
If President Obama really wants to hurt the Syrian government, don’t send cruise missiles. He should send over some of his economic advisers.
President Obama is asking Congress to support a military strike in Syria. If they approve, it will be the first time Congress has officially declared war since Obamacare.
Java - overflow and compare vs. subtract: integer overflow is a challenge in many modern programming languages, including Java. For many programmers, the silent overflow is unexpected, and often unanticipated. It's also frustrating, because the underlying computer hardware “knows” about the overflow, but there's no way in the programming language to detect it without some ugly (and slow) code.
Overflow can cause some very subtle bugs. One that I've run into several times over the years is in a comparison, like that used to implement the java.lang.Comparable interface. You might see something like this:
The traditional way of handling overflow in Java (and many other languages) is to “upcast” to a larger precision integer to do the comparison. The implementation above could be revised to this:
However, I just discovered something that has somehow eluded me in over ten years of Java development (and may well be true in other programming languages, too): the relational comparison operators (<, >, <=, and >=) are apparently not implemented with a subtraction – instead, they appear to have access to the underlying hardware's knowledge of overflow and underflow. That means that we can implement the comparison method in a much cleaner way:
Overflow can cause some very subtle bugs. One that I've run into several times over the years is in a comparison, like that used to implement the java.lang.Comparable interface. You might see something like this:
@OverrideThat looks innocent enough, but it will fail – silently! – if an overflow or underflow occurs in that subtraction. This will occur, for example, if intField contained 2,000,000,000 and obj.intField contained -2,000,000,000. That comparison would return a negative number, which of course would be incorrect.
public int compareTo( T obj ) {
return intField - obj.intField;
}
The traditional way of handling overflow in Java (and many other languages) is to “upcast” to a larger precision integer to do the comparison. The implementation above could be revised to this:
@OverrideThis upcasts the int arguments to long, subtracts as long (thus avoiding the overflow), then turns the result into one of three int values (-1, 0, 1). It has one unarguable advantage: it works correctly with all int values.
public int compareTo( T obj ) {
long c = (long) intField - (long) obj.intField;
return (c == 0) ? 0 : (c > 0) ? 1 : -1;
}
However, I just discovered something that has somehow eluded me in over ten years of Java development (and may well be true in other programming languages, too): the relational comparison operators (<, >, <=, and >=) are apparently not implemented with a subtraction – instead, they appear to have access to the underlying hardware's knowledge of overflow and underflow. That means that we can implement the comparison method in a much cleaner way:
@OverrideThis also has the advantage of returning a pure signum function result (the second example did as well).
public int compareTo( T obj ) {
return (intField == obj.intField) ? 0 : (intField > obj.intField) ? 1 : -1;
}
The only review that matters to Apple: “first weekend” sales of the new iPhone models set a record: 9 million phones. The iPhone 5C has a volume of almost 4 cubic inches and weighs 4.65 ounces – so 9 million of them would occupy 771 cubic yards, and would weigh 1,308 tons. That's a lot of iPhones!
An appreciation of beauty is baked into the culture in Japan, whether it's natural beauty or man-made. The manhole cover at right is a great example – the utilitarian, purely functional manhole covers in our U.S. cities look downright Stalinist by comparison. Here's an entire collection of Japanese manhole cover photos.
Way back in the '70s, I once took two weeks leave while my U.S. Navy ship was in port at Yokosuska, Japan. I took off for a two week long trip through the Japanese countryside on my bicycle. That trip was memorable for several reasons, but one of them was my discovery of the pervasive Japanese appreciation for beauty. I don't recall the manhole covers – but then, I wasn't in any city for very long. The one thing that sticks out in my mind is are the beautiful little gardens, all meticulously tended, that could be found under just about every bridge abutment along the country roads. These were created and maintained by local folks, just for the beauty and for the appreciation of travelers...
Way back in the '70s, I once took two weeks leave while my U.S. Navy ship was in port at Yokosuska, Japan. I took off for a two week long trip through the Japanese countryside on my bicycle. That trip was memorable for several reasons, but one of them was my discovery of the pervasive Japanese appreciation for beauty. I don't recall the manhole covers – but then, I wasn't in any city for very long. The one thing that sticks out in my mind is are the beautiful little gardens, all meticulously tended, that could be found under just about every bridge abutment along the country roads. These were created and maintained by local folks, just for the beauty and for the appreciation of travelers...
How are those gun controls working out for you? Over the weekend Chicago – with some of the strictest restrictions on guns in the U.S. – had 23 shootings, including 5 fatalities. Like the NRA says: outlaw guns, and only the outlaws will have them...