Tuesday, September 26, 2006

From the book Bon By Walden and Nerson

The control structures
of languages like Pascal and C embody abstractions that the assembly
programmers were already using mentally (often occurring as comments in some
pseudo-Algol notation), so the big payoffs were immediate. When the tedious
and error-prone translations of these constructs into sequences of machine
instructions were no longer needed, work could proceed as before, only much
faster.

pg 10 Fortunately, in recent years a very promising method has been proposed to
bring elements from the research fields of abstract data types and formal
specification into standard use in software engineering. This is the theory of
software contracting [Meyer 1992c]. The idea is to use assertions to define the
semantics of each class. The prerequisites and resulting behavior of each
operation are specified through pre- and postconditions, and the overall class
consistency through the class invariant. These semantic specifications then
form the basis for a contract between each class, the supplier, and all classes
using its operations, the clients.

Many existing methods for analysis and design, probably the majority, include
either data modeling using some variant of the entity−relationship approach (ER
modeling [Chen 1976]) or finite state machines (FSM modeling), or both, as a
significant part of their high-level system description.

With FSM modeling, the impedance mismatch is obvious
since there is no easy mapping between the state transition graphs and an
eventual implementation (unless we actually model every object as a state
machine, thereby giving up all abstractional power of the class concept).



Consider the entity
EMPLOYEE and the concept of being the most popular person in a service
department. Clearly, being most popular is a personal property, but modeling it
as an attribute of EMPLOYEE may be quite wrong from the system’s point of
view. The employee abstraction may not know about its condition, and the only
way this knowledge will manifest itself may instead be as a combination of
attributes of other entities, perhaps STATISTICS and CUSTOMER_POLL.



BON has been designed to follow a different track. Rather
than trying to include concepts from traditional data modeling or the so-called
structured techniques with all their accompanying drawbacks, a more fruitful
alliance is sought: the combination of object-oriented flexibility with the clarity
and expressive power of strong typing and formal contracts between classes.


p. 17 BON has been designed to follow a different track. Rather
than trying to include concepts from traditional data modeling or the so-called
structured techniques with all their accompanying drawbacks, a more fruitful
alliance is sought: the combination of object-oriented flexibility with the clarity
and expressive power of strong typing and formal contracts between classes.

Formalisms from other fields, which are often adapted and used as part of
proposed object-oriented analysis and design methods, such as state transition
diagrams, process diagrams, Petri nets, entity−relationship diagrams, data flow
charts, etc., are therefore not addressed in BON.

Tuesday, September 19, 2006

Slashdot Quotes About Python

Finally C gives easy hooks into the OS, which isn't the same at all with Lisp, although you can do anything you can do with C it isn't Lispy to do so.

I personally love Python (used it for all the code I wrote for my thesis), but these days I program Perl at work. It's not that bad, really. It makes sense, in its own way and it's got a good solid set of libraries available out there.

So the question is not so much are you good enough to learn C, but are you willing to take the time. In C, algorithms tend to be quite a bit more complex than they are in Python,

That made me sit up and take notice. A pretty nice programming language with built-in functionality to read and write Sqlite databases natively?

Now extensive third-party repositories such as CPAN or easy-to-install third-party libs such as Ruby's gems do make sense, and are also great assets to a language not to be underestimated, but stdlib functions just give much more (potentially misguided though) confidence about quality, and they create common idioms across the language.

It is good to finally see inline conditions such as:

print ( "first option" if a==b else "second option" )

Sunday, September 03, 2006

Python replace command

<<<<

String Methods

The most basic way to manipulate strings is through the methods that are build into them. We can perform a limited number of tasks to strings through these methods. Open up the Python interactive interpreter. Let's create a string and play around with it a bit.

>>> test = 'This is just a simple string.'

Let's take a fast detour and use the len function. It can be used to find the length of a string. I'm not sure why it's a function rather than a method, but that's a whole nother issue:

>>> len ( test )
29

All right, now let's get back to those methods I was talking about. Let's take our string and replace a word using the replace method:

>>> test = test.replace ( 'simple', 'short' )
>>> testa
'This is just a short string.'
<<<<<
The replace command changes all instances of the first argument, not only the initial one.

%20 means space

Space = decimal code point 32 in the ISO-Latin set.
32 decimal = 20 in hexadecimal
The URL encoded representation will be "%20"

Listing of data elements in Squishdot posting





= http://www.goodbyejim.com





= "Hurst seems to be a different kind of candidate, and a different kind of Dem, from Jim Moran. Particularly on the subjects of unfair trade agreements and earmarks."
= ""
= "I wondered why so many Dems are friendly to Jim Hurysz, who opposes CAFTA and is going after Moran over OFTA where Moran was at odds with the entire Democratic Leadership.



Moran is on his way O-U-T. One more stupid remark and he is a goner. Too many young Dems have their eyes on Moran's seat in Congress and they are seeing how well Jim Hurysz, who is 59, is being received by voters this year."

= ""
= Barry
= Sunday September 03, @09:33PM





comment_spillover">



replylevel">
',prevlevel - level)">
= 1157333636
= Re: Andy Hurst expresses opposition to Moran posit








=




prevlevel">

',prevlevel - level)">






















replylevel">
',prevlevel - level -1)">