Readit News logoReadit News
awild commented on Multiranges in Postgres   cybertec-postgresql.com/e... · Posted by u/gurjeet
timwis · 3 years ago
Wow, I was just trying to solve the problem of merging overlapping periods in ruby. Life would be so much easier if the database did it for me!
awild · 3 years ago
Sort by lowest start, merge left when they overlap. Emit current span if not. Repeat.
awild commented on An ode to that “coffee friend”   tiramisu.bearblog.dev/cof... · Posted by u/memorable
koonsolo · 3 years ago
This "too cool for stuff" sounds like US culture. I never experienced that kind of thing in EU. We each had our own friend groups, and didn't really care what the other groups were into.

I once heard an artist say (can't remember which one), that they loved playing in Europe, since everyone at a festival is there to have fun. While in US, everyone is there to look cool.

awild · 3 years ago
It's not a US thing and not even necessarily related to being bullied in school. Lots of parents scold their children for being into useless or eclectic hobbies.
awild commented on Ask HN: Seriously, steelman this please. 7,400 employees at Docusign?    · Posted by u/tomcam
chrisseaton · 3 years ago
Does anyone actually directly employ janitorial staff these days?
awild · 3 years ago
I found out yesterday that our facility management is employed with us. But we also handle seriously sensitive data.
awild commented on JSON Crack – Visualize JSON data into graphs   jsoncrack.com... · Posted by u/iCutMoon
youngNed · 3 years ago
this might be a good place to ask: is there any tool out there that can help with json to normalised tables?

I know that many databases can store json, but i often have api's that i would like storing in tables, and feel that 'splitting it out' should be fairly trivial.

Each time i think about making a tool, i am put off by the fact that there is a voice saying 'someone will have done this, in a much better way than you!' :-)

EDIT:

Ignore that, i did that think where i didn't look at the link - this pretty much does what i would need

awild · 3 years ago
Have you looked at Millercsv or jq?
awild commented on Ctrl-C   kevinlawler.com/ctrl-c... · Posted by u/kcl
dmarinus · 3 years ago
After decades of experience I learned to use ctrl-\ (break) or ctrl-z and then kill -9 %1. Hope this helps someone.
awild · 3 years ago
Kill9 can keep ports locked for a bit after exiting which is a quite annoying
awild commented on Why Punish?   thereader.mitpress.mit.ed... · Posted by u/pseudolus
dragontamer · 3 years ago
> Why do adults punish children?

Because it works at changing their behavior.

Now we can argue the merits of positive reinforcement vs negative reinforcement all day. But when a technique is effective at changing unwanted behavior, then it will be used.

Punishments are absolutely necessary because some kids don't know when their parents disapprove of their behavior otherwise. I'm not talking about beating kids btw, I'm talking about scolding, "go to your room", and timeouts.

I don't think corporal punishment is worthwhile. There's some studies that shows that while effective at changing behavior, it also teaches the kid that violence is sometimes necessary, a lesson that I'm not sure if we should be teaching them.

But punishments in general? You don't want to reach for them as your first tool in your parenting toolbox. But you really can't just positive-reinforcement "you're doing a good job" all day to your kids. Its disingenuous and the kids pick up on that.

----------

> It answers the question in the title mostly by asking what, from today’s perspective, are the rational uses of punishment?

To change a person's behavior. If someone keeps lying, cheating, and stealing in society, we want to make them to stop so that they can reintegrate and become a beneficial member of society.

Perhaps we've gone too far with jail times in the USA, but the foundational theory is quite simple and effective here. Anyone who has ever trained a dog or other animal knows how to use animal psychology / punishments / rewards to change the animal's behavior.

Human psychology is more complex than animal behavior, but it shares a lot of similarities. Positive reinforcement (aka: rewards) and negative reinforcement (aka: punishments) are both useful within the framework.

awild · 3 years ago
> To change a person's behavior. If someone keeps lying, cheating, and stealing in society, we want to make them to stop so that they can reintegrate and become a beneficial member of society.

I think a common criticism of this stance is, that it does not ask why a person does something that others want to punish. Obviously there sometimes are no answers, but often it's poverty and lack of options. So this begs the question, why people come to steal and murder etc.

I personally don't believe that "punishment" is usually well invested in a person. Rehabilitation and support structures are probably the better option.

I am also realising that it gets very interesting for white collar crime "without a victim" such as tax evasion or manipulation of stocks. My intuition is to punish exactly these crimes, but I think that's my bias showing.

awild commented on SQLite Internals: Pages and B-trees   fly.io/blog/sqlite-intern... · Posted by u/eatonphil
Kinrany · 3 years ago
I hope using an embeddable database will also free us from delegating the choice of query language to the database library. It should be possible to have a general purpose low level persistence API and many different query engines built on top of it.
awild · 3 years ago
Have you had a look at arrow? It has those capabilities
awild commented on Code doesn’t have to be a mess   danielsieger.com/blog/202... · Posted by u/dsieger
samsquire · 3 years ago
In my experience people refactor code to their own understanding of the problem and not all refactorings improve the code.

People abstract before an abstraction is necessary.

I find single file dense leetcode style code easier to understand and follow the flow. Algorithmic code I can reason around. A large mature codebase is far harder to get to know.

One of the first things I do when I study a new codebase is find all the entry points and follow the flow of code from beginning to the thing I am interested in.

One person's beauty is another person's mess.

It's harder to change an existing codebase than to write a simple program that does the new thing but not in the context of the original program. A reference implementation of the various components is far easier to understand than one big ball of mud. Fitting problems together is hard. You need to understand the old thing before you can introduce the new thing and it ends up being forced or hacked in if the design doesn't support the new thing.

I tend to write reference implementations of everything, then combine them together as a separate project.

I find an empty file far more reassuring than a large codebase.

awild · 3 years ago
I try to encourage newcomers to refractor the code into a form they understand, fix the problem and then undo that refactoring as much as possible. If they actually come up with a better abstraction I'm up for it.

Refactoring will give them the chance to see what the actually moving parts of code are.

awild commented on The case for bad coffee (2015)   seriouseats.com/the-case-... · Posted by u/srathi
staticautomatic · 3 years ago
This isn’t directed at you/OP, but the anti dark roast thing seems to me to be a distinctively American coffee snob hipster thing. Many places in the world have wonderful dark roast coffee. Honestly, are these people just wandering around Austria, Italy, Vietnam, Cuba, or Turkey complaining about bad the coffee is? Give me a break.
awild · 3 years ago
I most definitely go to Italy and complain about the quality of the coffee. And I do actually appreciate bitterness in coffee.
awild commented on The case for bad coffee (2015)   seriouseats.com/the-case-... · Posted by u/srathi
parasubvert · 3 years ago
This is overly dismissive of certain styles, the same could be said for any popular style like yet another chocolatey syrupy Imperial Stout, or yet another crisp Pilsner.

Hoppy is anything but accessible, in my experience, clearly some people love them but most casual drinkers do not. I personally find certain DIPAs to be a near religious experience but others can’t stand them. To each their own.

awild · 3 years ago
Sorry, but the modern form of DIPA most definitely is one of the most accessible forms of craft beer. They usually aim for low to no kettle hops, only whirpool and high levels of rx hopping. Fermentation, mash and grist all serve to make the beer sweet. The end result: a beer low in bitterness, silky, extremely sweet (these beers can finish above 1.030) with intense fruity notes.

u/awild

KarmaCake day426September 14, 2016View Original