Please dont take this seriously guys its just a dumb meme I haven’t written a single line of code in half of these languages
If you’re catting a file into a grep, you can go.
I mean good point, but if I’m just using bash as a shell and not writing a script, I’m probably first previewing the contents of a file with
cat
anyway, and recalling the last command and appending a| grep <pattern>
to it is less keystrokes than re-writing the last command intogrep <pattern> <file>
. Especially if you’re playing around with the pattern and trying to get it right, it’s nice to have the pattern at the end of the line.If you’re piping any of those commands to or from awk, you can also go.
i feel like javascript could also be
Problem -> solution -> 3 days pass -> all dependencies had breaking changes made -> problem
deleted by creator
Ever wanted to be somewhere inbetween java and JavaScript?
Yeah, that’s Groovy. Only it’s the wrong groove
JS is ironic punishment as a programming language. It’s fun to screw around in! And then you have to use it for stuff, and pain ensues.
What makes JavaScript so widely disliked? I know very little of it, and in skimming different stuff I think I’ve seen like a million different frameworks for it, so is that a part of it?
deleted by creator
I used to think Javascript was hell when I barely used it. Now I have to build with it regularly and… once in a while I’m just right about things.
Python one is accurate. Most of our problems are solved by importing a library and writing the line, librarySolver.importedFunction.SolveMyProblem()
def main(): Print(‘thanks librarySolver’)
Advent of code 2023 day 24 part 2. Z3 solver saved the day on that one.
Now I have PTSD every time I see an hailstorm.
So many solver solutions that day, either Z3 or Gauss-Jordan lol. I got a little obsessed about doing it without solvers or (god forbid) manually solving the system and eventually found a relatively simple way to find the intersection with just lines and planes:
- Translate all hailstones and their velocities to a reference frame in which one stone is stationary at 0,0,0 (origin).
- Take another arbitrary hailstone (A) and cross its (rereferenced) velocity and position vectors. This gives the normal vector of a plane containing the origin and the trajectory of A, both of which the thrown stone must intersect. So, the trajectory of the thrown stone lies in that plane somewhere.
- Take two more arbitrary hailstones B and C and find the points and times that they intersect the plane. The thrown stone must strike B and C at those points, so those points are coordinates on the line representing the thrown stone. The velocity of the thrown stone is calculated by dividing the displacement between the two points by the difference of the time points of the intersections.
- Use the velocity of the thrown stone and the time and position info the intersection of B or C to determine the position of the thrown stone at t = 0
- Translate that position and velocity back to the original reference frame.
It’s a suboptimal solution in that it uses 4 hailstones instead of the theoretical minimum of 3, but was a lot easier to wrap my head around. Incidentally, it is not too hard to adapt the above algorithm to not need C (i.e., to use only 3 hailstones) by using line intersections. Such a solution is not much more complicated than what I gave and still has a simple geometric interpretation, but I’ll leave that as an exercise for the reader :)
That is a great explanation of how you solved it, thanks! I should go back to it and conquer that puzzle properly without a solver. Or at least try.
deleted by creator
Someone do java hahaha
Problem -> AbstractProxyFactory<SolutionProvider<BaseProblem>>
for the ones missing the marvelous HTML, I gotchu bro:
<problem />
Obligatory “Hyper Text Markup Language is a markup language, not a programming language”
HTML+CSS Has been turing complete for some time now.
See, you added the CSS part, that was not part of the original comment.
that’s fair but, they are quite intertwined
Which is why it was just an obligatory comment from pedantic me. Just a light correction.
Add css, and the problem looks really pretty now
Problem
python -> Import solver © -> Solution
C:
Problem
→return Solution;
C++:
Problem
→const [auto]&& (Problem&& problem) noexcept(noexcept( Solution<Problem>{}(std::forward<Problem>(problem)) )) { return Solution<Problem>{}(std::forward<Problem>(problem)); } -> decltype( Solution<Problem>{}(std::forward<Problem>(problem)) )
C:
return *(solution_t*)&problem;
Maximum optimization!
But this doesn’t return the
Solution
. You don’t invoke the lambda.(Or does C++ have implied returns now? Last I heard there was implied
move
)Actually I do; it’s the
{}
that initializes the lambda, and the parenthesis after invokes.That said, it would have been fun.
missing the stage of C where it’s all incomprehensible bitfucking with comments like “this works, i do not know why it works, do not touch this”
C should show some overflow corruption of the problem graphic.
I had this in CSS.
CSS isn’t as bad these days if you use Flexbox. Debugging floats and absolute/relative positioning was a nightmare in comparison.
On the other hand, it made webpages way less flexible.
Like yesterday (i have the browser not in fullscreen, for reasons) on my 16" fullhd notebook, webdev couldn’t imagine that someone would use his site in a ~1000px browser window, sidebars left and right, the main content about 20 characters wide squeezed inbetween. So i pressed f12 and deleted the sidebars. But the content was still 20em wide, because of flexbox.
Real fast inverse square root algorithm hours
That one is not that complicated if you don’t think about the math. It’s basically just if we interpret the float as int and add a magic number we have a good estimation.
From what I remember at least, it’s been a little while since I implemented it.
IIRC also relying on how floating-point is basically scientific notation and the most-significant bits are the exponent.
And most importantly, relying on how a sloppy answer works just fine. The most important skill in game development is cheating.
The most important skill in game development is cheating.
Makes me feel better about my own game dev attempts lmao.
I was more thinking of the comments which are pretty much exactly what you said (“incomprehensible bit hacks” followed by “what the FUCK?”)
PHP -> Problem -> Replace the developer -> Solution.
Yes PHP was bad in 5.x, in 8.x if things go bad it’s just the developer who’s bad.
C --> segfault --> new problem
Sry, the best I can do on mobile
It’s good
🙉 it’s perfect!
deleted by creator
Racket: problem - > #lang solution
C could just be a blank and you have to bit blit the arrow on yourself.