2017-Apr-11, Tuesday

So yeah job

2017-Apr-11, Tuesday 21:16
mindstalk: (Nanoha)
I haven't been practicing tight infosec and have leaked a lot, but here's Ye Officiale Announcemente: I have a job. Started a bit over four weeks ago. I wasn't shouting about it because I felt traumatized after over a year of searching, and takebacks-shy after December's "we'll tell you we'll make an offer, then disappear" firm. Plus a bit of paranoia about whether I'd be out of work-shape and get into trouble. But I've gotten my second paycheck, so this seems real and ongoing. They can pay me! I can keep earning getting paid!

It's a tiny startup, I'm literally the first person to get paid in money and not just equity. Back-end work on a web services (more or less) company, with C++ in my distant future, but right now lots of Python. After lots of virtual machine wrangling (see previous posts.)

I've been learning a lot, it's been fun[1], I like my boss and co-worker, and the hours are agreeably flexible for someone with sleep disruption and a nomadic existence.

[1] For somewhat aggravating values of fun.
mindstalk: (Default)
Speaking of aggravating values of fun... I foresaw a day of boring editing in my future? Well, I managed to make that half a day. I'd looked for programmatic solutions but they all seemed half-assed in bad ways, especially in breaking the logging information (filename, function name) we want. So I went through by hand... and a good mastery of vim commands and maps. It's funny, I haven't had to make a new vim map in forever, but the skills are there.

Samples: (Edit: all the [] should be angle brackets; I forgot how Dreamwidth swallows them.)

map CP :s/,/+/g #turns commma to plus, down a line
map KE cwkinnlog.error([Esc]A)[ESC]CP
#changes word under cursor to 'kinnlog.error(', appends ')' to line, invokes CP
map KX cwkinnlog.exception([Esc]A)[ESC]CP
map fp /print^M # fast search for 'print', since CP changes the current search to ','
map St istr(^[ #inserts 'str(' and goes back to command more.
map stt a)^[ #inserts ')' and goes back to command more
map kld cf(kinnlog.debug(^[ #changes everything from cursor to a '('

I got to show off more simply last week, too; I was setting up the product for Co-worker, and had to edit the IP address in a bunch of files.
$ vi *.json
/[IP 1]
n #search next
. #ditto
:wn #write, move to next file -- which preserves all the state, so I can keep going 'n' and '.'

She was impressed by my speed. (If you're wondering why not regexes, there were only 1 or 2 addresses per file, this seemed as fast or faster as recalling a ':%s/...')


All that said and done... Python makes it easy to write code. Python has an awesomely nice standard library, including a logger module with many handlers like RotatingFileHandler. Python makes it easy to rip out the guts of a stub logging module and replace it with something sophisticated.

Python 2 has a print statement which can take an indefinite list of things, and print them all, without any type information.

Python 2 does not provide any function that does something similar, so converting from those print statements to calls to actual logging functions was terribly painful and/or un-typesafe. I mean, a lot of the time I can't tell easily what the type of the value of a variable is where it's being used. Granted you can wrap almost anything in 'str()', and maybe I should have been more thorough about doing just that. Python doesn't have a compiler, and as long as it's basically syntactically correct, will be happy until it tries to actually execute the code. I really hate this.

April 2017

2 345678
9 10 11 1213 1415
161718192021 22
232425262728 29

Expand Cut Tags

No cut tags

Style Credit

Most Popular Tags