Hacker Newsnew | past | comments | ask | show | jobs | submit | contravariant's commentslogin

For reasons I never quite understood python has a collections.Counter for the purpose of counting things. It's a bit cleaner.

There's bound to be a way to turn a stream of bytes into a stream of unicode code points (at least I think that's what python is doing for strings). Though I'm explicitly not volunteering to write the code for it.

    import mmap, codecs

    from collections import Counter

    def word_count(filepath):

        freq = Counter()
    
        decode = codecs.getincrementaldecoder('utf-8')().decode
    
        with open(filepath, 'rb') as f, mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) as mm:
        
                for chunk in iter(lambda: mm.read(65536), b''):
            
                        freq.update(decode(chunk).split())
            
                    freq.update(decode(b'', final=True).split())
        
                return freq

Sure, but making one string from the file contents is surely much better than having a separate string per word in the original data.

... Ah, but I suppose the existing code hasn't avoided that anyway. (It's also creating regex match objects, but those get disposed each time through the loop.) I don't know that there's really a way around that. Given the file is barely a KB, I rather doubt that the illustrated techniques are going to move the needle.

In fact, it looks as though the entire data structure (whether a dict, Counter etc.) should a relatively small part of the total reported memory usage. The rest seems to be internal Python stuff.


The phrase "when it is detected" makes me nervous.

That's why I included the bottom part describing how some pins are longer than others. It's sort of how some hotplugs work in most cases. First ground connects, then other set of pins and so on. So when is detected a physical act of being disconnected.

I can't really think of a polite way to phrase this, but I'm not surprised throwaway mobile apps do benefit, while relatively mature python packages do not. That matches my estimation of how much programming skill you can reasonable extract from the current LLMs.

Really the one thing that conclusively has changed is that the 'ask it on stackoverflow' has become 'ask it an LLM'. Around 95% of the stackoverflow questions can be answered by an LLM with access to the documentation, not sure what will happen to the other 5%. I don't think stackoverflow will survive a 20-fold reduction in size, if only because their stance on not allowing repeat questions means that exponential growth was the main thing preventing them from becoming stale.


> I'm not surprised throwaway mobile apps do benefit, while relatively mature python packages do not.

Right.

I don't think you even need cynicism or whatever you felt you were having impolite thoughts about:

I'd expect the top mature libraries to be the most resistant to AI tool use for various reasons. They already have established processes, they don't accept drive-by PR spam, the developers working on them might be the least likely to be early adopters, and -- perhaps most importantly -- the todo list of those projects might need the most human comms, like directional planning rather than the sort of yolo feature impl you can do in a one-man greenfield.

All to further bury signals you might find elsewhere in broader ecosystems.


I would expect nearly all of these developers to be technologically sophisticated and for most of them to have tried AI asssisted coding and to be unafraid to use it if they thought it brought some benefit.

> Note that a more complete model would multiply each term by P(track)_j — the common-mode detection-tracking-classification factor developed in the previous section — but the standard WTA formulation assumes perfect tracking.

I'm not sure that is a useful model, or more complete. I don't think you can assign interceptors to undetected missiles, so considering their effect on the value is rather pointless. It's effectively a sunk cost.

Multiplying with the probability also makes no sense from an optimisation point of view. Why would you assign lower value to a target about to be hit simply because you were unlikely to detect the missile?

The tracking probability only shows up in the meta game described at the end, where one side is trying to optimise their ability to hit valuable targets and the other is trying to optimise their ability to prevent that from happening.


They have some more useful figures in the paper, but for a lot of things they're essentially saying there is not enough evidence to support using cannabis yet.

The strongest claim is the lack of significant effects for anxiety, ptsd etc. but it varies a bit whether that's because the effect is too small or because it is not studied enough.

For anxiety for instance the effect they list in the paper is quite big but the error bars are even bigger so the net result is inconclusive. This is quite different from PTSD where they note little to no effect with small error bars.


I don't think I've ever heard that cannabis was a treatment for PTSD let alone a good one.

Is this paper trying to confuse people about psilocybin?


The paper is just listing studies that happened. There might be a political agenda behind it, but identifying a study about cannabis use for PTSD and drawing conclusions about the results is what you would expect this review to do. Leaving studies out is much more suspicious.

How many veterans do you know? How many veterans that you know use cannabis to treat their PTS? I guess I might be living in a bubble but there are plenty of videos of veterans and others talking about how exactly it is that they use cannabis for PTS. I recommend watching some.

I won't call you an idiot, but assuming that all cases are simply people being sad is a bit simplistic.

Some people are going to be more susceptible to depression, for whatever reasons, and improving someone's surroundings is probably going to prevent or alleviate depression to an extent, but to people who are depressed now it's somewhat pointless advice.


Why shouldn't the reference implementation get JIT? Just because some other implementations already have it is no reason not to. That'd be like skipping list comprehensions because they already exist in CPython.

At this point pandoc, that way I can at least be sure I can translate it to whatever format I need.


If 'we' really cared about the improvement of models all of them would be public.

Anything else just proves someone prefers making money to improving the models.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: