Saturday, November 19, 2011
Tuesday, October 11, 2011
Monday, October 10, 2011
Saturday, September 3, 2011
Tuesday, August 30, 2011
Friday, April 29, 2011
Thursday, April 28, 2011
Q-BASIC
This tutorial is laid out in what I believe to be a good order for learning QBasic. I have been frustrated often because the QBasic help menu has not explained things to me well enough. If you have seen the QBasic help menus you'll know that they use very formal language. This tutorial was written more casually, so you should be able to catch on fairly quickly. I hope that this document helps you get what you want out of QBasic.
Command: PRINT
PRINT can be used in many ways. If you were to use PRINT without any parameters, it would simply cause the cursor to move down one row and return to the left side of the screen (also known as a carriage return). This does us not much good, but now you know. To print the word QBASIC on the screen, you would need PRINT "QBASIC" in your program- pretty easy. You may also print numbers on the screen in two different ways. One is PRINT "2000". The other way is PRINT 2000. The first way is printing 2000 as text, while the second is printing it as a number. Printing numbers in this way is not very practical, but it is more often used for displaying the values that variables have been assigned. Later on in the section about variables, I will show you how to use a variable in the PRINT command.
PRINT "This is how to use the PRINT command"
PRINT "It's amazing!"
PRINT 2000
PRINT "The number is: "; 2000
Output:
This is how to use the PRINT command
It's amazing!
2000
The number is: 2000
Command: CLS
Once we have a bunch of words on the screen, they can get rather annoying. Well, what do you know! There is something you can do about it. CLS is probably the simplest command in QBasic. There is one way to use the CLS command; type it in. When QBasic executes this command, the screen is cleared and the cursor returns to the top left corner of the screen.
PRINT "This line of text is going to be erased"
CLS
PRINT "Only these words are on the screen"
Output:(At top left corner of screen)
Only these words are on the screen
Command: BEEP
Of course, there is much more to programming than text. The BEEP command when in a program makes the speaker make a tone for about a half a second. This is a very old command, but it works for teaching. You will learn how to produce different frequencies and lengths of sound later.
CLS
PRINT "The speaker is going to beep!"
BEEP
PRINT "Cool!"
Output:
The speaker is going to beep!
(speaker emits tone)
Cool!
Tool: REM
Before we get any further, it would be a good idea to know how to explain your programs within the source code without affecting the program. You can do this using the REM (remark) command. To make a remark in your program type REM followed by any text that you want. REM causes QBasic to ignore everything on the line that is to the right of it. Take a look at the example.
REM This program demonstrates the REM command
PRINT "The REM command won't work if inside quotes"
REM Here is another remark line
REM You can have many remarks in a program
Output:
The REM command won't work if inside quotes
Command: END
In the case that you want to stop the running of your program even though there are more lines of commands (this is applicable mainly in debugging), the END command is what you need. END will trick QBasic into thinking that there are no more lines to run and it will return you to the editor. You may not use this command for some time, but it is just something to know.
REM The END command will stop the program"
PRINT "First line of text"
PRINT "Second line of text"
END
PRINT "Third line of text
PRINT "The third and fourth lines won't be displayed"
REM Oh well!
Output:
First line of text
Second line of text
Command: GOTO
Now we get into the more complex part of QBasic. The GOTO command will make QBasic run lines of commands in different order than what they are written. At the moment, there is not much use for this, but later you will see that it is very important. The GOTO command requires that you have a destination for it. You have to tell it where you want the program execution to go. This is called a line number. In earlier versions of Basic, every line in the program was required to have a line number. This is not so any more. In QBasic, the line number (or label) can be either a number, a word, of a combination of the two as long as you only have that combination as a label once in the program.
PRINT "Line of text #1"
GOTO 10
PRINT "This line gets skipped"
10:
PRINT "Line of text #2"
GOTO abcd
PRINT "QBasic will not execute this line either"
abcd:
PRINT "Line of text #3"
Output:
Line of text #1
Line of text #2
Line of text #3
As you can see, each label must be followed by a : in order for it to work. Also, the labels "10" and "abcd" only appeared as labels once in the program. This does not mean that you may only have one GOTO 10 command in the program; you can have as many as you need. This will be demonstrated later.
Concept: Variables
Before learning any more commands, you now must learn about variables. A variable in it's simplest form is a letter or word that represents a number that it has been assigned. Examples of QBasic numerical variables are: x, y, num, hjk1, d45. (A variable may contain numbers as long as it starts with a letter.) QBasic variables are NOT case sensitive. For example: x = X and hjk1 = hJK1. Once a variable has been assigned a number, it will be the equivalent to that number.
REM Syntax for assigning variables
x = 25
q = 4
op1 = 17
(There is no output for this program)
Once these lines have been executed, the variable x, y, and op1 will be numerically equivalent to 25, 4, 17 respectively. But I can't do anything with them yet. Well, Remember before when I talked about using variables in the print command? This is where they fit in. In the example x and q are assigned values using the = sign and then using PRINT the values are displayed onto the screen.
CLS
x = 25
q = 4
PRINT x
PRINT q
Output:
25
4
Command: IF. . .THEN. . .ELSE
The "IF...THEN...ELSE" command bring variety into a program. It is the main controller of program line execution (the way the program runs). When an IF...THEN statement is executed, QBasic evaluates the criteria for decision and directs the program flow accordingly. Look at this example line of code:
IF A = 1 THEN GOTO 100
The criteria for this IF...THEN statement to send the program flow to line 100 is for the variable `A' to hold a value of 1. If, in this case, the value of `A' does not equal 1, the program would continue execution onto the following line of the program. Now we add the ELSE part of the command:
IF B = 1 THEN GOTO 100 ELSE GOTO 200
The ELSE part of this command is optional. The reason for it is to allow for the criteria of the IF...THEN statement not to be met. In the above example, let us say that B = 3. Since B does not equal 1, the command after THEN (GOTO 100) is not executed but rather the one after ELSE (GOTO 200). The completely literal description for this IF...THEN statement is: If the value of `B' is 1, continue running the program at line 100, but if NOT, continue to line 200 instead. You must realize that the GOTO command is not the only one that can be used in this statement. Any other command can be executed via IF...THEN statements such as CLS, BEEP, PRINT, etc. Here are a few of the formats of different kinds of variables in IF...THEN statments:
IF A = 1 THEN... If `A' equals 1
IF A > 1 THEN... is greater than 1
IF A <= 1 THEN... is less than or equal to 1
IF A <> 1 THEN... does not equal one
Some examples of using the IF...THEN command for something other than GOTO:
IF A = 1 THEN PRINT "Well what do you know? A = 1"
IF A = 2 THEN BEEP
IF A = 3 THEN N = 15
If you want, you could copy the above three examples and put them into a program. When QBasic gets to those lines, they evaluate the value of `A' and choose what commands to execute. If `A' is 1 it prints a message, if 2 it beeps, if 3 it sets that value of `N' to 15. This may sound complex at first, but once you learn it, the concept is really quite simple.
Command: FOR. . .NEXT
One of the most time saving commands (both programming time and processing time) is the FOR...NEXT command. A single FOR...NEXT loop involves only one variable, but that one variable has very valuable characteristics. The syntax for the command is:
FOR variable = beginning_number TO end_number
.
.
.
NEXT variable
For example:
FOR T = 1 to 5
PRINT T
NEXT T
Output:
1
2
3
4
5
The variable `T' was put into a loop, increasing by 1 for each time the cycle was run. Any commands inside the FOR...NEXT loop that depend on the variable `T' are affected. In the above example, as you can see, when the PRINT command displayed the value of `T' it had incremented by one for each time around the loop. One of the valuable aspects of FOR...NEXT is in animation. That is way more advanced, but just as an example, the FOR...NEXT loop makes it easy to "drag" a picture across the screen with a simple loop that changes its coordinates. Sound tricky? Sorry if it confuses you. Never mind then.
If you are the type that always wants to know more, here is something for you. To get a variable to count downward, do this:
FOR T = 10 to 1 STEP -1
.
.
NEXT T
Or you could get it to count up (or down using a `-' sign) by a specific increment like this:
FOR T = 1 to 100 STEP 10
.
.
NEXT T
Conclusion
This tutorial can merely instruct you on the basics of QBasic. There are hundreds of commands/functions used in QBasic. Refer to the Advanced Tutorial for learning specifics on individual QBasic commands. The Advanced Tutorial is index-based to make the locating of specific information easier
Sunday, April 17, 2011
Happy new year
Saturday, February 26, 2011
Saturday, February 19, 2011
GLC
THANK ALL FOR SUPPORTING ME..
Working as the computer officer
HAVING FUN IN MY JOB. ONE GOOD NEWS IS THAT, FROM YESTERDAY, RAJDHANI INTERNATIONAL WEEKLY, PUBLIC FROM NEPAL TOO...
Sunday, October 17, 2010
Thursday, October 7, 2010
How to Format Nokia N72, N73, N81, N95, NSeries Mobile Phones.
Method 1: Three Finger Reset for Nokia Phone
1. Switch off your Nokia phone.
2. Hold down the following three keys, Green (call answer button) * Key, and Number ‘3? key.
3. While holding these buttons, press the power button and switch on the phone.
4. Wait for message ‘Formatting’ to appear on the screen and release all keys once you see that message.
Method 2: Hard Format of Nokia Mobile Phone
1. Switch off your Nokia phone
2. Now Press following key sequence *#7370#
3. Enter Default lock code is 12345.
4. While holding these buttons, press the power button and switch on the phone.
5. Wait for message ‘Formatting’ to appear on the screen and release all keys once you see that message.
Method 3: Soft Reset of Nokia Mobile Phone
1. Switch off your Nokia phone
2. Now Press following key sequence *#7780#
3. Enter Default lock code is 12345.
4. While holding these buttons, press the power button and switch on the phone.
5. Wait for message ‘Formatting’ to appear on the screen and release all keys once you see that message.
Please Note: The Above Nokia Phone Formatting method will erase all your Phone data. Sodo backup before proceeding for Formatting
Saturday, September 4, 2010
Muna Madan ,by Laxmi Prasad Devkota
by Laxmi Prasad Devkota
adaptation by Pallav Ranjan
copyright of this English version held by Pallav Ranjan
All rights reserved
[Muna]
Fire,
a fire burns in my mind.
Don't leave, my life,
don't leave.
Brightness of eyes,
my star of night,
don't take your light.
Tear open this chest of mine
perhaps the pictures
in my heart,
when you see them,
will change your mind.
Give me poison
to drink instead.
See? My pain
falls with my tears,
but tears do not speak,
thoughts stay within the mind.
Love, even my tears
fail to speak.
[Madan]
Darling Muna,
don't speak like this,
I will be returning.
For twenty days
I will stay in Lhasa,
I will travel twenty days
on the road.
Smile at me,
for if you would smile
I could raise myself
to Lord Indra's Heaven.
My intentions
are to achieve or to die,
do not put a barrier of tears
upon my roads.
The cranes return
with the sun.
It will be a great day,
the day of our meeting.
[Muna]
My Rama, my Krishna:
the sun at night,
smiles as you prepare your flight,
how shall I combine these?
Don't leave me here.
I sparkle beside you,
without you I am stone.
Take me with you,
hold my hands,
we will face jungles,
mountains, cliffs,
and murderers.
[Madan]
Muna, my Muna,
look at mother, look at her,
the oil that feeds that lamp
is about to dry.
Both of us can't leave her,
stay, care for her.
Her eyes that have seen
three twenty winters
shine as she looks
upon your face.
[Muna]
Pale hair, brittle body,
a mother's love
could not tie your feet.
Shadows of her affection call
but cannot hold you back.
What will you gain
in that land
as precious as her love?
Bags of gold,
they are the dirt of hands,
the soup of nettles,
our vegetables,
a peace in mind
are better. Stay,
satisfy your thoughts.
[Madan]
But what do I do?
- a gulp of milk
for my mother's throat,
- her dreams to build a resthouse
and taps for her people,
- on your delicate hands
pretty bangles,
- a strong foundation for a home
made insecure by loans
these wishes sing in my mind,
their voices are in my mind.
The music moves my feet Muna.
There is God above
and I have a heart.
I will cross those angry floods.
I mean well, but if things go wrong,
at least I will have died
with a song.
[Muna]
You tighten the knot
inside my heart.
Do not return then,
I will draw an unforgettable
picture of your face
for remembrance.
The maidens of Lhasa dance,
they seem as if they are carved of gold,
their voices laugh like the streams
as they play on barren hills and fields.
Leave, my love,
darkening the home and the city,
even tears do not have strength.
Maybe in darkness,
memories will gleam
or flash like lightning.
And sorrow shower
upon my clothes.
[Narrator, describing Madan's journey]
Naked earth, cloud mists,
climbs are hot, flowers poison,
poles with flags are death.
There, see monasteries
and Lamas with shaven heads.
One day the roof of gold
against the skies
beneath the Potala Palace,
Lhasa smiled.
Yak skin walls,
angels on cloth.
Young Bhotenis white as bones,
passers by bowing
before gurus with sunken eyes.
[Narrator, describing Muna at home]
Pearls fell. Pearls fell
when Muna smiled.
But now she wilts.
In sleep, tears wet her face,
her days are long,
her nights are long,
her time is sad.
In her voice, hear,
there is a soft tearful drizzle.
After the end of light,
even a flickering lamp is bright.
Women came with stories,
men showed they cared,
When you see a rose, brother,
do not touch it.
Do not with lust, spoil it.
A wondrous being
is a jewel of God
do not try and corrupt it.
[Muna]
Go to the worms of the city
and tell them your words.
Make the moon fall,
make mountains rise,
I will wait for his feet
and my Heaven,
God has created
four beautiful days,
that is life,
don't throw mud
to spoil them.
[Narrator, describing Madan's journey]
Smooth pebble gold,
new country, fresh light,
the smell of musk.
Madan stayed, six months passed
before memories came like water:
ill mother, Muna's eyes large with weeping.
At night he was unable to sleep.
Hiding a heavy bag of gold in clothes,
gathering the musk,
he met up with a few friends
and left for home.
[Muna]
What a nightmare!
A buffalo dragged me down!
I fell in mud, mother,
the darkest buffalo dragged me down.
[Madan's mother]
Come, darling,
don't shiver with fear,
I will take all the ill
that comes to you
upon my head,
don't shake.
[Muna]
My eyelids quiver,
my heart is pain,
a shadow of evil
has come into our home.
Perhaps he has no time,
perhaps he hopes to come soon,
paths lead through high mountains
maybe this is why he has not come.
[Narrator]
Madan falls ill with cholera on the road home.
[Madan]
Don't leave! Don't leave me
to the crows and vultures!
My friends, I will not die yet.
I will stand,
my throat is dry,
my chest is burning,
wipe these tears from my eyes,
I still have breath.
[Madan's companions]
We have no medication
and no one's here.
Stay! Each of us
has to leave someday,
God will give you salvation.
[Narrator]
Madan wakes and leans on his elbows,
his friends have left, the day drowns in red,
wind sleeps, birds are quiet, it is cold, he falls.
[Madan]
What is this fire?
Does the forest burn?
Is this fire going to kill the dead?
Is it a robber or a thief?
Is it a demon?
Madan decides to call for help.
[Tibetan]
Who cries?…
Your friends are bad.
My house is some miles away,
you will not die. I will carry you there,
you'll be all right.
[Madan]
Tibetan brother, you are a god,
your words are wonderful.
I have been told,
I am a man of lineage
and noble caste.
I hold your feet with respect, brother,
I am holding your feet.
A man's greatness
is determined by his heart
not by the caste
and the lineage he brings.
[Narrator]
The Tibetan carries him to his house, rests him on wool, gives him water and kindness, searches for herbs, crushes them, and makes him drink. He gives Madan yak milk and makes him strong. At Madan's home tangerines are in flower, thoughts are soft and sad.
[Muna]
You have forgotten me.
Tell me, how could you forget?
Which hateful god took you?
I cannot see, hills are covered by curtains.
The image I see of you is empty.
Your voice is tells me stories of happiness
in my sleep. I have no wings to fly with.
I cannot search for my love.
Why have you left our wealth
and stayed in that city.
Are you ill? Do your eyes fill up with tears
when you think of me?
Dust don't touch, thorn don't hurt.
[Narrator]
Madan wants to thank the Tibetan by giving him some of his gold, but the Tibetan refuses material rewards.
[Tibetan]
What will I do with yellow gold?
My children can neither eat this gold
nor will it give them warmth.
My wife is dead, she is in Heaven,
the clouds are her decoration,
her jewels and gold.
Madan weeps.
[Tibetan]
Chance blessed and I have helped.
I will not barter goodness for wealth.
Ask you mother, if you will,
to pray for my children.
[Narrator]
Madan's mother sees a clear face
and calls, the air responds,
the breeze touches her.
No tears in eyes, only a peace
a softness of the evening
reflected on that pond.
She reaches out to Muna.
[Madan's mother]
My darling, it is time to leave,
to cross the river, don't weep.
Everyone walks this way,
the rich and those who suffer poverty.
Earth has to meet the earth.
This flood of unhappiness,
stand against it, do not fall.
I saw the world flower,
I saw it wilt,
and I have known God.
The seeds we plant here
will grow in Heaven.
What you have given, love,
you will get back
when you leave this place.
Look at me, I take all
I have done with me.
The gold that you found in sleep,
I will take with me.
I want to leave now,
but is Madan not coming?
I want to see him before
shutting my eyes to this world
in case I die before I see him, tell him,
the old woman asked him not to weep.
[Muna]
I will clean and shine
the memories of you with tears,
mother, don't worry,
nothing has happened yet.
[Narrator]
Madan's mother begins to shake,
her voice fades,
she feels for Muna's hands at times
and when she holds them,
she asks in a faraway voice,
"Where is my son?"
A great wind shakes the branches,
a crow screams, travelers stare at the peaks.
Madan's head is on his palms,
his arms rest upon his knees,
the crow screams.
Madan looks at the crow.
[Madan]
Did you see my city?
My house is clean in that valley.
Go to my mother, she has white hair,
go to Muna, she is bright.
Tell them that I am well,
tell them not to worry about me,
trees on the lawn must be ripe with fruit,
go, eat, and tell them my story.
[Narrator]
There is strange screaming in the city tonight.
wet eyes, dimmed lamps, strong winds,
dogs cry, no moon.
Rumor of Madan's death
has reached home.
See tears drip from leaves
and a young broken tree.
The old woman's breath struggles.
Muna has fallen.
[Madan]
Why did I come, mother?
What did I come to see?
My mother, you have torn my chest.
Look at my face, mother, look at me.
I have come. I have sinned. Look at me.
Why do you look afar when I am close,
look at me. See me cry. Comfort me.
Don't leave, come back,
don't you recognize me?
I could not even
take care of you mother.
What is this peace
that has spread across your face,
speak to me. How could I hurt
that gentle heart of yours
I have brought bags of gold, mother,
I put them at your feet,
we will make the resthouse
and the taps, mother,
where you point.
Come back, don't look there,
don't point towards the skies.
[Narrator]
Madan goes to his sister when he cannot find Muna.
[Madan]
Tell me, sister, tell me, where is my Muna?
My mother is dying, but I do not see her.
[Madan's sister]
Your Muna went to her parents in sorrow,
when you left and did not come back.
[Madan]
She left my mother alone?
How could she leave her alone when I was gone?
[Madan's sister]
Muna went away from us
when she was ill herself.
She shone like a diamond
among the daughters,
she left because she was unwell.
[Madan]
How is Muna, who has been to see her?
She must ask for water,
who has given my Muna water to drink?
[Madan's sister]
She does not need water, she is cured and healed,
she does not need your herbs.
And my love, I would have met her
but I could not find a road to take me
to her parents' home.
[Madan]
If she is healed why hasn't she returned,
why hasn't she come back?
[Madan's sister]
She searches for roads but there are no roads
to lead her back from her parents' home.
[Madan]
This is strange, what do you mean?
[Madan's sister]
She is over the clouds,
in that city heavy with light.
[Madan]
My sister, tell me Muna is here.
Tell me she is upon this earth.
Tell me when she will be back.
[Madan's sister]
She lives across the river.
On the other side.
But she laughs with the flowers,
dances with water,
blinks with the stars,
speaks with the blackbird,
and her eyes, they shine.
She weeps with the dew
and when she is sad,
you will see the mist sinking.
My brother, Muna is not dead,
the birds have made songs of her,
hear them sing.
[Madan]
Muna isn't dead, tell me she lives.
Tell me she is at her parents' home.
The roots of my hopes,
the wings of my mind,
tell me Muna is here.
Tell me when she will be back!
[Madan's sister]
She is not here, on this side of earth.
She lives where sorrow does not stain.
Across imagination
she picks flowers of happiness
in the gardens of Heavens.
[Madan]
Cruel sister. Your words are death.
Letting the buds of hope open, bloom
and sway before my eyes. Making ears
swallow gulps of poison.
Muna, O Muna, you were the temple of worship
and the chains of life.
Life, why did you leave?
My sister, let me look upon my Muna
call her, sister, let me see her for a little while.
O Muna, my Muna, come down to me,
my queen, let me gaze upon you for a little time.
[Madan's sister]
My brother, my dear brother, take heart,
this dirty life has to leave.
In the end, the wind will take the fistful of ashes,
this blossom of meat has to fall and wilt.
[Madan]
My sister, remember, "My chest wants to explode,"
she said. "What will we do with gold?"
"It is better to eat nettles and satisfy our souls," she said.
God, how could you create her
and then ruin what you have made.
How could you make this flower
and then drag her down like this?
You gave me this flower,
how could you destroy her like this?
My sister, when I first saw her,
when I first saw Muna's face
I never thought that Muna could die,
sister, I thought she would never die.
How could the fire take her?
Where can I find her,
hold her to my chest?
Give me her ashes, sister,
I want to rub her ashes on my chest.
Mother, Muna, I will not stay here.
I will not stay here sister,
I will not stay.
Do not look upon this earth Muna
I am also coming.
With tokens of tears,
with the jewels of love
that you left behind




























