Category Archives: Productivity

Writing performant JavaScript – A Hacky thought using asm.js

Disclaimer: I haven’t tried this myself. Got this weird thought when going through some of the blogs.
The question is, how do you write a very performant Node JavaScript code?
If you have a node based microservice doing exactly just one thing and that too in the most efficient fashion. Once written such programs doesn’t have to be tweaked much and constitutes as a piece of framework based on which other components work (around it). It seems confusing, don’t worry, just think of a scenario in which you would want to write best performant Node code for your project.
Writing a high performant code is very difficult. One approach that I can think of is by generating the best possible JavaScript by converting well written C or C++ code using Emscripten. Crazy??
Sort of.. 🙂
Let me explain. ..
Have you heard of asm.js? If not, its a subset of JavaScript which is very efficient and can be one of the JS written very close to native code. It performs very close to how native code works. Generally its not hand written, rather it is generated.
The C or C++ code which is written (considering all the best practices) is passed to Emscripten which converts into asm.js code. Sound Greek?
Ok, let me get into a bit more detail… first you write C or C++ code and then it is converted to so called LLVM byte code. Now you will think what the hell is LLVM. LLVM (Low Level Virtual Machine) is what it started off years ago. But, now it has so many sub projects under its umbrella and it no more like its abbreviation. Using Clang you convert the C or C++ code to LLVM bytecode and then pass it onto Emcripten which converts LLVM bytecode to highly performant JavaScript code (asm.js).
So, this can be thought off as an approach to write some performing Node (JavaScript) code which runs itself as a microservice.
If you feel confused at this stage, dont worry. Just grasp some of the important points as below:
  • asm.js – strict subset of JavaScript which is highly performant. At the end of the day, its plain JavaScript.
  • LLVM – C or C++ code is converted to LLVM bytecode using Clang.
  • Emscripten – Takes in LLVM bytecode and converts into asm.js.
Let me know your thoughts using the comment section.
If you feel this is quite good thought, spread the word using various social networks by clicking on appropriate icons.
Shameless Advertisement/Promotion… 🙂
Would you like to read a book on Data Lake (Big Data)? I am co-author of a book named “Data Lake for Enterprises” published by Packt Publishing.
You can buy in Amazon here.
If you would like to see more on what is there in this book, please visit the book’s dedicated website here.

Page Visitors: 129

Best way to persuade/communicate – Pyramid Principle

Recently I had a chance to read more on so called “Pyramid Principle”. Thanks to my mentor who wanted to discuss this very topic in my next mentoring session.

When i heard this topic for the first time, to be honest i was thinking of hierarchy in an organization which is often attributed to be of pyramid structure.

When i searched in Google, i got some very good pointers on what exactly this is and that moment itself i thought i should write a quick 100 word blog post on what i understood on this topic for my fellow colleagues.

Ok, coming to the point, the concept “Pyramid Principle” refers to an approach by which you can communicate something to someone, in a more methodical, concise and adoptable (yes, something which others are more happy to adopt) fashion.

Usually these kind of principle (complex as everyone would say.. :)) is employed to higher management who, in general doesn’t have much time with them. To be fair to them, they do process large amount of data and is entrusted to take top decisions under very little time (yes, that’s why they earn more money.. :)).

When you want to communicate something, usually follow the steps as below (advocated by Pyramid Principle):

  • Start with the answer (yes, your first slide can be the answer itself which the management has asked from you). This is often against your usual way of communication, as in the past, you give facts and figures first and then come to a particular conclusion. Yes, reverse the approach for you to be heard and accomplish what you would like to communicate. If the person whom you are communicating, has already parsed good amount of information in past on similar topic, just the first slide would be good enough for him/her to take a decision and move on.
  • After giving the answer, now its time to group things together and get into a bit more detail with very high quality facts and figures. The best way to get your higher management to listen to you is that, the facts should be grouped and it should not be more than three groups (just a rule which has seen success in past – scientifically proven as you can say). Grouping can be done in many different ways and in general can be classified as:
    • Time based – convey according to how it happened
    • Rank based – higher to low rank
    • Structured – break the main one into three main parts and present it

I think now you know why is it called “Pyramid Principle”. If not, what i understood is, start by giving pointed answer to a question (top of the pyramid) and then drill down as needed with more and more detail. The base of the pyramid would contain more finer details with more figures and facts.

The question is, should you use this for higher management only? The answer is, no. It can be even used when you write a simple mail (reply to a question obviously). This can also be used while answering a question from your higher management or even from your colleagues.

Simple, concise and to the point answer is always appreciated. Its a sign of leaders and i would persuade you to practice it right away.

If you like this topic, please share by clicking on various options in this blog post and help spread this.

Page Visitors: 187

Windows Task Manager – Enhanced

Have you felt at any point that Windows “Task Manager” is limiting in functionality? If so, this blog will try to give a solution by which you will have much better details on various programs running on your Windows machine with lots of data at your finger tips.

By the way I haven’t done anything in this blog by myself, rather I would just point to a simple utility which will help you get these details… :).

The tool we will be using is Windows Sysinternals Process Explorer. It is provided as a free download from Microsoft.

Process Explorer:

http://technet.microsoft.com/en-us/sysinternals/bb896653

You will need to download and unzip the Process Explorer package. The application does not have an installer, so unzip it somewhere convenient so that you can launch it when needed.

Complete details on the features of this simple program is detailed in the URL above.

Some screenshots which will make you use this enhanced Task Manager in Windows.

1 2 3 4

Page Visitors: 390

Regular Expression

Its really awesome to see people sharing their knowledge to everyone out there. If you need regular expression while doing a piece of code or while doing a validation in your application, you don’t have to break your head designing this cryptic code yourself. There are awesome people out there who are good at it and they are willing to share this with the world. Recently i had a requirement to look for a particular country’s telephone number scanning through various web pages. I found a tool which does this but it had a generic regular expression for phone numbers. I am not at all good at regular expression and to be honest, i haven’t break my head trying to learn this… :).

Because i am lazy, i thought i will give in a try in Google before doing it myself from scratch. When i did, i found some very useful regular expression, all being shared and kept well in a site below:-

http://regexlib.com/Default.aspx

There is another blog which lists commonly used regular expression, not exhaustive, but worth scanning through for your requirement.

http://www.coffeecup.com/help/articles/regular-expression-examples/

I thought before i am too lazy to share it as a blog post, i wrote a quick blog for other readers.

Page Visitors: 130

How to keep yourself updated with latest technology trends

Its a quick read blog post and will not take more than 10 minutes to read the post completely.

Its very hard to cope with the every changing technology trends and keep yourself updated all the time. The technology also changes in such a fast pace that the things that you learn today cease to exists or gets replaced in a real fast pace manner.

But, we cannot run away from reality and we will have to keep our self update till you are in industry, otherwise, in no time the door will be opened for you to move out of the organization that you are working… 🙂

What i do?

I am not claiming that this is something you should do. Its one of the way what i try to do to make myself updated to some extend with the pace of technology change.

I go and subscribe myself to various RSS feeds, go frequently to some great sites (dzone, javalobby etc.) and look for blogs/articles which deserves a read. Once i decide on a blog post or an article, i first skim through it and see if it is very written. If so i start reading the first paragraph. If the blog really entices me, i try to put a time or save it in my pocket (bookmark application). When i get time, i start reading the blog with a notepad opened side by side. I try putting some notes in the notepad as i read. At one stage if the blog is so interesting, i try to put adequate things in my mind which i can use later on to churn my own blog in this topic. When i decide that the topic is good for me to write a blog myself, i start preparing a draft blog as i read. Things which i don’t know in this case deserves more read and i start googling stuff to get more details. My blog post slowly grows in size but without a structure. Slowly and steadily i try to put a structure to the blog post and start putting more sentences and figures. At the end of my read my blog will have my own content with some good attributions to the content from which i extract my blog. In the meantime if the blog deserves a practical session, i go on trying various tools and put these into practice.

If at the end i feel that my blog is a good candidate to be published and it does give reader a good though explanation on the topic, i put the reference section and go ahead and publish it.

Page Visitors: 1458

Quick Scheduling

Are your partners/friends etc. in different places and doesn’t have a common platform to let each other know of their Yes/No for a meeting? You can use this awesome web application to do it in a very easy fashion. How secure it is, i cannot comment, but if these details are fine to be seen by others, this seems very good option for doing just this.

http://doodle.com/

Disclaimer:- There might be other sites which aids you do just this but this is my suggestion. I am not saying that this is the best solution though.

Page Visitors: 135