Demographics works with the new university->departments->majors thing, and most of the form will also now keep its value upon a refresh or an error. In implementing the latter, I was reminded of...well, let's just say there are very good reasons why I hate working with HTML and Javascript.
Unfortunately, I didn't have time to figure out how to make the rest of the form dynamic, so prior and current math and physics courses are all hardcoded, still. Funnily enough, the easiest one to fix (Prior High School) is also the one that doesn't really need fixing.
Anyway, I've also been puttering around doing various things for Conor and Stephanie. Conor needed a table of overall course and student information, and I decided to have some fun with SQL and try to get it all out in one query. I got most of it, too, but I had to stop at the point where it would have taken much more time than a single separate query. I still think there was a way, though.
Ellie asked Stephanie to make a graph combining all 90 groups across the entire year into just 30. I explained how tasks were assigned to groups, and we ran into a problem with Fall because of the extra week's worth of tasks. For example, groups 40 (from Winter) and 70 (from Spring) take the same tasks in the same weeks, but 10 (from Fall) has an extra task that would offset its weeks by one. We asked Ellie what she wanted us to do, and she told us to ignore the groups and just sort by whoever took the same task in the same week. It's a good lesson for groups next year, though, even if they're not as useful now.
Friday, July 29, 2011
Thursday, July 28, 2011
RIT Majors done
I made a program that parses the RIT programs page Stephanie found. It should only take a bit of tweaking for it to work with any university with a parseable majors page. I also should make a note somewhere that it should be run every year or so, to catch any new majors that RIT (or any other school) adds. Now it's on to the demographics form, where students enter their majors...which is currently hardcoded with RIT information. I was actually going to try and push through that tonight, but it will take longer than I thought, partly because I didn't even think about the Prior Math and Prior Physics fields, which are also hardcoded. To do it right I need to add those to the database, but not quite in the same way as the other classes. I need to pull them out and identify them, somehow. Prior physics I can pull from normal classes, but what about prior math courses? Once those are added, how do I identify them?
I added a couple new tables, Department and DepartmentMap, mostly as organization for that demographics form. Department contains whatever category each school uses to lump their majors together (in RIT's case, separate colleges). DepartmentMap maps departments to majors. I will need to leave a hardcoded "Other" in there, but that's no trouble. RIT lumps its miscellaneous certifications, degrees and majors under the 'Division of Academic Affairs', which I'm thinking of renaming to a much more clear and concise 'Other'. I could put it there.
I'd planned on spending what time I needed this week on multiple-site implementation, and that's certainly happened. I hadn't thought it would take until the end of the week, but I did spend the first couple days on profiling. Considering that, this is about the time I figured I'd spend. I don't think I'll do anything about custom university colors, as cool as it would be, unless I end up with extra time.Hopefully we'll get beta-testers at this next conference to kick-start the teacher page. Ellie should also be checking out the instructor pages next week.
I forgot to go down again after three to look for Brett. I'll have to talk to him tomorrow about redirecting rawr.rit.edu.
I added a couple new tables, Department and DepartmentMap, mostly as organization for that demographics form. Department contains whatever category each school uses to lump their majors together (in RIT's case, separate colleges). DepartmentMap maps departments to majors. I will need to leave a hardcoded "Other" in there, but that's no trouble. RIT lumps its miscellaneous certifications, degrees and majors under the 'Division of Academic Affairs', which I'm thinking of renaming to a much more clear and concise 'Other'. I could put it there.
I'd planned on spending what time I needed this week on multiple-site implementation, and that's certainly happened. I hadn't thought it would take until the end of the week, but I did spend the first couple days on profiling. Considering that, this is about the time I figured I'd spend. I don't think I'll do anything about custom university colors, as cool as it would be, unless I end up with extra time.Hopefully we'll get beta-testers at this next conference to kick-start the teacher page. Ellie should also be checking out the instructor pages next week.
I forgot to go down again after three to look for Brett. I'll have to talk to him tomorrow about redirecting rawr.rit.edu.
Wednesday, July 27, 2011
Major interests
Unfortunately, the little baby laptop proved to be a loss. Either Stephanie will have to use Winbugs or she'll need another computer. Does she actually need it to be a laptop, if it's only for one program she's using occasionally? Maybe she could use the extra computer I set up instead. I'll have to ask her tomorrow.
Although Stephanie's interview was distracting, I managed to get a good start on what I wanted to do today. The only database tables that link to University are Course, Student and Teacher, and that's not bad. Everything there will mesh pretty well, although we might need to do some juggling if we want to pull out the 'Univ Physics I' equivalent from each school, for example. Major doesn't link to University at the moment. I was thinking that it should for a while, so we wouldn't get exact duplicates (how many schools would add a variation on 'Computer Science', for example) but I don't think it will matter any more. So what if every university uses the same SysID for their Computer Science degree? We'll be starting from Student anyway, which already has Univ_SysID.
Right now, we get the students' majors from our demographics form. This is the area I need to change most, as RIT majors are hardcoded into the form. I may have misunderstood, but when I asked Sam I think he said he did it by hand, although he may have used several throwaway scripts. I've written one script that pulls department and major from an RIT website Stephanie found and throws them into an array, with department as keys. If every college has a parseable site like that, I can just change the script slightly for every university, with no problem. I wonder if I should add a Department table to the database, though. A lot of schools separate majors into categories or departments, and it might be useful for an overall look at different areas of a school. I haven't quite sold the idea to myself yet, though. It'll add less complication to our form, as I can draw everything from the database instead of a file with a PHP array for each school, but it will add slightly more complication to our database.
Now that I've parsed the file, I need to add any new majors to the database, and make sure all the old ones are spelled correctly. I think Sam included major codes, which I don't have in my majors, which will suck. Thursday's gonna be fun :) .
Although Stephanie's interview was distracting, I managed to get a good start on what I wanted to do today. The only database tables that link to University are Course, Student and Teacher, and that's not bad. Everything there will mesh pretty well, although we might need to do some juggling if we want to pull out the 'Univ Physics I' equivalent from each school, for example. Major doesn't link to University at the moment. I was thinking that it should for a while, so we wouldn't get exact duplicates (how many schools would add a variation on 'Computer Science', for example) but I don't think it will matter any more. So what if every university uses the same SysID for their Computer Science degree? We'll be starting from Student anyway, which already has Univ_SysID.
Right now, we get the students' majors from our demographics form. This is the area I need to change most, as RIT majors are hardcoded into the form. I may have misunderstood, but when I asked Sam I think he said he did it by hand, although he may have used several throwaway scripts. I've written one script that pulls department and major from an RIT website Stephanie found and throws them into an array, with department as keys. If every college has a parseable site like that, I can just change the script slightly for every university, with no problem. I wonder if I should add a Department table to the database, though. A lot of schools separate majors into categories or departments, and it might be useful for an overall look at different areas of a school. I haven't quite sold the idea to myself yet, though. It'll add less complication to our form, as I can draw everything from the database instead of a file with a PHP array for each school, but it will add slightly more complication to our database.
Now that I've parsed the file, I need to add any new majors to the database, and make sure all the old ones are spelled correctly. I think Sam included major codes, which I don't have in my majors, which will suck. Thursday's gonna be fun :) .
Tuesday, July 26, 2011
Chasing unicorns
Speeding up R proved to be almost hypnotic in the focus it drew from me. Hours went by instantly, it seems. I spent more time than I wanted, but I'm done now, and it runs pretty well. I wasted the last few hours, though, except for deeper knowledge of R.
My R graphs now use parallelization. I had trouble for a while because I had forgotten to close a graphics object for the line graph. It wasn't a problem without threading, as long as I didn't have too many objects open, but it broke parallelization completely. I found that problem and tightened up the R object code. It's still rough, and I haven't fully explained the parallelization additions in comments, but it works well. I also made another change in caching. Earlier, I made it so if a graph that looks the same already exists, it will load that instead of recreating it. However, there wasn't any such limit on a single session. One command to R could have code to recreate the same graph over and over. I fixed that, and now instead of making 80 for a new teacher page, it makes around 20. This jump will be a lot less drastic when groups are larger and we have more variation, but it helps. This really helped me find and fix the problem with threading, as there was less R code to look through.
Calling on R to make all of the graphs for a teacher page took about .5 seconds before threading. After, it took around .25. The rest of the program takes less than .05. The page loads in about 1.5-2.5 seconds, with no cache of graphs. I hadn't consciously expected a figure, but .25 still seemed high, so I made an R "Hello World" program and profiled that. It took about .23 seconds, so most of that had to be going into starting R. (You execute shell code in PHP using the exec function. exec doesn't return until whatever you executed stops running [generally]. That's how I could use a PHP profiler to find R's execution time.) I tried a couple things to speed that up, and that's when I saw the unicorn.
It was pretty stupid. I tried running the HW program in BATCH mode. I'd previously discounted it for a number of reasons, but this time it ran in .015 seconds. Ooh, BATCH mode exists with all of its problems because it loads R faster!, I thought, and spent the next few hours chasing that idea. Nope. It ran fast because exec returned early. exec returned early because it ran into a permissions error. The speedy unicorn turned out to be a mirage.
My R graphs now use parallelization. I had trouble for a while because I had forgotten to close a graphics object for the line graph. It wasn't a problem without threading, as long as I didn't have too many objects open, but it broke parallelization completely. I found that problem and tightened up the R object code. It's still rough, and I haven't fully explained the parallelization additions in comments, but it works well. I also made another change in caching. Earlier, I made it so if a graph that looks the same already exists, it will load that instead of recreating it. However, there wasn't any such limit on a single session. One command to R could have code to recreate the same graph over and over. I fixed that, and now instead of making 80 for a new teacher page, it makes around 20. This jump will be a lot less drastic when groups are larger and we have more variation, but it helps. This really helped me find and fix the problem with threading, as there was less R code to look through.
Calling on R to make all of the graphs for a teacher page took about .5 seconds before threading. After, it took around .25. The rest of the program takes less than .05. The page loads in about 1.5-2.5 seconds, with no cache of graphs. I hadn't consciously expected a figure, but .25 still seemed high, so I made an R "Hello World" program and profiled that. It took about .23 seconds, so most of that had to be going into starting R. (You execute shell code in PHP using the exec function. exec doesn't return until whatever you executed stops running [generally]. That's how I could use a PHP profiler to find R's execution time.) I tried a couple things to speed that up, and that's when I saw the unicorn.
It was pretty stupid. I tried running the HW program in BATCH mode. I'd previously discounted it for a number of reasons, but this time it ran in .015 seconds. Ooh, BATCH mode exists with all of its problems because it loads R faster!, I thought, and spent the next few hours chasing that idea. Nope. It ran fast because exec returned early. exec returned early because it ran into a permissions error. The speedy unicorn turned out to be a mirage.
Astounding stupidity
So remember last night I was all worried because I couldn't get my R object to draw graphs? And how I went back to a previous revision of the object, and it still didn't work, and I was freaking out? The R object was fine. Well, fine in the sense it worked as it always has. The problem was that, before trying out R parallelization, I added task names to the graph titles. I didn't even think about it, and went on to spend the next several hours working on parallelization. Hence, I didn't even think about the tiny addition of characters in the program calling my R object.
The problem was Newton. Or, Newton's. As in Newton's Third Law, with its unclosed, unescaped apostrophe.
Arrrrggggggh
The problem was Newton. Or, Newton's. As in Newton's Third Law, with its unclosed, unescaped apostrophe.
Arrrrggggggh
Monday, July 25, 2011
SPEEEDY
In my last post, I talked about a PHP profiler I was going to use. I spent this morning learning how to use it, and I like it. It comes with some excellent debugging functions, and the software for profiling is very useful. As I suspected, SQL was the biggest source of slowdown behind the R graphs -- that is, one SQL query was. I use a very simple query to return the latest week in the class being viewed. That query was joining a table that had nothing whatever to do with anything. Due to the vagaries of relational calculus, this meant I was computing the maximum number of 3 million rows. Two words removed from that query and SQL queries hardly made a blip anymore.
This is where things took a turn for the worse. Emboldened, I decided to tackle the speed of the R graphs. It didn't look as if R were parallelizing, so I decided to try and make it. The creation of each graph was very simple in itself -- splitting each graph into its own thread could really help. So I thought. I haven't found out yet.
I spent a long while figuring out how to parallelize, installed the package, tested the function, and tried to insert it into my PHP object. It didn't work, but the code it created seemed to sometimes work. I tried to put things back to non-parallelization for now...and it still didn't work. I went back to an earlier revision of my PHP object, way before any changes I made -- no dice. I'm debugging now, but I figured I'd post. I've got to get this fixed by tonight.
This is where things took a turn for the worse. Emboldened, I decided to tackle the speed of the R graphs. It didn't look as if R were parallelizing, so I decided to try and make it. The creation of each graph was very simple in itself -- splitting each graph into its own thread could really help. So I thought. I haven't found out yet.
I spent a long while figuring out how to parallelize, installed the package, tested the function, and tried to insert it into my PHP object. It didn't work, but the code it created seemed to sometimes work. I tried to put things back to non-parallelization for now...and it still didn't work. I went back to an earlier revision of my PHP object, way before any changes I made -- no dice. I'm debugging now, but I figured I'd post. I've got to get this fixed by tonight.
Friday, July 22, 2011
"The Death RAWR is fully operational! It's a trap!"
I successfully debugged a problem I had with creating graphs using R on the new server -- the problem was I didn't have R. So that's fixed now. Sam sent me a list of a couple things he did when he set up zoot, so I have a couple non-major things to do. Even with those, little rawr should be good to go. I'd like to have Janice on and connected for a little while, in case I need anything quickly, but I'd also like to get rawr off my desk. Let's see what I can do....
I've also done some writing today -- finished up the AERA section and the little bio for that booklet thing. It always feels strange to condense my life to a few sentences.
I've also come up with a broad plan. Basically, before prime-time, I need to do two, maybe three things. I need to have teacher pages; I need to have multiple universities working; I possibly need a more sophisticated grouping system. Nearly all of them need things that are almost out of my control before I can finish them.
Next week, I'm going to work a little on teacher pages. I installed a PHP profiler today that I can use to find out what is taking up the larger fraction of time in generating teacher pages. I suspect the SQL queries, but you really shouldn't profile on suspicion. Whatever it is, I may try rewriting if I think it's worth it. If it becomes necessary, I could definitely speed up the database, at the cost of making it slightly harder to use for Ellie and stats folks. We'll have to see if that's needed. Most other teacher page improvements, definitely the most helpful ones, will be in tandem with beta testing from instructors. We could even do stuff during primetime -- have a little suggestions form for teachers. Once they see what we've already done, they may have a good idea of what else they want that we can actually provide.
Most of next week I want to use to pave the way for multiple universities. I can't really finish that until I know which schools we'll be working with, because I'll need specific class and major information. Sam had to manually input RIT majors, for example, but RIT's LDAP system made passwords much simpler. Speaking of that, I should look into redoing RIT's majors for this year. Haven't they added all sorts of Sustainability Engineering jazz?
The last thing is student grouping. I don't expect to work on this until much later, if at all. For one thing, I don't really know how we'll group them yet, except maybe by gender and GPA. Definite answers depend on Stephanie's MLM (as far as I know, anyway.) Gender and GPA could be a problem, though. Rosters we get from instructors don't include gender and assigning students to groups only after they log in and provide their information could prove problematic. On the other hand, we would need to acquire GPA information beforehand, and gender could easily come with that. Time will tell.
See ya next week!
I've also done some writing today -- finished up the AERA section and the little bio for that booklet thing. It always feels strange to condense my life to a few sentences.
I've also come up with a broad plan. Basically, before prime-time, I need to do two, maybe three things. I need to have teacher pages; I need to have multiple universities working; I possibly need a more sophisticated grouping system. Nearly all of them need things that are almost out of my control before I can finish them.
Next week, I'm going to work a little on teacher pages. I installed a PHP profiler today that I can use to find out what is taking up the larger fraction of time in generating teacher pages. I suspect the SQL queries, but you really shouldn't profile on suspicion. Whatever it is, I may try rewriting if I think it's worth it. If it becomes necessary, I could definitely speed up the database, at the cost of making it slightly harder to use for Ellie and stats folks. We'll have to see if that's needed. Most other teacher page improvements, definitely the most helpful ones, will be in tandem with beta testing from instructors. We could even do stuff during primetime -- have a little suggestions form for teachers. Once they see what we've already done, they may have a good idea of what else they want that we can actually provide.
Most of next week I want to use to pave the way for multiple universities. I can't really finish that until I know which schools we'll be working with, because I'll need specific class and major information. Sam had to manually input RIT majors, for example, but RIT's LDAP system made passwords much simpler. Speaking of that, I should look into redoing RIT's majors for this year. Haven't they added all sorts of Sustainability Engineering jazz?
The last thing is student grouping. I don't expect to work on this until much later, if at all. For one thing, I don't really know how we'll group them yet, except maybe by gender and GPA. Definite answers depend on Stephanie's MLM (as far as I know, anyway.) Gender and GPA could be a problem, though. Rosters we get from instructors don't include gender and assigning students to groups only after they log in and provide their information could prove problematic. On the other hand, we would need to acquire GPA information beforehand, and gender could easily come with that. Time will tell.
See ya next week!
Subscribe to:
Posts (Atom)