The Wiert Corner – irregular stream of stuff

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

  • My badges

  • Twitter Updates

    Error: Twitter did not respond. Please wait a few minutes and refresh this page.

  • My Flickr Stream

  • Pages

  • All categories

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

    Join 1,762 other followers

Archive for September 4th, 2019

Early version of Apple II Logo. · PDP-10/its-vault@4145dea · GitHub

Posted by jpluimers on 2019/09/04

[WayBack] Early version of Apple II Logo. · PDP-10/its-vault@4145dea · GitHub:

Early version of Apple II Logo.

Written by:
- Stephen L. Hain
- Patrick G. Sobalvarro
- Leigh L. Klotz

Brows the source files at [WayBack] its-vault/files/aplogo at master · PDP-10/its-vault · GitHub.

Via Lars Brinkhoff – Google+ commenting at [WayBack] This week, Logo on the 6502, in honour of Seymour Papert who died this week. He did a lot more, but Logo is a lasting and perhaps most visible contribut… – mos6502 – Google+.

Instructions at [WayBack] its-vault/usage.doc at master · PDP-10/its-vault · GitHub

–jeroen

Posted in //e, Apple, Apple ][, Development, Power User, Software Development | Leave a Comment »

python multithreading wait till all threads finished

Posted by jpluimers on 2019/09/04

A great tip from [WayBack] python multithreading wait till all threads finished:

ou need to use join method of Thread object in the end of the script.

t1 = Thread(target=call_script, args=(scriptA + argumentsA))
t2 = Thread(target=call_script, args=(scriptA + argumentsB))
t3 = Thread(target=call_script, args=(scriptA + argumentsC))

t1.start()
t2.start()
t3.start()

t1.join()
t2.join()
t3.join()

Thus the main thread will wait till t1t2 and t3 finish execution.

I’ve used a similar construct that’s used by the multi-threading code I posted a few ways ago (on Passing multiple parameters to a Python method: the * tag) in the ThreadManager class below.

But first some of the other links that helped me getting that code as it is now:

Example:

class ThreadManager:
    def __init__(self):
        self.threads = []

    def append(self, *threads):
        for thread in threads:
            self.threads.append(thread)

    def runAllToCompletion(self):
        ## The loops are the easiest way to run one methods on all entries in a list; see https://stackoverflow.com/questions/2682012/how-to-call-same-method-for-a-list-of-objects
        # First ensure everything runs in parallel:
        for thread in self.threads:
            thread.start()
        # Then wait until all monitoring work has finished:
        for thread in self.threads:
            thread.join()
        # here all threads have finished

def main():
    ## ...
    threadManager.append(
        UrlMonitorThread(monitor, "http://%s" % targetHost),
        SmtpMonitorThread(monitor, targetHost, 25),
        SmtpMonitorThread(monitor, targetHost, 587),
        SshMonitorThread(monitor, targetHost, 22),
        SshMonitorThread(monitor, targetHost, 10022),
        SshMonitorThread(monitor, targetHost, 20022))

    threadManager.runAllToCompletion()

–jeroen

Posted in Development, Python, Scripting, Software Development | Leave a Comment »

“Functional programmer: (noun) One who names variables ‘x’, names functions ‘f’, and names code patterns ‘zygohistomorphic prepromorphism.'” — James Iry on Twitter

Posted by jpluimers on 2019/09/04

“Functional programmer: (noun) One who names variables ‘x’, names functions ‘f’, and names code patterns ‘zygohistomorphic prepromorphism.'” — James Iry

–jeroen

Read the rest of this entry »

Posted in Development, Fun, Functional Programming, Quotes, Software Development, T-Shirt quotes | Leave a Comment »

 
%d bloggers like this: