Personal weblog of Ted Pavlic. Includes lots of MATLAB and LaTeX (computer typesetting) tips along with commentary on all things engineering and some things not. An endless effort to keep it on the simplex.
Thursday, February 02, 2012
What it means for GMail's web interface to use a different grammar for labeling and searching...
Now, the search bar at the top of the GMail web interface doesn't have much problem with this. It will match such labels regardless of whether I include the leading special character:
Note that it's not just finding partial matches in the middle of a label. If you drop the first alphanumeric character after the special characters, you get no matches:
Now, you would expect the "Move To" and "Copy To" quick searches to behave the same way. At first, it seems like they do. They'll do partial matches from the front of the label if you include the special character:
But if you drop the special character, you're doomed.
Pretty annoying, huh? See, "Move To" and "Copy To" are using some special grammar to extract information from the list of labels. Apparently this grammar is overly simple. Now, I might be able to live with that if it wasn't the case that GMail Search knows how to get labels right. In fact, Gmail Search can even handle nested labels with leading special characters. Check it out:
See? It was able to recognize that the "/" in big version of the label name separated parent from child label (which actually can be a problem if you're not intending to use nested labels). It then looks for matches at the start of the sublabel, which is in the middle of the big label shown. Pretty cool. Moreover, if you drop the leading alphanumeric character, the match fails:
Now, apparently "Move To" and "Copy To" have some of this matching behavior. That is, they'll properly chop the label into parent and child and look for matches in just the child part:
Unfortunately, you need the special character for the match to work:
So, again, for some reason GMail has developed the quick search for "Move To" and "Copy To" independently from GMail Search in general. Maybe this was an optimization, but it seems like it wouldn't be too slow to call out to GMail Search to find these labels. Then everything would be consistent.
Now, I tried explaining this to the Google Apps support team initially. You know what they told me? That "Gmail Search" doesn't do partial matches, and so it's the expected behavior. Can you believe they actually had the nerve to forward me to a GMail Search page when the real problem is that "Move To" and "Copy To" are in fact acting DIFFERENTLY than GMail Search? IF ONLY the issue was with GMail Search; I could live with that.
Well, Thunderbird gets it right. I guess that's a nice workaround.
Monday, January 30, 2012
The Sony SMP-N200 (or SMP-N100) is the only streaming player you need; eschew the Roku!
For US$66.99 on Amazon (and US$69.99 on Best Buy) at the time of this post, you get:
- HDMI output for full 1080p video and 5.1 channel audio
- Optical audio output (if your receiver doesn't do HDMI audio)
- Analog audio output (via RCA connectors)
- Composite video output
- Component video output
- Wired ethernet support
- Wireless 802.11b/g/n support built-in
- USB port (videos, pictures, music)
- DLNA client (and maybe server for that USB?)
- HDMI wake-up (i.e., device turns on and off automatically based on HDMI signal; moreover, this behavior is configurable if you don't like it)
- Very thin and simple remote control powered by a watch battery
People say this remote is an improvement over the one that came with the old SMP-N100 model, but I disagree. For one, the "Home" button is too close to the down arrow. More importantly, the old remote control was quasi-universal in that you could program it to your TV and it would control your TV's volume, power, and video input. So I basically only need one remote with the SMP-N100 to do everything.
- Android phone and tablet remote control apps
- iOS remote control app
- ...probably more that I overlooked because I personally didn't care
And the applications that come on board the Sony SMP-N200 include:
- Hulu Plus (and free Hulu via PlayOn over DLNA, but see CAVEAT below)
- Amazon Instant/Video-on-Demand (although the app doesn't play trailers)
- Vudu (albeit without "Vudu Apps" but with full "Vudu Movies" support, including trailers and promotional credit)
FYI, the current US$5.99 promotion for signing up a device works even if you've already signed up other devices; so you can keep adding promotion credit to your account... even if you end up returning the device
- Netflix
- YouTube
- CinemaNow (which looks to be a similar selection as Blockbuster On-Demand) – Note that the application is included but currently it tells you that it's "coming soon" when you start it up
- Pandora
- Slacker
- Sony Entertainment Network's Video Unlimited (yet another on-demand streaming service)
- Sony Entertainment Network's Music Unlimited
- Flixster
- DLNA sources (e.g., PlayOn and everything it supports, including free Hulu; CAVEAT: I own a Sony SMP-N100, and I haven't had trouble using PlayOn the few times I've tried. When I tested an Sony SMP-N200, PlayOn worked at least for the few minutes I tested (if I recall correctly), but I've heard that people are having issues with PlayOn now.)
- ...plus a lot more that I just don't care much about (e.g., streaming from Berliner Philharmoniker)
And if that's piqued your interest, you should also take a look at the previous model, the Sony SMP-N100. It is nearly identical to the SMP-N100 except that it lacks support for a few providers, of which the only one you should care about is Vudu. It still has Netflix, Hulu Plus, Amazon Instant/Video-on-Demand (no trailers though), DLNA (which means PlayOn too), Crackle, YouTube (but no movie rental support), Pandora, and much more. However, it sells for at least US$20 less (so US$49.99 on Amazon (same price at Best Buy) at the time of this post) because the new version exists.
So if you're looking for a nice streaming player for a good value, I think most people will point you at the Roku. However, the Sony players (both the SMP-N200 and SMP-N100) are cheaper and do more. The interface is not as clean and cozy as Roku though. Moreover, it might be annoying to you that you cannot play Amazon video trailers. However, trailers are available through lots of other services, and there's a lot of value to having them all on one device (as opposed to having, say, Vudu on your Blu-ray player and Amazon VOD on your Roku).
Monday, January 23, 2012
Cloud Storage Referral Links (and tips on getting even more space)
All of these services have good Windows support, decent OS X support, and at least a hint of Linux support. Some of them are easier to activate using Windows than other platforms.
- Dropbox, an old standard in could storage. The referral link gets you 2.25 GB of free storage to start with. Make sure you complete at least five of the steps under the "Getting Started" tab to get another 0.25GB. Also, for a limited time, you can use the "Camera Upload" feature of the Windows beta or the Android beta to get up to 5GB more free space (so 7.5 GB total!). Then you can get 0.25 GB more for every new person you refer to the service.
- SpiderOak will give you 3 GB if you join via that link. However, during your account setup, you can then try the promo code worldbackupday to get an additional 3 GB so that you top off at 6 GB total of free storage for the life of the account. In case you already have a SpiderOak account and didn't know about the promotion code, you can still get the extra 3 GB. Just login to the SpiderOak website, click on the "add new space" (it might say "buy new space"), then click to "Change" your account, and then enter the worldbackupday promotion code. Assuming the promotion code hasn't expired, it all should work.
SpiderOak is very similar to Dropbox and yet also very different. It encrypts your files locally so that SpiderOak employees don't even have access to your data. It also does the encryption in a way that ensures that files duplicated across your machines don't take up duplicate space. Plus, you can create encrypted shares where a subset of people have access to storage but no one else. Finally, SpiderOak allows you to select multiple folders to backup on your system rather than just keeping one "dropbox" in sync. You can use it like dropbox by selecting a single folder to be synchronized across your computers, but you don't have to. - Minus.com will give you something like 10.2 GB for clicking on that referral link. It's a relatively new service, and it has a nice on-line interface with plenty of mobile apps. It's easy to upload large files and distribute download links to people. You can mark entire folders as "Public" or "Private", and you can still share download links to private folders or even individual files inside private folders. Just be careful because the default access level is Public. You can change the default to Private in the settings on the web page.
- Memopal is a little difficult to setup if you use a non-Windows system. In that case, follow the referral link and register your e-mail. Then follow the link corresponding to your operating system and follow the instructions. I think it will say you'll be getting 3 GB for free, but then you'll actually get 3.5 GB because you registered your e-mail as a referral. One plus of Memopal is that you can guy a whopping 200 GB for US$50/year, and that rate gets discounted as much as 60% if you purchase several years at once. Unfortunately, I didn't see an easy way to configure what Memopal backs up. I didn't play with it long, but it may just try and backup every bit of media it can find (and use as much CPU resources as it wants to do so).
- SugarSync gives you around 5 GB at that referral link. For non-Windows users, you should check your e-mail after going to that link and you'll find an e-mail verification link. That e-mail verification link will bring you to the standard login and a Dropbox-like web interface. Moreover, you can find additional software support there. You get extra space for completing tasks like installing the mobile app or going through the mobile app's demo "game" that leads you through sharing files from SugarSync.
- Box.net has no referral links. However, they often offer 50 GB promotions that upgrade your free storage from 5 GB to 50 GB just for logging in in a special way. For example, back in December, I logged into my Box.net account via someone else's iPad and then logged out. That's all it took for me to get 50 GB for the life of the account.
- iDrive will give you 5 GB at that link, but it's easy to add 10 GB more onto that. Just create a fake e-mail account at Aol.com. Then add at least five contacts to the contacts list. Try adding pluses to your own e-mail address username if you want to make sure they're unique. For example, you might use your own e-mail address of joe@schmoe.com as well as joe+two@schmoe.com because most mail servers will omit everything behind the plus sign, and yet it will look like a unique e-mail address. The point is to create what look to be five unique contacts without spamming five unsuspecting individuals. Then log out of Aol.com and go back to iDrive's referral page. It will give you the ability to enter in your Aol.com username and password so it can access your contacts list. For giving it access to your entire contacts list, you get 10 GB of extra storage.
- SkyDrive is Microsoft's cloud storage offering. There are no referral links; everyone gets 25 GB of free space.
- Bitcasa is still in beta, and it won't have referral links because every user gets infinite storage. They use a dubious encryption scheme that prevents duplication across users so they can maximize on storage efficiency in their end while still keeping stuff encrypted.
By the way, if you open up multiple such accounts and want a central place to manage all of your services, check out Otixo which can connect to each of your sharing sites and create shared workspaces bridges across storage boundaries.
Friday, January 13, 2012
Best Idea Ever: "Air Snail" to lock down MacBook Air with Kensington-style lock
UPDATE #2: More competition has come onto the market. Check out the Snake ~ Chicago Snake lock solution. It looks a lot less scary (in terms of potential scratching) than the others, like macBracket. It's $20 and available from Amazon, where several pictures of how it works are shown. You can also find it at its home page.
UPDATE #1: It turns out this is not the only bracket available. As reviewed by MacGirl.net, there used to be a bracket sold on an eBay store that slid up through the MacBook Air. Unfortunately, not only was the locking portion in front of the screen, but it could slide around and scratch the device. Then came the macBracket out of Germany. The macBracket is pretty slick and looks like it is relatively gentle on the MacBook Air. It's a little pricey, but it's not like there's a lot of competition right now.I was surprised to hear that the MacBook Air has no Kensington lock slot. It's too small. Apparently, some of the PC ultrabooks also have this problem. Tablets have this problem, but it's easy to take tablets and phones with you... It's a little harder to carry the MacBook Air everywhere.
So if you need a good solution right now, check out the macBracket. Just make sure to order the correct version for your MacBook Air; they have support for new MacBook Airs (MBA). That new MBA bracket will be shipping soon (at the time of this posting), but it's available for order on their website.
There are a ton of alarm solutions (like what you'd expect to see in a BestBuy) that rely on USB connectivity or adhesion or something similar. Those aren't really ideal. A lock is what is really needed. I've seen two locking solutions available for purchase, and both of them are a bit ugly.
- The first, from MacLocks.com is a protective case which attaches to the bottom of the MacBook Air with screws. The protective case includes a Kensington lock slot, and so your MacBook Air can be locked down so long as the potential thief doesn't carry around the right screw driver (some sort of security star head or something like that). I suppose they could have used those non-removable screws that only support a driver in the clockwise direction (like in many bathroom stalls), but then you'd be out of luck if you ever wanted to get the case off of your MacBook Air.
- The second, from JKLocks.com, has a few variations. I saw version RL108 on YouTube, but there are other versions on the company website. It uses 3M command strips to attach a Kensington lock slot to the back of the laptop. When the lock is connected, it covers the ends of the command strips so they cannot be removed. Of course, if you ever try to remove the command strips, you have to be very careful the metal base of the Kensington lock slot doesn't go scratching across the top of the laptop (!!).
That's genius! It is just an eared sickle that slides through the hole between the screen and the keyboard; the hinges and lock keep it from sliding out! Unfortunately, the inventor cannot find any partners willing to fabricate it in large quantities and market it. Sure, it would need to be built so it could be tough while not scratching the device (and would need to be fabricated for relatively cheap). However, I think those challenges are not insurmountable.
So do you have some dough laying around and want to market a great idea? If so, contact the inventor and start selling these things! Get them out before there are a lot of ultrabooks on the market -- I'm guessing there will be a demand for this little portable toy!
Meanwhile, you could probably fabricate something similar yourself (e.g., with some coated aircraft cable thin enough to slide through the MacBook Air). It might be hard to make it compatible with a Kensington lock without some fabrication, but you could surely make it compatible with a padlock.
Tuesday, November 08, 2011
Building ElectricSheep on Fedora 16 (and enabling in KDE4)
UPDATE: Apparently these steps also work on Fedora 17. Moreover, if you use Gnome3, there are some additional instructions that can help you get ElectricSheep setup.
Quick link: Updated makeSheepFedora16.sh install scriptA while back, I wrote a post summarizing how to get ElectricSheep running on Fedora 15 with KDE 4.6.5. Today, I "upgraded" to Fedora 16 and was surprised to find that library updates were incompatible with ElectricSheep. Symbol mismatches made it impossible to simply symlink old shared libraries to new shared libraries. Moreover, the version of electricsheep that built fine on Fedora 15 would not build on Fedora 16.
So I made some modifications to Tait Clarridge's script to fix the build. My hacks seem to work for me so far; hopefully they do not introduce regressions into the already old version of electricsheep.
So to get ElectricSheep running on your Fedora 16 system, try downloading and running my modified makeSheepFedora16.sh script. As a bonus, it (hopefully) will install ElectricSheep as a screensaver if you are running KDE. However, the same DPMS caveats about mplayer from old post still apply until Fedora updates their mplayer to a recent version (why does it take these people so long?).
Thursday, October 27, 2011
"Your mamma's so dumb she can program in Arduino!"
Dear Members and Readers,[ the article that caused the fuss: http://spectrum.ieee.org/geek-life/hands-on/the-making-of-arduino ]
Please accept our sincere apologies for the headline in today's Tech Alert: "With the Arduino, Now Even Your Mom Can Program." The actual title of the article is "The Making of Arduino."
I'm an IEEE member, and a mom, and the headline was inexcusable, a lazy, sexist cliché that should have never seen the light of day. Today we are instituting an additional headline review process that will apply to all future Tech Alerts so that such insipid and offensive headlines never find their way into your in-box.
Spectrum's insistence on editorial excellence applies to all its products, including e-mail alerts. Thank you for bringing this error to our attention. If you have any additional comments or recommendations, do not hesitate to contact me or other members of the editorial staff.
Sincerely yours,
Susan Hassler
Editor in Chief
IEEE Spectrum
Wednesday, September 28, 2011
Why symbiosis is not a good example of group selection
Part 1: What is group selection?
Typically "group selection" doesn't cross species boundaries. That is, group selection refers to the proliferation of a particular form of a gene, otherwise known as an "allele", due to its benefits to groups of individuals which share that allele despite the individual costs of having that allele. It may help to consider the basic group-selection argument for the evolution of altruism (i.e., the evolution of behaviors that are costly to an individual and yet beneficial to a different unrelated individual). Before that, consider why we wouldn't expect altruistic alleles to have strong representation in a population.
For every gene or group of genes, there can be many different variations (alleles). Some of those variations will be deleterious to an individual, and so you would expect the relative representation of those deleterious variations to decrease over generations. So imagine if one of those alleles encoded an altruistic trait that caused an individual to do something costly for the benefit of another (e.g., helping a stranger understand group selection with no expectation of future payoff). Individuals with that allele are suckers. Those without that allele instead focus on tasks that return direct benefit to themselves, and that direct benefit would payoff with greater productivity of offspring that share that non-altruistic allele. When an altruist met a non-altruist, the benefit from the altruist would increase the non-altruist's alleles representation in the next population while decreasing its own alleles' representations. So we would expect that altruistic alleles would fade away into obscurity. Moreover, the benefit from all of the altruists would diffuse across the variety of alleles rather than being concentrated on just the altruistic ones.
However, what if that altruistic allele also encoded a behavior that would seek out others with that same allele. This non-random association means that each individual who helps another does actually help to increase the productivity in that allele. That is, even though there is a cost to the individual doing the altruistic task, the benefit going to the other individual is felt by the other copy of the same allele in the different (and unrelated) person. So when these altruists group together, altruistic benefits do not diffuse. They are captured within the group. Moreover, the group's synergy can cause it to be more productive than the remaining groups of non-altruists. Consequently, the altruistic allele not only persists in the population, but its representation can grow because there is a differential benefit between altruistic and non-altruistic groups. It is this differential benefit between groups that is group selection.
Part 2: Symbiosis and Mutualism
A symbiotic relationship between members of different species is not group selection (in general) because it does not posit that there is a mutual allele that may be deleterious in an individual but beneficial in a group. That is, there is no group synergy that is mitigating individual costs by generating benefits elsewhere that help to support alleles that would otherwise naturally decay. When species are mixed within a population of interest, the analysis is a bit different because alleles cannot flow across the species barrier (except for special cases).
For example, consider an allele that existed across species (e.g., an allele for a gene shared between humans and bonobos), the speciation in general would prevent the sort of group selection gains because there would be no way for increased numbers of alleles in one species to transfer to the other species. Imagine that altruists in one species seek out altruists in the other species. The result could lead to more increases in the altruist representation in one species than another, and so there would be an altruist surplus. Those surplus altruists would have no choice but to associate with non-altruists in the other species. However, if the group was all of one species, then there would not be surplus altruists. Altruistic benefit need not diffuse across non-altruists too.
However, most examples of symbiosis are not altruistic. Instead, they are mutualistic. That is, the behavior does benefit another, but that is a possibly unavoidable side effect of an action that benefits the individual doing the behavior. For example, if I'm driving through a parking lot looking for an empty space to park, I am revealing information to my competitors (other drivers) about where empty spots are not. I don't want to help the competing drivers, but it is unavoidable because they can see me go down an isle of the parking lot and not find a spot. Consequently, they do not go down that same isle. Of course, I use their searching behavior to inform my choices of the next isle. So we are doing "cooperative search" only because the behaviors have mutual benefits. The same goes for many symbiotic relationships among individuals of different species.
Consider a remora ("sharksucker"). It's a small fish that essentially attaches to another host (fish, whale, turtle, etc.). It can receive nutrients from on or around the host. It can also be protected from predators that avoid the host. In some cases, the host could eat the remora, but the remora is so small that it may not be worth the effort. Some hosts actually receive a small benefit (cleaning, for example) from the remora. Regardless, the remora experiences very little cost and plenty of benefit. Moreover, the host experiences very little cost and possibly some benefit. So there's no surprise that this behavior evolved. You don't need any fancy mathematical model to show how this is possible – when the benefits align like this, it's natural to assume that it is going to be favored by natural selection.
Part 2.5: Symbiosis and Co-evolution
Having said all of that, symbiosis can lead to elegant examples (or at least suggestions) of co-evolution, which describes how a change in one species can lead to a change in other species. In particular, natural selection on different species creates a feedback across species. One species is the ecological background for another species, and so as each species changes it creates new niches (and destroys old ones) for other species. So the evolution of one species can guide the evolution in another. But I think this post is long enough. :)
More information
Wikipedia does a pretty good job on these particular subjects. Check 'em out there.
( I have also mirrored this content on a post on my website. )
Tuesday, September 20, 2011
Duplex Printing from the Command Line to an HP LaserJet Printer
Unfortunately, doing duplex printing (i.e., two-sided printing) to an HP LaserJet printer from the command line is not trivial. So, using the GSview documentation as a guide, I put together a small bash script (available for download as hplj_duplex_print) that does the trick.
#!/bin/bash
declare -a input_file
if test $# -eq 0; then
input_file=("-")
else
input_file=("$@")
fi
( echo -e "\e%-12345X@PJL JOB"
echo "@PJL ENTER LANGUAGE = POSTSCRIPT"
echo "<< /Duplex true /Tumble false >> setpagedevice"
gs -sDEVICE=psmono -sPAPERSIZE=letter -q -sOutputFile=- \
-dNOPAUSE -dBATCH "${input_file[@]}"
echo -e "\e%-12345X@PJL EOJ"
echo -e "\e%12345X"
) | lp -d your_HP_printer_spool_nameYou should replace the your_HP_printer_spool_name with your printer's spool name. You might want to tweak some of the options (details below), but the general structure will remain the same. The opening and closing escape sequences communicate to the HP LaserJet printer that a PostScript file is coming. Then the setpagedevice PostScript directive instructs the printer to use its duplex module.Regarding tweaking:
- Again, make sure to change your_HP_printer_spool_name to your spool name. You may also want to change lp to lpr, but you will likely have to change -d to -P then.
- You may want to change the gs (GhostScript) options to suit your purposes. For example, you can change the psmono device to one of the other GhostScript devices like psgray or psrgb.
- The Tumble switch determines whether to do short-edge (true) or long-edge (false) duplex printing, and so this script defaults to the latter case. If you prefer vertical flipping, change the /Tumble false to /Tumble true. You might also make this a configurable command-line switch on the script.
Thursday, September 01, 2011
"Dark Matter is an Illusion" summary in National Geographic News gets something a little wrong
"Dark Matter Is an Illusion, New Antigravity Theory Says"I thought I'd post a link to the primary source here. I also wanted to point out that the explanation Ker Than gave got something really important wrong and consequently diminished the elegance of the proposed theory.
by Ker Than
Here's the primary source:
"Is dark matter an illusion created by the gravitational polarization of the quantum vacuum?"Ker Than, the National Geographic News reporter, got it a little mixed up in this part of the NatGeo article:
by Dragan Slavkov Hajdukovic
Astrophysics and Space Science 334(2):215--218
DOI: 10.1007/s10509-011-0744-4
All of these electric dipoles are randomly oriented—like countless compass needles pointing every which way. But if the dipoles form in the presence of an existing electric field, they immediately align along the same direction as the field.This electric analogy states that electric dipoles align and strengthen electric fields, but that's incorrect. Electric dipoles weaken surrounding electric fields. In particular, the positive end of the dipole goes toward the "negative end" of the field and the negative end of the dipole goes toward the "positive end" of the field. So the two fields subtract from each other, not reinforce. This is summarized in the primary source (that I'll quote below).
According to quantum field theory, this sudden snapping to order of electric dipoles, called polarization, generates a secondary electric field that combines with and strengthens the first field.
[ note that magnetic dipoles align and reinforce surrounding magnetic fields because there are no magnetic monopoles. That is, magnetic field lines are continuous; they don't terminate. Consequently, magnetic dipoles are torqued to align their fields. Electric dipoles are driven by the motion of their monopolar ends ]
What Ker Than missed was that in this model of "gravitational charge", it is the case that opposites repel and likes attract. That's why you (matter) are attracted to earth (also matter). However, anti-matter and matter would repel each other. Moreover, if you had a matter–antimatter virtual pair (as quantum field theory says you do in a vacuum of space), that dipole would align because its "positive" end would be pulled toward the positive end of the gravitational field (and vice versa for its negative end). This alignment would strengthen the resulting field.
Here's the relevant snippet from the bottom of the first column of page 2 of the article:
In order to grasp the key difference between the polarization by an electric field and the eventual polarization by a gravitational field, let's remember that, as a consequence of polarization, the strength of an electric field is reduced in a dielectric. For instance, when a slab of dielectric is inserted into a parallel plate capacitor, the electric field between plates is reduced. The reduction is due to the fact that the electric charges of opposite sign attract each other. If, instead of attraction, there was repulsion between charges of opposite sign, the electric field inside a dielectric would be augmented. But, according to our hypothesis, there is such repulsion between gravitational charges of different sign.
Why GMail's show-if-unread is NOW useless with nested labels
- nested labels: You could create a nested label (like a subfolder) by adding slashes in folder names. You would create two folders called "Parent/ChildA" and "Parent/ChildB", and they would be displayed as "ChildA" and "ChildB" underneath a single "Parent" that you could collapse and expand.
- show-if-unread: Only labels that had unread messages in them would show up in the left bar. To see all of your labels, you could use the "more" link which would show you a full list.
However, eventually both labs features became integrated into production GMail, and they messed it all up. Now, ostensibly to avoid revealing the slash form and to avoid having parent labels repeated in both the unread and read lists, they've made it impossible to apply show-if-unread to nested labels. Consequently, if any nested labels have unread messages in it, the parent and all of its nested labels show up in the unread list. So you get things like this (click for larger):Obviously, that defeats the whole purpose of show-if-unread. I'm forced to look at all of those read nested labels just because some of their "sublings" are unread.
So Google has gone from taking two nice features and combining them into one terrible and useless and awful thing.











