Bible Stats Visualizer
It’s been quite some time, hasn’t it?
Well, I finally found some time to do some experiments and play around with new libraries. This time, the chosen one was D3.js.
This semester, I’ve been taking a Data Visualization course here at ASU. It’s a very interesting subject. The power you can have by visualizing information is enticing. Discovering patterns hidden in the data is very exciting. So, when a friend of mine here at ASU published his preliminary results on some analysis he did on the Bible’s books, I thought it would be nice to try out some of the techniques. The result is in this link. Since it was the work of one night, so there’s still a lot to improve.
The output of his analysis was: number of words in a book, and ratios on verbs, nouns and adjectives. If you’re interested in the analysis process itself, you can get more info on his website: https://sites.google.com/site/jadielam/personal-projects/the-bible-by-the-numbers/tokenization-and-part-of-speech
Here’s how the information was encoded:
- number of words -> y-position
- verb ratio -> circle radius (interactive)
- noun ratio -> circle radius (interactive)
- adjective ratio -> circle radius (interactive)
The ordering can be done in the traditional Bible arrangement, or relative to the currently chosen ratio.
Coloring was done qualitatively, but warm colors were chosen for the old testamente and cold colors for the new. This way, one can compare pre-attentively (or hopefully close to that) the proportion of old and new books in the chart.
What about conveying all three ratios at once on the screen? I’m sure it can be done. Maybe through composite pie charts or so. The issue is just making sure that there’s not too much information, and effectiveness of the visualization is lost.
In the future, I plan to add tooltips and maybe some different forms of visualizations. Some colors obviously need adjusting (they’re too close or too dark).
This project is on GitHub. This is my first project there, so this is also a learning experience. Here’s the repo: https://github.com/victorgirotto/bible-stats-visualizer
:-)
* about my computer studies
This blog will go through some changes. Why?
Well, the simple reason is: there are many important things demanding my attention, resulting in less time spent studying HTML5 and its related technologies. But I’ve been studying many other things, and I believe this blog is very important to me, as a learning log and a public ‘portfolio’, and to others, who might benefit from something written in here.
So, what will I write about now? Basically, every interesting thing that comes up to me in this semester of studies. That involves HCI, Software Engineering, QA, design patterns, SOA and specially compilers. This last one will likely be the one that I talk about the most, since I’m currently attending CSE440 - Compiler Construction here at ASU and am currently developing a portuguese pseudo-code interpreter at my university in Brazil as my capstone project. This project uses ANTLR at its core, and the development is done with Java.
I have interesting topics in mind, and will be writing about them soon. :-)
Website charges 'tax' over IE 7 users
The Australian website Kogan.com is charging an extra fee for users who buy on their website using Internet Explorer 7. Talk about learning the hard way! Hehe!
They explain that this fee is to compensate for the extra work needed to make their website run on IE7.
From the legal point of view, is this ok? And will this make users change their browser during the purchase (having to redo the whole product-choosing cycle on the other browser), or will it simply make users give up un their purchase?
All issues aside, this was a pretty cool way of calling attention to this issue.
Yet another conference - Microsoft HTML5 Devcamp
I haven’t even written about the conference in SF yet, and am already attending another one. This time, it’s the Microsoft HTML5 Devcamp, here in the sunny and hot Phoenix.
It hasn’t started yet, but so far so good: free breakfast! :-)
P.S.: I’ll write about both conferences soon. But it’s important to note that they are a bit different: while the one in San Francisco was (mainly) for people who already knew (at least some) HTML5, presenting it’s multiple features, this one seems to be more introductory, presenting an introduction to HTML5 and CSS3, and some basic technologies.
HTML5 Developer Conference - San Francisco
So far, I’ve watched two talks: Doug Crockford’s and Giorgio Sardo’s (one of the guys behing cuttherope.ie).
Doug’s wasn’t technical. It was entitled “What Would Crockford do”, and he basically talked about Yahoo’s situation, and what he would do if he was the companies next CEO.
Sardo’s was technical, but he only showed a couple of code snippets. He will have a more in-depth talk later on the day, in which he promised to share more code and answer many questions.
Later on (not today, though), I’ll talk more about each talk. I’m taking notes. :)
Books I read: Javascript: The Good Parts

You know a book is good when you keep reading it even when you’re on finals week. That’s what happened with Crockford’s Javascript: The Good Parts. His book is great.
This is the book’s table of contents:
- Good Parts
- Grammar
- Objects
- Functions
- Inheritance
- Arrays
- Regular Expressions
- Methods
- Style
- Beautiful Features
- Awful Parts (appendix A)
- Bad Parts (appendix B)
- JSLint (appendix)
- Syntax Diagrams (appendix)
- JSON (appendix)
First of all, a little about me. I have a good background with object oriented programming (basically with Java), and have been ‘programming’ with Javascript for a while. With this background, I’ve been able to read and understand basically everything he wrote in the book. My lack of experience with real Javascript programming, however, keeps me from seeing the big picture. So, this is certainly a book that I’ll read again later on my Javascript road.
Of the things that stood out to me, was all the talk about Javascript’s prototypal inheritance. This is a concept that I need to exercice more, given my background with ‘classical’ inheritance, as seen in Java.
Chapter 4 (functions) was pretty interesting. Javascript relies heavily in functions, so it’s important to understand some things about them. He talks about four invocation patterns (Method, Function, Constructor and Apply - all affecting the this pointer), the fact that Javascript does not have block scope (only function, meaning that if you declare a variable inside an if clause, for example, it’ll still be accessible from outside of the if), and the very interesting Closure. What’s this? Inner functions (function within a function - just like Inception’s dream within a dream) always have access to the parameters and variables of the functions that they’re defined in. Even after method execution. This can be used along with constructors to create private variables, something that many people think is not possible in Javascript.
I also liked Chapter 9 - Style. Nope, it has nothing to do with CSS, but with coding style. The chapter itself is pretty short, but I consider it to be directly connected with Chapter 10 and Appendix A and B. He gives some advices on how to to make your code speak. There are some pretty useful things, and some that many may consider a little too radical. He tells us not to use incremental or decremental operators (++ and —). While this may cause confusion in some circunstances, I honestly see no harm in writing index++; instead of index = index + 1;.
Lastly, the chapter about JSLint is also pretty sweet. He basically provides us with a tool that checks many things that he wrote there. But here is were a subtle problem lies. By using JSLint (which IS a great tool), his recommendations stop being recommendations and start becoming rules. You have to follow them, or your code will not do well on his tool. I brought up this theme a couple of posts ago, so just refer to this and that.
Anyway, this is an awesome book, that I will surely read again, later on my quest to be a front-end Jedi. I’m also pretty excited to see Crockford’s speech on the HTML5 Developer Conference later on this month. :-)
Now, I’ll hold Javascript back a little bit, and already have started reading Mastering CSS, Vol. 1, by Smashing Magazine. Seems a pretty good book, and wasn’t expensive at all. Although the title doesn’t explicitly state it, this book is really about CSS3’s new features. As usual, I’ll say a few words about it when I’m done with it.
Polyfills
Two posts ago, I talked about the cool website HTML5 Please. It basically is an abstraction over caniuse.com, providing you with simple a answer to if you should use a given feature or not.
But when you check the site by yourself, you’ll see that many APIs have the Use with Polyfill. Ok, sounds good. But…
What is a polyfill?
A Polyfill - a term coined by Remy Sharp -, is simply a way to fill the holes that some browsers leave on the new APIs, allowing you to use them as if nothing was wrong. Under the covers, they provide mechanisms compatible with those browsers - like flash, if available -, but expose it through the normal Javascript API that you’d expect to be available.
Here’s the article were Remy explains it.
And here’s a list of cross browser polyfills, brought to us by the awesome guys behind Modernizr.
* { box-sizing: border-box }
While skimming through Paul Irish’s blog, I found a very interesting article.
This is the situation: you set an elements width to, say, 300px. Then you set its padding to 50px. You save the file, reload the page, look at the result, curse it, and go back to the code to set the width to 250px. This happens because of how the box model works.
Basically, you can overcome this behavior with this simple line of code:
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
Haven’t tested it yet, but surely will.
Another cool detail is that people are always worried about using the * operator alone, due to performance issues. I had read that before, and always avoided it. Well, he says that it shouldn’t be on your top concerns. And, I guess I agree.
HTML5 Please
I’ve already talked about caniuse.com, but I’ve just seen this cool website that puts a nice little “do | be-warned | don’t” layer over it. It basically tells you if you should or not use a feature, and if you use it, what kind of fallback support you need to provide. It also provides great information on shortcomings of specific features, which is very important to have in mind.
If you still prefer caniuse.com, don’t worry. They link to it on every feature you search there. Just click on the “View browser share %” link, and BOOM, you’re there.
HTML5 Dev Conference
Ok, just one last thing before I go have lunch (and go back to my studies).
This morning I saw the jQuery conference in San Francisco. I was interested, because this year I could actually go to it. But then I saw the price. Don’t take me wrong, I like to invest in stuff like that, but my student budget is not that good. I’m already going to the Microsoft HTML5 DevCamp that will take place here at Phoenix, but I wanted more.
Then, I came upon the HTML5 Developers conference, link above. Some awesome people will go there (including Crockford), and I think it’ll be a great experience. I’m still thinking about it, but I’m very tempted to go.
UPDATE: Now it’s 100% certain. I’ll be there. :)
UPDATE 2: Just a curious observation: Dr. Doris Chen, Developer evangelist for Microsoft, who will performing the HTML5 Devcamp here at Phoenix, will also be talking at this conference. She’ll have two chances to impress me, then. :-P
- Theme by Simen
- Talk to me! :-)
