skysight-inc/HackerNews huggingface dataset:
You can make python binary search super fast if you use mmap. here's a version of that I had lying around, it's probably correct.

import os
import mmap

def do_mmap(f):
fd = os.open(f, os.O_RDONLY)
size = os.lseek(fd, 0, 2)
os.lseek(fd, 0, 0)
m = mmap.mmap(fd, size, prot=mmap.PROT_READ)
return m, size, fd

SEEK_SET = 0
SEEK_CUR = 1

class Searcher:
def __init__(self, file):
self.file = file
self.map, self.size, self.fd = do_mmap(file)

def close(self):
self.map.close()
os.close(self.fd)

def find_newline(self):
self.map.readline()
return self.map.tell()

def binary_search(self, q):
pos = 0
start = 0
end = self.size
found = False
#this can get stuck with start = xxx and end = xxx+1, probably from the \r\n
while start < end - 2:
mid = start + (end-start)//2
self.map.seek(mid)
pos = self.find_newline()
if pos > end:
break
line = self.map.readline()
if q < line:
end = mid
elif q > line:
start = mid

while True:
line = self.map.readline()
if not line.startswith(q): break
yield line

if __name__ == "__main__":
import sys
q = sys.argv[1]
s = Searcher("pwned-passwords-sha1-ordered-by-hash-v6.txt")
import time
ss = time.perf_counter()
res = s.binary_search(q.upper().encode())
for x in res:
print(x)
ee = time.perf_counter()
print(ee-ss)
Perhaps loading a file from disk into pandas every request is not the right strategy to begin with.
1930 GDP was (at the time) $100B with NewDeal actual expenditure of $42B (42%), compared with 2019 $19T GDP and $6T COVID (~30%).

There's this weird historical effect represented by "Real GDP" that has the 1930s number being 10x that size (whatever that means):

https://www.statista.com/statistics/1031678/gdp-and-real-gdp...
OP didn't ask for advice about how to treat their condition. Presumably they prefer to hear that from their doctor, rather than from every stranger they mention their diagnosis to.
They made it to that explanation in the video eventually.
While the law is there, the grid-scale battery tech is pretty far from the point where the returns start diminishing. I'd say that it's now in the lower part of the S-curve, with a lot of lower-hanging fruit to crop.

I'm saying this as a definite proponent of nuclear power and of renewables.
While I never worried about gas heater related outages, I have two 30-gal gas tank heater in series (4-5 person household), with the purpose being a little bit of added efficiency.

In the summer and autumn, the upstream heater is turned off (optionally even its pilot light), since the incoming water is much closer to room temperature than freezing in this half of the year.

In the winter, when incoming water temperature ends up reaching temperatures closer to freezing than room temp, both are operating. So the total BTU capacity doubles when the upstream "pre"-heater is put online again late October.

One variation I suggest would be the above system, except with the main heater (downstream) being a heat pump circulation driven tank heater. Something like 50-60 gal maybe. This way, you get some "free" air conditioning in the summer. You also have benefit of redundant fuel all year around.

The down stream gas pre-heater could optionally remain on in the summer (or on any of the settings, from vacation to medium to hot settings) depending on whether the number of people in the household calls for a higher capacity of hot water.
But remember that Musk very much didn't want to buy twitter. He was forced to, and in the process of doing that, has saddled Twitter with a level of debt it has no prayer of being able to service.

I could totally believe that he would prefer that it died.
> kids on iPads while eating.

Thing is that statement applies to a lot of the adults (with phones) in the restaurant too. It's sad and telling.
What makes you think OP needs advice for ADHD treatment? He was diagnosed by a mental health professional. He may be taking medications that work quite well in the right environment.
This is just Clayton Christensen/Geoffrey Moore/SteveBlank stuff. It's the same patterns of growth, price, adoption curves, irrational exuberance, etc down to the bad predictions by entrenched industry experts.

It's remarkable how cleanly it's playing out. There's probably some easy academic opportunities on writing about it if someone wants some easy first authorship opportunities while sitting in their pajamas, it's there for the taking.
Home battery to story a day’s worth of power, $15k, job done.
System Preferences > Accessibility > Display > enable "Reduce motion"

Though I think this reduces motion on everything, not just the virtual desktop animations. I don't mind that but YMMV.
Parsing ASCII simply takes time. What you describe sounds like a use case for SQLite. Parse once when building the database. When indexed properly, searching should be much faster.
The question I have is, do masks actually lower viral load meaningfully if the individual viruses are being shed and blown through the mask? Put another way, particles large enough to be stopped by most masks may not be the primary vector of infection for new strains of COVID and we have no real clue.
I'm really looking forward to SpaceX getting Starship into orbit. I haven't been this excited about rocketry since I was a kid, watching Apollo shots.
What is measurable is the amount of staff that was working and is currently working the problem. From all reports I’ve seen, it’s less.
It’s to upsell you to the 32s by letting you think that something must be wrong with the 24s at that price.
apparently there is a bullet that will go nearly as fast as (still slower)
https://en.wikipedia.org/wiki/.220_Swift
Wow, they have 664 open issues, 503 closed. For a software that specifically wants to keep things simple. I don't envy them.
The boring predictability of this article.
I've noticed an enormous number of business and self-help books are little more than checklists. Each chapter's title is essentially "Do X", and the contents give examples of when someone "did X" in a specific scenario. "X" is often very general advice, so the examples usually lack nuance or depth, resulting in a whole lot of fluff
1990s Microsoft: "Where do you want to go today?"

2020s Microsoft: "Where do we want you to go today?"
If that's what you want to believe, you will always be able to find another blog to reinforce that view. In fact, that's almost exactly what you did; you found another article that paints America as one bad coin-flip away from a dystopian hellscape (if it isn't one already).

Just look at the first sentence:

>For months, the world’s largest economy has been teetering on the brink of collapse because America’s latter-day robber barons can’t comprehend that workers sometimes get sick.

We learn so much from this trite piece of... journalism.

1. We're on the brink of collapse (again!)
2. We're living in a new era of robber-barons
3. The people running things are idiots have no idea that people get sick, unlike the very smart author of this article

Meanwhile, in reality, the "crisis" spelled out in the article was resolved in a predictably political (and boring) way. That kind of news doesn't fuel clicks, though. In its staunchly dogmatic opposition to modern capitalism this kind of journalism can't avoid embracing the exact business model it pretends to decry: clicks go up, journalism more better.
+1

And if you're in a role where you are expected to respond promptly (say, you're an SRE or sysadmin that's on-call) there should be other, better avenues to reach out like a ticketing system, pagerduty or opsgenie, etc.
That's why there are consulting companies specialized in Oracle licensing. Just hire one of such consulting companies, instead of dealing with Oracle directly.
As always, it's the benefit of a small group being prioritized over the majority.

Most software engineers would not build Copilot. But those that "defected" and build it got compensated very well for it.
I think Twitter is clearly doomed. The best case outcome for it is that it becomes Parler.
That many hinges is going to be quite expensive.
What's the point of reboot, if not to reset state?
> As much as I enjoy writing to think, simply writing doesn't lead to
reality testing

Yes it's possible to get cloistered. But I find writing and
formulating ideas gives way to the ability to say it. What was
ineffable becomes clear language I can test with people to see how
it's received.
> and that degree of accuracy is only going up as we feed the models more data.

The problems comes when the data that is fed is of the "Hitler did nothing wrong"-type. That AI system will have no problem regurgitant something that takes that at face value, while a thinking individual knows it to be false.

There's also the issue of what do you do if the data being fed is only "valid" for people that happen to have a certain skin colour? Or a certain ethnicity? Or a certain gender? Or a specific socio-economic status?

There's a great short story about a "robot" ingurgitating lots and lots of data with no extrinsic value in Stanislaw Lem's "The Cyberiad" (minus the Hitler part). People like Norvig are smart enough to give lots and lots of references in order to prove their point but they're not smart enough to see the bigger picture (the one pointed to by people like Lem).
The Onion talks were my favorite take down of ted talks:
https://www.youtube.com/playlist?list=PL4NL9i-Fu15hhYGB-d0hm...

And wow these videos are 10 years old. Does anyone care about Ted talks anymore?
> had no issues, but precautions after FTX

That’s the issue

Did you withdraw from all your other accounts or just Binance / crypto

Once the true believers leave who replaces them ?
The problem with this analysis is not that it’s wrong: the existence of a zero-sum nuclear/renewables “argument” is absolutely a huge benefit to the legacy fossil fuels industry. The problem is that right now it’s renewables and not nuclear that pose the most direct threat to fossil industry profits. Given current prices and dropping costs/watt of solar and wind, those sources are going to extinguish a lot of fossil competition in a relatively short period through exponential increase in deployment - and delaying an exponential “knee” can mean years of additional profit. Whereas right now there’s really no path to a massive nuclear rollout, and the costs don’t compete with fossil sources even if we decided to push harder.
You can hide the app (no badge, no dot visible) and snooze notifications, but leave them on system-wide, and then if someone mentions you with something important, they can click the "yes this is important" confirmation link. (And if someone abuses that then you can mute them personally)
The HAWT War or the War against Human Anthropogenic Warming Trends.

You have to spruce it up a bit for the bureaucrats.
Lightweight syntax is a pain to use for blind people. Glad OCaml hasn't fallen for that fad.
It seems like it would be easy enough to train the model to improve performance too once you have it writing correct code. Write N problems and N performance test suites - then train by self-play on those problems until you're writing high performance code.
I’ve haven’t seen those reports and a quick Google didn’t return them either. Would love a link.
Let's say that I have an encyclopedia of philosophical arguments, with an index and table of contents. Let's suppose I have a philosophical question, and I get the book, use the table of contents to find a relevant article, read the article, and am impressed by the reasoning.

Do I decide that the paper the book is printed on has good reasoning? That the table of contents does? Or that the author does?

What you linked is a regurgitation of a digest of the reasoning of others. It's not reasoning. (Of course, you could argue the same about much of human "reasoning", too...)
You presumably know that you, yourself, posess qualia based on your own experiences. I certainly do. But there's no way to know that other humans do, at least not via empirical or scientific means. It's a safe assumption that since you have qualia that most/all other humans do, but it's entirely possible that you're the only one and I'm some Chinese room style simulation of qualia (or vice versa).
Good point, that. Funny how free speech is said to matter so much now because that some liberals have been treated like they treated masses of conservatives.
seems like a promising project!
I'll definitely give this a spin, however, I landed on the page and I wasn't immediately sure about what i had in front of me, same goes for the github page.

If this is a software meant for developing with powerful collaboration tools, where is even just one screenshot of what it looks like?
I don't want to sound like a tiktok kid that only cares about form over function, but there's absolutely nothing visual ( or written for that matter ) to illustrate this project.

Do I really have to pull the image, execute it and find out about the looks, features, and how to configure it?
No introductory video? No Docs? Heck, not even a screenshot of the main page
This is notably one of the locations mentioned in Kraftwerk's "Radioactivität" lyrics.
Every known picture of Thomas Pynchon
Ubuntu desktop is anything but stable. Nuke-and-pave is the only sane solution to the OS corruption issues. The GUI is more stripped down than a holocaust victim. They still haven't figured out drag and drop. And on top of that, everyone swears such-and-such distribution is actually the good one, but it never is. The desktop is in permanent demo mode. A back-burner school project that turned into a part-time hobby.

Maybe you just use it for web browsing. But for everyone else, there's Windows. Which is still crap but at least you can set an environment variable without doing a research project into the differences between .bash_profile, .bashrc, .profile, and /etc/environment. None of which have a GUI. And the best part is that none of them can ever be renamed because muh scripts would break and the entire OS would come crashing down.
If your job is to write code to specification (basically fill out the functions as instructed), then yes, you may need to be worried.

However, I've never seen a person doing that. The largest part of a dev job is not figuring out what to write, but how to structure the codebase so it doesn't become a nightmare really quickly. I, for one, would appreciate any help writing more code quicker because it would let me spend more time figuring out and fixing architectural problems.

I recently had to jump into a new project without my usual IDE setup of code navigation, interactive debugger, and code analysis and my productivity dropped by 90%. Needless to say, I invested the time to get it working again. When I started working professionally, most codebases were a few thousand lines of code. Now I frequently run into repos with several hundred thousand lines of code. These are sheer impossible to navigate without IDE help.

So no, I don't think AI is going to take the job of anybody I know, it will just make our jobs more efficient and enable us to manage working on even more compex codebases. My advice? Learn how to use an IDE really well.
Funny, this is exactly to the point how I have it. Unfortunately I haven't found a way to remove animations on OSX, but works well regardless.
I found it useful to keep a text file with organizational and personal goals and to record my accomplishments each day. It helped a ton when review time rolled around, but it also helped me keep in mind if my actions were best serving the organization’s goals.

Prior to that, in ignorance, I thought my productivity and contributions would be self-evident. That is not a great strategy for someone who isn’t inclined to self-promotion.
My understanding is that the shark fin trade is threatening extinction but I could be wrong
You could argue the profit is made where the money is earned. No CDN, no streaming; No content, no streaming, etc. How much would Netflix pay a (probably US based) CDN company to do what they do inhouse... that should probably still go to the CDN team, etc.
Profiling Context Switches on Windows with ETW
BorgWarehouse – My new free software
It's not very complicated. Wealth has a tendency to accumulated, it's very addictive.

And now that we have reclassified usury as productive it has got even worse. We not only count it as productive but often give preferential tax treatment.

Our tax systems have become a perverse inversion where we tax the poor to enrich monopoly cartels.
A simple tip to reduce usage. I would guess that a lot of smartphone usage happens within your home, which most people spent a lot of time in, even more so if you work from home.

Put the phone in the next room. As simple as that. Break the convenience of having it with you. Working in a home office? Put it in the next room. Watching TV on the couch? Put it in the next room. Driving? Don't mount it.

You'll still check it, during natural progressions of the day. Lunch. End of the work day. Before you go to bed. But that's still quite a lot better than the 100-200 times that people check it per day on average.
At the current rate he's burning through his Tesla stock: quite soon. Another 3.5 B$ worth this week and that's the second batch in a very short time.
Slack is great in small doses, but a complete time-waster beyond a certain threshold. I don't have ADHD, but I still have had problems with Slack. Don't feel bad about shutting all notifications off, or, better yet, closing the app entirely, and only opening it once or twice a day. You will almost instantly feel better. Some people may get annoyed that you're not instantly available, but if you're not able to get your work done then many more people will get annoyed. There is no perfect solution.
How do you manage virtual desktops on windows? I used to but found it annoying to maintain which windows go where, when restarting would always reset the settings
Ask HN: Where can I learn AI?
I am currently a CS student at University, I have been contemplating going into the realm of AI but I do not trust the recommendations of the internet. Where can I find reliable information or courses that will allow me to take the next step in AI development and use?
I live in NYC, and about 50% of energy coming to my apartment comes from nuclear and hydro sources, according to the energy company.

But NYC has a few gas-fired peaker plants, and during summer they are fired at the hottest time of the day, when AC load soars.

More solar power would certainly help this specific problem. I suppose that somewhere farther from ocean, where day and night temperatures vary more, a solar plant should have an even bigger effect in the summer.

(In the winter though the picture changes.)
Zero to three are critical years for child development. The brain grows to 80% of its adult size by then.

What happens doing those years has outsized effects on the child the rest of their life.

So yes, I won't be able to shield her from screens forever. But I can still do my best to set her up for success and prevent her from being a screen junkie.
It’s been a while since I set OSX up but there are Super User threads about it. I end up searching each time for the latest methods because I haven’t been able to get it quite as instant as Win/Linux but close enough.

https://superuser.com/questions/35144/speed-up-osx-spaces-by...
I think of them as a new type of database with remarkable query and data manipulation capabilities. They can’t produce things that go fundamentally outside their training data set.
I think what isn’t said a lot is how to make better behaviors more attractive - playing with friends, tackling on projects, pursuing professional carriers and making positive impacts to the world - than indulgence in slot machines.

One of quality differences that separate good social behaviors and addictions is that the latter is boring. I personally couldn’t get hooked with TikTok, not for fears of addiction but because it wasn’t much rewarding to me. If someone is stuck repeating actions lacking in diversity or generally boring things, even if it seemed stimulating on surface, maybe there could be some other reasons than that the machine’s just too toxic.

This isn’t to say that parents “failing” to save kids have to feel any sense of guilt or responsibility - addictions are real - but it does seem to me that a lot of internet addicted self-taught flamewars expert people (bad bad thing) have episodes with picky, overly interfering, in-satisfiable, jealousy, or sometimes downright insane parents.

Maybe that plays a role in addiction, maybe having happy and stable parents help in kids growing better.

(I wish I couldn’t recall my then-parent-ish holding chef’s knife at 5 years old me with the door to my back)
> single letter variables

i hate when people put descriptive names on variables that dont need it. when im tired i end up reading the name over and over as if it has meaning (it doesnt), and subconsciously ponder the meaning for up to a minute before snapping out of it.

they actually dont even serve a purpose. its because we are reading code in text form that they are needed. conceptually, most variables are just something flowing out of one function to the next which would be easily repesented by lines in a diagram or many other ways that dont use names. you're meant to only give names to the rare case where it would truly make the code more understandable. this shit doesnt: thingManagerProxyGenerator = createThingManagerProxyGenerator()
Maybe we also operate as a large lookup table for pattern matching (with some initial weights set by our evolutionary history). We have no grounding in truth either (and often confidently "reason" incorrectly).

I’m not so sure there’s a major missing piece here beyond some sort of continually running “default mode network”.
Wow that's a lot of water... something that doesn't get mentioned in the article - what's the temperature of the waste water, and where is it going? Because, for example, if you are putting that water back into streams and the river at a higher temp, that's going to impact aquatic life...definitely the kind of use of public resources that needs to be fully disclosed to the public.

Would be interesting to understand if Facebook is using similar amounts of water over in Prineville (not really all that far from The Dalles...), especially given reports that central Oregon water districts are having issues with their wells...
i'll repost here the twitter worker who does nothing at work and i suppose now has been fired: https://www.theblaze.com/news/twitter-day-in-life-video

forgive the link, i guess the original tiktok was deleted.
Wouldn't they also have been patched long ago?
I was actually thinking the opposite, which also might be wrong, that most sharks are dying because of overfishing in general and climate change.

edit: not to say that this isn’t a good thing, we just need a lot more if we want to save the sharks
I was vaguely aware one could get Windows to tell you when it performs context switches, so I decided to ask it for that information.

This is my story.

If anyone reads this and knows of a better way of doing what I did, I'd love to hear about it!
Some want education. Some want entertainment. Some want some wrapped in some.

Sometimes.
Beneficial effects of Nicotine relating to Parkinson's
This question kind of shocks me. We do allow, very limited, screen-time but the concept of having no idea what to do with the kids without a screen is jarring to say the least.
It feels like we're getting back to that with focus states in iOS and Android, but half my apps still don't tell the API who sent the message and just set the notification title... (and some do but they don't link it to the contact, so the anti-DND rule never goes off)