cobol >> Geriatric farts WAS: The list of INVOKEs

by Pete Dashwood » Sat, 13 Jun 2009 10:23:20 GMT

Howard Brazee wrote:
> On Thu, 11 Jun 2009 16:04:32 -0600, "Frank Swarbrick"
> < XXXX@XXXXX.COM > wrote:
>
>>> Jeepers Paul, just read you are an old fart at 70; join the club,
>>> I'm 78
>>
>> You guy's make me feel good for just having turned 40.
>> :-)
>
> I see three (on-topic) ages:
>
> 1. Have to work.
> 2. Qualified for a pension, but still working full time, building up
> the retirement.
> 3. Retired - any money from work is for toys.
>
> I'm in stage 2, looking forward to 3. We all have toys, it's nice to
> have enough to live on - and new income goes for them.

You are really fortunate, Howard. (I know that hard work and planning had
more to do with it than luck, but to even be achieving what you planned
involves a modicum of fortune.)

Consider these amendments:

1. "Have to work". But cannot get a job. The skills you have are largely
out of date or no longer in great demand, and you are competing with
energetic young people who are not as desperately driven as you are (the
young will always survive; in a worst case scenario they can go and live at
home for a while...) Days go by, the bills mount up and the situation looks
hopeless...This undermines your energy and confidenece and becomes a
dwindling spiral.

2. "Qualified for a pension, but still working full time, building up the
retirement." This is indeed a fortunate position to be in. I don't know of
many companies where they allow this, UNLESS you have specific skills they
are anxious not to lose (or it would cost them more to replace you, than to
let you stay on while they train your replacement). In some countries
retirement is compulsory at retirement age and companies CANNOT (officially
and legally) do this. (They can get round it by retiring you, then engaging
you as a contract consultant...)

3. "Retired - any money from work is for toys." Except for those who are
retired and trying to live on their pensions. Then "any money from work" is
used to buy fripperies like electricity, water, and food... :-)

Since I passed 60 (and did NOT collect $200) I have been giving more thought
to "retirement". I reckon a bank heist could be a good option. The banks
have all the money, and what's the worst that could happen? You get away
with it, sweet... You get caught, free heating, clothing, food and lodging
for a number of years... I can't see a downside, compared to the way some
retirees are forced to live. I'm just surprised there aren't more geriatric
criminals... (Maybe difficulty in running, and the need for frequent comfort
stops are not conducive to a life avoiding the Law...)

Having been a freelance for nearly 35 years now, I'm used to not expecting
anyone to take care of me and am just thankful that I own my house and have
no debts. If I don't work, I can't afford to live. (I won't qualify for a
pension for a few years yet and even if I got it (there is some doubt
because I have been out of NZ a lot), it would be a very meagre existence.)
Apart from that, I LOVE my work and I need to do it.

For the last 4 years now I have preferred to stay at home, rather than to
traipse round the world raising the wherewithal that would enable me to stay
at home... As a result, my savings have been depleted to the point where I
decided that action must be taken. I had planned on returning to Europe in
April to seek consultancy work, but the recession put paid to that. It is
cheaper to live here than there and if I didn't get work pretty immediately,
it could cost me a fortune just for accommodation and transport.

Being in one place for a period of time has upsides I had not seen or
considered. I'm getting involved in the local community and some of this is
really rewarding (not in terms of money, but money isn't everything...seeing
kids winning and helping them do things they never thought they could is
beyond price. I know that most of you who are parents already know this,
but I spent most of my life avoiding having children so it was new to
me...:-))

I am finding that if it is possible to create a home based business, this
could be an ideal model to take me into retirement. I don't enjoy travelling
(especially long haul) as much as I used to (although First Class is nice...
I had occasion to do a 4 hour flight to Melbourne recently and was
upgraded... it was great. Food, drink, mains power and wireless internet for
the notebook, and space for my 6 foot frame, not to mention some very
interesting conversation; I was next to a lady who is a researcher in stem
cell technology for a California based company, you can imagine how that
went... :-)), I just don't look forward to 26 hours in Economy any more...

Web skills are a useful asset and the response to the cobol21 site has been
more than I expected or hoped for. (I spent many hours revamping the site
and I don't consider any of it wasted).There is a genuine growing awareness
that people need to move off COBOL but it needs to be done sensibly and
carefully. Through the website, PRIMA is becoming a "centre of competence"
for things Migration and we recently acquired our first North American
customer for the Migration Toolset. There has been a good level of
downloading of the free information I have made available (largely connected
with the COBDATA Tool and using SQL in COBOL, but there have been requests
for packs on Migration, which I am working on) and I intend to put more up
there as soon as I can.

The most popular page on the site has been the one that has a picture of an
IBM mainframe on it... I think there is a fair bit of nostalgia in the
people who visit. It is kind of fun to interact with a 35 year old COBOL
component and compare how it looked in 1974 and how it looks on .NET today.
If people get some insight into understanding and using component
technology, even just come to realise what INVOKE does in COBOL, (we have
seen a lack of that demonstrated in this very thread recently) then I am
satisfied.

Retirement is different things to different people, and much of it, as
Howard pointed out indirectly, depends on decisions you take many years
before it arrives. Most of us in our thirties can't imagine ever being
"old". We are indestructible and the future can take care of itself. Then,
one day, you look in a mirror and realise there is more salt than pepper in
the beard and hair, and the eyes don't have quite the sparkle they used to,
yet the person inside is still the same, just wiser, maybe calmer, and more
experienced. (And, as Doc points out, the memory becomes more porous...:-))

If we are "lucky" (and we do the necessary planning) our retirement can be
an really enjoyable time, just as Howard is finding.

I'm still working to shape mine into what I want it to be... :-)

Pete.
--
"I used to write COBOL...now I can do anything."




cobol >> Geriatric farts WAS: The list of INVOKEs

by Frederico Fonseca » Sun, 14 Jun 2009 20:57:22 GMT


op posting only -

Great post Pete - I am still far away from retirement - but all your
points apply.

Frederico

On Sat, 13 Jun 2009 14:23:20 +1200, "Pete Dashwood"
< XXXX@XXXXX.COM > wrote:




cobol >> Geriatric farts WAS: The list of INVOKEs

by Pete Dashwood » Mon, 15 Jun 2009 10:09:53 GMT

rederico Fonseca wrote:

Thanks for your comment, Frederico.

I hope you have a fulfilling future for many years yet... :-)

Pete.

Nothing new below - Top Post

--
"I used to write COBOL...now I can do anything."




Geriatric farts WAS: The list of INVOKEs

by Howard Brazee » Tue, 16 Jun 2009 00:11:02 GMT

On Sat, 13 Jun 2009 14:23:20 +1200, "Pete Dashwood"




See: http://www.imdb.com/title/tt0079219/

--
"In no part of the constitution is more wisdom to be found,
than in the clause which confides the question of war or peace
to the legislature, and not to the executive department."

- James Madison


Geriatric farts WAS: The list of INVOKEs

by SeaSideSam » Tue, 16 Jun 2009 01:10:06 GMT





the safest way i know of in the usa to gather a retirement nest egg is to...

1) get elected to any position
2) quit paying your taxes
3) claim ignorance of the law
4) proclaim that you have found god
5) proclaim that you and your family are green to the gills

works every time. tremendous savings to be had using this method.

sss


Geriatric farts WAS: The list of INVOKEs

by Charles Hottel » Tue, 16 Jun 2009 09:54:55 GMT







How about failing but being too big to fail? Where is my bailout?




Similar Threads

1. List of "CALLs" vs List of INVOKEs

Starting a new thread - based on an  older one.

The comparison of a COBOL compiler vendor providing a "list of INVOKEs" when 
compared to a "Lit of CALLs" actually raises and interesting (to me) topic.

For Micro Focus, for example, they do provide a list of
 - CBL_
 - PC_
 - hex-literal
subroutines that they provide.  In almost all (well at least many) of these 
cases, you can "get the same effect" by using some System API or a call to 
"system" with specific parameters.

In some (not all) ways, this is similar to the way that IBM provides LE callable 
services.  Again, many of these services CAN be achieved by "system" defined 
(and named) services.

Therefore, I certainly CAN imagine a COBOL programmer thinking that the COBOL 
vendor (rather than the "Object owner") might provide "my-COBOL-specific" 
methods (or classes) to access facilities (such as Microsoft Excel).  Why they 
might do that I can't imagine (and as I don't know of any vendor that does it, I 
don't think there are good reasons for it.)  However, as someone who does 
understand (I think) Pete's and Frederico's (and other's) posts, I did think 
that I might bring this up as a POSSIBLE area of confusion.

The bottom-line being that (at least for Microsoft "products"), Microsoft, not 
Micro Focus (or Fujitsu or other COBOL vendors) does provide "adequate" classes 
and methods (and properties) and it is these that should be looked at by the 
COBOL programmer.  This is UNLIKE certain types of "system" CALLs/API's where 
the COBOL vendors have provided their own interfaces to the underlying system 
service.

-- 
Bill Klein
 wmklein <at> ix.netcom.com 


2. Cross referencing objects: Am I invoking UB?

3. The list of INVOKEs

4. Having a brain fart with entry controls ...

5. FART Performance

I'm looking for some advice on mathematical optimization in CL. I have
implemented a Fuzzy ART network, and I wonder how I might
significantly improve the performance.

After trying some simple differential benchmarks on simple constructs,
I tried implementing it without CLOS, using a struct instead of class
and functions instead of methods. After benchmarking the alternate
implementation (and keeping in mind that small differences will
snowball into big differences as the size of the network grows), I
didn't see enough difference to justify the sacrifices. (Due to the
input randomization, the resulting networks had slightly different
sizes, but they were close enough. I'll have to devise a static set of
inputs to truly compare apples to apples.)

Because the application requires chaining FARTs together, to build
multi-level networks, such as Fusion ARTMAPs, I'll require a
structured architecture.

I tried profiling with SBCL's profiling utilities, but as I don't have
much experience profiling in CL, I didn't quite know how to interpret
the reports.

>>>>>>>>>>

(defclass fart ()
  ((inputs
    :initarg :inputs :accessor inputs :type simple-vector
    :documentation "the vector of inputs (I)")
   (outputs
    :initarg :outputs :accessor outputs :initform nil
    :documentation "the vector of outputs (Y)")
   (weights
    :initarg :weights :accessor weights :initform nil
    :documentation "the two-dimensional vector of weights (W)")
   (vigilance
    :initarg :vigilance :accessor vigilance :initform 0.0 :type single-
float
    :documentation "the vigilance parameter (phi)")
   (alpha
    :initarg :alpha :accessor alpha :initform 0.0 :type single-float
    :documentation "the alpha parameter")
   (beta
    :initarg :beta :accessor beta :initform 0.0 :type single-float
    :documentation "the beta parameter")
   (winner
    :initarg :winner :accessor winner :initform 0 :type single-float
    :documentation "the winning category")
   (size-delta
    :initarg :size-delta :accessor size-delta :initform 8 :type
integer
    :documentation "the amount by which vector allocations will grow")
   (complement-coding
    :initarg :complement-coding :accessor complement-coding :initform
t
    :documentation "whether the fuzzy-art complement-codes its
input")))

(defmethod initialize-instance :after ((instance fart) &key)
  (with-accessors ((outputs outputs) (weights weights) (winner winner)
		   (size-delta size-delta)) instance
    (unless (and (slot-boundp instance 'outputs) outputs)
      (setf outputs (make-array size-delta :element-type 'single-
float :fill-pointer 0)))
    (unless (and (slot-boundp instance 'weights) weights )
      (setf weights (make-array size-delta :initial-element nil :fill-
pointer 0)))
    (unless (and (slot-boundp instance 'winner) (>= winner 0))
      (setf winner 0)))
  instance)

(defgeneric feed-inputs (element value))

(defmethod feed-inputs ((fart fart) (value array))
  "Set the current input vector for training. With complement-coding
disabled,
this method merely sets inputs to value, so altering the shared array
object would
lead to undefined behavior. With complement-coding enabled, it sets
inputs to
a complement-coded copy of value. Related egghead methods do not alter
the value array."
  (if (complement-coding fart)
      (let* ((length (length value))
	     (array (make-array (* 2 (length value)) :element-type 'single-
float)))
	(loop for i from 0 below length
	      for ii across value
	      do (setf (aref array i) ii (aref array (+ i length)) (- 1 ii))
	      finally (return (setf (inputs fart) array))))
      (setf (inputs fart) value)))

(defgeneric grow (element))

(defmethod grow ((fart fart))
  "The outputs vector (y) and the weights vector (w) grow together.
This method will
increment the fill-pointer of each vector, increase the vector
allocations if necessary,
set the winner to the new category and return T, indicating that the
winning category is
uncommitted."
  (with-accessors ((outputs outputs) (weights weights) (winner
winner)
		   (size-delta size-delta)) fart
    (let ((category-count (fill-pointer outputs)))
      (when (eq (array-dimension outputs 0) category-count)
	(adjust-array outputs (+ category-count size-delta))
	(adjust-array weights (+ category-count size-delta) :initial-element
nil))
      (incf (fill-pointer outputs))
      (incf (fill-pointer weights))))
  t)

(defgeneric fire (element #|activator signal context|#))

(defmethod fire ((fart fart) #|activator signal context|#)
  (setf (winner fart) -1)
  (if (eq 0 (fill-pointer (outputs fart)))
      (grow fart)
      (let* ((max-y most-negative-single-float)
	     (inputs (inputs fart)) (outputs (outputs fart)) (weights
(weights fart))
	     (alpha (alpha fart)) (vigilance (vigilance fart)) (winner
(winner fart))
	     (sum-inputs (loop for ii across inputs sum ii into sum finally
(return sum))))
	;; TODO: With complement-coding, sum-inputs will be constant across
input vectors
	;; of the same size--i.e., half of the node count of the complement-
coded input vector.
	(loop for j from 0 below (length outputs)
	      for wj across weights
	      do (multiple-value-bind (sum-weights sum-iw)
		     (loop for wji across wj
			   for ii across inputs
			   sum wji into sum-weights
			   sum (min wji ii) into sum-iw
			   finally (return (values sum-weights sum-iw)))
		   ;; FIX: As it is, fire activates all of the outputs, when it
should only
		   ;; activate the winner. Use a vector pre-y for pre-activation
signals,
		   ;; zero the outputs and activate only the winner.
		   (setf (aref outputs j) (/ sum-iw (+ alpha sum-weights)))
		   (if (and (>= sum-iw (* vigilance sum-inputs))
			    (< max-y (aref outputs j)))
		       (setf winner j max-y (aref outputs j)))))
	(setf (winner fart) winner)
	(if (eq winner -1)
	    (grow fart)
	    nil))))

(defgeneric learn (element #|specialty signal context|#))

(defmethod learn ((fart fart) #|specialty signal context|#)
  (with-accessors ((inputs inputs) (outputs outputs) (weights weights)
		   (beta beta) (winner  winner)) fart
    (if (eq -1 winner)
	;; fast learning
	(progn
	  (setf winner (1- (fill-pointer outputs)))
	  (setf (aref weights winner) (copy-seq inputs))
	  (setf (aref outputs winner) 1.0))
	;; slow recoding
	(let ((wj (aref weights winner))) ; winner must be a valid index into
weights
	  (loop for i from 0 below (length inputs)
		for wji across wj
		for ii across inputs
		do (setf (aref wj i) (+ (* beta (min ii wji)) (* (- 1 beta) wji)))
		finally (return nil))))))

(defgeneric train-current (element))

(defmethod train-current ((fart fart))
  (fire fart #|nil nil nil|#)
  (learn fart #|nil nil nil|#))

(defparameter *fart* (make-instance 'fart :vigilance 0.89 :alpha
0.000001 :beta .1 :size-delta 2048))
(defparameter *inputs* (make-array 4 ))
(proclaim '(simple-vector *inputs*))

(defun bang ()
  (loop for i from 0 below (length *inputs*)
	do (setf (svref *inputs* i) (coerce (/ (random 100) 100) 'single-
float)))
  (feed-inputs *fart* *inputs*)
  (train-current *fart*)
  (winner *fart*))

>>>>>>>>>>

; On an AMD Athlon(tm) 64 X2 Dual Core Processor 4200+, with 2GB RAM,
; a linux-2.6.17, 64-bit Gentoo system and SBCL 1.0.1, I have the
following:
CL-USER> (time (dotimes (n 10000) (bang)))
Evaluation took:
  7.193 seconds of real time
  7.192449 seconds of user run time
  0.0 seconds of system run time
  0 calls to %EVAL
  0 page faults and
  2,467,552 bytes consed.
NIL
CL-USER> (length (outputs *fart*))
560
; Of course, as the network grows, the runtime increases.
CL-USER> (time (dotimes (n 10000) (bang)))
Evaluation took:
  13.337 seconds of real time
  13.336833 seconds of user run time
  0.0 seconds of system run time
  0 calls to %EVAL
  0 page faults and
  2,446,848 bytes consed.
NIL
CL-USER> (length (outputs *fart*))
829
CL-USER>
; Build a network up to a few thousand nodes, and you might as well go
find other things to do while it chews on it.
>>>>>>>>>>

I tried a couple of things, such as proclaiming data types of slots,
arrays and specific variables, making arrays simple-vectors where
possible, etc., but I wasn't seeing any dramatic gains. I'd wager that
the bottleneck is the math--correct me if I'm wrong. Due mostly to my
inexperience in CL optimizations, I imagine that there must be a few
things that will result in marked performance improvements. Does
anyone have some pointers on where to start?

Thanks in advance,
Jack

6. I am getting following error when I am building my C program

7. A trivial problem with Tk, I am sure I am not doing it the right way

Hi All

I am novice in Tk , so I have goofed up somewhere in my code ...Need
help

Heres my partial code snippet

# I define a global variable

set udrPath /udr

# and then I use it as textvariable for my entry widget
entry .bfmc.ud -text "/udr" -textvariable udrPath

#next to the entry widget, i have a button
button .bfmc.btud -text "Set" -command { MIBUpdate 0 $udrPath }

#So my idea is to trigger MIBUpdate procedure with the value of udrPath
whenever I click the button

#MIB Update is defined as

proc MIBUpdate { type value } {

    global udp testStat udrPath


    if { $testStat == "Stop" } {

	puts $udp $type$value
    }

    if { $type == 0 } {

	set udrPath $value

    }

}

SO basically I enter a text in entry widget and it get set in the
udrPath variable
then when I click the button the MIBUpdate is called and the udrPath
value is sent to a udp socket inside the procedure.

This works fine in normal scenarios but there is a problem .as follows

if I enter the first time
/udr as the value inside entry it works well

but next time if i enter, say
/ab , then the value at remote udp socket is /abr instead of /ab , so
/ab overwrites /ud of /udr and becomes /abr

i.e the new value overwrites the previous value instead of scrapping it
totally.

I am sure there is a workaround but i am just not able to figure it
out.

Any help will be appreciated

thanks
in advance

8. Lists within Lists or Nested Linked Lists...