skysight-inc/HackerNews huggingface dataset:
Would switching all classes to the data class style mean losing the ability to differentiate between class variables and object variables?

I'm going to go try it in a minute, but I'm specifically thinking of setting a mutable variable to use as a way to cache the results of a long running process across objects. Or even just any variable to use with class methods. I'll update soon

edit:

I tried it out and it looks like it works just fine

@dataclass
class MyCoolDataClass:
arg: any
_things = {'last_updated':0, 'data':[]}
_things_timeout = 300

def _update_things(self):
"""some long process"""
time.sleep(10)
self._things['last_updated'] = time.time()
self._things['data'] = ['some things']
@property
def things(self):
seconds_since = time.time() - self._things.get('last_updated', 0)
if seconds_since >= self._things_timeout:
self._update_things()
return self._things.get('data',[])

which then works as expected, sharing the cache between objects.

start_time = time.time()
for i in range(10):
obj = MyCoolDataClass(i)
print(obj.things, int(time.time() - start_time))

['some things'] 10
['some things'] 10
...

So yeah, I think I might be on board with dataclasses by default. As long as we can still add __init__ for when we want to do something extra with the variable

edit2:

If we switch to dataclasses things like this would need to raise a syntax error:

@dataclass
class MyOtherDataClass:
arg: any
def __init__(self, special_arg:str):
self.special_arg = special_arg.lower().strip()

As it stands now defining __init__ completely removes any definitions set in the class.

I think the killer feature would be if we added django forms style validate methods for validation and normalization. imagine if we could do this:

class Drink:
temp: str
container: str

def _validate_temp(self, temp):
temp = temp.strip().lower()
if temp not in ['hot', 'cold', 'room']:
raise ValidationError(f'"{temp}" is not a valid temperature')
return temp

def _validate_container(self, container):
container = temp.strip().lower()
if container not in ['mug', 'glass' 'sippy cup']:
raise ValidationError(f'"{container} is not a valid container")
return container

def _validate(self, kwargs):
if kwargs['temp'] == 'cold' and kwargs['container'] == 'mug':
raise ValidationError("Don't dirty a mug for a cold drink!")

Sure, it goes against explicit is better than implicit, but that could be fixed with decorators. It would also be nice to have a concise way to say what values are valid, and a handful of standard normalization processes, but I think you get the idea.
A Rising Awareness That Balloons Are Everywhere in Our Skies
It wasn't a SWAT team. The politician is minister of interior of the state and thus head of the police. He formally filed a police report about an insult, that is indeed available to anybody. Still a local scandal, his name is now associated with being a penis. IMHO unrelated to the BBC documentary (freedom of press vs freedom to insult somebody on social media).
> Nothing can exist without causality as we know it, i.e. a thing happens which is the cause of another thing that happens.

Not only is this not true of all conceivable worlds, it's not even true for the most commonly accepted explanation of physics. In the Copenhagen Interpretation of quantum mechanics, the value that will be observed in an experiment has no cause - it is random in some range. For example, if we detect an electron passing through the left slit of a double slit apparatus, there is no cause for why it passed through the left slit and not the right one (in the CI of QM).
A SDK to add iOS Pose Estimation with pre-built fitness and health classifiers
I doubt it.

A) Sunak can't just "pull the BBC into line" as it's independent of the government.

B) The BBC regularly criticises the UK government and even the Royal family. If it could get a scoop on some new corruption it would air it as soon as it could.

C) We also have people like Led By Donkeys here who air as much dirt as they can on the government. (We are not short of scandals right now, although few involve genocide).

https://www.ledbydonkeys.org/
Right, and this also includes CB radio.
I'm not particularly fond of regular 1:1 meetings, my manager had one each week, and I thought it bordered on micromanagement. Much preferring to bring up my concerns / problems as they arise, and be otherwise left alone as much as possible.
>> The block $insert_country IP range "solution" is an outdated mentality that should have died off in the 90's.

Maybe so. But it works really well. After blocking certain countries IP ranges / ASes, >70% of abuse we had to deal with just vanished.

Also there are other reasons to block: since the russians attacked Ukraine, business I work with no longer does business with russia, belarusia and few other countries as a matter of principle (and because of sanctions).
this link doesn't go anywhere.
> “They tend to always produce negative pieces about…” is quite an unevidenced statement.

There are whole books of evidence for that

https://www.medialens.org/2017/preferred-conclusions-the-bbc...

> what’s the game plan here if, as your comment seems to posit, there could be (or could be seen to be) an ulterior motive. UK has left EU. Wants trade partners. Not going as well with India as it could. So make documentary to make it go worse?

There are multiple competing interests at play. Ultimately, improving relationship with India (at the expense of burying what I presume is a legitimate criticism and investigation on BJP) is just not worth as much as the alternative.
Sun, sea, and startups: València’s tech sector is poised to explode
Doesn't surprise me at all.

We used to have various domains at Hover too, but due to their incompetence we migrated all of our domains elsewhere (a few months ago).

Their incompetence:

1. [fairly minor] Something technical (!) is wrong with their logged-in customer portal, such that I could never properly access their Knowledge Base once logged in (various error messages). But working completely fine when logged out. Filed a support ticket about this 2 or 3 times, but it was always closed with something along the lines of "works for me".

2. [show stopper] We were having a problem with one of our domains, and it was getting close to expiry (a few weeks away). Attempting to contact their support about it (via email) a few times over a few days, and ... no response apart from "we got your ticket" type of thing (from rough memory).

Then tried via their "live chat", which never had anyone pick up.

So, made the decision to transfer all of our important domains away from Hover, as "zero response" isn't acceptable for important domains having issues.

About a month later (well after the original domain expiry period), their support finally responded with something along the lines of "sorry for the delay, we were super busy. What seems to be the problem?".

At which point migrating the rest of our domains (even unimportant ones) away from them was decided upon, then done.

It's a shame, as they used to be good (some years ago). My impression is they started out ok (with clueful staff/processes/etc), but went through some sort of cost-cutting/minimisation period after a while, during which their good staff left.

Thus, crap like this. :(
Thanks to everyone involved for your work! I'm looking forward to the completion of C++23.
Do you really want to support your thesis with article from 2012?
Not sure if you sub-licensing something to yourself would work out? But I am sure it's just as easy for a company to spin up two shells to play this games.
No, they wouldn't
> This was discussed thoroughly when the incident happened

Ah yeah, right, I guess that's also when investigation was finished within hours since the sabotage happened.

For US it's distraction from Ohio toxic air as bonus. What I would be more affraid - non-existent UFO on par with Iraqi WMD or toxic air? That's tough one...
This Modi?

"Prime Minister Narendra Modi on Thursday hailed Infosys and Sudha Murthy, chairperson of Infosys Foundation, as he expressed gratitude to them for their service to humanity."
Isn't it possible to create (compile) a shared library from Python code? Then it wouldn't be source-open.
Not sure why the offices have been raided, corruption in Indian offices are not new, just because they are the BBC does not make its staff immune.

The show itself adds nothing new in real evidence that can be taken to court, however there is a serious risk it create communal disharmony. Muslims and Hindus have found peace since the event, Indians see it as stirring the pot just before the 2024 elections.
> I don't think the lack of social media reports is that telling.

Actually, I find it shocking that almost ten seconds of free fall plus many passengers being terrified to the point of screaming would go unmentioned on social media. That's not an experience you forget. :/
Most parts of the U.S. are not well designed for bikes or pedestrians, only cars. Also, many schools in the U.S. have really large districts, so some students live really far from the school.

In many places this would mean children would be required to bike on 55mph+ 5-lane roads with no shoulder and no bike lane for 5-20+ miles.

Nearly all public schools in the U.S. provide a free bus system for all students for this reason.
Related The Guardian article https://news.ycombinator.com/item?id=34787782
Because it could create communal disharmony and doesn't actually provide any further court admissible evidence.
Bert Hubert gives a two part explanation of what is going on in [1]

[1]: https://berthub.eu/articles/posts/galileos-authentication-al...
Maybe I didn't have enough coffee, but what's really the point of "data" keyword?
Seems like its only goal is to confuse.
So you write that data thingy and later figure out you actually need a class, then what?

What's the difference between data and class? Because of what it keeps?
So why not have "methods" for classes that only have methods or "notdecided" if you don't yet know what sort of class you are going to end up with.

I don't follow.
Looking at the structures, I don't see the similarity. Capsaicin is a vanilloid, chemically related to the flavor chemicals found in vanilla, not a methylxanthine.
Eh, its selling like hot cakes?
For people in the US: https://www.bhphotovideo.com/c/product/1703444-REG/korg_nts2...
That's nuts, great work!
The problem is not only Sharp, the BBC is widely known for being partisan

https://www.medialens.org/2019/the-arrogance-of-bbc-news/

Of course "most corrupt organization in the world" is hyperbole, and I wouldn't discount this specific investigation on BJP (but I have limited interest in that, since I haven't been to India in years)

But blaming others of whataboutism is harmful, since it stifles deserved criticism.

Especially because no one here is really defending the Indian government corruption (for now), so it's not even truly whataboutism.
I am an Indian and I personally know of few _more_ credible outlets than BBC. They take on their own government and monarchy. Unfortunately, many generations of WhatsApp fake news has convinced that anyone who is not of the "Mr. M is God" persuasion is basically anti-national, not patriotic, not credible. Gandhi and Jawaharlal Nehru are considered villains, and Gandhi's killer has been elevated to God status.

To your other comment though, given Rishi "our own son" Sunak and the jostling of power between China and the west, I'm not sure the relationship between the countries is going poorly.

All major Indian national media has been completely compromised and thugged into submission. There are brave alternate and small liberal media that still have the courage to cover them. Some links for your viewing pleasure.

Scroll.in: https://scroll.in/tag/Gujarat-Riots

Telegraph: https://www.telegraphindia.com/topic/gujarat-riots

The Wire: https://thewire.in/tag/2002-gujarat-riots

And for fact checking news, there is https://www.altnews.in
Not sure about time, but you can pass a custom allocator to Lua and stop execution if the program is allocating too much.
Say no to censorship. This includes the all idiots no matter if they fly woke or right wing banners.
The problem is that dictators and authoritarians, can not even imagine a independent press. Because the small people are not reall people. Just puppets, manipulated by large peoples and shadowy enemy figures.

The psycho-pathology reveals itself in public.
In most cases, they expect to see zero money from people who were tasked to "do a quick search for quotes" anyway, because they don't compete on price and someone who gets their junior to shortlist self service providers on the basis of the lowest cost and least effort to get a quote isn't remotely likely to be making a purchase strategic enough to consider their large up front setup fee for a custom trained model and months long integration process.
To Woke or Not to Woke, That Is the Question
Lawrence Krauss discusses whether using the emotionally charged term, Woke, is helpful when trying to make a point.
FreeBSD 13.2-BETA1 is Now Available
As a corporate decision maker, I wouldn't buy or license a library when there's only a single person behind it. What happens if that person suddenly stops working? Even if the source is available, the sole expert on that code is gone, so it's may be difficult to keep on going.

Just open sourcing it (under a liberal license) may invite freeloading and potentially forking. Regarding less liberal licensing, many companies will not even consider any (A)GPL code, so a restrictive license is likely not making your business more successful.

So what remains? If you can make a fantastic product that's way ahead of the market, the license and mode of delivery does not matter much, you can even keep it closed source as long as you provide the customers a continuity strategy (e.g. via a code escrow company that will open source it in case your company ceases to exist).

If your product isn't that much ahead of other components, open sourcing it may boost popularity but can not guarantee you customers or income.

Edit: typo, reworded second paragraph.
Can't help but feel there's some projection going...
Thanks to Herb and all the others who worked so hard on C++23. As someone who has made their living with C++ for 25 years now, I’m very grateful to all the people who keep making the language and my professional life better every 3 years.
It’s also a reason the application of dietetics can vary so much.

People will focus on their individual experience as a proxy for generalizing others way too much.

While there are some universal principles, extremes around eating both bad and eating healthy can be confused with eating simple or eating clean.

If someone has a cashew allergy, the practice of veganism can be life threatening where it’s used so much.

If you come from a certain area of the world, your genetics might be a little more used to benefiting from eating certain things than not, too. A negotiation for might be nice for me but for someone who’s being eating it well for a few generations..
Inside Flipkart, the Indian giant beating Amazon
On my machine teams regularly eats up several gigabytes of ram, even when not interacting with it at all.

I generally don't care about applications using a lot of ram, but this is just too much for a program which I mostly use for text messaging.
typically only things that you annotate end up instance variablses for dataclasses
…on the other hand it doesn't take a PhD to write a linked list in C++.
Duckdb excels at OLAP workloads that SQLite would choke on
Regarding the monetized thing: there's a special point with that. You can have all the passion in the world for a thing, but is your passion about how OTHER PEOPLE react to that? If so, monetizing can be your passion, but the way other people react to a thing is not that thing, it's a separate thing.

I know that in my line of work I can get passionate about plenty of ideas, but there's no real correlation between what keeps me going, and what clicks with a mass audience. One of the things that clicks with the mass audience is that I'm there seeking out really quirky, specialized things that might possibly result in something amazing.

In that sense the mass audience is more interested in me being passionate, than in every specific thing I'm being passionate about. Bit like a zoo. Watch the tiger code widgets! If the tiger codes an amazing, saleable widget, that's a real marketing story, but people will still be curious and watch even if the widgets don't suit them. If the tiger thinks every widget is gonna be a hit, he's going to burn out and quit in despair.
You missed out, then.
Whenever I run into 'Contact Sales', I translate that into 'We have hired unemployed used car salesmen. They assure us they can con you out of more money if they get a chance to talk to you.'

I realize it might not be a fair assessment, but it is always where my brain goes. And then I move on, to a competitor. I only contact sales if you are literally the ONLY one with what I need. But that is rare.
That is when they roughly know what they want, if they don't they hire an innovation consultant and organise competitions and grands for companies and universities to come up with work.
So you're saying we should CRISPR in some pigeon magnetic direction finding genes to the jumping beans so that they have more choice in their shade-finding strategy?
Video call with traditional healer? Once unthinkable, now common in South Africa
Brother, this is the norm at small to large companies. Maybe five person shops need to get things done, but once a company hits like 15-20 people, yeah... people get hired and stay hired because people like them, rarely because of their output.
Yup yup. Have had this happen countless times with Windows features updates. They always blow away the boot sector so Windows is the last one standing. Now I know better to install Windows on it's own seperate drive.
Even the article you posted admits they're relying on a technicality:

>in 2014 Cargill did buy a 5% share in UkrLandFarming, one of the largest landholders in Ukraine

>Despite the moratorium on private land transfers, more than two million hectares — or about 7,700 square miles — of land have ended up being controlled by foreign companies through leases, Mousseau said. The largest investors are companies from Cyprus, the U.S. and the Netherlands.
Yes. We technologists have made it far easier for them to crack down on dissent than ever before.
The trouble for me as a dumb programmer has been that "values" is really vague and squishy and I only know it as political dogwhistles.

The concrete examples above of valuing fancy math or design patterns over product quality helped clear it up.
https://blogs.loc.gov/law/2020/03/falqs-spreading-rumors-and...

Similar too? A law so squishy, it can target anyone and all things.
And those in the powerful positions feel that the solution is to be harder on the populace, censor them, be less transparent and blame them rather than, I don't know, being more honest and transparent themselves.

It's astounding how consistently they follow the same process. Ego is a powerful thing.
Aren't people who value fun and positivity over sincerity by definition shallow and fake?
> 1: The aircraft entered into free-fall (i.e. falling at ~9.81m/s) at a low altitude and recovered within 1425ft. This would mean the wings were fully stalled and there was no drag or lift forces on the airframe while it was falling.

It's not true that falling at 9.81m/s means no drag or lift forces were on the place, it could also mean the plane was pointing down and it was engine thrust was accelerating it downwards (not just gravity)
Ask HN: Is YouTube now just tube?
Go and search "turkey earthquake" on youtube. I had over 200 videos in a row of TV news channel video uploads. Its literally 100% TV shit. Not a single user-created video or even local footage uploaded. If I wanted to watch TV I'd buy a TV and turn it on.

Is Youtube just tube now?
did you or did you not write these sentences?

> Other than an appeal to their sense of morality (which only works if they happen to be a Stallman disciple)

> what's their incentive to use it? It's simply demanding more from those who are already giving.

I think you meant more than simply "why I choose not to license my own project as GPL"

you're actually bashing on GPL because you either

- are ignorant of what GPL license says

- have an agenda and/or are paid to spread FUD

- all of the above

If I want to be charitable I would say that the last hypothesis is that you are not aware of what you write.

EDIT:

you also rote

> Nobody is "afraid" of copyleft, that's a rhetorical device you're using to discredit those who disagree with you

Which is not true, a lot of businesses are afraid of copyleft, in fact at work not many people can publish their code under a copyleft license, because the mainstream mindset is that code is an asset and keeping it secret gives companies an advantage. Which clearly is not the case, because most of the code is simply a rewrite - usually bad - of something that already exists in the copyleft World. Everyone working in the field knows that. So it's a decision based on fear not on risk assessment. The company I work for is specialized in risk assessment and even they cannot escape the myth that code must be kept secret or the competition would steal it. I wonder what competitor would steal that pile of garbage that only works under very specific requirements, which are mostly there because 40 years of legacy and incompetence.

You seem to have an idea of copyleft (GPL in particular) that is far from what it is and it only exists in your mind.
Scroll down to the section on Conscious Realism. This presents a mathematical basis for what "base reality" is: a graph of conscious agents, and our reality is merely a projection of that graph (we perceive elements of the projection, not the base graph). This to me is a much more powerful idea than the Ted talk which is a bit clickbaity.
How to use classic Atari, Commodore, and Sinclair software on your Mac
> Actually, I find it shocking that almost ten seconds of free fall plus many passengers being terrified to the point of screaming would go unmentioned on social media. That's not an experience you forget. :/

How do you know it hasn't been mentioned on social media? I have like 6 followers I could have posted my harrowing experience and nobody would see it
For my general uses, pydantic and dataclasses are very similar, and I prefer pydantic over dataclass for the following reasons:

1. pydantic by default ignores extra fields - it's useful when I make an API call and want to extract and validate only certain fields from the response, while dataclasses throws errors if you don't specify all fields, and this behavior can't be disabled

2. pydantic is more customizable - I can overwrite the BaseModel if I have a custom need

3. pydantic seems to integrate better with python typing - I'm not sure how to explain this one, but it feels more natural and dynamic

I'm not sure what the performance concerns are, though
Great. Now I want GPU pass-trough in VM on linux with Nvidia GPU. I mean something that you don't need nuclear physics degree to actually understand how to set up.
Python has had named tuples since 2008 and slots for attributes since 1999, both of which are fast first class values.

I’m always astonished by ignorant people feigning knowledge of their areas of ignorance.
It's likely that the two most important metrics for an EV for most consumers are cost and range. The easiest way to keep price down and range up is efficiency. So efficiency is a key consideration for manufacturers to succeed.

It's not a coincidence that Hyundai and Tesla are the Western mass producers with both the highest margins and the highest eficiencies.
... on the third hand it's better not to roll your own list in any language ;-)

Joking aside, some stuff are currently really hard in Rust, but the rate of change slowed down, and all I can see now is everyday ergonomic improvements, so there is hope for (slightly) simpler syntax in the future.