Wifi in Latin America/Asia: developer solutions

When I was small, a hotel must have a swimming pool. Now, it must have free wifi.

While working from Latin America or Asia you notice that there are just a few things that can really annoy you or bum you out. The main thing, for me as a data dev at least, is the lack of reliable wifi, which seems to be vital at times. There are a few good apps out there that might help you that help circumvent most problems while traveling and working. These tips have certainly made my life here a whole lot easier.

Sitesucker
I came to latin america to give myself time to study some other technologies. Rails was a major goal of mine. The wifi was down a lot so I could not rely too much on youtube videos or websites that offer training (like tutsplus). A simple way around this is to just go and download an entire website containing the ruby docs and tutorials. Sitesucker is an app that makes this extremely easy, check out the app here. I actually found it more efficient at times to learn this way than learn it with the help of the internet. You effectively remove all the distractions that the internet offers you this way.

Think about it, if you prepare well you can download a few good tutorials that you want to play with and still learn most of the things that you want to know. I learned all about mongodb through this method as well as a little d3 and jquery.


dash
Sitesucker is great for downloading tutorials and docs but not immediately awesome at organizing docs. This is where dash shines. Dash is a documentation browser and snippet manager in one. It downloads the docs and all snippets that belong to it to of a popular framework such that you wont have to rely on stackoverflow as much anymore. Most popular languages/API’s are in there (unity, iOS, python, rails) although a few specific libraries are missing (pandas, d3, leaflet).

Snippets
The reason why you love the internet as a dev is because you love going to stackoverflow to search and ask questions. I’ve often caught myself looking up questions that I have already found the answer to in the past (the google search results show that I have already pressed the link before). Instead of making a habit of looking everything up all the time it would be best if you remembered and learned. This process is made a lot easier with a good snippet manager and the snippets themselves would still be a great reference point when the wifi is down. I’ve also enjoyed working a lot with apps like espresso to help me with the autocompletion for css and javascript.

I currently prefer to use a combination of codebox and sublime text but there are many tools available. Don’t let anybody tell you what to use, just work with what you feel most comfortable with.

Local Servers
You don’t need to sync everything up to the cloud all the time. A rails app, a mongodb server and a lot of other things can just be done locally if you prepare properly. If you are working on the interactive part of a website, just go and download all the needed css and javascript beforehand and you are still good to go. You can also download data that you use from an API and store that locally if you want to just focus on a certain part of an app.

(Sidenote: the above does not always hold, but 90% of the time you can plan around the need of wifi for the libraries. Leaflet and googlemaps will still need to communicate with a server through an API if you want them. Most other applications will work just fine as long as you download them beforehand: jquery, d3, bootstrap).

Developer in South America

People tend to romanticize traveling and working and although it is an amazing experience there are a few things that you should keep in mind. It is not for everybody and I get the idea that people only see the plus sides of doing it. Traveling is awesome with good parts and bad parts. Although it is easy to focus only on the good stuff when you are preparing your trip there is a small list of things to be aware of.

  • Initially I was thinking that I would be ‘earning euros and spending pesos’. Basically, this would allow me to love like a king by only working for a few days a week. For most countries this is true, generally in latin america you will have the upper hand economically. The downside however is that this does involve ‘working european hours in a latin american country’ as well. Sure the exchange rate and purchasing power can be preferable but you DO need to get the work done that your western employer expects. This can be a bit of a challenge at times. The lifestyle of latin america is generally less focussed around being productive, largely due to the sheer amount chaos but mostly because they are just not used to it. If you are in the same climate, you will be tempted to act alike.
  • Be honest. Why do you want to travel? To sit at a desk but in a different country? Of course not. You want to tango and party in Buenos Aires? You want to hike in patagonia? You want to climb machu pichu and visit the amazons. Go for it! Be mindful though that all these activities take time which is not spent on work. And recovering from these activities also do not allow you to get much work done. Be honest of how much time you must work and how much time you can party.
  • The economies can collapse. One of the reasons that pesos are generally cheap is because they hold little value to foreign investors. Buenos Aires at the time of writing (March 2013) has been having 20% inflation for the last 3 years. This also puts pressure on the euro’s that you earn and the value that you can spend.
  • You will be alone in what you do. I am from Amsterdam where we have a lot of meetup communities (like appsterdam) that allow you to get in contact with people from the tech industry. Don’t expect a massive community of developers in latin america. You might be tempted to hear that a lot of big companies are active here (Google has lots of offices in latin america) but most of these companies will only have sales offices here. Expect the research and development type of jobs to be someplace else. The start up scene is not that great here. Chile in my opinion is a small exception, something seems to be starting there. But other places did not really show a proper entrepreneurial atmosphere.
  • You will most likely experience the ‘NOTHING WORKS ARGH!’ moment. Welcome to a non western country. Governments, institutions, roads, mentalities and things just work completely different here, which has surprising consequences. Small example: an ipad is about $100 more expensive in Argentina than in any other place in the world because of the import taxes. These import taxes are meant to boost the production of Argentine goods by blocking the goods from other countries. Unfortunately this means that a lot of goods that are affordable are usually terrible. I got a bike and within a week it broke twice (the pedal fell off and it turned out that there was a staple in the inside of the tire). Some goods just need to be imported and these trade laws sometimes make it hard to get anything of quality here.
  • Trafic is different here. It is very normal to be late to a meeting (or a party) because you get stuck in two demonstrations while in a taxi. The busses usually don’t even come with a time schedule because even the bus drivers think they are inaccurate.
  • You will need to be mindful of your things. A stolen laptop is worth a fortune in this place. One laptop easily means one or maybe even two months of not having to work for the person who stole it. You will always need to be a little bit on your guard at hostels, cafes and public transport because of this.
  • Besides the obvious time difference which is a bother for communication it also seems that the clock works different here. When somebody says they will meet you at ten then they will be there around 12ish. Everything is immensely tardy here. When taking spanish classes it took me about two hours to find out what ‘tarde’ means but only after 6 weeks did I learn what ‘temprano’ meant. If you want to really enjoy the nightlife you also need to keep in mind that it completely changes your flow during the next day. Clubbing starts at 3 am and ends around 7. The next day you are worthless.
  • The deadliest ‘ARGH! NOTHING WORKS!!!’ moment as a developer is with wifi. It varies per region but it can happend that the connection fails you right in the middle of a skype call or a backup. Especially when you want to go to the more rural places or countries like bolivia you should not expect the wifi to be sufficient.
    Also hostels that offer wifi often have problems when more than two people are using it at the same time. Especially if there is somebody using skype, the rest of the hostel might be without internet for a while. You will find out how much you rely on stackoverflow during your travels here, although it is manageable. If I had to give a title to a movie about my profesional life right now it would be ‘Vincent and the search of wifi’.

Don’t expect comfort when traveling much, expect an adventure. The things listed above do make life a little more rough but also a lot more worthwhile. Your life will become a lot more like a movie and you should prepare for the chaos a little.

One thing I sometimes really miss is the structure of a western European country. There is no ‘off’ button for the chaos in the larger southern american cities.

If you are on a serious project for a client please be aware of all of these things. The lifestyle is intensely rewarding, albeit very tricky.

d3 + tangleJS in wordpress

If you want to insert a script into your wordpress document you are going to have a bad time. A better tactic is to use an iframe. All you need is a link to the html where the interactive document you want to show is located. The code to make this is very simple:


<iframe width='410' height='200' frameborder='0' align="aligncenter" src='http://bl.ocks.org/d/4742316>
</iframe>

In fact. That little line of code links to a gist that produces the following:

By using the iframe you open up a window to another website (the one supplied in the ‘src’). I can do the exact same thing with a d3 file as well:

Note that I am using gist and blo.cks.org to accomplish this. Basically we imitate what blo.cks.org does with the only difference that we posted it unto a wordpress site. Theoretically the iframe could point to any website and you could embed any type of javascript into wordpress this way (think canvas for example).

WoW economy

“As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality.”
―Albert Einstein

“The mistake is thinking that there can be an antidote to the uncertainty.”
― David Levithan, The Lover’s Dictionary

The field of economy often fails me. The reason is that usually one needs too many assumptions in order to make sense of it. Economics, to me, is a social science, not an exact science. One studies the behavior of how people choose to trade in goods and services. Behavior, to me, should be studied as a qualitative science, not a quantitative science. I understand that a scientist would want to model things, but one should not resort to assumptions if they are not valid.

Depending on the model the economics approach requires other assumptions, but I’ll list a few assumptions that are often seen:

  • perfect information: whenever you make a choice you are well informed about the possibilities
  • complete information: whenever you make a transaction you and the other party have the same information
  • profit maximization: you have a preference to things in this world and you are always trying to get the best out of it
  • rational choice: nobody will ever make an irrational choice considering the other assumptions

One needs these assumptions for a quantitative economic model to work. The problem now is that we can never test out the models. We input data about our world, make assumptions and then test if it applies to our world.

In our real world these assumptions hardly ever apply. Wouldn’t it be nice if there was an experimental setup where these assumptions do apply? That way we could test if the model, in terms of thought experiment, would hold. If the model does not hold even in the experimental setup then we can affectively prove that certain economic models are just invalid.

So what would we demand of an experimental setup?

We will need a separate environment filled with people that are actively trading with one and another. For our assumptions to hold valid we need a place where we can say that everybody is playing the same ‘game’. People may cooperate or obstruct one another and they should only do this if it is beneficial to them. The rules of the game must be very clear and people need to be able to predict their actions with known consequences. This game, preferably, is played by millions of people all around the world such that we can eliminate any population bias. Also, all behavior should be perfectly measurable.

Ladies and gentlemen, we have just defined world of warcraft. And luckily for us, it has an auction house system which contains plenty of data where we can let all sorts of economic models loose.

There is a perfectly measurable economy.

Think about the assumptions again:

  • perfect information: When you check wowhead, wowpedia or wowwiki it seems legit. There is very minimalistic effort needed to get any information about the game. It’s certainly easier to get every single detail of information in world of warcraft than in our real world.
  • complete information: Valid, it is to the point where you would have information overload ingame.
  • profit maximization: That’s what the whole l00t hunting is about.
  • rational choice: Seems valid, the game punishes you for dying and it allows you to quantify value of actions much more.

I suppose one can be critical and state that these assumptions still don’t perfectly apply. I would agree. But the sake of the argument is that the assumptions fit world of warcraft better than to the real world.

If the assumptions listed are argued to apply to the real world then they should outmost definitely apply to world of warcraft. That means that if the model does not work in world of warcraft that it outmost certainly does not have a place in our world (the real one).

It should be said that I’m not a world of warcraft player but purely from a scientific viewpoint I don’t get the lack of economic research that is being done. On websites like wowhead and theunderminejournal you can actually see that an expansion pack causes an inflation to the online economy.

Mageweave cloth prices on theunderminejournal. Can you see when the expansion pack came out?

I would love to see a research project on this. If time permits I will post about this and do a little research as well.

D3 Risk Visualisation

You can look at the game of risk in two ways. A normal person would look at a game of risk like below:

Source: wikipedia.

But as a computer scientist, it will quickly look something more like this:

Network made in cytoscape of the RISK game. For the theoretical computer scientists: you should quickly see that this graph contains a hamiltonian path.

The risk game board is just like a graph:

  • A node represents a territory.
  • An edge represents if you can attack one territory from another territory.

And you can visualize this in many ways. If you rearrange the nodes in a circular layout or a force directed layout the graph will look different, but it will still be the same graph.

I’m experimenting more and more with D3, so I thought it might be nice to share the small network visualisation here.

The code for the above visualisation can be found here.