Trailing Whitespaces Vim

Trailing whitespaces are a pain in the ass. Adding, deleting and modifying code can lead to invisible spaces at the end of the line. This is “bad” and useless.

Here comes Vim!
:%s/\s\+$//

A substitution command :%s/<search>/<substitute>/
Where the search is for trailing whitespaces \s\+$ and the substitute is “nothing”.

Writing this every time is too much effort, it’s a good idea to define a user command:
:command Deltw :%s/\s\+$//

Or better, add the line to your vimrc file:
command Deltw :%s/\s\+$//

now just typing the command Deltw deletes those annoyances.


References

Vim patterns ⇒GO
Vim user_commands manual ⇒GO

Leave a comment

Filed under tips, vim

CODE. The Hidden Language of Computer Hardware and Software

Electricity is like nothing else in this universe, and we must confront it on it’s own terms

Charles Petzold does an amazing job in this book. It explains how current computers work without a previous knowledge required. While there was no new information for me at all, I really enjoyed the way it presents the concepts, easy and with a lot of clarifying pictures. Is one of those books that you can say “I wish I read this book while I was studying the topic”.

Some argue that it has no relevance at all because it is old (1999). I would respond that while the computer world seems to advance very fast, the bases are almost the same, (1945 First Draft of a Report on the EDVAC), but with a lot of refinement (smaller, faster, smarter).

This book is a must-have if you want to learn how a computer works and you don’t feel like reading very technical stuff.

1 Comment

Filed under books

Emerillon: Geocoding Names

Current search bar on emerillon is limited:

Current Emerillon Search with GeoNames


I want emerillon to find also streets!

Emerillon search with GeoNames and OSM

And in this post I explain how I’ve done it

All the text (Beware! lot of code)

2 Comments

Filed under code, emerillon, gis, Maps, webservices

α – Shape generation with R

α-shape, is a family of piecewise linear simple curves in the Euclidean plane associated with the shape of a finite set of points.
— Wikipedia

Boum!. Let’s make it simpler. α-shape is a generalization of the convex hull concept. And the convex hull of a set of points is the minimal convex set containing all the points. Is typical to depict as some pins covered by a rubber band.

convex hull

Representation of convex hull idea


α-shape me!

1 Comment

Filed under code, tips, tools

Legend of GrimRock

I’m a big fan of Dungeon crawl. Is one of the only games that is always there.

Such was my joy when some months ago I read about Legend of Grimrock. I preordered the game on GOG (I prefer GOG in front of Steam) and it’s here! [Well, the post is not in time with GOG release, I’m a slow writer]

Let’s do a fast comparison:

Crawl Orcs and Ogres

Crawl Ogres (the capital O)

Legend of Grimrock Ogre

Legend of Grimrock Ogre

That’s an Ogre!

Crawl will never disappear (Big game with lots of options, randomness and suprises) but Grimlock has a good appeal. It looks good, sounds good and plays good. It Presents an old-school gaming style revamped in a really beautiful case.

High Five for Almost Human!


Doing a review is far from my objective, I just want to share how awesome this game is. More skilled reviewers alredy wrote about Grimrock:

IGN REVIEW: ⇒GO
Gamespy:⇒GO
EDGE review: ⇒GO
GameBanshee: ⇒GO

Leave a comment

Filed under Games

Shackleton – Imperial Trans-Antarctic Expedition Map

Recently I’ve been reading Endurance: Shackleton’s Incredible Voyage. On the whole book they describe its current position, movement, etc.. but it’s difficult for me to understand certain positions on the poles. Also, the history is so astonishing that it deserved a cool map.

There are some maps of the Imperial Trans-Antartcic Expedition: http://www.kodak.com, http://www.wgbh.org, coolAntarctica, and a long etcetera. But I wanted to play a little bit.

Results

Online Map:
Nice view of Shackleton Imperial Trans-Antartcic expedition. Information of each point and also photos.

Interactive Shackleton Map at MapBox

That’s interesting, show me how

6 Comments

Filed under Maps