HNHacker News
TopNewBestAskShowJobs

ekns

166 karma · joined March 11, 2013

submissionscomments
ekns··on Mathematica on Raspberry Pi for free
IPython has to my knowledge always used those kind of labels for inputs and outputs. It just follows from the CLI convention.

I looked up how it was in version 0.0.1 from 12 years ago and it turns out the original CLI format was made to look like Mathematica [1]: "Interactive execution with automatic history, tries to mimic Mathematica's prompt system".

[1] https://gist.github.com/fperez/1579699

ekns··on PyPi interactive dependency graph
I was curious about what the most common dependencies were so I hacked the IPython notebook a bit:

  import json, pip, re
  from base64 import b64decode
  from itertools import chain
  from collections import Counter

  def get_name(x):
      "This captures most of the base names for dependencies"
      if x.startswith('#'):
          return
      try:
          return pip.req.InstallRequirement.from_line(re.sub('["\']', '', x)).name.lower()
      except ValueError:
          return
  
  C = Counter()
  
  data = []
  with open('pypi-deps.csv', 'r') as file:
      for line in file:
          name, version, deps = line.split('\t')
          deps = filter(None, map(get_name, json.loads(b64decode(deps))))
          data+= [(name, version, deps)]
          for x in deps: C[x] += 1
  
  print '\n'.join('{0}\t{1}'.format(*x) for x in C.most_common(20))
The results:

  setuptools	1949
  django	546
  zope.interface	244
  requests	241
  lxml	204
  zope.component	203
  simplejson	202
  flask	158
  zc.buildout	127
  argparse	110
  zope.schema	109
  python-dateutil	108
  jinja2	105
  distribute	104
  pyyaml	103
  fanstatic	95
  beautifulsoup	93
  zope.publisher	91
  sqlalchemy	91
  numpy	89
ekns··on I know none of my passwords
I've been using PasswordMaker (http://www.passwordmaker.org/) for years to generate most of my site-specific passwords when needed. PasswordMaker uses a master password together with a site's domain name to hash a site-specific password. It has Chrome and Firefox extensions for filling in the password fields with one button.

Unfortunately, by default it uses MD5 and 8-character passwords. I always set this to SHA256 and at least 12 characters when first installing the extension on some device/browser.

Most sites play well with this, but there are exceptions: having to change a password is a bit ugly when the passwords are generated from a given master password and the site's domain name. A more common problem is when a site refuses to accept certain characters in the hashed password or when a site requires some number of digits and uppercase letters, for instance. I currently just store these exceptions with Keepass.

I see 1Password being mentioned a lot but I started using PasswordMaker and Keepass well before I'd first heard of 1Password so I don't know how it might compare.

ekns··on Keypress: A Javascript library for capturing input
I don't know the details, but it is possible for a USB keyboard to support N-key rollovers. As an example: http://www.corsair.com/en/support/faq/vengeance-gaming/
ekns··on Google Hangouts/GTalk glitch sends chats to wrong recipients
I've had this happen with facebook chat once maybe two years ago. I wonder if there have been other places where something like this has happened...
ekns··on Beyond grep: ack, a code search tool for programmers
You could do this with grep or ack or ag:

  grep bar -A 5 -B 5 files... | grep foo
-A n prints n lines following the match (bar) and -B n prints n lines before the match.
ekns··on Foundations of Computer Science
Here's a more portable version (works with bash, pdftk and wget):

wget http://i.stanford.edu/~ullman/focs/ch{01..14}.pdf && pdftk ch*.pdf cat output merged.pdf

← PreviousPage 3 of 3