Sep. 29th, 2018

mtbc: maze I (white-red)
For our software at work we use Python in some components. I am not much of a fan of Python — for me it brings the worst of Perl while omitting the best — but I have been trying to become more comfortable with it. I have found it easy to write buggy code: for instance, flake8 is quite happy with,
x = 'foo'
for x in range(5):
    pass
print(x)
That prints 4 which means that I must be very careful about tracking variable names: scoping may not be as I expect.

I have also found myself having to be wary in other ways. For example, recently I tried experimenting with the multiprocessing module and if too careless then I am easily surprised. If I fire off a process to print something to standard output then return a result, then having gotten that result and written something else to standard output, those output lines may appear out of order if I do not first join() from that other process, at least unless I manually flush or adjust buffering. Or, if I pass an object as an argument to apply_async or somesuch, it may effectively get passed by value instead of by reference so its state changes are lost as side-effects: I must remember that data may be pickled on its way about. In some situations it thus turns out that I must be doubly wary.

I have a large multidimensional numpy array that I was hoping to have multiple processes read from without copying it around. On trying to work out correspondences between ctypes and dtypes and whatnot I kind of gave up there and figured that I would prefer a night's sleep.
mtbc: maze E (black-cyan)
Recently we have been taking children around various universities. It has been interesting to compare them. For example, among some local ones, Dundee has a large student union building with many pool tables and affordable beer: I suspect that as staff I too could benefit. It is also nestled next to the city center, whereas Heriot-Watt and Stirling have fairly separate campuses with bus service. Heriot-Watt was easier to get to than I expected from north of Edinburgh. Among those three, Stirling's accommodation appears to be the worst value for money.

My children's college fees are a principal reason why I find myself outside the US, living in Scotland for this period of my life. The Scottish government fully funds residents' undergraduate tuition and subsidizes student loans such that the interest rate is effectively zero in real terms.

Profile

mtbc: photograph of me (Default)
Mark T. B. Carroll

December 2025

S M T W T F S
 12 3456
78910111213
14 15161718 19 20
21222324252627
2829 3031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Dec. 30th, 2025 11:08 pm
Powered by Dreamwidth Studios