HNHacker News
TopNewBestAskShowJobs

jimmahoney

82 karma · joined December 29, 2011

Computer Science Faculty at Bennington College
submissionscomments
jimmahoney··on Janet for Mortals
I used janet for Advent of Code 2021 too. My first exploration of the language. Small world. I found janet fun but quirky. My work is at https://github.com/jimmahoney/advent-of-code/tree/master/202... .
jimmahoney··on CMSC 430: Design and Implementation of Programming Languages
FWIW here are my CS courses including notes, assignments, and resources: https://cs.bennington.college/ (2020 - 2022) & https://cs.marlboro.college/ (2010 - 2020)
jimmahoney··on Ask HN: What's the best book you read in 2021?
The Murderbot Diaries by Martha Wells. Best scifi I've read in awhile; a really nice one in the first-person-nonhuman genre.
jimmahoney··on Ask HN: Who is hiring? (February 2021)
Faculty Position in Computer Science at Bennington College

Full time on site starting Fall 2021

Would you like to teach and help design a broad cross-disciplinary computing curriculum at a small liberal arts college in southern Vermont?

Applicants with academic, industrial, and/or artistic backgrounds in computer science and from all sub-specializations are encouraged to apply. An advanced degree in computer science or a closely related field is desirable but not required.

See https://bennington.recruiterbox.com/jobs/fk0u26e/ for all the specifics.

Jim Mahoney | Computer Science Faculty Bennington College | jimmahoney@bennington.edu

jimmahoney··on Ask HN: Best office chair for home office work?
I have the Ikea Markus at home and it's been fine, especially for a $200 chair. I use a Herman-Miller Aeron in my work office that I got when I was having back problems, and like it a lot ... but I've found the Markus to be a good solution given the cost disparity. I don't feel like I need to spend $1000 for my home office.
jimmahoney··on Ask HN: Best way to learn JavaScript in 2019?
I second "Eloquent Javascript" - it's excellent.
jimmahoney··on Ask HN: What is your favorite programming font?
Anonymous Pro https://fonts.google.com/specimen/Anonymous+Pro
jimmahoney··on Ask HN: What are some niche communities you enjoy?
Argentine tango : check out the "my double life" TED talk at https://www.youtube.com/watch?v=QhdI3FNItHk .
jimmahoney··on Ask HN: What are the best Sci-Fi books you've ever read?
lighthearted and fun : "The Crown Jewels" by Walter John Williams. Definitely.

See https://en.wikipedia.org/wiki/Drake_Maijstral

jimmahoney··on Ask HN: What are the best Sci-Fi books you've ever read?
Lois McMaster Bujold is just the best - almost everything she's written.
jimmahoney··on All the things I hate about Python
I teach intro programming using python, and use it regularly for various projects.

But I agree with the author's central point that the language has a number of issues.

He mentions the python2 vs python3 issues, but doesn't discuss what is to me the biggest problem of all that: there is no standard simple way to identify within the code what version of python it needs or is written for. Coming originally from the perl world, that has always seemed like a significant oversight.

Nor does he mention several of my other biggest issues with the language, such as the arbitrary assignment of some operations to global functions (i.e. a=[3,2,1]; len(a)) while others are method calls (i.e. a.reverse()) which return nothing. And then there's list(reversed(a)) and all the iterator awkwardness ...

Explaining to students learning programming for the first time why neither of these do what they expect is never fun.

    >>> print(a.reverse())
    >>> print(reversed(a))
jimmahoney··on New Giant Viruses Further Blur the Definition of Life
"Life. Don't talk to me about life." - Marvin.

http://hitchhikers.wikia.com/wiki/Marvin

jimmahoney··on Httpie: A cURL alternative
It looks cool, but I don't really want to wait half a minute for it to do anything.

  $ time curl cs.marlboro.college
  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  <html><head>
  <title>301 Moved Permanently</title>
  </head><body>
  <h1>Moved Permanently</h1>
  <p>The document has moved <a href="https://cs.marlboro.college  /">here</a>.</p>
  <hr>
  <address>Apache/2.4.18 (Ubuntu) Server at cs.marlboro.college Port 80</address>
  </body></html>

  real	0m0.269s
  user	0m0.004s
  sys	0m0.005s
  
  $ time http cs.marlboro.college
  HTTP/1.1 301 Moved Permanently
  Connection: Keep-Alive
  Content-Length: 321
  Content-Type: text/html; charset=iso-8859-1
  Date: Sat, 27 Jan 2018 18:04:17 GMT
  Keep-Alive: timeout=5, max=100
  Location: https://cs.marlboro.college/
  Server: Apache/2.4.18 (Ubuntu)
  
  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  <html><head>
  <title>301 Moved Permanently</title>
  </head><body>
  <h1>Moved Permanently</h1>
  <p>The document has moved <a href="https://cs.marlboro.college/">here</a>.</p>
  <hr>
  <address>Apache/2.4.18 (Ubuntu) Server at cs.marlboro.college Port 80</address>
  </body></html>

  real	0m30.553s
  user	0m0.437s
  sys	0m0.052s
jimmahoney··on Brushing up on operating systems and C programming
Yes - I use this and the CMU labs for an undergrad course, and it's excellent.
jimmahoney··on The Presence of One’s Own Smartphone Reduces Available Cognitive Capacity
The statistically significant result is that scores on this test : "in each trial set, participants complete a series of math problems (information processing) while simultaneously updating and remembering a randomly generated letter sequence (information maintenance)" were significantly different for those with their phone silenced, face down on the desk next to them than for those with their phones in another room.

Given that this test essentially measures attention and distractions would seem to affect performance, I wonder what the results would be for some other object on the desk in the field of view - a book or a photo say - rather than just a phone.

jimmahoney··on Ask HN: Which book have you re-read recently?
Ready Player One.

Though the recent second time was as an audio book on a long car trip.

jimmahoney··on Ask HN: Best Chair for Programming
I'm typing from an Ikea Marcus which is my home office chair.

While I agree that the Aeron is great (and have one at work that I use regularly), the Marcus fit in my budget ($200 for the Marcus vs $800+ for a new Aeron) and is perfectly reasonable. I usually leave it in the locked forward typing position.

For twelve hour stints, I stand for part of the time (my desk will move up to standing height).

I tried an exercise ball - didn't work for me.

jimmahoney··on The most elegant implementation of FizzBuzz
Here's a different sort-of-functional python fizzbuzz.

While it doesn't use the spiffy lazy lists of itertools, and does have the typical "if x % n == 0" test, it does generalize easily to the "and print Baz every 37th number" case.

  def joinmap(func, elements, separator):
    return separator.join(map(func, elements))

  def fb_value(x, fb={3:'Fizz', 5:'Buzz'}):
    words = joinmap(lambda n: fb[n] if x % n == 0 else '', fb.keys(), '')
    return words if words else str(x)

  def fb_range(low=1, high=100):
    return joinmap(fb_value, range(low, 1 + high), '\n')

  print fb_range()
jimmahoney··on Ask HN: Good sci-fi movies?
A few others that I don't think have been mentioned, in no particular order.

- Guardians of the Galaxy

- Back to the Future series

- Men in Black

- Groundhog Day

- Elysium

- Planet of the Apes (old & new)

- Ender's Game

- Independence Day

- The Island

- John Carter

- I Robot

- The Day the Earth Stood Still (old & new)

jimmahoney··on Recommended Self-Study Path for Statistics
This free online textbook using R is what I used when I last taught statistics in a college setting : https://www.openintro.org/stat/textbook.php .
jimmahoney··on Enough with Basic Income
I like this notion of "political compass" : https://www.politicalcompass.org/analysis2 (not unique to this author), in which liberal vs conservative (left vs right) is an axis , but with a second one authoritarian vs libertarian i.e. more government intervention vs less government intervention is another axis.

Essentially this highlights the difference between your particular policy opinions and your enthusiasm for having a government enforce those policies on everyone.

jimmahoney··on Professors’ unprofessional programs have created a new profession
Having done a variety of data analysis and computational modeling while working as a PhD physics student and postdoc, I can attest that many of my colleagues wrote terrible code.

The problem wasn't that their code didn't have a nice user interface, or wasn't designed for reuse. The problem was that it was often impossible to really know whether it worked correctly or not.

In my experience, whether the code you're writing is going to run once or go into production, it needs to testable and understandable - enough that you have confidence that it does what you think it's doing. And that means building it in small enough pieces to analyze. Otherwise you just don't know.

jimmahoney··on Introduction to x64 Assembly (2011) [pdf]
I teach a systems course at Marlboro College which covers some x86 assembler and C, using Bryant and O'Hallaron's "Computer Systems: A Programmer's Perspective" textook. ( http://csapp.cs.cmu.edu/ ). The course materials include some great labs.

My students have particularly liked the "bomb lab" which requires reverse engineering an x86 binary to understand what input it expects, and the stack overflow exercises.

Highly recommended.

jimmahoney··on Ask HN: What non-computer activities do you do?
Argentine tango. At its best, a powerful, intimate connection between you, your partner, and the music.
jimmahoney··on What is Electricity?
I like Dave Barry's explanation of electricity (e.g. http://www.comp.leeds.ac.uk/Perl/Misc/electricity.txt ) including

"the electric company sends electricity through a wire to a customer, then immediately gets the electricity back through another wire, then (this is the brilliant part) sends it right back to the customer again. This means that an electric company can sell a customer the same batch of electricity thousands of times a day and never get caught, since very few customers take the time to examine their electricity closely. In fact, the last year any new electricity was generated was 1937."

and

"AMAZING ELECTRONIC FACT: If you scuffed your feet long enough without touching anything, you would build up so many electrons that your finger would explode! But this is nothing to worry about unless you have carpeting."

jimmahoney··on Hack: A typeface designed for source code
Another vote for Anonymous Pro.
jimmahoney··on The 'impossible' EmDrive could reach Pluto in 18 months?
It's not entirely coincidence.

Four dimensional space-time has a metric analogous to but not quite the same as euclidean space: the time part has the opposite sign from the space parts.

  ds^2 = (c dt)^2 - (dx^2 + dy^2 + dz^2)
ds is an "invariant proper time" which has the same value in all frames of reference. Check any special relativity textbook for the details.

Just as you can start with distance and then build up to momentum and energy in classical physics, in relativistic mechanics you can start with this metric and build up vectors in 4-space for velocity and energy/momentum. (Turns out that the time part is an energy while the space parts are momentum.) The upshot is that

  (m_0 c^2)^2 = E^2 - (p c)^2
which is the frame-invariant length of the energy-momentum 4-vector. (I think that m is better written as m_0, the rest mass, since the "m" notation sometimes means relativistic mass, which is different.)
jimmahoney··on Change of basis in Linear Algebra
I've always particularly liked the bra-ket notation for making this sort of problem intuitive, typically used by quantum physicists. (There's a wikipedia article on this notation, though I don't think it does it justice.)

In that notation, a vector |a> which is basis independent has components <i|a> in some basis |i> , where (say) |i_1> , |i_2> are the basis vectors. Then to change to another basis <k| the "operator one" (which is the outer product of a basis, i.e. sum over i of |i><i|) is inserted to get <k|a> = sum over i <k|i><i|a> , which turns into the matrix mechanics.

(Each of the outer products e.g. |1><1| is a "projection operator" which projects a vector onto that basis vector. The sum of all of them projects onto the whole space spanned by the vectors, which is the same as doing nothing, which is therefore the identity operator.)

Once you get your head around the connections between coordinates (i.e. a_x = a_1) and the dot product with a basis vector (i.e. dot(i_1, a) = <i_1 | a> = <1|a>), this notation can make the whole thing intuitive and mechanical.

I have an explanation of this online at http://cs.marlboro.edu/talks/bra_ket.pdf .

jimmahoney··on User feedback on Pocket submitted to Mozilla
But this procedure leaves it in the booksmarks menu - far from ideal.
jimmahoney··on Clean Thesis – A clean, simple, and elegant LaTeX style for thesis documents
Yes. And code. Without a LaTex & PDF example that includes all the pieces, the text layout isn't particuluarly interesting.
Page 1 of 2Next →