Friday, April 17

SVG (Scalable Vector Graphics) and My Knowledge about it.

Today on my commute to work, I was thinking about life, work and my knowledge and realized how little I know from the Ocean full of knowledge out there. So I asked this question, What is SVG? And I was surprised to learn I knew almost nothing.

What I know about SVG? (Don't read, Posting it below just for my understanding. Read blogposts from css-tricks.com or read from MDN)
It is full form for Scalable Vector Graphics. Literal meaning would for a graphic format. Nowadays it is extensively used on the web, mostly as Icons. Since it is a Vector Graphic, the image can scale on any device, any resolution, almost all browsers without actually getting distorted. For example, If you are using jpeg icons, then for a Apple iPad Retina display, you would need to have the image twice in resolution compared to the one you would use for a Chrome browser in your windows machine. However, with the use of SVG, you wouldn't have to worry about having different resolution images.

Also with SVG, you can animate your icons and it would work across multiple devices.

P.S : Spent some time reading through SVG from good articles out there. Posted it below in my own words for future reference.

What is SVG? (Research from Various Internet Websites)
css-tricks.com has it summarized very well. https://css-tricks.com/using-svg/
It is a image format for Vector Graphics. SVG has a small file size and it compresses well. It scales to any size without loosing clarity. You can have interactivity and filters applied to your SVG image. Wikipedia has a very important point I forgot to mention, that it is in XML format (SVG images and their behaviors are defined in XML text files)

How to use SVG in your web development?
You can use it just like how you would use it in case of jpeg and/or png. For example,
<img src=”main_logo.svg” class=”logo” alt=”Company Main Logo” />
And you can give dimensions to this image and it should work fine. This method does not work for IE8 and below and android 2.3 and below.

You can also use it as a background-image in your css, howeveer you need to have background-size css property defined.

Using SVG 'inline”
You can grab the SVG code, if you open it in a text editor (it is in XML format, remember?) and place it directly inside your HTML document and it should work fine.
<div>
  <!--Your SVG Code-->
</div>
The above method has its own pros and cons. Cons being, bloated code, no caching etc.
One of the advantage can be that since SVG is in XML format, you get tag names, inside this tag names you can provide your own classes and then style them. An added advantage of including SVG inline. 
 
Using SVG as an <object>
<object type=”image/svg+xml” data=”your_svg_image.svg” class=”logo”>
Some Logo <!--fallback image in CSS of I think you can even use fallback <img> tag here-->
</object>
Styling SVG inside an <object>
  1. You can use <style> tag inside your <svg> XML file</svg>
    <svg ...>
        <style>
        <!-- you CSS styles here-->
        </style>
    </svg>
  1. You can use an external Style sheet especially only for the type.
    <?xml-stylesheet type=”text/css” href=”svg.css” ?>

More Theory that I found interesting on MDN
Just like HTML, which has header, nav, body, p etc. tags that define a document, SVG has elements for circle, rectangle, simple and complex curves etc. So a SVG consists of a root element with various shapes to build a graphic. The g element is used to group various shapes together.

The latest SVG version is 1.1

SVG Example
<svg version=”1.1”
        baseProfile=”full”
        width=”300” height=”200”
        xmlns=”http://www.w3.org/2000/svg”>

<rect width=”100%” height=”100%” fill=”red” />
<cicle cx=”150” cy=”100” r=”80” fill=”green” />
<text x=”150” y=”125” font-size=”60” text-anchor=”middle” fill=”white”>SVG Text</text>

</svg>

SVG has a grid or a coordinate system wherein it starts from (0,0) from top left of the document. X axis is from top left towards right and Y axis is towards bottom.

Various shapes that can be drawn in SVG are rect, line, circle, ellipse, path where path being very useful to create complex shapes. All this shapes accepts different attributes such as rect expects a x and y attribute with width and height, circles requires cx and cy and r (for radius) attribute, etc.

Apart from the basic attributes, the shape of elements in path is defined by “d” attribute, and the d contains series of commands. Each command is instantiated by a specific letter, for example, “M” is for “Move To”. The “Line To” ie. “L” command helps draw a line, the “H” helps draw a Horizontal line and similarly the “V” helps draw a vertical line.

SVG Example
<?xml version="1.0" standalone="no" ?>
    <svg width="100px" height="100px" version="1.1" xmlns="http://www.w3.org/2000/svg">
    <path d="M10 10 H 90 V 90 H 10 L 10 10" />
    <!--points-->
    <circle cx="10" cy="10" r="2" fill="red" />
    <circle cx="90" cy="90" r="2" fill="red" />
    <circle cx="90" cy="10" r="2" fill="red" />
    <circle cx="10" cy="90" r="2" fill="red" />
</svg>

These are just the basics to get some understanding on SVG. With SVG you can do a lot of other things such as Styling using CSS, Gradients effect, patters, clipping and Masking, incorporating external images, rotation, skew, animation using Javascript, Interaction etc.

SVG has a very good advantage over other methods of using images on the web, however it requires good domain understanding.

Note to Self : I just had basic knowledge of SVG, not sure if that even counts as knowledge, but spending an hour on css-tricks.com and Mozilla Developer Network, I now have some understanding of SVG.

Thursday, April 16

Career development and Growth

This was a very important topic for me and today I had an opportunity to attend a session on the same. Being ambitious, career oriented and hunger for more knowledge is very important. Gone are the days when our parents completed their graduation took up a job and lived with it happily forever after. It sounds simple, straightforward and minimal. No Efforts required. I don't want to judge and I know it must have been damn difficult for them, however I am of the opinion that the earlier generation never thought about Career Growth.

So why is it important now?
Getting a medical or an engineering degree was a privilege in the early years. So the best of the jobs would be filled by only the few. However, now, it is a different ball game. With so many, to profit, Educational institutes and a hell lot of students passing out each year, it is a competitive world out there.

Darwin’s law comes in my mind “Survival of the fittest”. However, now it is “Survival of the smartest”.

With a lot of competition, you cannot just be stuck in a job in your comfort zone and live your life. Within no time, you would find out that employees with desirable qualification, does not matter if they are less experienced, would get wages much higher then you are getting now after serving so many years. Why? Because
  1. Companies are willing to pay for good qualification and desired candidates.
  2. If you don't grow in your career, you are not that important to your company.
How to grow in your career and what I learned by attending the session?
One should ensure they have desired SKILLS and CAPABILITIES.

What are Skills?
As per Wikipedia, A skill is the learned ability to carry out a task with per-determined results often within a given amount of time, energy or both. In other words the abilities that one possesses. Skills can often be divided into domain-general and domain-specific skills. For example, in the domain of work, some general skills would include time management, teamwork and leadership, self motivation and others, whereas domain-specific skills would be useful only for a certain job.

In my case, lets talk about domain specific skills. Front end engineering including HTML, CSS and JavaScript. I plan to take up full stack development and am deeply looking at Ruby on Rails. I also have a game idea which I plan to develop using Corona SDK. I was able to work on one project but I haven't worked on it past 3 weeks. Laziness.

A lot of jibber jabber, right? But that is the truth. Everyday it is a new story in the world of Front End. I have to have knowledge of things. So to get the required skills you can do the following
  1. Read online and be up to date with what is happening around your domain. Lots of blogs and websites. Now that I have gReader app installed, it is become easy. Before, I would regularly visit css-tricks.com, HTML5 weekly, JavaScript weekly and during work sometimes I would listen to shoptalkshow or the 5by5.tv.
  2. Practice what you learned.
  3. Take up certifications whenever possible. I had taken a w3 CSS certifications a year back, which was a complete disaster because it took me two attempts to get certified. I am looking at the PMP certification and also Microsoft's HTML5, CSS3 certification. As and when I get to know more about them, I will update on this blog.
  4. Participate in online courses such as Coursera, edX, udemy etc.
  5. Write what you learned. Blogging really helps. It forces me to write and then helps me remember for a long time. Also, I like to write so that is that.
  6. Teach, you can take up teaching others, become mentor etc. Really helps, trust me. (That gives me a good blog post idea about my teaching experience.)
What is Capability?
Let's say you've worked hard to get the desired skill sets. But what next? Are you capable of taking up that job role? Would you be able to take complete ownership of a project, can you be a leader and start making decisions? Can your team mates, people around you trust you? You may be wearing those shoes because you have the desired skills, however are you capable enough to take complete your tasks with those skills?

As per Wikipedia. A Capability is the ability to perform or achieve certain actions or outcomes through a set of controllable and measurable faculties, features, functions, processes or services.

How can you know your capability?
The most important aspect is “Communication”. You are, the way you communicate. Can you get your thoughts out your mouth and into someone's ears? You should know how to Network, ask for help, of course without wasting anyone's time. If you want to grow in your career, you need to get up and show that you are really interested about it. Talk to people, your network, your manager, anyone but make sure your goals are inline to what you are doing and that you have communicated them well.

For example, down the line if I want to take up a managerial position, then first thing that comes in my mind is if I am a good spokesperson. Can I communicate well? I can take that PMP certification and clear it, so I have the desired skill set, however am I capable?

So basically, it all boils down to how you present yourself, are you working towards your goals and are you capable to handle any different but desired role? And to be capable of anything, you should get up and start involving yourself into things that matter. Start from small, but get a live feel of things around. Take up ownership, start teaching what you learned, participate in events that occur in your company, network and most important, try to communicate your mind.

Who is your Inspiration?
This is a very important question and I had a perfect answer for this. When I have to look for inspiration it is M.D (A colleague). True, organized, has good domain expertise and he is the best. I look down upon him for all the positive energy and whenever I have a doubt, a question, I keep M.D in that situation and think what he would have done.

So we have our colleagues, teachers, parents, Manager, HR people etc around us that we look up for an inspiration. However (I learned this in the training, and it is very much true, I feel), the most person who shapes you is “I, Me and Myself”. Yes, it is you as your own inspiration, your own mentor, teacher and the people around you are there just to trigger, boost, accelerate your thoughts. Sounds strange, but I feel it is the truth.

Saturday, April 11

Important Points - Front End Development - Things I wish I had told the 5 years earlier me.

These days Front end is become an essential part of IT industry because everything is getting online. The responsibilities of a Front End developer have increased exponentially. I remember during my earlier years, a designer would write the HTML and CSS, but now we have a department in every organization with such expertise. And as front end developers we always have to keep ourselves informed with the latest. As uncle Ben would say, "With great powers, comes great responsibilities", and I totally agree to it.

Enough of all the exaggeration, this post is basically what I would have said to the 5 year earlier me.

1) Write Code.
2) Don't just read, but write more Code.
3) L:earn to use version Control and upload all your code to Github.
4) Learn to write documentation of your code on Github. Write simple to follow steps for how to install and configure your software. Make everyone's life easier. This also includes you, because down the line, somewhere in future you would want to revisit your code.
5) Have yourself ask and answer questions on Stackoverflow.
6) Earn certifications in Coursera and such educational websites.
7) Have IE as a major testing browser, when working on projects.
8) At start of the year, make goals and have yourself at least 5 Side projects assigned to you.
9) Important point, document everything. I had read somewhere about this and I am trying hard to follow it. However the point here is, if you learn something exciting, no matter how small it is, try to document it somewhere, may be online in your blog or in a book. Writing what you learned always helps you and keeps you a step ahead. You tend to remember things easily if you had made some attempt in documenting it. In case you don't remember the specifics, you at least know where to look for it.
10) Have a blog and regularly update it.
11) Read and Repeat. Go to Step 1.

Keep learning, Keep Rocking!!!!

Saturday, April 4

FrontEnd feeds and gReader App for Android

I was a big fan of Google reader and I had subscribed to awesome websites for my daily dose. After the sudden shutdown of google reader, I tried many other feeds reader but was not actually satisfied.

Recently I came across gReader app for android. I loved it. Apart from that the 5inch phone helps me scan through articles easily so it isn't a eye strainer. Subscribing to the websites one at a time would have been tedious, but I remembered that Paul Irish had created an OPML file of the best of the best frontend feeds. And the best thing, gReader app allows to import the file. Bingo!


While trying the import, it failed. I wasn't sure what was the reason, until after trial and error I figured out that the main reason was grouping of the feeds in the opml file. Paul Irish had grouped feeds, and this format was not being accepted by gReader. I than found a github repository of frontend feeds by impressivewebs which is an extension of the work done by Paul Irish.

Thanks to all the hard work already done, I forked a copy of the xml file and did minor changes to accommodate for gReader app. You can get find the xml file here.



What did I learn?
1) How to fork existing code in github, get a clone of it on your computer and push back the changes to your repository.
2) gReader App, some trial and error and a little digging into the issue, some passion and a wonderful experience.

Monday, March 30

The Optimist - One man's search for the Brighter side of life - Lawrence Shorter

This book looked promising and I had to read it during the summers. The Title was exactly what i was looking for subconsciously. As the title suggest, the book is a straightforward journey into finding what optimism is? If i have to sum it up, it is a big book of great quotes, however I've realised that it there is no path to being optimistic. Initially i thought there will a set of rules, following those would help a person attain the highest level of optimism.

I must say, the pessimist in me has welcomed the new optimistic. I for now am looking at a brighter side of life and some of the things that are mentioned in the book actually are useful which I have started applying in my day to day life.





Below are all the beautiful quotes that I would life to mention here for my future reference. 

Bad news had left me unscathed. I was an optimist, and I was proud of my ability to ignore events and carry on as if everything were fine. That was the privilege of optimism. Deep down if you're an optimist, you know that everything is going to be OK. You don't know why - you just know. It's like your little secret.

First law of optimism : The more optimistic you are, the better life gets.

It was midway by the time I walked out of the house. I didn't know where I was going, but I was ready. I was glad and, for the first time in weeks, I felt full of optimism.
Confidence is the feeling you have before you understand the situation - Anonymous
The pessimist were a terrible and inscrutable enemy. Even though we lived in the most wonderful and fortunate period of human history, there were still people out there addicted to negativity, who made it their task to spread fear and anxiety.

Ashley judd believes that suffering will always exists. She's learned to accept that.

Accepts yourself and accept the negative. God is love, so if we do loving things, be loving , love ourselves and let the love for ourselves emanate out, that will set us on the path to finding the peace and serenity that is possible in this lifetime.

The atmosphere felt monastic and peaceful, far away from the chaos and stupidity of the outside world.
There is nothing either good or bad, but thinking makes it so. - William Shakespeare, Hamlet.
Learned Optimism - Martin Seligman
Each of us has our 'explanatory style' a way of thinking about the causes of things that happen in our lives. The basis of optimism does not lie in positive phrases or images of victory, but in the way you think about causes.

Optimism comes down to three things : When something bad happens do you
1) Take it personally
2) Expect it to last forever and
3) let it affect other areas of your life?
If so, then you're a pessimist.

Seligman - We've found that happiness is measurable and that there is a formula for this...
Life satisfaction  = Positive Emotion + Engagement + Meaning.
There are shortcuts to positive emotion, but there are not shortcuts to engagement, The engaged life is when you're totally absorbed in what you're doing and it comes when your highest challenges meet your highest strengths. There's also meaning. Human beings ineluctably want meaning and purpose in life, but this only happens when you use your strengths to serve something bigger than yourself.

Scientific technique for raising human happiness. Three blessings Exercise :- Every night before you go to sleep, write down three things that went well today. It turns out that building gratitude is one of the main ways of developing happiness.
The three blessings is an intervention for increasing positive emotion about the past. Optimism is related to emotion about the future.

when you're a pessimist you give up easily, when you're an optimist you try. Pessimist just have different thoughts about adversity.

Pessimists have habits of thought, which mean that they interpret failure very negatively. These negative thoughts then create feelings of helplessness, which in turn feed depression. Pessimist tend to take bad luck personally. They see bad events as a reflection on themselves. They also tend to assume they're going to last forever and they're going to affect all parts of their life. But if they can learn to question and dispute those thoughts, then they can shift their explanatory style from a pessimistic one to an optimistic one.

Can pessimism be cured?
It's a training. You can teach yourself to recognise the negative thoughts you're saying to yourself before you start believing them. You become an expert disputer of your own beliefs.

Seligman says it's not our problems that makes us depressed. It's our thoughts.

Human beings ineluctably (not able to be) want meaning and purpose in life, but this only happens when you use your strengths to serve something bigger than yourself.

Saligman -Author of Learned Optimism, provides the following tip :-
Stand up and slam the palm of your hand against the wall and shout 'STOP!' This is one of several simple but highly effective thought stopping techniques used by people who are trying to interrupt habitual thought patterns.

Achieving enlightenment is every Buddhist's goal. It means an end to suffering, a state of bliss.
Buddhist don't believe in God. They only believe in supreme consciousness. All entities including the self are an illusion. The only way to avoid suffering is to escape from all human attachments.

For an optimist, it makes no sense to lose hope. We can always do better (instead of being devastated, resigned or disgusted), limit the damage (instead of letting it all go to pot), find an alternate solution (instead of wallowing pitifully in failure), rebuild what has been destroyed (instead of saying 'it's all over!') take the current situation as a starting point (instead of wasting our time crying over the past and lamenting the present), start from scratch (instead of ending there), understand that sustained effort will have to be made in the best apparent direction (instead of being paralysed by indecision and fatalism), and use every present movement to advance, appreciate, act and enjoy inner peace (instead of wasting our time brooding over the past and fearing the future).

In creative visualisation you use your imagination to create a clear image, idea, or feeling of something you wish to manifest. Then you continue to focus on the idea, feeling, or picture regularly, giving it positive energy until it becomes objective reality.
"The question is, when did you stop growing? When did you stop having those Aha! moments? And that's the moment you died. Most pessimist are the walking dead. It doesn't matter that they breath and they get up and eat. They are dead" - Taddy Blecher.
What education means?
The word education came from the Latin 'educare' - to lead out. It meant leading out the genius out of heavy human being, the beauty in everybody.

We live in a field of infinite possibility. We just have infinite possibilities for creating solutions to the problems we have.

Transcendental Meditation is an easily learned, natural mental technique which opens the awareness to the infinite reservoir of energy, creativity and intelligence that lies deep within everyone. Whatever you believe in, whatever system you follow, what matters is that you do it.

Transcend the boundaries of fear.
Somewhere in your heart is a powerful voice which is telling you what you should be doing. If you an break through the boundaries of fear and just listen to that voice, then everything will be beautiful, or listen to the voice, then break the boundaries. It doesn't matter which way around you do it. If you have problems hearing the voice then you can meditate, although this is only necessary if you have a tiny narrow awareness of life and you absolutely need it.

Today Blecher didn't spend hours alone with his computer, sending emails to celebrities and making notes in his diary. He worked with other people, lots of other people. That's where he got his energy from.

Since the beginning of time people have been trying to change the world so that they can be happy. This hasn't ever worked, because it approaches the problem backward.

Most people are at war with reality. They are never at peace because they believe their thoughts and their thoughts do not accept what is and so they suffer.

When I believe my thoughts, I suffer, but when I question my thoughts, I don't suffer.

Stress in your life is caused only by one thing, your reaction to not getting what you want.

My philosophy of life is that everything that happens to you happens for the best. In other words it's impossible for you to make a mistake.
"The terrible has already happened" - Heidegger
Power of acceptance - Forgive them, they don't know what they do.

In trusting there is a power to see clear, a power to be able to see in the future.
The most intelligent thing you can do is to appreciate everything, no matter how bad it is. It won't take long before life will give up. It will adapt to your mind and deliver only good things. - Marbel Mohr.
The universe always acts in your best interest and always brings into your life exactly what you need at any instant...

Everything in life happens to confront you with some deep inner fear. So that you can let go of it. But you can't let go of things before you know them. The process is about facing deepest beliefs and emotions.
"Screw it, let's do it : Lessons in life - Richard Branson"I have found that, if I have fun, the money will come. I often ask myself, is my work fun and does it make me happy? If something stops being fun, I ask why? If  can't fix it, I stop doing it"
When you have goals and positive outlook on life, you have something to aim for.

Richard Branson
What drives me is being in a position to change things, to keep learning and to be in a position to make a difference. Throughout my life I've been trying to get into that position, and now I'm in that position I don't want to waste a minute of it. But I also have an attitude in life that however hard I'm working and however tired I am, make sure I enjoy every single second of my life, and if you just make sure you enjoy every person  you're with and every second of your life, the pleasure you're going to give other people is enormous.

True optimism is about following your heart. It's about visualising things and letting them flow effortlessly into your life.

Fear of pain is so much worse than the pain itself.

Notes to pessimist
Gottfried, wilhelm heibniz (1646 - 1716) :-
Everything is perfect because - mathematically - nothing is this world could be any other way. For similar reasons, anything that can happen will happen.

Buddha :-
Suffering is causes only by believing painful thoughts. Life will keep presenting you with situations until you finally stop believing them. Everything that happens to you, happens because you 'need' it.

Viktor Frnkl (1904 - 97) :-
If you are afraid of something, its much more likely to happen to you. 'Fear brings to pass what one is afraid of'. Suffering is an achievement in its own right.

"The law of attraction" states that like energies attract. Therefore whatever we think about the most we will experience.
"We have found that merely repeating positive statements to yourself does not raise mood or achievements very much, if at all. It is how you cope with negative statements that has an effect. - Martin seligman
If you can break things into bite-sized pieces you can handle anything.

Realism consists of accurately seeing the probabilities of a good or a bad outcome, then accepting this reality. But true options consists of accepting the risks and then doing it anyway.

Dr wong was a chinese psychologist who had developed a radical new approach to optimism.

Tragic Optimism :- Tragic optimism is an attitude, and its defining characteristics is acceptance of reality. To develop tragic optimism you need some kind of spiritual belief, a religion, something bigger than yourself.

Optimism and Pessimism are two related but independent dimensions.

Tragic optimism means admitting that life is tragic but still maintaining the hope that tomorrow will be bigger.
We know that bad things happen most of the time, but also life is worth living. It doesn't matter how bad things get, there's still something worth living for.

"So many people say they can't make a living, can't pay the rent - but I've tried it myself and I think if you're willing to work hard there's plenty of work out there. I'm willing to drive a truck, I'm willing to do laundry, I can go shopping for you and I'll go walk your dog. You can still make a decent living. I'm very optimistic.

If you want to get filthy rich, you might have an impediment (something that makes it difficult to do or complete something, something that interferes with movement or progress) wants to work hard I think the sky's the limit.

"Yesterday I met a man who suffers from insomnia. When he wakes up in the middle of night, sweating, unable to sleep, clogged by worries about his career or his children, he writes them down and puts them in a jar. Then he screws the lid and places the jar on top of the bookshelf, far out of reach. Once a week he allows himself to schedule a meeting with the worry jar. They get half an hour of his time and that's it. At the end of each year he invites his friend around for a party and he burns the jar."
"That thing the nature of which is totally unknown to you is usually what you need to find, and finding it is matter of getting lost - Rebecca solnit"
Craig newmark - founder of craigslist.
What makes me optimistic in a big way - by following through with principles, giving people a break and treating others well, somehow we have created a culture of trust with the community.

Optimism is a lot of things. The most important thing I've learnt is that none of it matters at all. Not even a tiny little bit.