Interview Question : What is Thread?

Quad Core processor and Threads Winged Post

A thread is a single sequential flow of control within a program. the threads of a computer program allows the program to execute sequential actions or many actions at once. Each thread in a program identifies a process that runs when the program asks it to.

The term “Thread” can also be defined as

  1. a smallest unit of processing that can be scheduled by an Operating System.
  2. a portion of code that may be executed independently of the main program.
  3. an ordered sequence of instructions that tells the computer what to do
  4. In online discussion, a thread can refer to a series of related messages.
  5. In e-mail, a thread can refer to a series of replies back and forth pertaining a certain message.

Extended Information:

All programmers are familiar with writing sequential programs. You’ve probably written a program that displays “Hello World!” or sorts a list of names or computes a list of prime numbers. These are sequential programs. That is, each has a beginning, an execution sequence, and an end. At any given time during the runtime of the program, there is a single point of execution.

A thread is similar to the sequential programs described above. A single thread also has a beginning, a sequence, and an end. At any given time during the runtime of the thread, there is a single point of execution. However, a thread itself is not a program; a thread cannot run on its own. Rather, it runs within a program.

Some texts call a thread, a lightweight process. A thread is similar to a real process in that both have a single sequential flow of control. However, a thread is considered lightweight because it runs within the context of a full-blown program and takes advantage of the resources allocated for that program and the program’s environment.

Multiple threads can exists within the same process and share resources such as memory, while different processes do not share these resources.

 

Source / Courtesy : WiseGeek

The Dove’s Lament – Literary Review

The Dove's Lament
The Dove’s Lament

Most humans often compare, complain and whine about the various problems and shortcomings that they face in life. None can dare measure those issues as being ludicrous or unnecessary, for no one but the person who undergoes problems would know the gravity of the situations and would be forced to come out with different potential solutions. However, what the whiners and touch me nots cannot measure is the enormity of the other people’s problems, for they would never have given ear to the languish escaping the mouths of stricken individuals. Wearing dark glasses, all that they would see is a dark world that offers them nothing but dim light to walk, failing to notice the crippled, wounded and dying people surrounding them. When the glasses are removed by chance, reality hits them in the stomach like a speeding locomotive – and it really hurts.

The Dove’s Lament does exactly that, making reality hit hard in a place where pain is felt all the more – at the heart!

We think we’ve seen it all, heard it all and well… experienced it all. Kirthi Jayakumar, through The Dove’s Lament, tears apart that false curtain of deceptively woven lies into shreds, leaving the reader gasping for breath. It is not every day that one comes across a book such as this. A book that makes the heart to stop beating for awhile, trying to come to terms with reality.

Genocide, the first story of the book gives the readers a glimpse of what is to follow. What had so far been to many readers only a figment of imagination of some obscure author while penning a novel, is visualized and brought alive, when readers realize through the essays at the end of each story, that Kirthi has recreated through her stories, the horrors experienced by people, people like us!

I saw Joseph Gahiji amongst them, knife in tow. Could it be really him, the man I knew? Could it be the very benevolent gentleman who brought his granddaughter to the same school as Habimana every day until the war broke out?

Sentences like the above rent hearts into two, as the story takes the reader into the mass killing that took place in Rwanda. We are not able to imagine even for a moment that it is just a story – Kirthi sees to that. Truth is felt in every sentence that one reads.

Fire in a Ring of Ice is a story set in the backdrop of The Srebrenica Massacre. The woes of a family struggling in war are brought out in a way that brings tears to the eyes. The son being compared to a creeper brings the imagery alive before one’s eyes. The separation of the men from the women in the house moistens one’s eyes, while the thoughts of the dying father bring hope to one’s hearts about the creeper – son being alive somewhere, to our solace.

For the Love of a Motherland is set in the Middle East amidst one of the longest conflicts going on in the world, the Israel – Palestine dispute. The innocence of the children in the story and the frank manner in which they speak their hearts out make one pray that the ending is not a blood smeared one. Kirthi has brought out emotions that play with one’s minds. The story brings out the pathetic condition of people who have lost their dear ones, their houses, their countries and their identities.

He noticed the boy get up from his spot at the table. ‘I will come with you, Papa.’

Papa! The soldier turned immobile momentarily at this long awaited first call of the boy.

‘Papa? Can I?’ The soldier’s resolve firmed. He would reclaim his future, and give it to his son.

The uncertainty in the minds of children and adults alike is wrought out in a manner that evokes pity on the characters, all the while reminding the reader yet again that this is not just a story, but reality.

Home is set in almost the same background as that of the previous story. The occupation of the West Bank by the Israeli forces and the displacement of thousands of Palestinians are brought alive to the readers through the eyes of Amal, as millions of thoughts zoom in and out of her mind. The story ends with a ray of hope as Amal inhales the heady feeling of being at home, in her motherland.

Sacrifice brings to the fore a trait that is not known to many around the globe. Two brothers born up in the same family are brought up for different purposes. The ugly practice of Bacha Baazi is dealt with in this story, as a story of brotherly love, misunderstanding and sacrifice unfolds, leaving readers with lumps in their throats. The activities of the youngest brother remind one of the affection shared amongst siblings around the world.

The Smallest Coffins is perhaps the story with which all readers would be able to connect easily, not only because of the enormity of the brutality but also because it is the most recent one that all can remember. The class room scene is hilarious and typical of a normal school children mentality story, till disaster strikes. The involvement of the family feud and the connection at the end bring a sorrowful wakening to the story, reminding the readers that the smallest coffins are indeed the heaviest. That such love could possibly be inside so small a form is mind numbing.

Desiccated Land is set in the geographical crown of the Indian sub-continent, Kashmir. The partition of India and Pakistan, and the gory scenes that made blood run in both countries, especially in Kashmir is brought alive in this story. Kirthi Jayakumar has the inane ability to delve deep into the minds of people and bring out their emotions. The love, misunderstanding, misdeed and the terrible aftermath is heart rendering to read.

Princess is another story from the land of India. An evil that is rampant in India is prostitution. What people usually do is to overlook or ignore the consequence of prostitution in families that are forced to sell the product of their own flesh and blood. The pain of the mother in seeing her daughter suffer the same fate that she did and yet being unable to make any other move than the one she did is the worst fate that could befall any mother. It happens in this story. Kirthi’s efficiency in story telling has moved up a couple of notches in this story alone. Such is the power of her pen, in revealing the pain of individuals, families and communities to the world.

A Night to Remember is set in the dark world of prostitution and human trafficking. The pathetic situation in which a girl child is sold to a brothel is told in a detailed manner. Poverty plays a role in many families into sending members for this heinous act.

From the ante-room, she was sold into the heart of permanent hell.

Ironically, it was the heart of momentary heaven for the men who knocked on its gates.

Lines like the above showcase the ability of the author to play with words while breaking the ear of the reader with the seriousness of the situation. The breakthrough to the protagonist of this story is the bold act taken at the end of the story, bringing hope.

Explosion makes the readers explode with emotion and tears. Suicide bombers who destroy many parts of the world and communities with their ruthless acts form the crux of this story. The love between sisters and the helplessness at the end make this a dolorous read. Families torn apart because of the war and the longing for peace among the characters remind readers of the grim reality of life in many parts of the world.

Imprisoned deals with the drug dealers and their trade in countries like Colombia. The story deals in its journey life in prison for young inmates and seasoned criminals, along with people serving sentences for wrongs done by others. The thread of connection in this story is awesomely interwoven thanks to Kirthi’s ability. The fact that drug dealing is an evil that must be rooted out is brought out clearly in the story. The fair child of December makes hearts heavy…

Esther’s Story is the jewel of The Dove’s Lament and is a fitting climax to this book that contains stories of tribulation and sorrow, for this story ends with the silver lining to cast away all misgivings that one would have gotten about this cruel world filled with people committing vile deeds. Habimana’s mother is filled with the encouragement that flows into her through the acquaintance of Ujasiri.

She nodded. Later that evening when I helped her with the sombe, she told me her name was Ujasiri. It meant courage.

Resilience.

Kirthi Jayakumar has given to this world a book as rare as Gollum’s ring. The Dove’s Lament is one of the rarest books to have been published in the recent times in terms of the problems dealt with, the manner in which the issues have been brought out, the deeply etched memories of the stories that just refuse to fade away into oblivion as other stories do, the relevance of the stories in the current world, the pathos surrounding all the stories, the heavily researched essays that substantiate each story, the usage of apt words in places befitting them, the ache that is produced in the hearts of readers, the determination that the book forces one to take, and above all, the burden in the heart of Kirthi Jayakumar to bring to light the atrocities happening in different countries of the world. The Dove’s Lament by Readomania is a precious possession of Indian Literature that appeals to International audience. Kudos to Readomania for publishing such an irreplaceable wonder!

Interview Question : What is Object Oriented Programming?

Object Oriented Programming Languages - Winged Post

Object Oriented Programming (OOP) is a type of programming in which programmers define not only the data type of a data structure, but also the types of operations (functions) that can be applied to the data structure. In this way, the data structure becomes an object that includes both data and functions. In addition, programmers can create relationships between one object and another. For example, objects can inherit characteristics from other objects.

The Object Oriented Programming can also be defined as:

1. A style of programming that focuses on using objects to design and build applications.

2. Object oriented programming (OOP) is a model of programming language that focuses on the use of objects instead of actions in order to carry out tasks. This involves taking an approach that is more mindful of data and less concerned with logic, which is more commonly the case in other programming paradigms.

3. Object-oriented programming (OOP) is a programming paradigm based on the concept of “objects”, which are data structures that contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods.

 

For your information, the following are some additional concepts associated with the Object Oriented Programming:

  1. Encapsulation means that a group of related properties, methods, and other members are treated as a single unit or object.
  2. Inheritance describes the ability to create new classes based on an existing class.
  3. Polymorphism means that you can have multiple classes that can be used interchangeably, even though each class implements the same properties or methods in different ways.

 

Look black – Idiom Thaatha

Look black

The meaning of the idiom look black is to show little or no sign of hope whatsoever in life or in future.

Examples

1. When he was fired from his job, his career was in jeopardy and life looked black – from his position.

2. Everything looks black when hope is lost – for hope is the elixir of human life.

Interview Question : Define Array.

multi dimentional array data structure Winged Post

Array is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key. An array is stored so that the position of each element can be computed from its index tuple by a mathematical formula. The simplest type of data structure is a linear array, also called one-dimensional array.  We can also define a array as a container object which holds a fixed number of values of a single data type.

array data structure Winged Post

Arrays are among the oldest and most important data structures, and are used by almost every program. They are also used to implement many other data structures, such as lists and strings. They effectively exploit the addressing logic of computers. In most modern computers and many external storage devices, the memory is a one-dimensional array of words, whose indices are their addresses. Processors, especially vector processors, are often optimized for array operations.

Arrays are useful mostly because the element indices can be computed at run time. Among other things, this feature allows a single iterative statement to process arbitrarily many elements of an array. For that reason, the elements of an array data structure are required to have the same size and should use the same data representation.

The following are also the definitions of array in the area other than computer programming:

  • In general, an array is a number of items arranged in some specified way – for example, in a list or in a three-dimensional table.
  • In random access memory (RAM), an array is the arrangement of memory cells.
  • In data storage, an array (disk array) is a method for storing information on multiple devices. A disk array is a hardware element that contains a large group of hard disk drives (HDDs).

Take the edge off – Idiom Thaatha

take the edge off

 

The meaning of the idiom take the edge off is to mitigate or make less severe anything that is not pleasant.

Examples

1. The bars of chocolate that I had helped me take the edge off my ravenous hunger.

2. When the students responsible for the riot in college came and apologized to the principal, the act took the edge off his anger.

Interview Question: Difference between LinkedList vs ArrayList in Java?

Introduction:

LinkedList and ArrayList both implement List Interface but how they work internally is where the differences lies. Main difference between ArrayList and LinkedList is that ArrayList is implemented using re-sizable array while LinkedList is implemented using doubly LinkedList. ArrayList is more popular among Java programmer than LinkedList as there are few scenarios on which LinkedList is a suitable collection than ArrayList. In this article we will see some differences between LinkedList and ArrayList and try to find out when and where to use LinkedList over ArrayList.

difference between arraylist and linkedlist - WingedPostThe Differences:

  1. Since Array is an index based data-structure searching or getting element from Array with index is pretty fast. Array provides O(1) performance for get(index) method but remove is costly in ArrayList as you need to rearrange all elements. On the Other hand LinkedList doesn’t provide Random or index based access and you need to iterate over linked list to retrieve any element which is of order O(n).
  2. Insertions  are easy and fast in LinkedList as compared to ArrayList because there is no risk of resizing array and copying content to new array if array gets full which makes adding into ArrayList of O(n) in worst case, while adding is O(1) operation in LinkedList in Java. ArrayList also needs to update its index if you insert something anywhere except at the end of array.
  3. Removal is like insertions better in LinkedList than ArrayList.
  4. LinkedList has more memory overhead than ArrayList because in ArrayList each index only holds actual object (data) but in case of LinkedList each node holds both data and address of next  and previous node.

 

From mountains to moons: discoveries from Pluto mission

New close-up images of a region near Pluto's equator reveal a giant surprise -- a range of youthful mountains rising as high as 11,000 feet (3,500 meters) above the surface of the icy body. Credit: NASA/JHU APL/SwRI
New close-up images of a region near Pluto’s equator reveal a giant surprise — a range of youthful mountains rising as high as 11,000 feet (3,500 meters) above the surface of the icy body.
Credit: NASA/JHU APL/SwRI

Icy mountains on Pluto and a new, crisp view of its largest moon, Charon, are among the several discoveries announced Wednesday by the NASA’s New Horizons team, just one day after the spacecraft’s first ever Pluto flyby.

“Pluto New Horizons is a true mission of exploration showing us why basic scientific research is so important,” said John Grunsfeld, associate administrator for NASA’s Science Mission Directorate in Washington. “The mission has had nine years to build expectations about what we would see during closest approach to Pluto and Charon. Today, we get the first sampling of the scientific treasure collected during those critical moments, and I can tell you it dramatically surpasses those high expectations.”

“Home run!” said Alan Stern, principal investigator for New Horizons at the Southwest Research Institute (SwRI) in Boulder, Colorado. “New Horizons is returning amazing results already. The data look absolutely gorgeous, and Pluto and Charon are just mind blowing.”

A new close-up image of an equatorial region near the base of Pluto’s bright heart-shaped feature shows a mountain range with peaks jutting as high as 11,000 feet (3,500 meters) above the surface of the icy body.

The mountains on Pluto likely formed no more than 100 million years ago — mere youngsters in a 4.56-billion-year-old solar system. This suggests the close-up region, which covers about one percent of Pluto’s surface, may still be geologically active today.

“This is one of the youngest surfaces we’ve ever seen in the solar system,” said Jeff Moore of the New Horizons Geology, Geophysics and Imaging Team (GGI) at NASA’s Ames Research Center in Moffett Field, California.

Unlike the icy moons of giant planets, Pluto cannot be heated by gravitational interactions with a much larger planetary body. Some other process must be generating the mountainous landscape.

“This may cause us to rethink what powers geological activity on many other icy worlds,” says GGI deputy team leader John Spencer at SwRI.

The new view of Charon reveals a youthful and varied terrain. Scientists are surprised by the apparent lack of craters. A swath of cliffs and troughs stretching about 600 miles (1,000 kilometers) suggests widespread fracturing of Charon’s crust, likely the result of internal geological processes. The image also shows a canyon estimated to be 4 to 6 miles (7 to 9 kilometers) deep. In Charon’s north polar region, the dark surface markings have a diffuse boundary, suggesting a thin deposit or stain on the surface.

New Horizons also observed the smaller members of the Pluto system, which includes four other moons: Nix, Hydra, Styx and Kerberos. A new sneak-peak image of Hydra is the first to reveal its apparent irregular shape and its size, estimated to be about 27 by 20 miles (43 by 33 kilometers).

The observations also indicate Hydra’s surface is probably coated with water ice. Future images will reveal more clues about the formation of this and the other moon billions of years ago. Spectroscopic data from New Horizons’ Ralph instruments reveal an abundance of methane ice, but with striking differences among regions across the frozen surface of Pluto.

The Johns Hopkins University Applied Physics Laboratory in Laurel, Maryland designed, built and operates the New Horizons spacecraft and manages the mission for NASA’s Science Mission Directorate. SwRI leads the mission, science team, payload operations and encounter science planning. New Horizons is part of NASA’s New Frontiers Program, managed by the agency’s Marshall Space Flight Center in Huntsville, Alabama.

Follow the New Horizons mission on Twitter and use the hashtag #PlutoFlyby to join the conversation. Live updates also will be available on the mission Facebook page.

For more information on the New Horizons mission, including fact sheets, schedules, video and all the new images, visit:

http://www.nasa.gov/newhorizons

and

http://solarsystem.nasa.gov/planets/plutotoolkit.cfm


Story Source:

The above post is reprinted from materials provided by NASA. Note: Materials may be edited for content and length.

What Is Electrical Conductivity?

Power lines are made of conducting materials.
Power lines are made of conducting materials.

Electrical conductivity (EC) is a property that is used to describe how well materials allow electrons to flow. It is determined using experiments and math equations. Conductivity is the reciprocal of resistivity, meaning the higher the conductivity, the lower the resistivity. A conductor is a material that has a high electrical conductivity, and an insulator is a material that has a high electrical resistivity. Both properties depend on the temperature and purity of materials.

Temperature dependence of electrical conductivity follows a general pattern. Metal is a conductor, and it has lower conductivity at higher temperatures. Glass is an insulator and shows higher conductivity at higher temperatures.

At very high temperatures, conductors behave like insulators, and insulators behave like conductors. This behavior of insulators and conductors is explained by the free electron model. In this model, conductors clearly show the ability to free electrons, and when a current, or electric force, is applied, the force can easily push around the extra electrons.

Soil is a mixture of minerals, salts and organic materials. It has a special electrical conductivity called soil electrical conductivity, which measures the amount of salt that is in a soil sample, which is called its salinity. The process can also measure other soil properties where salinity is low enough. These properties are related to the influence that purity has on EC data.

EC data of a soil sample can determine how much impurity is in the soil. Soil impurities are water, air and minerals. Each impurity influences the data differently, but a practiced soil scientist can determine this information from the gathered data. In general, more impurities lower the EC, with the exception of minerals that increase EC. Impurities also can explain the use of pure copper in electrical wiring.

Metals are often made of alloys, a mixture of two or more elements. This is not useful for conducting electricity. The metals in alloys are not the same elements and electrons cannot flow easily between different elements. Pure metals, such as copper wire, have high electricalconductivity. This applies only to solid metals because air pockets can lower the electricalconductivity of materials.

Materials that are not metals usually make good insulators. The best insulators are materials that naturally have air pockets in them, such as rubber. The air pockets are like impurities and disrupt the flow of electrons. Gases, such as air, are the best natural insulators. Modern chemistry has mastered insulators, creating materials that have thousands of times more resistivity than air.

 

Source / Courtesy : WiseGeek

Do you really think you’re a foodie?

Think you’re a foodie? Adventurous eaters, known as “foodies,” are often associated with indulgence and excess. However, a new Cornell Food and Brand Lab study shows just the opposite -adventurous eaters weigh less and may be healthier than their less-adventurous counterparts.

The nationwide U.S. survey of 502 women showed that those who had eaten the widest variety of uncommon foods — including seitan, beef tongue, Kimchi, rabbit, and polenta– also rated themselves as healthier eaters, more physically active, and more concerned with the healthfulness of their food when compared with non-adventurous eaters. “They also reported being much more likely to have friends over for dinner,” said lead author Lara Latimer, PhD, formerly at the Cornell Food and Brand Lab and now at the University of Texas.

“These findings are important to dieters because they show that promoting adventurous eating may provide a way for people -especially women — to lose or maintain weight without feeling restricted by a strict diet,” said coauthor Brian Wansink, (author of Slim by Design: Mindless Eating Solutions for Everyday Life). He advises, “Instead of sticking with the same boring salad, start by adding something new. It could kick start a more novel, fun and healthy life of food adventure.”

The article is published in the journal Obesity. It is authored by former Cornell researchers, Lara Latimer, PhD, (currently a Lecturer at the University of Texas at Austin) and Lizzy Pope, PhD, RD (currently Assistant Professor at the University of Vermont), and Brian Wansink, (Professor and Director of the Food and Brand Lab at Cornell University.


Story Source:

The above post is reprinted from materials provided by Cornell Food & Brand Lab. Note: Materials may be edited for content and length.


Journal Reference:

  1. Latimer, Lara; Lizzy Pope, and Brian Wansink. Food Neophiles: Profiling the Adventurous Eater. Obesity, 2015