Thursday, March 22, 2007

COMP 102 Temporary Wiki

I am too lazy to have a wiki and newsgroup is something that is obsolete anyway. So for all the helps you need, please post it here, and I will answer them to the best of my ability.


Help for assignment 4:

I have received some questions about question 2 in the assignment, so I will post some clarifications from the instructor here:

From the instructor:

The "model the peers" part for 4pt is about describing how they modelled the
network, and why. This can be done on the graph, or in a few sentences. The
second part for 2pt is for only drawing the graph itself.

In this question we are talking about a P2P network where peers talk DIRECTLY
to one another.

Hope it helps..

Update: I will not be here at 1 pm but I will be back at 2 so the office hour is delayed for 1 hr.


Help for assignment 3:

1. Truncating an floating point:

Try: var truncated_value = Math.round(my_initial_floating_point_val)
reference: http://www.javascriptkit.com/javatutors/round.shtml for help.

2. loop to infinitity?

Take a look at how to use break in loop.
Cheap shot: try, while(confirm("you wanna keep playing?"))

Update: skeleton code of question 2 is available! Check the TA page!

3. Hard Way to code Tic-tat-toe.

I tried to put up a sample code in the blog but it interprets the code as valid HTML and tries to parses it. So i could not display the code probably on the blog. Let me put it this way: if you use HTML table it will requires a lot more knowledge than what you have learned in class. Better to keep things simple by not touching the HTML layout at all.

Of course, if anyone is really interested in doing that, then reply here and I will try to create the sample code.

4. Multidimensional Array

Unlike Ruby or Python, there is no built-in support for array / list type in JS. Everything is treated like an object.

Therefore, to declare a 3x3 2-dimensional array you need to do this:

a = new Array[3];
a[0] = new Array[3];
a[1] = new Array[3];
a[2] = new Array[3];

Well you get the idea. Not the most elegant way to construct it and I will avoid it as much as possible.

Again, please post your questions HERE instead. I don't check my email too often so please use this wiki. It also benefits others who may have the same questions in mind.

Update: I have made the following list to Greg as the submission format requirement. But I have not received any news so I will post the following as the preferred guildline for this submission.

1. Each assignment should be submitted electronically through a ZIP file.

(Very important!!!) The name of the zip file should be: c102-a3-lastname-firstname.zip . Files not adhered to this format is not accepted.

2. The zip file MUST contain 3 html files with the following names:

bi-converter.html
tic-tat-toe.html
mandelbrot.html

I will run a script that tests for these three files. File names other than the ones I specified will not get tested.

3. Each file MUST COMPILE: a blank screen means automatically a zero for the specified question.

4. Each script MUST contain a comment that specifies the name of the author, and if they used the skeleton code provided. Submissions that use the skeleton code but did not specify the source is considered plagiarism.

5. All files MUST BE SUBMITTED to this email address: iyuen@cs.mcgill.ca or isaac.yuen@mail.mcgill.ca . Submissions to any other places will not be accepted.

6. Submission deadline March 27th 11:59 pm.

111 comments:

Isaac said...

Testing

Isaac said...

To Alex, but JS does not offer a truncated version of / (unlike Java).

So Round is still your best bet, or maybe it will round up so beware to that.

Isaac said...

Yes your equation works.

Anonymous said...

Thanks Isaac!

I have another question for you. How many && or || operators can we put in a single conditional statement?

For example, can I write:
if ( x>>3 && y>>3 && z>>3) {...}?
or if ( x>>3 || y>>3 || z>>3) {...}?

If so, is it possible to include both operators:

if ( x>>3 && y>>3 || z>>3) {...}?

How does JS interpret that?
is it (x && y) || (z)
or is is (x) && (y || z)?

-Alex

Isaac said...

Yes Alex. Theoretically you can post infinite amount of boolean statements in the guard expression.

But, why are you doing X >> 3? '>>' is a bit-wise shift. I think you mean '>' instead?

For operator precedence, check out:
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Operators

So yea, it is equivalent to ((x && y) || z) in your example

Anonymous said...

Hi Isaac,

I can't find where in the tic-tac-toe code I need to change things so that there is a player one and a player 2. I also don't know how I can switch from player 1 to 2. I am really out of idea for that, can you help me?

Thanks,
Caroline Saucier

Isaac said...

To Caroline,

You can have a while loop and skip switching between player 1 and 2:

while( game_has_not_finished )
if (player == 1) {
// player_1_code

player = 2;
}
else
{
// player_2_code
player = 1;
}
}

Isaac said...

well if prompt you promtp twice:

var player_1_name = prompt("Enter name player 1");

var player_2_name = prompt("Enter name player 2");

and in the while loop, you have two branch, one branch for player 1 and the other for player 2

Anonymous said...

All right, it works.

Thank you!
Caroline

Anonymous said...

Hey Isaac,

For the tic-tac-toe again... I am trying to implement the

if (board[3]==board[4]==board[5]==1) {
alert(name_1 + " wins!!"); break;
}

but no matter what combination I choose, the alert (you win) goes on as soon as there are three values on the board, no matter which player is playing. What is the problem?

thanks,
Caroline

Isaac said...

Iwill have to see a large piece of code.

BuyLevitra said...

Thanks for article!

Phentermine said...

Thanks for interesting article.

Viagra said...

Glad to read articles like this. Thanks to author!

Wayne Nichols said...

Very interesting article, I have long sought. It is in front of me. I agree with you!

Anonimous said...

Excellent website. Good work. Very useful. I will bookmark!

Anonimous said...

Hello! Interesting article, thanks to author!

PaydayLoans said...

hJhD1y You have a talant! Write more!

Auto insurance company said...

IW4GdL Please write anything else!

Hydrocodone said...

lXLhTA The best blog you have!

internet pharmacy said...

xDnTmB actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

aloes travel tours said...

Thanks to author.

fioricet 3 said...

Magnific!

vytorin and celebrex said...

Wonderful blog.

sallie mae loan said...

Good job!

cialis and viagra purchase online said...

Wonderful blog.

low blood pressure and vicodi said...

Wonderful blog.

heroin xanax bars said...

Good job!

dreampharmaceutica said...

Thanks to author.

fake phentermine pills said...

Thanks to author.

JohnBraun said...

8wR6se write more, thanks.

comic cruel sex said...

actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

dumb sex acts said...

Hello all!

anime sex sendspace said...

Please write anything else!

latex corset sex said...

actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

hot babe anal said...

Good job!

sex act mpeg said...

actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

pam lee sex said...

Good job!

beast sex dvd said...

Please write anything else!

beast sex cartoons said...

Nice Article.

creampie thais sex said...

Nice Article.

hot transexual sex said...

actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

punch sex scene said...

Please write anything else!

mama fat sex said...

Give me ambiguity or give me something else.

night sex video said...

Ever notice how fast Windows runs? Neither did I.

dirty hard sex said...

Calvin, we will not have an anatomically correct snowman!

free italian porn said...

Energizer Bunny Arrested! Charged with battery.

boy boy sex said...

actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

boob cum sex said...

If ignorance is bliss, you must be orgasmic.

african cock sex said...

What is a free gift ? Aren't all gifts free?

iowa sex regestry said...

Build a watch in 179 easy steps - by C. Forsberg.

hydr said...

The gene pool could use a little chlorine.

generic generic cialis pills cod said...

What is a free gift ? Aren't all gifts free?

cheap ultram said...

Hello all!

japanese sex vids said...

When there's a will, I want to be in it.

best deep sex said...

Ever notice how fast Windows runs? Neither did I.

geocities celebrity sex said...

Build a watch in 179 easy steps - by C. Forsberg.

arabic ass sex said...

Give me ambiguity or give me something else.

all home sex said...

Lottery: A tax on people who are bad at math.

sex around you said...

Friends help you move. Real friends help you move bodies

daring sex positions said...

Nice Article.

old phone sex said...

C++ should have been called B

cocaine bump box said...

Calvin, we will not have an anatomically correct snowman!

name said...

Save the whales, collect the whole set

family guy porn xxx said...

Build a watch in 179 easy steps - by C. Forsberg.

rape porn websites said...

Lottery: A tax on people who are bad at math.

alexis lay porn said...

Build a watch in 179 easy steps - by C. Forsberg.

litte sister sex said...

When there's a will, I want to be in it.

asians sex outdoor said...

Thanks to author.

full lenth porn vids said...

If ignorance is bliss, you must be orgasmic.

disney porn toons said...

Build a watch in 179 easy steps - by C. Forsberg.

gay porn sex pics said...

Build a watch in 179 easy steps - by C. Forsberg.

dogs impacted anal glands said...

Save the whales, collect the whole set

funny sex poem said...

Give me ambiguity or give me something else.

porn star clips and trailers said...

All generalizations are false, including this one.

having sex sister said...

640K ought to be enough for anybody. - Bill Gates 81

immig said...

When there's a will, I want to be in it.

chastity video sex said...

Lottery: A tax on people who are bad at math.

pokemon sex fanfiction said...

The gene pool could use a little chlorine.

cam corter sex said...

Nice Article.

cartoon sex samples said...

Thanks to author.

forbidden pic sex said...

Save the whales, collect the whole set

home made porn movies in ireland said...

All generalizations are false, including this one.

instant sex games said...

Clap on! , Clap off! clap@#&$NO CARRIER

violent porn trailers said...

Save the whales, collect the whole set

junjle book sex said...

Energizer Bunny Arrested! Charged with battery.

power sex positions said...

What is a free gift ? Aren't all gifts free?

asian porn sites said...

Wonderful blog.

kinky asian sex said...

A lot of people mistake a short memory for a clear conscience.

boston amateur porn needed said...

Build a watch in 179 easy steps - by C. Forsberg.

3-d sex games said...

The gene pool could use a little chlorine.

perv sex pics said...

Calvin, we will not have an anatomically correct snowman!

phentermine no prior free shipping said...

Energizer Bunny Arrested! Charged with battery.

phentermine with next day shipping and online c said...

A lot of people mistake a short memory for a clear conscience.

phentermine yellow said...

I'm not a complete idiot, some parts are missing!

Anonymous said...

best catholic dating sites http://loveepicentre.com/map.php dating by sign

Anonymous said...

cleveland ohio married and dating http://loveepicentre.com/faq.php asian and black dating

Anonymous said...

Hi all
I'm Mary, 24 years old :)
I am looking for good man. If he exists...
I'm love sport and... Hope you understand

[img]http://loveepicentre.com/uploades/photos/30375.jpg[/img]

www.blogger.com is very interesting forum for me, so I think we have the same hobbies
So lets chat...
My e-mail is marypopovaks@gmail.com, Skype *
Send me your foto!

__
Added later:

This photography is corrupted, sorry!

Oh, and all my photos here:
http://loveepicentre.com/user/Popova

Anonymous said...

proposal ebook http://audiobookscollection.co.uk/Governing-Sustainable-Cities/p105023/ how to write a ebook [url=http://audiobookscollection.co.uk/Hardware-and-Software-Verification-and-Testing-4th-International-Haifa-Verification-Conference-HVC-2008-Haifa-Israel-October-27-30-2008-Programming-and-Software-Engineering/p222414/]doid ebook reader[/url] xaml in nutshell ebook torrent

Anonymous said...

bonsai gardening secrets ebook http://audiobookscollection.co.uk/C-The-Complete-Reference/p185620/ free ebook asset pricing gorge pinochet [url=http://audiobookscollection.co.uk/es/Padres-y-familia/c1050/?page=14]learning corel painter ix ebook[/url] ebook of computer

Anonymous said...

poker ebook http://audiobooksplanet.co.uk/Profumo-Gaja-Scienza-Italian-Edition/p206872/ make an ebook from your library [url=http://audiobooksplanet.co.uk/Gene-avatars-the-neo-Darwinian-theory-of-evolution/p100048/]free journal implementation of ebook[/url] the best ebook writer

Anonymous said...

c# unleashed joe mayo ebook http://audiobooksworld.co.uk/Bible-and-Other-Sacred-Texts/c1112/?page=3 free ebook rice [url=http://audiobooksworld.co.uk/Techniques-of-fantasy-art/p157115/]html ebook maker[/url] ebook on chaos fractal

Anonymous said...

nikon d200 ebook http://audiobooksworld.co.uk/Gouxiong-Xue/m44929/ ebook diary of anne frank [url=http://audiobooksworld.co.uk/Xinjie-Yu/m133982/]david carnoy ebook[/url] free bruce springsteen ebook downloading
[url=http://audiobooksworld.co.uk/it/J-D/m53761/][img]http://audiobooksworld.co.uk/image/6.gif[/img][/url]

Anonymous said...

goe software for firefox http://buyoem.co.uk/product-10065/Ability-Mail-Server-2-61 godspeed software [url=http://buyoem.co.uk/de/product-36174/Windows-XP-Professional-SP2-English-x64]yellow dots software[/url] best freetv software free downloads
[url=http://buyoem.co.uk/product-35986/OLfoldersPE-3-2-Multilanguage-x32]OLfoldersPE 3.2 Multilanguage x32 - Software Store[/url] small bussiness software for construction
[url=http://buyoem.co.uk/es/product-16330/MemTest-4-2-Mac][img]http://buyoem.co.uk/image/6.gif[/img][/url]

Anonymous said...

setpoint software for logitech http://buysoftwareonline.co.uk/it/category-13/Software-di-Musica?page=23 seven network software [url=http://buysoftwareonline.co.uk/category-100-110/Internet]best rendering software for archicad[/url] blackberry 4.3 software beta
[url=http://buysoftwareonline.co.uk/de/category-5/PC-Diagnose]PC Diagnose - Download OEM, Software Sale, OEM Software[/url] boeing video conferencing software
[url=http://buysoftwareonline.co.uk/es/category-100-113/Programas-de-m-sica?page=4][img]http://buyoem.co.uk/image/5.gif[/img][/url]

Anonymous said...

opera accounting software http://buysoftwareonline.co.uk/product-37166/UltraTagger-2-3 system recovery software for windows vista [url=http://buysoftwareonline.co.uk/product-14111/PhotoZoom-Pro-2-1-Mac]syria software sanctions[/url] breakthrough replication software
[url=http://buysoftwareonline.co.uk/account/account]Account Login - Software Store[/url] wm5 gps software
[url=http://buysoftwareonline.co.uk/es/category-100-104/Extensiones-de-programas?page=2][img]http://buyoem.co.uk/image/3.gif[/img][/url]

Anonymous said...

[url=http://onlinemedistore.com/products/astelin.htm][img]http://onlinemedistore.com/4.jpg[/img][/url]
pharmacy test http://onlinemedistore.com/catalogue/h.htm pharmacy online message boards new levitra [url=http://onlinemedistore.com/products/levitra.htm]pharmacy school unc[/url]
ellis hospital pharmacy schenectady ny http://onlinemedistore.com/catalogue/o.htm cardizem cd canada online pharmacy cardizem cd actos norvasc [url=http://onlinemedistore.com/products/activ8--energy-booster-.htm]activ8 energy booster [/url]
aarp pharmacy http://onlinemedistore.com/products/generic-keflex.htm wsu pharmacy [url=http://onlinemedistore.com/products/lysexl.htm]holland park pharmacy[/url]
online pharmacys http://onlinemedistore.com/products/glucophage.htm ct long term care pharmacy [url=http://onlinemedistore.com/products/himplasia.htm]himplasia[/url]

Anonymous said...

[url=http://certifiedpharmacy.co.uk/products/allopurinol.htm][img]http://onlinemedistore.com/4.jpg[/img][/url]
pharmacy by san francisco airport http://certifiedpharmacy.co.uk/products/serevent.htm the lines of communitcation within a pharmacy [url=http://certifiedpharmacy.co.uk/products/female-viagra.htm]parleigh pharmacy[/url]
malouf pharmacy competition http://certifiedpharmacy.co.uk/categories/skin-care.htm tesco pharmacy open hours [url=http://certifiedpharmacy.co.uk/products/tetracycline.htm]tetracycline[/url]
bakersfield home care pharmacy http://certifiedpharmacy.co.uk/products/mxman.htm requirements for va pharmacy program [url=http://certifiedpharmacy.co.uk/products/eriacta.htm]cvs pharmacy blood pressure[/url]
new mexico school of pharmacy http://certifiedpharmacy.co.uk/products/levitra-professional.htm top pharmacy schools in uk dpharm [url=http://certifiedpharmacy.co.uk/products/elavil.htm]elavil[/url]

Anonymous said...

[url=http://fdaapproved.co.uk/products/benicar.htm][img]http://onlinemedistore.com/5.jpg[/img][/url]
top pharmacy school http://fdaapproved.co.uk/products/indinavir.htm offshore caribean pharmacy [url=http://fdaapproved.co.uk/products/finpecia.htm]midwestern university college of pharmacy[/url]
cvs pharmacy glen ellyn http://fdaapproved.co.uk/products/levitra-professional.htm low price pharmacy hickory nc [url=http://fdaapproved.co.uk/products/xtz--energy-booster-.htm]xtz energy booster [/url]
medco health home delivery pharmacy service http://fdaapproved.co.uk/products/micardis.htm pharmacy technician board [url=http://fdaapproved.co.uk/products/requip.htm]wholefood pharmacy[/url]
shraf pharmacy http://fdaapproved.co.uk/products/lexapro.htm cvs pharmacy blood pressure [url=http://fdaapproved.co.uk/products/luvox.htm]luvox[/url]

Anonymous said...

rumors of jay z beyonce dating [url=http://freeinternetdating.info/meet/meet-and-fuck-leika-game-review]meet and fuck leika game review[/url] brian lee of perfect ten dating
dating black single women discreet http://freeinternetdating.info/matchmaker/gainesville-florida-matchmaker naruto dating sims for girls
virtual free online dating [url=http://freeinternetdating.info/personals/swingers-personals-walker-south-dakota]asperger syndrome dating websites[/url] young and old dating

Anonymous said...

trends in dating for adolecents http://loveepicentre.com/advice/ jessica yellin dating
song hye gyo dating [url=http://loveepicentre.com/map/]euroasia dating[/url] dating changes
nude dating site [url=http://loveepicentre.com]wales dating uk[/url] filipino girls dating [url=http://loveepicentre.com/user/tushu/]tushu[/url] personals sex login dating site