Thursday, May 19, 2011

Beware of Social media.... Things never to share on Facebook

My this post is inspired by an article I just went thru in Yahoo, regarding things one should never share in social networking site. The article was focused on facebook, may be because it's potential to reach maximum number of people around the globe.

It reminded me the interview of Prez Obama where he suggested and advised teenagers especially the girls, how to behave and need to be careful while using and sharing the informations, pictures  and status update on social  network.

I found it interesting, and got intended to research more on this. So found there are so many awareness campaign has already being circulating regarding this.

That's good , I proud upon some ppl took it social responsibility and generated some sense to make people awake by creating  social awareness campaign videos and upload them to the same social networking platform which has been used by maximum number of people.
And try to educate them beware and think twice before publishing your in-personal information and pictures.

Almost every user likes to share everything on their Facebook page but certain updates can lead to criticism, embarrassment and even job termination.


I myself have experience and witness the incidents, if you're a person that cannot foresee or imagine the future and you're a person who dont understand and evaluate about your activities,   impact on your future life. It's better to remain and act as a passive user of these social media.

So here's a shortlist of what you shouldn't share on the social networking site, reports CBS news.

1.That your job sucks.
If you say this, you could be fired.

2. That you hate your ex.
In the event that you and your boyfriend get back together, or you and that friend you had a falling out with start talking again, you'll look like a total sucker. It's okay to let your emotions govern your thoughts but keep your feelings off your Facebook until you've started to think clearly about said ex.

The important thing to remember about social networks is that although you have the option to delete your comments, sometimes it can be too late. It's immediate and someone might have laid eyes on it before your retraction.

3. That you're going on vacation and then give the dates you're away.
You could be robbed. A recent study found that thieves scan social networking sites like Facebook and Twitter for folks in targeted neighbourhoods before they strike.

4. That you love yourself.
In fact, don't give any indication that you're your biggest fan. Your followers will only think the opposite. It's the biggest barometer of insecurity. Researchers at the University at Buffalo also found that women who base their self-worth on appearance and what people think of them tend to upload pictures very frequently.

5. That you're mean.
Saying mean things about people can only make you undesirable-for potential employers, dates, friends and strangers.

Monday, May 16, 2011

Function :GetChar()

int getchar ( void );
Get character from stdin

Returns the next character from the standard input (stdin). It is equivalent to getc with stdin as its argument.

Parameters: (none)

Return Value : The character read is returned as an int value.

If the End Of File is reached or a reading error happens, the function returns EOF and the corresponding error or eof indicator is set. You can use either ferror or feof to determine whether an error happened or the End-Of-File was reached.
 
Example:
int character=1;


while (plainChar != EOF) {
character= getchar();
printf("%c\n", character);

Important (may be interview question sometimes)
What's wrong with this code?

char anyCharacter;

while((anyCharacter = getchar()) != EOF) ...
Correct Explaination:
The variable to hold getchar's return value must be an int. EOF is an ``out of band'' return value from getchar: it is distinct from all possible char values which getchar can return. (On modern systems, it does not reflect any actual end-of-file character stored in a file; it is a signal that no more characters are available.) getchar's return value must be stored in a variable larger than char so that it can hold all possible char values, and EOF.


Two failure modes are possible if, as in the fragment above, getchar's return value is assigned to a char.
If type char is signed, and if EOF is defined (as is usual) as -1, the character with the decimal value 255 ('\377' or '\xff' in C) will be sign-extended and will compare equal to EOF, prematurely terminating the input.
If type char is unsigned, an actual EOF value will be truncated (by having its higher-order bits discarded, probably resulting in 255 or 0xff) and will not be recognized as EOF, resulting in effectively infinite input.


Inspired By :
http://c-faq.com/stdio/getcharc.html



return 0;

}

Sunday, May 15, 2011

The mechanics of function calls

Other day i was going thru the lectures of  Richard Buckland from UNSW. As he was explaining about the mechanism of function calls.
In actual , computer stores the data of the function (such as arguments, local variables, return address etc.,) when a function is invoked and destroys them when the function returns. Similarly when a function calls other functions, the caller function returns only after all the callee functions are returned.

It's a  last-in-first-out, meaning, it's a impelmeation as of stack .
In the memory, the stack grows from the higher memory address to the lower memory addresses. So we have to visualize an inverted stack.
Here's some keywords need to be remembered. It'll let you know what are they and explain little bit of them .
Here's they go.

Stack frame
The section of memory where the local variables, arguments, return address and other information of a function are stored, is called stack frame or activation record.

Stack pointer
For function calls, a bulk of data is pushed and popped from the memory, whenever a function is invoked and returned respectively. But we may need to access the data which is deep into the stack and it will be inefficient to pop off all the data to do that. Hence, unlike conventional stack implementation, we have a register called stack pointer that points to top of the stack such that all the addresses smaller than the address to which the stack pointer points are considered as garbage and all the address larger are considered as valid.

Stack bottom – It is the highest valid address of the stack. When the stack is initialized the stack pointer points to stack bottom.

Stack limit – It is the smallest valid address of the stack. When the stack pointer goes below this address, then there’s stack overflow.

Frame pointer – When a new function is invoked the frame pointer points to where the stack pointer was and when the function returns the stack pointer points back to where the frame pointer is.

Return address – It points to address (within the caller function) to which the control should pass when the callee (current) function returns.

Static link is for the nested functions. When a function (nested function) is defined within another function (enclosing function), the nested function may need to access the variables of the enclosing function. Therefore, the nested function’s stack frame should be able to access the enclosing function’s frame. This made possible by static link which points to the address of the enclosing function’s frame.

Try to understand below, diagram on the basis of above definations and corelate how the fucntion calls works.

I get a chance to get this some where so sharing the knowlege here.

Thursday, May 12, 2011

Movie Threaters in Las Vegas....

1. Regal Cinemas Red Rock Stadium 16

(702) 233-6948
11011 W Charleston Blvd,
Las Vegas, NV

2. Tropicana Cinema Incorporated
(702) 438-3456
3330 E Tropicana Ave,
Las Vegas, NV

3. United Theatres
(702) 655-0005
8612 Wild Diamond Ave,
Las Vegas, NV

4. UA Rainbow Promenade
(702) 221-2283 2321
N Rainbow Blvd,
Las Vegas, NV


5. Century 16 South Coast
(702) 260-4061 9705
S Las Vegas Blvd,
Las Vegas, NV


6. Brenden Palms Casino
(702) 507-4849
4321 W Flamingo Rd,
Las Vegas, NV


7. G & G Theater Service
(702) 823-1398
3311 S Rainbow Blvd,
Las Vegas, NV

8. UA Showcase
(702) 225-4828
3769 S Las Vegas Blvd,
Las Vegas, NV

9. Rave Motion Pictures
(702) 260-1266 6587
Las Vegas Blvd S,
Las Vegas, NV

10. IMAX - Luxor Hotel
(702) 262-4629 3900
Las Vegas Blvd S,
Las Vegas, NV

Health Benefits of Cashews

  Benefits of Cashews. Healthy food is an integral part of healthy body. Regular exercises such as Yoga and healthy diet is important to...