tag:blogger.com,1999:blog-21641202855354068632024-02-23T18:03:01.181-08:00JFoo on Techjfoohttp://www.blogger.com/profile/01258623353535524071noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-2164120285535406863.post-60071926087523110062013-12-28T21:19:00.001-08:002013-12-28T21:22:34.181-08:00Chromecast ReviewMy Sony DVD player was not handling Netflix very well -- lots of pauses. After some testing to verify it really was the DVD player I went out and got a Chromecast. This is a dongle that plugs into the HDMI port on the TV and is controlled by a smartphone or laptop. It will serve Netflix content to the TV (or Amazon or other sources too).
<p>It's a very cool idea: it connects to the wifi and hence to Netflix or Amazon or whatever content provider and displays it on the TV. It is controlled via an app on a smartphone, or a plugin to the Google Chrome browser. It is a very cool idea, but the implementation falls short.
<p>To do this right, the dongle needs to contact Netflix directly. Having the smartphone/computer get the content from Netflix (via wifi) and then sending it via wifi to the dongle is a very inefficient use of wifi. The Chromecast mostly does this right. When controlling it via a smartphone/app, the dongle contacts Netflix directly for the content. But when "casting" from a browser - even for Netflix - the inefficient route is used. In time honored tradition, this is billed as a feature rather than a bug: you are "casting" the browser content.
<p>The dongle is pretty limited in capabilities, but it handles Netflix which is 95% of our watching. So no complaints there.
<p>It can be controlled via Android app or iPhone app. And here's where it really falls apart. On our first watching the iPhone app either crashed or gave up, leaving us with a playing show that couldn't be paused. A little research showed it was pretty easy to crash the iPhone app.
<p>When starting a show via the iPhone app, the device is the owned by that app on that iPhone. When my wife started playback via her iPhone, I was unable to control it via my Android phone. The humorous point of view is that this solves the war over who gets the remote. But in reality, you want to be able to control the device with what is at hand, especially in the case of a buggy app, dead battery or phone call being answered.
<p>In summary:
<ul>
<li>This is very cool: using phones/tablets/laptops as remote controls for the TV is the future.</li>
<li>Buggy apps are frustrating (iPhone app crashing).</li>
<li>A remote is a remote - you cannot have one remote "taking control" and locking out others.</li>
</ul>
It's not worth it yet, maybe next year.
jfoohttp://www.blogger.com/profile/01258623353535524071noreply@blogger.com0tag:blogger.com,1999:blog-2164120285535406863.post-80548277425477164502012-04-14T08:56:00.002-07:002012-04-14T09:10:08.265-07:00Facebook cachingEconomy of scale takes on a new meaning at Google, Facebook and large cloud companies. I worked at F5 for a year, and learned a fair amount about deduping, link optimization and other strange techniques. I just ran into an issue with Facebook that highlights this, and may prove useful to others who encounter the same problem.<br /><br />My wife has a blog, <a href="http://www.theforevermarriage.com/">The Forever Marriage</a> where she discusses her forthcoming book. She blogs about 3 times per week, and always updates her facebook status with a link to the latest entry. Facebook normally gets a nice picture and some text, but for the latest, it would only post the raw URL.<br /><br />The issue was some strange html that crept in due to a Wordpress plugin, easily fixed. But Facebook had cached the link on first load, and thereafter only had that link. Any time she would try to post the new link, Facebook would only do the original page. I verified this by checking the logs as she was posting a new link: no activity in the logs.<br /><br />Economy of scale: imagine millions of people posting links. A few links will be posted by only one person. The majority probably get posted by 5 or 10 people, and a few get reposted by hundreds or thousands of people. Caching the link turns out to be a large savings in bandwidth. I would estimate reducing the bandwidth used for links by 90 to 95 percent!<br /><br />In case you encounter a similar issue, this website was very helpful: <a href="http://www.rajeshrana.net/2010/11/23/update-link-description-cached-facebook/">Rajesh Rana . net</a>. It directs you to <a href="http://developers.facebook.com/tools/debug">Facebook Developer debugging page</a> where you can clear the cache entry for your page.jfoohttp://www.blogger.com/profile/01258623353535524071noreply@blogger.com0tag:blogger.com,1999:blog-2164120285535406863.post-37628825250789509672011-02-09T18:47:00.000-08:002011-02-09T19:04:16.329-08:00Y2K, Leap Years, and other fun programming issuesI will start by saying that I have a rule of thumb: Y2038 doesn't matter. You might think this rather short-sighted of me, but I will be retired by then. This has been a choice on my part after dealing with time programming for a while.<br /><br />It started before Y2K. The developers at the small company I worked for had a friendly "demerit" board, just for fun. I even think I might have been the person to start it, but I was certainly the person who finished it, achieving 86,400 demerits in a single day. I had written a small time app and on February 1st (yes, really February 1st, so it probably should have been 86,401 demerits) it goofed a leap year calculation and was off by a whole day. I got one demerit per second.<br /><br />In my current job I'm wading through some hairy time code, involving stock exchange delays, timezones and summer daylight saving time. The code is ancient C code and I'm supposed to refactor it to C++ and make it elegant. It's full of time_t and struct tm, as well as a custom type that is a "weekly time": a time that measures how long since the week started. (It doesn't matter what year it is when figuring out how long to delay a stock ticker report). It's really kind of fun, but is prone to the 86,400 demerit kind of pitfalls I have fallen into before.<br /><br />To wit: one should always use symbolic constants, such as minutesPerDay, and never numeric expressions, such as 24 * 60. Even with such an obvious meaning as 24 hours and 60 minutes, sometimes it comes out 20 * 64, which is a different enough number to cause issues. Test Driven Development found this before it could get me any demerits.jfoohttp://www.blogger.com/profile/01258623353535524071noreply@blogger.com0tag:blogger.com,1999:blog-2164120285535406863.post-89851511600193176602010-11-21T20:03:00.000-08:002010-11-21T20:29:15.775-08:00Rental Car scamsI just got back from a trip to New Mexico where I rented a car from Alamo. One of the many questions is how to pay for gas. I chose to return the car empty and pay Alamo's $2.73/gallon rate to refill it on return. The other option is to return it full, or pay over $4.00/gallon to fill it on return. The latter is more attractive to Alamo, so check your paperwork carefully, in case the rental agent "forgets" to use the right option (they did forget in my case, but switched it when I complained on returning the car).<br /><br />I had a Chevy Malibu, I'm guessing a 2010. Almost all cars in the past few years come with an on-board computer that tells fuel economy in various ways, and how many miles left in the tank. Strangely, the Chevy Malibu didn't. I checked Chevy's web site and the new 2011 model comes with this computer as a standard option. So, either one of two things has happened: Chevy made the computer standard between 2010 and 2011, or Alamo has enough buying clout to get Chevy to make a rental-car version of the Malibu without this trip computer. And since the trip computer would have made it very easy to return the car with an empty tank, it is to Alamo's advantage to not have it.<br /><br />I returned the car empty. And they charged me for 16 gallons of gas (which is pretty accurate, 16.1 gallons according to the website). But they charged me $2.73 plus 7% sales tax (which is the rate for the city I was in) plus 5% "leased gross receipt" plus a 9.89 percent "concession fee".<br /><br />The sign on the desk said "$2.73 per gallon" with no asterisk or any information about the additional charges. I was told by the rental agent both on rental and return that $2.73 was the going rate of gas in the city. It wasn't. There were stations charging that much, but most charged less, and I bought gas at $2.57 in the suburbs.<br /><br />When I buy gas at a station, they never charge sales tax. New Mexico actually doesn't have a sales tax, they have a gross receipts tax. But my bill shows me paying both.<br /><br />The sign on the desk said $2.73/gallon. It didn't say anything about the almost 10% surcharge for a concession fee. Nor about the 7% and 5% taxes.<br /><br />The amount is not much. I don't think an attorney general or the BBB would talk to me over this amount. But it is dishonest and unethical. Buying special model cars to prevent consumers from knowing how much gas in the tank is dishonest and unethical.jfoohttp://www.blogger.com/profile/01258623353535524071noreply@blogger.com0tag:blogger.com,1999:blog-2164120285535406863.post-16104607190913587992010-03-24T20:39:00.000-07:002010-03-24T21:05:52.135-07:00Domain Registry of AmericaI just got a paper letter from Domain Registry of America telling me my domain was going to expire soon and I could renew with them for their best price. But they sent it to my home address, not the P.O.Box address I use for all domain contacts.<br /><br />I don't know how they do this. I'm pretty sure I never used the address for any of my domains. The domain is actually my name (first and last) dot org. I haven't received any other letters like this for my other domains, so I think they have purchased a usps mailing list from someone and correlated it to domain names.<br /><br />The letter in question was a pretty straightforward attempt to catch me sleeping. It stated my domain was about to expire, and I really really really needed to renew it, and by sending in 3 times the annual amount I currently pay they would be happy to transfer me to their service.jfoohttp://www.blogger.com/profile/01258623353535524071noreply@blogger.com0tag:blogger.com,1999:blog-2164120285535406863.post-40665774017281390812010-03-19T07:32:00.000-07:002010-03-19T07:50:36.247-07:00The latest facebook phishing scamThere's a facebook phishing e-mail going around, it tells you your password has been reset and the new password is in a zip file attached to the mail message. There's nothing unusual about the phishing attempt. It's unusual that it is receiving so much attention, but that isn't newsworthy to me.<br /><br />What is unusual and newsworthy is the source of the e-mail addresses it was mailed to. I use a different e-mail address whenever I register at a website. Typically it is <span style="font-style:italic;">company name @ my domain</span>. Not only does this lead to lots of fun confusion when I tell a company representative my e-mail address (I've been accused of lying), but it also lets me track if the company sells their e-mail list, or uses it in nefarious scamming ways.<br /><br />And it lets me see when a company might have been hacked, and their e-mail list stolen. I've received two messages so far, one for my Roku (www.roku.com) e-mail, and one for my Big Brand Water Filter (www.bigbrandwater.com) e-mail. I don't know anything about Big Brand Water Filter, other than they sell cheap water filter parts, but Roku has always been a reputable company. I suspect their e-mail list has been stolen somehow.<br /><br /><span style="font-weight:bold;">Update:</span> I cannot remember exactly in which context I used the roku address. I have purchased from them, and used their support forums, but I also had a professional relationship with them, and the only support forum account I could remember used my work e-mail address. The Big Brand Water Filter was used for a purchase, and only once I think. It is troublesome to think that the phishers hacked into servers and had access to sales data.jfoohttp://www.blogger.com/profile/01258623353535524071noreply@blogger.com0tag:blogger.com,1999:blog-2164120285535406863.post-6787545713825831302009-07-07T22:59:00.000-07:002009-07-08T20:02:06.725-07:00Whither OS (homage to Monty Python's Whither Canada)Google announced their Chrome OS today:<br />“We’re designing the OS to be fast and lightweight, to start up and get you onto the Web in a few seconds.”<br /><br />A couple of years ago, my kids' computer was infected by a virus. They said "oh, just re-image it, we don't need anything on the disk."<br /><br />I'm slowly repairing a goof on my music collection where I erased all track numbers, not a huge deal, but time consuming. But I look at that time, then at my wife happily using Pandora, and wonder why bother.<br /><br />Where is your personal data? Mine, currently, is mostly on a server hosted on the opposite side of the country for dirt cheap. I ran a server in my house for a decade, but the hassle became far more expensive than the cheap hosting available. So is the data really mine anymore? Probably not, the hosting company has access to it, though that would be outside the terms of service. I still have my old server, with tons of pictures and music, too expensive to host remotely.<br /><br />Ancient history: the behemoth computer that ran jobs constantly, and mere mortals could only have jobs run during the wee hours of the morning. Your data was on punched cards, and you got more data back in the form of a print-out. Then time-sharing came along, and instead of waiting overnight, you sat frustrated at the terminal hitting enter and wondering how many other damn people were using it. Your data was in an air-conditioned room somewhere, perhaps on a disk drive looking like a washing machine with a label on the front saying "don't place anything on this disk drive, it will break if you do." Then there was the personal computer, and you didn't have to wait for anyone else, but it couldn't do very much. Your data was on floppies, or maybe a 10 megabyte hard drive.<br /><br />Then networking came into the picture, and where data lived got confused. At first, it was pretty clear. When you got an e-mail, it was downloaded to your account or PC and removed from the server. But then, laptops and multiple accounts came into the picture. I want my mail available no matter where I am, or what computer I am on, and of course I don't want anyone else to read it. I have a cool music playing program at home, why can't I use it at work? Or at the coffee shop? I can get to my bank account from anywhere, why not music?<br /><br />Where <span style="font-weight:bold;">is</span> your personal data? <span style="font-weight:bold;">What</span> is your personal data?<br /><br />How is it backed up or saved from loss?<br /><br />How is your privacy protected?<br /><br />Why would you buy a desktop system for home use?<br /><br />These aren't rhetorical, I'd like to know. For me - my data is on my server, or my old server. It is websites, e-mail, notes, music and pictures. It's backed up by various means, including RAID. It used to be privacy was protected by me being the only one with access to my server, but that's no longer true. Now I don't know. And I don't think I'll ever buy a desktop system again. The <span style="font-weight:bold;">only</span> reason for this would be because I needed a lot of CPU power, memory or hard disk space, say for software development (other people might want it for gaming or similar high demand applications). But right now I access powerful remote systems to do software development, I don't need the power at home.jfoohttp://www.blogger.com/profile/01258623353535524071noreply@blogger.com8tag:blogger.com,1999:blog-2164120285535406863.post-40811741763246347542008-07-31T14:08:00.000-07:002008-07-31T14:19:53.243-07:00What is U-Haul up to?I moved - a pain, but not really blog-worthy. Except: I rented a U-Haul truck to carry our belongings across town. One of the big ones, fun to drive, gets 7mpg if going downhill with a tail wind.<br /><br />There was this mystery box on the side of the cab, below the dash, just next to my left calf. Had a digital readout, two LED digits, that perhaps were tracking time, they went from 70 to 74 while I was using it. I'm remembering vague stories about rental car companies charging a fortune because their secret GPS tracked the guy going 80mph (which is a little amazing itself, my GPS once tracked me doing 150MPH even though I was doing about 60) so I watched my speed.<br /><br />I asked the guy when I returned it: "so... what's that little box there with the readout". "Oh, it's for the brakes... you know... the brakes on these big trucks". I replied "yes, I know about air brakes, but what's that box *for*"? He's kind of blustery: "it's the brakes, you know... These big truck brakes...". I didn't question further.<br /><br />I'm pretty sure it isn't for the brakes: it's an add-on box, and brakes are pretty integral. Plus, I don't think a gradually increasing pressure from 70 to 74 would be a good sign.<br /><br />The question is: what is it? What sneaky data is U-Haul capturing?<br /><br />And as long as we're on this subject, did you ever notice that Nickelback's song "Leader of Men", when played on the radio, leaves out the half verse that states "Turn your television off, and I will sing a song, and if you happen to have the urge, well you can sing along". It's a conspiracy between the music industry and U-Haul, I tell ya....<br /><br />I'm going to go make a tin foil hat now.jfoohttp://www.blogger.com/profile/01258623353535524071noreply@blogger.com0tag:blogger.com,1999:blog-2164120285535406863.post-59808985683401259552008-02-13T07:58:00.000-08:002008-02-13T12:34:56.910-08:00An honest mistake?I was watching the City Council on television one night, and they were dealing with restaurant owners who had failed the City's sting operation and served alcohol to a minor. One owner's defense - "It was an honest mistake" - was ignored (and probably correctly so).<br /><br />But something happened recently that made me realize there are errors and there are errors, and perhaps an honest mistake is different than intentional malice.<br /><br />Suppose we are managing a database of CDs, just a listing of CDs, their artists, titles and track names. Input comes from the community at large. Someone puts a new CD in their computer, it looks it up in the online database (via the Internet), and if it isn't found, they type in the info and it is submitted.<br /><br />Suppose that instead of typing "The White Stripes", they enter "The White Stirpes". Or suppose that instead of entering all the track info carefully, they enter the first one, then get bored and then enter "track 2", "track 3", ... or worse, "asdf", "lkjh", ...<br /><br />If the database is smart, it will recognized that "The White Stripes" and "The White Stirpes" are the same artist. And by carefully culling data from the online community, it can recognize that "The White Stripes" is correct, and "The White Stirpes" is a misspelling. Anyone else asking for info about "The White Stirpes" will then receive information about "The White Stripes", which is almost certainly what they want. (Yes, it's possible that Weird Al Yankovic will for a new band called "The White Stirpes"). This kind of error provides valuable information to the database.<br /><br />But "track 2", "track 3" or "asdf", "lkjh" are not as valuable. "Track 2" is recognizable as filler, but random characters aren't. Neither provide the same information that an "honest" misspelling does.<br /><br />In this case, honest mistakes are far better than intentional malice (well, intentional laziness).<br /><br />Any other cases? Counterexamples?jfoohttp://www.blogger.com/profile/01258623353535524071noreply@blogger.com0tag:blogger.com,1999:blog-2164120285535406863.post-38822380668553300552008-01-10T10:01:00.000-08:002008-01-10T10:23:35.467-08:00Spam from Coffee shops?Bruce Schneier, one of my heroes, <a href="http://www.wired.com/politics/security/commentary/securitymatters/2008/01/securitymatters_0110">wrote that he runs an open WiFi</a> at his home. One of his reasons was:<br /><blockquote>I can count five open wireless networks in coffee shops within a mile of my house, and any potential spammer is far more likely to sit in a warm room with a cup of coffee and a scone than in a cold car outside my house.</blockquote><br /><br />I run my own mail server at home, and originally configured it to accept the STARTTLS command. Running an open relay is a no-no, and so unless you have authentication credentials, connecting to my server from outside will only allow local delivery. With the credentials, you can send mail to anywhere.<br /><br />One day soon after configuring this, I was sitting in a local coffee shop (I think it was Caribou, but I am not sure), sending an e-mail and got a strange error message: it didn't recognize the STARTTLS command. After a few minutes head scratching trying to understand why my server wasn't recognizing it, I realized that I <span style="font-weight:bold;">wasn't</span> connecting to my home server. The coffee shop wireless (on top of their auto-sign-in process) was stealing all port 25 traffic and feeding it to their own server. I'm just guessing, but I'd bet a lot that this is to prevent someone from walking in, grabbing a delicious cup of coffee and a scone, and sending a few thousand e-mails saying "Dearest one, I am a 200 year old senile senior citizen who wants to give you a 25,123,999 (twenty five million, one hundred twenty three thousand, nine hundred ninety nine) U. S. Dollars".<br /><br />I began running a second mail server on a different port, and now it works fine. Port 25 is still for anyone sending me mail (including, unfortunately, spammers) and the other port is for me when I'm away from home.<br /><br />One of the reasons I set up my own mail server was security: checking e-mail is done via secure IMAP, sending is done via encrypted SMTP, and theoretically, I can send myself a message and later read it, from anywhere in the world, securely. I don't have anything that really requires that much security, but it's cool to have it.<br /><br />And yet, it's not perfect. A coffee shop/hot spot could run a man-in-the-middle attack by carefully watching my outgoing traffic, and if I'm not careful about certificates, they've got me. I'm not sure why they'd want to, but it's possible.jfoohttp://www.blogger.com/profile/01258623353535524071noreply@blogger.com1tag:blogger.com,1999:blog-2164120285535406863.post-47443072581373539502007-12-13T09:55:00.000-08:002007-12-13T14:36:42.935-08:00Embrace and Extend or Standardize and StultifyThe operator precedence in the title is correct: <b>and</b> binds tighter than <b>or</b>.<br /><br />I've long been a fan of the GNU compiler (since at least the early 90s), but I'm a little disappointed with their current direction.<br /><br />Let's say you wanted a C++ class for string handling. We'll just put in a char * member variable (the only data member) and some cool functions like Left, Capitalize, Parse and Rot13 (also known as SuperSecretEncryption).<br /><br /><pre><br />class CString {<br />public:<br /> CString Left(int NumberCharacters);<br /> void Capitalize();<br /> int Parse(char *Format, ...);<br /> void Rot13();<br />private:<br /> char *m_Data;<br />};<br /></pre><br /><br />A cool thing to do with strings like this is to pass them to printf:<br /><br /><pre><br />CString MyString;<br />...<br />printf("Here it is: <%s>\n", MyString);<br />...<br /></pre><br /><br />Should this work? Consider:<br /><pre>char *foo; printf("%s", foo);</pre><br />The arguments to printf are a pointer to a string, and a pointer to a string. Now, for the MyString printf, the first argument is still a pointer to a string. The second is an object, and what actually gets put on the argument list is the contents of the object, which is, you guessed it, a pointer to a string.<br /><br />So it should work. And it does with Microsoft's Visual C++ compiler (which is where I happened to meet this idiom).<br /><br />However, the GNU C++ compiler complains with this message:<br /><pre>cannot pass objects of non-POD type 'CString' through '...'</pre><br /><br />If you take a look at <a href="http://gcc.gnu.org/ml/gcc/2007-10/msg00369.html">this thread in the GNU C++ compiler mailing list</a>, you'll see that it is not supported, because it is not standard. Worse, the compiler, in pursuit of standardness, does not issue an error message, and instead <b>emits code causing the program to abort</b>.<br /><br />That's right: they print a warning, and if you ignore the warning and run the program: <b>CORE DUMP</b>. A little unfriendly...<br /><br />The Intel C++ compiler does better, it prints a warning but emits code to do the right thing.<br /><br />While Microsoft is often guilty of <i>Embrace and Extend</i>ing common standards (such as HTML so that web pages only correctly display in Internet Explorer), in this case I don't think they've done anything wrong. The metaphor is very useful, and there is no benefit to forcing programmers to use the clumsier:<br /><pre>printf("%s", (char *)MyStringObject);</pre><br />(assuming that there is a conversion operator for CStrings).<br /><br />The GNU compiler group is guilty of an equally evil technique: let's call it "Standardize and Stultify". When I pointed out that the metaphor was useful, I received the terse reply:<br /><pre>> The class is a non POD.</pre><br />Meaning basically "we're sticking to the standard, broken though it may be".<br /><br />The Intel compiler got it right, but of course this would tie me to Intel and AMD platforms.jfoohttp://www.blogger.com/profile/01258623353535524071noreply@blogger.com0