The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,276 other followers

Archive for the ‘Algorithms’ Category

I still print (relevant parts of) code. Have been for a long time. Will keep doing it.

Posted by jpluimers on 2021/02/24

In a response to [WayBack] Iris Classon on Twitter: “I’m curious, how many of you guys and gals have printed out code on paper to read later? Doing it during earlier years also counts 🤓”, I started the long read below starting with [WayBack] Jeroen Pluimers on Twitter: “Still do.… “.

Basically a more in depth coverage of my 2017 post Happy 60th birthday, Fortran.

[WayBack] Thread by @jpluimers: “@IrisClasson Still do. @IrisClasson There is a story behind these 1988 tractor feed print outs, which follows shortly. I should put dinosaur […]”

Still do.

There is a story behind these 1988 tractor feed print outs, which follows shortly.

I should put dinosaur or old-fart on my job description.

CC @isotopp

The story has to do with this.
A “translation” of [WayBack] Programming Fortran 77: A Structured Approach (ISBN-10: 0835956717) but I wish I had had the original back then, as in fact it was a knock off, mostly covering FORTRAN IV and 66.

Sidestory: these books were from the same era.

Machine learning and AI modern?

They are about as modern as AWK. Both still relevant though.

AWK is indispensable on many *n*x related systems, especially the low powered one. The book is still the ultimate source on it; see [WayBack] stackoverflow.com/a/703174/29290

text processing – Is there still any reason to learn AWK? – Stack Overflow

If you quickly learn the basics of awk, you can indeed do amazing things on the command line.

But the real reason to learn awk is to have an excuse to read the superb book The AWK Programming Language by its authors Aho, Kernighan, and Weinberger. You would think, from the name, that it simply teaches you awk. Actually, that is just the beginning. Launching into the vast array of problems that can be tackled once one is using a concise scripting language that makes string manipulation easy — and awk was one of the first — it proceeds to teach the reader how to implement a database, a parser, an interpreter, and (if memory serves me) a compiler for a small project-specific computer language! If only they had also programmed an example operating system using awk, the book would have been a fairly complete survey introduction to computer science!

Famously clear and concise, like the original C Language book, it also is a wonderful example of friendly technical writing done right. Even the index is a piece of craftsmanship.

Awk? If you know it, you’ll use it at the command-line occasionally, but for anything larger you’ll feel trapped, unable to access the wider features of your system and the Internet that something like Python provides access to. But the book? You’ll always be glad you read it!

Back to the story. With some side-steps to (:

Here we go…

This is end 1980s. I was a student. A year later I started my own consultancy as a side-thing.

The reason is that I had a client prospect for some PC Turbo Pascal programming. So I needed to buy some hardware. Only companies could buy hardware. So I started one.

en.wikipedia.org/wiki/Turbo_Pascal

2 years later, I was selling PC network hardware to a university research group, so they could connect to the internet. At 75% of what they would pay via their regular channels. My profit was large enough to cover for that year of studying.

Back to the print-outs.

They were on tractor-feed paper en.wikipedia.org/wiki/Continuous_stationery
We had a class: computer usage for chemistry students. It was mandatory. They were teaching from a FORTRAN 77 book that was in fact more FORTRAN IV and FORTRAN 66. Found a link to it too: [WayBack] Cursus Fortran 77, R.C. Holt, J.N.P. Hume

The way you would program in that class was via PC terminals with serial terminal emulation, connected to a VAX 11/780 machine running VAX/VMS 4.7.

The connection was through a multiplexed serial over an unshielded ribbon cable some 300 yards long.
The connection was very reliable: about 90% of the characters would transmit correctly.

So I had to reset the VT52 terminal emulation over the Kermit protocol every minute or so, then wait a dozen seconds for the screen to re-draw.

At the chemistry department it was still a VAX 11/780 machine called HLERUL5, but at the computing department they had an 11/750 called RULCRI which was faster.

They also had a bunch of VT100 terminals that could do 132-columns instead of 80, with a far more reliable connection.

en.wikipedia.org/wiki/VT100

Later the chemistry department also got their own VAX 11/750, renamed the old one to HLERUL52 for the 2nd years studens to to work on, and kept the old HLERUL5 name.

The machines were networked too, so you could connect to one, then daisy-chain your logon to the others.

Long story short: later I managed to get official accounts on both chemistry department machines, and borrow an account on the computing department one. So I had accounts on HLERUL5, HLERUL52 and access to RULCRI when needed.
Later too, I found out that the room above the VAX 11/780 also had VT100 terminals (later even two VT240 terminals!). It wasn’t meant for student use though. But with some social engineering…

In the mean time, I wanted to make better use of the VAX/VMS FORTRAN compiler.

Apart from that it fully supported FORTRAN 77, it also had many more language features and had support for 132 columns instead of just 80.

Given FORTRAN had limited use of the leftmost 8 columns, having 124 usable columns instead of just 72 made a huge difference in readability.
There was no book in the library on VAX/VMS FORTRAN, but the on-line help was great: both vast and in-depth. With the bad serial documentation though, it was very hard to read on-line.

The easiest way to read things was on paper. I think the printer back then was a LA36 DecWriter II or LA120 DecWriter III

www.youtube.com/embed/T3TifjAX51I
www.youtube.com/embed/tJ1jkINFVho

www.youtube.com/embed/T3TifjAX51I

Printing one topic at a time however was cumbersome. Print jobs were not always printed in the right order, and sending like a 100 print commands that all were slightly different was hard too.
Luckily I found out two things:
  1. you could dump the output of a FORTRAN HELP page to a file
  2. you could recursively generate all FORTRAN HELP, then redirect that to a file
The recursion was great, as it would output everything in an orderly fashion. What was lacking though is a good table of contents. More on that in a bit.
So I decided to send that file to the printer. Of course I knew that would take something like an hour, so I printed it during lunch time.
I was back from lunch early to monitor the printing progress (VAX/VMS had queues for everything, and you could monitor the ones or the parts of ones you had access to!).

The printer was right next to the VAX 11/780 and both of them were very noisy. The climate control was even noisier, which meant you wanted to avoid that room whenever possible.

So shortly after my job was ready, I wanted to pick it up and make the 300 meter walk twice.

Right at that moment, the student assistent walked in with a red face, madly screaming “who the hell printed this one inch stack of FORTRAN help”.
I responded that I did. At first she (this was a time when we had a way better balanced female/male ratio in STEM) would not even want to give my output, refusing to believe I would read it.
She also would not believe that you cour recursively send the help to a file, then print it. But the stack of paper demonstrated otherwise.
I explained that I was going to read the whole stack. It took a long weekend, as after reading, I manually made the hand written table of contents on the front.
In addition, I colour marked the sides of the paper matching the entries in the table of contents.

Now I could index into the right topics very quickly.

She was amazed I did all that in just a weekend. Apparently, that’s how my brain copes with information: need something, read something, read something, use something.

Later she actually made use of that stack of paper, as it was a great way for other people too to figure out some things faster than doing it on-line.
Back to my side-business: that’s the reason for the PASCAL stack of paper. It’s the output of the VAX/VMS help for the PASCAL compiler. It was great and helped me learn a lot on the language.

That print job took far less time: it was printed from RULCRI to the printer at the computing department. Their printer was not a dot-matrix one, line printer. It was orders of magnitude faster.

3 years later, I started doing more and more work with Turbo Pacscal and made the business my full time work.

Only a decade later, I found out why I had deverted less and less energy into my studies and more into work.

Two reasons: computers are way easier to cope with than people, and a theoretical university was totally the wrong kind of environment for my learning mode: I am an auto-didactic person. I need to do things in order to learn.
By now I have slowly learned way and way more about people. Coping with them is still tough, taking a lot of energy. But by now it is also a lot of fun. Though doing both at the same time is still very very hard for me.

Finally back to the STRUCT print job:

That was actually the FORTRAN program I developed for the assignment.

You could choose from multiple problems to solve during the assignment.

As one of the few students, I managed to finish it in-time.

I was the only one that took this particular problem.

The essence is that you got a few tables with data:

  • atom numbers, atom abbreviation and atom covalence (the number of other atoms they can bond with)
  • bond pairs with abbreviations and minimum/maximum distance
  • atom locations (abbreviation plus X/Y/Z coordinate)
The goal was to find which atoms were connected, and describe any cycles.

Only after reading the tables, then trying to solve the problem, I found out a recursive solution was needed to solve it.

Boy was I surprised that FORTRAN did not support recursion.

In the end, I implemented my own recursion with stacks citing a Dire Straits song with “and when you finally reappear, at the place where you came in…”.

A long story to explain I started printing on things to read very early on (:

/end

–jeroen

Read the rest of this entry »

Posted in Algorithms, Development, Fortran, Power User, Printers, Software Development | Leave a Comment »

On my research list: Unum – The End of (Numeric) Error

Posted by jpluimers on 2020/06/24

From about 4 years ago, so time to see how many development stacks support Unum by now: [WayBackThe End of (Numeric) Error

Crunching numbers was the prime task of early computers. The common element of these early computers is they all used integer arithmetic. John Gustafson, one of the foremost experts in scientific computing, has proposed a new number format that provides more accurate answers than standard floats, yet saves space and energy. The new format might well revolutionize the way we do numerical calculations.

Back then, I found these links through my G+ circles:

Read the rest of this entry »

Posted in Algorithms, Development, Floating point handling, Software Development, Unum | Leave a Comment »

Naming is hard so look at this list when you will name things: Approved Verbs for Windows PowerShell Commands

Posted by jpluimers on 2020/04/29

Naming is number # in the Programmers’ hardest tasks so when you have to name things, read [WayBack] Approved Verbs for Windows PowerShell Commands.

It is guidance on naming schemes and lists of appropriate nouns and verbs to use in names.

–jeroen

From twitter:

$PARAMETERS = get-command | where-object {$_.CommandType -eq "Cmdlet" } | select Parameters
$PARAMETER_KEYS = foreach ($P in $PARAMETERS)
{
  foreach ($K in $($P.Parameters | select keys))
  {
    $K.Keys
  }
}
$PARAMETER_KEYS | sort-object -unique

Resulting in this list with PowerShell 5.1.18362.752 on Windows 10.0.18363.815:

AccessMode
Action
Activity
Add
AddToHistoryHandler
Adjust
After
Alias
AliasDefinitions
AliasesToExport
All
AllMatches
AllowClobber
AllowRedirection
Amended
AnsiEscapeTimeout
Any
AppDomainName
Append
AppendPath
ApplicationArguments
ApplicationBase
ApplicationName
ArgumentList
Arguments
As
AsBaseObject
AsCustomObject
AsHashTable
AsHtml
AsJob
AsSecureString
AssembliesToLoad
Assembly
AssemblyName
AsString
Attachments
Attributes
Authentication
Author
Authority
AutoRemoveJob
AutoSize
Average
BackgroundColor
BaseDirectory
Bcc
Before
Begin
BellStyle
BinaryPathName
BindingVariable
Body
BodyAsHtml
Bound
BreakAll
Breakpoint
BriefDescription
BufferSize
CancelTimeout
CanonicalName
CaseSensitive
Category
CategoryActivity
CategoryReason
CategoryResourceFile
CategoryTargetName
CategoryTargetType
Cc
CContains
CEQ
Certificate
CertificateThumbprint
CGE
CGT
Character
ChildJobState
ChildPath
Chord
CimNamespace
CimResourceUri
CimSession
CIn
Class
CLE
CLike
ClrVersion
CLT
CMatch
Cmdlet
CmdletsToExport
CNE
CNotContains
CNotIn
CNotLike
CNotMatch
CodeDomProvider
Colors
Column
Command
CommandLine
CommandName
CommandType
CommandValidationHandler
ComObject
CompanyName
CompatiblePSEditions
CompilerParameters
Completed
CompletionQueryItems
Component
Compress
ComputerName
ConfigurationName
ConfigurationTypeName
Confirm
ConnectionUri
Container
ContainerId
Contains
Content
ContentType
Context
ContinuationPrompt
Copyright
Count
Credential
CssUri
Culture
CurrentOperation
Date
Day
Days
DcomAuthentication
Debug
Debugger
DefaultCommandPrefix
DefaultDisplayProperty
DefaultDisplayPropertySet
DefaultKeyPropertySet
Definition
DefinitionName
DefinitionPath
Delay
Delimiter
DeliveryNotificationOption
DependentServices
DependsOn
Depth
Descending
Description
Destination
DestinationPath
Detailed
DifferenceObject
DingDuration
DingTone
Directory
DirectRead
DisableKeepAlive
DisableNameChecking
DisplayError
DisplayHint
DisplayName
DomainCredential
DomainName
DotNetFrameworkVersion
Drive
DriveLetter
DscResourcesToExport
EditMode
EnableAllPrivileges
EnableNetworkAccess
Encoding
End
EntryType
EnvironmentVariables
EQ
ErrorAction
ErrorId
ErrorPopup
ErrorRecord
ErrorVariable
EventArguments
EventId
EventIdentifier
EventName
Example
Examples
Exception
Exclude
ExcludeDifferent
ExcludeProperty
ExecutionPolicy
Expand
ExpandProperty
Expression
ExtraPromptLineCount
File
FileList
FileName
FilePath
FileVersionInfo
Filter
FilterScript
First
For
Force
ForegroundColor
Format
FormatsToProcess
FormatTypeName
Forward
Fragment
From
FromSession
Full
FullyQualifiedModule
FullyQualifiedName
Function
Functionality
FunctionDefinitions
FunctionsToExport
GE
Global
GroupBy
GroupManagedServiceAccount
GT
Guid
HasMoreData
Head
Header
Headers
Height
HelpInfoUri
Hidden
HideComputerName
HideTableHeaders
HistoryNoDuplicates
HistorySavePath
HistorySaveStyle
HistorySearchCaseSensitive
HistorySearchCursorMovesToEnd
HostProcessInfo
Hour
Hours
IconUri
Id
IdleTimeout
IdleTimeoutSec
IgnoreWarnings
IgnoreWhiteSpace
Impersonation
In
Include
IncludeChildJob
IncludeEqual
IncludeExtent
IncludePortInSPN
IncludeScriptBlock
IncludeTotalCount
IncludeUserName
Independent
Index
InDisconnectedSession
InFile
InformationAction
InformationVariable
InheritPropertySerializationSet
InitializationScript
InputObject
InstanceId
Is
IsAbsolute
IsNot
IsValid
ItemType
Job
JobName
Keep
Language
LanguageMode
Last
LastStatus
LE
Leaf
LicenseUri
Like
Line
List
ListAvailable
ListenerOption
ListImported
LiteralName
LiteralPath
LoadUserProfile
LocalCredential
Locale
Location
LogName
LT
Match
MaxConcurrentCommandsPerSession
MaxConcurrentUsers
MaxConnectionRetryCount
MaxIdleTimeoutSec
Maximum
MaximumHistoryCount
MaximumKillRingCount
MaximumReceivedDataSizePerCommand
MaximumReceivedDataSizePerCommandMB
MaximumReceivedObjectSize
MaximumReceivedObjectSizeMB
MaximumRedirection
MaximumSize
MaximumVersion
MaxMemoryPerSessionMB
MaxProcessesPerSession
MaxSessions
MaxSessionsPerUser
MaxTriggerCount
MemberDefinition
MemberName
MemberType
Message
MessageData
MessageResourceFile
Method
Millisecond
Milliseconds
Minimum
MinimumVersion
Minute
Minutes
Mode
Module
ModuleInfo
ModuleList
ModulesToImport
ModuleVersion
Month
MountUserDrive
Name
Namespace
Native
NE
NestedModules
NewerThan
Newest
NewName
NoClobber
NoCommonParameter
NoCompression
NoElement
NoEncryption
NoEnumerate
NoMachineProfile
NoNewline
NoNewScope
NoNewWindow
NoQualifier
NoRecurse
NoServiceRestart
NotContains
NotePropertyMembers
NotePropertyName
NotePropertyValue
NotIn
NotLike
NotMatch
NoTypeInformation
Noun
NoWait
Object
Off
OlderThan
Online
OnType
OpenTimeout
OperationTimeout
Option
Options
OUPath
OutBuffer
OutFile
OutputAssembly
OutputBufferingMode
OutputMode
OutputModule
OutputType
OutTarget
OutVariable
OverflowAction
Paging
Parameter
ParameterName
ParameterResourceFile
ParameterType
Parent
ParentId
PassThru
Path
PathType
Pattern
PercentComplete
Persist
PipelineVariable
Port
PostContent
PowerShellHostName
PowerShellHostVersion
PowerShellVersion
PreContent
Prefix
PrependPath
Priority
PrivateData
Process
ProcessIdleTimeoutSec
ProcessName
ProcessorArchitecture
ProjectUri
Prompt
PromptText
Property
PropertyNames
PropertySerializationSet
PropertyType
Protocol
Proxy
ProxyAccessType
ProxyAuthentication
ProxyCredential
ProxyUseDefaultCredentials
PSDrive
PSEdition
PSHost
PSProvider
PSSession
PSVersion
PutType
Qualifier
Query
Quiet
Raw
RawData
ReadCount
ReadOnly
RecommendedAction
Recurse
RedirectStandardError
RedirectStandardInput
RedirectStandardOutput
ReferencedAssemblies
ReferenceObject
Refresh
Registered
Relative
ReleaseNotes
RemainingScripts
Remove
RemoveFileListener
RemoveListener
Repair
RepeatHeader
Replace
RequiredAssemblies
RequiredGroups
RequiredModules
RequiredServices
RequiredVersion
Resolve
Restart
RestorePoint
RestorePointType
RetentionDays
ReturnResult
Role
RoleDefinitions
RollbackPreference
Root
RootModule
RunAs32
RunAsAdministrator
RunAsCredential
RunAsVirtualAccount
RunAsVirtualAccountGroups
Runspace
RunspaceId
RunspaceInstanceId
RunspaceName
SchemaVersion
Scope
Script
ScriptBlock
ScriptsToProcess
Second
Seconds
SecondsRemaining
SecondValue
SecurityDescriptorSddl
Sender
Separator
SerializationDepth
SerializationMethod
Server
Session
SessionName
SessionOption
SessionType
SessionTypeOption
SessionVariable
SetSeed
ShowCommandInfo
ShowError
ShowSecurityDescriptorUI
ShowToolTips
ShowWindow
SimpleMatch
Skip
SkipCACheck
SkipCNCheck
SkipLast
SkipNetworkProfileCheck
SkipRevocationCheck
SmtpServer
Source
SourceId
SourceIdentifier
SourcePath
Stack
StackName
Start
StartupScript
StartupType
State
Static
Status
Step
Stream
Strict
StringData
StringSerializationSource
Subject
SubscriptionId
Sum
SupportedCommand
SupportEvent
SyncWindow
Syntax
System
Tags
Tail
TargetObject
TargetTypeForDeserialization
TemplateContent
TemplateFile
TextFormatType
ThreadApartmentState
ThreadOptions
ThrottleLimit
Timeout
TimeoutSec
TimeToLive
Title
To
ToSession
TotalCount
Trace
TransactedScript
Transcript
TranscriptDirectory
TransferEncoding
TransportOption
Type
TypeAdapter
TypeConverter
TypeData
TypeDefinition
TypeName
TypesToProcess
UFormat
UICulture
Unbound
Unique
UnjoinDomainCredential
Unsecure
UpdateTemplate
Uri
UseBasicParsing
UseCulture
UseDefaultCredential
UseDefaultCredentials
UseNewEnvironment
UserAgent
UserDriveMaximumSize
UserName
UseSharedProcess
UseSSL
UseTransaction
UseUTF16
UsingNamespace
Value
ValueOnly
Variable
VariableDefinitions
VariablesToExport
Verb
Verbose
Version
View
ViMode
ViModeIndicator
Visibility
VisibleAliases
VisibleCmdlets
VisibleExternalCommands
VisibleFunctions
VisibleProviders
VMId
VMName
Wait
WarningAction
WarningVariable
WebSession
WhatIf
Width
WindowStyle
Word
WordDelimiters
WorkgroupName
WorkingDirectory
Wrap
WriteEvents
WriteJobInResults
WsmanAuthentication
Xml
XPath
Year

Posted in Agile, Algorithms, Code Quality, Development, Software Development | Leave a Comment »

Bipartite matching algorithm in Delphi… John Kouraklis – Google+

Posted by jpluimers on 2020/04/23

In the thread is an actual implementation: [WayBack] I am looking for an implementation of Bipartite matching algorithm in Delphi or Pascal. Does anyone have a suggestion? Thanks – John Kouraklis – Google+

As I probably need it one day (:

–jeroen

Posted in Algorithms, Delphi, Development, Software Development | Leave a Comment »

Hashes and their uses – The Isoblog.

Posted by jpluimers on 2020/04/09

A nice introduction to [WayBackHashes and their uses – The Isoblog covering:

  • Checksums
    • Digit sums as simple, weak checmsums
    • Better checksums: ISBN-10 as an example
    • Proper CRC checksums
  • Hashes for storage
    • Building dictionaries
    • Breaking dictionaries
    • Handling collisions
  • Cryptographic hashes

Via [WayBack] I needed to explain Bitcoin. In order to explain Bitcoin, I needed to explain Proof-of-Work and Hash structures. In order to explain Proof-of-Work and H… – Kristian Köhntopp – Google+

–jeroen

 

Posted in Algorithms, Development, Software Development | Leave a Comment »

 
%d bloggers like this: