files.catbox.moe

itsmect, (edited ) to vexillology in Flags of Swedish provinces

> can I copy your homework?
> sure, but don’t make it obvious
> the homework:

Ryan213, to memes in Pfff, HTML
@Ryan213@lemmy.world avatar

WHAt’s wRoNg wItH HtmL

bauve,
@bauve@jlai.lu avatar

Nothing, but it’s not a programming language

Siegfried, (edited )

But the meme says developer, not programmer… wouldn’t that be ok then?

thiccdiccnicc,
@thiccdiccnicc@sh.itjust.works avatar

The first step to being a developer seems to be learning how to put down other devs :(

Amends1782,

What is it actually then?

shuzuko,

It’s a markup language. In the simplest explanation, a programming language describes a process (what does the thing do) while a markup language describes a structure (how is the thing supposed to be displayed). There’s more to it than that, but someone else can get into deeper if they want, it’s beyond me lol

Dirk,
@Dirk@lemmy.ml avatar

a markup language describes a structure (how is the thing supposed to be displayed)

A markup language does not define how something is to be displayed, that’s what a styling language is for (usually CSS). A markup language semantically defines what certain parts of the created document are.

shuzuko,

Lol that’s fair, but since those words in that combination barely even make sense to me I tried to dumb it down more and ended up being wrong 😂

I’m the idiot who searches stack for code and copies and pastes it into the project so no one should listen to me anyway.

Amends1782,

I knew it was a markup language, but didn’t know the diff between the two since I’m not a programmer. Thanks

BeefPiano,

Diogenes throws a Ruby on Rails model over the fence and shouts “Behold a markup language!”

Cort,

Psshaw. I programmed my Myspace page with that language: checkmate.

JoMiran, (edited ) to piracy in Naming Torrents
@JoMiran@lemmy.ml avatar

Dealing with spaces while scripting or in terminal is such a pain in the ass. The true dark path of horror is using spaces indeed.

adespoton,

“\ “ and [tab] and * are your friends. I’ve been using spaces in Unix filesystems since the early 90s with no issues. Also, using terminal fonts that•put•a•faint•dot•in•each•space•character helps.

ShaunaTheDead,
@ShaunaTheDead@kbin.social avatar

Yeah, either put quotes around it '/like this/you can incorporate/spaces/into your paths' or /just\ escape/your\ spaces/like\ this

silasmariner,

This is fine for the most basic of use cases but once you start looping through file names or what have you, you have to start writing robust correct bash and nobody does that

gears, (edited )

It gets real crazy when you’re sending remote commands so you have to escape the escapes so that the remote keeps them and properly escapes the space

ssh -t remote "mv /home/me/folder\ with \ spaces /home/me/downloads/

LocustOfControl,

Yup, this is me with scp. Well, it would be if I didn’t just use asterisks to avoid that PITA.

PoolloverNathan, (edited )

Does SSH require quoting commands?

gears,

It doesn’t for commands without spaces (i.e reboot) You might be able to escape the spaces and not use quotes, I’m not sure

PoolloverNathan,

Might be client-dependent; I’ve regularly ran commands with spaces (e.g. ssh a@a.local ssh b@b.local) without a problem.

cobra89,

Yeah but at least with periods in the title tab complete will just complete the file name all the way while with a filename with spaces I have to escape the damn space with “\ ” like you said. Why do more work when I don’t have to?

Euphoma,

My shell seems to autocomplete filenames that have spaces with “\ ” already.

skullgiver, (edited )
@skullgiver@popplesburger.hilciferous.nl avatar

deleted_by_author

  • Loading...
  • reverendsteveii,

    I work on a Web app and we recently decided that we’re just not gonna support double quotes in free text fields because oh holy balls what a thing it is to try to deal with those in a way that doesn’t open you up to multiple encoding vulnerabilities.

    FooBarrington,

    That’s… Surprising. If you’re doing things right, double quotes should be no trouble at all:

    • HTTP requests have simple, automatic encoding
    • SQL queries with prepared statements don’t need any special handling for double quotes
    • Rendering the data should happen with proper escaping etc.

    They are usually only trouble if you’re doing SQL queries wrong (concatenation etc.) or if you’re not escaping your output.

    reverendsteveii, (edited )

    The issue is the filter that we’re using to avoid multiple encoding attacks de-escapes everything via multiple rounds, then tries to pass it to the next layer of filtering with the de-escaped request body as a json string. Your absolutely right that this is a silly way of doing it, but sometimes we have to live with decisions that were made before we were onboarded to a project. In this particular case, I pushed to improve the filters but all our PO heard was “spend development time weakening security” and at the end of the day they decide what to do and we do it.

    FooBarrington,

    Ah, that’s understandable. Sorry you have to go through that!

    WarmApplePieShrek,

    The filter you’re using to avoid multiple encoding attacks creates multiple encoding attacks.

    reverendsteveii, (edited )

    You should tell that to OWASP then, they wrote it. org.owasp.esapi 2.5.2.0, class is Encoder, method is canonicalize(String, bool, bool)

    WarmApplePieShrek,

    This method is a band-aid patch when your downstream code is all messed up and you can’t fix it. Instead of treating the input string correctly, it just removes anything that might possibly trigger some vulnerability in wrong code.

    pete_the_cat, (edited )

    It’s a way bigger pain in the ass than people think it is. I remember having to parse output from a tool for work that had tons of output in tabular format, mixed with normal sentence like strings. JSON, YAML, or XML outputs weren’t available so I had to do a nasty mess of grep, awk, cut, and head/tail, to get what I wanted. My first attempt was literally counting the characters so I could cut out exactly what I needed, but as we all know, hardcoding values is a recipe for headaches later on.

    JoMiran, (edited )
    @JoMiran@lemmy.ml avatar

    Here’s a horror story from literally yesterday. We have been fighting a system for a client for weeks and it has been a nightmare. Our clients just told us that they outsourced some of their work to an Indian outfit but that outfit is unfamiliar with Linux and doesn’t know how to edit text files so they have been downloading the files to their Windows machines, editing them in Windows, then uploading the contaminated text files back into Linux. None of them, not our client nor the outfit they hired, understood why this was a problem. We have no idea what files are affected and we won’t know until they fail because they obviously did not keep track of what they touched.

    EDIT: I’m being intentionally vague.

    reverendsteveii,

    The only reasonable response to this behavior is disproportionate violence

    porksoda,

    Haha this is up there with having to explain why opening a csv in Excel and then saving means that I don’t want the file.

    ramblinguy,

    I will never forgive excel for automatically converting all of my dates to some weird ass format, or stripping single quotes randomly, or something other BS that they do for no reason

    DarkDarkHouse,
    @DarkDarkHouse@lemmy.sdf.org avatar

    My absolute favourite is stripping leading zeroes from any text that looks like a number, then displaying it in scientific notation. But we get Copilot, so it balances out, right?

    murtaza64,

    If this is about line endings, surely a simple shell or python script could correct them?

    m_randall,

    There’s already a command for it:

    linux.die.net/man/1/dos2unix

    Astaroth, (edited )

    Does windows add an extra character at the end that gets converted to new line on linux? Because the other day I were copying a script and after pasting it an extra line was added after every single line, even the empty lines.

    how it looked when I copied it:

    
    <span style="color:#323232;">bla
    </span><span style="color:#323232;">bla
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">bla
    </span>
    

    what it turned into:

    
    <span style="color:#323232;">bla
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">bla
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">bla
    </span><span style="color:#323232;"> 
    </span>
    
    candybrie,

    Windows uses CR LF (carriage return, line feed), whereas Unix just uses LF. For added fun, macs use CR.

    noughtnaut,
    @noughtnaut@lemmy.world avatar

    For added fun, macs use CR.

    This used to be true, for sure, but I thought this changed with OS X (which is essentially PrettyBSD) ?

    candybrie,

    You’re right. Notepad++ still lists macs as using CR for their EOL conversion tool, so I didn’t realize.

    elscallr,
    @elscallr@lemmy.world avatar

    You can just grep for carriage returns followed by newlines, grep -Pirn ‘rn$’ /path/to/whatever. It’ll identify all your problematic files.

    Amends1782,

    Yeah I was gonna say this is something anyone in tech knows, spaces are a plague

    257m, to lemmyshitpost in Could we not bring that to Lemmy, please?

    c/unixporn ny friend.

    kopczak1995, to programmer_humor in Debugging

    Well, seems like coding while drunk didn’t help this time.

    ElBarto, to lemmyshitpost in Could we not bring that to Lemmy, please?
    @ElBarto@sh.itjust.works avatar

    Yeah and the keep fucking up my porn searches.

    Anti_Face_Weapon, to memes in Pfff, HTML

    Funny meme, but I don’t think we should gatekeep. HTML is the path to HTML5 and thus JavaScript.

    Tak,
    @Tak@lemmy.ml avatar

    Do we gatekeep Java though?

    Anti_Face_Weapon,

    No. But we do get to hate Java.

    HeyThisIsntTheYMCA, to lemmyshitpost in Could we not bring that to Lemmy, please?
    @HeyThisIsntTheYMCA@lemmy.world avatar

    DontTellMeWhatToDoPorn

    baggins, to lemmyshitpost in Could we not bring that to Lemmy, please?

    NopePorn

    GrammatonCleric, to lemmyshitpost in Could we not bring that to Lemmy, please?
    @GrammatonCleric@lemmy.world avatar

    Bro, that shit is here, too 😅

    Bobble9211, to lemmyshitpost in Could we not bring that to Lemmy, please?

    What have you done???

    • Unixporn@lemmy.ml - 574 subscribers
    • FoodPorn@lemmy.world - 550 subscribers
    • EarthPorn@lemmy.ml - 274 subscribers
    • SpacePics@lemmy.fmhy.ml - 243 subscribers
    retiolus, to piracy in Naming Torrents
    @retiolus@lemmy.cat avatar

    It’s quite strange, I’ve been downloading torrents for more years than I can count, and I upload them from time to time, and I’ve always had the worry myself of how to name torrents: with dots? underscores? dashes? (although with spaces is definitely not an option).

    I’ve even asked the questions on several forums and upload sites, read tutorials on these same sites etc and every time I’ve asked the answer has been: THERE IS NO STANDARD, even on the tutorials, I’ve never seen anything mentioned such a thing.

    All this to say that I’m making a meme, and after so many years, this is the first time I’ve heard of a Warez scene, and several times in the same comments!, curious, isn’t it? I wish I’d heard about it before.

    Socsa,

    You should know that in most filesystems that are not NTFS, spaces in file names are not well supported.

    Pyrozo007,

    Can you give examples? Linux and Mac have no real issues as far as I’m aware. Nor exFAT or FAT32

    bam13302, (edited )

    The problem is really that space is an argument separator, so to safely handle filenames with spaces you need to handle them special, either by escaping them, quoting the entire thing. This means that the filename with spaces can’t be just copy pasted wherever you want, you have handle them special. It adds complications that are resolved by just using a separator that isnt used for other things, like underscore, or dash. Dot I also don’t like as much as it’s used as a separator for extensions, but that’s a far easier problem to handle by just ignoring all but the last dot, leaving only one really bad edge case (a file that does not have an extension, that uses dot separator in its filename having the filesystem imply a wrong extension.

    gayhitler420,

    I’m with the person you’re replying to, what’s an example? I haven’t had a problem working with filenames with spaces in at least ten years on windows, Linux or Mac…

    retiolus,
    @retiolus@lemmy.cat avatar

    Have you ever written a program or simply used a terminal?

    gayhitler420,

    Escape characters and autocomplete exist.

    It’s also really good practice to account for weird characters in programs and shell scripts you write because then you don’t have injection vulnerabilities or unicode problems.

    Seriously, what’s an example of spaces in filenames causing a problem?

    bam13302, (edited )

    for f in *.txt; do cat $f; done

    Will error for example. It works fine for filenames without space, but if the filename has space in it, it will be interpreted wrong. But if your testing batch doesn’t have spaces in the filename, you won’t see the issue until it’s used on a file that does. Note ‘cat’ is a placeholder, any function/script that can be used on a file here will have the same issue.

    Something similar to that caught me last week while I was unzipping multiple mods in bulk for a game.

    gayhitler420,

    I’m not at a bash terminal, but I think “$f” fixes that. I’ll look tonight.

    bam13302, (edited )

    You are correct, that is how I worked around the issue and why I mentioned that work around in my original post

    gayhitler420,

    I didn’t notice that part of your post. 🙏

    The point I guess I was getting at was that even having “come up” with Slackware and a whole os that’s just 69 half baked scripts in a trenchcoat I adopted a more universal mindset and specific skill set when using scripts over ten years ago and find it hard to justify expecting sanitary inputs nowadays when it is harder and harder with Unicode and is a serious security threat to treat variables as passable strings.

    I wasn’t trying to suggest that there isn’t a way to make a space in a filename cause an error, but that I can’t think of an example where allowing a space to affect things was a good or right way to do something.

    In the specific example of the op, no spaces is a scene rule from the days of ftp and irc/usenet. The idea behind having only a subset of the ascii character set was to allow those services to work with the files and commands around them. There’s no reason to treat my own scripts and programs as if they’ll never encounter the galaxy of other characters that are flying around now and to be honest, theres no reason not to work in sane handling of non ascii characters in filenames even for code I only expect to touch scene stuff.

    It used to be an unavoidable mistake when we dug up buried utilities. Now that there’s a number to call first it’s only the fault of the knucklehead with the shovel.

    Please don’t read this as some kind of an argument. I think we basically agree and I’m not trying to get one over on you.

    bam13302, (edited )

    To be fair, I didn’t really focus on the biggest annoyance I’ve had with spaces in the file name: going between terminals and the GUI, most filenames you can copy and paste with wild abandon, but filenames with spaces always require special care, sometimes stripping the auto completed escaped space from file names from the terminal, or quoting or escaping the space when taking one from the GUI.

    gayhitler420,

    That can be a struggle. There used to be a context menu option in maybe xterm or the kde terminal emulator that would copy the wd and maybe even the highlighted file but I might be gpt hallucinating that last one.

    After fucking up bad copying from the internet into a terminal about fifteen years ago I have tried to review and understand what’s happening when copying from or to the terminal even in part. It would be bad for me if there weren’t the possibility of (at best) having shit not work when I use middle click with abandon.

    I been thinking a lot about designing technology to discourage people from using it. For example it’s a serious mistake when wearable displays are made to look like wayfarers. The danger of people accepting them socially to the point of being manipulated into a state of flow, dissociating from their reality through a combination of sight and sound augmented reality, is too high. Good design of wearable displays should prioritize function over form 100% and make the user look like an insane freak that no one wants to be around, forcing people to remove them in order to maintain social interactions.

    I think copying to and from the terminal is like that. When going between an interface which is a very high level mediator of interaction with the machine and one that’s a very low level mediator, we should be alert, on guard and proofreading everything twice. It’s good that we have to check ourselves before we wreck ourselves copying and pasting into the terminal.

    ramjambamalam,

    That’s a problem with the shell though, not the filesystem. It doesn’t matter which files filesystem you’re using; most interactive shells use spaces as token separators and therefore spaces in filenames need to be enclosed in quotes or escaped.

    eluvatar,

    Clearly the best option then is to just use some of each. Like this: “MovieTitle-2000.Your_mom h.265”

    WarmApplePieShrek, (edited )

    Scene has standards. You don’t have to be scene to use scene naming standards. scenerules.org

    bjoern_tantau, to memes in Pfff, HTML
    @bjoern_tantau@swg-empire.de avatar

    coding != programming

    retiolus,
    @retiolus@lemmy.cat avatar

    xcuse Shakespeare

    GreenMario, to memes in "OpenAI Staff Threaten to Quit Unless Board Resigns"

    Surprised they are backing up a sister-fucker.

    CluckN,

    If he did the board would list that as a reason and be done with it. I haven’t seen any articles connecting those claims to his dismissal.

    canis_majoris,
    @canis_majoris@lemmy.ca avatar

    I’ve seen this in a number of threads but I’ve never seen direct proof?

    ssboomman,

    You can google it. She’s said on numerous occasions and in many many social media posts that he abused her

    Johanno,

    Everytime smb. says “you can Google it” I think about googling it and expect some weird niche article from some esoteric sites. But then I think, why didn’t you Google it and posted an link? Why should I try to find a trustworthy source for your claim?

    ssboomman,
    1. Because you asked
    2. It’s not my claim
    3. Because it’s a sensitive topic revolving SA and I feel weird sending the link.

    Regardless it doesn’t actually matter. I don’t owe you a link. If you want it I told you how to get it.

    TheAnonymouseJoker,
    @TheAnonymouseJoker@lemmy.ml avatar

    Accountability is not a strong suit of slimy weasels in the world.

    Johanno,

    What I wanted to say is:

    If all you have to say “you can google it” then maybe consider being silent.

    ssboomman,

    Nah I’m ok. Thanks for the advice though!

    ReversalHatchery, (edited )

    See, here I searched for it in the internet, the earth is flat: duckduckgo.com/?q=the+earth+is+flat&amp;ia=news

    Even The Guardian confirms it!

    This is a garbage method. You can find everything and the opposite too by searching for it on the internet.

    ssboomman,

    I’m not trying to have a debate or prove anything. I’m also not trying for find the most accurate ‘method’ fuck off with their Reddit debatelord shit.

    ReversalHatchery,

    Or, you could just shut up and not say “just google it” anymore. I think that’s the real solution.

    ssboomman,

    Just google it.

    tweeks,

    You’re willingly confirming something you rate as sensitive, trying to bring more credibility to it by being an extra shout and referencing a virtually unverifiable needle in a haystack ‘authority’ as Google, but find the sensitivity a reason for not sharing your information.

    How can you reason like this?

    ssboomman,

    Easily

    ReversalHatchery,

    I can also google that the earth is flat

    ssboomman,

    Cool

    mino, to memes in Pfff, HTML
    @mino@lemmy.ml avatar

    Unrelated: anyone knows what this template is called? I can never seem to find it or describe it intelligently enough to search engines.

    dangblingus,

    civil war elevator?

    runner_g,

    Captain America Elevator meme.

    mino,
    @mino@lemmy.ml avatar

    Thanks!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20975616 bytes) in /var/www/kbin/kbin/vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php on line 171

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2097152 bytes) in /var/www/kbin/kbin/vendor/symfony/error-handler/Resources/views/logs.html.php on line 36