Err: Connection timed out [110] Write-up — Coding Loudly

Entries Tagged 'Write-up' ↓

EngEdu Video Write-up: “Advanced Python (or understanding Python)”

 Advanced Python (or Understanding Python) by Thomas Wouters

Thomas Wouters speaks with a great signal to noise ratio. He guides by groking both Python and which bits of Python confuse learners. An advanced programmer will love his short code snippets. An intermediate Python programmer will appreciate the clarity in which he covers topics. A beginner will also appreciate the ‘Understanding Python’ section.

You may want to use this video more as reference than a single experience.

‘Understanding Python’ explains the cohesive and consistent rules covering all the scoping rules, modules, definitions, and object rules. Much of the rest of lecture covers a variety of topics, mostly related to special classes. I find this a good reference lecture to get the two minute overview of a particular topic.

“Get you program, can’t tell your decorator from your generator without a program.”
0:00; ‘Understanding Python’
0:17; Details about object lifecycle and implementation.
0:27, Iterators and Generators.
0:33, Decorators
0:40 Special Class Hooks, including New-style 2.2 classes (0:38); Descriptors (0:40), Properties (0:41), Classmethods, staticmethod (0:43), __slots__ (0:47), __new__ actual constructor (0:48).
0:51 Metaclasses
1:01 Multiple Inheritance
1:05 Unicode

Keep this link in your reference folder.
Have an excellent day! — Charles Merriam

Event Write-up: First Tuesday Notes for Tuesday, August 1.

Overall:

The basic topic, “Improving Communications in Face to Face (Meatspace) Meetings” presented challenges. It may be the topic with the most opportunity that we ever covered.

The group was small, about 15 people, with good participation by all. As mechanics worked out, no one was that interested in dinner and the lack of a babysitter sidelined Judith for much of the conversation.

Some Ideas Covered:

  • Achut Reddy and others suggested improvements to the general calendaring and scheduling of meetings.
    1. A universal cut-and-paste function that would recognize calendars would be helpful. The idea would be that a calendar item could be highlighted text from an email, webpage, IM, Evite, or other source and be copied into a calendar in an intelligent manner.
    2. We need to easy share calendars by role (social, work, technology interest, politics, etc.), by group (kw-comm, our tribe, everyone we know), and social circle (1 degree of connection, 2 degrees, etc.)
    3. It would be nice to have a slick implementation to take over the world.
  • Bubbles, Laura, and others pointed out the low-tech solutions for meeting at a convention, the Voodoo Board.
    1. See Wikipedia for a description of this low tech method involving push pins, index cards, and a bulletin board.
    2. The Voodoo Board allows easy message passing fast, simple, and cheap.
    3. The secondary social aspects, such as meeting people who are checking messages, make the board worthwhile.
  • Joe, myself, and others talked about discovering interesting people.
    1. One of the modes or roles is to find interesting people, break the ice, and chat.
    2. Use of markings for common interest was discused. For example, Judith mentioned one gathering where badges held symbols for different fields of law. Also mentioned were Bujold’s “Betan Earings” and the Geek Code.
    3. I came up with the overboard technical solution: wearable LCD panels with near range communication. When you come close to someone else with a similar wearable tag, it might light up with “I’m also interested in Python” or “I also know Richard Threadgill”. I’ll write this idea up in detail soon.
  • The core human problems still trump: calendars might be inundated by promoters; slimy people lie about existing relationships; etc. The nuances of communication are an opportunity to automate.

EngEdu Video Write-up: “Practical Common Lisp”

Practical Common Lisp by Peter Seibel

Date: May 10, 2006

Overview

  • Good material with mediocre presentation. Seibel seems to hint obliquely at his three major points:
    1. Lisp gives a higher level view of an implementation than Java et al.
    2. Lisp constructs can be made to work in other languages, but verbosely.
    3. The key tool is Macros, which allows programmers to define new syntax to better express the problem.

Details

These are my mostly raw notes from watching the hour long video.

Peter Seibel

  • Pronounced “Sigh-bull”
  • Practical Common Lisp
    • 500 pages long
    • Winner of Jolt Award
    • Aimed at an expert non-LISP programmer
  • Worked at Kenamea, BEA, Organic Online
  • Second generation LISP programmer

Ideas from Peter Naur’s “Programming as Theory Building”

  • View that ‘theory’ is the essence of a program
  • Can only get theory from code without work equivalent to writing it
  • Programming languages allow us to write more concisely

Views from Patterns

  • Software patterns for people writing software
  • Building patterns make some rooms more usable
  • Alexander looked for a generative language
  • Patterns generate forces; a good language could make closure
  • Software patterns are for a particular language sets; others do it automatically.

What’s Natural

  • Language wars are often fought based on what’s natural
  • What’s natural is often confused with what was learned
  • Infix notation is hard to learn, but is ‘natural’ because we learned

Sapir-Whorf hypothesis

  • By Edward Sapir and Benjamin Whorf in 1920′s
  • Suggests the thoughts we think are largely determined by the language we speak
  • Sometimes called Linguistic Determinism
  • Strong Linguistic Determinism is that you can’t think what you can’t say
  • Weak Linguistic Determinism is that what you can say influences what you think
  • Strong LingDet undermined by fact we can translate human languages
  • Weak LingDet supported by colors being easier to remember when named
  • Turning Completeness destroys Strong LingDet for programming languages

Paul Grahm

  • “Beating the Averages” by Paul Grahm
  • The ‘Blub’ paradox of the intermediate powerful programming language
  • Looking at less powerful languages shows what they lack from Blub
  • Looking at more powerful languages looks like Blub plus unknowable gunk
  • If you could think in most powerful language possible, could work in any.

Quotes

  • “Beware of the Turning Tarpit” by Alan Perlis
  • “LISP isn’t a language, its a building material” by Alan Kay
  • “LISP has assisted … in thinking previously impossible thoughts” by Dykstra

Vistor Pattern (Double Dispatch)

  • Often used when traversing a tree of heterogeneous objects
  • Traversal is not the point of the pattern
  • Double-dispatch is point of the pattern.
  • Example: use for pretty printing or compiling a tree of syntax tree
  • Trying to dispatch to a particular function based on two object hierarchies.

Java Vistor Pattern Example

  • Polymorphing is like “Object o; o.display()”
  • Non-polymorphing, or overloading, is like “Object o; ((Book) o).display()”
  • Could write hand-coded dispatching but maintenance nightmare
  • Java cannot direct dispatch correctly a something like DisplayPtr.display(MediaPtr)
  • The DisplayPtr subtype cannot be resolved at compile time, so is Non-polymorphing overloading
  • Pattern concentrates the grunt code in one place and makes it more maintainable.
  • Lisp does this without writing grunt code

Language rants

  • Simula and LISP mixed well made SmallTalk by Alan Kay (Good)
  • SmallTalk (did he mean Simula) and C mixed make C++ (Bad)
  • SmallTalk added message dispatch, now back in CommonLisp
  • Methods no longer are member of classes, so organize them well.

Multiple Dispatch

  • Explained much better in Wikipedia
  • Shows using a pattern in Java that accomplishes the same thing as in Lisp.
  • Key aspect is that same pattern can be implemented, but with easy syntax in Lisp.

Error Handling in General

  • Pre and post condition testing is not sufficient
  • There are ‘actual’ pre/post conditions that cannot be derived from code
  • Formal pre/post conditions are what we can derive from code
  • Actual pre/post conditions are real corner cases, like file gets deleted during run
  • Can open up our expectations and passing error handling upward to a degree.

Error Handling in C, Java, etc

  • C uses a ‘return value’ which is often ignored
  • Java, Python, etc. propagates exceptions so routine must “handle it or fail”
  • Some exceptions need to have decision about how to handle it far up the stack.
  • Making that decision in a Java exception system unwinds the stack too early.

CommonLisp Exceptions

  • Example is pretty badly described. Think “Top level decides if parse problem is fatal or not.”
  • Allows signal of error to be passed up stack independently of unwinding the stack.
  • Can use an ‘restart’ method to keep the original stack
  • Key aspect is that this is a pattern easier in CLOS, but implementable in other languages

* 55 minutes into video
Macros are the most important feature of CLOS

  • The language parser parses into a generic abstract syntax tree
  • You can hook your own code generator into the compiler at any scale or level
  • These macro hooks expand into lots of Lisp code.
  • This allows one to create new syntax and language concepts
  • New, compile-time syntax is often best way to express a problem
  • Making the pattern explicit in a macro avoids making it implicit in code