We have basic functionality but no axis arguments or broadcasting
???
| """ | |
| Estimate pi using a Monte Carlo method. | |
| If we imagine a unit circle inscribed within a unit square, the ratio of | |
| the area of the circle to the area of the square is pi/4. So if a point | |
| is chosen at random within the square, it has a pi/4 probability of | |
| being inside the circle too. | |
| So we choose one N points in the square, count how many are in the | |
| circle and divide by N to give an estimation of pi/4. We then multiply |
| """ | |
| Calculate the Julia set for a given z <- z**2 + c with | |
| IPython.parallel passed via command line args. Usage: | |
| $ python julia_ipython.py <c real component> <c imaginary component> | |
| """ | |
| from IPython.parallel import Client | |
| from matplotlib import pyplot | |
| from distarray.client import Context |
| #!/usr/bin/env bash | |
| # Return a list of files which need to have the pep0263 encoding | |
| # statement added. | |
| PATTERN='coding: utf-8' # The pattern for your encoding | |
| FILES=`find . -name "*.py"` # The files you want to check | |
| for i in $FILES; do | |
| # Get the line numbers matching the pattern | |
| LINE=`grep -nr "$PATTERN" "$i" | cut -d : -f 2` |
| # Configuration file for ipcluster. | |
| c = get_config() | |
| c.IPClusterEngines.engine_launcher_class = 'SSH' | |
| c.IPClusterEngines.controller_launcher_class = 'SSH' | |
| c.SSHClusterLauncher.username = 'blake' | |
| c.SSHClusterLauncher.hostname = '10.7.0.121' | |
| c.SSHControllerLauncher.controller_cmd = ['/home/blake/.virtualenvs/remote-ipython-worker/bin/python', '-m', 'IPython.parallel.controller'] | |
| c.SSHEngineLauncher.engine_cmd = ['/home/blake/.virtualenvs/remote-ipython-worker/bin/python', '-m', 'IPython.parallel.engine'] | |
| c.SSHEngineSetLauncher.engine_cmd = ['/home/blake/.virtualenvs/remote-ipython-worker/bin/python', '-m', 'IPython.parallel.engine'] |
| In [11]: def foo(): | |
| ....: return b | |
| ....: | |
| In [12]: eval('foo()', dict({'b':42}, **globals())) | |
| --------------------------------------------------------------------------- | |
| NameError Traceback (most recent call last) | |
| <ipython-input-12-a2089cf14959> in <module>() | |
| ----> 1 eval('foo()', dict({'b':42}, **globals())) |
Q: Where can I find jobs a research scientist? A: The army core of engineers is hiring. I write code there. A: I'm at UMich we have been discussing support for research. We they think we should help scientist write code. Historically research groups just had a random programmer that would do thing for them.
Q: Can you say more about how this works at UMich? A: Groups steal and borrow programmers from each other. But they have not
| from sys import stdin as r | |
| from sys import argv as a | |
| from pprint import pprint as p | |
| l=r.read() | |
| n=int(a[1]) | |
| g=[l[i:i+n] for i in range(len(l)-n)] | |
| p(sorted([(i,g.count(i))for i in set(g)],key=lambda x:x[1])[::-1]) |
| #!/usr/bin/env bash | |
| scp -r 10.7.0.121:~/.ipython/profile_default ~/profile_default | |
| sed -i 's/"ssh": "",/"ssh": "10.7.0.121",/g' ~/profile_default/security/ipcontroller-client.json | |
| rm -rf ~/.ipython/profile_default.bak | |
| mv ~/.ipython/profile_default ~/.ipython/profile_default.bak | |
| mv ~/profile_default ~/.ipython |