2015-12-27

Boycotting Facebook users

(Please see http://saynotofreebasics.fsmi.in/ for background on this internet land grab by Facebook and their partners.  For a more enjoyable way to learn about this, hit https://www.youtube.com/watch?v=AAQWsTFF0BM)

----

I have always been a bit of a crackpot in terms of rants and protests and taking a binary approach to things that upset me.

Age is supposed to mellow people.  Apparently I am not old enough.  Worse, I am getting younger (i.e., less mellow!)

I am stepping up my personal campaign against facebook in the following manner: until this "Free Basics" nonsense is completely gutted by TRAI (or if it is not gutted, then *forever*), I will not accept any personal (see footnote 1) communication other than via plain phone and SMS from anyone who is in the IT industry and also uses Facebook.
(For people who are not in the IT industry, I will only boycott those who are very active on FB.  Yes, that's subjective; can't help it.  As for how would I know if they are active, since I don't have a facebook account?  I plan to just ask them and take their response at face value.)

(One big question mark is whatsapp -- far too many people are on whatsapp for my liking.  But since I don't have it, these people are already constrained to communicating with me normally anyway...  so maybe I will simply treat this as a separate thing and not bring it into this equation.  For now anyway.)
----
Footnotes:

1.  "Personal" mean this will not affect anything that could be called a "professional" or "business" communication, or something where money is involved, etc.  It also means gitolite support will NOT be affected; I consider that a professional thing too.  So why am I posting it here?  Just to have a URL to point people to... I'm not even posting it on my g+ because very few of my g+ contacts are "personal".

2.  If you want to comment on this post, note that the "oppose Facebook" idea itself is not up for discussion; there are many other places you can do that, with many people who know much more than I do and are working a lot harder to beat this nonsense.  If you want to comment on my specific form of protest, feel free to do so, as long as you understand that I am unlikely to go back on this stance, and may not respond immediately.  Or at all.

2015-08-15

Elixir: Agent Fibonacci!

I got interested in Elixir when I had to help someone troubleshoot something called Hyperledger, and it seemed neat.  I've always wanted to try Erlang but had heard the statement "Erlang makes hard things easy, and easy things hard" so I had backed off.  (I assume it was the syntax...?)

Elixir seemed the best of both worlds so... let's take a look.

I'm now skimming through Dave Thomas's "Programming Elixir", and I found a pretty confusing example of using an Agent to maintain state (that's what Agent's do in Elixir) to compute a fibonacci number.  And it was, as I said, confusing.  Subjectively, this looks a *lot* cleaner to me:


# Fibonacci with an Agent

defmodule AgentFib do
  def sl do
    Agent.start_link(fn -> HashDict.new end, name: __MODULE__)
  end

  def get(0), do: 0
  def get(1), do: 1
  def get(n) do
    f = Agent.get(__MODULE__, &(HashDict.get(&1, n)))
    if f do
      f
    else
      f2 = get(n-2)
      f1 = get(n-1)

      Agent.update(__MODULE__, &(HashDict.put(&1, n, f1+f2)))
      f1+f2
    end
  end
end

AgentFib.sl
n = String.to_integer(hd(System.argv))
AgentFib.get(n) |> IO.inspect