Perl 6 - the future is here, just unevenly distributed

IRC log for #webwork, 2013-03-13

| Channels | #webwork index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 Paul__ joined #webwork
00:12 mgage_ joined #webwork
01:50 Paul__ joined #webwork
03:56 mgage_ joined #webwork
04:51 Budd joined #webwork
05:38 mgage_ joined #webwork
06:59 Budd joined #webwork
07:12 Budd joined #webwork
12:17 mgage_ joined #webwork
13:01 mgage_ joined #webwork
14:02 aubreyja joined #webwork
14:07 rbeezer joined #webwork
14:42 aubreyja mgage: around?
15:23 darwyn joined #webwork
15:25 goehle_ hey aubreyja
16:24 mgage aubreyja: hi
16:29 navajotech joined #webwork
16:33 navajotech Can anyone here help me debug a problem that I tried writing?
16:40 mgage maybe -- what is the problem?
16:42 navajotech # DESCRIPTION
16:42 navajotech # Problem 2 from the Problem section
16:42 navajotech # of Astronomy: A Beginner's Guide to the
16:42 navajotech # Universe 6th Edition
16:42 navajotech # WeBWorK problem written by Joshua Bronston,
16:42 navajotech # <jbronston(at)navajotech(dot)edu>
16:42 navajotech # ENDDESCRIPTION
16:42 navajotech ## DBsubject('Astronomy')
16:42 navajotech ## DBchapter('Chapter 0')
16:42 navajotech ## DBsection('Problems')
16:42 navajotech ## KEYWORDS('')
16:42 navajotech ## TitleText1('')
16:42 navajotech ## EditionText1('')
16:42 navajotech ## AuthorText1('')
16:42 navajotech ## Section1('')
16:42 navajotech ## Problem1('')
16:42 navajotech ## Author('Joshua Bronston')
16:42 navajotech ## Institution('Navajo Technical College')
16:42 mgage hi -pasting it into the IRC doesn't work so well for these things
16:42 navajotech DOCUMENT();
16:42 navajotech loadMacros(
16:42 navajotech "PGstandard.pl",
16:42 navajotech "MathObjects.pl",
16:42 mgage too many line feeds
16:42 navajotech "PGcourse.pl",
16:42 navajotech );
16:42 navajotech # make sure we're in the context we want
16:42 navajotech Context("Numeric");
16:43 navajotech @distance1 = (57.9,108.2,149.6,227.9,778.4,1427,2871,4498);
16:43 navajotech @distance3 = (57.9*(10**6),108.2*(10**6),149.6*(10**6),
16:43 navajotech 227.9*(10**6),778.4*(10**6),1427*(10**6),2871*(10**6),4498*(10**6));
16:43 navajotech @planet1 = ("Mercury","Venus","Earth",
16:43 navajotech "Mars","Jupiter","Saturn","Uranus","Neptune");
16:43 navajotech @year1 = (.241,.612,1,1.88,11.86,29.42,83.75,163.7);
16:43 navajotech $num = random(0,8,1);
16:43 navajotech $distance2 = $distance3[$num];
16:43 navajotech $planet2 = $planet1[$num];
16:43 navajotech $year2 = $year1[$num];
16:43 navajotech $circum = Compute("pi*2*$distance2");
16:43 navajotech $day = $circum / ($year2 * 365);
16:43 navajotech $hour = $day/24;
16:43 mgage try http://pastebin.com and post the link in IRC
16:43 navajotech $second = $hour/3600;
16:43 navajotech Context()->texStrings;
16:43 navajotech TEXT(beginproblem());
16:43 navajotech Context()->texStrings;
16:43 navajotech BEGIN_TEXT
16:43 navajotech Given that the distance from \($planet2\) to the Sun is \($distance1[$num]\)x\(10^6\) km, through
16:43 navajotech what distance does \($planet2\) move in a second? An hour? A day? $BR (HINT: Use Table 3A in Appendix 3 in your book. 1 Tropical Year = 1 Earth Year.)
16:43 navajotech $PAR
16:43 navajotech distance traveled in a second = \{ ans_rule(4) \} km
16:43 navajotech $PAR
16:43 navajotech distance traveled in an hour = \{ ans_rule(4) \} km
16:43 navajotech $PAR
16:43 navajotech distance traveled in a day = \{ ans_rule(4) \} km
16:43 navajotech END_TEXT
16:44 navajotech Context("Numeric");
16:44 navajotech ANS( $second->cmp());
16:44 navajotech ANS( $hour->cmp());
16:44 navajotech ANS( $day->cmp());
16:44 navajotech Context()->texStrings;
16:44 navajotech SOLUTION(EV3(<<'END_SOLUTION'));
16:44 navajotech $PAR SOLUTION $PAR
16:44 navajotech END_SOLUTION
16:44 navajotech Context()->normalStrings;
16:44 navajotech ENDDOCUMENT();
16:44 navajotech Here is the error
16:44 navajotech Problem2
16:44 navajotech ERROR caught by Translator while processing problem file:JoshAstroProblems/Chapter00/Problem02.pg
16:44 navajotech ****************
16:44 navajotech Missing operand after '*'; see position 5 of formula at line 92 of (eval 3057)
16:44 navajotech Died within main::Formula called at line 92 of (eval 3057)
16:44 navajotech from within main::Compute called at line 43 of (eval 2909)
16:44 navajotech ok
16:44 navajotech I see
16:44 navajotech Sorry
16:44 navajotech Is there a way to send files?
16:45 mgage use  http://pastebin.com/  and send me the link
16:45 navajotech http://pastebin.com/skhr6zrD
16:45 navajotech There is the link.
16:46 mgage I think the problem is that $distance2 is undefined (or a blank string)
16:48 mgage in particular @distance is indexed from 0 so the $num should be between 0 and 7
16:48 mgage not 0 and 8 as you have defined it.
16:48 navajotech Dang it
16:48 navajotech I see it now
16:48 navajotech Thanks.
16:48 mgage np -- have fun
18:39 mgage_ joined #webwork
18:44 mgage_ back
19:42 Paul_ joined #webwork
21:03 Paul___ joined #webwork
22:26 goehle_ left #webwork
23:28 Paul_ joined #webwork

| Channels | #webwork index | Today | | Search | Google Search | Plain-Text | summary