Book review: Host Your Web Site in the Cloud: Amazon Web Services Made Easy

Thursday, August 16th, 2012

I bought this book because I thought it is about web site building. There are many frameworks that facilitate this process and I like reading books about them. But this book is not about web site building, despite what the title says. So, I totally agree with one Amazon reviewer who mentioned that the title is misleading.

So what is this book about? It is about Amazon web services. It is a good introductory book, with each service explained in a great detali: how to set it up, how much it will cost, how to start using it. There are lots of examples written in PHP, and they are easy to follow. So, in general it is a rather useful book if you want to learn how to build web apps. The problem is that nobody is actually building the apps the way this book teaches. The code snipptets in this book use some low-level API. It is a good way to demonstrate all the features of Amazon web services, but when it comes to building a web app, it is more about architecting the app, picking the right libraries and frameworks, etc. I have not investigated this question, but I am pretty sure there are dozens of higher-level libraries for AWS that make building apps a whole lot easier than this book explains. For example, nobody is going to code a data input form by using pure HTML/PHP these days. In modern frameworks such as Drupal and Django people only have to provide data model, and the framework takes care of the rest, i.e. how to input data according to the model, how to present it to the user.

Still, this book is probably a good start for people who contemplate buidling web apps. I know there are many people who succsefully migrated their web sites from traditional hosting companies to more flexible Amazon cloud hosting. Even though the book does not explain how to do this, it exaplains how the basic blocks work, and then it is only the matter of connecting the dots.

My new web site dedicated to running

Tuesday, July 10th, 2012

Years are passing by, and each year I am running a few marathons and half-marathons. For each of them I generate a write-up and a picture gallery. But there was no centralized place where I could post my war stories. Finally, I created one, with the help of Drupal, a wonderful site building system.

Here is it. You can see a grid of titles, each one representing a single running event. If you click on a title, a web page showing detailed description opens up. It even includes a map of where the marathon took place. Beneath the map and summary you can see my report. And after the report – a picture gallery (I am always trying to snap a few pics as I go along the way, even if organizers also take pictures).

The funny thing is that it was really easy to build this web site. I did not have to write any code to create a data schema or the UI to enter the data. All of this is done completely automatically. I only need to specify what kind of data I want to store – text fields, geo-location, star voting widget, etc. Very high-level and rather intuitive. The only part that needed some coding was the styling part, that is, when you actually want to specify that the map should be aligned on the left-hand side, and the summary block – on the rigt-hand side. For that purpose I used CSS injector plugin.

In addition to My Marathons web page I would like to build My Readings page which will be dedicated to the book reviews. With the proliferation of book readers I noticed that I am reading more books now. Yeah, these book readers are really useful gadgets, even though I don’t have a dedicated book reader. I am using a rather general-purpose inexpensive tablet manufactured by some Chinese manufacturer called ErgoTech.

I am really excited about Drupal now! I think it perfectly fits to the golden middle on the scale of skills one has to posses in order to build a web site. On the one end there are template-based web site builders which don’t make it possible to build custom web apps. On the other extreme is the pure HTML and Javascript, which takes a lot of time to learn. So – Drupal is what I really needed!

Learn Drupal!

Book review: Principles of Beautiful Web Design

Monday, July 2nd, 2012

I read this book because I am trying to educate myself in the area of web technologies. As some people mentioned in their reviews of this book, it bridges important gap between pure mortals and web designers. It is nicely written, in a fluent and ironic style. Still, the book maintains a logical attitude toward art of web design. From the very beginning, I liked the fact that table of contents includes only 5 parts, which makes it possible to keep global picture in mind as you make your way through this book. They are:

  • Layout and composition
  • Color
  • Texture
  • Typography
  • Imagery

Roughly speaking, these parts correspond to steps one needs to make when building a new web site. Being organized is essential to making it through such a complicated process as building a web site. Each chapter describes some techniques professional designers use. But the explanation is simplified as much as possible, so that people of various backgrounds can easily follow. The downside is that the book sounds way too elementary every now and then. For example, it spends a fair amount of time describing some CSS properties. There are tons of CSS guides on the Internet, you really don’t have to write a book about it. The good thing is that each step is illustrated by screenshots of web sites that author belives are good representatives of certain technique.

A collection of links is provided in the end of each chapter. Many tools that facilitate web development have been developed. So if the reader wants (s)he can start exploring them right away. In paritcular, I found the following two examples to be very interesting:

  • 960 Grid System – a framework for building grid layouts. I did not realize that most commerical-grade web sites use 12-16 columns in its grid. I thought that web page has 2-3 columns.
  • Color Scheme Designer – a tool that helps you select a color scheme based on theory of harmony (which color pairs with which). Then you can grab the resulting palette and colorize your web site.

So, I found the first few chapters to be rather interesting, but the rest of the book to be rather dull. The good thing is that you can treat this book as a potpourri of essays which you can read in any order. If you don’t want to read about Textures for example then you can easily skip it. To summarize, this book is a good example of recreational reading for a computer geek.

My experiences with Drupal: give it a second thought before getting disappointed

Saturday, June 23rd, 2012

I am spending some of my free time to learn various web frameworks. Recently I decided to take a look at Drupal (I was using version 6 of the framework). So, I installed it after registering account on 000webhost. The installation was smooth.

Then I logged in as admin and started looking around. What I found was a primitive set of tools, namely the ability to create pages and stories. Ok, this looks like basic blogging system. Fine. How about creating a real web site? Menus, custom data types, widgets? I glanced through Drupal’s admin menus but found nothing. Still, Drupal claims to be a web-site building framework.

So how can I build a web site using Drupal?

Oh well, I thought, this framework is less than obvious. Lets get some book and learn from it. So I went to Safari Online and found Pro Drupal development. This book explained how to extend sub-systems of Drupal, such as how to add elements to a page, how to disable a user, etc. Lots of scattered facts, but this book certainly could not convience me that Drupal can be used to build web sites.

I was disappointed by Drupal. Then I thought maybe I should make my requirements more specific. What it means to build a web site? Well, I thought, it should have various sections, such as picture gallery, a list of my favourite recepies, trip reports, etc. So I expected some kind of data store accessible through API, then some way to generate views and so on.

So lets say we want to build photo gallery using Drupal. It should have albums, each album containing arbitrary number of photos. I searched Internet trying to find how to do this. Any free e-books out there? None. Compared to Django which has a dozen of free books, documentation for Drupal is much less complete. Even on the official web site it is rather incomprehensive.

Then suddenly I stumbled upon a few cool free screencasts on drupaltherapy.com. It mentioned that I need to use modules. Yes, M-O-D-U-L-E-S. A-ha, that’s the keyword. Drupal is a pretty creepy system by itself, but modules make it fly! Then I quickly installed a bunch of modules (I wonder why I had to use ftp, could not they provide built-in installer?). I installed CCK, calendar, filefield, imageAPI, imagecache, imagefield, node_reference_url, view, view_attach, views_bonus, views_slideshow, ccs_injector

These modules really brought my Drupal installation to life. Now I can use CCK to add custom content types, views to present data as grids, lists, and slideshows. I can even customize look and feel by injecting CSS (so I don’t have to hack the theme). What is really important is that each module comes with a GUI. For example, the content creation module presents the data type scheme as a list of fields, for each of which you can select type, modify its name and attributes, etc. Views is an even more impressive module – essentially, it makes it possible to query the database without writing a single line of SQL.

So, Drupal aims at a very elusive goal of programming without writing code. As I mentioned earlier, building web site requires knowledge of a whole bunch of programming languages, so it is far from trivial. Drupal bridges the gap between pure mortals who just want to tell the world about their beautiful household, and the intricate world of web technologies. You don’t need to obtain a PhD if you just want to build a web site. Not anymore – thanks to Drupal. Really amazing framework!

And finally, after watching a dozen of screencasts, I found the one I really liked – how to build a photo gallery which supports some kind of hierarchy and references among objects (pics and albums). Here is a screencast – a really nice one!

Book review: Python web development with Django

Tuesday, May 29th, 2012

This is a very balanced book. It is probably a bit unusual to describe a book as balanced but here is what I mean. These days, programming is more like solving jigsaw puzzle. There is no silver bullet anymore. Earlier, programming meant just knowing programming language. If you know C then you are systems programmer. If you know Fortran then you are scientific programmer. Today, you really need to know 3-4 programming languages to be able to program the Web.

In fact, Web has become a crossroads of a bunch of technologies. In particular, it unites two schools of thought: traditional programming with functions and objects (languages such as Javascript, PHP, Python, etc) and declarative programming, or UI programming, when the programs you write do not have any sequence of commands. Instead, those declarative programs specify the layout of objects on a web page (HTML) and their style (CSS).

Therefore, to achieve the goal of web development one has to know at least the following: HTML, CSS, Javascript, and either PHP or Python, that is 4-5 completely different languages. In a certain sense Web has already become the Babel tower. So how is it possible to write a relatively short book that will teach you web programming if you have no background in either of those langauges? I think this book achieves this goal rather nicely, and this is why I call it balanced.

The book starts by providing a 1-chapter introduction to Python. I never thougth that it is possible to teach Python in 1 chapter, but after reading this chapter I found it pretty concise and useful. Of course, it assumes some elementary knowledge of programming, but from there it takes you to some advanced concepts such as lamdba functions and decorators in just 10 minutes worth of reading.

Without further ado, the book describes how to build a real-world useful application, namely a Blog explaining concepts of Django framework along the way. Such an example-driven approach keeps reader engaged all the time. Every time I open this book I think: what kind of cool application am I going to build today? This book contains four large-scale projects which illustrate various components of Django. On the other hand, there are some chapters with more in-depth description of underlying technology.

Django framework is a good example of software design. As it has to bridge two different approaches to programming, namely declarative (HTML) and functional (Python) methods, a clear separation of these is necessary to avoid code mess. In addition, Django presumes that each Web application needs a data store, and therefore some langauge for manipulation data. Each database has underlying schema, therefore Django has to include an object relation management layer. In short, Django assumes the following workflow of a typical web application:

  • Web application stores data in a database (blog posts, pictures, etc.). So, the core of every application is a data model, written in Python
  • So we’ve got some data. How are we going to show it? Here the model-view-controller (MVC) paradigm comes to rescue. First off, a view is a function that takes incoming HTTP request and generates a response. It can access data store through the data model defined in step 1. So a view function is also implemented in Python.
  • Now comes the tricky part. The view function fetches the right data, but how would it present it? It needs to generate some HTML, and the latter is a declarative language. Generating HTML from Python is a tedious task. This is why Django comes up with its own template engine which is a declarative langauge itself. It naturally coalesces with HTML, yet augments it with minimalistic functional features, such as loops, to iterate through collections of data.
  • Last but not least, a web application typically has many views, such as archive of all posts, recent posts, etc. A special regex-based mechanism is used to distribute incoming requests to appropriate view functions.

Django comes with a bunch of helper applications (called contrib apps in Django). One of them which is particularly useful is admin app, which makes it possible to enter data into the data store, according to the application’s data model. Essentially, it is a nicely written UI for accessing the database. There are some contrib apps for managing users and sessions, and even for localization.

Despite all the complexity of a web application, Django does not hide the low-level details from you. You have access to every single byte of the web pages generated by Django. It only affects the way you think, it teaches you to write your software using design patterns. Therefore, Django is a good thing for universities – students should learn how to design software, instead of learning specific programming language such as Java.

I think that this book makes it very clear that with Django you can start building cool stuff after spending weekend to read this book. This is a great recreational reading for a computer geek, and I definitely enjoyed it.

Book review: Coffeescript

Monday, March 26th, 2012

This is one of the best programming books I have read in years, due to a number of reasons:

  1. It is small, only 60 pages
  2. It is free, but I got my copy though OReilly blogger reivew program
  3. It is well written. The narration goes from simple to complex

So what is this all about? Javascript is easy to learn, and this is what its creators aimed at. But as a result you get lots of headache when you try to use some advanced features such as classes, inheritance, etc. Are those really advanced features? In those days when Javascript was designed, they were. So, Javascript is simply showing its age, and the time to give it a major overhaul has come.

Recently, people have come up with many nice languages such as Python and Ruby which share many common features. Nobody claims they are easy to learn, but they are easy to use. So, the initial goal of building an easy language has been achieved. A new set of language constructs and idioms has been adopted (such as using indentation instead of brackets, arrow instead of function keyword, ranges, comprehensions, etc.). A new generation of developers expects iterators, maps, ranges, closures to be standard features of any programming languages. To most C++ programmers those look like quite advanved features provided by libraries such as STL. But Java revolution has happened: people got used to this syntactic expressiveness.

Coffeescript adds syntactic sugar to Javascript, bringing its language constructs on par with those of Python and Ruby. The good thing is that it compiles down to Javascript, so you can paste the output in existing web pages without any problem. No server support or library is necessary. You can even use interactive compiler that converts your Coffeescript into Javascript on the go.

The book is nicely written. Each chapter is dedicated to a certain aspect of the language: classes, idioms, the good parts, etc. Each chapter starts with a few simple examples, but it concludes with some really tricky stuff which can keep your attention for several minutues. For example, the chapter about classes mentions Mixins in the end, which is essentially a way to implement abstract classes (interfaces) in Javascript. Still, some people claim that CoffeeScript introduces new problems while trying to fix Javascript issues. This is why some language hackers added even more sugar to CoffeeScript. One such attempt is called Coco, look at all the new syntactic constructs it adds. They are awesome! So concise and powerful

(I wanted to say – strange and beautiful).

To summarize: CoffeeScript will make life of JavaScript developer F-U-N.

Books are becoming free

Wednesday, March 21st, 2012

There is lots of free information on the web – and Wikipedia is the most prominent example. I think that it makes it possible to learn about any particular subject. The quality of this information is getting better and better. One can say that information on Wikipedia is rather limited – there are few examples, etc. If you want to learn something in a greater deapth you typically need to read a book (textbook) and those used to be not free. This year demonstrated a change in the education capabilities of the Internet. MIT and Stanford are now offerring online interactive courses, to which tens of thousands of people sign up.

Another interesting example is free books written by professional authors. They are published by well-known publishers such as Oreilly. You can pay if you want, but more and more often, you can get these books for free. So here are a few examples that are currently on my mind:

Modelling on January 1st

Monday, January 2nd, 2012

I went to sleep at 4 AM on the New Year day. However, I woke up rather early at around 9AM. After spending some time at home, I went to the office. It was Sunday, still, there were some people. This is funny. After making Skype call to my parents, I finally got a chance to do what I really like, but for what I have virtually no spare time: 3D modelling.

This time I decided to build a model of a new church in my hometown Dzerzhinsk, Russia. Here it is.

I spent around 6 hours building this model. I enjoy Sketchup modelling so much that sometimes it seems to me I can do it during entire day without feeling tired. Anyway, with this exercise the day went by surprisingly quickly. I wonder if the whole 2012 will also create this kind of feeling. We will see.

Year 2011 wrap-up

Thursday, December 29th, 2011

Just a few days remain before the end of this year. Lets try to summarize what has changed in my life during this year in relation to computer technology. In short, I changed my habits of interacting with Internet during this year – from batch mode (blogs, e-mails) to more real-time mode. This was the year when I started using actively Facebook and Twitter. The reason why I did not use these social networks before was that there are way too many social networks around. I have been using LinkedIN before and have built a network of more than 100 friends during 2008-2010. But during 2011 I added only a couple of friends in LinkedIN.

For me, each social network comes with a distinct group of friends: In linkedIN I have Finnish friends, in Facebook – Chinese friends, and those sets do not intersect.

Facebook was the social network I used the most during 2011. The primary reason is that there are lots of updates coming through it. In LinkedIN people usually update their status 1 a month or even less frequently, in Facebook – many people update status several times a day. So I wonder whether LinkedIN starts to die. One can argue that LinkedIN is a professional network. But it is pretty clear that such resume building functionality can be easily implemented in Facebook. In other words, if Facebook wants to kill LinkedIN they can easily do it, I think. Am I saying that Facebook is immortal? Of course not. Someone else will take over after some time. It is a natural way of evolution of social networks: MySpace (dead), Orkut (dead), LinkedIN (kind of alive), Facebook (flourishing).

So before we are tired of playing with Facebook, what is that next big thing on the horizon? This year Google has launched a bunch of new products including yet another iteration of social network called Google+, and it killed its previous (unsuccessful) attempt: Google Wave, Google Buzz, Orkut, as well as many other products.

Googleʼs rate of killing their own (unsuccessful) products seems too high. Wave, Gears, Buzz, Orkut – R. I. P.

It is funny that while some companies try to keep afloat their existing products, Googleʼs rate of killing their own products seems too high. It would not surprise anybody if Google kills Google+. So this is not the next big thing.

Year 2011 was the year of revolutions organized through social networks (Arab Spring and Russian Fall are just two examples). This increases the importance of mobile blogging. This is why Instagram became app of the year at iTunes. All the popular social networks now have official mobile apps and they are constantly improving. So the next social network will be mobile, thatʼs my prediction. People will stop blogging from their desktop machines and start using their mobile phones everywhere – in subway, in supermarkert, etc. One enabling technology is speech-to-text recognition. This year proved that this is indeed possible. I used Dragon Dictation and it works quite nicely – recognition rate about 90%, then you can easily edit the mistakes.

I started using Twitter actively this year. Earlier I could not think of how I could use it. Now, besides sharing links, I use it to share my notes. For example, while reading the book if I spot an interesting phrase – I send a quote to Twitter immediately. Even if my phone is offline, the Twitter app makes it possible to save the draft and publish the tweet later. Essentially, Twitter has become my scratch book. Also Twitter is a great way to receive updates from various blogs and publishers. I use TweetDeck which makes it simple to organize tweets into columns.

It seems that real-time updates from Twitter and Facebook are pushing away RSS technology and the numerous blog readers. The problem with RSS is filtering: many news outlets publish dozens of articles per day from various authors, so seeing them all imposes a burden on the reader. Therefore, the editors decide which story is important and which is not so important. They send only the important ones to Twitter/Facebook, and the reader can see the rest if he decides to visit the publisherʼs web site. This social filtering model explains why Twitter is becoming more popular than traditional RSS.

Since I switched to Twitter I decided to abandon Google Reader. I am subscribed to more than 100 blogs in it, but during this year I visited Google reader only a couple of times. Also, I have a huge collection of links in Delicious. Over the past few years, I never visited any links that I saved before. Therefore, building such collection does not make any sense. R. I. P. Delicious.

RSS, Google Reader, and Delicious are dead. Long live Twitter, my digital scratch book!

Instead, I want to bookmark only those web pages which I know I will come back to. I noticed that I use bookmarks in Firefox to store interesting articles which I donʼt have time to read at the moment. I can click on this bookmark in the end of working day, read it, and remove it. Recently, I discovered a great tool that does exactly that in the cloud – Instapaper. You can install “Read later” button in any browser, save web pages to your web account, and open them later at any other device. You can move the articles youʼve read to any folder (essentially tagging it), which actually makes it possible to find out later on which topics you have read the most.

Using Twitter and Instagram generates a whole pile of small chunks of information. Tools to organize this are definitely needed. I would like to mention two tools that can organize separate tweets and photographs into stories: Storify and Jux. Those tools have very nice look, pretty much like a professionally edited newspaper or magazine. This means that self-publishing will continue to flourish. Btw., this year was the year of tablets: think of Kindle Fire, B&N nooks, HTC flyer, and so many other tablets.

There are so many cozy self-publishing platforms that appeared in 2011. During the next year I will try to take into use one them. One can wonder, why is this needed? Can I still use text-based blog? For some reason, however, if you want to attract more readers (customers) you need to work on the design of your product. Apple iPhone attracted customers not because of its features, just because it was the very best looking gadget on Earth. People have intrinsic aesthetic feeling.

These new web applications became possible because of HTML5 that is now supported in major browsers. I still need to re-design my web site to take into use HTML5 and elements of semantics web. Another goal that I constantly want to pursue is learning new programming languages, for example Dart, the Node.js paradigm, or even good old jQuery. Building for mobile is another essential skill that I want to acquire. It is pretty clear that web/mobile technology is where lots of exciting things are happening these days. And learning them is a lot of fun!

Introducing Volkov Commander for Web 1.0

Wednesday, December 28th, 2011

Good old days…. I still miss those IBM PC XT computers…

I would like to introduce my new pet project – Volkov Commander for Web. I wonder if many people know what is Volkov Commander. Maybe some people still remember Norton Commander from good old DOS days? That’s the program I adored during my childhood. No wonder I decided to re-implement it. Of course, the environment has changed drastically, now most popular program is web browser. So, why not implement Volkov (Norton) commander in a browser window, I thought. In fact, the primary motivation for me was being able to clean up the mess that my web site actually was. As the design of my web site was constantly changing, I uploaded way too many pages, images, scripts, etc. Another reason was to link local file system with the web, for example to upload pics to my web site.

Volkov for Web is implemented in JavaScript with some PHP functions acting as back-end. So if you want to use it you have to put the entire package on your web site. Then the websiteʼs file system will appear in Volkovʼs panels. I took advantage of HTML5 file API which makes it possible for a Javascript program to access local file system. With this API it became possible to copy (upload) files from local filesystem to the web site. Traditionally, youʼd have to use FTP to do that, so Volkov definitely simplifies lives of web developers.

Implementing a file manager involves heavy use of UI components: buttons, dialogs, etc. One of my goals was to preserve the original UI of Volkov (Norton) commander. So I implemented my own small UI library. The UI components in the above video do not look quite like those in good old Volkov, but I will keep improving them. The goal is to make two UIs look identical.

I loved Qt framework so much that I decided to give it a boost – port it to Javasciprt! Hence the name: JA QT (yacht). Is it going to stay afloat?

My UI library tries to be API-compatible with Qt library, a toolkit I learned while working at Nokia. Qt is a popular UI toolkit for Linux (think of KDE as an example), Symbian (which was killed by Microsoft). Even though it was thought of as cross-platform toolkit from the beginning, there are some other UI frameworks that are more popular on certain platforms. So, I thought we should give it a boost – and I decided to port Qt to the Web, in other words rewrite it in JavaScript. Hence the name of this new UI toolkit – JAQT (pronounced as yacht): JAvascript+QT. Boy, an ambitious goal it is!

So far, I have ported some basic widgets (QWidget, QPushButton, QLineEdit, QProgressBar, etc), and layouts (QBoxLayout, QVBoxLayout, QHBoxLayout), as well as dialogs (QDialog, QMessageBox, etc.). So I can implement some basic dialogs such as those shown in this video.

Will these two technologies (orthodox file manager + orthodox UI framework) produce a killer app? I guess it depends on the features of this file manager. In particular, going to cloud seems like a promising direction. It would be interesting to make it possible to access Dropbox in one of the panels, and your local filesystem in another. In a longer run, I think I should put this app on Chrome store so that more people can try it, maybe it can become file manager of choice for the Chrome OS.

If anybody is interested in this – do not hesitate to drop me a line.