Thursday, October 02, 2008

List Comprehension in Python, an example

Coding up a little website where a user would select (using check boxes) from a list of items and submit. I'm using Django btw (which is great). Due to the dynamic nature of the list being generated and displayed, the name of each checkbox wold be something like vid0, vid1, etc. The POST data however will not have the keys for unsubmitted values, and I have no way to tell which keys are in the POST dictionary.

So at first, I coded the following bit of code. Simple, straightforward, gets the job done.
feed = []
for i in range(max_results):
feed.append(request.POST.get('vid'+str(i), '')) # feed will contain empty strings
if feed[-1] is '':
del feed[-1] #if the most recently appended item is an empty string, delete it.
But then, I had a light bulb moment and coded this:
feed=[request.POST.get('vid'+str(i)) for i in range(max_results) if request.POST.get('vid'+str(i),'') is not '']
One line of code now replaces 5! How awesome is that! Python rocks.

There might be even simpler and more elegant solutions out there. If so, please leave them in the comments. (Maybe something using a lambda?)

BTW, I am a newcomer to python having started to code with it just a few months ago.

Labels: , , , , , ,

Getting Started in Corporate Training

Recently, a friend asked my input on getting started in the corporate software training world. I thought my response to him was well thought out and might be beneficial to others (oops, just sprained my shoulder patting myself on the back :) ), so here it is:

An important question to ask yourself is: Are you passionate about Speaking? That's speaking with a capital S. I.e, getting in front of a group of people and talking to them, explaining, presenting, communicating with them, making a connection with them? You got to be passionate about it to be good at it. It's gotta give you a thrill. You gotta feel like you can do it forever. If it's just one more thing to do to make cash and it does not thrill you, then your audience will be able to tell, the sessions will not be good and you'll get no satisfaction. And then, what's the point?

The most important thing about training is presentation and communication. You need to be able to communicate concepts and ideas. Training is not a pedantic click here, click there, you're a moron for not being able to figure this out kind of thing. Adult learners need to be able to fit the why and the benefits of the software tool into their 'mental paradigm'. Benefits, concepts and ideas need to be explained in a why that is relevant to your audience, hence communication and presentation skills become paramount. A great GREAT presenter/speaker is Steve Jobs. Check out his keynote presentations (on youtube) for an example of a great communicator.

Keep in mind that if you're training a software app, it helps to be familiar with said app, but (and I can't repeat this enough), presentation and communications skills rule.

As far as job hunting goes, most corporate training gigs are freelance, which means you sign on for a contract that spans a few weeks, or months. This is not a great time for trainer freelancers. The economic environment means that companies are cutting back on training rollouts and as a result, whatever training gigs there are go to veterans with networked resources. I would keep your current job and just take days off for any gigs you get. This has the added benefit of building experience that you can add onto your resume.

To get experience to add to your resume (this is what i did when I started aobut 18 years ago): I put up fliers and offered individual one-on-one training for about $50 an hour. I was able to add this to my resume as software training. I also volunteered at the public library teaching computer classes (also good on the resume).

As far as software experience is concerned, it's unfortunate that a lot of hiring managers want to see software titles on the resume. Add the usual Office suites and whatever else you can think off that you may have remotely been involved with. The more obscure, or 'corporate' the better (like PeopleSoft, Siebel, or even FileMaker).

Here are a few blogs that I like to read that help make me a better trainer. Not all of them are about training perse, some are about presenting or creating training materials, but all of them deal in one way or another about reaching your audience and communicating.
http://headrush.typepad.com/ <
http://www.presentationzen.com
http://blog.cathy-moore.com/
http://www.articulate.com/rapid-elearning
<

Hope this helps. Let me know how it turns out. I am not one to tell you not to follow your dreams but in this financial environment, maybe keeping your job and looking for part-time contracting work (training wise anyway) would not be a terrible idea.

Tips:
Join LinkedIn and update your profile so it includes skills and accomplishments that line up with training jobs.  For a good idea of what to include, search for training jobs and look for job responsibilities and candidate requirements and try to use the same keywords.  You'll have job recruiters knocking on your door. Try to become an expert on LinkedIn by responding to training related questions from the community.

Finally, for job searches, I use simplyhired.com and indeed.com. They both search other job posting websites and aggregate the search results. Simplyhired also integrates with linkedIn.


FYI, I have not trained in a couple of years as I have become more of a training material author creating user guides and rapid e-learning for my clients.

Labels: , , , ,