July 20, 2011

What is the light year distance of the Sun from Earth?



This post is for you both, Neeraj and Pritam. I tried to give the answer of your question – “What is the light year distance of the Sun from Earth?

As the light year is a big unit which is used to measure long distances (length). It is not feasible to convert it from km to light year. Let’s see how it is difficult.

To understand all this, first you need to understand the concept of light year. Light year is not a unit of time; it is the unit of distance. Usually people misunderstood the term because of the word ‘year’. Light year is the distance traveled by light in a year.

The mean distance from Sun to Earth is 149.6 million km i.e. 1 AU (Astronomic Unit). The distance between Sun and Earth is varies according to the the Earth moves.

1light year = 9460800000000 km = 9.4 trillion km
and Sun to Earth distance is 149.6 million km

So, the distance between Earth and the Sun is very small (in million km) as compare to 1 light year (9.4 trillion km). So it is not feasible to give that distance in light year. (This is same as, you are asking the distance between Jalgaon to Bhusawal in Millimeter).

Rather than giving the distance in light year, I am giving it in light minute.
1 light second = 300 000 km/s = 3X108 m/s (light travel the distance in 1 second)
1 light minute = 18 000 000 km/s = 18 million km/s

As we know, it takes 8.31 min to travel light from Sun to the Earth.

The distance between Sun and Earth is 8.31 light minutes.

18 000 000 X 8.31 = 149580000 = 149.58 million km

Note:- Moon – Earth distance is about 1.282 light Seconds

Note:- Vacuum is the absence of matter, so there is no any such place exist in the universe where vacuum is present. (This is not part of your query but this is important for your project work)


May 20, 2011

KenKen - a nice puzzle game

Ken Ken is a puzzle game. This game increases our mathematical and logical ability. This game is invented by Japanese teacher named as Tetsuya Miyamoto in 2004. This game is also known as KenDocu, MathDocu, CaluDoku. This game is published in near about 40 newspapers over the world.  I got to know about this game from Sunday Times of India.

This game is played in various grids like 3X3, 4X4, 5X5, 6X6, 7X7, 8X8 and 9X9.
If you are playing 5X5 then you can fill number from 1 to 5 only.

Rules:-
Rules are very simple
1. Each row and column contains exactly one number i.e. no number is repeated in row or column.

2. Each bold shaded group of cells called cage. There is a target number written in upper left corner in one cell with a mathematical operators (+, -, *, /). You have to use that mathematical operator and you have to get that target number. You can repeat the number is the cage but not in row or column.

Enjoy the playing...

May 4, 2011

My C++ Experiments

The following program will access the private variable outside the class which is theoretically not possible in C++.
'info' private variable will be assigned using the ‘int’ pointer variable ‘a’.

#include<iostream.h>
#include<conio.h>
#include<process.h>

class Node
{
private :
int info;
public :
void disp()
{
cout<<info<<"\n";
}
};

void main()
{
Node *n;
int *a;
clrscr();
a = (int *) n;
*a=30;
cout<<*a<<"\n";
n->disp();
}


The following program a very interesting example of 'for loop'. Do you think the program will give syntax error or it will go in infinite loop?
It won’t. It will just print ‘1’. To know how, you should learn 'for loop' very carefully or visit me personally or left your email in comments because it is very 

difficult to explain here. 

#include<iostream.h>
#include<conio.h>
void main()
{
int i=0;
for(;i++;cout<<i)  ;
cout<<i;
}

April 15, 2011

आंतरराष्ट्रीय महिला दिनाच्या निमित्ताने महिलांना आत्मपरीक्षणाची गरज...

आंतरराष्ट्रीय महिला दिनाच्या निमित्ताने हा लेख लिहितो आहे. या लेख मध्ये माझे मत मांडायचा प्रयत्न करत आहे, मी यात काही कटू सत्य लिहित आहे पण कुणा दुखवायचा माझा मुळीच हेतू नाही......


८ मार्च च्या सकाळ ची सुरुवात लोकमत च्या पहिल्या बातमीने झाली. त्यात महिला बाबतीत  काही survey चे results दिलेले होते ते वाचुन आनंद झाला. बहुतेकांनी ते results वाचले असतील पण मी त्यातील वेगळा view मांडणार आहे.

मी काही दिवसापूर्वी एक talk show बघितला, त्यात एक महिलेच म्हणण होत कि या वर्षी च्या budget मध्ये महिला करता काहीच ठोस केलेले नाही त्यामुळे महिलांची प्रगती होत नाहीये. मी मान्य करतो की खरच budget मध्ये असे काहीच केलेले नाही, पण.......जर डॉ. कल्पना चावला (the only person who traveled space twice), इंदिरा गांधी (honored as “the only man in parliament”), डॉ. किरण बेदी (India’s first and highest ranking woman police officer) यांनी ही जर महिला करता provision असलेल्या budget ची वाट बघितली असती तर??? आज वरील नाव आपण इतक्या अभिमान ने घेऊ शकलो असतो? ज्यांना खरच काहीतरी करून दाखवायची तळमळ असते, ते अशी भाषणबाजी करत पण नाही आणि अशा चुकीच्या संकल्पना मांडत पण नाही. डॉ. किरण बेदी नी एका लेख मध्ये लिहील आहे की पहीले स्वतः चा विकास करा, मग दुस-यांचा.
यातून घ्यायचा भाग असा की आजकाल महिला, डॉ. किरण बेदी च्या वाक्याच्या जरा उलटच करत आहेत अस नाही वाटत? मी तर डॉ. किरण बेदी च्या वाक्याला पूर्ण पणे सहमत आहे. पहीले स्वतः चा विकास करा मग दुस-यांचा....कारण
१. जर आपण पूर्ण पणे सक्षम नसलो तर दुसरे आपल अस्तित्व मानत नाही. २. अशा पुढारी कामात आपणच मागे राहून जातो. (स्वतः चा विकास करण्याच limit स्वतः च ठरून घेतलं पाहीजे, कारण कुणाला स्वतः च्या खोट्या प्रशसेत मोठेपण(विकास) वाटतो तर...कुणाला भाषण बाजीत....)


माझ्या निदर्शनातील आलेला महिलांचा सर्वात मोठा आणि महत्वाचा मुद्दा असा की, जर तुम्ही एखाद्या (ओळखीच्या) महिलेला मुद्दाम चिडवा, तर ती तुम्हाला जास्त प्रतिकार नाही करणार पण जर का तुम्ही स्त्री जाती विषयी जरी एक शब्द ही काढला तर ती तुम्हाला फाडून खायला कमी करणार नाही. या बाबतीतच १ उदाहरण सांगायचं म्हटलं तर, तुम्ही जरा ३३% आरक्षण रद्द करण्याबाबतीत बोलून बघा...ते त्यांच्या शैली मध्ये तुमच्या अंगावर धावून येतील...तो आमचा हक्क आहे....इत्यादी इत्यादी....पण कुणी या गोष्टी चा समाजावर काय परिणाम होईल हे विचार केलाय??? जर सर्व क्षेत्रात आरक्षण झाल तर बेरोजदारी किती वाढेल हे सुद्धा विसरून चालणार नाही, आणि बेरोजदारी जर वाढली की त्याचे समाजावर वेगळे परिणाम होतील...चोरी चे प्रमाण वाढेल इत्यादी इत्यादी...
....मला नाही वाटत कुणी या सर्व बाबींवर विचार केला असेल....आणि जर कुणी केला असेल तर ते स्वार्था पोटी चूप बसले असतील....महिला चूप बसतील कारण महिला वर्गा ला राखीव जागा मिळतील म्हणून आणि पुढारी लोक त्याला समर्थन करतील कारण त्यात त्याचं नाव मोठ होईल...पण यात सामान्य जनतेच काय???....आधी जाती वरून...आता स्त्री-पुरूष वरून भांडण.....पुढे कशा वरून होईल देव जाणे....आपण समाजाला अजून मोठ्या दरीत ढकलत आहोत अस नाही वाटत?
जर तुम्ही महीला सक्षमीकरण आणि सबलीकरण चे पुरस्कर्ते असाल तर जे मूळ कारण आहे त्यावर जोर द्या ना....२०११ च्या जनगणने नुसार भारतात फक्त ६५% महीला साक्षर आहेत...बाकीच्या ३५% महिलान वर लक्ष केंद्रित करा ना....पण मला माहितीय या वर कुणी कृती कारण तर दूर विचार सुद्धा करणार नाही.

या लेख चा असा अर्थ नाही की मी स्त्री विरोधी आहे...मी फक्त अशा गोष्टी वर प्रकाश टाकायचा प्रयत्न केला की ज्या गोष्टीवर बहुतेक लोक विचारही करत नाही...खर तर मी समान नागरी कायद्याचा समर्थक आहे. ज्यात स्त्री आणि पुरुषांना समान हक्क (आणि कर्तव्य) दिली आहेत. लोकमत मध्ये दिलेल्या survey मध्ये महिलांना त्यांच्या कुटुंबात मान मिळतो अशा म्हणणा-या ६५% महीला आहे...वाचून बर वाटल...पण मनाला नाही पटत की हे सर्व महिलांना ची स्थिती दर्शवित (कारण मी मानतो की statistics is always lie)गरीब वर्गा तील महिलांचा अभ्यास यात झालेला नसेल अस मला वाटत...पण ती ही परिस्थिती सुधारू शकते जर समान नागरी कायदा जर अस्तित्वात आला तर.......सर्वोच्च न्यायालयाने देखील भारतात समान नागरी कायद्याला समर्थकता दर्शवली आहे. पण हे राजकारणी लोक त्यांच्या स्वार्था करता अशा चांगल्या गोष्टी होऊ देत नाही. मी कॉंग्रेस विरोधी नाही तरीही सोनिया गांधी ना दोषी मानेन...publicity stunt म्हणून पंतप्रधान पद नाकारलं...नंतर स्त्री पुरस्कर्ती stunt म्हणून एका स्त्री ला राष्ट्रपती बनवलं...स्वतःला विचारा की...खरच प्रतिभाताई पाटील ह्या राष्ट्रपती पदा करता लायक होत्या??? उत्तर नाही असाच मिळणार.....जर तुम्हाला(राजकारणी लोकांना) दुसरा option मिळाला नाही म्हणून तुम्ही कुणालाही कोणत्याही पदावर बसवणार???...इथेच हे stunt प्रकरण थांबल नाही....सोनिया जी नी अजून एक कारनामा केला....लोकसभेतली पहिली महीला speaker म्हणून मीरा कुमार यांची निवड केली... speaker पदाची व्यक्ती कशी असायला हवी....जर महीलाच speaker म्हणून नेमायची असेल तर त्या पदाला लायक व्यक्ती नेमा ना.......मला मान्य आहे की मीरा कुमार यांचा अनुभव चांगला आहे आणि त्यांनी उच्चआयुक्त पदी काम केलेल आहे पण दुस-याही ब-याच महीला खासदार होत्या की ज्या speaker बनू शकल्या असत्या...त्यांना सोडून न बोलणारी व्यक्ती का??? अजूनही stunt चालूच आहे...आता ३३% आरक्षण......अशा या राजकारणी लोकांची मला चीड येते...हे राजकारणी स्वार्था करता जनतेचा विचारच करत नाही....महाराष्ट्र सरकार ने स्थानिक स्वराज्य संस्था करता ५०% आरक्षण जाहीर केल...पण फायदा काय??? या आधी महीला सरपंच करता आरक्षण नव्हत..नाहीये??? पण सत्य परस्थिती अशी की त्यांच्या नावा खाली दुसरेच सत्ता चालवतात....

महिलान वर अत्त्याचार होतात म्हणून ४९८(अ) कायदा आला...त्याचे खूप कडक स्वरूप होते जेणे करून महिला वरचा अत्याचार थांबवता येईल पण त्याच काय झाल?? आज अशी परिस्थिती आहे की या कायद्याचा गैफायदा घेऊन महीला खोट्या केस करतात. अस सिद्ध झालं की ९८% केसेस ह्या खोट्या असतात म्हणून सर्वोच्च न्यायालयाने याला कायद्याचा दहशदवाद म्हणून संबोधल आहे. आता पुरुषांच्या संरक्षणा करता ४९८(ब) कायदा येतोय की जेणे करून पुरूष वरील अत्याचार थांबवता येतील. आणि आपण म्हणतो की भारत हा पुरुषप्रधान देश आहे.

जर ही परिस्थिती बदलावायची असेल तर डॉ. किरण बेदी चे rule पाळा...स्वतः बदला आणि नंतर दुस-याना ही बदलवा... म्हणूनच मी म्हणतो की महिलांनी आत्मपरीक्षण केलच पाहीजे.

March 28, 2011

GeoTools DbaseFileReader Sample Code

           
           

I observed that, the code given in geotools documentation  is wrong. The statement missing semi colon and major mistake is DbaseFileReader constructor is passing single argument. Actually there is no such constructor.
This sample code read the DBF file and display the row on console.

I am using NetBeans 6.9.1 , JDK 6 and GeoTools 7.2.1

I used following classes

import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.channels.FileChannel.*;
import org.geotools.data.shapefile.dbf.DbaseFileReader;        


Following code read the DBF file from c: drive with the name jal.dbf. You can change the file name with your file location. You can paste this code to your command button event listener method.

Code:-
File selectedFile = jFileChooser1.getSelectedFile();
FileChannel in = null;
        try {
           in = new FileInputStream(selectedFile).getChannel();        //read the DBF file //Dynamic path
           //in = new FileInputStream("c://jal.dbf").getChannel();       //Static path   
        } catch (FileNotFoundException ex) {
            Logger.getLogger(SearchengineView.class.getName()).log(Level.SEVERE, null, ex);
        }
    DbaseFileReader r = null;
    try {
    r = new DbaseFileReader (in, false,Charset.forName("ISO-8859-1"));  //line was wrong in original code
    } catch (IOException ex1) { }

    Object[] fields = new Object[r.getHeader().getNumFields()];
    while(r.hasNext())
    {
            try {
                r.readEntry(fields);
                System.out.println(r.readRow());   //display the row on console
              } catch (IOException ex) {
                Logger.getLogger(SearchengineView.class.getName()).log(Level.SEVERE, null, ex);
            }
    }
        try {
            r.close();
        } catch (IOException ex) {
            Logger.getLogger(SearchengineView.class.getName()).log(Level.SEVERE, null, ex);
        }

           
           
         

February 3, 2011

DVD-RAM ???

If you look over the items of “My Computer” in Windows XP, you may see DVD-RAM drive. In early days it, was CD-ROM or CD-RW, so what does DVD-RAM drive means?

DVD-RAM disk
Basically, DVD-RAM (Random Access Memory) disk is the same as DVD-ROM or DVD, but which is having read/write facility. In simple word, DVD-RAM is like a re-writable DVD but not exactly the same. DVD-RAM is excellent in damage protection and they have long life than other DVD formats.

 In the normal DVD, you can only read the data from disk but cannot write. In DVD-RAM, you can re-write data many times as per requirement. DVD-RAM is used in camcorders, set top boxes, and etc.

Your DVD-RAM drive is able to write the DVD-RAM disk and DVD.

January 18, 2011

First moon mission – Who was the third person?

All know the fact that, NASA’s Apollo 11 spacecraft landed on moon on 20th July 1969 and the commander Neil Armstrong became first human to walk on the moon. You might also know about the Lunar Module Pilot Adwin Aldrin Jr. who became second moonwalker. But some of you might not know that, in this mission three people went to moon, out of which 2 walked on the moon surface and third person Command Module Pilot Michael Collins orbited above the moon surface in command ship named as Columbia. So the bottom line is 3 people went to moon but 2 walked on moon surface and one was in the ship.

January 17, 2011

Really, The Great Wall of China is the only manmade object visible by unaided (naked) eyes from the moon or space?


FDI publication’s “Around D Word” book states that, there are only 2 artificial objects which can be seen from space, one is Kansai Airport which is located at Japan and other is The Great Wall of China. Then I started quizzing myself about this. I am putting some finding of my investigation.
Little background about this rumor/misconception/myth,
Þ In 1754, English antiquary William Stukeley wrote in letter, “This mighty wall of four score miles in length (Hadrian's Wall) is only exceeded by the Chinese Wall, which makes a considerable figure upon the terrestrial globe, and may be discerned at the moon”
Þ Similar kind of reference found in American-published magazine The Century in 1893
Þ In 1895, Henry Norman states "besides its age it enjoys the reputation of being the only work of human hands on the globe visible from the moon."
Þ In 1932, it was appeared publicly in “Ripley’s Believe It Or Not” cartoon
Þ In 1938, Richard Halliburton's book “Second Book of Marvels” assured readers that The Great Wall could be seen from space and claimed that it was the only man-made structure visible from the moon
This claim was made long before the first man-made satellite, Sputnik, was sent into orbit, and 31 years before humankind had set foot on the moon.
The answer of the above myth:
In case of moon the answer is NO.
The wall is a maximum 9.1 m (30 ft) wide, and is about the same color as the soil surrounding it. Based on the optics of resolving power (distance versus the width of the iris: a few millimeters for the human eye, meters for large telescopes) only an object of reasonable contrast to its surroundings which is 70 mi (110 km) or more in diameter (1 arc-minute) would be visible to the unaided eye from the moon, whose average distance from Earth is 384,393 km (238,851 mi). The apparent width of the Great Wall from the moon is the same as that of a human hair viewed from 2 miles away. To see the wall from the moon would require spatial resolution 17,000 times better than normal (20/20) vision.
In 2001, Neil Armstrong stated about the view from Apollo 11: "I do not believe that, at least with my eyes, there would be any man-made object that I could see. I have not yet found somebody who has told me they've seen the Wall of China from Earth orbit. ...I've asked various people, particularly Shuttle guys, that have been many orbits around China in the daytime, and the ones I've talked to didn't see it."
Apollo 12’s astronaut Alan Bean: "The only thing you can see from the moon is a beautiful sphere, mostly white (clouds), some blue (ocean), patches of yellow (deserts), and every once in a while some green vegetation. No man-made object is visible on this scale. In fact, when first leaving earth's orbit and only a few thousand miles away, no man-made object is visible at that point either."
In case of space the answer is hazy.
Actually, answer of this question is depends on, what do we mean by SPACE? If we take "space" to mean a low Earth orbit (160 km), even though its visibility from that distance is questionable.
Some claims that, we can see it from this distance with naked eyes. U.S. Senator Jake Garn claimed that he was able to see the Great Wall with the naked eye from a space shuttle orbit in the early 1980s, but his claim has been disputed by several U.S. astronauts. Veteran U.S. astronaut Gene Cernan has stated: "At Earth orbit of 100 miles (160 km) to 200 miles (320 km) high, the Great Wall of China is, indeed, visible to the naked eye." Ed Lu, Expedition 7 Science Officer aboard the International Space Station, adds that, "it's less visible than a lot of other objects. And you have to know where to look."
But other authors have argued that, due to limitations of the optics of the eye and the spacing of photoreceptors on the retina, it is impossible to see the wall with the naked eye, even from low orbit, and would require visual acuity of 20/3 (7.7 times better than normal).
Kamlesh P. Lulla, NASA's chief scientist for Earth observation at Johnson Space Center in Houston, directs observation science activities from the Space Shuttle and the International Space Station. He says that generally the Great Wall is hard to see and hard to photograph, because the material from which it is made is about the same color and texture as the area surrounding it. It's questionable whether you can see it with the unaided eye from space. "The shape, the age of the structure, the resolution of the camera, the condition of the atmosphere -- all these factors affect the ability to detect an object from space." But, he added, "you can see the wall in radar images taken from space."
On the whole issue NASA says “The Great Wall of China, frequently billed as the only man-made object visible from space, generally isn't, at least to the unaided eye in low Earth orbit. It certainly isn't visible from the Moon.

To conclude, The Great Wall of China is not visible from either moon or space.
The Beijing Times added, "Having this falsehood printed in our elementary school textbooks is probably the main cause of the misconception being so widely spread."
According to the BBC, "For decades, elementary schoolbooks have maintained that the Great Wall of China could be seen from space - but now the books are being rewritten."
But in India, such wrong information spreading is still going on…
(This article is written on 12-01-2011)

Popular Posts