PixelProf,

C could just be a blank and you have to bit blit the arrow on yourself.

xigoi,
@xigoi@lemmy.sdf.org avatar

Actual C: Problem → Segmentation fault

milkjug,

Actual Problem: C → Segmentation Fault

Kedly,

Actual Problem: C → Segmentation Fault?

nintendiator,

C:

Problemreturn Solution;

C++:

Problem


<span style="color:#323232;">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)) )
</span>
veniasilente,

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)

nintendiator,

Actually I do; it’s the {} that initializes the lambda, and the parenthesis after invokes.

That said, it would have been fun.

xigoi,
@xigoi@lemmy.sdf.org avatar

C:


<span style="color:#323232;">return *(solution_t*)&problem;
</span>
nintendiator,

Maximum optimization!

loweffortname,
@loweffortname@lemmy.blahaj.zone avatar

Didn’t see any mention yet, so… Useless use of !

theherk,

I’ve seen this before but don’t accept it myself. There are cases where you just wanted to cat. In this case, maybe to review the problem. Then you want to extend the command. Preserving it in the next commands where you start stacking on pipes is useful since it can be fewer strokes and maintain a habit.

wabafee,

JS is basically the Hydra from the Greek Mythology.

Though PHP is literally the problem had me lol.

HulkSmashBurgers,

Racket: problem - > solution

TCB13,
@TCB13@lemmy.world avatar

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.

Shady_Shiroe,
@Shady_Shiroe@lemmy.world avatar
Gingernate,

Someone do java hahaha

gex,

Problem -> AbstractProxyFactory<SolutionProvider<BaseProblem>>

corsicanguppy,

If you’re catting a file into a grep, you can go.

renzev,

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 into grep <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.

al177,

If you’re piping any of those commands to or from awk, you can also go.

affiliate,

i feel like javascript could also be

Problem -> solution -> 3 days pass -> all dependencies had breaking changes made -> problem

bort,

Latex: Problem --> defplease@#1#2#3#4{e@kill#2#3{me#1}#4@now} --> https://i.imgur.com/6DMncEk.png

bitwolf,

I got way too excited Lemmy parsed LaTeX for a second

renzev,

Testing 123

$$ \sigma $$

aww…

renzev,

Accurate. LaTeX is great, it makes you feel like you have superpowers compared to “office suite”-style software. But every once in a while you just run into some bullshit that feels like it’s stuck in 1985 and it completely breaks your flow. I remember wanting to make a longtable where text in the “date” column would be rotated by 90 degrees to leave more horizontal room for the other columns. It took me two rotateboxes, a phantom, a vspace, a hspace and 40 minutes of my life to get the alignment right. Would probably have taken a duckduckgo search and three clicks in Libreoffice.

Odiousmachine,

Funnily enough I had a similar problem but I wanted text instead of a date. In the end I used a solution similar to yours and adjusted each cell entry manually for hours. Feels like there should be a lot simpler solution for this problem in LaTeX. Glad I don’t need to use it anymore…

renzev,

u/vox@sopuli.xyz suggested Typst as an alternative to TeX. I gave it a try, and I’m loving it so far. It even has built-in support for the rotated text thing typst.app/docs/reference/model/table . I’ve only used it for notes/homework so far, but I’m looking forward to seeing how it fares for more serious typesetting tasks.

Odiousmachine,

That looks interesting, thanks for the ping. I will give it a try.

vox,
@vox@sopuli.xyz avatar

btw what do you think about typst?
i only used it for simple stuff so far but it seems pretty fun and easy to use

renzev,

Never heard of it before, but might give it a try at some point. From the website, it seems like something halfway in between LaTeX and Markdown? Sounds exactly like what I need at times, tbh.

vox,
@vox@sopuli.xyz avatar

yeah it’s perfect for taking notes and stuff

PixelProf,

My two cents, after years of Markdown (and md to PDF solutions) and LaTeX and a full two years of trying to commit to bashing my head against Word for work purposes, I’m really enjoying Typst. It didn’t take long to convert my themes, having docs I can import which are basically just variables to share across documents in a folder has been really helpful. Haven’t gone too deep into it but I’m excited to give it a deeper test run over the next little bit.

humbletightband,

it makes you feel like you have superpowers compared to “office suite”-style software

Especially the installation process

tetris11,
@tetris11@lemmy.ml avatar

I still have no idea how to exit the build process. It tells I need to type H or end but it also just lies. I find the easiest way is to invoke Ctrl-Z and then kill the background process, and the younglings children

renzev,

Yeah, what the hell is up with that? I always just echo | pdflatex to make it shut up and exit on error. Maybe one day I’ll learn how to actually use that interactive compilation thing, but not today lol.

tetris11,
@tetris11@lemmy.ml avatar

wait how does your hack work?

renzev,

So there are many different commands that compile LaTeX, right? pdflatex, pdftex, latexmk, etc. But they all do that thing where they ask for your input as soon as they encounter an error, right? Well, if you just pipe an empty echo command to them, it notices that stdin has reached end-of-file, and gives up trying to ask the user for input, and just exits on first error. So instead of pdflatex mydocument.tex, you can do echo | pdflatex mydocument.tex and it won’t ask you for input if it sees an error, it’ll just exit. There’s probably a “proper” way to achieve the same behaviour, but I can’t be arsed to read the docs.

Speaking of stupid TeX hacks, at one point I had a script called latex_compile_and_install_packages_until_it_works.sh. It’s essentially a loop that repeatedly tries to compile a document, searches the output of the compiler for anything that looks like a missing package error, and pipes it to sudo tlmgr install. The “fuck it” of package management, arbitrary code execution exploit included!

https://lemmy.world/pictrs/image/105d8096-b9cd-424e-8578-5482a086c74d.png

(Sorry for the screenshot, I lost the original script in text form, probably for the better)

tetris11,
@tetris11@lemmy.ml avatar

Haha that’s brilliant! I have a similar script for Conda, where it tries to install R packages by first looking in bioconductor and then trying the rejects through conda-forge, and then the rejects from that are compiled from source or just outright rejected.

I would have thought you would have needed a (while :; do echo; done) | pdflatex or a yes “end” | pdflatex, i.e. something that repeatedly generates output. It’s actually quite elegant that pdflatex checks if stdin is already EOF

renzev,

tries to install R packages by first looking in bioconductor and then trying the rejects through conda-forge, and then the rejects from that are compiled from source

Just do all of these in parallel to maximise the change of installing the correct version

tetris11,
@tetris11@lemmy.ml avatar

lmao, though it’s noticeably missing pacman, guix, and "pkg install "should be “pkg add” :P

Funkytom467,
@Funkytom467@lemmy.world avatar

You also need that usepackage just like python.

Hotzilla,

C# Solution -> .sln

(brought to you by .net gang)

smileyhead,

Every programming language has it’s place.

JavaScript’s place is in hell.

Bishma,
@Bishma@discuss.tchncs.de avatar

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.

mindbleach,

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.

Da_Boom,

Ever wanted to be somewhere inbetween java and JavaScript?

Yeah, that’s Groovy. Only it’s the wrong groove

Socsa,

Also regular java.

There is not a single piece of Java software in existence which wouldn’t be better as some combination of C++ and/or python. Chang my mind.

God I hate java so much.

mindbleach,

We joked about .NET being Microsoft Java, but really, .NET is “what if Java was good?”

ALostInquirer,

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?

smileyhead,

It was mostly made for simple scripts to embed on a website for animations and handling updates without refreshing whole page. Not to make a full portable client (browser) side app.
Hating JavaScript is mostly a meme, it’s just a programming language. But its very loose syntax, fact it’s often someone’s first programming language to learn and how most programs written in it nowadays are a hack build on top of a hack on top a hack makes this language easy to laugh at.

alexdeathway,
@alexdeathway@programming.dev avatar

python -> Import solver © -> Solution

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programmerhumor@lemmy.ml
  • DreamBathrooms
  • ngwrru68w68
  • tester
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • tacticalgear
  • JUstTest
  • osvaldo12
  • normalnudes
  • cubers
  • cisconetworking
  • everett
  • GTA5RPClips
  • ethstaker
  • Leos
  • provamag3
  • anitta
  • modclub
  • megavids
  • lostlight
  • All magazines