Monday, August 29, 2011

3mindme is shutting down! Old owner recommends NudgeMail

Today I received the quoted e-mail below from David Barrett (@quinthar). His work as CEO of Expensify and some complications with maintaining the longevity of 3mindme have made him decide to shut down the 3mindme service effective immediately. He recommends the very similar but commercially operated service NudgeMail as a substitute. You can find other substitution options at an old post of mine discussing these services.
Hi! I'm David, the guy who made 3mindme. I'm very sad to inform you that I'm shutting down the service permanently, starting immediately. I strongly encourage you to check out a similar service at http://nudgemail.com -- it's essentially the same thing as 3mindme, but better.

Q: What will happen to the emails I've scheduled for the future?
A: After I send this email to all users, I'm going to send all future-dated emails immediately. My goal has always been to return every email at precisely the right time. Unfortunately, I'll need to make due with simply returning them at all.

Q: Can I do anything to convince you to keep 3mindme alive?
A: Probably not. It's been a fun service to operate these many years, but as CEO of Expensify (https://expensify.com - Expense reports that don't suck!) I just don't have the time to devote to 3mindme.

Q: Why now, after years of continuous operation?
A: Spam. I recently learned that many users (myself included) were having their emails silently dropped, meaning they got no error response, but the message was never scheduled for future delivery. Solving this problem is very difficult and time consuming, and I'd rather shut down 3mindme than leave it in a non-functioning state.

I think that's all. If you have any questions, feel free to respond to this email and I'll do what I can to help. Otherwise, give NudgeMail a shot, and keep Expensify in mind for your next expense report!

-david
Follow me at http://twitter.com/quinthar
So that is very sad. 3mindme was a nice server-side mail-me-back reminder service that didn't have the ugly commercial taste of pretty much every other alternative.

So bye-bye 3mindme; we'll miss you.

Thursday, August 25, 2011

Using \gobblepars to prevent LaTeX from adding empty lines at gaps

While searching for something else, I came upon a StackOverflow question from a while ago that asked how to prevent LaTeX from adding a \par at particular blank lines in the source code. The asker didn't want to remove blank spaces everywhere; he just wanted to get rid of the paragraphs at certain spots.

Of course, you can use comments to do this:
\somemacro{}
%
Some text
However, a lot of people don't like the look of that. Some of the responders on StackOverflow gave some alternatives that seemed ugly and half baked. So I came up with \gobblepars, which is a macro you can add to the end of your own macro definitions to cause them to eat up all trailing pars, or you can use explicitly. For example:
\somemacro{}\gobblepars

Some text
would do the same as the commented stuff above. Moreover, if you had control over \somemacro, you could build \gobblepars into it (in fact, even if you didn't have control, you could use \let and \def to augment an existing macro with a trailing \gobblepars, but that's a different topic).

Here's the simple definition of \globblepars (you put this in the preamble of your LaTeX document):
\makeatletter
\newcommand\gobblepars{%
    \@ifnextchar\par%
        {\expandafter\gobblepars\@gobble}%
        {}}
\makeatother
So that's pretty simple. It checks for a \par (which includes a blank line in the source) trailing it. If it finds one, it gobbles it up (i.e., gets rid of it) and then calls itself again. This process will continue until it finds something other than a \par. Hence, it "gobbles" strings of "pars".

Tuesday, August 23, 2011

Update to my LaTeX CV templates: Space allowed after sections now!

In preparation for setting up MultiMarkDown (MMD) to write my CV for me, I've been thinking about ways to refactor my old résumé/CV LaTeX templates to make them look a little cleaner. A fix I came up with tonight should help with that, and I think it will also make the templates easier for others to work with even if they're not doing anything with MMD.

In particular, the \section macro used to be renewed as a \marginpar with some other ugly stuff. Putting the sections in the margins caused problems because people like to put spaces after the sections, which generates a \par that means the section content will not be aligned with the section heading in the margin note. So the old way I got around that problem was to force people not to use spaces between \section and the section content. If they needed visual space in their source code, they could use comments to do that.

Well, I've swapped out that ugly definition for a slightly less ugly one that uses \llap (with a \smashed \parbox) and some creative gobbling. In particular,
% The section headings
%
% Usage: \section{section name}
\renewcommand{\section}[1]{\pagebreak[3]%
    \hyphenpenalty=10000%
    \vspace{1.3\baselineskip}%
    \phantomsection\addcontentsline{toc}{section}{#1}%
    \noindent\llap{\scshape\smash{%
        \parbox[t]{\marginparwidth}{\raggedright #1}}}%
    \vspace{-\baselineskip}\par}
The \vspace and \par combination should ensure that an additional \par isn't added by LaTeX. So before you were restricted to things like...
\section{Stuff} \begin{bibsection} %...
and
\section{Stuff}
%
Junk
But now you don't have to be so careful about the whitespace. You are allowed:
\section{Stuff}

\begin{bibsection} %...
and
\section{Stuff}

Junk
So that's cool. Much more readable.

You can get my most recent LaTeX CV templates at their page on my website. You can find a detailed history of the source code changes within my Mercurial repositories of documents.

(updated: new \gobblepars allows for arbitrary amount of space after each \section)
(updated: replaced \gobblepars with \par hack that still allows for arbitrary amount of space after each \section but also prevents lists from adding a \par when placed directly after a \section; consequently, adjusted all of the lone-lists to get rid of their leading negative vertical space (probably can get rid of them now, actually). I'm trying to shift toward using conventional lists (or perhaps conventional modifications of them from paralist or enumitem))

The maximum number of matrix dimensions in MATLAB

[ Background: I was asked what the maximum number of matrix dimensions was in MATLAB today. I responded as follows. ]

You are only limited by the amount of memory available and the maximum number of ELEMENTS (as opposed to dimensions) in a matrix. The actual number of dimensions is just a detail about how the memory is indexed. You can reshape any existing matrix to any number of dimensions (I'll give details below). You can only create a new matrix if it abides by the memory and element limits that vary by computer.

To find out the maximum number of elements for a matrix on your computer, use the MATLAB command "computer" (do "help computer" for details). For example:
[~,maxsize,~]=computer
tells me that I can have 2.8147e+14 elements in matrices on my computer. So I better be sure that:
(number of rows)
   × (number of columns)
   × (number of cubes)
   × (number of 4-th dimensional thinggies)
   × (...)
is less than that number.

To find out about memory limits on your system see, the command "memory" ("help memory" or "doc memory"). Unfortunately, memory may not be available on your system. Alternatively, you can see:

http://www.mathworks.com/support/tech-notes/1100/1110.html

for information about memory limits in MATLAB. For information about the maximum number of elements (and the command "computer" that I discussed above), see (UPDATE: MATLAB has moved this page, and this link doesn't land in the right spot anymore):

http://www.mathworks.com/support/tech-notes/1200/1207.html#15

Regarding dimensions, you can use the command "reshape" to re-index any existing matrix. For example, if I start with the column vector:
A=ones(100,1)
I can turn it into a row vector:
newA = reshape(A, 1, 100)
or a matrix of any number of dimensions so long as the number of elements is still 100.
newA = reshape( A, 2, 2, 25 )
newA = reshape( A, 1, 1, 1, 1, 1, 1, 1, 1, 1, 100, 1 )
newA = reshape( A, 1, 1, 1, 2, 1, 50, 1, 1, 1, 1, 1, 1, 1, 1 )
% etc.
Now, I'm assuming you're using regular MATLAB matrices. Alternatively, you can use sparse matrices so long as you limit yourself to functions that work with sparse matrices:
help sparfun
A sparse matrix stores an index with every element. That lets it "skip over" the 0 elements of the matrix. Consequently, you can store VERY large matrices with an abstract number of elements far larger than anything you can work with in MATLAB... however, most of those abstract elements will be 0.

Spotify, Google Music Beta, and Amazon Cloud Player? My choice is probably Google Music Beta

Between Spotify, Google Music Beta, and Amazon Cloud Drive/Player, I have had the most fun with Google Music Beta.

So Spotify is weird and uncomfortable. It’s cool that I can get easy access to lots of music that I don’t actually own, and it’s easy to make playlists. However, it is ugly to be able to both shuffle your whole library and put songs in multiple playlists without risking over-representing them in your shuffle. Over-representation is generally a major problem if you create artist playlists because one artist might have a whole bunch more songs in the Spotify database than others. It would be nice to “shuffle artists” where you’re guaranteed a balanced selection of artists (e.g., in every set of 30 songs)… What’s worse on Spotify is that playlists are static. You might be able to create an artist playlist, but you have to watch out for new songs to add to that playlist. Be careful though – songs get duplicated in a playlist if you drag them over. Having said all of that, I certainly have had fun discovering new music with Spotify. The interface is ugly though, and it sucks to have to pay $10/month just to have Linux access (yes, I know I can use Spotify through wine for free now (and $5/month later when the free accounts become limited), but I hate dealing with the headache of local MP3’s and the wine codec). Moreover, if I want Android access, I’m stuck with $10/month too. Boo.

Google Music Beta had an easy upload process. It took a while, but not that long. It was strange that it bogged down my entire Internet connection (while Amazon’s uploader didn’t affect my downstream at all), which makes me wonder what else Google is doing. However, I could select all of my songs on my Linux machine (no fancy Windows uploader needed) and they all got uploaded. Unfortunately, I cannot download them (unless I make them available offline on my phone and then figure out where and how Google stores them, which may not be tractable). Also, I cannot figure out how to buy new music (certainly a feature for the future, right?). However, Google randomly adds free music to my library, and that’s cool. What’s coolest is the Instant Playlist feature (which is similar to features in iTunes and other players/services) that builds a good-sized playlist from a single song. I’ve enjoyed its picks – even when the song I seeded lists with came from a local artist that it couldn’t have known much of anything about. Best of all, Google Music Beta gives me all of this for free (up to 20,000 songs) on all of my systems (including Android). I never need to worry about keeping a Windows machine.

Amazon’s Cloud Drive/Player is cool that it gives you 5GB for free and then $1/year/GB up to 1TB after that (starting at $20/year for 20GB). For the moment, if you pay for any storage, you get music storage for free. Any Amazon MP3 purchases can be placed directly in your library. Any song in your library can be downloaded. So Amazon’s Cloud Drive is a nice archival and music management solution. Almost all of the cool features of the player work on all systems. The only downside is that the MP3 Uploader (which re-organizes your music into Artist/Album/Song and will allow you to select a batch of thousands of songs to upload at once) is only available in Windows (and Mac?). On a Linux machine, you can use the web uploader from Amazon’s Cloud Drive, but you can only upload contents of one folder at a time (with no subfolders) and you have to organize everything manually. No one has figured out how to automate this through a script as far as I can tell. The Windows uploader does a pretty good job sitting in the background, and it’s safe to interrupt it in the middle of an upload (however, it may take a while building your upload list when you re-start it). The Amazon Cloud Player is fine. You can build playlists of your music, which is fine. You can shuffle. You can’t discover new music, but you can easily grow your library at 50 to 99 cents a song.


[ Oh, and all three will scrobble to Last.FM. It’s supported natively in Spotify (with no support for “Love”), and it’s supported with 3rd-party Greasemonkey scripts (for Firefox and Chrome (and Safari?)) for Google Music and Amazon MP3 Player. ]

Monday, August 22, 2011

Converting an EMF (MetaFile) on Linux using unoconv

When I needed to convert a graphic from an EMF (Windows Enhanced MetaFile) on my Linux machine today, all of my Google searchers were turning up with conversion utilities for Windows or wine at best.

Fortunately, it appears as though unoconv converts from EMF and is available in the standard Fedora repositories. I issued:
unoconv MYMETAFILE.emf
and it spit out a MYMETAFILE.pdf, and I was happy.

Wednesday, August 17, 2011

An hour with MIUI Android on my OG DROID

Last night, I installed the MIUI Android build from on my OG DROID. This is my first experience with MIUI, and it was mixed. I think the build was great (major h/t to Trey Motes), and I think the MIUI devs have done a terrific job showing me that my phone can look drastically different than I'm used to. I've posted links to MIUI Android (where
you can download a ROM for your phone) as well as MIUI.us (where you can also download a ROM for your phone) as well as MIUI (where you can read about the official project and their own MIUI phone that recently hit the news).

Things I liked:
  • Clean theme made GMail look so much nicer
  • Notifications pull-down included toggles for everything I'd want to toggle (WiFi/Bluetooth/etc.)
  • Lots of customizability (starting from lock-screen backgrounds and going all the way down to lots of other stuff that you usually only see in 3rd-party launchers and such)
  • Trey Motes has bundled lots of useful apps with his distro (ROM Manager, WiFi Tether, etc.) out of the "box"
Things I didn't like:
  • The iOS-style launcher – All of your apps are on the pages of the launcher. You can then create folders to group them together. There's no "app drawer" that shows you all of your apps so that you can only put a select few on your desktop screens. Some people might like this (iOS users sure do), but I've gotten used to Android-y things like using *FolderOrganizer* to tag apps (possibly with multiple tags), and so it's a major departure to go to an iOS-like organization style.
  • The iOS-style dialer and contacts list – I'm not sure what's smart about the "smart dialer" (but I didn't play too much, and it was too late to call anyone). The contacts list (and other lists on the system) displays the iOS-like letters down the right where you can click on the tiny letter you want. Android's typical way of doing this is displaying a pull-tab on the right that you can drag (opposite semantics as flicking; so more like a Desktop scroll). I like the way Android does it better than iOS.
  • Android Wizard doesn't run and Market didn't sync apps – The wizard that usually runs the first time you boot most ROMs didn't run, and so I had to add my accounts via the settings menu. What was probably worse was that the Market didn't automatically start downloadiing my apps, which is something I've come to appreciate (I know there are 3rd-party ways of backing up and restoring apps, but I don't use them if I don't have to).
  • The Music app didn't integrate with Google Music – The music app follows a bit of the style of the iTunes app in iOS, but it looks markedly different. In fact, it looks different than the stock Android music app too. So it has lots of features, but it's not like anything you're going to expect. It also didn't sync with Google Music, which really sucks after spending so much time uploading songs to the service.
  • General lack of integration with Google services – The MIUI tries not to be so Google-dependent... Some may find that a strength, and some may find that a weakness.
So I really don't have any complaints about the build or the dev's, but I'm just not sure I'm the intended demographic for the new look and feature set. I really think it's cool, but I just don't think it's something I want to use day to day. So I'm looking forward to whatever else Peter Alfonso tells me I need (he's like my new Steve Jobs).

I hear that next week Trey Motes will release a MIUIAndroid release for the OG DROID using a version of Peter Alfonso's kernel that is newer than anything you can get pre-built from him on his distro sites (I wonder if it's a 0.4 kernel? If so, I wonder if it has the same bugs that has been concerned about). So I imagine that performance of MIUIAndroid will be much nicer. It was fine when I tried it, but I didn't install many apps.

So give it a shot. When I tried it, I downloaded the ROM from MIUIAndroid.com (ROM Manger's version was a 1.7.x version; I used the 1.8.12 version from MIUIAndroid.com; note that it has a 1.8.12.1 HOTFIX (you'll see it in the forums that it links you too)) and used ROM Manager to backup my existing setup and install MIUIAndroid (you could try MIUI.us, but I got the feeling that Trey Motes does a fantastic job customizing MIUIAndroid for OG DROID, just like Peter Alfonso does with Android/AOSP). When I decided I didn't like it, I used ROM Manager (which comes bundled with MIUIAndroid) to restore my old setup. That was my hour-ish with MIUI.

Links:

Monday, July 18, 2011

How we fixed our Ikea wardrobe after the bar fell

Our apartment has no bedroom closet space. There are two coat closets and a linen closet all clustered in the same wall between the living room and office and near the bathroom, but there is no storage in the bedroom. So a while back, we bought three large Ikea wardrobes that fit nicely next to each other down one of the walls of our bedroom. This particular wardrobe model was one of Ikea's budget options (i.e., it was not one of their crazy customizable types; it basically came as a complete unit). The closet bar (shown here without the shelf that is usually above it) should attach to the closet using a plastic insert like this (click on the image for a larger and clearer version):
As you may be able to see, there is a large vertical scrape a few inches beneath the plastic insert. That scrape came into our lives when the plastic insert on the left side of the bar failed ("wardrobe malfunction"), which sent the awkward-shaped metal closet bar (and the clothes hanging on it) into the floor of the wardrobe. As you can see, there is a cantilever-type support jutting out from the plastic insert that sheared off (pretty clean cut, actually):
Ikea often keeps spare parts like this on hand that you can grab for free in bins from the store, but we didn't want to drive all the way to West Chester to look for them, and we were pretty sure these wardrobes were discontinued and these (likely specialized) parts were not available. So we went to Meijer instead (it was too late to go to a hardware store to find real closet accessories) to look for a way to hack together a good pre-fabricated furniture fix.

Just before we were about to give up, we found these corner braces that looked like the perfect size and shape for our problem. They were about $2.50 for a pack of 2 (in case any of the other supports ever break later).
So here's how we used a corner brace to support the closet bar:
As a bonus, the screws that came with the corner brace were short enough to not protrude out the side of the wardrobe. They were self-tapping screws, but I didn't trust them in the Ikea-style formica-covered particle board, and so I pre-drilled some small holes first, and that worked pretty well. We used a zip tie to fix the bar vertically; however, we also experimented with binder rings that we had stowed away in our office supplies. The binder rings actually provided a much tighter fit so that the bar didn't wiggle at all; however, as strange as it sounds, the zip ties were a little more discrete as they hugged the corner brace snugly.

[ I should note that I took off the shelf to get easier access to the closet. That meant pulling out the three small brads/nails attaching the masonite-ish backing. Because the area moment of inertia of that backing is very high, I think it provides significant support to the closet structure as a whole. So afterward, I pulled the closet out and put the nails back in a different spot. I probably could have left the shelf in through the whole fix. ]

I almost like the look of our fix better than the Ikea insert (which looks like it has a tenuous hold on the bar anyway).

[ You can also find this post at Jessie and Ted's blog. ]

Friday, July 08, 2011

Well, I have a Google+ account now...

UPDATE: Yes, it does appear like I have invitations to give out. Yes, if you e-mail me, I'll do my best to send you one.
You can my Google+ profile at:

http://profiles.google.com/ted.pavlic

Overall, initial reactions are good. There are some bugs to fix and some things to clean up, but I think I'd "+1" it.

Thursday, July 07, 2011

Someone asked me about Hilbert transforming minimum-phase magnitude responses today...

Someone sent me this e-mail today:
Thank you for contributing to the Wikipedia article about minimum phase. I gather from the article that I should be able to use the Hilbert transform to compute a phase response from the amplitude response of a minimum phase system. Yet when I compute (in Matlab) the Hilbert transform of the log of the amplitude response of a Butterworth filter (sampled at uniform frequency intervals), the result is not real and does not resemble the phase response of a Butterworth at all. I expected that it would equal the phase response of a Butterworth since a Butterworth is minimum phase. What have I missed? Thank you.
So I responded in an e-mail, and I've pasted that e-mail here.
Assuming that you are using a high-order filter, are you unwrapping your phase? See the MATLAB function "unwrap" for details. Another easy fix is to ensure you're using the NATURAL log to extract the exponent of the magnitude as an exponential. In MATLAB, "log" is natural log and "log10" is common log.

If you still have the problem, make sure your filter is truly minimum
phase. In particular, the transfer function and its inverse must be
stable and CAUSAL. The causality condition is redundant so long as your
notion of stability includes poles induced from unmatched zeros. For
example, the discrete-time filter:
z + 0.5
is not causal and thus has a pole at infinity. So it does not meet the criteria for being minimum phase. On the other hand, the filter:
(z+0.5)/z
is minimum phase. So let's take its impulse response. In MATLAB, you could try:
h = impulse(tf( [1,0.5], [1,0], 0.1));
or...
z = tf('z');
h=impulse( (z+0.5)/z );
or just read it from the numerator and add as many zeros as you'd like...
h=[1,0.5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
Then use the FFT:
H=fft(h);
Then use the discrete-time Hilbert transform of the NATURAL log:
X=hilbert(log(abs(H)));
Then, to compare, use "plot":
plot( 1:length(h), -imag(X)*180/pi, 'o', ...
      1:length(h), angle(H)*180/pi, 'x' )
I think you'll find that each x is circled.

To summarize:
h=[1,0.5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
H=fft(h);
X=hilbert(log(abs(H)));
plot( 1:length(h), -imag(X)*180/pi, 'o', ...
      1:length(h), angle(H)*180/pi, 'x' )
Here's another interesting case that won't match as well because of the discrete-time approximation.
z = tf('z',1);
H = (z + 0.5)/(z);
[mag,phase,w]=bode(H);
mag=mag(:); phase=phase(:); w=w(:);
X=hilbert(log(mag));
plot(w/pi,-imag(X)*180/pi,w/pi,phase)
As you can see, these two match pretty well in the interior region. You can make some interesting observations about the edges where they don't match well.