It's been months since I last looked at the new SURRAnet code. When I realized that I wouldn't have the revised code ready for the new school year, I refocused on "old" SURRAnet to make sure the data can more easily transition to the new SURRAnet when it's time to make the swap. Of particular interest was the elimination of quarters and grade weights.
When I say, "Back to the drawing board," I'm not talking about redesign, but about rewrapping my mind around my original design plans. It may take me a week just to set the "stage" of my brain up with all the objects and objectives of the new SURRAnet.
Now that winter is almost here, I will be dedicating those cold, chilly days to SURRAnet, when I'm off from school, of course. Winter is a nice, quiet time of year, and I find it a great time to pound out computer code because who wants to be outside in sub-zero temperatures?
I would really, really like to be able to finish the majority of the new code before we print the final report cards this school year (June). I make no guarantees, as we know what happened the last time. I sometimes even wonder if it is worth it, now that open source SIS programs are more readily available, but, I put my hand to this plow, so I'd like to finish what I started. Maybe, just maybe, my SURRAnet has something to offer that the other programs do not.
Time to clear out the cobwebs and remember everything I forgot over the last three months!
Monday, November 16, 2009
Tuesday, July 14, 2009
When Real Life Interferes With Our Plans
Today I received a letter that stated the following:
My ability to finish SURRAnet for the new school year was being taxed before receiving this letter due to other major work-related projects. Now, it's practically impossible without making some insane sacrifices on my part.
After discussing the situation with my boss, we have decided that we're pushing back our goal for the launch of the new SURRAnet at GHCA until the following school year, giving me an extra year to finish it.
Part of me is relieved to have an extra year to complete SURRAnet since this is a massive project - a project that has to be tabled for a few months while I perform my civic duties. That's not to say that I won't be working on it, but SURRAnet will be truly a "in my spare time" project for the next few months.
I do want to push to finish the code on the Record system so that I can upload a snapshot of the new code for you to have, especially since this code has some drastic changes from what's currently available to download.
As for missing my first month of teaching classes (Computer Fundamentals and Computer Programming), along with the major time-crunch that my other projects now face, I can only say Grrrr!!!!
Dear Mr. Surran:In that previous summons, I was told not to plan anything from late July until late September, which very inconveniently overlaps with the start of the school year (as a reminder, I'm the system administrator and part-time teacher at Greater Houlton Christian Academy). I requested a change in schedule, but it appears that the judge doesn't agree that teachers should be available for the first month of classes...
Justice Hunter has reviewed your request to be excused from jury service and has denied your request. Please report for jury service on ______, as instructed in the summons you previously received....... We will do our best to minimize the inconvenience.
My ability to finish SURRAnet for the new school year was being taxed before receiving this letter due to other major work-related projects. Now, it's practically impossible without making some insane sacrifices on my part.
After discussing the situation with my boss, we have decided that we're pushing back our goal for the launch of the new SURRAnet at GHCA until the following school year, giving me an extra year to finish it.
Part of me is relieved to have an extra year to complete SURRAnet since this is a massive project - a project that has to be tabled for a few months while I perform my civic duties. That's not to say that I won't be working on it, but SURRAnet will be truly a "in my spare time" project for the next few months.
I do want to push to finish the code on the Record system so that I can upload a snapshot of the new code for you to have, especially since this code has some drastic changes from what's currently available to download.
As for missing my first month of teaching classes (Computer Fundamentals and Computer Programming), along with the major time-crunch that my other projects now face, I can only say Grrrr!!!!
Thursday, July 9, 2009
Google Chrome and Other Tidbits
Recently Google announced a new operating system tied to their web browser, Chrome. I find this interesting for a number of reasons, but one reason should be obvious in relation to this blog - SURRAnet was written for Chrome.
Okay, let me rephrase - SURRAnet was written for the browser, and Chrome promises to be designed with browser apps in mind, so you could say that SURRAnet was written for Chrome, or even more appropriately, Chrome was written for SURRAnet!
I'm a bit tickled because SURRAnet was first conceived and designed as a web app before web apps were commonplace. It also is refreshing to know that SURRAnet has a good run ahead of it because it's using technology that's just now becoming mainstream. Cool!
Here are a few other tidbits. I'm hoping to release my latest work on SURRAnet sometime this weekend. I'm trying to finish up the majority of the Records system before doing this. This will be the first release with SURRAnet's own HTTP server code, meaning that it no longer needs Apache to run. The new release also uses XML vs HTML and has some major enhancements in the base classes. If you compare the new code to the old code, you will hopefully appreciate the differences. I'll set it up so that interested parties can try SURRAnet "out of the box" with little setup overhead.
One of the things slowing me down is the amount of time seemingly simple tasks can take to code for. Today's browsers still have shortcomings that making programming applications for them "tricky". I've been spending time working on the AJAX communication between client and server, and having solved those issues, I'm not working on the final polishing of the Records system.
Another thing slowing me down is distraction. It seems that all of my quiet programming spots are, well, NOT quiet lately! My office at the school is subjected to construction noise as summer renovations happen all around me. My home office is shaken by the noise of the constant convoy of dump trucks and farm traffic that plague my road. Our local library is surprisingly noisy and distracting. I have a friend with a cabin in the middle of the woods, and I'm tempted to shack up there for a week to get some work done! Oh, and don't get me started on the poorly-timed jury duty....
Well, there's not much more to say. Hopefully my next post will be accompanied by code! I'll end on this thrilling note - a tarball of SURRAnet, including a few years of student data, currently fits on a single floppy disk!! (No, I don't use floppy disks, but I remember their capacity). In the world of bloat, I find this very cool indeed!
Okay, let me rephrase - SURRAnet was written for the browser, and Chrome promises to be designed with browser apps in mind, so you could say that SURRAnet was written for Chrome, or even more appropriately, Chrome was written for SURRAnet!
I'm a bit tickled because SURRAnet was first conceived and designed as a web app before web apps were commonplace. It also is refreshing to know that SURRAnet has a good run ahead of it because it's using technology that's just now becoming mainstream. Cool!
Here are a few other tidbits. I'm hoping to release my latest work on SURRAnet sometime this weekend. I'm trying to finish up the majority of the Records system before doing this. This will be the first release with SURRAnet's own HTTP server code, meaning that it no longer needs Apache to run. The new release also uses XML vs HTML and has some major enhancements in the base classes. If you compare the new code to the old code, you will hopefully appreciate the differences. I'll set it up so that interested parties can try SURRAnet "out of the box" with little setup overhead.
One of the things slowing me down is the amount of time seemingly simple tasks can take to code for. Today's browsers still have shortcomings that making programming applications for them "tricky". I've been spending time working on the AJAX communication between client and server, and having solved those issues, I'm not working on the final polishing of the Records system.
Another thing slowing me down is distraction. It seems that all of my quiet programming spots are, well, NOT quiet lately! My office at the school is subjected to construction noise as summer renovations happen all around me. My home office is shaken by the noise of the constant convoy of dump trucks and farm traffic that plague my road. Our local library is surprisingly noisy and distracting. I have a friend with a cabin in the middle of the woods, and I'm tempted to shack up there for a week to get some work done! Oh, and don't get me started on the poorly-timed jury duty....
Well, there's not much more to say. Hopefully my next post will be accompanied by code! I'll end on this thrilling note - a tarball of SURRAnet, including a few years of student data, currently fits on a single floppy disk!! (No, I don't use floppy disks, but I remember their capacity). In the world of bloat, I find this very cool indeed!
Wednesday, July 1, 2009
Dancing With The Client
This title is inspired by the show, "Dancing With The Stars". I was thrilled yesterday when I had an eureka moment, at least IMHO, regarding the "dance" that the server and client will perform to make the user experience of SURRAnet.
SURRAnet was a web 2.0 app before there was a web 2.0. Back when I decided to make SURRAnet's GUI engine the browser, it really wasn't common for applications to be built for the browser (and when they were, they were Java or Flash apps). Since SURRAnet's initial release, web apps like Google Apps, Facebook, and even this blog have pushed the boundaries of what a browser can do, thanks to the ever-expanding capabilities of modern browsers like Firefox. One of the reasons I'm rewriting SURRAnet is to take advantage of these new capabilities and thus remove the clunkyness of the "old web."
One goal for this rewrite is to find the right balance between server-side and client-side processing. There is a place for each, and if the right balance is not found, the product suffers. In fact, I often wonder if sites like Facebook are missing this balance, resulting in the client "stepping on the feet" of the server. In my opinion, using client-side scripting to do something that is easily done on the server-side or even in simple static HTML/XML is a mistake. Facebook has become extremely client-side processor intensive, and often Firefox just freezes up for seconds while the insane amount of Javascript churns away to generate the page you see. Take a look at their source code sometime - it's crazy!!!
I obviously don't want SURRAnet to perform sluggish like Facebook or even Google Docs. I want it to be fast and responsive. I also want it to require the least amount of work to use (right now it requires too much clicking and navigating). I'm definitely going to use both client and server-side processing, but what is the correct balance? How will these two dance together for the best performance?
My eureka moment came while working on the validation phase of my student records manager. In the past, the client Javascript did the validation. This required plenty of data to be copied from the server to the client, and Javascript has limitations that make this phase of writing SURRAnet less than fun. The old SURRAnet represented the student records as a form that needed to be submitted in order to be recorded (old web). The new version sends individual field data immediately to the server via AJAX, thus providing instant updates to the database and eliminating the need for a "Click here to save" button. It dawned on me that since I'm using AJAX in this fashion, I can make the server do the validation!
This provides a number of benefits, including:
SURRAnet was a web 2.0 app before there was a web 2.0. Back when I decided to make SURRAnet's GUI engine the browser, it really wasn't common for applications to be built for the browser (and when they were, they were Java or Flash apps). Since SURRAnet's initial release, web apps like Google Apps, Facebook, and even this blog have pushed the boundaries of what a browser can do, thanks to the ever-expanding capabilities of modern browsers like Firefox. One of the reasons I'm rewriting SURRAnet is to take advantage of these new capabilities and thus remove the clunkyness of the "old web."
One goal for this rewrite is to find the right balance between server-side and client-side processing. There is a place for each, and if the right balance is not found, the product suffers. In fact, I often wonder if sites like Facebook are missing this balance, resulting in the client "stepping on the feet" of the server. In my opinion, using client-side scripting to do something that is easily done on the server-side or even in simple static HTML/XML is a mistake. Facebook has become extremely client-side processor intensive, and often Firefox just freezes up for seconds while the insane amount of Javascript churns away to generate the page you see. Take a look at their source code sometime - it's crazy!!!
I obviously don't want SURRAnet to perform sluggish like Facebook or even Google Docs. I want it to be fast and responsive. I also want it to require the least amount of work to use (right now it requires too much clicking and navigating). I'm definitely going to use both client and server-side processing, but what is the correct balance? How will these two dance together for the best performance?
My eureka moment came while working on the validation phase of my student records manager. In the past, the client Javascript did the validation. This required plenty of data to be copied from the server to the client, and Javascript has limitations that make this phase of writing SURRAnet less than fun. The old SURRAnet represented the student records as a form that needed to be submitted in order to be recorded (old web). The new version sends individual field data immediately to the server via AJAX, thus providing instant updates to the database and eliminating the need for a "Click here to save" button. It dawned on me that since I'm using AJAX in this fashion, I can make the server do the validation!
This provides a number of benefits, including:
- Small and simple Javascript - This reduces the file size of the .js file needed to be loaded and processed by the client. On slower clients, like old computers and netbooks, this simple Javascript will run much snappier, as it basically just displays the results sent back from the server. Since the server is the powerhouse, it makes sense that it do more of the work when it can.
- Complex code stays in Python - As a personal preference, I'd rather code in Python than Javascript any day! It also makes validation and data processing much easier with direct access to the database objects. Otherwise I'd need to copy many internal server objects to the client Javascript.
- Security - Client-side validation places trust in the client, but what if a hacker tries to post data directly to SURRAnet and thus bypasses validation meant to protect the database from errors? By keeping the validation on the server, the data sent it will be checked regardless of its source, and bad data is not accepted.
- Maintained Web 2.0 experience - Since I'm using AJAX, and SURRAnet is designed to run on a LAN / WAN, the user still gets instant feedback regarding mistakes. Even though validation is taking place on the server, it feels like it is happening client-side because it is just as fast. This might be different if someone were using dialup to connect to the school intranet, but for the average teacher using SURRAnet on a 100 Mbps LAN, this method is perceivably instantaneous.
Wednesday, June 17, 2009
Location, Location, Location
My wife and I have treated ourselves to a little present - an MSI Wind (hers is pink). The Wind is a nice little netbook with a 10 inch screen and great keyboard. It isn't as fancy as some of the latest netbooks, but with features like a 160 GB hard drive, card reader, and great battery life, it is perfect for my work, especially at the $300 price tag!I made this purchase for a few reasons, but the main reason was portability while maintaining usability. I have one of the orginal Asus Eee PCs, and while that netbook is great for surfing the web and checking email, I would not want to code SURRAnet on it, for my eyes and hands would suffer before long! The MSI Wind, on the other hand, is a great little platform to work from. It gives me flexibility to take my work "on the road" in a way that my large, heavy, and power-hungry 17" HP laptop prevents me from doing.
As you can see from the picture, I can find some great locations to program from! I was inspired by Steve Gibson who is pounding out hours of code at his local Starbucks. For me, "location, location, location" is very important regarding how much work I can get done, since SURRAnet requires me to be very focused in order to juggle all the details and big-picture goals without dropping them all on my mental floor.
The one negative is the 10" screen, since SURRAnet is designed for a larger monitor and resolution. However, I can plug the netbook into a full-sized monitor when I have one at my disposal, and I do a lot of testing even with a limited screen size.
I'm still looking for the perfect programming environment. My home office is great when the dump truck army isn't shaking my house. The hillside is great when swarms of hornets aren't buzzing over my head. Maybe I'll try the local library. If only the beach were closer!! With this little netbook, the sky is the limit!
Tuesday, June 9, 2009
if insomnia or dump_truck_noise: raise RuntimeError
There's nothing like a 10 day stretch of bad sleep to mess up one's mind and make complex, object oriented programming almost impossible. Add to this a fleet of noisy dump trucks going back and forth all day long on an otherwise peaceful country road, and code production comes to a standstill.
People who do not program really don't understand the mental exercise this discipline is, especially with large programs that have hundreds of pieces that one must mentally keep track of at all times. There are plenty of tasks that I can do with "half a brain", but programming SURRAnet is not one of them! I find that I almost have to enter a higher state of consciousness in order to see the big picture and simultaneously focus on specific lines of code. It's like 3D chess in some ways, with the need to predict the outcome many moves into the future. Needless to say, a tired, fuzzy mind and a distracting environment are poison to the process.
So... I'm a week behind where I'd like to be. I'm slowly getting back on a decent sleep schedule, and soon I'll have a more portable programming platform (the MSI Wind) so that I can take my software development on the road to quiet and peaceful locations. When my mind is clear and alert, my productivity increases 10 fold!
BTW, in tracking down why I haven't been able to sleep, I've come across multiple reports that Splenda can cause insomnia. I recently switched to Splenda as part of new eating habits I'm adopting (with mental clarity being one of my goals). I have since stopped using Splenda and hope to return to a normal sleep pattern very shortly. The brain is a very complex biologic machine, and chemistry has a lot to do with its efficient operation. That chemistry is determined in large part by what we eat. As SURRAnet becomes a focus and my September deadline looms, I'll be eating lots of brainfood! Feel free to share what helps keep your brain fit by commenting on this blog post.
People who do not program really don't understand the mental exercise this discipline is, especially with large programs that have hundreds of pieces that one must mentally keep track of at all times. There are plenty of tasks that I can do with "half a brain", but programming SURRAnet is not one of them! I find that I almost have to enter a higher state of consciousness in order to see the big picture and simultaneously focus on specific lines of code. It's like 3D chess in some ways, with the need to predict the outcome many moves into the future. Needless to say, a tired, fuzzy mind and a distracting environment are poison to the process.
So... I'm a week behind where I'd like to be. I'm slowly getting back on a decent sleep schedule, and soon I'll have a more portable programming platform (the MSI Wind) so that I can take my software development on the road to quiet and peaceful locations. When my mind is clear and alert, my productivity increases 10 fold!
BTW, in tracking down why I haven't been able to sleep, I've come across multiple reports that Splenda can cause insomnia. I recently switched to Splenda as part of new eating habits I'm adopting (with mental clarity being one of my goals). I have since stopped using Splenda and hope to return to a normal sleep pattern very shortly. The brain is a very complex biologic machine, and chemistry has a lot to do with its efficient operation. That chemistry is determined in large part by what we eat. As SURRAnet becomes a focus and my September deadline looms, I'll be eating lots of brainfood! Feel free to share what helps keep your brain fit by commenting on this blog post.
Friday, May 29, 2009
The True Beauty of Object Oriented Programming
When first introduced to object-oriented programming, I really didn't like it. Looking back, I think I understand why. Besides the obvious fact that OOP takes a while to wrap one's mind around, it often is presented as another way to do procedural programming. In fact, I remember seeing many such examples where I scratched my head and thought, "Why do you add all these layers of complexity just to do that?!?" Think about it, how many times have complex classes been used where a simple function or even a simple script would have done the job with less code and less confusion?
As I was reading the book Dreaming in Code, I came to a part that resonated with me. Actually that happened many times, but the time related to this blog entry was when the Chandler team hired a Python expert to look at their code. He scolded the developers for using Java methodologies in Python, thus creating a huge and overly complex code base. I look at how OOP in Python is presented in many books and websites, and I think that the Chandler developers are not the only ones guilty of this.
So in rewriting SURRAnet, I'm trying to break away from some of the mistakes I've copied from examples I've seen in the past. Often classes are treated as functions on steroids or variables with attributes, but I think the true beauty of OOP is deeper than that. In the SURRAnet rewrite, I'm trying to harness the true power of Python OOP by creating the equivalent of custom types.
I've already done this in some places. For example, the "core" SURRAnet database class, SDBM, is basically a simple Python dictionary (dict) with file operations added to it. It's simple yet beautiful. The SchoolYear class is another example of objects that behave like special variable types, allowing me to use those objects in very intuitive and simple ways.
Yesterday I reworked the StudentData class (now just Student) in light of the added flexibility I have since breaking away from Apache. Instead of being a sort of ugly extension of the StudentDB class, it is truly a "student type", and instead of handling student IDs all the time, I can actually just handle Student objects!
This adds many benefits and simplifies much of my code. Let me leave you with this one example. In the past, sorting students by their name was a big pain, since students were represented by integers (their ID), and sorting those integers would not do. If you look at the current code I have available for download (at the time of this writing), you'll see this strange voodoo sort method in the StudentDB class (sort_stuids_by_fieldname or something like that). Now, by overloading the __cmp__ operator of the Student class, I can have lists of Student objects and just call a regular sort() on that list, and poof - sorted students! No funky voodoo! Here's an example:
Needless to say, the code is simple, beautiful, and logical. I'm quite looking forward to using my new student "type" today as I continue to switch SURRAnet over from Apache-based to a stand-alone server program.
As I was reading the book Dreaming in Code, I came to a part that resonated with me. Actually that happened many times, but the time related to this blog entry was when the Chandler team hired a Python expert to look at their code. He scolded the developers for using Java methodologies in Python, thus creating a huge and overly complex code base. I look at how OOP in Python is presented in many books and websites, and I think that the Chandler developers are not the only ones guilty of this.
So in rewriting SURRAnet, I'm trying to break away from some of the mistakes I've copied from examples I've seen in the past. Often classes are treated as functions on steroids or variables with attributes, but I think the true beauty of OOP is deeper than that. In the SURRAnet rewrite, I'm trying to harness the true power of Python OOP by creating the equivalent of custom types.
I've already done this in some places. For example, the "core" SURRAnet database class, SDBM, is basically a simple Python dictionary (dict) with file operations added to it. It's simple yet beautiful. The SchoolYear class is another example of objects that behave like special variable types, allowing me to use those objects in very intuitive and simple ways.
Yesterday I reworked the StudentData class (now just Student) in light of the added flexibility I have since breaking away from Apache. Instead of being a sort of ugly extension of the StudentDB class, it is truly a "student type", and instead of handling student IDs all the time, I can actually just handle Student objects!
This adds many benefits and simplifies much of my code. Let me leave you with this one example. In the past, sorting students by their name was a big pain, since students were represented by integers (their ID), and sorting those integers would not do. If you look at the current code I have available for download (at the time of this writing), you'll see this strange voodoo sort method in the StudentDB class (sort_stuids_by_fieldname or something like that). Now, by overloading the __cmp__ operator of the Student class, I can have lists of Student objects and just call a regular sort() on that list, and poof - sorted students! No funky voodoo! Here's an example:
SDB = database.StudentDB()
students = SDB.students
students.sort()
for student in students: print student.fullname
Needless to say, the code is simple, beautiful, and logical. I'm quite looking forward to using my new student "type" today as I continue to switch SURRAnet over from Apache-based to a stand-alone server program.
Subscribe to:
Posts (Atom)