Recent submissions

Comment · 8 years ago
PayPal froze my account a few years ago for "suspicious activity". I still don't know what that activity was. Support gave me the same sort of runaround non-answers as described in this article. I finally got to talk to someone on the phone and had an exchange along these lines: me: "Is there any way I can continue to use paypal?" paypal: "You can open up a new bank account and then use that to register a different paypal account" me: "..."
Comment · 8 years ago
It used to be that way, now when I try it F1 is a sign-in screen, F2 is my main GUI, F3-F6 are normal virtual terminals, and F7 is some process that I don't recognize.
Comment · 8 years ago
Comment · 9 years ago
Comment · 9 years ago
Classes definitely give you a lot of rope to hang yourself with (metaclasses, inheritance, MULTIPLE inheritance), but they have their place. I'll usually start with a function, but when it gets too big, you need to split it up. Sometimes helper functions is enough, but sometimes you have a lot of state that you need to keep track of. If the options are passing around a kwargs dictionary, and storing all that state on the class, I know which I'd pick.

You can memoize methods to the instance to get lazy evaluation, properties can be explicitly defined up-front, and the fact that everything is namespaced is nice. You can also make judicious use of @staticmethod to write functional code whenever possible.

Comment · 9 years ago
> "Don't let people pay for things because poor people might not be able to afford it" is offensive to "poor" people.

It's important to distinguish what kind of "things" you're talking about, though. There's a pretty big moral difference between not being able to afford consumer goods and not being able to find an appropriate place to perform basic bodily functions.

Comment · 10 years ago
Why do you want to work at one of the big 4 tech companies? Software engineering is a very big field, you don't need to be really good at solving coding puzzles on a whiteboard to be a good developer. Hell, there are developers who do nothing but set up wordpress sites for their clients, and they're providing a needed, valuable service.

You can work as a web dev at a small company without being part of the mainstream silicon valley rat race. Sysadmin-type skills are pretty hard to hire for, and very useful at small companies. It sounds like you've got that going for you. I'd change your definition of success and focus on finding a job at a company with a culture you'd enjoy, and not worry so much about its perceived prestige.

Comment · 11 years ago
Comment · 11 years ago
Comment · 11 years ago
I'd write that function like this:

  def absolute_path(path):
      if not path.startswith('/'):
          return '/' + path
      return path
This way you don't have to keep track of mutating the path variable. I do find that more readable - it's clearer that there are two paths through the code. That said, this example is trivial enough that I'd probably do it with an inline if/else statement, although still probably not a lambda:

  def absolute_path(path):
      return path if path.startswith('/') else '/' + path
This way it's more obvious at a glance that you're defining a function. It's easier to follow someone else's code if they generally adhere to standards, and Python is a very convention-oriented language.
Comment · 11 years ago
> Neovim however might help to solve this problems, but when that will see the light of day, it seems to be hard to find out.

Neovim is working quite well already. I fully switched from vim to nvim months ago without any issues. Plugins are still written for vim though, so I don't think many take advantage of neovim-specific features yet. It does have a full terminal already though, which is pretty awesome.

edit: Oh, I'm guessing you're referring to the promises of embedding neovim inside IDEs. I'm looking forward to that too!

Comment · 11 years ago
ipython has a killer autoreload function: http://ipython.org/ipython-doc/stable/config/extensions/auto...

In [1]: %load_ext autoreload

In [2]: %autoreload 2

In [3]: from foo import some_function

In [4]: some_function()

Out[4]: 42

In [5]: # open foo.py in an editor and change some_function to return 43

In [6]: some_function()

Out[6]: 43

It's nothing like a proper lisp repl, but you can sorta do this in vanilla python too, if you don't mind some annoyances. `reload` reloads a module:

>>> import mymodule

>>> print mymodule.myfunction()

3

>>> reload(mymodule)

>>> print mymodule.myfunction()

5

Downside is you have to use the module, `from mymodule import function` won't reload.

Comment · 11 years ago
I've been using spacemacs off and on for a few months, (although never as my primary editor). I really like their out-of-the-box config, and it's much easier and better than my previous copypasted amalgamation of an init.el file. I have a few qualms with it though.

- It completely takes over emacs. Your modifications now go in ~/.spacemacs. Don't touch ~/.emacs.d/ Want to install something from melpa? Make a spacemacs configuration layer. That aspect feels like a strong step away from the emacs ethos where you're on the same footing as the editor authors. I don't like the inversion of control.

- It's unstable. Fairly often I'll update and something will fail, leaving me helplessly with emacs keybindings. Thankfully, a revert is easy.

- The last one is a problem with evil in general, you'll still occasionally find yourself in emacs mode, where hjlk and more importantly ":q" don't work

Comment · 12 years ago
Are you using React.js directly through JS interop, or something like Om or Reagent to wrap it? What is your opinion of the various options available for React.js in ClojureScript?

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton