I'm changing how I deal with spam

SpamMy email address, pupeno@pupeno.com, existed since around 1998 and was never obfuscated or protected in any way. Spam wasn’t such a huge problem in those days. Today my Spam folder has 3200 mails.

My spam filter is quite good, but I still like going through my spam in case some non-spam message was thrown in there. I’ve tried cleaning it weekly, daily, whenever I have free time and even inbox zero. It’s a hassle and I’m tired of it.

My new way to deal with spam is ignoring it. Since my spam is deleted automatically whenever it is more than 30 days old, filling up my inbox won’t be my problem; and whenever I someone tells me “I’ve sent you an email, haven’t you receive it?” I’ll be able to search for it and find it if it was on the spam folder unless it’s more than 30 days old. The cases I won’t be able to spot are mails that just went there. Life is tough.

Advertisements

Some comments on This Week in Android #1

I’m catching up with my podcasts and right now listening (and watching) to This Week in Android #1. I have some comments to add.

First of all, I think it’s great they are making a show about it. I’ve been extremely excited about Android since day 1 (when I couldn’t tell anyone because it was confidential information at Google) and I’m getting more excited all the time. I honestly believe the Nexus One is the best phone ever made. The show still has some rough edges, but that’s a huge compliment for episode #1 and looking forward to #2.

So, my comments…

Android was not a response to iPhone. Android was released latter but it was being developed before iPhone was publicly known, probably even before it was even a rumor. If you look at the early Android emulators, you can see it was targeted as a Blackberry competitor and I actually believe Android was delayed because they’ve had to get rid of the keyboard to compete with iPhone.

Android is not good old Java. It’s for sure not J2ME, it’s something totally different. The virtual machine doesn’t follow Sun’s specification so you need a separate VM, compiler and so on (provided in the SDK, of course). The language, in a sense, it’s not really Java. It’s so identical than developers won’t notice the difference.

Android is more open than they’ve mentioned on the show. In the show the mention the usual complaints about the draconian attitude for approving iPhone Apps while the Android Market is much more free and open. But then, pushing the argument forward, the Android Market doesn’t allow adult content. What they’ve failed to mention is that in Android you are not stuck with the Android Market (like you are with the App Store in an iPhone).

In Android you can install web apps directly from the web, without any kind of market. And some of those apps are actually markets themselves. There are alternative markets including some that will allow adult content. Another reason for these markets to exists is that they offered paid apps in countries before the Android Market did or you can envision they offering a bigger share to the developers or other benefits.

Google decided not to serve the porn industry with their Android Market but at no time they are forbidding you from getting adult content in your small wonderful portable tablet.

At some point in that episode they’ve show a graph where iPhone had only 1% of the market. Well, iPhone really doesn’t have the bast majority of the market. It’s really a small player in amount of phones. It’s the biggest player in apps and money moved in those apps and totally dominates some communities; but not the whole market.

Android is going to be the dominant player because it’s going to be in all those other phones. Android will be huge without ever causing one lose sales for the iPhone. It’s a huge market with space for both players. What Android is really grabbing is the market of Symbian and other operating systems like that.

My last comment for the show: stop talking about the iPhone. I think it would be good to have one person be the outside voice, defending iPhone, and I think Lon is that voice. He plays the part well. The rest should never mention iPhone and should never do a pros and cons with Android in a balanced way. It’s not interesting, it doesn’t make a show and I’m not watching This Week in Android to know what are the advantages of iPhone. Just say and keep repeating how Android is crushing it, get me excited about it.

A message to kids: what is your passion?

This message actually applies to everybody but I think it’s obvious how it applies to adults. What most kids don’t realize is that it applies to them too.

If I ask you “What is your passion?” and you don’t give me a straight, simple and quick answer, you are in trouble.

My passion is programming. When I start programming the world around me fades away; I forget about time, I forget about people, I forget about sleeping. I don’t even feel sleepy. If I spend two days without programming I start to feel uneasy. Five days and I’m going crazy; I start writing algorithms in napkins. I think that’s how a passion feels like.

I believe it doesn’t matter what your passion is as long as you have one. I’m fortunate that my passion is an extremely profitable one. Work and play are the same for me. Even if you think your passion is not on that category, you may be able to force it into it. And enjoying one’s job is the best thing that could happen to anyone.

I think most adults recognize this. I would hope so. Most kids don’t even know what I’m talking about. They don’t know the feeling or that the feeling even exists. I was, again, very fortunate of finding my passion when I was 7 years old.

It’s very important to find your passion as soon as possible, so you can align your life to it. I loved to program and now I work as a programmer. I didn’t wait until the second year of Computer Science to find out. It would have been way too late then.

If you think your passion might be programming? Pick a book, start writing code. You think it’s helping animals? What animals have you helped so far? Go out, find an animal, and help it; go to a shelter and feed an injured dog at least. You think it’s money? You better had a spreadsheet with your income and expenses, even if your income is your weekly allowance.

Let’s see a couple of activities which seem hard to turn into a passion for a kid.

Medicine? Go and do a course in first aid, it doesn’t matter how old you are, they’ll probably let you do it. Read about about anatomy or any other aspect of medicine. You can start at the Wikipedia and read for as long as you want. If you get bored in 10 minutes, that’s probably not your passion. Get a microscope and play with it. There are experiments to extract DNA from some plants, do them. There are experiments to figure out the type of blood of a person, do them.

Watch Dr House, ER (does it still exist?), Grey’s Anatomy and whenever there’s an illness in them do your own research. Start a blog and for every episode explain how wrong they are. Watch documentaries about real emergencies, even about forensics and corroborate what they say, blog about it.

Talk to a medic, ask them how it is like to be a medic. Ask them what was the most interesting case they’ve had. Probably they’ll have some reserve in talking about them, but if you are interested, they’ll find something to tell you. People love talking about themselves.

And then find out the thousand experiments to do and things to learn about medicine that I don’t know about because it’s not my passion. I already gave you a lot of ideas for not knowing anything about the field, if it’s your passion you’ll have many more.

Law? Watch all the law-related TV shows, there are a lot. Are they right or wrong? Same as for medicine, go and do your own research, blog about it. If you are old enough, try to get a job as a clerk, or errand-boy in a law firm. You’ll learn how that world works.  Get yourself real cases to read an analyze. Are public trials conducted where you live? Can you get into one? Do it. Can you go to congress sessions? Do it.

Help someone with a contract. Contracts move around all the time. Work contracts, leasing contracts. Most people, me included, glance over them and sign them. Help someone understand a contract, by understanding it yourself first. I don’t have the time or the money to get a lawyer to review everything I sign, but if you were my neighbor and want to help me for free, sure! Go ahead! Do know about any potential liability problem, though.

Find a lawyer and ask them about their job. Ask them about cases. And then learn about the thousands of things you can do in relation to law without being a lawyer that I don’t know about because it’s not my passion.

You don’t have to wait until your are 17 or 18 to start doing all that. You can start today no matter what your age is.

Leave a comment: What is your passion and what are you doing about it?

Distributed revision control was a breakthru

I strongly believe in revision control. Back in the days when there wasn’t any other choice that CVS I spent countless hours setting up CVS servers and re-freshing my mind on its obscure commands and arguments, which were almost all of them. If you drop my copy of Professional Linux Programming it’ll open on the CVS chapter by itself (much like my copy of The C Programming Language will open itself on the pointers chapter, somewhere on the pointers to pointers section).

Then came Subversion and it was somewhat better. After that we got the explosion of revision control systems with the introduction of distributed ones. We’ve got Darcs, Git, Mercurial, Arch, Bazaar, etc. My choice right now is Git. It used to be Darcs, but unfortunately it stagnated for a long time and I moved on to the next new thing. I’ve used Mercurial as well. From my perspective Mercurial and Git are almost equivalent.

For me distributed revision control was a breakthru. There’s one small feature that makes a huge difference for me. In the old days I used to set up CVS or Subversion servers/repositories (in those, a repository is essentially a server-side thing). I had to decide where that repository was going to reside, how it was going to be named, how it was going to be accessed (ssh, http, custom protocol?), by whom, etc.

Today with Git I just do this

git init

That’s it. I’m done. The directory where I am is now a repository. I can start committing, branching, rolling back, looking at the history, generating patches, stashing, etc. It’s that simple. The fact that it’s so simple goes from a quantitative advantage to a qualitative advantage. What I mean is that I not only revision-control things faster but that I revision-control things I wouldn’t have otherwise. For example the configuration directories on my servers.

I know many people will complain: “But with no centralized repository chaos will ensue”. The fact that it’s distributed doesn’t mean there can’t be a central repository. When I want to collaborate with someone using Git I create one repo somewhere, in my servers or GitHub and we both push and pull from there. The difference is that I commit a lot locally, and when the chances are ready I push them. That means that I can commit broken code, without worrying.

At work we don’t use a distributed revision control system, we use a centralized one and we have a very string peer reviewing policy. My current tasks involve touching code in many different files in many different systems never getting familiar to any of them. That means that it’s common for my peer reviews to say things like “all this methods don’t belong here, these two should go there, that one should be broken into three different ones going here, there and somewhere else”.

Now I have a problem. I can’t commit because my peers don’t consider my code ready. My code works but it has to be refactored in a very destructive way. What happens if during the refactoring it stops working. For example copying and pasting I loose a piece of code. I can’t roll back to my working state and start over. If we were using a distributed revision control system I could.

So, being able to commit non-finished code locally while colaborating with other people is one of my other crucial features in DVCS.

The third one is being able to branch locally. In a similar vein as the last example. When I find myself thinking about a very destructive refactoring that I’m not sure if it’s going to get me anywhere and worst than that is going to take me three days to do; I just create a local branch. I experiment in that branch. If at any time I get tired or I need to do anything else I go back to the main one. That is what branching is about.

Why is locally branching better than globally or centralized branching? Well, one reason is that a local branch doesn’t have to make sense to anyone else. I don’t have to pick a name that’s descriptive for anyone else than me. I don’t have to justify myself for creating a branch with anyone else. Let’s suppose I had an argument with a co-worker where I believe something is doable and (s)he believes is not. Do I want him/her to see that I created a branch to prove him/her wrong? I don’t. And if I prove myself wrong I want to quietly delete that branch and never ever talk about it.

But I am starting to go into the very hypothetical realm. In short, for me, DVCS is about this:

git init

and get to code.

Erlang gen_server template

I like Erlang and I like gen_servers, I end up coding a lot of stuff as gen_servers and I like behaviors in generally. I even wrote some myself. I haven’t used Erlang for a while. I’ve been playing with it in the last couple of days, hopefully I’ll announce something soon.

I ended up creating my own gen_servers template to get started. It’s a very verbose one and I’m putting it here more for me to know where it is that anything else; but, maybe it’s of use for someone else:

-module(module).
-compile(export_all).

-behaviour(gen_server).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).

%% Public API

start() ->
  gen_server:start({local, ?MODULE}, ?MODULE, [], []).

stop(Module) ->
  gen_server:call(Module, stop).

stop() ->
  stop(?MODULE).

state(Module) ->
  gen_server:call(Module, state).

state() ->
  state(?MODULE).

%% Server implementation, a.k.a.: callbacks

init([]) ->
  say("init", []),
  {ok, []}.


handle_call(stop, _From, State) ->
  say("stopping by ~p, state was ~p.", [_From, State]),
  {stop, normal, stopped, State};

handle_call(state, _From, State) ->
  say("~p is asking for the state.", [_From]),
  {reply, State, State};

handle_call(_Request, _From, State) ->
  say("call ~p, ~p, ~p.", [_Request, _From, State]),
  {reply, ok, State}.


handle_cast(_Msg, State) ->
  say("cast ~p, ~p.", [_Msg, State]),
  {noreply, State}.


handle_info(_Info, State) ->
  say("info ~p, ~p.", [_Info, State]),
  {noreply, State}.


terminate(_Reason, _State) ->
  say("terminate ~p, ~p", [_Reason, _State]),
  ok.


code_change(_OldVsn, State, _Extra) ->
  say("code_change ~p, ~p, ~p", [_OldVsn, State, _Extra]),
  {ok, State}.

%% Some helper methods.

say(Format) ->
  say(Format, []).
say(Format, Data) ->
  io:format("~p:~p: ~s~n", [?MODULE, self(), io_lib:format(Format, Data)]).

Update 2010-01-04: I keep changing the actual contents of the template as I’m coding a little Erlang app. I’ve recently added, among other things, a call to get the state of the process, useful for debugging.