The Power of Habit

The Power of Habit

I started reading Intro to Psychology in online course and looking for something to read and got this book from my friend “The Power of HABIT”. He said it is about psychology of our habit and why we do it. So I got interest in it. Where I never read a full book before, other than academic (even academic we use to read important topics). This book made me to read fully.

HABIT – Why we do, What we do and How to change.

Power of Habit books show case that how Habit occurs and how to change it. It contains in three different areas of Habit of Individual, Organization and Society

Habit of Drug addiction can be changed, by set your focus on some other goal.

Our 40 % of daily activities are Habits. By understanding how it happens, you can rebuild  those patterns in whichever way you choose.

Changing Habits is possible. And now we understand how. We now know why habits emerge, how to change, and the science behind their mechanics.

 

The Habits of Individuals

1. The Habit Loop – How Habits work:

Story about Eugene Pauley (E.P) and Henry Molaison (H.M) famous patients in medical history. Removal of infected brain part “Hippocampus” resulted to memory lose. But still they able to remember the habits they learned and able to learn new habits in the medical research. When researching E.P, he doesn’t know where the kitchen is, but able to go by himself to take-up some nuts for eating.

Basal Ganglia – responsible for store the habits and igniting it. It placed in center of the skull, golf ball seized tissue. ( In head of fish, reptile or mammal)

Outer parts of brain works for most complex thinking tasks ( laugh for jokes, new invention). Deeper inside the brain and closest to the brain stem, where brain meets the spinal columns is used to control our automatic behaviors ( breathing, etc..)

MIT research lab, they took a rat and placed sensors inside its brain and put it into a maze ( T shape maze, where one side of T contains chocolate). After a week of repeating this maze to that rat and when we see the brain activity, its decreased.

When we repeating things, it gets to basal ganglia and our other parts of brain be silent to do those tasks.

Chunking – Our brains coverts a sequence of actions into a automatic routine.

Without habit loops, our brains would shutdown, overwhelmed by the minutiae of daily life. People whose basal ganglia are damaged become mentally paralyzed. They trouble performing basic activities.

We don’t realize how habit occurs (ex: eating at fast food, start once a month and becomes like twice a week). But still habit break off when a slight change occurs in it. (What happens when the fast food shop closed, we start eating at home, instead of searching new shop).

2. The Craving Brain – How to create new habit:

Story of Claude C. Hopkins – Advertisement consultant who is reason which due to his advertisement many companies are now having popular brand name.

“My life in advertising” book

Pepsodent – Brushing is not a habit in 1900’s, where due to his advs, now the company pepsodent being popular and brushing became a habit.

Cue – Routine – Reward

Cue-Routine-Reward-pic

Habits created, which should be satisfied. Or Some of habits or routine is bored and will lost.

It’s all about Craving brain. Whenever we see a food item or chocolate, it automatically craves our brain to eat.

 

3. The Golden Rule of Habit Change – Why Transformation Occurs:

Tony Dungy – NFL Coach joined in a hopeless team.His coaching philosophy.

“Champions don’t do extraordinary things”. “They do ordinary things, but they do them without thinking, too fast for the other team to react. They follow the habits they’ve learned.”

Bill William – A drug addict turned to God (when he feels the spirit in one night and became a free man)

Bill didn’t read academic journals or consultant doctors, but founding AA. AA 12 steps.

Keep the Cue, Provide the same Reward, Insert a new Routine.

A disaster or life changing moment also helps people to change their habit or routine.

Electronic device in basal ganglia, turn on when crave occurs.

New routine will fail in stressful times.

If belief, in God or anything that helps to come out of a stress.

Believe -> comes from any life changing disaster or moment.

 

Habit of Successful Organizations

4. Keystone Habits, Or the Ballad of Paul O’ Neill – Which Habits Matter Most:

Alcoa – Aluminum Company of America (largest on earth)

New CEO – Paul O’ Neill

Employee Safety is the first rule he announced on his first meet

Change in One Habit, which automatically results change in other behavior

Due to change in the safety rule, the company employees feels the change in company and bought so many ideas and company back to top.

If you need a transformation, you can’t order people to change. So Decided to start focusing on one thing. If I could start disrupting the habits around one thing, it would spread throughout the entire company.

Some “Keystone habits” have the power to start a chain reaction.

To solve any problem go to the bottom of the problem and you will find the solution for it.

Exercise is one of the Keystone habits which make changes in our other behaviors.

Small Win” – in habits help other habits to flourish by creating new structures.

Keystone habits to remake workplace

 

5. Starbucks and the habit of success – When Willpower becomes automatic:

Travis – whose parents are drug addicts and he cannot stay on job for long, because of his behavior to customers.

Starbucks recruited him and after the training he is totally changed. So soft and care on customer.

Starbucks – training program teaches the life skills, one of the largest educators.

At the core of that education is focus on important habit – Willpower.

Self-discipline has bigger effects on academic performance than does IQ talent.

Willpower is learning skill which needs to be habit

Willpower linked with our self-regulatory.

KIPP – Knowledge is Power Program

Writing the booklet or notes helps more on what we are doing and more control. Self-discipline increases.

 

6. The Power of A Crisis – How Leaders Create Habits Through Accident and Design:

Habits aren’t deliberately planned, can create accidentally too.

An Evolutionary Theory of Economic Change – 1982

Accidents and Critics made leaders or organization to reorder or change the behavior.

Ex: Rhode Island hospital (Nurse & doctor fight) – Mistakes in operation made patient died

Kings’s Cross subway station – Departments fight – Fire on subway.

 

7. How Target knows what you want before you do – When companies Predict (and manipulate) Habits:

Target – Retail Shopper

  • Search habits of customer from shopping data and buy data from 3rd party.
  • Data collection through guest ID, debit, credit card, online, cookies.
  • Create personalized discounts for the customers.
  • Target was assigned Pole to analysis and get Pregnant women and send them discount products and in future they to send discounts on baby products.
  • In order to avoid customer doubt on shoppers about their tracking, Target send discount on mixed products, in a way customer won’t find any doubt with the advertisement.

Polyphonic HMI’s database – AI experts & statisticians – program Hit Song science.

But a song was not hit in radio station, where people change stations when this song comes. But it was rated high in AI program.

Researcher try to find a reason or idea to make this song hit.

Rich Meyer – Media base – analysis on sticky songs – Where people won’t change their radio station, even they didn’t like the song

Sticky songs – familiar – on genre – People even dislike, subconscious feel the familiar

We choose song like or dislike on mental effort. But most time sounds familiar – like and hear

How to make the song familiar

Play other two familiar songs before and after this, which makes people familiar and hear it.

Whether selling a new song, new food, the lesson is same. If you dress a new something in old habit or familiar, it’s easier for the public to accept it.

 

The Habits of Society

8. Saddleback Church and the Montgomery Bus Boycott – How Movements Happen:

1950 US – Racism (black and white)

Rose park – lady – bus incident, become social habit and protest

Park relation friend with field hands to college professors. That made to join big group of people to fight, when she ended to jail

  1. Weak tie – Close-tie friends
  2. Peer Pressure or Persuasion

Saddle back Church – Warren and McGavran

  1. Ministers needed to convert groups of people rather than individuals
  2. Teach them the habits of faith – then they become self-feeders.
  3. People follow Christ not because you’ve led them there, but because it’s who they are.

 

9. The Neurology of Free Will – Are We Responsible for our habits?

Sleepwalker or sleep terrors

While dreaming, our body will not react. But to sleepwalker, they unconscious but do things what they dream

“All our life” – William James – Unsuccessful in life. Make a decision one day to belive in Free Will

Charles Renourier

“Do things difficult at first time, but soon do it more and more easily, final with sufficient practice, do it semi-mechanically or with hardly any consciousness at all”

If you believe you can change – If you make it a habit – the change become real. This is real power of habit

David Foster in class

Fish to other fish – What is water?

The water is habits, the unthinking choices and invisible decisions that surround us every day – and which, just by looking at them, become visible again.

The principle of Psychology – William James

Water – “hollows out for itself a channel, which grows broader and deeper; and, after having ceased to flow, it resumes, when it flows again, the path traced by itself before”

You now know to redirect that path. You now have the power to swim.

 

 

  • Routine – The habits you want to change
  • Rewards – Relax, Not hungry, Saw flowers. Satisfy the craving
  • Cue – Identify the category
    1. Location – Where are you?
    2. Time – What time is it?
    3. Emotional State – bored or happy
    4. Other people – Who is around?
    5. Immediately preceding action – What action preceded the urge?
  • Plan

 

This blog contains only the notes what I have taken. Hope you got something on Habit, How it works and How to change it.

 

Courtesy: The Power Of Habit book. Read the book to get whole idea in good manner, which contains all chapters and concepts with real stories.

Advertisements

Intro to Psychology – Part 2

 

In part 1 we have seen about the Psychology, brain and behaviors. But there a lot of topics waiting for part 2, which will be more interesting ones like learning, memory, intelligence. So lets get started with Learning.

1) Learning

Learning is enduring change in behavior that occurs with experience. There are three types of learning Classic, operant and social learning.

a) Classical Conditioning:

Reflex – unlearned, automatic response (cough, eye blink)

Acquisition – Pavlov and dog (bell – meat – dog saliva)

Conditioned taste, smell – Some taste, smell make us ill.

Schedules of reinforcement – ratio, interval

b) ABC of Operant conditioning:

Sealion – training to kiss and dolphin show

Reinforcement and punishment are the basic keys to make learn.

i) Reinforcement – to increase a behavior. It can to +ve or -ve (by adding/removing something in environment)

ii) Punishment – to decrease a behavior

c) Social Learning:

If somebody do something and get a reward, we also like to do the same, so that we also will get a reward.

Bobo doll study, What we see on the social and gets a reinforcement, will do the same. (Watching television)

Brain and learning:

So how much you learn and practice, that much you brain neurons involved fired, wired and strengthened. When you stop learning, neurons become weaker and see a memory lose.

psy-learning

 

Long term learning makes our neuron stronger and growth, becomes change in brain.

 

2) Memory:

H.M – Henry Molaison, one of the famous patient in brain study for nearly 60 years. Few years ago he died and his brain was contributed to UCSD university for further study, which they sliced into 2400 slices.

H.M was affected by siezures due to some problem in Hippocampus. Because of his struggle in siezure nearly 10 per day, doctors decided to remove his hippocampi. Which solved his problem and came to know that his is not able to remember anything.

Hippocampus –  plays important roles in the consolidation of information from short-term memory to long-term memory

There are many types of memory which our brain deals on our life.

a) Sensory memory –  During every moment of an organism’s life, sensory information is being taken in by sensory receptors and processed by the nervous system.The information people received which is stored in sensory memory is just long enough to be transferred to short-term memory.

b) Short-term/working memory – listening, reading (practice to make long-term)

c) Working memory – day to day activities

d) Chunking – acronyms or 5-7-9 digits make easier to remember

e) Serial position effect – remember begin and end items of list

f) Long-term memory:

While short-term and working memory persist for 10 – 30 seconds, Long-term memory remain for indefinitely.

There are different sub levels involved to store the long-term memory

    • Episodic memory – biographic things
    • Semantic memory – general knowledge or facts
    • Explicit or declarative memory – abt past (both episodic & semantic)
    • Implicit or procedural memory – knowledge on previous experience
      • Riding cycle, swimming

There are four step for long-term memory:

    • Encoding – Attention, take it in, process info. More deeper the better we can recall. Mnemonic device – rhyme or acronym
    • Consolidation – Process of establish, stabilize our memory – sleep
    • Storage – Hierarchy, Schema, Associative network
    • Retrieval – recall the information.

g) False memory – memory will change the situation.

Lets take a Car accident, if police asks different words, ways of same questions to each witness, we use to get different answer. Becoz mind changes.

h) Forgetting and memory loss:

Interference – due to new information we learn, use to forget previous memory

i) 3 distinct long-term memory systems.

    • Cerebellum and Striation – Learn to do things such as implicit procedures
    • Amygdala – Experiencing emotional events.
    • Hippocampus – We Concioussly and explicitly remember personal event or trying to recall answer to an essay.

j) Emotion in memory – play key role of storing info in long-term memory.

2) Language and Thoughts

a) Stages: Lang Comprehension (understanding) and then Lang development (production)

b) Initial stage of child development – not learn (lang), window of learning closes and become very difficult to learn.

c) Hart and Risley theory (functional approach): Professional, middle-class, welfare family – decrease in learning lang, speaking, praising or positive words

d) Chomskys (Structural approach): comes of naturally

e) Thoughts:

    • Mental representation – structure in mind, like idea, image
    • Mental rotation – Concept, category, prototype
    • Reasoning – Deductive reasoning(straight forward), Inductive reasoning(stmt diff from people)
    • Critical thinking
    • Metacognitive thinking – first think and reflect on one’s own thinking
    • Judgment and decision making

3) Intelligence:

Intelligence is ability to think, reasoning, problem solving, learning, from experience.

Single ability: Intelligence on single ability, Where Math, Lang, spatial – related ( 1increase other also increase in scores)

Multiple Intelligence : There are 8 types of intelligence. Math, linguistic, spatial, music, bodily, intra, interpersonal, naturalist

Measuring Intelligence:

IQ test: result mostly on academic not for real life (happiness)

Stanford Binet test: IQ nature vs nuture. Gene or family plays less percentage of role in Intelligence, Where nuture or environment makes our intelligence.

Creativity: Is not on intelligence. Thinking out of the box.

Problem solving: Intelligence and Creativity helps on problem solving.

4) Motivation and Emotion:

Motivation:

  • Drive reduction model – body auto change respect to environment
  • Hierarchy of needs: Physiological ( basic needs like food, sleep, Safety, Love/Belonging, Esteem (Confidence, achievement), Self-actualization (creativity, problem solving)
  • Rejection
  • Achievement motivation – desire to do things well and overcome obstacles
  • Extrinsic motivation – motivate others by giving rewards (have opposite effects)
  • Intrinsic motivation – comes from within person (challenge, enjoyment, mastery)
  • Motivation to eat – Insulin (glucose to blood and stop hunger)

Emotions:

  • Moods – longer lasting experience
  • Emotion – short exp to mins
  • Affective traits – permanently
  • Pride
  • Emotion expressions – Charles Darwin
  • Facial expression change our mind and emotions (it may be fake too, it chg our emotions)
  • Emotion thro voice – can control facial expression, but not voice on emotions
  • Amygdala – brain that control emotions
  • Culture changes emotions
  • Make positive frozen in your face brings positive energy into you.

5) Stress and Health:

Stress:

  • It couldn’t take it up to the mind easily.
  • As stimulus – event or situation that trigger stress
  • As response – physiological change
  • Cortisol release which affects the brain and cause the interfere to memory. It should stop in sometimes, otherwise the stress makes more chemical emit and cause damage to our brain.

Handling stress:

a) Problem-focused – change situation or solve problem
b) Emotion-focused – changing or regulating one’s emotional response (social support or sharing)

    • Reappraisal
    • Escape-avoidance
    • Self-control
    • Seeking social support
    • Emotional disclosure

c) Emotional disclosure – to write or talk about stressful situation
d) Meditation, exercise
e) Smoking – stimulant (raise level of nervous system)
f) Drugs – Depressant (reduce functional nervous system)

Health psychology

  • Physiological reaction model – bodily changes to illness
  • Health Behavior Approach – diet, exercise

Immune system:

  • Type of defense
  • Natural immunity
  • Acquired immunity

6) Personality:

Big Five or OCEAN:

a) Openness to experience – try new things or curiosity
b) Conscientiousness – careful and planful
c) Extraversion – social, open, no shyness, taking risk
d) Agreeableness – carrying, friendly, compassion, warm.
e) Neurotics – fear, sadness

Personality comes from nature and nurture
Environment influence more on non-family (non-shared – friends, teacher, role model) rather than family (shared)

psy-personality

 

 

There are some more topics contains more deeper content, which I like to skip. With this am ending  my Intro to Psychology blog.

Courtesy: To Udacity online course.

Intro to Psychology – Part 1

 

I get involved too much in Psychology now a days, let me start with my story of how I entered into this area.

I just enrolled into Machine Learning online course in Udacity. Where the course started awesome, but while moved on to next chapters lot of math getting involved in it and of-course we never used math in real world and become difficult. So I gave up and upset on me. And due to lot of  things which disturbs my mind, I started searching some other course in Udacity, and that’s where I found this course “Intro to Psychology” and I enrolled in it. Basically Udacity courses are not a lengthy videos to make people bored, rather it have 2-5 mins clips of explaining each modules or topics which makes us interest and learn. That how I started Psychology and finished the course, so I thought will have the important points of what we learned in my blog, which will make some progress in my blogging and also it refresh on this topics.

 

Introduction to Psychology:

As most of people having common idea on psychology and myself too had same thoughts that “Psychology deals only on reading peoples mind, clinical – patients on mental problems or depression, crime”. But when I started this course, I learned that psychology is dealing on vast area.

There are lot chapters in this course. So let me write about few chapters here and rest I will continue on next parts.

Psychology – Study on how people react or behave. Study about the mental function and behaviors.

1) Types of Psychology:

  • Cognitive – Mental processing. How our mind or brain processing things like memory, decision, solving problems, language.
  • Behavior
  • Development
  • Biological – Neuroscience
  • Personality
  • Industrial/Organization – Motivation, Productivity
  • Social
  • Forensics – Crime
  • Clinical

So the above list are the areas where Psychology is dealing. We will see each topics on future chapters.

 

2) Biology of Behavior:

Behavior comes from lot of aspects. So let see how biologically the behavior happens because of our brain.

DNA – comes from parental DNA and it is unique because of the formation of DNA strands by A, G, T, C  – four chemical parts.

Gene – (Genome) encoded in DNA which regulating expression of genes. Due to these expressions from gene our  behaviors comes out (so as differently as  gene is differ from each other)

But our brain development is affected not only by Gene, but from Gene and Environment (surrounding we grow up). So our behaviors are from both our Gene and our surroundings.

Epigenetics:  Expression affected by environment, gene or sequence will not change. So because of this, due to our environment change our behavior also changes.

So before getting deep into our behavior, let see how we react and brain works.

 

Nervous System:

Our nervous system contains two parts Central and Peripheral.

Central NS: connects the brain and spinal cord.

Peripheral NS: Connects other parts which works somatic and transmits sensor to brain.

Neurons:

Our brain activities and our body response are full of neurons. It helps to process and transmit information to brain.

Sensory neurons: to pass the sense information to brain

Motor neurons: message from brain to move muscles

Inter-neurons: connect neurons, where neurons communicate each other by transmitting electric signals.

Brain:

As we already learned in schooling that brain contains many parts, where each helps to do something in our body (like memory storage, control heart and other parts)

We can read the brain activities by EEG, PET Scan or MRI. And there are lot other equipment’s to do that.

 

3) Sensation and Perception:

Weight and Threshold – We will feel the weight difference of threshold is above 3% weight. (For Ex: If you hold two same cups one in  a hand, and you feel the same weight. Lets pour 10ml of water in one cup, still you will feel its in same weight. You will feel the weight difference if the threshold is more than 3% of another weight).

Physical and emotional pain activates same brain cells. Which is why we feel equivalent pain in us when we physically hurt or emotionally.

Human Senses:

1) Taste:

To identify the primary flavors, chemicals in our body helps to identify the taste and smell. There are 10k taste buds in our tongue.

2) Hearing:

Everything we can hear on our limits in hertz and decibels. Dogs can hear more hertz than human. Human (20 – 20k hertz)

3) Sight

We can see clearly when the light waves hits our lens and connects exactly at retina or sensors. If it merges before or after, then we gets near or far sight problems.

We see different colors on its wavelength freq. Each color has it wavelength freq. And we see colors due to cones in eye, which has sensors of RGB color. So we see all the colors from RGB combinations.

Depth Perception:

How far the object is from us. We identify the object size, distance all by our binocular cue (2 eyes process the image). Jumping thumb ( by closing one eye and we see jumping thumb)

5) Development:

Let see how Development of our brain is as we grow.

a) Brain develops and behave on Nature and Nurture – Gene & Environment

b) Brain works through neurons. So it creates million on neurons, more on earlier stage of our childhood and it slows down. If brain neurons are not used and it will be dead.

So everyone have more capacity to works with brain and think, where we need to really do homework to make our neurons busy and active.

c) Growth and creation of neurons needs good sleep. That why for first few years children need good sleep.

d) New born babies hear more than the vision. So for first few months babies will have blur view of us and identify and react through hearing.

Child growth is a separate vast topic, which will learn later in life when needed 😛

 e) Social development:

People expects and needs secure and relationship attachment. Bowlby attachment theory – People need attachment which makes them secure and relationship.

Research explains that new born Babies on ICU incubator. Group of babies got cured and out of ICU soon and other babies got cured slowly. Difference is that cured babies are daily touched or cared by some people which makes them more secure and got them cured quicker.

f) Cognitive Development:

How our brain think, process and react.

Intelligence is on two types:

    • Crystallized intelligence  – what we learned from experience, learning and education ( problems what we seen before in life).
    • Fluid intelligence – Solving new problems, makes our brain to think and process to solve the problem. (at aging it decreases). At 60’s we start losing mental thinking.

6)  Consciousness – responsive/perception to surroundings:

a)  Coma & Consciousness – Aware of what is going on and react or not aware and not able to react. Consciousness of people vary on time, sometime we maid be fully aware or sometimes we din’t aware of our surrounding

b) Wakefulness & Awareness:

Wakefulness – Whether we are awake or sleep

Aware – Whether we are aware of surrounding, environment

psy-wake-aware

c) Tip of the Tongue (TOT) – failure to retrieve word from memory. We are wake but slightly unaware.

d) Comma (no aware, no wake) – Vegetative state (wake, no aware)

e) Cock tail party – 3 person talks about your interested topic and you are concentrating to some other things, but your brain automatically listens to  it.

f) Attention – our ability to focus on aspects of our environment and to be consciously aware of it

Selective Attention – Our ability to pay attention to our environment while ignoring aspects of our environment

Sustained attention –  “the ability to direct and focus cognitive activity on specific stimuli.”

g) Meditation – growth in brain tissues, gives freshness

h) Sleep

Need 7-9 hours of good sleep.

Sleep apnea – pause in breathing 30 times in  a hour, mostly in day time sleeping.

Narcolepsy – inability to regulate sleep/wake cycle

Night terrors

Insomnia – difficult to sleep

i) Drugs

Any chemical which changes our behavior

I will end the part 1 with this, and conclude that what we do, think, behave all from our brain. And brain is responsible for our thinking and emotions( which we say as heart or love in heart).

UEFI?

 

I bought a new laptop which was preinstalled with Windows8. And everythings looks new from the Metro BootLoader to Desktop and applications.

But still I wanted to install Ubuntu also in it. And I found this blog http://askubuntu.com/questions/221835/installing-ubuntu-on-a-pre-installed-windows-8-64-bit-system-uefi-supported

Installing Ubuntu in older systems like Windows XP are different for me, where as here they talk about something UEFI. So before installing Ubuntu I started reading about this UEFI.

This blog is to tell what is BIOS and how UEFI replaces BIOS. And whats problem on installing Ubuntu on UEFI Secure Boot.

BIOS (Basic Input/Output System)

BIOS is firmware which comes inbuild in motherboard.

Firmware is permanent software programmed into a read-only memory.

Here is the flow when you starts your computer.

  1. Switch on the computer
  2. First instruction to tells CPU is to process the BIOS.
  3. BIOS is a program stored in ROM.
  4. BIOS begins with POST(power-on self test) to make sure the components in computer are present and functioning properly.
  5. Once the test sucess, it load the boot process.
  6. BIOS hands control over to bootstrap loader(boot manager), which looks boot sector of the harddrive to load the OS.

Drawbacks in BIOS

BIOS has been terribly outdated for decades.

  1. BIOS process on 16bit, which takes up to 30 sec after you turn the switch on before your PC is ready to start booting.
  2. BIOS only had 1MB of executable space, which trouble starting up multiple interface(USB, eSATA) devices, ports and controllers on a modern PC.
  3. BIOS supports on hard drives of maximum capacity of 2.2TB

EFI

In 1998 Intel starts work on “Intel Boot Initiative”(IBI) later know us Extensible Firmware Interface.
Intel-HP introduced this with its Itanuim large platform server.

In 2007, Intel along with AMD, Apple, Dell, and other vendors, finally agreed to use UEFI (Universal EFI) specification. UEFI as universal replacement for BIOS.

UEFI

UEFI is a mini OS sits top of the computer’s hardware and firmware.

UEFI is not an implementation like EFI, UEFI forum is just a specification where nearly 140 technology companies participates in it. And the manufacturer vendors will produces their system implementing using UEFI specifications.

 

WFI

EFI

Advantages of UEFI

  1. UEFI uses GUID Partition Table, which replaces the MBR partition in BIOS. With GUID, it will able to boot from hard disks as large as 9.4ZB.
  2. It’s also possible that some vendors will implement basic operating system interoperability, such as access to a Web browser, without ever needing to actually “boot” the computer into an operating system.
  3. Faster boot and resume times.

UEFI Secure Boot

Secure Boot is a feature on UEFI-based PCs that helps increase the security of a PC by preventing unauthorized software from running on a PC during the boot sequence. It checks that each piece of software has a valid signature, including the operating system that will be loaded.

But Windows also using Secure Boot to lock PCs into being only able to boot one operating system: Windows 8. Seems like Windows is using this feature to keep Linux off PCs.

Issues with Windows and Linux on Secure Boot

Now that Microsoft is insisting that Windows 8 PCs must support UEFI-secure boot — a sub-system designed to make sure that a PC only boots a legitimate operating system — you can be sure almost all 2012/13 PCs will be using UEFI as at least a basic BIOS replacement.

Contrary to popular opinion, Linux developers have no problem with secure boot. Indeed, as The Linux Foundation white paper, Making UEFI Secure Boot Work With Open Platforms (PDF), states, “Linux and other open operating systems will be able to take advantage of secure boot if it is implemented properly in the hardware.”

The key is that Microsoft continues to dodge the question of how they’ll implement secure boot. Eventually, I suspect Microsoft will quietly back down from their “our way or the highway” approach to secure boot and you’ll be able to both use secure boot and run any UEFI-compatible operating system you want on a Windows 8 approved PC.

 

But anyhow Linux or Ubuntu supports with UEFI Secure boot. Lets try installing, hope should not face any issues 🙂

Courtesy : http://www.itworld.com/hardware/222791/goodbye-bios-hello-uefi, Wiki, Microsoft knowledge base.

Even Faster Web Sites

Last few months I just become void and search something to do or learn on technically. And I went to my company library and searching for some books, and found this one “Even Faster Web Sites”.

If your are front end developer or loves web page designing, you would come across few rules for making web page faster – “High Performance Web Sites” book, even lot of articles, forum, blogs explains about those 10 rules. Steve Souders, who wrote the book High Performance Web Sites made the web development to improve 80% faster.

He and other folks contributed the book “Even Faster Web Sites”. I think why he named it even faster is because already he written a book for performance which makes the web fast. So obviously the next one should be even more faster right.

The book covers 15 chapters and some performance tools. And I can’t give all the details over  here, because you should read the book to learn more deeper. Here I will talk about some of the things which made me to surprise/shocks me on the behavior of web and browser.

 

1) Splitting the initial payload

If you talk a look at top 10 US web sites, 75% of the JavaScript are not executed on page load. So why do we need to load those stuff on before load and makes page delay. Idea over here is to use Defer rendering, where we can load the scripts(scripts not executing before page load) after page gets loaded.

2) Scripts Blocking other components

This topic was new to me and surprised that web and browsers are behaving in such a manner.

Scripts tag will blocks other components(images, style, iframe, anything) to execute or render until it downloaded and executed

Why this is happening is because of script is capable of changing the web page(by style, or new components and many features). So to preserve the order of the execution and page rendering, it blocks others components.

So  if you are having scripts which will not do anything of the web page modification, you can execute or render without blocking the other components by set of technics like XHR Eval, XHR Injection, Script in Iframe, Script DOM element, Script Defer, document.write Script tag.

And even CSS style also will block other components to execute or render, reason as same as script blocks.

Best way is to position the CSS Styles at top and Scripts at bottom to load the page in efficient way.

3) Writing Efficient JavaScript

In JavaScript lifecycle, we have execution context(scope), global context and scope chain. So whatever variable we refer or use, will start search from active execution conetext (scope) and it continues to the upper stack and atlast goes to global context.

We need to be more careful of using the global variable, and for the local variable don’t forget to put var keyword, most of the developer won’t do that which leads that to global variable. And store the repeatedly using variables into local variable to process fast.

Processing DOM element is most costly in the JavaScript, where we mostly to use the DOM document or any elements like ( document.getElementById(‘..’) ) which needs to be stored in to local variable in case of it is used in more than one statement, which makes the access scope search easier and faster.

Loop tip:

To improve the performance of a loop is to decrement the iterator towards 0 rather than incrementing will save up to 50% of original execution time depend upon the complexity of loop.

4) Going Beyond Gzipping:

Even if Gzipping support is enabled in your server and the browser, sometimes nearly 15% of users are not getting the Gzipped version.

This happens because of these two culprits ( web proxies, PC security software’s ), which will make the original header to mangled like (X-cept-EncodXng: XXXXX). So the server and browser couldn’t understand the encoding format and gets failed to serve Gzipped content.

To overcome this we can use cookie to share that the browser supports Gzip format and server can serve the Gzipped content.

5) Sharding Dominant Domains

There is a W3C rule that browser needs to make max async call to single domain. If you take look at the older browser, it supports only 2 parallel call at a time to single domain. But newer browsers supports up to 6 parallel calls to single domain.

If a web page supports maximum parallel downloads, will make the page maximum to load faster. In order to download max parallel connection, we can go for multiple domains as the rule applies to single domain. So if components are shared with multiple domains like (CSS, images and JS are put into two domains), CSS and JS will download at same time from different domains.

And an important concept here is that this restriction to max parallel calls is not only the webpage, it applies to all the window, tab of that browser. So If you are loading YouTube in 2 tabs at a time and one tab start max downloading the components of page from that domain(YouTube), other tab needs to wait for the first tab to gets completed. As the MAX connection applies to whole browser at a time.

To use multiple domains, it doesn’t mean that we need to have 2 different servers, because browser won’t look for IP address to check MAX connection. It just checks the url hostname. So we can have CNAME (alias ) for the same server and use the alias for some components.

6) Simplifying CSS selectors

In the current Web 2.0 applications we use lot of CSS selectors to apply different styles.

How the CSS selectors executes and apply the styles is “browser tries to match the CSS selectors with the elements in the document.  The amount of matching the browser must perform depends on how the CSS selectors are written”.

Our mentality of writing the selectors is as same as our writing way, starts from left to right. Ex: to apply a bg color as red to all the span inside div under div(with class middle) will be

div > div.middle > span { background-color: red; }

But how the browser reads or executes the selectors are from right to left. So all our selectors should be turned to filter most of elements on right most one. For the above example browser selects all span, and check each span whether its child of div.middle.

CSS selectors should be on right to left

 

Performance Tools:

There are lot of tools which shared in the book, am just list the major hits in the web developers circle.

HttpWatch

Fiddler

Firebug

YSlow

 

Here the link to see the examples of the EFWS,

http://stevesouders.com/efws/links.php?ex

Hope it will be some way helpful to you, and am trying to write the blog in interesting way. If it bored am sorry. Anyway read the books “Even Faster Best Sites” and “High Performance Web Sites” to get into it deeper with lot more information’s.

Its not engineering whatever be a pro

 

It has been long that I wrote a blog. Totally I have written some 5 blogs and all ‘ll be on technical, which I had read in other articles and make it here.

But this blog I try to make my own, but eventually refers an article from news paper.

MATH — Am not to talk about the Mathematics, but the way of education, scope and our mentality about arts in India.

Year of Mathematics – an article from India Express on 31 Dec, 2012. While I am reading this article, lot of things opened to me about the area and field to work.

Let me start from my or most of Indian students life. We use to read Maths and science from our childhood to college. But all the way our way of education is Pattern recognition, where we follow the pattern or formula to solve the problem and we never know where it will be used or implemented.

And our parents, don’t want to get into arts and always tell to others that “My son is an engineer”, unless parents are working as teacher (becoz they want their son/daughter to become as teacher, safest job :P).

So our life go like go to engineer college, get into the job or do arts, PG, Ph.d and go as teacher.People will fear that arts subjects will not give job which pay higher.

But the ways have changed now. Where companies are going into a innovative world which involves on research and analysis which needs science.

Lets take a software engineer, who works on any platform which uses algorithms in it to solve lot of issues like sorting, hash etc..

In the express article, Rajeeva, director of CMI speaking, I came to know that their are specilized college for arts CMI, ISI which will take hand full of students every year and focus on research on Maths, Physics and computer.

And Rajeeva have consulted work for Parliamentary election and state assembly pools for Doordarshan, TV Today and more channels.Involved in CBI case to find the cheating involved in multiple choice question and as we know maths always involve in defence for encryption (use to know from Roja movie, thanks to Sujatha writer).

And all the banks, upcoming technological concepts like BigData, Machine learning, robotics all involves the science.

And I was looking into a Facebook engineering video and an indian was talking. I surfed about him and find out that he is an make of CMI college. And looked all profiles of CMI students and every one are in big jobs.

So it doesn’t matter whether we are engineer or an arts graduate. But what we do on that field is going to make our future.

“Sense of Discovery” in all our works need to there on whatever we do and it will become something big.

Ask why and how, which enables our minds to explore the things and its working to lead the innovation.

And then I decided that we should not bend our children to what we like or majority of people do. Let them know what they are good at and interested in. But one things, what ever they choose they need to become pro in it. 🙂

VMs and Dalvik VM

I have been thinking to write a blog on something, So I thought now to write about Virtual Machine. Which I have learned DALVIK VM in Linux For You magazine last month and almost all content are copied from that article only  J.

Let me start with What is VM?

Linux For You magazine says,

Virtual Machine is an isolated, self-contained implementation that abstracts hardware resources. Typically, it simulates an actual physical machine capable of executing instructions sets. Broadly VM are classified into two types,

  1. Process VMs
  2. System VMs

Process VMs:

A process VM, sometimes called an application virtual machine, runs as a normal application inside a host OS and supports a single process. It is created when that process is started and destroyed when it exits. Its purpose is to provide a platform-independent programming environment that abstracts away details of the underlying hardware or operating system, and allows a program to execute in the same way on any platform.

This type of VM has become popular with the Java programming language, which is implemented using the Java virtual machine. Other examples include the Parrot virtual machine, which serves as an abstraction layer for several interpreted languages, and the .NET Framework, which runs on a VM called the Common Language Runtime.

System VMs:

Supports the execution of a complete operating system (eg: VirtualBox, VMWare).

System virtual machines (sometimes called hardware virtual machines) allow the sharing of the underlying physical machine resources between different virtual machines, each running its own operating system. The software layer providing the virtualization is called a virtual machine monitor or hypervisor. A hypervisor can run on bare hardware (Type 1 or native VM) or on top of an operating system (Type 2 or hosted VM).

I have learned little bit on system VMs while in my college with helps of my Guru (Ewards). Where with help of System VMs you can run XP in linux, tats wat I tried in my laptop.

In this article, will see on Process based VMs.

For example, Java applets run in a Java virtual machine (VM) that has no access to the host operating system. This design has two advantages:

System Independence: A Java application will run the same in any Java VM, regardless of the hardware and software underlying the system.

Security: Because the VM has no contact with the operating system, there is little possibility of a Java program damaging other files or applications.

The second advantage, however, has a downside. Because programs running in a VM are separate from the operating system, they cannot take advantage of special operating system features.

VM implementations:

VM are implemented in two ways,

  1. Register based VMs
  2. Stack based VMs

Register based VMs:

It computation model assumes register as the memory, and operands are accesed with explicit address coded in an instruction.

Stack based VMs:

Memory takes the form of a LIFO stack. Every operation boils down into PUSH/POP or STORE/LOAD. These instructions do not need explicit operand address, because the operand is always available with stack pointer. Ex:- Microsoft .NET and Sun JVM.

Traditionally,

People preferred to stack-based rather than register-base VMs, main reason of this choice was the simplicity of the complier. And stack-based instruction are shorter of (PUSH/POP). But register-based instructions are quadruple. Even though advantages of stack-based is diminishes in terms of number of instruction, which some of stack-based instructions need to express the register-based instructions.

Example: “a = b + c” would need stack VM:

LOAD  C
LOAD  B
ADD
STORE A

Register VM:

“add a,b,c”

Comparison:

Stack VMs, operands are accessed relative to the stack pointer, but in register VMs need to preovide the location of all operands. Having all the operands in instruction has it benefits of execution faster compared to stack VM.

Stack VM consume more memory cycle and temp values often stored in main memory. Register VMs, temp values usually remain inregister.

Stack VMs are unable to use few optimisation, in-case of expression, which recalculated each time they appear in the code. Register VM can calculate an expression once, and keep that in  a register for all future references.

So Dalvik VM preferred register based VM, and thou google choose to implement it in andriod.

Dalvik VM :

Introduction:

In stead of using usual JVM, Google have implemented their own VM of “Dalvik VM”

The Dalvik virtual machine is a register-based virtual machine, designed and written by Dan Bornstein with contributions from other Google engineers as part of the Android mobile phone platform.

It is optimized for low memory requirements, and is designed to allow multiple VM instances to run at once, relying on the underlying operating system for process isolation, memory management and threading support. Dalvik is often referred to as a Java Virtual Machine, but this is not strictly accurate, as the bytecode on which it operates is not Java bytecode.

License and patent:

Dalvik is claimed by Google to be a clean-room implementation rather than a development on top of a standard Java runtime, which would mean it might not inherit copyright-based license restrictions from either the standard-edition or open-source-edition Java runtimes.

Dalvik is published under the terms of the Apache License 2.0.

On 12 August 2010, Oracle, which acquired Sun Microsystems in April 2009 and therefore owns the rights to Java, sued Google over claimed infringement of copyrights and patents. In developing Android, it is alleged that Google knowingly, directly and repeatedly infringed Oracle’s Java-related intellectual property.

Specifically the patent infringement claim references seven patents including US Patent No. 5966702 “Method And Apparatus For Preprocessing And Packaging Class Files”, and US Patent No. 6910205 “Interpreting Functions Utilizing A Hybrid Of Virtual And Native Machine Instructions”. It also references US Patent No. RE38104 “Method And Apparatus For Resolving Data References In Generated Code”.

The Dex File Format:

In standard Java environments, Java source code is compiled into Java bytecode, which is stored within .class files. The .class files are read by the JVM at runtime. Each class in your Java code will result in one .class file. This means that if you have, say, one .java source file that contains one public class, one static inner class, and three anonymous classes, the compilation process (javac) will output 5 .class files.

On the Android platform, Java source code is still compiled into .class files. But after .class files are generated, the “dx” tool is used to convert the .class files into a .dex, or Dalvik Executable, file. Whereas a .class file contains only one class, a .dex file contains multiple classes. It is the .dex file that is executed on the Dalvik VM.

 

Reference:

  1. Linux For you article.
  2. http://www.dalvikvm.com
  3. Wiki
  4. Ofcourse www.google.com