|
https://twitter.com/d_feldman/status/1740106959704195185
|
# ? Dec 28, 2023 02:12 |
|
|
# ? May 11, 2024 14:01 |
|
Write Four Billion Conditions Volmarias fucked around with this message at 07:27 on Dec 28, 2023 |
# ? Dec 28, 2023 05:09 |
|
Volmarias posted:Write Four Billion Conditions Reach heaven through bad code
|
# ? Dec 28, 2023 13:04 |
|
do it for 64-bit and you will complete all the names of God
|
# ? Dec 28, 2023 15:18 |
how long is the 4 billion if condition code if printed on 8.5x11, 12 point courier?
|
|
# ? Dec 28, 2023 18:59 |
|
Volmarias posted:Write Four Billion Conditions
|
# ? Dec 31, 2023 02:11 |
|
sooo aaaanyway
|
# ? Dec 31, 2023 02:27 |
|
This thing seems like a fun thing to throw at optimizers. (Not to be confused with a wise choice of a benchmark).
|
# ? Dec 31, 2023 02:28 |
|
Please, your jump table only needs to fill one physical memory frame, and simply redundantly remapped across your entire virtual address space
|
# ? Dec 31, 2023 03:22 |
|
Dijkstracula posted:Please, your jump table only needs to fill one physical memory frame, and simply redundantly remapped across your entire virtual address space quote:For added performance (it is very important), I decided to map the file into the address space instead of reading all of it. By doing this, we can just pretend that the entire file is already in memory and let the poor OS deal with fitting a 40 GB blob into virtual memory.
|
# ? Jan 2, 2024 23:44 |
|
I don't think I'm complaining too much about my ORM having an 'engine' component written in rust that is 2.5GB in size and requires me to build it myself. My host where I'm trying to put it is running FreeBSD13 for which the ORM doesn't have pre-compiled binaries. I'm currently moving 2.5GB of who knows what onto the host so that I can pray that I can build it. The ORM is Prisma by the way.
|
# ? Jan 18, 2024 17:59 |
|
the development history of prisma is so insane that i am unsurprised that that's what they're shipping, what a loving company/project it makes slightly more sense as an architecture if you know that prisma at one point had aspirations of supporting other languages, but afaik they only ever got as far as a half complete go library that appears to have been completely deleted from their website, and the lead developer on the project at prisma was given ownership of the project after exiting the company which is very funny
|
# ? Jan 18, 2024 18:47 |
|
personally i would not use the ORM created by a company that originally raised money to be a GraphQL-based backend-as-a-service, then pivoted to being a GraphQL query engine as a serice for existing databases, then pivoted to being an ORM for all databases and languages, and now appears to have burned $40 million dollars in venture capital on building a TypeScript ORM anyone remember "gatsby"? love that they got a bunch of people into their open source project, then when everyone started having more mature sites and their build times started creeping up, they introduced a paid gatsby cloud project that was the only officially supported way to do incremental builds, and then they got bought by netifly and now the entire project is very dead
|
# ? Jan 18, 2024 18:52 |
|
abraham linksys posted:they got bought sounds like a success story to me
|
# ? Jan 18, 2024 18:55 |
|
Ok well I spent all day today trying to get a javascript npm module to run on node. I'll wake up with a brilliant idea I can try, I'll try it as a curiosity. Then I'll spend all day tomorrow replacing the ORM in the project.
|
# ? Jan 18, 2024 19:03 |
|
https://twitter.com/IroncladDev/status/1752349724105945181
|
# ? Jan 31, 2024 02:47 |
|
readUTFWhat?
|
# ? Jan 31, 2024 03:37 |
|
I C++ footgunned myself the other day with frigging clamp(). Was in older code and std::clamp() wasn’t there, so I did a template in what was essentially ‘randomUtils.cpp’. Had to touch a lot of older code, so I of course re-factored ton of stuff into clamp(). Oops, turns out that unsigned is a thing, especially if people turn a dial Really Fast and of course when a hosed-up unsigned goes negative things get really interesting. That build never left the building, I’m only posting this here because I know I have one point I posted here my diatribe about using signed versus unsigned for expected values and how that implicit communication is a good thing. Mea culpa.
|
# ? Jan 31, 2024 03:57 |
|
abraham linksys posted:personally i would not use the ORM created by a company that originally raised money to be a GraphQL-based backend-as-a-service, then pivoted to being a GraphQL query engine as a serice for existing databases, then pivoted to being an ORM for all databases and languages, and now appears to have burned $40 million dollars in venture capital on building a TypeScript ORM GatsbyJS looks safe still, but dang didn’t know that I’m an Astro shill these days
|
# ? Jan 31, 2024 06:05 |
|
abraham linksys posted:personally i would not use the ORM created by a company that originally raised money to be a GraphQL-based backend-as-a-service, then pivoted to being a GraphQL query engine as a serice for existing databases, then pivoted to being an ORM for all databases and languages, and now appears to have burned $40 million dollars in venture capital on building a TypeScript ORM I remember when a client wanted me to build them a gatsbe project and I did and then they had a bloated application that was way more complicated than what they needed.
|
# ? Feb 7, 2024 01:55 |
|
ok so as you can see here on line 33, we declare the variable i to be an integer, and initialize it with the value 0
|
# ? Feb 7, 2024 06:31 |
|
So, one of the juniors on my team came up with something I said (in a code review) was "beautiful and terrible". Minor vagueness in backstory: so we have a service (written in Python) that operates on a list of objects; the objects are in a strict hierarchy and the names are expressed as ParentObj/ChildObj/ChildOfChildObj, etc etc. We identified a bug in some code where there was an inheritance of an attribute from parent to child that this program was trying to change; so changing the parent and then trying to change the child would result in an error, since you were trying to add something to a set that already existed, essentially. Example: code:
The PR I received contained the phrase "I have used PurePath in my implementation, confirmation of logic in ticket". I kind of blew past that at first, and then had to go back and read it again. "Wait...PurePath? Did I read that right?" I then opened the PR and confirmed that yes, I had read that right. The way they solve this was to interpret each object name as a Unix-style file path using Python's stdlib Pathlib module, and then utilize directory crawling patterns to achieve the answer. I was immediately horrified, followed almost directly afterward by 'wait...hold on. Does this...work?' and I looked into it. So a minor note aside that PurePosixPath was a better option to ensure that the OS didn't freak out, I came to the conclusion that this...definitely worked. Now, the rest of their implementation was pretty weird, involving some significant logic issues, but here's the final implementation, give or take: Python code:
Now, could we have written something else? Sure, and it probably would have been just as readable, but I was kind of awestruck at this hacky thing, and it was reasonably constrained so...I approved it.
|
# ? Feb 7, 2024 08:16 |
|
In college I interviewed for an internship at Microsoft (they'd bring a bunch of recruiters and engineers on campus once a year and interview basically every 3rd/4th year CS student) and I was definitely in my smarmy-Unix-kid phase, which intersected heavily with my any-program-worth-writing-can-be-a-Perl-oneliner phase My interview was being done by a recruiter, not an engineer, but they still asked technical questions. One was "write a function to reverse the order of words in a string". I had done plenty of that type of exercise in school, and I was well-versed in C and to a lesser extent C++, so I could have done a straightforward recursive or iterative algorithm, but the interviewer said I could use whatever language I wanted, and I wanted to show everyone just how fuckin' clever I was so I just wrote "join reverse split;" on the whiteboard and then refused to elaborate. I didn't get the internship.
|
# ? Feb 7, 2024 08:35 |
|
more falafel please posted:In college I interviewed for an internship at Microsoft (they'd bring a bunch of recruiters and engineers on campus once a year and interview basically every 3rd/4th year CS student) and I was definitely in my smarmy-Unix-kid phase, which intersected heavily with my any-program-worth-writing-can-be-a-Perl-oneliner phase Well obviously not, you forgot the separator argument for join
|
# ? Feb 7, 2024 08:56 |
|
Soricidus posted:Well obviously not, you forgot the separator argument for join goddamnit larry how does it not default to $_ (probably because it's in list context and all the args get collapsed, once again goddamnit larry)
|
# ? Feb 7, 2024 09:05 |
|
more falafel please posted:goddamnit larry how does it not default to $_ (probably because it's in list context and all the args get collapsed, once again goddamnit larry) I think technically your code uses the result of “reverse split” in scalar context (i.e. the number of words), to join an empty list. So the result is always an empty string. Perl is fun!
|
# ? Feb 7, 2024 09:21 |
|
more falafel please posted:In college I interviewed for an internship at Microsoft (they'd bring a bunch of recruiters and engineers on campus once a year and interview basically every 3rd/4th year CS student) and I was definitely in my smarmy-Unix-kid phase, which intersected heavily with my any-program-worth-writing-can-be-a-Perl-oneliner phase Don't worry, some people never grow out of that phase.
|
# ? Feb 7, 2024 10:17 |
|
That Python paths solution is funny, but hopefully the inputs stay small.
|
# ? Feb 7, 2024 10:24 |
|
Falcon2001 posted:So, one of the juniors on my team came up with something I said (in a code review) was "beautiful and terrible". The bad small here is that the junior still does not understand recursion.
|
# ? Feb 7, 2024 13:02 |
|
DELETE CASCADE posted:ok so as you can see here on line 33, we declare the variable i to be an integer, and initialize it with the value 0 or an hour long "chat gpt explain this" voice to text
|
# ? Feb 7, 2024 13:39 |
|
Falcon2001 posted:... I don't think I would describe it as "hacky". You've designed a system where the "paths" are paths in an abstract filesystem, so it's amenable to interrogation with tools intended for filesystems. Is it "hacky" when URIs are constructed using abstract paths like http://example.com/foo/get/12345
|
# ? Feb 7, 2024 14:32 |
|
Yeah. I mean, given your constraints of canonical Unix-style strict-alpha paths, the simpler and much more efficient solution is just to sort them and then make a single pass dropping elements that have the last undropped element as a path-prefix (which is just string-prefix except the first character after the prefix also has to be a slash). But using an abstract path library for abstract paths is totally fine.
|
# ? Feb 7, 2024 15:23 |
|
I would have used urllib
|
# ? Feb 7, 2024 17:15 |
|
The Soviets used a pencil
|
# ? Feb 8, 2024 07:00 |
|
Falcon2001 posted:So, one of the juniors on my team came up with something I said (in a code review) was "beautiful and terrible". Given the choice between easy to read and comprehend vs clever I prefer the former, but if it's well-tested then clever is fine
|
# ? Feb 8, 2024 23:56 |
|
QuarkJets posted:Given the choice between easy to read and comprehend vs clever I prefer the former, but if it's well-tested then clever is fine Back at my first job they'd literally have sections of code where the two were side by side. "Here's the legible version if you're trying to interact with this section, here's the gross bit-by-bit breakdown to actually make it fast enough."
|
# ? Feb 9, 2024 18:24 |
|
.
|
# ? Feb 11, 2024 09:32 |
|
Is someone playing with BiDi overrides somehow?
|
# ? Feb 11, 2024 15:16 |
|
It's like how a[2] is the same as 2[a].
|
# ? Feb 11, 2024 17:22 |
|
|
# ? May 11, 2024 14:01 |
|
I'll bite, my knowledge of C/C++ esoteria is apparently insufficient. Is this actually something, or did you ask an AI to generate a picture of hello world?
|
# ? Feb 11, 2024 23:40 |