Life @ NCP

not everyone needs to go outside to have fun

PAF #1 Show and Tell

Here are the results of my first PAF#1 in pictures and short words:

I learnt much, but a TL;DR:

  • It’s mind boggling how easy it is nowadays to pick up front end components and put a webapp together. Things like AngularJS lower the barrier to entry significantly, at the cost of magical complexity. Bootstrap makes everything nicer.
  • Good design is hard. You can spend hours and days tweaking how things look, it’s easy to get caught up with something small not aligning right, or CSS craziness.
  • Javascript is crazy/awesome, asynchrony is a core requirement but not built into the language. Consequently, many tools and techniques (callbacks, promises) developed to handle this. I tried to use pure callbacks throughout the project, I’m very very tempted to rewrite everything using promises because it sucked so hard.
  • It was nice only needing to work with a single language for backend and frontend. Only used Sublime throughout. That said, the cycle for frontend was still better than the nodejs backend (yes, i probably could have used nodemon but didn’t). As an added bonus of working with interpreted languages, all sources are available for the libraries you use!

Even though at the end of the day I only produced a grand total of…two pages, I’m pretty stoked that it took only two weeks. I’d like to spend much more time than I have to fix some bugs, improve the UI, clean up the code, and write about the details of setting up Express, NodeJS callback conventions, AngularJS anchorscrolling hell, but that could take another fortnight to get right. And I don’t want to break my rules too early.

It’s now available publicly at https://bitbucket.org/minantan/ebooker/ . The code in there is pretty nasty but does the job. I did feel dirty and thought long and hard about making it public, but decided to with warts and all anyway since clean code was not an express requirement 😉

The requirement of having poppler-utils installed makes it difficult to host as a demo, but ping me if you run into problems getting it working.

Author image Min'an

PAF #1 – Ebooker

I wasn’t sure what I was going to do when I stopped working, but I did know I wanted to catch up on my reading. There was a reasonably long list of books folks had recommended or I had earmarked for reading “when I had the time”. Obtaining e-books is easy, well-defined and consequently one of the first things I did to prepare for the break.

I had recently installed Plex on the box connected to our TV and was blown away by how easy it was to use and that it had a web interface out of the box. I fully expected to find a similar app for ebooks, but there didn’t seem to be anything comparable.

Maybe it’s because Kindle has the market cornered where it comes to such ebook management, but the closest, most full featured independent ebook library manager I came across was Calibre. Don’t get me wrong, it’s got a slew of features such as conversion between a myriad of formats (pdf, mobi, epub, you name it), and like plex has a web interface out of the box. It’s the web interface I was disappointed about it, as it seems like it was started some time ago and in need of some refreshment. It doesn’t even let you upload ebooks from the interface 🙁

So here’s my simple project for the fortnight. A plex-inspired ebook manager. I’ve always wanted to pick up javascript and css right, and am currently in the middle of going through how to learn javascript properly. So what better platform to use than NodeJS, and maybe even Bootstrap 😛 Incidentally, the same guy who wrote that javascript run through also has a nodejs one, though I’m probably going to run more with the slightly outdated dailyjs one.

So at the end of a fortnight, I should have something which will let you:

  • Upload an ebook PDF
  • Populate data about the ebook from amazon, including book cover, ratings, etc.
  • Search for uploaded books, including text within the book
  • Filter available books
  • Download the PDF and text version (which I would have needed for indexing to search anyway)

Here’s my notepad drawing of how I think it will work:

ebooker

Research today turned up a few things. There aren’t many native PDF parsing libraries in nodejs. Mozilla’s pdf.js used in firefox for PDF viewing seems to be the most popular native route, but shelling out to OS-available tools like Poppler’s pdftotext is also an option with libraries like pdftotextjs.

I also played around with an indexer called search-index with a pretty front end called norch that was drop dead easy to set up.

There’s also some interesting conditions with Amazon’s Product Advertising API, used to obtain product information. Goodreads which used to use Amazon’s API to obtain book info switched because of overly restrictive conditions in their usage agreement:

(e) You will not, without our express prior written approval, use any Product Advertising Content on or in connection with any site or application designed or intended for use with a mobile phone or other handheld device (which prohibition does not apply to any site that is not designed or intended for use with such devices but that may be accessible by such devices, such as a non-mobile-optimized site accessed via an internet browser on a tablet device), or any television set-top box (e.g., digital video recorders, cable or satellite boxes, streaming video players, blu-ray players, or dvd players) or Internet-enabled television (e.g., GoogleTV, Sony Bravia, Panasonic Viera Cast, or Vizio Internet Apps).

Really? No mobile sites at all? Funnily enough, Goodreads later got acquired by Amazon, but that’s a different story altogether.

It’s going to be fun 😀

Author image Min'an

A project a fortnight

One of the reasons I left work was because I found myself waking up and going through the things I needed to do, and not tasks I wanted to do. I had joined as a developer, but for the better part of my time there I was dealing with the intricacies of building software and its supporting services, as opposed to actually making stuff. I want to make stuff. I just can’t make up my mind about what that stuff is yet.

Trying to figure out what you want to do is a well-trodden path. Much smarter folks have thought long and hard about this, and Paul Graham has an excellent article about the subject – How to do what you love. It is filled with nuggets of gold, the relevant one being:

“Always produce” is also a heuristic for finding the work you love. If you subject yourself to that constraint, it will automatically push you away from things you think you’re supposed to work on, toward things you actually like. “Always produce” will discover your life’s work the way water, with the aid of gravity, finds the hole in your roof.

What

I want to always produce, which is why in addition to our regular poison blog, I’d like to do a project a fortnight. I’d like to get really good at taking an idea, and knocking something together to try it out in a limited amount of time. The rules are simple.

  • The week starts on Sun, so all work must be finished by Sat
  • No extensions
  • Code must be committed by the first day of the second week
  • At the end of the fortnight, someone else must be able to use it
  • There shouldn’t be any incremental changes to a previous project (thanks peggy!)

I initially had a week but made it longer to avoid using “X lets me do Y faster because I already know how to use it”. It’s not a rock solid definition of done, but with anything else in this it’s all subject to change. I’m particularly iffy about someone else must be able to use it, but we’ll see where I get to.

****Eh?

Yesterday morning Marty was thinking of making an apple and mango smoothie. Having worked at Wendy’s she could do a banana smoothie blindfolded, but she’d never actually worked with apples before. She wanted to go ahead and try it out, making up what needed to be done. I wanted to look it up online first to make sure we didn’t waste any time doing something silly. We went with making it up and had no problems* getting a smoothie.

Have I ever thought about making a smoothie? Probably. Could I make a smoothie? Most definitely.

Except just the thought of doing the work required to actually look it up and doing it, and the fear of failure prevents me from even taking that first step of looking it up. I worry too much, often about doing the wrong thing. So much so it actually prevents things from being done.

I can think of a million and one reasons to put this off, some of which are along the lines of

_…is this the best way of finding out what you enjoy?
_ _…how have others done it, and what are their success rates?
_ …maybe you should be taking a break and doing nothing instead

but they pale in comparison when balanced against

_Can you afford to wait for the rest of your life?_ 

When else can I afford to make mistakes, if not while lying on the couch sipping mai tais.

Author image Min'an

Harvesting the seed she has planted

Throughout my adolescence, I changed my mind on this topic very frequently, often, from one end of the spectrum to the other. The topic is on my mum’s parenting. I know, it’s almost like a taboo to question this, as she gave her unconditional love to me. But for some reason it kept on coming up. I have completely changed my position on the topic now, but when I was younger, I used to feel disappointed that I could not do some of the things that other kids could do, like speaking mandarin, or being much more skillful in playing piano, or even better, making myself more confident.

 

Two years after I left Jakarta, I started university. I had quite a lot of good things going for me in that period of time, so it was easy to draw a correlation between the successes and the lack of my mum’s influence on my life. For example if mum had been there, she would never have allowed me to stay in the campus’ boarding house. She was over-protective in her parenting style, such that everyday activities like going on public transport on my own were considered too dangerous.

On the contrary, most of my aunts and uncles had the view that I would never have achieved those good things if it hadn’t been for mum’s help. Being rebellious, I fully rejected this notion in anger. I thought I had worked hard for what I achieved. Therefore I began to criticise how mum had raised me. I think the lowest point in this period of my life was when I thought I should have a kid just to show mum how it was supposed to be done. Ah, my arrogant, naïve young self!

The main criticism I made up to discredit her was to show how disconnected our two ideas of success were. She was a typical Asian parent who had a one track mind of how to achieve “success”, that is, study hard, go work for someone else in a big company and climb the corporate ladder as you age. Her advice at the time was that I should “learn” from what the oldies were telling me and don’t ever take drastic action because I wasn’t old enough to know anything useful. That wasn’t my idea of success.

I spoke to a couple of friends about my disappointment on mum’s parenting style, and I was not alone. Of course, there were friends who are bffs with their mother. But for some others, there was a disappointment on how they were raised by their parents, on a range of issues. Sometimes because they felt their parents had not put enough dedication to get them to learn something when they were younger, or given more direction when they had to choose their uni degree, or because they were allowed to play video games too much (I’m not joking).

Although it’s comforting to find other people who have similar problems like me, it was also quite clear that we were no more than a bunch of whiners. These friends are also decent people, and they are fully in charge of their lives. Blaming their mothers on how they turned up ‘less perfect’ than what they would have liked to be seems unfair. I started thinking maybe I was also being unfair to mum.

One of the Indonesian proverbs says that there is always a sky above the sky, conversely there is always more dirt below the dirt, which means that if I think my parent is bad, I could have had a worse one. If I start thinking of how my mum could be a worse mum, the list is very long and non-exhaustive. For a start, she could simply have chosen not be my mum, because she adopted me when I was a baby. In spite of being an over-protective mother, she still allowed me to go to Sydney. She put so much effort in raising me up, it was ridiculous.

Soon, it made me realise that there were a number of principles she carried that were of the utmost importance, because they shaped the way I am and formed the basis of my life. In fact, those habits are still with me until now. Despite difficulties in trying to form new habits, these habits have stuck with me, hopefully forever, and it is definitely through mum’s hard work.

The first principle is no expense should be spared for education. She told me that because it’s an investment, it comes from a special budget. There would always be money to buy books or to take a course, no matter how expensive. It was like having a bottomless pouch where you could get money – as long as it was used for education. She spent a truckload of money for me to learn the piano, ever since I was four years old. And I quit just shy of a year of getting certification to be able to teach it. I never ended up being a teacher, but nonetheless I love playing the piano as a hobby.

My piano lessons were a major part of my life growing up. I would practise from Wednesday onwards, and would be completely stressed out on Friday, the time when I would have to present my work to my teacher. But Saturday would be a different story. I would feel elated, calm and comfortable in my skin because a new level of mastery has been reached. Hence, I have viewed learning as an iterative and repetitive process of pain and pleasure – enjoyment and struggle are two sides of the same coin. If I can figure out how to win in a board game just by playing it once, then the game is not very fun.

It was not just about life lessons though, I got to experience her quirks too. You see, I was small when I was small, and I am still small now (Imagine how much smaller I was, huh!). One of my mum’s obsessions was how to make me tall. She would always tell me to eat, to the extent of spoon-feeding me when I fell asleep at dinner time. I had memories of getting hit with wooden ruler when I left my dining chair without finishing my meal, a big plate of rice usually.

It did not stop at eating because she cranked up her effort to new heights whenever things did not work. She gave me some herbal tablets without knowing what was in it. She told me jokingly that I should break my legs, to extend them by surgery. Surprisingly it is common for a lot of kids in India to go through this type of horrible surgeries in India.

 

This year has marked 10 years of my life in Australia, it has also marked 10 years of my mum’s life without me in Jakarta. When I moved out to live on my own seven years ago, I tasted my independence as a young kid and I criticized her parenting too much. Fast forward to now, the fact that I am now who I am, able to think rationally and have a will to do better parenting means that she has pulled off the most amazingly difficult task to do. This does not mean that I will have kids though. It’s the thought that counts! :p). To plant the seed of who I am is not easy, and there is no excuse I can come up with to take away that achievement.

Thanks mum 🙂

 

PS. Thanks for poison post! I have had this post as a draft for several months. If I don’t post it this time, I think I would never will.

Author image Min'an

This is not the greatest blogpost in the world

I remember having to write essays in school. Composition writing they called it. We had to take lessons which told us what a good essay was meant to have. If it was fiction, what kind of characters it ought to have and how a plot should develop. If it was non fiction, how there should be a balanced argument for both sides and a logical structure for the piece. To be honest, I can’t remember half of what they said.

This is not the greatest blogpost in the world, maybe it would be if I had paid more attention. Like the taste you will never find again, it is a whiff of potential. The possibility looms larger in your mind than the actual reality. The truth is, I had never committed fully to writing the best blogpost in the world, maybe only partially, just so I could use it as an excuse for failure.

I don’t commit fully to things easily because I don’t like making mistakes. If things don’t turn out right, at least I can say I never fully went ahead with it. The story of my life of not being able to commit fully to doing something today, here and now, means that all the planning in the world is not going to help. Changing this is one of the reasons I was so keen to move to Stockholm, the main reason I’m leaving my job.

This is not the greatest blogpost in the world, it is simply a statement. A statement that I am fully commited to keeping in touch 🙂 To not dying a horrible death by poison post, to sharing a part of my life with you. It is not an obligation, but something I truly want to do here and now.

I thought of writing about how we settled in, unpacking the crazy number of boxes we brought over and the IKEA furniture we bought just to house all the stuff. I thought about writing about how we’ve gotten used to the summer sun, rising at 3am in the morning and only going down at 10pm. In the end I thought I’d start with something different, deep and meaningful if you will.

This is not the greatest blogpost in the world, but it does have some pictures of Stockholm!

Author image Min'an