Profile cover photo
Profile photo
William T
48 followers -
This is my CLI. There are many like it, but this one is mine...
This is my CLI. There are many like it, but this one is mine...

48 followers
About
William's posts

Post has attachment
Python Idiom: Collection Pipeline
A
common implementation involves calling a set of functions sequentially with the
results of the previous call be passed to the subsequent call. from math import sqrt, ceil
def transform(value):
x = float(value)
x = int(ceil(x))
x = pow(x, 2)
x ...

Post has attachment
Python Idiom: Collection Pipeline
A
common implementation involves calling a set of functions sequentially with the
results of the previous call be passed to the subsequent call. from math import sqrt, ceil
def transform(value):
x = float(value)
x = int(ceil(x))
x = pow(x, 2)
x ...

Post has attachment
How Companies Are Still Getting Integration and Automation Engineering Wrong
For awhile now, many companies have been investing more into having automation/integration engineering teams.  This is a result of being tired.  Tired of creating Statements of Work to generate solutions that aren't maintained.  Tired of finding these solut...

Post has attachment
Python: unittest setUp and tearDown with a ContextManager
Python unittest follows the jUnit structure, but is extremely awkward.  One of the more awkward portions are the use of setUp and tearDown methods.  Python has an elegant way of handling setup and teardown, it's called a ContextManager.  So let's add it. im...

Post has attachment
Python Idiom: First Occurence
Finding
the first occurrence in a collection of data is a common problem.     # Non Idiomatic
found_line = None
for line in logfile:
if regex.match(line):
found_line = line
break
return found_line Compared to # Idiomatic
return next((line for...

Post has attachment
SIngletons Reconsidered
TL;DR Don't make it a global, use it only for stateful resources, and don't use them if you can't implement them properly due to language or ability. Add management controls to the interface so that you can control the behavior of the Singleton in cases lik...

Post has attachment
SIngletons Reconsidered
TL;DR Don't make it a global, use it only for stateful resources, and don't use them if you can't implement them properly due to language or ability. Add management controls to the interface so that you can control the behavior of the Singleton in cases lik...

Post has attachment
EMail: offlineimap and procmail
I synchronize my imap folders to maildir on my local laptop often so I can both have access to my email without a network and utilize my preferred search and email clients.  In order to facilitate how I use email I keep a local archive which created and fil...

Post has attachment
REST: POST vs PUT for Resource Creation
Questions often come up about whether to use PUT or POST for creating resources in REST APIs. I've found both are appropriate in different situations. PUT PUT is best used when the client is providing the resource id.  PUT https://.../v1/resource/<id> Per s...

Post has attachment
Python: Aggregating Multiple Context Managers
If you make use of context managers you'll eventually run into a situation where your nesting a number of them in a single with statement.  It can be somewhat unwieldy from a readability point of view to put everything on one line: with contextmanager1, con...
Wait while more posts are being loaded