Software

Programming Language Installation

  • Python
    • Python 2.7.7
      • Windows
        • use the installer above
      • Mac OS X
        • should be pre-installed
        • it is recommended to freshly install python before installing Pygame
      • Linux
        • should be pre-installed
        • advanced package tool: sudo apt-get install python
        • If you want a bash script (here called bs) that executes your python file (here called ~/pf), create the bash script in the directory /usr/bin/bs, then give it execution permission with chmod: sudo chmod +x bs. The bash script should contain bash code to execute your python file:
          #!/bin/bash
          python ~/pf "$@"

          Now you should be able to execute your python file by typing bs from anywhere. Command line arguments should be gotten by the python file.
    • Pygame (a Python module)
      • Pygame 1.9.1 (for Python 2.7.7)
        • Windows: use the installer above
        • Mac OS X
          • Snow Leopard (10.6.8) or older: use the installer above
          • unfortunately pygame does not work on newer versions of macOS
        • Linux
          • use the installer above
          • advanced packaging tool: sudo apt-get install python-pygame
  • Java
    • Create a .jar from a single .java file
      • Method I: without a manifest
        • javac source.java
        • jar cvfe out.jar source *.class
      • Method II: with a manifest
        • javac source.java
        • echo “Main-Class: source” > manifest.txt
        • jar cvfm out.jar manifest.txt *.class
      • A resource worth looking at: Skylit Publishing
      • Documentation: Oracle

Editors

  • TextWrangler version 4.5.3 / 4.5.12
  • Sublime Text 3
    • To make Sublime Text execute your Python scripts when pressing Ctrl+B on Windows, you need to go to Preferences>Browse Packages. In this directory create a directory called Python. In there create a file called Python.sublime-build. That file should contain the following lines:
      {
      "cmd": ["C:\\python27\\python.exe", "-u", "$file"],
      "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
      "selector": "source.python"
      }

      You may need to change C:\\python27 to another path if you are not using Python 2.7.
  • Notepad++ 6.8.6
  • nano
  • Atom
    • To properly use Python in Atom, you need — in my opinion — the feature to run a Python script inside the editor. To do that install the package script. If you get an error, it is likely that you have not installed GIT (needed for this package). After installing GIT, restart Atom and try again.
    • However this package uses the simple command python to execute a script, which works on Linux and Mac OS but does not on Windows. Thus you need to change the execution command. Navigate in Atom’s gui to Installed Packages>script>Settings>View Code>script>lib>grammars.coffee or edit ~/.atom/packages/script/lib/grammars.coffee. Change the 597th and 600th line ‘command: “python”‘ to ‘command: “C:\\Python27\\python.exe”‘ (the path may vary if you are not using Python 2.7). Restart Atom and the script package should allow you to execute your python scripts.
    • The default keyboard shortcut to execute a script under Windows is Shift+Ctrl+B. The keybindings can be changed under ~/.atom/packages/script/keymaps/script.cson.
      To avoid conflicting keybindings between the script package and Atom, disable the desired keybinding in ~/.atom/keymap.cson. The code lines to put there can be gotten by going the Settings>Keybindings.
    • If you are not using an American keyboard, it can also be useful to install the package keyboard-localization. That way you can type characters like @ (at) or \ (backslash).
    • If you are working with coordinates, you may want to disable the package autocomplete-snippets, which automatically turns the string ‘x’ into ‘# XXX: ‘ when you press enter.
    • Lastly, the very convenient feature to edit your files in Atom through the Windows file context menu (the menu that pops up if you right-click a file) can be enabled by going to Settings>System>Show in file context menus.
  • intelliJ
  • vi
    • Printing source code using vi by generating a PDF
      • vi -c "syntax on|set printoptions=paper:A4,wrap:y,header:0,number:y,syntax:y,portrait:y,left:5pc,right:5pc,top:5pc,bottom:5pc|set printfont=courier:h10|hardcopy>out.ps|q" file.py;ps2pdf out.ps
      • Additional information can be found in the documentation.

Other

  • Mathematica / Wolfram|Alpha
  • TI Connect™ CE
    • TI Basic reference: tibasicdev
    • The TI-84 Plus screen is 63×95 pixels big (it really is one pixel bigger in both dimensions, those just cannot be accessed).
    • The ‘sto’ character is ‘→’.
  • AutoHotkey (Windows only)
  • py2exe (Windows only)
  • py2app (Mac OS X only)
  • Pygments
    • Pygmentize a file to html
      pygmentize -O full,style=friendly -o out.html in.py
    • List of default Pygment styles
      {manni, igor, lovelace, xcode, vim, autumn, abap, vs, rrt, native, perldoc, borland, arduino, tango, emacs, friendly, monokai, paraiso-dark, colorful, murphy, bw, pastie, rainbow_dash, algol_nu, paraiso-light, trac, default, algol, fruity}
    • Pygment’s on-line code highlighter

macOS

  • Show or hide hidden files (because Apple hides it by default)
    defaults write com.apple.finder AppleShowAllFiles <true|false>;killall Finder
  • Disable or enable icons on desktop
    defaults write com.apple.finder CreateDesktop <true|false>;killall Finder
  • Download the now deprecated OS X El Capitan installer from the App Store. (No longer visible in the App Store, obviously requires a Mac to use.)

Command line (bash)

  • ImageMagick
    • Create a gif using individual images (ms: miliseconds between frames, n: number of loops, 0 means loop indefinetely)
      convert -delay -loop img*.png out.gif
    • Resize an image using nearest neighbour
      convert small.png -filter point -resize <resize_factor>% big.png

Windows 10

  • Install Windows 10 Bash Shell: Installation Guide
  • Reset Windows 10 Bash Shell (Because the bash shell is a beta feature, it has some bugs. Sometimes you can crash it, which you can — to my knowledge — only resolve by re-installing it. Be sure to backup your important files before doing so. The following two commands are executed on the Command Prompt.)
    lxrun /uninstall /full
    lxrun /install
  • Change Windows 10 Bash Shell language
    sudo update-locale LANG=en_US.UTF8#
  • Windows 10 Bash shell home directory from Window’s perspective
    C:\Users\<windows username>\AppData\Local\Lxss\home\<bash username>
  • Skype sound fix (At your own risk!)
    Try delting RtmPltfm.dll in C:\Program Files (x86)\Skype\Phone

Raspberry Pi

  • Autostart file
    • Under /home/pi/.config/autostart/.desktop write the following.
      [Desktop Entry]
      Exec=<the command that should be executed>
  • Disable screen sleep
    • Edit the /etc/lightdm/lightdm.conf file with super user rights, and add under [SeatDefaults] the following line.
      xserver-command=X -s 0 dpms
      You may need to restart your Pi for this change to take effect.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s