HNHacker News
TopNewBestAskShowJobs

ericfrederich

883 karma · joined June 12, 2014

submissionscomments
ericfrederich··on Quicksort (1961) [pdf]
6:47 minutes to sort 2k items.

We've come a long way. Python isn't even the fastest of languages

  $ time python3.6 -c "import random; l = random.choices(range(1_000_000), k=2_000); l.sort()"
  
  real	0m0.033s
... and this also takes into account creating the 2k random ints.
ericfrederich··on PureVPN Logs Helped FBI Net Alleged Cyberstalker
Thanks for that link. I currently use IPVanish. Maybe I should switch since this guy who got caught was publicly criticizing them.
ericfrederich··on Backblaze has ordered 100 petabytes of hard drives
I love the articles from Backblaze. I enjoy them publishing the failure rates of drives and anything else on the blog.

Two things missing from them in my opinion 1) a Linux client and 2) a second location

I guess I could get away without a Linux client if there was an unRAID plugin for B2.

ericfrederich··on AIM will shut down after 20 years
Agreed... it really paved the way for ambiguous and vague Facebook statuses and tweets.
ericfrederich··on Programming Models for Distributed Computation
I watched a talk on Dask

https://www.youtube.com/watch?v=RA_2qdipVng

... looks awesome, and something that seems only possible with dynamic code... or at least code that can introspect it's own AST.

EDIT: the cool part about it, I think, is that you don't have to shoehorn your algorithm into any particular model like map reduce or something else. You just write idiomatic Python code and... magic

ericfrederich··on Compute Engine machine types with up to 96 vCPUs and 624GB of memory
Idle, or running their own internal computations, or running lower preemptiable stuff.
ericfrederich··on If macOS High Sierra shows your password instead of the password hint
Okay... can somebody spoof/re-spin the relevant xkcd? https://xkcd.com/538/
ericfrederich··on PyPy v5.9 Released
3.5 was the first Python3 worth using according to Raymond Hettinger... but I think it was 3.6 that made dicts ordered by default and also includes f-strings. 3.6 is the one to have ;-)
ericfrederich··on Russian Hackers Stole NSA Data on U.S. Cyber Defense
This came up in congress a couple weeks ago didn't it? I think Rubio had mentioned Kapersky it knowing that it was a public hearing... some speculated that this was perhaps because he was privy to some classified things he couldn't say publicly but wanted to get the word out that they can't be trusted.
ericfrederich··on Best CPUs for Workstations: 2017
Interesting thought, but kind of sounds like a conspiracy theory. Anything else to back it up?
ericfrederich··on Keybase launches encrypted Git
Cool... haven't seen that. I guess what I'm asking for is for this stuff to become standardized. Once that happens if someone wants to write a web app around it that's fine, but it'd have to be run locally where the content can be decrypted and made sense of.
ericfrederich··on Keybase launches encrypted Git
You're correct, they're just files. To create a new branch off of master you can just...

  cp .git/refs/heads/master .git/refs/heads/WTFFF
... no SHA-1 involved at all, no parent, history, etc.
ericfrederich··on Keybase launches encrypted Git
This removes the ability for collaborating, browsing online, basically any feature of GitLab/GitHub/BitBucket.

... I think I'm in favor of this. I think of the things that those services provide on top of Git should actually be ported or mapped to Git itself. Branches, pull requests, comments, etc... should all be Git objects of some sort.

ericfrederich··on Keybase launches encrypted Git
Awesome... any plans to support LFS? I know with LFS you can write custom backend handlers.
ericfrederich··on How do people manage hundreds of Git repositories?
This looks like a one-off thing you need to do semi-manually and methodically.

Every step of the way you need to balance the effort of doing something with a script vs doing it manually.

How long would it take to manually make the change in all 100+ repos... vs. how long would it take to write a script to do it. Would the script be robust enough to properly make the change in like 90% of them... etc.

These are things you need to ask yourself in your endeavor.

You'd want to do all this work on a new similarly named branch (or branches depending on your workflow) for every repo.

Perhaps write a script to validate changes to all 100+ repos on that branch. Then when all the work is done... do a massive merge.

ericfrederich··on The Curious Case of the Longevity of C
Yeah... good luck taking a newer version of Python an compiling it on Visual Studio 2012. I had to jump through hoops even to get 2.7 to compile and wound up abandoning it because it caused problems down the line with ctypes.
ericfrederich··on Hacker News Clone Using GraphQL and React
How did the web get so complicated. Just look at that diagram.

Separation of concerns went right out the window didn't it? I'd like to see Hacker News Clone Using 300 lines of server-side Python code that works on browsers without JavaScript

ericfrederich··on Dolphin Progress Report: September 2017
Nintendo just released the SNES classic. Next up should be the N64 Classic.

I think GameCube and Wii are probably too new to be considered retro.

Also, the games are a lot bigger... they wouldn't be able to cheaply make a device powerful enough and with enough storage to make a huge profit.

ericfrederich··on Las Vegas Shooting Kills More Than 50
The right would say this wouldn't be a problem if more people had guns to defend themselves with. An idiotic argument for sure especially given the details of this current attack (32 stories up... far away, etc).

Even if this happened at an NRA rally or gun show they'd come up with some other excuse.

ericfrederich··on Modern terminal-based text editor
As easy as childsplay as long as your target is supported. I cannot run Go code on my router which runs OpenWRT... Nano works there just fine.
ericfrederich··on Google’s PixelBook: the target is bigger than it seems
A link within that article mentioned Android Studio possibly running on it. Who cares? Are there any developers who live 100% in an IDE? I use Sublime Text in addition to a full blown IDE because sometimes there's stuff that you know will be tedious in an IDE and simpler with your go-to editor.

Until you can run Sublime Text, and bash (with perl, python, sed, awk, etc, or any other arbitrary piece of software I don't see developers moving to this device.

ericfrederich··on What’s New in Python 3.7
Thanks for that link. Very informative interesting discussion. There must be a lot of desire for attrs from the stdlib developers.
ericfrederich··on What’s New in Python 3.7
It's a good assumption for 3.7. In isolation this is a pragmatic decision and makes sense.

You are correct though. A .py file which uses non-ascii and doesn't declare the encoding should be considered an error though. Hopefully everybody's dev tools will pick this up (even on 3.7 where they wouldn't need to)

ericfrederich··on What’s New in Python 3.7
What do you mean by this? Do namedtuples not give you this?

  >>> class MyClass(namedtuple('_MyClass', ['x', 'y', 'z'])):
  ...   def foo(self):
  ...     return self.x * self.y + self.z
  ... 
  >>> x = MyClass(4, 5, 6)
  >>> x.foo()
  26
... or an attrs decorated class with frozen=True?

  >>> import attr
  >>> @attr.s(frozen=True)
  ... class MyClass:
  ...   x = attr.ib()
  ...   y = attr.ib()
  ...   z = attr.ib()
  ...   def foo(self):
  ...     return self.x * self.y + self.z
  ... 
  >>> x = MyClass(4, 5, 6)
  >>> x.foo()
  26
ericfrederich··on What’s New in Python 3.7
A linter for a dynamic language has got to be the hardest thing ever to implement.

In PyCharm if you return from within a contextlib.suppress context it'll think any code following it is unreachable code.

https://youtrack.jetbrains.com/issue/PY-25809 https://youtrack.jetbrains.com/issue/PY-16419

ericfrederich··on What’s New in Python 3.7
Correct. This is called orthogonality. I just used it now to discover that this same syntax works for both sets and lists (using * instead of )

  >>> s1 = {'a', 'b', 'c'}
  >>> s2 = {1, 2, 3}
  >>> {*s1, *s2}
  {'b', 1, 2, 3, 'c', 'a'}

  >>> l1 = ['a', 'b', 'c']
  >>> l2 = [1, 2, 3]
  >>> [*l1, *l2]
  ['a', 'b', 'c', 1, 2, 3]
ericfrederich··on What’s New in Python 3.7
Lots of code to show that. How 'bout this: ;-)

  >>> {**{'a': 'first'}, **{'a': 'second'}}
  {'a': 'second'}
ericfrederich··on JSLinux – Run Linux or other Operating Systems in your browser
What a great nostalgic color. I think I'll change my Windows 10 desktop to it.

http://www.colorhexa.com/3a6ea5

ericfrederich··on Hack – A typeface designed for source code
I switched my Sublime Text to it and watched my fonts change ever-so-slightly. This font is essentially "Source Code Pro"
ericfrederich··on Statically Recompiling NES Games into Native Executables with LLVM and Go (2013)
This means that they test some condition, and then either transfer control flow to the next instruction, or to a different label. This means that we can mark the possible branch address and the next address as instructions.

I hope all of these NES ROMs were coded well. Seems like you could do something like...

  if False:
      jump_to_data_address
... then he'd be interpreting data as code.
← PreviousPage 5 of 14Next →