Skip to main content

Posts

Showing posts from 2013

Installing R language on Mac with Homebrew

First you need to install homebrew a command line package manager.
Then you install gfortran if you don’t have fortran on your computer (this is a dependency of R).
brew install gfortran

brew install gcc

Then to install R you need to tap the homebrew/science repository with this:

brew tap homebrew/science

Then you can install R with:

brew install R

This R will work with R-studio btw.

Note:
Homebrew seems to have removed gfortran from it's list as it's now provided by gcc.
GNU Fortran is now provided as part of GCC, and can be installed with:  brew install gcc

The idiocy of fools

Why Apple made a mistake releasing two phones. Well let’s see… Apple releases two new phones and I’m pissed that I didn’t order the Nexus 4 yesterday and now it’s out of stock. I feel like a dumb ass. I wanted that phone. I’m rather tired of the iPhone. Why? well it’s slow as molasses these days. Every progressive iOS update seems to leave the phone slower and slower and the apps buggier and buggier. And Android has caught up with the iOS features and now it seems de-coupled from Android updates.
You see the bane of Android is fragmentation of the platform. Huge amount of screen sizes, processor, etc. But the Nexus devices and the maturity of the Android market has made that less of an issue. This was Apple’s greatest strength: a unified platform. Because on hardware (features), they were already the same.
Apple’s last true innovation in the iPhone line was the retina screen. That’s the iPhone 4 (the one I have btw) and it was fantastic. We are three models in after that. Thre…

Tim Ferriss Birthday Celebration.

I went to school with Tim Ferriss, but I only met him my last semester. Which sucked because we had tons in common. If you've been under a rock and don't know who Tim is he's a potato-headed guy with a few best-sellers under his belt but much more importantly he's a teacher. Well teacher doesn't describe him and I don't want to call him a master (which he is) but let's say one of the things we both had and have in common is a love of Bruce Lee's philosophy of life. For Bruce, all knowledge was self-knowledge because real knowledge reveals yourself and really life then becomes an honest expression of yourself. So he's a master in that sense.

Today is his birthday. He has invited us to do something extraordinary by joining him in providing potable waters to communities without any. Check him out at his site:
http://my.charitywater.org/timferriss

And here is my quote on education he required then got blocked from posting on his site so here:

To me educa…

Commuting in Los Angeles vs. Commuting in San Juan

LA is a driving city. It's huge, it's got lots of cars massive avenues and many places aren't even reachable via the metro at all. Cities within cities like Beverly Hills strictly opposed the metro from going through it and the design of the metro doesn't make it any faster than driving. So many times when you're going too far for a bike driving is the only option. I spent a lot of time in the car in LA. A LOT. But it is completely different from Puerto Rico. In both places I like to minimize commuting but in LA it was for a completely different reason.

The prime disadvantage of commuting in LA is time. It takes a lot of time to commute because you have to cover great distances. I became an NPR nut in LA, driving and listening to the radio, or putting in a book on CD from the library was also cool. But in Puerto Rico this options aren't really viable.

The prime disadvantage of commuting in PR is you are risking your life and your car every-time you commute. A r…

Testing with Cucumber, Sinatra and Capybara

Everything you need to know There are many elements you need to simultaneously learn to do effective testing of your code. Because some of these elements are very simple a lot of explanations just jump over what you need to know and give them up as obvious. Let’s start with a list of the things you need to learn:
Gherkin (the language of Cucumber) ——> super easyCapybara (the DSL that controls the browser tests) Rspec (the DSL in which the actual pass/fail tests are written.) None of these are hard. But having to learn all at the same time can seem daunting. But it’s not! It’s easy peasy but takes time. :-/

It took me three days to get a handle on this. And I hope by reading this you’ll get a handle on it much much quicker.

Let’s start with Cucumber first.

Cucumber Five things you need to know about Cucumber:
Cucumber tests are located on a features folder that have plain text files with a .feature extension and written in Gherkin. The .feature files contain tests that have a (1.)Feat…

"That's just the way things are." and other cultural traps.

My college buddy just cancelled hanging out with me because it was going to be after 8pm and he didn't want to go out that late because he was worried about crime. He didn't excuse himself for feeling this way, or explain why being worried about crime would be an issue, he just texted me:
Ok. Puerto Rico. Crime. A reality. I'd rather reschedule. Sorry to be an old man 8(And we're the same age! (By the way, as a close friend I understand what he means. He's got a young daughter and would rather stay at home with her than leave her alone.)

I've been encountering this over and over. "That's just the way things are here." Or the much worse: "It's like that everywhere." (The Japanese got "shikata ga nai", "it's no use.")

I'm still not sure why people don't see the huge trap going around like that is. Let me make a parallel.

This morning I was watching a TED video from Lisa Bu, who talks about her parents du…

Ruby Idioms part 1

Ruby is like a language in that it has phrases that are used, and ones that work better than others. The most common rubyism is a ||= b where a is set to b if it is not nil, false or undefined. It basically means if a has a value move on but if it doesn't set it to b. Simple enough.

But an even more powerful one but less well known is the index feature one. Arrays, hashes and even more importantly strings have this function too.

In hashes it's the normal way to get a value by sending it its key. So:
hashy = {:key1 =>  :value1, :key2 => {:subkey1 => :subvalue1}}
doing
hashy[:key1]
will spit out
:value1 
But it's really useful for strings too.

stringy = "Friends, Romans, countrymen, lend me your ears;"
stringy['lend me your ears'] #=> "lend me your ears"

You can also chain this calls which leads to some weird things.

stringy['lend me your ears'].upcase['EARS']   #=>  "EARS"

I just used a bit of this actual code o…

When I was Puerto Rican

"El fanguito," or the little mud pile is, or was an 'arrabal' a place like the favelas in Brazil. An unstructured extremely poor housing. This one, the mud pile apparently stank quite a lot. I was very young when it was razed down and it's inhabitants moved to public housing. But still if the wind hits you just right you can smell the mangrove smell of decay.

Today, I smell that smell so strongly. I'd been saying how one of the advantages of a crisis like the one Puerto Rico is facing is that you can't deny it. You can't hide from the reality of it. Yet apparently you can. At least on my family denial is alive and well. Suddenly, having to defend one's position that staying in "el fanguito" is maybe not such a good idea, you can't stop smelling the scent of decay.

Like a wizard, one creates the future out of the imagination, whole cloth. Then draws the present there. Otherwise one plods along the available roads and if they all suck …

Fad-Friendly Culture and Group Think

How do you know what restaurant is good? As I was walking through the food kiosks at Luquillo, a beach town in Puerto Rico. I realized that you look for the crowded one, because if the locals frequent it, then it most be at least decent, right? At least that's how the thinking goes. While food-poisoning looks imminent in that lonely restaurant with nobody in it. This is a type of group think. You crowd-source your restaurant decision because you don't have time to check each restaurant for cleanliness and audit their food, you go where others have gone to eat and trust in the wisdom of the crowds.

Now sometimes you go off exploring too, and go check out that restaurant you haven't tried or that new place that opened. But when you're in a hurry, in an unfamiliar place, need to eat quick the lonely food kiosk just feels sketchy even if it's totally fine and the crowded one is just good.

Why is this important? It isn't but it's a cool way of thinking about a t…

On the Island I was born...

For the past two months I've been in Puerto Rico, the island I was born in. I frankly feel conflicted about Puerto Rico. In a weird way every time I've come back since I left for college, it's felt like a different country, and I've suffered reverse-culture shock every time. Even now.

Now however I'm seeing a Puerto Rico that is in a worrisome state. NPR has been doing a 4 part series that's worth checking out here called "Disenchanted island." Puerto Rico is called "la isla del encanto" or the "island of enchantment" so the title is a play on words. It's worth a listen.

Like children you don't see grow up because you see them everyday, the people that live in Puerto Rico become essentially blind to the changes that happen in the island. While I who feel at times like a strange uncle that comes to visits sees them starkly. So much so that I get a push back. It's very strange to see consistent responses from people to th…