Re: Homework Questions Wanted
by planetscape (Chancellor) on Aug 04, 2009 at 21:53 UTC
|
| [reply] |
Re: Homework Questions Wanted
by halfcountplus (Hermit) on Aug 04, 2009 at 16:10 UTC
|
"Intermediate Perl" (Schwartz et. al.) has a great series of similar exercises in it, with solutions. It is explicitly object-oriented, but also contains the best explanation of essential things like grep and map I've ever seen.
The goal is module writing, which looking at the exercise above I would say it might be best done that way, anyway. And it's not too thick. If your participants are interested in doing perl homework they'll love it. | [reply] |
|
|
halfcountplus,
...which looking at the exercise above I would say it might be best done that way
First, thank you for your response. We have provided a long list of perl resources (most free) to include book recommendations. I do want to reiterate that the point of these "homework" assignments is to give achievable tasks for beginners as the primary objective and "extra credit" for intermediate students as secondary. Writing modules (OO or otherwise) is beyond the scope of what I consider beginner perl. I do own a copy of Intermediate Perl (back when it was hideously called "Learning Perl Objects, References & Modules") but haven't found the exercises a good fit for the beginners.
| [reply] |
Re: Homework Questions Wanted
by Bloodnok (Vicar) on Aug 04, 2009 at 16:07 UTC
|
| [reply] |
Re: Homework Questions Wanted
by raisputin (Scribe) on Aug 04, 2009 at 18:55 UTC
|
Not sure that I can offer anything useful here, but as pretty much a beginner myself, these are some things that I have needed to do in our business to better enable our after hours technical support since they cannot have access to some of the systems that hold information, or it was to time intensive for them (they are lvl 1) to do on a regular basis via our RT system. Maybe you can come up with some ideas from those things I have implemented?
- Provide an easy way to watch dial-up logins via a web page
- Connect to another system and retrieve some arbitrary information delimited by lines, parse that information and display it in an easy to read table format highlighting anything that is out of the ordinary.
- As an example: Our cable modem system reports power levels for upstream and downstream. There are certain values that are within spec. Our techs needed a simple way to know that they would be unable to solve the problem if one of those values was out of spec, so in the case that they are out of spec, we highlight that value so they can escalate the call to Lvl 2 technical support.
- In order to get these levels, we must create an ssh connection to the CMTS, query the modem by MAC address, then parse the values from the resulting dataset and display them to the tech so they are obvious.
- On our mailservers (that need to be upgraded LOL) sometimes the spamassassin process just quits (No, I am not in charge of these, thanks). So I wrote a script that monitors each server to ensure that process is running. If it is not, it will send an email to the mail admin to let him know.
- On our mamilservers again: Oftentimes users call in and say that they did not get an email from joeblow@somedomain.com. Almost without fail, this means that the spam filter has caught it and sent it to their junkmail account (which users never check, go figure). Searching this was difficult because more often than not users didn't know exactly when the mail was sent saying things like "last week sometime". To facilitate a time savings, I wrote a perl script that executes a shell script on each server. The perl script takes 2 arguments date as yyyymmdd and emailaddress or messageID.
- Users can enter a date as yyyy, yyyymm,yyyym, yyyymmd or yyyymmdd
- so the command syntax is:
msearch 20090803 email@domain searching for mail from someone that was not received or msearch 20090803 1MY1zZ-0004fr-46 searching for a particular message after the result of the address search. I still need to update this to allow selection of a given message on a given mailserver, and add an argument to restrict the search to a given set of servers instead of all of them, but there has been no time to do so thus far
- In our cable modem provisioning, we used to do it by hand and provision a specific modem for a specific customer before it went out the door. I wrote a small web-based application and with some configuration changes in our server, we no longer have to provision them before they go out.
Our techs now go to a customers home with a modem that has been generically provisioned as a "New Install". When they connect the modem at the customers house, they are forced to a website in which they fill out some basic information: Customers Name, Telephone Number, email address and what type of service they have and whether this is actually a New install or if it is a customer whose modem we are swapping out for some reason. On submit, the web app, through some perl trickery writes out a provisioning file in /tmp then uses some provided CLI tools to connect to the provisioning server, and make the required changes to the modem. It then sends an email out to our admin and customer service teams to ensure that it was properly provisioned. Sounds like a long process, but the whole thing takes less than 2 minutes on average and saves us hundreds of hours
- Password Generator :) Create a simple Password generator to create 8 character passwords. because l and 1 and O and 0 often get confused when looking at them, ensure that if there is an "l" (el) in the password that it is always uppercase and if there is an "O" that it is always lowercase so that they are not confused with 1 (one) and 0 (zero)
I am sure I can think of more things that I have done, just not right now.
Being a beginner, some of these were still fairly easy while some have been challenging in the extreme, such as provisioning cable modems via a web page as that required me to learn not only how to write files, but how to write them properly for the CLI tools provided by a particular software vendor.
Another challenging part of the provisioning was that if it is a modem swap we pull all of the information from the provisioning server based on MAC address and pre-fill in the form for the tech. This was challenging because it required me to learn how to use the provisioning system effectively from the provided cli tools instead of the GUI. It was fun though I have to say.
I have now been programming perl for about 1.5 years and am getting more and more comfortable with it. I am sure that some of my code, the old pro's would look at and laugh until they puked, but at the same time, that is one of the things that I find beautiful about perl, I can write the code in such a way that I have a complete understanding of it at this point in my learning, and as I get better and learn more, I can go back and change it to be smaller, better and more "correct".
I don't know who your students will be or what their programming ability is, but for those with little to no background in programming, I would offer this:
Perl is an enabling language. Because you can write things in many different ways, your code and mine may not be even remotely similar in approach or execution. As time goes on you learn more and your code improves. Each time you write something it gets better, and if you are stuck: perlmonks!!!! | [reply] [d/l] [select] |
Re: Homework Questions Wanted
by Your Mother (Archbishop) on Aug 04, 2009 at 16:44 UTC
|
If shell/sysadmin stuff is the focus, this might be a better choice than the O'RLY books (or at least a choice to augment lessons and a good book to have sitting around the office): Minimal Perl; it is *nix-centric.
| [reply] |
|
|
Your Mother,
Perl for System Administration is already on our list of resources and we will add Minimal Perl - thank you. We don't want to restrict the "homework" to just sysadmin tasks as these are things that truly are intended to be worked from home. While it most be the most applicable and tangible, not everyone has an AIX server at home to play with - besides, variety is the spice of life.
| [reply] |
Re: Homework Questions Wanted
by biohisham (Priest) on Aug 04, 2009 at 16:10 UTC
|
| [reply] [d/l] |
Re: Homework Questions Wanted
by raisputin (Scribe) on Aug 04, 2009 at 16:32 UTC
|
TOTALLY OFF TOPIC REPLY
ROFLMAO!!! HOLY CRAP!
"...After discovering the number called most frequently, you realize you have never called that number. You look closer and all the calls happen when you are at work. You begin to suspect that perhaps your significant other has something to hide..."
Did you take this scenario from a call of mine from like 7 or 8 years ago? That was EXACTLY what happened with my ex-wfie LOL!!!!!! Of course she denied it, but a litte keystroke recorder on her computer and a weeks worth of collecting the resulting email logs confirmed my suspicion. Good riddance to her! LOL LOL LOL | [reply] |
|
|
raisputin,
I am glad you found our story line humorous as that was the intention. We hope it is effective. No, this wasn't taken from your or anyone else's real world experience. We did think it very plausible and that was what we were going for.
We are encouraging participants to bring their real work related issues as the topic for a lesson at work. Working on something real often reinforces a lesson much more than some contrived example from a book. Unfortunately, this won't work for our "homework" because of the sensitive nature of what we work on. We still wanted to provide examples that were realistic, practical and left some questions intentionally unasked to encourage people to go out on their own.
| [reply] |
|
|
When Germany liberalized its telecoms market in the nineties, I worked for one of the American firms that jumped in to compete not just on price, but by offering businesses previously unknown services like itemized bills.
I enhanced the bill with a "Most Frequently Called Numbers" report, and consternation ensued.
| [reply] |
Re: Homework Questions Wanted
by WBF3 (Initiate) on Aug 05, 2009 at 19:31 UTC
|
I have noted that another very good homework assignment is to give the student a working block of code and then ask what it does.
This works especialy well when I am trying to learn a language
Does anyone have any suggestions on which code found here that I should try to figure out?
| [reply] |