Monday, February 12, 2007

In Comp Sci

This Shabad is by Guru Arjan Dev Ji in Raag Saarang on Ang 1220

ਸਾਰਗ ਮਹਲਾ 5 ॥
saarag mehalaa 5
Saarang, Fifth Mehla:

ਬੈਕੁੰਠ ਗੋਬਿੰਦ ਚਰਨ ਨਿਤ ਧਿਆਉ ॥
baiku(n)t(h) gobi(n)dh charan nith dhhiaao
To meditate on the Lotus Feet of the Lord of the Universe is heaven for me.

ਮੁਕਤਿ ਪਦਾਰਥੁ ਸਾਧੂ ਸੰਗਤਿ ਅੰਮ੍ਰਿਤੁ ਹਰਿ ਕਾ ਨਾਉ ॥1॥ ਰਹਾਉ ॥
mukath padhaarathh saadhhoo sa(n)gath a(n)mrith har kaa naao 1 rehaao
In the Saadh Sangat, the Company of the Holy, is the treasure of liberation and the Lord's Ambrosial Name. 1Pause

ਊਤਮ ਕਥਾ ਸੁਣੀਜੈ ਸ੍ਰਵਣੀ ਮਇਆ ਕਰਹੁ ਭਗਵਾਨ ॥
ootham kathhaa suneejai sravanee maeiaa karahu bhagavaan
O Lord God, please be kind to me, that I may hear with my ears Your Sublime and Exalted Sermon.

ਆਵਤ ਜਾਤ ਦੋਊ ਪਖ ਪੂਰਨ ਪਾਈਐ ਸੁਖ ਬਿਸ੍ਰਾਮ ॥1॥
aavath jaath dhooo pakh pooran paaeeai sukh bisraam 1
My cycle of coming and going is finally completed, and I have attained peace and tranquility. 1

ਸੋਧਤ ਸੋਧਤ ਤਤੁ ਬੀਚਾਰਿਓ ਭਗਤਿ ਸਰੇਸਟ ਪੂਰੀ ॥
sodhhath sodhhath thath beechaariou bhagath saraesatt pooree
Searching and searching, I have realized the essence of reality: devotional worship is the most sublime fulfillment.

ਕਹੁ ਨਾਨਕ ਇਕ ਰਾਮ ਨਾਮ ਬਿਨੁ ਅਵਰ ਸਗਲ ਬਿਧਿ ਊਰੀ ॥2॥62॥85॥
kahu naanak eik raam naam bin avar sagal bidhh ooree 26285
Says Nanak, without the Name of the One Lord, all other ways are imperfect. 26285

18 Responses to “In Comp Sci”

teraroopie said...

#include [iostream.h] // includes iostream
#include "worditer.h" // includes worditer.h
#include "apstring.h" // makes it possible to use word variables
#include "prompt.h" // includes prompt.h
// blank line
// illustrates nested loops using WordStreamIterator class
// to find the word that occurs most often in a file
// blank line
// Owen Astrachan
// 2/13/96
// blank line
int main() // main function of program begins here
{ // opening bracket
int max = 0; // declares the starting value of max to be zero; max is the number of times the most used word occurs
apstring word,maxWord; // declares variables word and maxWord
apstring filename = PromptString("enter file name: "); //outputs prompt
WordStreamIterator outer,inner; // declares two iterators to go through the file one word at a time
// blank line
outer.Open(filename); // open two iterators; this is the slower one
inner.Open(filename); // second, faster iterator
// blank line
for(outer.First(); ! outer.IsDone(); outer.Next())
{ // opening bracket
word = outer.Current(); // current word for comparison
int count = 0; // count # occurrences
// blank line
for(inner.First(); ! inner.IsDone(); inner.Next())
{ // opening bracket
if (inner.Current() == word) // found another occurrence
{ // opening bracket
count++; // increase count of occurrences of current word
} // closing bracket
} // closing bracket
if (count > max) // maximal so far
{ // opening bracket
max = count;
maxWord = word;
} // closing bracket
} // closing bracket
cout << "word \"" << maxWord << "\" occurs " << max << " times" << endl; //outputs word repeated most and number of times repeated
return 0; // returns zero =)
} // closing bracket
// blank line
// now there's green everywhereee

b said...


where's the green? i don't see it : (

TeraRoop said...

haha.. the green shows up in the program we use, bhenji.. it won't show up here.

our assignment was to comment every line of the program to our understanding of the program, its components, and their individual functions. the comments are what come after the "//", and in the program they turned a light green to set them apart from the rest of the program.. most of us decided to be shararti and comment the blank lines and brackets.. although since everyone did it i'll probably take it off before i have to submit the assignment.

i suppose now that there're comments i should leave it up so people don't think you're insane {we all already know i am}

b said...


i don't mind.

The World Must Know The Truth.

b said...

btw did you ever solve that sleep-cycle-related problem you had a while back?

if so, how?

TeraRoop said...

"The World Must Know The Truth."

funny =)

I really should watch my fingers - all of cyberworld knows things about me a lot of people I know well in person don't know. Says a lot about cyberspace and human nature, etc.

So a) how do you know? blog post? random comment? forums?

b) no idea. Sorry I can't be of more help, Bhenji =(

p.s. May I at least know how old you are?

b said...

a) i think it was on discoversikhi a long time ago, but i've been getting similar problems recently.

b) it's okie, i wasn't actually expecting you to remember about it at all.

p.s. alas, i am a youngling yet. you're never going to guess who i am, unless Novtej or Brain leak the information. actually you can guess how old i am, that will be fun =)

(*in an odd mood right now*)


how were your exams?

TeraRoop said...

young as in YOUNG young? like anyone who knows you online but doesnt know you in person would be surprised upon learning your age? like me young? like 13 young? like 11 young?

ah sleep problems.. what's to become of our world =(

yeah, i thought it was forums.. ummm.. i think i just started waking up earlier, and i forced myself to stay awake when i got home rather than pass out from weariness.. so i started falling asleep earlier at night.. i was doing pretty good until a while ago actually.. now i definitely sleep better, but still not right. i wake up at three every morning and dont know why haha.. wait i think i do =D but yeah.. i go to bed and it takes me an hour/hour and a half to fall asleep..

bhenji it could be stress.. try to do simran before sleep {i'm one to talk =(}, don't eat right before sleeping, try warm milk.. ummmmm.. and don't stress. i realize that's easier said than done, but it's starting to work for me.. i start stressing and then i go no. bass. and that's it. =)

ahhhh dont listen t ome im an idiot

good luck youngling. i hope you sleep better soon.

exams=boring. =)

b said...

as in 17-young.

TeraRoop said...

In Comp Sci again..

Waheguru Ji Ka Khalsa Waheguru Ji Ki Fateh

This Shabad is by Bhagat Kabeer Ji in Salok Kabeer Jee on Pannaa 1370

mwrig moqI bIQry AMDw inkisE Awie ]
maarag mothee beethharae a(n)dhhaa nikasiou aae
The pearls are scattered on the road; the blind man comes along.

joiq ibnw jgdIs kI jgqu aulµGy jwie ]114]
joth binaa jagadhees kee jagath oula(n)ghae jaae 114
Without the Light of the Lord of the Universe, the world just passes them by. 114

bhull chuk maaf karnaa Jee...

Waheguru Ji Ka Khalsa Waheguru Ji Ki Fateh

TeraRoop said...

ah - as in older than me young =)

b said...

yeh. a year and a bit. but my mental faculties are more younglingish than either of us. someone once told me i remind them of you. i think this is the most i've ever commented on your bloggie, so i'm going to end it with something sensible for a change : )

This Shabad is by Bhagat Sheikh Fareed Ji in Salok Fareed Jee on Pannaa 1380:

ਕੰਧਿ ਕੁਹਾੜਾ ਸਿਰਿ ਘੜਾ ਵਣਿ ਕੈ ਸਰੁ ਲੋਹਾਰੁ ॥
With the axe on his shoulder, and a bucket on his head, the blacksmith is ready to cut down the tree.

ਫਰੀਦਾ ਹਉ ਲੋੜੀ ਸਹੁ ਆਪਣਾ ਤੂ ਲੋੜਹਿ ਅੰਗਿਆਰ ॥੪੩॥
Fareed, I long for my Lord; you long only for the charcoal. ||43||

TeraRoop said...

Waheguru Ji - bhenji maaf karna for not getting back to you earlier

hahah.. that's what you think. if you met me in person you'd completely disagree.

haha, can you at least tell me who said that to you?

you know, i doubt i'll ever figure out who you are on my own, because i don't actually know you. hmm..

and i'm glad you took the time to comment - thanks for dropping by =)

ahh.. Waheguru Ji..

thank you so much for that sensibility.. waheguru waheguru waheguru ji

Anonymous said...

This Shabad is by Guru Nanak Dev Ji in Raag Raamkalee on Pannaa 952

mÚ 1 ]

ma 1 ||

First Mehla:

so audwsI ij pwly audwsu ]

so oudhaasee j paalae oudhaas ||

He alone is an Udasi, a shaven-headed renunciate, who embraces renunciation.

ArD aurD kry inrMjn vwsu ]

aradhh ouradhh karae nira(n)jan vaas ||

He sees the Immaculate Lord dwelling in both the upper and lower regions.

cMd sUrj kI pwey gMiF ]

cha(n)dh sooraj kee paaeae ga(n)dt ||

He balances the sun and the moon energies.

iqsu audwsI kw pVY n kMDu ]

this oudhaasee kaa parrai n ka(n)dhh ||

The body-wall of such an Udasi does not collapse.

bolY gopI cMdu siq srUpu ]

bolai gopee cha(n)dh sath saroop ||

Says Gopi Chand, God is the embodiment of Truth;

prm qMq mih ryK n rUpu ]4]

param tha(n)th mehi raekh n roop ||4||

the supreme essence of reality has no shape or form. ||4||

ss said...

That first comment looks like it needs grading, so I give you a c++


TeraRoop said...

why, thank you, dear sir! i do believe i deserved that grade.. a shiny red apple on your desk tomorrow!


Anonymous said...

This Shabad is by Bhagat Kabeer Ji in Salok Kabeer Jee on Pannaa 1373

kbIr dwvY dwJnu hoqu hY inrdwvY rhY insMk ]

kabeer dhaavai dhaajhan hoth hai niradhaavai rehai nisa(n)k ||

Kabeer, those who brag, shall burn. Those who do not brag remain carefree.

jo jnu inrdwvY rhY so gnY ieMdR so rMk ]169]

jo jan niradhaavai rehai so ganai ei(n)dhr so ra(n)k ||169||

That humble being who does not brag, looks upon the gods and the poor alike. ||169||

tr said...

This Shabad is by Guru Amar Daas Ji in Raag Gauree on Pannaa 160

gauVI guAwryrI mhlw 3 ]

gourree guaaraeree mehalaa 3 ||

Gauree Gwaarayree, Third Mehla:

eyksu qy siB rUp hih rMgw ]

eaekas thae sabh roop hehi ra(n)gaa ||

All forms and colors come from the One Lord.

pauxu pwxI bYsMqru siB shlµgw ]

poun paanee baisa(n)thar sabh sehala(n)gaa ||

Air, water and fire are all kept together.

iBMn iBMn vyKY hir pRBu rMgw ]1]

bhi(n)n bhi(n)n vaekhai har prabh ra(n)gaa ||1||

The Lord God beholds the many and various colors. ||1||

eyku Acrju eyko hY soeI ]

eaek acharaj eaeko hai soee ||

The One Lord is wondrous and amazing! He is the One, the One and Only.

gurmuiK vIcwry ivrlw koeI ]1] rhwau ]

guramukh veechaarae viralaa koee ||1|| rehaao ||

How rare is that Gurmukh who meditates on the Lord. ||1||Pause||

shij BvY pRBu sBnI QweI ]

sehaj bhavai prabh sabhanee thhaaee ||

God is naturally pervading all places.

khw gupqu pRgtu pRiB bxq bxweI ]

kehaa gupath pragatt prabh banath banaaee ||

Sometimes He is hidden, and sometimes He is revealed; thus God has made the world of His making.

Awpy suiqAw dyie jgweI ]2]

aapae suthiaa dhaee jagaaee ||2||

He Himself wakes us from sleep. ||2||

iqs kI kImiq iknY n hoeI ]

this kee keemath kinai n hoee ||

No one can estimate His value,

kih kih kQnu khY sBu koeI ]

kehi kehi kathhan kehai sabh koee ||

although everyone has tried, over and over again, to describe Him.

gur sbid smwvY bUJY hir soeI ]3]

gur sabadh samaavai boojhai har soee ||3||

Those who merge in the Word of the Guru's Shabad, come to understand the Lord. ||3||

suix suix vyKY sbid imlwey ]

sun sun vaekhai sabadh milaaeae ||

They listen to the Shabad continually; beholding Him, they merge into Him.

vfI vifAweI gur syvw qy pwey ]

vaddee vaddiaaee gur saevaa thae paaeae ||

They obtain glorious greatness by serving the Guru.

nwnk nwim rqy hir nwim smwey ]4]9]29]

naanak naam rathae har naam samaaeae ||4||9||29||

O Nanak, those who are attuned to the Name are absorbed in the Lord's Name. ||4||9||29||

Leave a Reply