Dave's Blog

Saturday, June 29, 2002 5:47:12 AM Thursday, the 20th, at the BayLISA meeting, Jim Dennis introduced us to Python. For an evening introduction, Jim packed in a lot of material. Python has been used to write installation programs, games, build utilities, mail managers, web site managers, as well as numeric, scientific, and statistical packages. The Python interpreter runs on Unix, Linux, MacOS, OS/2, and Microsoft operating systems. Python appears to be a mix of concepts derived from Perl, Java, the Bourne shell, and C, but it's a living, evolving, unique language. The most notable thing that first impresses a programmer about the language is that it uses indentation to infer blocks of code. You can see examples on Josh Cogliati's Non-Programmers Tutorial for Python. I like this one, because it illustrates much of what Jim presented Thursday night:

## This program runs a test of knowledge true = 1 false = 0 # First get the test questions # Later this will be modified to use file io. def get_questions(): # notice how the data is stored as a list of lists return [["What color is the daytime sky on a clear day?","blue"],\ ["What is the answer to life, the universe and everything?","42"],\ ["What is a three letter word for mouse trap?","cat"]] # This will test a single question # it takes a single question in # it returns true if the user typed the correct answer, otherwise false def check_question(question_and_answer): #extract the question and the answer from the list question = question_and_answer[0] answer = question_and_answer[1] # give the question to the user given_answer = raw_input(question) # compare the user's answer to the testers answer if answer == given_answer: print "Correct" return true else: print "Incorrect, correct was:",answer return false # This will run through all the questions def run_test(questions): if len(questions) == 0: print "No questions were given." # the return exits the function return index = 0 right = 0 while index < len(questions): #Check the question if check_question(questions[index]): right = right + 1 #go to the next question index = index + 1 #notice the order of the computation, first multiply, then divide print "You got ",right*100/len(questions),"% right out of",len(questions) #now lets run the questions run_test(get_questions()) The most common loop is the for loop, which iterates over complex data structures. Variables have no type; objects do. A dictionary is an object hash; anything can be the key. A tuple is a read-only list. There is a null object, NONE, which has its own methods. User-written functions are objects. A user can interactively list out all the methods of an object. There is no real encapsulation. There is a way to include a test harness for an object, in the object itself, as a comment. The Python interpreter, which is written in C, loads and executes at speeds similar to Perl. There is a curses module, and an outstanding XML support module. The socket modules are easy to use. In the Q&A session I slowly learned that Python's utility, like that of most modern languages, is best exploited through learning as much as possible about existing libraries. All too often the response to various questions included the phrase "under development," but that just means that Python is being continuously applied to new areas. Unfortunately, the catalog of libraries, modules, and packages is one of the areas "under development." On the other hand, I haven't seen a wonderful catalog of libraries, modules, and packages for C++, either. I'll put this language on a list to watch, and I'll learn it when I need it.


6/26/2002 Today Margaret and I are ordained in the Universal Life Church. Although some people have taken this blessing lightly, to us it is an affirmation. We are divine, and we know that all humankind is divine. We hold that truth for them, even if they do not see it for themselves.


Wednesday, June 19, 2002 11:47:50 PM Last night at BALUG I had the privilege of dining with Dr. Alexander Tormasov of SWsoft. One thing I notice when the title "Dr." is hung on the front of someone's name is that the company wishes to impress the audience with the credential. The most impressive thing I find about PhDs is that they have the support, the time, and the discipline to do the study and research, and to excel at what they enjoy. Other than that, PhDs put on their pants one leg at a time, like everybody else. The two salespeople who accompanied him acted like Disneyland talent handlers, but Alexander was a gentleman, expressing himself considerately. SWsoft was a company in Singapore; it has recently incorporated in Delaware and moved its headquarters to San Mateo, while maintaining its development offices in Moscow. Alexander was at the meeting to present the architecture of Virtuozzo, which is a resource-sharing architecture based on Linux. The idea of Virtuozzo is that multiple users and applications can be hosted on a single hardware platform and be programmed and installed as if they were the only tenants on the system. This technique lends itself to greater efficiencies in web hosting, or colocation consolidation. When Alexander was asked for the difference between his architecture and a stock Unix system, he stated that resource sharing on a Unix system is done at the user level, while his resource sharing scheme is implemented directly in the kernel. He likened Virtuozzo to mainframe partitioning; I was reminded of Sun's Enterprise domain scheme. The business advantage, secondary to efficiency gains, appeared to be that the tenants would be unaware of each other, as they appeared to be the sole tenants in their virtual machines. Alexander mentioned several times that Virtuozzo has been tested supporting Windows NT as the virtual operating system. It has also been tested supporting Linux as the virtual operating system, with up to 1000 kernel instances on an Intel platform with 8 processors and 4 GB of RAM. A member asked, "What were your biggest headaches in developing Virtuozzo?" Alexander's reply was, first and foremost, finding the necessary expertise. SWsoft was able to recruit Alexey Kuznetsov, a member of the Linux kernel team, to provide talent to the project. The second and third problems, respectively, were to redesign the Linux kernel (SWsoft derived its own proprietary version) to achieve mainframe-class stability, and working out the large memory model. The salespeople offered guest accounts on their demonstration server for the members present, but I didn't see a huge response when the presentation was over. That might not be a fair reaction; the product mix and sales success of SWsoft indicate it may become a long-term market leader.


Saturday, June 15, 2002 10:33:12 PM I have been exposed to several different areas of discussion lately that lead me to believe that one of the greatest business skills is communication. It's not a matter of chance that almost every resume on the market today lists "excellent communication skills" as either mandatory or very high on the wish list. Unfortunately, very few people have decent communication skills, much less excellent ones. There's a reason that many development teams meet every Monday afternoon. The weekly build has been completed, and there is a fresh list of compiler errors to examine. The project has been redefined by the marketing people. Alpha testers have issues to raise. And, last but not least, code has been written to a misinterpretation or a misunderstanding of the design. Think of it. You've written an object that has all the functionality and the interface agreed upon last Monday. The team down the hall has written another object that has all of its functionality, and that depends on yours for support. The support the team down the hall expected isn't provided by your object. What's the solution? Phone calls? email? Memos? Maybe a fleeting comment in the elevator or at the cafeteria? Who agreed to what? More importantly, what should the agreement be, who needs to make changes, and how can the code become functional before next Monday? Many observers believe the natural state of the universe is chaos. But as George Carlin and Seinfeld asked, "If entropy is increasing, where is it coming from?" A joke, sure, but a question worthy of Claude Shannon's attention. If we let the universe proceed without attention, chaos does result. The last time I looked, chaos was not a marketable product. Although managing programmers has been likened to herding kittens, programmers and projects must be managed. But the analogy of herding kittens may come from a complete misunderstanding of the role of management in large projects. The intelligence is inherent in the programmers. The design is inherent in the objective. As Tom Peters used to say, "give them the objective, give them the tools, and then get the heck out of the way." Interestingly, one of the primary tools of project coordination is communication. Not only do we have to get together on Monday afternoons to point fingers ;-) and to refocus, but we also have to get together constantly. Every day. Every morning. Every afternoon. We have to communicate naturally and continuously, through every channel available, to ensure that the object down the hall can use our object before the weekly compile.


Previous Logs
2002: January February March April May
2001: May June July August September October November December

 Return to David's Home Page
Your comments are welcomed by David R. Dull, ddull@netcom.com.
(C) Copyright 2002, by David R. Dull. All Rights Reserved.


This page hosted by GeoCities Get your own Free Home Page


1