Philip Ratzsch: March 2009 Archives

links.gif

...and for security reasons, I won't write a blog entry about it.

In other news, I'm now working in our office in Austin so I've moved there as well. As part of setting up my internet connection, I decided to force myself to learn how to configure the wireless functionality on my Cisco 1801. It turns out it's actually pretty easy:

interface Dot11Radio0
description 192.168.100.0/24_Wireless
ip address 192.168.100.2 255.255.255.0
!
ssid fieryweasel <-- also my Twitter account
!
speed basic-54.0
station-role root
no routing dynamic
!
dot11 ssid fieryweasel
authentication open
guest-mode
infrastructure-ssid

Looking at the wireless traffic with a protocol analyzer, I kept seeing the 'hello' packets used by the Cisco discovery protocol - I had forgotten to enter "no cdp enable", but after that it cleaned up nicely. There's currently no authentication in place, but since the only thing the router is presently connected to is my ASA, I'm in no rush. Perhaps I'll get more in-depth about the configuration options in a later entry. If there's anything else Cisco-related that anyone's curious about, let me know. Chances are I don't know it but it would be a good way to learn.

I've been reading a number of books recently dealing with how various languages were discovered, analyzed, and translated in the past. If the language itself is unknown, the key has almost always been what's referred to as a 'bilingual', some text of sufficient length written in at least one known language as well as the unknown.

The most famous example of this is of course the 1,700-lb Rosetta stone, with the same text in Greek, demotic, and Egyptian hieroglyphs. The Rosetta stone allowed Champollion (arguably) to finish deciphering the hieroglyphic language by means of comparing proper names in the Greek and attempting to find the equivalent hieroglyphs.

I started thinking about how various languages might be deciphered in a distant future when humans were long gone. It occurred to me that about the only real stone inscriptions in any quantity are those that appear on grave stones, and the length of each inscription consists almost entirely of names and numbers if not exclusively. Granted, there are also some monument inscriptions and thing of that nature.

As more and more things become electronic and internet-bound, it may appear to some future civilization that at some point we just stopped writing. But what about plastics? An increasing number of things are plastic, and it's well-known that plastics last a ridiculously long time before finally decomposing. Something as simple as Coke bottles discovered in the landfills of various nations may someday allow many human languages to be unraveled. It's an odd thought that our garbage may be the only real clue to our civilizations.

Tkinter

|
As part of my continuing effort to hate Python less, I decided to do some fiddling with the Python Tkinter library.  For those of you playing along at home, it's a series of libraries (or whatever Python calls them) for performing Tk/Tcl tasks.  

I've never done GUI coding before.  Up to this point, all my code's execution space was limited to browsers and the occasional CLI tool.  Like one would expect from an object-oriented language, the GUI behaves in much the same fashion, with 'widgets' as they are called (a button, a menu, text field, etc.) descend from a root frame.

from Tkinter import *  # Get the library

class App:

    # Draw GUI and init
    def __init__(self, master):

        # Parent frame
        frame = Frame(master)

        # The pack() method returns an object of type None so Frame(master).pack() will only work if you don't want to reference 'frame' again.
        frame.pack()
   
        # Labels are simply output areas
        self.display_text = Label(frame,text="")
   
        # side=TOP - Sets the widget's placement
        # TOP, BOTTOM, LEFT, and RIGHT are constants set by Tk
        self.display_text.pack(side=TOP)

        # Create a button
        # Args:
        #  frame - Set 'frame' as the parent of the button
        #  text - an attribute setting the text on the button
        #  command - the callback which will fire when the button is clicked.
        self.button = Button(frame, text="This is a button", command=self.a_method)
        self.button.pack(side=LEFT)

    # A callback method
    def a_method(self):
   
        # the config() (or configure() ) method is used to modify widget options
        self.display_text.config(text="Button pressed")

#Yet another thing I hate about Python - if the next four lines are at the top of the file, this doesn't work.
root = Tk() #Instantiate the root widget
root.title('Test App')  # ...and give the window a title
app = App(root)  #Instantiate the App class, which contains all the logic
root.mainloop() # Start the event handling loop

Much like in CSS, object placement seems to get exponentially more troublesome as the number of objects grow. 

While so far the only thing I've done with this is write a utility for work (and thereby getting some more practice with Python's xmlrpclib methods) I think I'll definitely have to keep messing around with this.

Play around with it a bit and let me know what you end up creating!

About this Archive

This page is a archive of recent entries written by Philip Ratzsch in March 2009.

Philip Ratzsch: February 2009 is the previous archive.

Philip Ratzsch: April 2009 is the next archive.

Find recent content on the main index or look in the archives to find all content.