- Pressing Ctrl + Esc (or Ctrl + Caps Lock if you have Caps Lock mapped to Esc) will put a “window hint” at the center of every currently visible window.
- These will each have a unique letter in them.
- Pressing a letter will focus that window.
- Pressing Esc will cancel the window hints.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import os | |
| import pickle | |
| import random | |
| from time import time | |
| import numpy as np | |
| import pyphi | |
| from pyphi import Network, Subsystem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @author qiao / https://github.com/qiao | |
| * @author mrdoob / http://mrdoob.com | |
| * @author alteredq / http://alteredqualia.com/ | |
| * @author WestLangley / http://github.com/WestLangley | |
| * @author erich666 / http://erichaines.com | |
| */ | |
| /*global THREE, console */ | |
| // This set of controls performs orbiting, dollying (zooming), and panning. It maintains |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="http://d3js.org/d3.v3.min.js"></script> | |
| <style> | |
| body { margin:0; padding:0; } | |
| #map { width:960px; height:500px; background:cyan; } | |
| </style> | |
| </head> | |
| <body> |
- Rule of Modularity: Write simple parts connected by clean interfaces.
- Rule of Clarity: Clarity is better than cleverness.
- Rule of Composition: Design programs to be connected to other programs.
- Rule of Separation: Separate policy from mechanism; separate interfaces from engines.
- Rule of Simplicity: Design for simplicity; add complexity only where you must.
- Rule of Parsimony: Write a big program only when it is clear by demonstration that nothing else will do.
- Rule of Transparency: Design for visibility to make inspection and debugging easier.
Elaborating on the reasons given in Dijkstra's memo on the topic, we observe the following:
- Ranges are of the form 1 ≤ i < N + 1.
- The last element of a sequence has index N.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| import numpy as np | |
| from itertools import permutations | |
| def normalize_cm(connectivity_matrix): | |
| """Render a square connectivity matrix into a normal form. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Memory-aware LRU Cache function decorator | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| A modification of the builtin ``functools.lru_cache`` decorator that takes an | |
| additional keyword argument, ``use_memory_up_to``. The cache is considered full | |
| if there are fewer than ``use_memory_up_to`` bytes of memory available. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/env/sh | |
| # Test various ways of flipping '1's and '0's in a Python binary string. | |
| TEST="'111101111010001000100100001'" | |
| TESTINT="129831201" | |
| echo "Bit manipulation given decimal int:" | |
| PYSTRING="i = $TESTINT; bin((i ^ (2 ** (i.bit_length()+1) - 1)))[3:]" | |
| echo "$PYSTRING\n" |
Forked from @agnoster's zsh theme. Incorporates changes from @smileart's fork.
- The current path is right aligned, so it's out of the way when working in deeply nested directories. The main, left-aligned prompt only the current directory's name.