Tuesday, February 28, 2012

How to detect if one of the linked list pointer is corrupted or not ?

How to detect if one of the linked list pointer is corrupted or not ?

0.In case of doubly linked list, by checking the prev/next pointer, we can identify whether the pointer is valid or not...
1.We can add some extra field to store the count of the linked list node  from 1,2,... and so on. For any node we can check the value with previous node value
2.we can make use of virtualquery() fn in windows to check whether the given address is valid or not.
In the same way, in linux, we will be having mprotect() fn. if we are passing the invalid address in mprotect(), it will notifies the application
with SIGSEGV signal, Application need to catch this signal and do the necessary things.
 

Monday, February 27, 2012

blessing

There is no disaster that cannot become a blessing and no blessing that cannot become a disaster - Richard Bach

Soviet Era math. books link

http://mirtitles.org/

Thursday, January 26, 2012

Lock based synchronization and Lock free synchronization

Lock based synchronization provides the following problems
1.Deadlock

2.LiveLock

3.Priority Inversions

4.Caravan Formation

To avoid these problems, we are going for lock free synchronization. AsynchronousProgramming is a typical technique for achieving lock free synchronization.

Example: Android Stagefright is having lock based synchronization mechanism

PV's OpenCORE is having lock free synchronization mechanism

Tuesday, January 03, 2012

How to add logs into android.mk [to display the information at compile time]

How to add logs into android.mk file:
 
This log will be printed whenever we are compiling.
Usecases: In a large project, somewhere the values will be set, User wont be aware of it.
So that time,to print which device macro is enabled, we can make use of this warning in android.mk

within Android.mk,

ENABLE_CODEC =1
ifeq(ENABLE_CODEC,true)
$(warning SUNDARA::ENABLE_CODEC is true)
else
$(warning SUNDARA::ENABLE_CODEC is false)
endif

#How to print the variable from Android.mk

TARGET_PLATFORM := MSM7227
$(warning SUNDARA::Target Plarform is '$(TARGET_PLATFORM)')

output:
SUNDARA::ENABLE_CODEC is true
Target Plarform is MSM7227

Monday, December 19, 2011

Think clearly

 The scientists of today think deeply instead of clearly. One must be sane to think clearly, but one can think deeply and be quite insane.

Friday, November 25, 2011

Tao Te Ching.

Tao Te Ching. Although it's a philosophy book and not a programming book, some of it's principles are very applicable to programming:

"Know when it's time to stop. If you don't know then stop when you are done."

Translation: Knowing your requirements means you know when to stop. If you don't know when to stop, you need to stop because the requirements have yet to be defined.

"The harder one tries, the more resistance one creates for oneself."

Translation: How many times have you worked on a problem for several hours, only to find the answer after taking a 15-minute break? The more you hammer at a problem, the harder it is going to be for you to solve it.

"One whose needs are simple can fulfill them easily."

Translation: Simple requirements lead to simple designs.

"When we lose the fundamentals, we supplant them with increasingly inferior values which we pretend are the true values."

Translation: Hubris is never a good substitute for good programming standards. If you get lax, no amount of design patterns will ever substitute for the lack of quality in your code.

Gmail Tricks

Tricks of Gmail:
===================
1.if your gmail id is something like this.

   a.sundara@gmail.com

Then you can login gmail as asundara or a.s.u.n.d.a.r.a@gmail.com [Any number of dots in between your mail user ID]

if anyone is sending mail to asundara@gmail.com, then you will receive mail in your inbox.

Monday, November 14, 2011

Putty Inactive problem

Problem:

1.Usually I will put some compilation in server through putty and leave for the lunch. after some timeout period, putty will goes to inactive mode.
But the server is compiling our code
2.After sometimes, I come back. There is a chance like due to slowness of the server,it might takes some more time to complete the compilation.
    
        How can we ensure the completion of compilation in this scenario ?

Solution:
  we can give compilation command | tee log.txt and redirects the compilation output to file log.txt. Once the compilation is done, the compilation message /errors will be stored in log.txt. From this log.txt, we can figure out whether compilation is completed or not.

Thursday, November 10, 2011

Tuesday, November 08, 2011

Wednesday, November 02, 2011

Harvesting techniques to use right side of the brain:

Harvesting techniques to use right side of the brain:

1.Free Form Journaling – Writing is a great way to relax your mind and allow your R-mode thoughts and ideas to escape your brain and present themselves onto paper. When ideas pop into your head, write them down, and then elaborate on those ideas. Simple brainstorming on paper can give you the opportunity to clarify your thoughts.

2.Walking – Sometimes the best way to come up with ideas is to simply step away from your desk, relax your mind, and go for a walk. While you're walking though, try not to think about anything, especially the problem you are trying to solve. The goal is to silence your L-mode and give your R-mode the chance to do some work.

3.Image Streaming – This is the process of deliberately observing images in your mind and paying close attention to them. First, pose a problem to yourself or ask yourself a question. Then shut your eyes and relax. As images start to cross your mind describe them out loud. Try to describe as many details as you can using all five senses. This type of thinking can help you discover fresh insights to the problem or question you presented yourself.


 

PQ RAR for effective reading


Try the PQ RAR reading-study method as you read or teach your next textbook chapter.

P-First of all, preview the reading selection. Try to limit the reading selection to a manageable size. Overly long chapters, say over six pages for

elementary students, eight for middle school students, twelve for high school students, and sixteen for college students should be "chunked" into manageable

reading sections.

1. Preview the first and last paragraphs of the chapter and the chapter review, if one is provided.

2. Preview all subtitles and any book study helps at the beginning of the chapter.

3. Preview all graphics such as photographs, charts, maps, etc. and their captions.

Q-Secondly, make use of text-based questions to read textbooks effectively.  Good questions produce good answers and significantly increase expository

comprehension. Determining questions before reading provides a purpose for reading, that is-to find the answers as you read.

1. Develop questions from the subtitles and write these down on binder paper or on your computer, skipping lines between each question. Try "What," "How,"

and "Why" question-starters. Avoid the "Who" and "When" questions, as these tend to focus attention on the minor details of expository text.

2. Write down any chapter review questions not covered by your subtitle questions, skipping lines between each question.

R-Read the chapter and "talk to the text" by taking notes in the textbook margins. Use yellow stickies and paste them in the textbook margins, if you can't

write in the textbook. Write down comments, questions, predictions, and connections to other parts of the reading and your own life experiences. List

examples, key details, and important terms with their definitions. Internal monitoring of the author's train of thought and the connection to your own

knowledge and experience increases comprehension as you read textbooks.

A-Answer both the subtitle questions and the book questions as you read. Write down your answers underneath your questions. Don't be concerned if the

textbook did not answer some of your reader-generated questions.

R-Review the questions and answers within the next 24 hours to minimize the effects of the "forgetting cycle." Generate possible test questions and
develop  memory tricks for key concepts and details.
 

SQ3R process

SQ3R is a simple strategy that can be used to actively engage yourself in whatever it is you are reading. The SQ3R process is as follows:

Survey – Scan the chapter headings and summaries for an overview.
Question – Note any questions you have.
Read – Read in its entirety.
Recite – Summarize, take notes, and put in your own words.
Review – Reread, expand notes, and discuss with colleagues.