HNHacker News
TopNewBestAskShowJobs

dr_zoidberg

1,856 karma · joined September 24, 2014

submissionscomments
dr_zoidberg··on Image unshredding using a TSP solver
Roy Mustang does it with way more style ;)
dr_zoidberg··on Goodbye C++, Hello C
That's ingenious, but I don't think I've heard a name for those kind of strings.
dr_zoidberg··on Goodbye C++, Hello C
Sure, its just that these kind of strings were historically called Pascal-strings [0] because they were the way Pascal implemented strings.

[0] And still are! For example, Python refers to them as such, see the "p" (lowercase p) character code here: https://docs.python.org/3/library/struct.html#format-strings

dr_zoidberg··on Goodbye C++, Hello C
Those would be Pascal Strings (length at the start, then the bytes). Those make for very easy to write code, but they come with a few issues, but in general they are simpler and give better behavior than null-terminated strings. However, as for a bit of a historical bagagge, it seems we got used to null-terminated strings and just went on with them.
dr_zoidberg··on Your CPU may have slowed down on Wednesday
I used to do that test with a mobile pentium from back in the day... I think it was a T5600? The model name sounded like a terminator, that's for sure.

Problem is that then AVX became a common thing (at least in part of what I run) so that processor became unusable. I moved to an i3-3120m, which supports AVX, but then AVX2 became a thing.

I could've gone for a 4000-series i3 at that point, but I just grew tired. And Pentium/Celerons are a bigger mess to find because some of them are Atoms now. For example, I have a N4000 sub-notebook that I got for my mom to check her email and view online videos, and the things feels pretty snappy for those things. But then you try to run some numerical code and you find it's 50-100x slower than their bigger siblings... Turns out it has no AVX of any kind, and event though it says it supports SSE4, it feels possibly slower than the older Pentium I mentioned at the start, even with faster, dual-channel memory, and those old Intel didn't even have SSE4, just SSE3. But possibly at that point the 35W thermal headroom of theT5600 plays a big part as the N4000 is passively cooled and has a 6W TDP.

Moral of the story? Even if you try to, it's hard to pick a slow/old processor that will support all the operations that your software could use. Some of the give a huge speedup. You have to pick your battles. You'd probably have an easier time underclocking a lot out of your current processor (and disabling a few things?) and call it a day for performance testing.

dr_zoidberg··on Raspberry Pi 4 OpenBSD based home computer/gaming console
Well, he did say he wants to turn that into a product, so I understand he won't release details as they are a form of trade secret for his idea.
dr_zoidberg··on Bitcoin Plummets Below 40K
I think the exchanges would be the ones that could answer that question... But I don't think it's in their interests to do so.
dr_zoidberg··on The Textbook That Unleashed Ramanujan's Genius
I've caught the exceptional by being a commited teacher. You notice that they are ahead of the pack, by different signs: some make great questions in class, others barely say a word but utterly ace the exams, others are incredibile driven and tell you about their interests, others aren't, but when challenged they respond with interesting solutions.

Of course, that may not be a scalable way to find them. But if you had all the teachers in line with that "pay attention to the exceptional" objective, you'd probably find more than the current[0] "grind students forward into formal education" approach.

[0] I say this being fully aware that may not be the particular case in a region/group, but it certainly seems like the broadly taken "strategy" by most of the education system where I live

dr_zoidberg··on Bitcoin Plummets Below 40K
In this particular case, the no apparent reason is certain person known to speculate with cryptocurrencies suddenly decided he'd go on to publicly bash the thing he pumped in the past "for no apparent reason". I mean, we couldall speculate the price was a bit high for his taste and wanted a discount, or maybe he really believes what he said.

That said, I agree that bitcoin price is kind of a bubble, and something that is pumped and dumped by people with a lot of money to the detriment of those who saw it as a miracle savings investment (usually people with little financial education) or those who truly believed in it (I think those became a small % of the users a long time ago).

dr_zoidberg··on Nvidia cripples cryptocurrency mining on RTX 3080 and 3070 cards
The driver you are using is a BLOB that comes from closed source. Many people who use Linux are against that, and would rather have open source drivers (which I think nvidia used to have but discontinued?).
dr_zoidberg··on The chip shortage could lead to an era of hardware innovation
Yeah, I guess economy of scale means that you can manufacture 1,000,000,000 identical MCUs which are flexible and multi-purpose. Up to the point where you can't and it turns out some (most?) of them can be replaced by simple circuits with a few components.
dr_zoidberg··on Missing line in a smart contract leads to $10M hack
This code isn't tested at all. They messed up copying code from a previous implementation, that's how bad this is. If they had had a few basic tests in place they would've spotted this before it even had a chance to be a problem.
dr_zoidberg··on The chip shortage could lead to an era of hardware innovation
I find it a bit hard to believe that a whole microcontroller can be cheaper than a few electronic components on their own. Probably what did happen before the shortage was that the MCU was cheap enough and gave you a great flexibility in prototyping and coudl be suited for many different tasks. After the prototyping stage, it should've been replaced by simpler things, but since good enough was cheap enough, it was left as it was.
dr_zoidberg··on The Ultimate Guide to Inflation
It's also debatable that there are no costs associated with digital goods. If suddenly Netflix had a surge in subscribers and they doubled them over a short period of time, they'd have to invest in infrastructure to support the extra demand. That would cost them in hardware and human resoursces to handle the extra demand. But yeah, digital services have a better situation at meeting demand than physical goods of which, after the produced amount sells out, you have to wait for more to be manufactured, delivered, etc.
dr_zoidberg··on Pyston v2.2: faster and open source
Pyston originally started as an internal project at Dropbox and they had a couple of super interesting blogposts where they detailed their approach and findings[0]. After a a year or two, the project got axed, but the devs kept working on it and then released it on their own (I don't remember the details, but evidently the chosen license for the project allowed that).

Last year (I think it was last year, but can't tell if that was 2020 or 2019) they released it on their own, thinking of a commercial model. Now they have switched to OSS+services, which is interesting because it'llopen up more people using Pyston.

I tihnk this is interesting in its own right, but yesterday we got Facebook announcing Cinder[1] -- which is unsupported to outsiders, but significantly faster than Pyston. According to Facebook, they intend for parts of Cinder to be upstreamed (and have already upstreamed a few, apparently) to CPython. So again, and sorry for using such a vague word, it'll be interesting to see how all these things play out in time.

[0] https://blog.pyston.org/2014/09/

[1] https://github.com/facebookincubator/cinder

dr_zoidberg··on Digital Needle: Ripping vinyl records with a scanner (2013)
When I read the title I immediately thought of a "laser tip" that and reading the reflections of it, not something based on software that would "read" an an image.

Following this animation I'm left thinking that you could do a bit of filtering to better extract the wave(s) from an image, though you'd require a particular setup for the lighting conditions to get the best possible quality out of it. And then back to my first idea: probably a laser-tip would be the best tool here too.

Unfortunately I don't have vinyl records around to test any of this!

dr_zoidberg··on Test for lists in Cython
But OP didn't type iterate_list either. Perhaps he saw little benefit on one and assumed the same would happen in the other. Cython's annotation mode (cython -a) doesn't really help either here, showing both OPs and optimized versions with a strong yellow color, indicating that they would be about the same, but compiling and trying both definitely shows the improvement.

Another funny thing: making a pure python version that uses the sum() built-in results in code that runs 80% as fast as the cython version, but also gives lower error (e-8 versus e-4 error that gets accumulated when the numbers are summed up one by one).

dr_zoidberg··on Linux Kernel: The multi-generational LRU
But this algorithm isn't a FIFO: it's a multi-generational LRU cache. That means, LRU+some extra details (evry well explained in the post) to make it perform even better. There are some metrics in the post, and some in the comments here too.
dr_zoidberg··on Test for lists in Cython
OP has an open pull request on his repo[0] where someone made basically this same change (different names for the variables, but same idea).

According to OP, he tried this but it resulted in slower execution for him. I'm not sure he really followed what that PR says. In the case of the submitter, it says on their machine it gave a 2x speedup (smaller than my ~7x, but still significant).

[0] https://github.com/00sapo/cython_list_test/pull/3

dr_zoidberg··on Test for lists in Cython
The cython code is a bit messy. Changing from:

    cpdef float iterate_list(a_list):

        cdef double count = 0
        cdef int i, j
        for i in range(len(a_list)):
            internal_list = a_list[i]
            for j in range(len(internal_list)):
                count += internal_list[j]
        print(count)
        return count
To:

    cpdef float iterate_list(list a_list):

        cdef double count = 0
        cdef double val = 0
        cdef list ilist
        for ilist in a_list:
            for val in ilist:
                count += val
        print(count)
        return count
Speeds up the iterate_list function an order of magnitude. On my PC:

    In [9]: %timeit list_cy.iterate_list(a_list)
    1000000.0007792843
    1000000.0007792843
    1000000.0007792843
    1000000.0007792843
    1000000.0007792843
    1000000.0007792843
    1000000.0007792843
    1000000.0007792843
    385 ms ± 6.15 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

    In [10]: %timeit list_cyo.iterate_list(a_list)
    1000000.0007792843
    1000000.0007792843
    1000000.0007792843
    1000000.0007792843
    1000000.0007792843
    1000000.0007792843
    1000000.0007792843
    1000000.0007792843
    2.71 s ± 182 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
(yeah, I kept the prints that the code has)

Where list_cy is the fixed code and list_cyo is the original code. Even then, iterating over a list of lists is _definitely not_ the optimal way you'd face a problem of this kind. Numpy arrays and memoryviews would be the correct tool to use.

dr_zoidberg··on Higher quality audio makes people sound smarter
For that case, a couple of years ago I bought a small Blue microphone (their cheapest model I think), and got amazing audio quality from it. My main requirement though was getting a USB mic, since my laptop at the time had the nasty habit of getting noise into the audio-in line.
dr_zoidberg··on Python 3 Types in the Wild: A Tale of Two Type Systems [pdf]
I've found over the years that people have an easier time understanding how Python manages variables when you tell them that, rather than "in-memory boxes with data" as is the case in other languages, Python variables are more like "name tags that you attach to an object".
dr_zoidberg··on Higher quality audio makes people sound smarter
You have to run that postprocessing somehow, and sometimes videoconferencing software doesn't give you that flexibility. So then you have to set a up a virtual microphone, which might be a hassle in your platform. At that point, and as you said, considering that you may not know enough about audio on how to set that up, you're much better with an easy-to-use, dynamic microphone that does much of what you need on its own.
dr_zoidberg··on Python 3 Types in the Wild: A Tale of Two Type Systems [pdf]
Python is strongly typed. It's also dynamically typed. They are not contradictory between each other.
dr_zoidberg··on Turing Award goes to Aho and Ullman
Those would be the green dragon book (1977), the red dragon book (1986) and the purple dragon book (2006). Maybe it's time for a blue dragon book?
dr_zoidberg··on Hello, HPy
> over the fact that it's slower than what native C would get them.

You have a quote for that? Cython code, in the context of "C-extended-python" probably never is slower than native C. There has been a lot of work over the years to make sure of that.

Now, if you want to compare it to "a C program/library in the wild", then we are not comparing apples to apples. The whole point of Cython is inserting C code into a Python module, to have (high performance) C code inside a Python environment.

dr_zoidberg··on All Futurama Opening Quotes
Of the tear-jerker episodes, I really like "The Late Phillip J Fry". Most people tend to take it into account in the series continuity.
dr_zoidberg··on Adobe Photoshop's 'super resolution' made my jaw hit the floor
I'm surprised nobody cited yet the Gigapixel AI-"Ryan Gosling" case from last year: https://petapixel.com/2020/08/17/gigapixel-ai-accidentally-a...
dr_zoidberg··on Julia receives DARPA award to accelerate electronics simulation
First and foremost: I AM NOT A LAWYER.

With that out of the way...

They could argue that since it was a tool that was made to help with his job at at the company, then it's internally developed. If there are no clear grounds or easily presentable evidence (even if there was!), he's out in the wild with a liability.

The only place where I can see him in the clear is if they had a repo going back to before the work on the company and they could prove the tool was a personal project, and unrelated to the job. Even then, Company could still sue and burden them with legal fees/process until they tire him out and BINGO, now they own their IP.

The alternative could be starting a new project, completely open source from the start (probably with one of the more liberal licenses) and get crowdfunding to develop and maintain it. Assuming they are interested in doing that, of course.

dr_zoidberg··on Linux Desktop on Apple Silicon/M1 in Practice
This is way beyond wishful thinking. Apple will do what it makes most sense in their business strategy. Due to their past transgressions against the open source community, what makes you think that community fits in their business strategy?
← PreviousPage 6 of 32Next →