stonecolddevin
Re:The deskilling of web dev is harming us all
on Sunday May 26, 2024 @08:34PM (#40486577)
this is fine when you're a junior learning but it's asking to get shit dumped on you later on. I think it's a good idea to pick a lane later on in your career and settle into it.
Re:Jedi Knight (Plus, Notes on an Expanded Universe)
on Friday April 05, 2024 @02:31PM (#39945533)
Ok
Re:Testcontainers
on Tuesday February 27, 2024 @06:54PM (#39531935)
Testcontainers is great. It's got seamless junit integration and really Just Works. I've never once had to even think about any of the docker aspects of it. There's really not much to it.
Re:George Harrison and the Struggle for Creative Freedom
on Tuesday April 11, 2023 @02:08PM (#35528866)
I am the Walrus.
Re:Analyzing multi-gigabyte JSON files locally
on Saturday March 18, 2023 @07:01PM (#35214073)
Isn't this pretty much what JSON streaming does?
Re:GPU Video acceleration in the Windows Subsystem for Linux now avail...
on Monday February 13, 2023 @06:03PM (#34782233)
I've been doing it for almost a year, am I missing something?
Re:Are all brains good at math?
on Thursday September 01, 2022 @05:58PM (#32683864)
I had no idea this had a name. Sure wish I'd have known this while I was in school.
Re:The Grug Brained Developer
on Wednesday June 22, 2022 @05:38PM (#31842190)
I personally almost always use loops (in Java) unless I know the dataset being dealt with is small, unless I'm writing stuff in Scala where maps and flatMaps are first class, but diving into Scala is its own can of worms.
Re:PostgreSQL Subtransactions Considered Harmful
on Tuesday August 31, 2021 @07:04PM (#28374692)
They're hyperbolic and don't actually give you any useful information on why they're "harmful" or what's wrong with the subject being discussed.
Re:Ask HN: How do I represent a hierarchy in RDBMS?
on Tuesday May 28, 2019 @07:57PM (#20035632)
If you're using Postgres, you can use recursive queries using common table expressions.
Disqus implemented this sort of thing 10 years ago: https://pastebin.com/Fe2twMRr (I can't find the original talk for some reason)
Here's the meat of the solution:
CREATE TABLE comments (
id SERIAL PRIMARY KEY,
message VARCHAR,
author VARCHAR,
parent_id INTEGER REFERENCES comments(id)
);
INSERT INTO comments (message, author, parent_id)
VALUES ('This thread is really cool!', 'David', NULL),
('Ya David, we love it!', 'Jason', 1), ('I agree David!', 'Daniel', 1),
('gift Jason', 'Anton', 2),
('Very interesting post!', 'thedz', NULL),
('You sir, are wrong', 'Chris', 5),
('Agreed', 'G', 5), ('Fo sho, Yall', 'Mac', 5);
What we’ve done now, is setup a basic comment model. We’ve included the message, the author, and the parent comment (which is optional). Now let’s learn how to use a recursive query to easily re-order this date, showing us a fully threaded view, sorted in ascending order by id. WITH RECURSIVE cte (id, message, author, path, parent_id, depth) AS (
SELECT id,
message,
author,
array[id] AS path,
parent_id,
1 AS depth
FROM comments
WHERE parent_id IS NULL
UNION ALL
SELECT comments.id,
comments.message,
comments.author,
cte.path || comments.id,
comments.parent_id,
cte.depth + 1 AS depth
FROM comments
JOIN cte ON comments.parent_id = cte.id
)
SELECT id, message, author, path, depth FROM cte
ORDER BY path;
Re:Ask HN: What's the most underrated programming language?
on Thursday February 01, 2018 @12:54PM (#16283975)
I really wish C# had more battle tested linux usage. I really love that language.