Kartones Blog

Be the change you wanna see in this world

Book Review: The LEGO Mindstorms EV3 Discovery Book

As lately I'm quite busy between my pretty dog, working, reading articles (of too varied topics to write about them I think) and trying to rest, I've just written another book review I had pending since a while. It's another book about LEGO Mindstorms EV3 (of which I have sadly my Node.js library quite adbandoned).


The LEGO Mindstorms EV3 Discovery Book book cover

Title: The LEGO Mindstorms EV3 Discovery Book

Author: Laurens Valk

As the book reads, it is a beginner's guide. But we're talking of a 400 pages, full-color title, in which you'll learn indeed the vital sensors and block-based programming (aproximately the first 100 pages) but also some mechanical basics about beams, axles, gears... Which help a lot when you want to try yourself building something (instead of just following construction instructions).

Each type of block is detailed really good, usually with more than one sample program fragment and lots of pictures. You're also given many "design discovery" texts, which are optional steps you might take that come without instructions, just as hints or ideas of further playing.

As an example of the degree of detail, the chapter about gears teaches not only essentials but gear ratios, torques, frictions, worm gears, gear trains, bevel gears... including the underlaying mathematics behind it.

Also, the models that you get to build are really cool and far from simple: a Formula 1 car, an ant, a sketch drawing machine, a robotic arm that grabs objects and a walking and talking humanoid. All imaginative and varied and some really ingenious.

I'm really happy with the book. It looks very professional, explains many things and not only in detail but in depth. Definetly recommended.

Fight about the ethics, not about the tools

I've come to "hate" most development languages, sames as I don't really "love" any operating system, but it seems in our current society people must always take sides. You cannot just have a set of tools and choose whatever is best for the job: "Using still SQL? Dude, NoSQL is the future!", "Server-side code, are you from the past? Javascript-all-the-things!", "Scripted languages? Nothing like going down the metal with C++!". No matter what you choose, there will always be an opinion against it. No matter the choice, it will always look wrong to somebody somewhere.

There will always be fanatic tech wars, but there is something that I don't see many fights about: Fights about if something is ethical to do.

Let me start with a story I directly lived. At one of my previous jobs, one of the things from the company that hooked to join them me was that they had moral values: they donated a yearly % of total earnings to NGOs. Once in, we had the opportunity to work in a project related to image recognition that was related to the Spanish Department of Defense. Instead of saying "yes, show me the money" it was voted internally and rejected for being related to military. We declined a project for being unethical and related with weapons and wars.

I've sometimes had to do things I was not happy with, be it directly building projects I didn't believed in or participating in others I wasn't happy or proud to be a part of due to some of its uses. I had once an internal fight and educated but firm boycott, I've always tried to express concerns and I openly say things I don't like. But I'll definetly avoid to work doing things that do harm instead of good. There's the saying "never say never", but I'd have to be really really desperate to work with the military. At my current job, anybody can install the opensource version and we cannot easily control that, but at least there's people building great things with the product, and that makes me happy enough despite possible "wrong uses".

I'd rather sleep well and feel I'm at least not doing any harm to the world rather than earn more money. If to be successful is to suffer the loss of ethics and moral, I'd rather be a mediocre player in the game.

Sadly, years later the same company "was able" to employ a few consultants on the very same Spanish Department of Defense. Money changes people and ideals, but fortunately I had already left.

Freakend 2015 and my Gameboy Powerpoint-like ROM

Freakend 2015 Logo

I just came back from the awesome Freakend weekend event on its 2015 edition (4th one if I'm correct). From friday night to sunday afternoon we had a lot of talks (and discussions) either directly of videogames, or related to them. This year we were 48 people and the bar has raised so much I've felt like an infiltrate among so much enthusiasts and professionals, all doing or having done great projects. People from the major (and quite a few minor/indie) spanish videogame companies like MercurySteam, Digital Legends or Tequilla Works, people working at Remedy, "web" games companies like PlaySpace... but it was enlightening because I saw people falling into one of two categories:

  • Professionals with lots of experience developing and/or producing videogames, serving as examples of when you achieve success
  • Indies, people building games on their spare time while working doing non-game oriented daily work, and other scenarios of pure passion.

In fact, having lunch on saturday and when I said I don't do videogames either on my spare time, I was asked a plain "and why not?". And it its true. It is as simple as that: grab some spare time and instead of playing another dumb AAA title or watching a silly movie, build small games, toy with game related stuff. Nothing except myself forbids me from doing that... so the one thing I've learned this freakend is to try to find time to actually do more what I like, not just read about it.

That said, after last year's project/presentation, and based on my null actual 3D game development skills, I decided to go for something real, something related with retro game dev or around it. Combined with my love for the Gameboy, it had to be something related with the beloved handheld from 1989. The initial topic was more regarding AI and using an emulator to try to make the computer beat Super Mario Land level 1 automatically, but as I digged into the source code of some emulators, I saw that I had to learn how the GB hardware works. And to my surprise, any CS student can really understand many things, as the hardware is a Z80 like 8bit CPU that was coded in Assembly. After some nights reading I decided I instead wanted to do either a game or something similar directly like people did in the early nineties.

And this is how the GBSlides idea was born... As I predicted I was going to have not enough time to build a full game (work, personal life, my young dog...) so I narrowed the scope to instead build a "Gameboy Powerpoint" and present the talk using a GB emulator.

I am just going to show very briefly three screenshots of the process and the results, as the talk and the source code are both available, along with a nice "development kit" (at http://kartones.net/Downloads/gbdevpack.zip) that contains all you need to create tiles, backgrounds, compile code, see samples and read the best documentation I found out there. Because sadly the original Gameboy scene is dying and many links are already broken, resources missing and wasn't easy to find and gather all pieces, so if at least I can help with that I'm happy enough.

This were my first experiments building tiles with GBTD and then loading and displaying them (kind of a hello world):

GBSlides screenshot 1

Once tile loading and map loading were done, I moved to building a system (a Ruby script) to read and convert from plain-text files into ASM's tile data (raw byte "arrays") inside include files to load into the ROM. It's complex because as the screen is 20x18 you have really few characters to explain things (I had to do my best to summarize). Example source and GB-displayed slide:

GBSlides screenshot 2

And once data loading was ready, I had the hardest fight, trying to read joypad input. It seems the hardware has an optimization of not checking input state if there isn't any sprite DMA operation (aka "if you're not drawing/managing sprites") because I got crazy trying to make it work and then found a sample that said "just do the sprite DMA and input read works" and it did, so the slide viewer was ready.

GBSlides screenshot 3

If you head to the code you can see the content was pretty basic (but not a bad overview considering what I've seen out there), and I haven't even used sprites on the talk, but time is limited and the MVP was showing slides and input handling. I also got quite nervous because after two days of amazing talks I felt I was cheating for giving such a entry level talk, but as I mentioned before I hope that at least the talk, sources and dev kit serves for someone who wants to start coding something with the Gameboy as a good and complete SDK.

I also have plans to keep learning more about this wonderful console and try to actually do some small games, because I've really enjoyed going so down into the metal and into such a restricted hardware. It's been also a nice exercise to switch to Assembler and I think is healty to use something so different instead of Ruby, C#, Javascript or SQL.

Book Review: Teach yourself visually Search Engine Optimization

My experiences and point of view about SEO are that most of the stuff "experts" do are tricks that today might position your website better, but tomorrow might even penalize you. But lately I'm trying to get a better picture of things before taking sides (even if I've seen really bad and stupid techniques in action). Reading this book was an attempt to improve that picture... and I'll try with another book because this experience was not great, probably because the books is aiming at a very very basic entry level. At least I can now confirm that nobody should ever buy a book that says "teach yourself visually" ;)


Teach yourself visually Search Engine Optimization book cover

Title: Teach yourself visually Search Engine Optimization

Author: Rafiq Elmansy

The "visually" keyword in the name was strange, but I picked up this book anyway. The trick is that you include hundreds of pictures and then don't need to dig deep, so you still get a "big" book covering "lots" of topics but at a level that anyone with some web development and hosting experience will skip every single screenshot of the book. I've been always skeptical about SEO techniques, because the "white hat SEO" are good practices and browser-friendly meta tags and structures you can add to ease indexing, but then quite often you cross the line to the dirty land of keywords juggling and search engine trickings. This said, the book is halfway between both, as mentions choosing the right keywords, linkbuilding and link partners, paid guest posts... but also gives good (although generic) advices for good HTML markup and attributes, meta tags, sitemaps robots.txt...

Other topics that are touched briefly (in separate chapters, but as I say no chapter gets really in depth) are Google Analytics, Webmaster Tools from Google and Bing, "Social Media" SEO, AdWords, and as widely used as it is, we have one chapter about Wordpress plugins, some not directly related to SEO (although useful for every WP site, I guess there weren't enough about the topic so the author filled with caching ones). Last two chapters are how to monetize your site (because SEO is not about doing things right but getting rich, right? ;) and hiring SEO experts. There are some fun jokes inside, like mentioning "Excel CSVs", or having steps for logging in into Wordpress and other stupid content that if removed the book would be smaller but easier to read (instead of skipping more content than actually reading).

The problem that I see with this book is that if you already have experience building websites, you will probably already know most of them. Also the book is from 2013 and there is a "note" in the Wiley website warning about no longer using some techniques from chapter 6. This is the kind of "bad SEO" for me, so use common sense and avoid things that smell to tricky or harmful if a search engine would turn against them. There are some small advices here and there that can be of use, and some of the web tools that the book mentions are good to use, but reading this I felt like the author grabbed a bag of all possible topics, tools and techniques, mixed with lots of screenshots and splitted into chapters.& Another negative point is that many links mentioned in the book no longer exist.

Either for non-developer profiles or worth renting at a library instead of buying. Searching Google about SEO best practices and playing with your site you'll get way more improvements than with this book.

Book Review: Learning LEGO Mindstorms EV3

More books read! This time, another book about LEGO Mindstorms EV3 I've been one of the technical reviewers which finally has been published.


Learning LEGO Mindstorms EV3 book cover

Title: Learning LEGO Mindstorms EV3

Author: Gary Garber

First chapters include general mechanics knowledge, intro to how to create assembly instructions using LEGO Digital Designer or LDraw and some basic chasis using both the retail and educational kits. Not bad info, but we've already "eaten" more than 1/4 of the book. 4th chapter gives an overview of all EV3 sensors, which includes 3rd party ones, all with how to use them with the official LEGO EV3 software blocks. A chapter about how to interact with the brick (using the buttons and screen, wifi, bluetooth...), really basic stuff. Follows a chapter about types of output the EV3 (sounds, screen, lights), which is kind of introductory again (except the details of how to load custom images).

Chapter 7 is where the non-basic stuff appears, and from here onwards we see quite bigger examples (block schemas) and the book gets more interesting. Explanations are good, images help and we learn more interesting concepts like course corrections, triangulation and other navigation options. Chapter 9 includes data logging, but as is only available to the educational kit this restricts the possible interest (other than generating envy). The remaining chapters cover an introduction to RobotC, LabView, Bluetooth communication between two EV3 bricks and another education only chapter, a detailed explanation of the Gyro Boy robot.

The book is a mixed bag: Some chapters are quite interesting and the descriptions and theory behind are excellent, but others are either too basic or exclusively for the education kit. For a 263 pages book, this leaves out around half the pages as "interesting for everyone". Another complain is that some of the block images are really hard to read in PDF ebook; I still have to receive the printed copy, but I fear that without color it might be even harder to distinguish individual blocks in the complex diagrams.

Previous entries