Dust

  • Post author:
  • Post category:Book

Hugh Howey is a master of suspense and as a result I found this book hard to read -- it's clear things are off the rails and characters I care about are going to get harmed (another Howey trademark it seems), but you just have to keep on marching through. As a result I found myself taking frequent breaks to think about what was happening, but finding myself having to pick the book up again. That is, this book is really really good, but Howey isn't afraid to have a character experience the consequences of their actions. That said, I don't really understand the purpose of the marriage sub-plot. I am sure its there for a reason, but it felt oddly out of place against the rest of the story arc.

Continue ReadingDust

Should SRE management hold blameless retrospectives for mistakes?

One of the core tenets of Site Reliability Engineering (SRE) is that blameless postmortems / retrospectives should be held for oncall incidents. Its part of the continuous improvement process where we learn from what went wrong and try and create processes to ensure it doesn't happen again. Very explicitly it is not about blaming anyone for an error -- the worst personal outcome for an engineer should be a decision that perhaps we failed to train them adequately. A simple example might be if a system broke because it ran out of disk, you might determine in the retrospective that it would be a super good idea to have some sort of alert for low disk space fire well before the system broke so you could intervene. It occurs to me that I've never seen the same process used for SRE management though, and that seems like an obvious gap to me now. Surely the same process of asking what went wrong and working out what mechanisms could be created to ensure that we're at least making new mistakes next time would be a good idea? Yet I've never seen a SRE management team willing to actually hold itself to…

Continue ReadingShould SRE management hold blameless retrospectives for mistakes?

Do you want the apocalypse, because this is how you get it

  • Post author:
  • Post category:Security

So I read this paper over the weekend. Naively, its a resonably interesting piece of research around using a generative AI to use descriptions of CVEs from their responsible disclosures to exploit unpatched systems autonomously. Now read that sentence again -- these people prompted Chat GPT4 with CVES which didn't have fixes yet, and had it hacking unpatched systems with an 85% success rate. We're doomed.

Continue ReadingDo you want the apocalypse, because this is how you get it

A gotcha with the Walrus operator

  • Post author:
  • Post category:Python

In New python syntax I was previously unaware of, I discussed some new operators I'd recently discovered. One of them is called the Walrus operator, which lets you write code like this: list = ['a', 'b', 'c'] def get_one(): if not list: return None return list.pop() while one := get_one(): print(one) See where we do the assignment inside the while? That code returns: c b a Which is as expected. However, the Walrus operator is strict about needing a None returned to end the iteration. I had code which was more like this: list = [('a', 1), ('b', 2), ('c', 3)] def get_one(): if not list: return None, None return list.pop() while one := get_one(): print(one) And the while loop never terminates. It just prints (None, None) over and over. So there you go.

Continue ReadingA gotcha with the Walrus operator

Debugging

  • Post author:
  • Post category:Book

One of the other architects at work was running a reading group for our North American comrades, and I felt left out so I figured I may as well just pick up the book to see what the deal was. This book is a bit old, and was written at the time to try and be funny, but to be honest I don't think the humour has aged well and it makes the book jarring to read. Overall I'd describe the book as having been written in the style of a long form chatty blog post, which is a bit unusual. 90% of the readers of this book will be looking for advice on how to debug software systems, but the book frequently uses hardwaare systems as examples. That speaks to the author's background, but its not super helpful for modern audiences living in a software defined world. The book is also a bit dated in terms of terminology and expectations of the work environment -- for example, the discussion of repeatable testing doesn't mention automated regression testing at all, and the only mention of automated tests is fleeting at best. Another example is that the author recommends that you…

Continue ReadingDebugging

New python syntax I was previously unaware of

  • Post author:
  • Post category:Python

This post documents the new syntax features I learned about while reading cpython internals. You can create more than one context manager on a single line. So for example Shaken Fist contains code like this: with open(path + '.new', 'w') as o: with open(path, 'r') as i: ... That can now be written like this: with open(path + '.new', 'w') as o, open(path, 'r') as i: ...   You can assign values in a while statement, but only one. Instead of this: d = f.read(8000) while f: ... d = f.read(8000) You can write this: while d := f.read(8000): ... But unfortunately this doesn't work: while a, b := thing(): ...   You can use underscores as commands in long numbers to make them easier to read. For example, you can write 1000000 or 1_000_000 and they both mean the same thing.   You can refer to positional arguments by name, but you can also disable that. I didn't realise that this was valid python: def foo(bar=None): print(bar) foo(bar='banana') You can turn it off with a forward slash in the argument list though, which should separate positional arguments from named arguments: def foo(bar, /, extra=None): print(bar) print(extra) foo('banana', extra='frog') The above example…

Continue ReadingNew python syntax I was previously unaware of

cpython internals

  • Post author:
  • Post category:BookPython

I have been paid money to write Python code since about 2006, so I figured it was probably time that I should understand some of the inner workings of Python. I therefore picked up two books on the topic, this one being the first of the two.

This book to be honest isn’t completely what I expected. Its very well written and quite interesting, but its more about the things you’d need to know to become a Python core developer, rather than the things you should know as a user of Python like how the Python dictionary implementation is built.

(If you want that specifically, this video is an excellent introduction).

(more…)

CPython Internals Book Cover CPython Internals
Anthony Shaw
May 5, 2021
396

Get your guided tour through the Python 3.9 interpreter: Unlock the inner workings of the Python language, compile the Python interpreter from source code, and participate in the development of CPython. Are there certain parts of Python that just seem like magic? This book explains the concepts, ideas, and technicalities of the Python interpreter in an approachable and hands-on fashion. Once you see how Python works at the interpreter level, you can optimize your applications and fully leverage the power of Python.

Continue Readingcpython internals

Shift

  • Post author:
  • Post category:Book

This is the second book in the Silo series, following on the Wool, which I recently read. I think to a certain extend this book is better than the first one -- I certainly found it compelling. An excellent read that explains how the universe described in Wool came to be, but yet also sets the scene for the third book in the trilogy.

Continue ReadingShift

Solve for Happy

  • Post author:
  • Post category:Book

Mo Gawdat was kind of a big deal, at IBM, Microsoft, and then Google. But he was unhappy, so he decided to take an engineering approach and try to systematically “solve for happy” and work out why adding more money, shiny objects, and adoration of others didn’t actually make him happy.

(more…)

Solve for Happy Book Cover Solve for Happy
Mo Gawdat
January 10, 2019
368

Solve for Happy is a startlingly original book about creating and maintaining happiness, written by a top Google executive with an engineer's training and fondness for thoroughly analyzing a problem.

Continue ReadingSolve for Happy

Starter Villain

  • Post author:
  • Post category:Book

Now, I might be biased because I like John Scalzi's stuff, but this book was really good. It starts slower than a normal Scalzi book, and takes a couple of chapters to really get going, but I am glad I was patient with it. Apart from that its a quick easy read. Its a typical Scalzi book, light hearted and fun. I think this one requires you suspend disbelief a little harder than others (except perhaps for Redshirts) but that doesn't make it less enjoyable.

Continue ReadingStarter Villain

End of content

No more pages to load