Thursday, August 22, 2013

Persona Login Support - Yay!

I've added Mozilla Persona login support for http://codingbat.com -- it's a neat technology that greatly simplifies logging into sites around the internet. I think there's a good chance it really takes over, so you heard it here first! It's in a kind of "beta" state, just getting started. (Disclosure: my wife works for Mozilla).

Persona has a lot of features, so the marketing is a little all over the place IMHO. Here's the main advantages as I see them:

Convenience: You don't have to make up a new username/password/pet-name for each site. You just use whatever email address you select to be your Persona id. If you want, you can have several Persona id's and use different ones with different sites (vs. Facebook connect). Also, once you've logged into Persona once in your browser, all the other Persona enabled sites you visit just work. So there's no creating and remembering 8 zillion different accounts and passwords. Yay!

Security: the way the tech works, your password is not shared with the site you are logging in to. If a site gets "hacked".. there's nothing for the bad guys to steal! The headlines we read again and again where a site gets broken into and thousands of passwords are stolen ... Persona is intrinsically immune. Under the hood, it works with digital signatures exchanged between the sites instead of passwords.

Open: It's a free and open standard built out by the non-profit Mozilla Foundation. You can select any Persona provider or even run your own, so your identity is not put under the control of one organization (this being the big problem with Facebook connect). As a practical matter, if you use a gmail or yahoo address, it just works seamlessly, so you type in your gmail password into gmail, and that's enough for you to log in to codingbat.com or whatever. Your gmail password is only sent to gmail, and that creates digital signature which logs you into codingbat.com. This is how there's no password sent to codingbat.com for the bad guys to steal.

CS research aside: Working with Mozilla research intern Hannah Quay-de la Vallee, I implemented the login feature with an "A/B Test" to test different UI looks and collect tons of stats about which UI worked best. So if you noticed that the UI looked different on occasion, that's why. I'll write about the A/B test separately, along with some other new-codingbat-feature posts.

Edit: Also, if you have an existing CodingBat account, like say example@gmail.com, you can still click through the Persona-create flow, and it will set that account up so you can use Persona for future logins, keeping all your old history and stuff. It's the same account, just with a new log in option. As it happens, your old CodingBat password will continue to work too. If you create a new CodingBat account through Persona, then only Persona works for log ins. You can create a Persona account for any email address (just type the email address into the Persona dialog, and it figures it all out). At present, Persona is  extra-simple for gmail and yahoo addresses, as those were the first two to get a fully automated flow.


Wednesday, September 26, 2012

Showing More Solution Code

Show Solution Code

This is something I've been meaning to do forever.

As a start, I've changed the String-1 and Logic-1 sections so that for about 20% of the problems, it will put up a "Show Solution" button once someone has solved the problem. (To see solutions before solving the problem, see the Warmup sections.)

Inside the solution code I've also added "Solution notes" comments -- a couple sentences pointing out what's useful or interesting about those lines of code.

Very often I see submitted solution code that works, but which could be better, sometimes quite a lot better. Hopefully seeing clean solution code will help people see how to write better code. It does seem like a great moment to learn from the better code, since the person working on the problem has all the right context at that moment, thinking about that problem and its code. Sebastian Thrun of Udacity makes a good argument that putting good solutions in front of people at the right moment can be a big win. Heh, of course having some "perfect" solution put in one's face could be a little annoying! Here they've just made this little victory, and now they have to look at the better solution. Well the benefits seem well worth a little annoyance and humiliation!

The Show Solution button will appear for problems with hints, as they always have. I've added hints for several problems, so those will now show solutions too. I've also added the Show Solution button to a bunch of random problems, doing it for roughly every other problem running down the middle of the three columns in the String-1 and Logic-1 sections. The phrase "Post-solution available" down at the bottom of a problem page means the bit is set so it will show the solution once it's solved. All told, about 20% of the problems in those sections have solutions available, so I figure most people will run in to them here and there.

Custom problem authors: you can do this yourself by adding the showpost:true tag to your problem, or by adding a hint.

Clear Code vs. Short Code

Another slight issue is that not everyone agrees what code is best. For the record, I'm aim for code which is the clearest, which is the IMHO the best sort of code for almost all projects. Sometimes there is a solution which is very short but kind of ugly, and I tend to avoid code like that. However some people argue for the most dense code, even if it's hard to read. Anyway, the balance between short code and clear code is a whole separate article I need to write one of these days. Maybe the best approach is to show the clearest solution, and then mention other approaches in the comments. There's probably not a single "best" anyway, just a few good styles.



Thursday, August 30, 2012

Codingbat DDOS Outage

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.

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.

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.

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.