Configuration files in Python

Configuration files in Python Most interesting programs need some kind of configuration: Content Management Systems like WordPress blogs, WikiMedia and Joomla need to store the information where the database server is (the hostname) and how to login (username and password) Propritary software might need to store if the software was registered already (the serial key) Scientific software could store the path to BLAS libraries For very simple tasks you might choose to write these configuration variables directly into the...

Configuration Files In Python

<!DOCTYPE html>/* Fonts */ @font-face{ font-family: octicons-anchor; src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAYcAA0AAAAACjQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABwAAAAca8vGTk9TLzIAAAFMAAAARAAAAFZG1VHVY21hcAAAAZAAAAA+AAABQgAP9AdjdnQgAAAB0AAAAAQAAAAEACICiGdhc3AAAAHUAAAACAAAAAj//wADZ2x5ZgAAAdwAAADRAAABEKyikaNoZWFkAAACsAAAAC0AAAA2AtXoA2hoZWEAAALgAAAAHAAAACQHngNFaG10eAAAAvwAAAAQAAAAEAwAACJsb2NhAAADDAAAAAoAAAAKALIAVG1heHAAAAMYAAAAHwAAACABEAB2bmFtZQAAAzgAAALBAAAFu3I9x/Nwb3N0AAAF/AAAAB0AAAAvaoFvbwAAAAEAAAAAzBdyYwAAAADP2IQvAAAAAM/bz7t4nGNgZGFgnMDAysDB1Ml0hoGBoR9CM75mMGLkYGBgYmBlZsAKAtJcUxgcPsR8iGF2+O/AEMPsznAYKMwIkgMA5REMOXicY2BgYGaAYBkGRgYQsAHyGMF8FgYFIM0ChED+h5j//yEk/3KoSgZGNgYYk4GRCUgwMaACRoZhDwCs7QgGAAAAIgKIAAAAAf//AAJ4nHWMMQrCQBBF/0zWrCCIKUQsTDCL2EXMohYGSSmorScInsRGL2DOYJe0Ntp7BK+gJ1BxF1stZvjz/v8DRghQzEc4kIgKwiAppcA9LtzKLSkdNhKFY3HF4lK69ExKslx7Xa+vPRVS43G98vG1DnkDMIBUgFN0MDXflU8tbaZOUkXUH0+U27RoRpOIyCKjbMCVejwypzJJG4jIwb43rfl6wbwanocr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fA+0Hi908Kx4eNsMgudg5GLdRD7a84npi+YxNr5i5KIbW5izXas7cHXIMAau1OueZhfj+cOcP3P8MNIWLyYOBuxL6DRylJ4cAAAB4nGNgYoAALjDJyIAOWMCiTIxMLDmZedkABtIBygAAAA==) format('woff'); } /* Body */ html { font-size: 100; overflow-y: scroll; -webkit-text-size-adjust: 100; -ms-text-size-adjust: 100; } body{ color:#4d4d4c; font-family:Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', "Hiragino Sans GB", "STXihei", "微软雅黑", serif; font-size:12px; line-height:1.5em; background:#fefefe; width: 45em; margin: 10px auto; padding: 30px; border: 1px solid #ddd; outline: 1300px solid #f8f8f8; } /* Links */ a{ color: #06d; text-decoration:none; } a:hover{ color: #06e; text-decoration: underline; } a:active{...

Append Python PATH

Append Python PATH Python has a PATH in which it looks for modules. You can display the current module PATH with import sys print(sys.path) and apped something to it with import sys sys.path.append("/some/path/to/a/module") However, the clean way would be to write a module and install that module.

Introduction to Octave

Introduction to Octave GNU Octave is a really neat prototyping language for machine learning tasks. It is dynamically typed. Installation Octave is in the package repositories, so it can be installed by $ sudo apt-get install octave gnuplot-x11 octave-epstk and started with $ octave Configuration Create a file ~/.octaverc in your home folder. Write PS1('>>'); setenv("GNUTERM","x11"); in it to get a nicer prompt and make sure that plots will work. The Language Vectors and Matrices Octave has a...

Fix zypper readline error

Fix zypper readline error In case you work on a openSUSE system and you get the following error $ zypper zypper: symbol lookup error: /usr/lib/libreadline.so.6: undefined symbol: PC you can probably "fix" it by setting the 64 Bit LD_LIBRARY like this: $ export LD_LIBRARY_PATH=/lib64:$LD_LIBRARY_PATH It worked for me on openSUSE 12.1 "Asparagus". Credits Thanks to JRSETI's Blog

Change password in ATIS

Change password in ATIS Recently, the Heartbleed bug was discovered. It works like this: Heartbleed ExplanationFrom xkcd One effect of that bug is that you have to change your password. From xkcd You can do that from home via SSH. Just replace s_thoma by s_[your last name]: $ ssh s_thoma@i08fs1.ira.uka.de s_thoma@i08fs1.ira.uka.de's password: s_thoma@i08fs1(~)$ passwd Changing password for user s_thoma. Enter login(AD) password: Current Password: New password: Retype new password: AD password information changed for s_thoma passwd: all authentication tokens...

A.I. in Computer Games

A.I. in Computer Games Artificial Intelligences (A.I.s) are computer programs that are able to adjust their behaviour according to data they see. So A.I.s are able to adjust to the data a human player generates. Password Strength Solved games There is a number of games which are definitely solved. That means the A.I. plays perfectly: Tic-Tac-Toe Connect Four: A Knowledge-based Approach of Connect-Four. Amsterdam, 1988. Victor Allis. Checkers: See also: Solved Game Computers win always A second category are...