Well here's topic with zero fun -- Codingbat.com is currently unavailable due to a DDOS attack. I guess someone saw one too many test failures and just couldn't take it any more.
On a more positive note, I have a list of Codingbat features I should have time to work on this fall, so I'll make a separate post about that.
Thursday, August 30, 2012
Monday, October 3, 2011
DDOS attack, codingbat collateral damage
Ouch -- apparently there's a DDOS attack going on against some site at the same facility that hosts codingbat. Codingbat, its data etc. etc. are all fine, it's just a question of actually reaching it! Anyway, sure hope the provider fixes it, so I can go back to not thinking about this sort of stuff. Bleh.
Saturday, May 28, 2011
Progress Graphs
Progress Graphs is a new CodingBat feature using HTML5 to draw a little time series graph of the struggles and failures and eventual success that make up the work on each problem. Here's some random makeBricks() graphs. Since it made me laugh during development, you can also see random "epic" graphs which are basically problems that took a long time: random epic graph.
Individuals can see the graphs of their own work as they go, and the graphs appear on the done page. My hope is that the graphs are just kind of fun to look at, giving a sense of iteration and gradual progress. Of course the progress is basically made of quite a lot of failure, punctuated with occasional success.
See About Progress Graphs for more info.
The graphs can also suggest to teachers which students might be cheating, since the graph of just pasting in the solution doesn't look anything like someone actually doing the work. Of course the students can get around that with effort, but the graphs do raise the cost of doing the wrong thing. At Stanford, I make code-writing exams that look very similar to the homeworks, and an F on the exam gets an F in the class automatically, so there's a clear incentive to make an honest effort on the homeworks, using them to learn the material.
Individuals can see the graphs of their own work as they go, and the graphs appear on the done page. My hope is that the graphs are just kind of fun to look at, giving a sense of iteration and gradual progress. Of course the progress is basically made of quite a lot of failure, punctuated with occasional success.
See About Progress Graphs for more info.
The graphs can also suggest to teachers which students might be cheating, since the graph of just pasting in the solution doesn't look anything like someone actually doing the work. Of course the students can get around that with effort, but the graphs do raise the cost of doing the wrong thing. At Stanford, I make code-writing exams that look very similar to the homeworks, and an F on the exam gets an F in the class automatically, so there's a clear incentive to make an honest effort on the homeworks, using them to learn the material.
Monday, December 20, 2010
ATT DSL -- making ppoe password work
Ok, this is just a regular blog post I wanted to help out others with this att setup, but it's nothing to do with cs-education.
ATT is offering $20/mo DSL in my area, and it seems like a great deal. It goes up to some terrible price in one year, so you have to remember to call them. Seems shabby to count on the customers forgetting to call and reset the rate, but for $20 I'm in, so I guess they have me figured out.
I don't mind that they have the super no-brainer install script to run things, but it's crazy that they don't ALSO have just include the few needed factual details for the tech savy. Not only are there no instructions included, but what's on their help boards is incorrect, so here is the right answer. I'm assuming you want to connect their modem to some networking gear, like a router or whatever:
1. Make a hardwire connection to the modem. Connect to 192.168.1.254 and change PPP to bridged
2. Now on your router, the att instructions tell you to enter your att username and password for the ppoe login. This is incorrect on my setup (I'm guessing it was correct at some time in the past). Instead, there is a special "network" password which you are not told, and this is what ppoe wants. Seems like this password would have been good to print on the data sheet that comes with the install. You can go to the following url, and use it to get a new auto-generated network password. Then type that in as the password for ppoe.
https://uversecentral2.att.com/uvp/home/password_reset
I suspect att would have been better off just leaving the ppoe without any authentication, instead solving it with a little logic at their end. Just looking at the help forums ... a vast amount of user and support time has been wasted on this, in contrast to the elegantly hard to screw up "I'm on my telephone line so I'm me" authentication scheme.
ATT is offering $20/mo DSL in my area, and it seems like a great deal. It goes up to some terrible price in one year, so you have to remember to call them. Seems shabby to count on the customers forgetting to call and reset the rate, but for $20 I'm in, so I guess they have me figured out.
I don't mind that they have the super no-brainer install script to run things, but it's crazy that they don't ALSO have just include the few needed factual details for the tech savy. Not only are there no instructions included, but what's on their help boards is incorrect, so here is the right answer. I'm assuming you want to connect their modem to some networking gear, like a router or whatever:
1. Make a hardwire connection to the modem. Connect to 192.168.1.254 and change PPP to bridged
2. Now on your router, the att instructions tell you to enter your att username and password for the ppoe login. This is incorrect on my setup (I'm guessing it was correct at some time in the past). Instead, there is a special "network" password which you are not told, and this is what ppoe wants. Seems like this password would have been good to print on the data sheet that comes with the install. You can go to the following url, and use it to get a new auto-generated network password. Then type that in as the password for ppoe.
https://uversecentral2.att.com/uvp/home/password_reset
I suspect att would have been better off just leaving the ppoe without any authentication, instead solving it with a little logic at their end. Just looking at the help forums ... a vast amount of user and support time has been wasted on this, in contrast to the elegantly hard to screw up "I'm on my telephone line so I'm me" authentication scheme.
Tuesday, March 9, 2010
JavaBat gets Python support, now CodingBat
Wow, well there's a big new feature -- Python support! So now there's online python problems on the 'bat! This is something I've been thinking about for a long time, but it just took a lot of coding. I had to change the name of the site from JavaBat to CodingBat. The name JavaBat sounded silly and weird at first, but I grew fond of it with so much use. So I hope the name CodingBat will grow to make sense, although of course today it sounds a little funny.
There are not as many Python problems as Java problems as yet, but I'm adding them quickly. I wanted to cut the Python capability over to be live so I can see how it works before adding any more. I am, of course, very interested to hear bug reports given the large new features -- email me at nick.parlante@cs.stanford.edu
I had to make the front page look very different .. now it lists some Java sections on the left and some Python sections on the right. I hope this is not too confusing for people accustomed to the old all-Java look. You can get to the old all-Java page by clicking the Java link.
If you don't know Python, try it out for a few problems. You can start playing with the Python Warmup problems where the solutions are available to get a feel for the language. I wrote some basic Python help docs to help you get started.
Since the Python problems are so parallel to the Java problems, it might be an interesting way to learn Python .. since you can look at your own Java solution for a Java problem, and then work out how it goes in Python ...heh, your personal Rosetta stone.
There are not as many Python problems as Java problems as yet, but I'm adding them quickly. I wanted to cut the Python capability over to be live so I can see how it works before adding any more. I am, of course, very interested to hear bug reports given the large new features -- email me at nick.parlante@cs.stanford.edu
I had to make the front page look very different .. now it lists some Java sections on the left and some Python sections on the right. I hope this is not too confusing for people accustomed to the old all-Java look. You can get to the old all-Java page by clicking the Java link.
If you don't know Python, try it out for a few problems. You can start playing with the Python Warmup problems where the solutions are available to get a feel for the language. I wrote some basic Python help docs to help you get started.
Since the Python problems are so parallel to the Java problems, it might be an interesting way to learn Python .. since you can look at your own Java solution for a Java problem, and then work out how it goes in Python ...heh, your personal Rosetta stone.
Sunday, January 17, 2010
JavaBat Jan Features GO
There's a few features in the pipeline for JavaBat. Prompted by a suggestion from a loyal reader, I tried putting a copy of the GO button up at the top, so writing code is less constrained by the availability of vertical space, like on a netbook. I'm hoping we all get used to it, since it seems useful, but it does look a little funny after all this time with the button at the bottom.
Also, for people using the authoring feature, the tag parsing was so primitive, it could not tolerate any spaces like in "section : Logic-1" ... anyway I fixed that bit of lameness.
A teacher suggested that it would be nice if a teacher could see all the problems a student has attempted, rather than just the ones completed. That would be easy enough to do. One disadvantage would be that currently students can attempt but not solve a problem privately, and I like it that way. I don't want anyone to feel inhibited about thrashing around trying to solve things, since that practice will lead to excellence, but it won't look excellent at the start! Anyway, it's maybe worth trying as a feature.
Also, for people using the authoring feature, the tag parsing was so primitive, it could not tolerate any spaces like in "section : Logic-1" ... anyway I fixed that bit of lameness.
A teacher suggested that it would be nice if a teacher could see all the problems a student has attempted, rather than just the ones completed. That would be easy enough to do. One disadvantage would be that currently students can attempt but not solve a problem privately, and I like it that way. I don't want anyone to feel inhibited about thrashing around trying to solve things, since that practice will lead to excellence, but it won't look excellent at the start! Anyway, it's maybe worth trying as a feature.
Wednesday, August 26, 2009
What's wrong with this code?
Here's some student code for JavaBat caughtSpeeding that shows a tricky coding bug, can you spot it? This student ran the code again and again, and I'm sure they were very frustrated that the code would not do what it should, but I'm hoping we can all learn a little from it.
The problem is the single "=" inside "if (isBirthday=false)" -- they meant to write a "==" to compare isBirthday to false. Instead the "=" assigns false to isBirthday and then uses false in the comparison. So that first if-statement is never true, regardless of what value was in isBirthday before. For many errors in Java code, you get a compiler error so you know right where you have something to fix. Compile errors are annoying at the time, but they are actually doing you a big favor, making it easy to find and fix simple problems. The tragic and very difficult to debug aspect of this bug is that it gets no compile error and it looks so similar to what the author intended ... it's hard for the eye to notice the little discrepancy. (Java, C, and C++ all treat = vs. == this way, so it's worth learning.)
How to fix 1: it's better to avoid the forms "if (isBirthday==true)" and "if (isBirthday==false)", instead writing them as "if (isBirthday)" or "if (!isBirthday)". This is shorter and more direct, and it happens to avoid this =/== trap which is so hard to debug.
How to fix 2: With the above fix, the code looks like...
That can work, but it could be improved a little. Notice that the 2 if-statements are exact opposites -- exactly one will run and the other will not. That's a common case, and for it you should just use a single if with a single else which looks like...
Incidentally, the technique here of having 2 big cases depending on isBirthday is a fine approach. Another approach which is shorter but trickier is to modify the "speed" variable if isBirthday is true, and then have a series of if/else to figure out the answer -- avoiding having one copy of the code for isBirthday and a second copy for !isBirthday.
public int caughtSpeeding(int speed, boolean isBirthday) {
if (isBirthday=false) {
...snip...
}
else if (isBirthday=true) {
...snip...
}
else return 0;
}
The problem is the single "=" inside "if (isBirthday=false)" -- they meant to write a "==" to compare isBirthday to false. Instead the "=" assigns false to isBirthday and then uses false in the comparison. So that first if-statement is never true, regardless of what value was in isBirthday before. For many errors in Java code, you get a compiler error so you know right where you have something to fix. Compile errors are annoying at the time, but they are actually doing you a big favor, making it easy to find and fix simple problems. The tragic and very difficult to debug aspect of this bug is that it gets no compile error and it looks so similar to what the author intended ... it's hard for the eye to notice the little discrepancy. (Java, C, and C++ all treat = vs. == this way, so it's worth learning.)
How to fix 1: it's better to avoid the forms "if (isBirthday==true)" and "if (isBirthday==false)", instead writing them as "if (isBirthday)" or "if (!isBirthday)". This is shorter and more direct, and it happens to avoid this =/== trap which is so hard to debug.
How to fix 2: With the above fix, the code looks like...
public int caughtSpeeding(int speed, boolean isBirthday) {
if (!isBirthday) {
...snip...
}
else if (isBirthday) {
...snip...
}
else return 0;
}
That can work, but it could be improved a little. Notice that the 2 if-statements are exact opposites -- exactly one will run and the other will not. That's a common case, and for it you should just use a single if with a single else which looks like...
public int caughtSpeeding(int speed, boolean isBirthday) {
if (!isBirthday) {
...snip...
}
else {
...snip...
}
}
Incidentally, the technique here of having 2 big cases depending on isBirthday is a fine approach. Another approach which is shorter but trickier is to modify the "speed" variable if isBirthday is true, and then have a series of if/else to figure out the answer -- avoiding having one copy of the code for isBirthday and a second copy for !isBirthday.
Subscribe to:
Posts (Atom)