• ¯\(°_o)/¯ I DUNNO LOL (unregistered) in reply to Jeff Grigg
    Jeff Grigg:
    That's it. My new coding standard is to use the
    NinjaSquirrel:
    as my standard loop index variable in all code.

    ;->

    I would rather use a dotless-i because then someone can't come around and change it to ALL CAPS! But if the language supports beyond U+FFFF, I could use the pile of poo emoji as my loop counter!

  • David (unregistered) in reply to MiffTheFox
    MiffTheFox:
    grasshoppa:
    Guestimate:
    ... should simply be "//ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"?
    Did you know that that notation is the same as the way to refer to another computer on a local nework ? And that for that reason you might get odd delays (the OS looking for such a computername) when trying to view a saved html page.

    Been there, done that & found the above reason.

    I do not know who thought that specific shorthening (of just 5 chars) would be a good idea. :-\

    As has already been mentioned, the reasoning was to allow for protocol independence. If the page is loaded over http, it will use http. If https, then https.

    On windows, at least, it's backslashes that indicate a network location. I've never had the issue you've had, and I'm a bit baffled any web browser would behave in the manner you suggest.

    If it's over http, it uses http. If https, then https. And if the page's URL happens to start with "file:" (remember Guestimate said a saved HTML page), then IE (and probably any other Windows-based browser) is happy to interpret the URL as "file://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js", which maps to the UNC pathname "\ajax.googleapis.com\ajax\libs\jquery\1.5\jquery.min.js" tries to connect to a CIFS server on ajax.googleapis.com, with all the slowness that entails.

    Ok then the issue has nothing to do with a protocol relative link starting with "//" but with the simple fact that relative links should be either converted to absolute links or the related content should be saved along the saved file and the links rewritten accordingly if you're going to save a html file locally and you expect the links still to work. Otherwise broken links are to be expected regardless of the browser.

    All common browsers (including IE) interpret "//" correctly since ages. So just use it and don't believe any FUD.

  • Jorn (unregistered)

    Yeah, I've done this... http://stackoverflow.com/a/23885812/8681

  • (cs) in reply to Doodpants
    Doodpants:
    TRWTF is that those so-called "smart" quotes aren't even smart, since they're both pointing in the same direction.
    »Why, when you type ›"‹ after ›=‹ you obviously want it to become nines. Sixes only come after whitespace. That must be the right way to do it, ›cause that‹s what the computer does, and computers are smart.«

    (These are german style guillemots, FTW. Proper french ones require some space at the inner side, and I have no idea which one, nor how to type it on a telephone)

  • Will Genich (unregistered)

    This is why source code should always be in ASCII, where "smart" quotes and other irritation-caused characters show up as the rubbish they are. No exceptions - even string constants, which should be in English and translated by something else later on if needed.

  • aaargh (unregistered)

    It might be worth giving your bloggers an upper high school literacy test before allowing them to post.

  • Zainab58 (unregistered) in reply to Doodpants
    Doodpants:
    TRWTF is that those so-called "smart" quotes aren't even smart, since they're both pointing in the same direction.
    I was going to say:

    TRWTF is that %E2%80%9D isn't an open quote, it's a close quote. So whatever entity generated the smart quotes didn't even do it right.

    Or is TRWTF that the author has joined the long list of people whose fingers typed "mod_redirect" when their brains means "mod_rewrite"?

    Or is TRWTF that blame is dumped on mod_rewrite when it belongs by rights to the human CMS developer who decided !-f is an appropriate handling of all incoming requests?

  • cyborg (unregistered) in reply to aaargh
    aaargh:
    It might be worth giving your bloggers an upper high school literacy test before allowing them to post.

    Based on which country's standards though?

  • (cs) in reply to bigbob
    bigbob:
    ... should simply be "//ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"?
    It's a good idea if you may need to use either http or https (protocol independent). It avoids getting those crappy mixed security messages when you are developing without SSL internally before deploying to a production site with SSL.
    Except:
    • If you're deploying on SSL, why don't you develop on SSL? Set a self-signed cert, add it as trusted in your browser, and develp as it's supposed to work.

    • Even if you're testing over http: with no SSL, I know of no browser that would throw a "element too secure" warning if you try to load a "https://" src from a http: or file: location.

    • Have you actually tried the "//[whatever]" syntax? ** Chrome 35 goes cuckoo banans if you try to open it from a "file://" location. It fails with a net::ERR_FILE_NOT_FOUND after 1.13 seconds. ** Opera 22 will wait for over 22 seconds before failing!! ** MSIE 11 takes about the same, 21+ seconds. ** Firefox 30 seems to be the only one sane enough to ignore the malformed url altogether.

    TL;DR: Just use "https://[whatever]" and be done with it.

  • (cs) in reply to Steven W
    Steven W:
    OSX does this to me on any copy/paste operation into a rich text editor. If you use the notes app it will convert your quote characters. If you paste into an e-mail it converts your quote characters. It's pretty annoying.

    You can configure it in System Preferences / Language & Text / Text.

  • QJo (unregistered) in reply to cyborg
    cyborg:
    aaargh:
    It might be worth giving your bloggers an upper high school literacy test before allowing them to post.

    Based on which country's standards though?

    France, Germany or Sweden. At a pinch, Scotland.

  • (cs) in reply to Grammar Nazi
    Grammar Nazi:
    I have edited for readability. Apostrophes in the wrong places, tense and number not agreeing, too many commas, and sentence fragments all made this harder to read than it should have been.
    I didn't notice the grammar at all. Then again I'm not a native writer.

    By TDWTF standards I thought it was quite well-written, let's say "style-wise".

    I want to welcome Bruce Johnson and congratulate him on his first article.

  • Frist (unregistered) in reply to jarfil

    Browsers don't throw a[sic] "element too secure" warning. But proxies will by design pass through any connection. In which case you might as well just inline everything FOR SPEED.

  • (cs) in reply to ¯\(°_o)/¯ I DUNNO LOL
    ¯\(°_o)/¯ I DUNNO LOL:
    I would rather use a dotless-i because then someone can't come around and change it to ALL CAPS!
    Yes they can. You know that I is the correct capital of ı (dotless small-i), right? And that İ (dotted capital I) is the correct capital of i?

    Well, they are, when you write in Turkish. This causes confusion in software contexts...

  • Anonymous Will (unregistered) in reply to m
    m:
    »Why, when you type ›"‹ after ›=‹ you obviously want it to become nines. Sixes only come after whitespace. That must be the right way to do it, ›cause that‹s what the computer does, and computers are smart.«

    (These are german style guillemots, FTW. Proper french ones require some space at the inner side, and I have no idea which one, nor how to type it on a telephone)

    French quotes require a thin non-breaking space on the inside (you don't want a line-break there).

  • (cs) in reply to anonymous
    anonymous:
    Anonymous:
    Now, tell me which editor (except using Word to open HTML as text files) will insert smart quotes there.
    I'd not point my finger at the IDE... I'd blame the dev

    We had a Mac user learning HTML come into our shop one day saying their (static) HTML was not rendering right in some browsers. Turns out we all incorrectly assumed that a name like "Textedit" would contain an actual text editor, not a quote mangling almost word processor.

  • Neil (unregistered) in reply to jarfil
    jarfil:
    * Have you actually tried the "//[whatever]" syntax? ** Firefox 30 seems to be the only one sane enough to ignore the malformed url altogether.
    Firefox ignores the "server" portion of file: URLs so it actually ends up with 3 /s: file:///ajax/libs/jquery/1.5/jquery.min.js (which could actually be made to work on a Unix-based system).
  • (cs) in reply to Frist
    Frist:
    Browsers don't throw a[sic] "element too secure" warning. But proxies will by design pass through any connection. In which case you might as well just inline everything FOR SPEED.
    The idea behind including stuff from googleapis.com, is that the more websites do that, the more probable will it be for any browser to already have a cached copy of the scripts. That translates into a blazing fast https connection just to receive a "304 Not Modified" (it takes <50 ms here).

    So what if outgoing proxies let it pass through? It's only supposed to get downloaded once, per client, ever. Reverse proxies on the other hand, as in those accelerating the website, won't even see it.

  • saepius (unregistered) in reply to chubertdev
    chubertdev:
    When we interview candidates, I always take their resume and highlight any instances of the word "complex."
    You don't like people who studied complex analysis?
  • Eli (unregistered) in reply to Anonymous

    Copy/pasting from a blog

  • (cs) in reply to saepius
    saepius:
    chubertdev:
    When we interview candidates, I always take their resume and highlight any instances of the word "complex."
    You don't like people who studied complex analysis?

    They're very pedantic, no one likes pedants.

  • (cs) in reply to someone

    I TA a computing class. The professor's course is given as a PDF with smart quotes even for the snippets of code that the students are expected to copy-paste. I use the student's reactions to the compilation errors as a litmus test for their future success in I.T....

  • anonymous (unregistered) in reply to Anonymous

    Outlook. Code could easily be emailed around and copy/pasted in.

  • Chris Chiesa (unregistered)

    We had the same problem in a Web Design course I took last year. We would get chaos-causing smart quotes when we cut-and-pasted... from our own textbook (on DVD)... that had been written-and-produced by our own instructor.

    I'm trying to remember whether Dreamweaver (which our instructor wrote the textbook around!) also injected smart quotes, all by itself -- or if I'm confusing this with some other issue. There were a few...

  • Gary B (unregistered) in reply to That admin guy

    Is there a good reason to use Ubuntu on a web server at all? It seems to me that a webserver would generally not have any GUI installed, and the main reason for using Ubuntu seems to be the GUI.

  • NH (unregistered) in reply to ¯\(°_o)/¯ I DUNNO LOL

    Which in the end is why I call them stupid quotes - they don't add anything at all.

    And the fubar they can cause when writing an installation document.

  • lesle (unregistered)

    Bruce, for future reference, collective nouns for turtles are bale, dole, or nest. I do concede that herd probably conjures the intended mental image better.

Leave a comment on “Code Abuse”

Log In or post as a guest

Replying to comment #436203:

« Return to Article