gavinj.net

Thoughts on technology, infrastructure, and AI

Viewing posts tagged code Clear filter

Python decorators

I came across an interesting recent addition to the Python language (as of Python 2.4). They are called decorators. Decorators are Python objects that can register, annotate, and/or wrap a Python fun...

Mysql local variables

Just learned how to use variables in mysql - the variables are bound to the specific client session - and are destroyed on disconnect. SET @varname = value SELECT max(value) from table into @varname S...

Python file magic

File magic is used on Linux and Unix systems as a binary "fingerprint" to tell what type a file actually is - this provides a much better result than MIME or filename extensions. The "magic" pattern i...