skysight-inc/HackerNews huggingface dataset:
import openai
import os

openai.api_key = os.environ.get('OPENAI_API_KEY')

def completion(messages):
response = openai.ChatCompletion.create(
model = gpt_model, temperature = 0, messages = messages )
return response['choices'][0]['message']['content'].strip()

response = completion([
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Who won the world series in 2020?"} ])

#####

import json
import tiktoken
import os

tokenizer = tiktoken.get_encoding("cl100k_base")

class Message:
def __init__(self, role, text, length=None):
self.role = role
self.text = text
if length != None:
self.length = length
else:
self.length = self._count_tokens(text)
print("New message, token length is",self.length)

def _count_tokens(self, text):
tokens = tokenizer.encode(text)
return len(tokens)

class History:
def __init__(self, ID=None):
self.messages = []
self.ID = ID

if self.ID:
self._load_from_json()

def add(self, role, text):
message = Message(role, text)
self.messages.append(message)
self._save_to_json()

def _save_to_json(self):
if not self.ID:
return

data = {
"messages": [{"role": m.role, "text": m.text, "length": m.length} for m in self.messages]
}
self.create_dir_if_not_exists('conversations')

with open(f"conversations/{self.ID}.json", "w") as f:
json.dump(data, f)

def create_dir_if_not_exists(self, directory_path):
if not os.path.exists(directory_path):
os.makedirs(directory_path)

def _load_from_json(self):
try:
self.create_dir_if_not_exists('conversations')
with open(f"conversations/{self.ID}.json", "r") as f:
data = json.load(f)
self.messages = [Message(m["role"], m["text"]) for m in data["messages"]]
except FileNotFoundError:
pass

def recent_messages(self, max_tokens):
recent_messages_reversed = []
total_tokens = 0

for m in reversed(self.messages):
if total_tokens + m.length <= max_tokens:
recent_messages_reversed.append({
"role": m.role,
"content": m.text
})
total_tokens += m.length
else:
break

recent_messages = recent_messages_reversed[::-1]

return recent_messages
DJB: Cryptographic Competitions [pdf]
>Australia has some extremely strict filtering requirements

That's in line with all the horrible complaints I've heard about Australian internet.

>How does one get to an SRE at Spotify, out of interest?

noc@ email addresses are often unpublished, but silently open a ticket assigned to a network engineer. If they have any sense, they'll ignore your request for a list of IP addresses.
A single youtube video has a couple of available video, audio and combined streams. It might be your browser picks a different stream to what youtube-dl (or its fork) takes by default.

I'm not sure what the defaults currently are for youtube-dl and its forks, but for a long time it defaulted to the best combined stream. However the best distinct audio and video streams are higher quality.
I've found this to be true, in my case.

I did this series[0], as I was learning Swift. It helped a lot.

[0] https://littlegreenviper.com/series/swiftwater/
Yeah.. this combined with the fact that this benchmark happens to rank their cloud offering the highest by a wide margin sounds a bit like they are submitting it to market themselves.
How do theyvdeal with bad actors and data integrity? Is it TOFU and then rely on signing?
Good for Dart-developers I guess. But who on earth is bothering with Dart in 2023?
The model is usually called the Fellegi Sunter model, but once you get into the maths, it's actually the same as Naïve Bayes. If you're interested I've got a blog post that explains this here:
https://www.robinlinacre.com/maths_of_fellegi_sunter/
What do you think about evolving the stored procedures into a stateless GRPC service that fronts the database? For the price of 1 (or 2) additional network hop, you get much better devx, while keeping most of the benefits provided by stored procedures.
Yes, obviously, but also the power is a big advantage of the SSDs, and this claim is pretty interesting if/when true, usually the HDD consumption is 4/5x a SSD.
That $1.2 mil figure wasn’t any of those cities, nor was it from SF. You seem to be detached from reality.

And btw, I spent a large portion of my life living out of a rack on a warship so don’t talk to me about compromise kiddo.
They set themselves up for success no matter what (take credit for hard arbitrary deadline being successful or blame whoever can't meet it), which clearly leads them to be in those leadership positions.

It's very common.
Generally these, say, too "proactive" moves to artificially gain attention to your own GitHub projects makes me less likely to test it out, so I'd rather stay with the mainstream options.
Love this article. So many great points that I deeply agree with but have never really put into words, and all written in such an engaging style.
AST vs. Bytecode: Interpreters in the Age of Meta-Compilation [pdf]
In my experience in non-SWE related enterprise this isn't really an issue. To put it as bluntly as possible, most EU organisations don't have enough work to staff an team for their IT operations. Maybe you could have one or two people on staff, but that is realistically too few people to run reliable operations, even in Azure or AWS. So what happens is that we outsource all the parts that aren't directly related to development or IT support and operations to 3rd party companies.

Most of those 3rd party companies will happily sell you managed database service that are run on Hetzner. So this part of it is sort of a non-issue for a lot of organisations if the cost are low enough.

Heck, even if you have your own inhouse operations department going for you, why wouldn't you be able to run your own stuff on Hetzner? That's what people did in the transition from having your iron in the basement and buying it from Microsoft/Amazon. The only reason we left the "own cloud" options was cost, and if Azure exceeds the alternative. Or the EU makes it too cumbersome to use Azure, then there won't be much of a reason to stay.
Matt Mahoney’s table has been updated for NNCP:

https://news.ycombinator.com/item?id=6001489

Note that the numerator is decompressed size plus decompressor.
This is why I don't blog, and instead take notes that are publicly accessible. They're for me to refer to, but others may find them useful and I may want to share examples with my coworkers and friends, so I make them public.

EG: https://danielhoherd.com/tech-notes/exiftool/
interesting project, for fun yes, but it seems it's based on an outdated assumption that 'thoughts are determined by language' [1] a sort of buy-one-get-one free.

However, human languages haven't been widely adopted with much success when designed/created top-down. Even more advanced and well developed languages such as Esperanto, haven't take off, though more widely adopted.

Personally I agree with Prof Steven Pinker, that Language is an Instinct, and that it evolves in communities, in stages, such as 'pidgin -> creole -> first/native language', most importantly developed & fortified by children.

The human brain has capacity for storing, processing and remembering tens of thousands of words, example [2]:

- 13K words for an average 3-year-old

- 60K words on average by the time they graduate from high-school

- a 3-year-old is likely to remember a new word casually mentioned in a conversation for up to 5 weeks

you may save in storage at the expense of processing, orchestrating, learning, and rather crucially accessibility. Except for fun, it's kinda pointless otherwise.

[1] Sapir-Whorf hypothesis of linguistic determinism "that people's thoughts are determined by the categories made avail-
able by their language, and its weaker version, linguistic relativity,
stating that differences among languages cause differences in the
thoughts of their speakers".

[2] Language Instinct, Steven Pinker
Sooner or later, youtube will do the same thing as twitch, which is to dynamically splice ads into the video stream - making it impossible to block with current mechanisms.

They don't do it yet, probably because they don't see the need quite yet. But i have no doubts that it will happen sooner or later.

Adblocking will have to evolve to a new level to block such things.
> You're lying. Canada acted on a US-warrant ( not an arbitrary law) and her "jail" ( the CFO of Huawei) was in a luxury mansion.

This is criminal, arbitrary and clearly political.
I disagree. Without the pressure and scrutiny of publishing, you won't scrutinize your own ideas. Others won't scrutinize your ideas and give you feedback.
I feel this, sort of. I taught myself how to code by writing a Python bot (among other things), and eventually needed some sort of database handling to make things work. I decided on teaching myself basic SQLite, and just did it raw with `sqlite3`.

Currently 50% of my anxiety when it comes to my bot is related to database matters. There's no type checking so I gotta be careful when writing them, and stuff might blow up weirdly at runtime. Refactoring tables is also a major pain, or at least was until I (sort of) figured out a 'routine' of how to do it.

It's doable, and I assume that teaching myself some basic SQL and using it in production was a great learning experience, but once I'd reached the point where I was inventing database migration tooling from first principles and considering how to implement that, I realized that I probably just want to look at SQLAlchemy again.
1) How much per user?

2) Is this a fine that compensates users for the damage caused?

3) Will this fine make apple do better next time?
Apple Planning 'Apple Watch X' Redesign to Introduce New Band System and More
Advertisement?

Thought this insightful:

4) What are the benefits of building a fitness app?

Building a fitness app includes many benefits; here are those:

# Large Audience Reach
# Staggering Revenue Through In-app Purchases and Advertisements
# A Unique Brand To Grow and Stay Ahead

How about ehm... helping to improve users' fitness? (and in turn, their lives). But no, that isn't even mentioned (sigh).

Sign of the times:

Products aren't developed because it'll improve users' lives. But in order to sell something (product or associated).

Yeah there's overlap. But often those goals conflict. Which does provide a nice yardstick:

Whenever I encounter a product, have a closer look at its design, and about possible reasons for a design decision, it falls apart in 2 categories:

Design choice was likely done to make product cheaper, easier to produce, increase profit margin, user-hostile feature that mostly benefits vendor, etc. Often this is obvious. -> Okay! I'm done. Next! Or:

Design choice was likely done to make product more durable, easier to use, fix a weakness, reduce user annoyance, etc. -> Now you've got my attention.

Again: there's overlap. But more often than not, products tend to fall in 1st category (like that fitness app, or its developer advertised here).

The really 'good stuff' is becoming rare. Treasure it when encountered.
>> In an ideal world, the major stakeholders of the Linux desktop – KDE, GNOME, the various major distributions – would get together and seriously consider a plan of action. The best possible solution, in my view, would be to fork one of the major browser engines (or pick one and significantly invest in it), and modify this engine and tailor it specifically for the Linux desktop.

> Is it really the best solution to create a fork?

This is funny considering that WebKit was originally a fork of KHTML.
Good luck to you. Coup d'etat isn't something everyone can say that they participated in. This will either work out well and you'll be high-fiving the remaining team—or you're all getting fired. Simple as.

FWIW, I've worked at places (plural) like the one you've described. In my experience, "reading the writing on the wall" and focusing on my resume and marketability (in preparation for leaving) was "the move". I burnt no bridges, even when I really wanted to.
--DELETED--

I said suggested you could pattern match on keyword lists with guards but that isn't true—I should not respond to things first thing in the morning.
I would be inclined to agree if the author had enabled comments.
I did. Have you? Because you're breaking the guidelines.

Please don't post insinuations about astroturfing, shilling, brigading, foreign agents, and the like. It degrades discussion and is usually mistaken. If you're worried about abuse, email hn@ycombinator.com and we'll look at the data.

Please don't complain that a submission is inappropriate. If a story is spam or off-topic, flag it. Don't feed egregious comments by replying; flag them instead. If you flag, please don't also comment that you did.

Judging from your comments, you clearly have a political opinion and you push for it often. Doesn't that behavior break the guidelines as well?

Please don't use Hacker News for political or ideological battle. That tramples curiosity.
Back in the day they were millions of VB/VBA developers. Look what kind of quality you had. Exactly.
Any time you see "atomic", you can make a queue.

A practical application of atomic mv is building simple file based queuing mechanisms.

For example I wrote this SMTP buffer server which moves things to different directories as a simple form of message queue.

https://github.com/bootrino/arniesmtpbufferserver

It's pretty simple - ~100 lines of Python without comments etc.

https://raw.githubusercontent.com/bootrino/arniesmtpbufferse...

Caveat I think this needs examination from the perspective of fsync - i.e. I suspect the code should be fsyncing at certain points but not sure.

I also wrote (in Rust) a simple file based message queue using atomic mv. It instantly maxed out the SSD performance at about 30,000 messages/second.
At least you are expressing something about your discontent - so thank you for giving me the opportunity to respond.

Perhaps its random speculation to you, but I cannot read what was written on burnt paper. I don't think the idea that some software/hardware fix can or ever could read what was written on burnt paper is viable.

However, I'm not just criticising the purported facts. I'm also offering a suggestion whereby I can be shown to be wrong, as I suggest a verifiable way to prove this idea works. I'm saying that you should surely test this system out on something that you can prove works, before rolling the idea out onto actual historical artefacts and adding to the ancient works on the bookshelf.

I just don't see what's objectionable to what I'm saying - it seems entirely based in common sense. However, I think it upsets people, as it snaps them out of a 'merry daydream' they have about how wonderful technology is.
There are plenty of advantages of using a dataclass, being the most obvious the fact that behaves like a pure data object (aka it doesn't have underlying associated resources). Serialization/deserialization of data is dead simple, and a dataclass is a construct you can use as a data object when building 3-tier applications. Having pure data objects also gives way more flexibility when implementing cache strategies.

While this separation isn't common in the Django ecosystem, it is very common in enterprise application design (regardless of usage of an ORM). On complex applications, Django models are often a leaky abstraction (not only because the mentioned resource connection problem, but also issues like for relations they require the inclusion of the target model, it cannot be lazy-loaded; a good example is a nullable foreign key to an optional module that may or may not be loaded), and they actually behave like a variation of the ActiveRecord pattern, that mixes two different scopes - data and operation on data. In many cases this is ok, but in many others this is a problem.

I personally use a repository pattern, coupled with a query builder and something vaguely similar to dataclasses (its a bit more complex in the sense that the data object attribute name can be different from the database field name). It is basically an object mapper with a non-related repository class.
Not just English speaking countries: housing affordability is low in most European and developed-Asian countries.
Humans often like to compare the brain to technology.

For example, when gears were high tech there were people that drew heads with gears turning inside of the head, likening the act of thinking to the motion of gears. And I think in cartoons etc we still see this sometimes.

:D
> None of the other options are significantly easier to hit.

Can you point to data supporting that claim?

I would think a simple model for throwing is:

- get the left-right direction right

- get the throwing angle/speed combo right

and do not rule out that some players are better at one of those than at the other, showing smaller variation. If so, those players would be better at hitting the (almost) vertical triples than the (almost) horizontal ones or vice versa.

I guess I would want to know the point-spread function (https://en.wikipedia.org/wiki/Point_spread_function) per player.

If you know that, you could devise an optimal strategy, weighing the number of points each target is worth (even if you can hit triple-10 with 100% precision, it most of the time isn’t a good idea to aim for it) and situation of the game (you’re maximizing the probability of winning, not the winning margin, so if you’re far, far ahead, that triple-10 may become enticing)
An illusion of predictability in scientific results
The difference is that a very natural and common reaction by some in positions of power is to blame down the hierarchy.

That's the "evil" part. The unethical "I'll save myself" if things wrong and having extra power to sell that narrative due to hierarchy.

You may be trying to do your best but saying nearly every case is pretty false for anyone who has observed the power dynamics for a long time. Hey, the same happens with developers. Depending on the org, your best for the team and your best for the career rarely meet and it's harder to have them meet as a manager.
Your alternative hypothesis is itself conservatism. Blocking change is to support the endurance of the status quo. They may not think it is by their ideals, but do it enough times and the actions speak.
Do you gave a link to the suggestion? (If it's public)
Also relevant: “How an Algorithm Feels from Inside” (2008)

https://www.lesswrong.com/posts/yA4gF5KrboK2m2Xu7/how-an-alg...
Yes, I think I used to check if `$cmd` was in a space separated list of valid commands, but I don't anymore because I only every use this to quickly get some commands down into a project's directory so as not to forget them.

As soon as any complexity or validation is needed I move to python, which is usually a better fit, and arguably even more portable.
No one is claiming that Coke’s revenue and Madagascar GDP are perfectly correlated. The claim was that the cessation of all vanilla buying from Coke caused a demand shock that harmed the economy in Madagascar. The data does not disqualify that possibility.

Also consider another thing: the revenue of Coke was multiple times that of the GDP of the entire country of Madagascar. Is it really surprising that this demand shock could occur?
Maybe it would be more interesting to consider - if Flutter was built in Go, would Dart have a reason to exist? It seems that aside from Flutter Go is a superset of Dart in terms of library and board community support / usage.
Seems a little dismissive. I think it’s a pretty interesting result from a theoretical point of view, and might be applied in some situations where you break a harder optimization problem into smaller problems with certain likely shapes of the piece wise problem. Regardless it’s not at all intuitive this pattern should have any optimality in any gradient descent space, so understanding it might yield some more fundamental concepts around more general optimization problems.
We literally had Trump say of Clinton “I’m not sure what can be done about her, maybe some of you Second Amendment folk can do something”…

And it worked very well, because precisely nothing happened.
Unfortunately a lot of companies don’t use anything made outside of Silicon Valley because “it sucks”, so hopefully that changes.
The fact that you need to learn a niche language like dart just to make stuff in flutter seems to me like technical baggage I could do without.
ARTful: A New Horizon in Android Runtime Manipulation
Nice project. In evaluating this for possible use, I have a question about workflow integration with snapshots. On gentoo-esque distros I believe there are two common configurations with ZFS, namely: (1) have a separate package repo (portage tree) ZFS dataset to the system root ZFS dataset and (2) to have them combined on one dataset.

In case 2 portage changes are automatically synchronized to system snapshots, but multiple system instances (VMs, diskless nodes, etc.) will have to redundantly update portage. However, in case 1 they are de-facto desynced and this can cause gentoo issues (yet saves duplicate network operations so is nominally desirable). Does ZFSBootMenu have a built-in system for managing ZFS root system snapshots with co-dependent dataset snapshot versions to enable case 1?
I record a field in my password manager named "MFA". In this field, I record the details of how this account uses MFA. I also have a field named "MFA backup" where I record something like paper backup codes, and when I last printed them out.

I also have a password manager entry for each security key, where I record its S/N if possible (the cut-rate Yubico key doesn't have one!) date of purchase and things like that. I try to make uniform names for them. So far, they're all different models anyway, so I differentiate them the same way I differentiate USB thumb drives, or sdcards.

Pretty much anything pertaining to an account, I record it in my password manager. If I purchase a new device, I record its specs, S/N, P/N in the password manager. Everything goes in there.
> It's wrong because the concepts of invention and scientific discovery are entirely different from political action.

We must also draw a distinction between invention/discovery and mass use. I'd like to point at nuclear energy - it seems unlikely that invention or scientific discovery in the field have been slowed down, but mass adoption of the technology was shut down by anti-nuclear activists. Environmentalists had at least a good ten year stretch where nuclear was all but unacknowledged as a good-to-go solution to all the problems being bought up. Even now there is a pretty good chance that with some political cover for the capital investment required it is a better choice for powering a country.

It is actually easy to imagine one motivated, charismatic person in the right place and right time completely changing the practical landscape without any change to the pace of scientific advancement.
Same here. I call it mkcd
We are talking about Star Trek here...

The bar isn't high.

Its sweet spot has always been good characters/acting + some veneer of plot.
I’ve recently come to find out that my wife has been signing documents using Snapchat for years and has evidently never once had a problem.
Then you were even more wrong. MariaDB wasn't just "a new name" for MySQL.
>Things they usually aren't very good at are when you start trying to do things that require a lot of optimization

I find this ends up being, like, 1 or 2% of queries. It's also very hard if not impossible to guess which queries will end up in that group.

You're better off building it with the ORM first and breaking out SQL later when you are trying to performance optimize.

There is also a small % of queries which use some feature of your database engine which the ORM won't support.
I apologize for the repeated posts. The reason I posted it 6 times is that I aim to announce every release and significant commit. The reason my entire history is centered around this benchmark is because I wanted to introduce my project to the community, potentially with some bias. I began my Hacker News journey at that time and wanted to share what I was working on.
Huh? Salaries in tech are lower in south europe than in east europe. Assuming there are any tech jobs in south europe.