The Official First World Problems Thread™
-
I mean, what do you need the "$" char for?
Variables in quite a few languages are rather closely related to
$
…Backtick (
`
) is much rarer though
-
Like maybe having a broken "$" or "@". I mean, what do you need the "$" char for?
I program accounting software in perl you insensitive clod.
-
I program accounting software in perl you insensitive clod.
Hey! I thought I was an insensitive clod, and now here you are calling other people that!
-
Hey! I thought I was an insensitive clod, and now here you are calling other people that!
Sorry, I didn't know we were exclusive.
-
-
-
-
So far no convincing reasons for needing "$".
Anyway, new keyboard solved the problem (problem persisted even when plugging the kbd into a different machine). Weird way for a keyboard to go - had others die on me before, but never that way. *shrug*
-
To the evil ideas thread with you!
It makes for pretty weird code. You need to have a space between whatever is preceding the
$
and the$
for the preprocessor to do the substitution (with some exceptions). I.e.return 0 $
is ok, butreturn 0$
produces an error (GCC: "invalid suffix "$" on integer constant").
-
Yeah, I know, it was fun testing that. The error you saw--MSVC gives the same one--is a verbose form of "?SYNTAX ERROR". printf(...)$ works, though.
iostream does NOT like it at all, regardless of whether you put the macro before or after the include statemen.
-
Actually, the error surprised me--I guess it means modern compilers don't necessarily run the preprocessor as a separate physical step before parsing, because otherwise it would have worked fine.
-
iostream does NOT like it at all, regardless of whether you put the macro before or after the include statemen.
#define iostream stdio.h
Fixt.
-
D:\apps\Microsoft Visual Studio 11.0\VC\INCLUDE\iosfwd(679) : error C2143: syntax error : missing ';' before '.'
-
NSFW commit message? Where?
-
NSFW commit message? Where?
It was that "fuck all the stars" discourse commit, or whatever the actual text was.
-
So:
- Jeff decides he doesn't like a feature of a piece of software
- Jeff deletes part of the interface for interacting with that feature
- Jeff decides to swear in the commit message
- Jeff realizes that it's unprofessional to swear in commit messages
- Jeff censors half of the letters in the first word
- Jeff pushes the feature removal to GitHub
Also, I find it funny to see this commit message:
FEATURE: we got rid of one of the features we used to have that people used. this in no way IMPROVES DISCOURSE but we don't give a fuck about the QUALITY of our software or any fictional guarantee of keeping the same API or having a coherent USER EXPERIENCE.
-
It's even better than that! Step 1 was less "Jeff decides he doesn't like..." and more "someone posts a CSS customization they're toying with on meta.d and now the feature is gone"
Granted, this one was something Jeff found on github, rather than the whole Likes column fiasco: https://meta.discourse.org/t/minimal-discourse/23288 -- but still. Programmering is hard guyz!!!
-
That was indeed the one.
-
-
Actually, the error surprised me--I guess it means modern compilers don't necessarily run the preprocessor as a separate physical step before parsing, because otherwise it would have worked fine.
Nah, both GCC and MSVC allow
$
to be part of identifiers. So, something likea$b
is OK as a variable/function name. The same applies to the preprocessor, which only operates on whole tokens. So when it sees something likefoo$
, that's a single token, and notfoo
+$
(where the latter could be expanded).In my example
0$
is also a single token, and therefore passes through the preprocessor unmolested.(I've seen code generators use '$' to decorate generated symbols that need to be visible externally, but also shouldn't collide with other stuff.)
-
I've seen code generators use '$' to decorate generated symbols that need to be visible externally, but also shouldn't collide with other stuff.
"Name mangling", I believe it's called.
-
"Name mangling", I believe it's called.
Code generators that produce C/C++ code, so before the compiler's internal name mangling (as defined by the ABI). I.e., the
$
turn up in the actual C/C++ code. (But, yeah, the concept is the same.)
-
Ok.
-
Backtick (`) is much rarer though
I write perl scripts to interact with an application running on Linux. We have eleventy billion command line tools provided by the vendor which I frequently need to collect the output of in my scripts. Though it's just uncommon enough that there won't necessarily be one already, in a script I'm modifying, to copy-paste.
I could probably do without # quite well.
-
I write perl scripts to interact with an application running on Linux. We have eleventy billion command line tools provided by the vendor which I frequently need to collect the output of in my scripts. Though it's just uncommon enough that there won't necessarily be one already, in a script I'm modifying, to copy-paste.
TIMTOWTDI: use
qx/command/
-
Huh, hadn't come across that. Thanks - if I ever find myself unable to type a backtick, I shall remember. I take that back then.
-
It's one of the quote-like operators.
Unfortunately there is no such operator for comments, so I'm not sure how you'd do without #. Don't you comment your code or do you only use POD blocks?
-
duh! I knew something really obvious that # was for that I was forgetting, but I'd forgotten it. It's the character of choice where I work for the match operator whenever / is inconvenient and that was all I could think of. Major brainfart moment.
-
duh! I knew something really obvious that # was for that I was forgetting, but I'd forgotten it. It's the character of choice where I work for the match operator whenever / is inconvenient and that was all I could think of. Major brainfart moment.
Heh
If / is inconvenient, I tend to use
m[...]
orm{...}
.
-
I detest the use of #, because if you end the regex with $, as is common for us, it b*ggers up the syntax highlighting in vi (which I nearly always use for editing). But it seems to be an established practice here.
It's the fault of the text editor not the use of #, of course, but is none the less irritating.
-
I detest the use of #, because if you end the regex with $, as is common for us, it b*ggers up the syntax highlighting in vi (which I nearly always use for editing). But it seems to be an established practice here.
It's the fault of the text editor not the use of #, of course, but is none the less irritating.
I resemble that remark. Also use Vim, also pissed off at wrong highlighting. Do your colleagues use Vim also? If they do, don't they also get irritated by the wrong highlighting?
-
FWPP: looooooooong builds. RIght now I'm watching hundreds of files being uglified and it takes soooooo long!
FAILURE: Build failed with an exception.
...fuck
-
"The application uses a custom framework that is designed specifically to our needs. Its goal is to be simple and fast while features should be built in as needed."
-- The introduction to the documentation for the most complex, impossible to understand codebase I've seen yet.
-
it takes soooooo long!
Pipe the output through this: https://github.com/BenLubar/delay
-
delay takes a stream of data on the standard input and writes it to the standard output after a specified delay.
That didn't help.
-
I'm accepting patches that make it work with negative arguments.
-
But is it fast?
-
Surprisingly yes.
It took almost 20 man hours to figure out how to get in place a unit test runner functionally identical to the other five runners I've made for other products in ~2-3 hours each, but each time I made a change it came back with a cryptic error message very quickly.
-
At some point in the recent past I was at a grocery store that I don't normally go to. At the time, I needed new storage / freezer bags (I always buy generic versions of ziplocks, 'cause they're good enough and cheaper). I keep quart and gallon sized bags on hand.
The only sensible way to store the boxes is so the small side of the box points out. Then they stack nicely and don't take up a ton of room. The geniuses who designed the packages at the other store don't bother to put the bag size on that side of the box. WTF, guys?
After being annoyed by this for a couple of weeks, I finally took a pen and solved the problem.
-
After being annoyed by this for a couple of weeks, I finally took a pen and solved the problem.
You wrote, "this box sucks!" on the side? Or did you mean penknife?
-
You wrote, "this box sucks!" on the side? Or did you mean penknife?
I took one of the boxes and wrote "GALLON" on both sides that could face out of the cupboard.
-
I took <abbr title="the one that had gallon size bags">one of the boxes</abbr> and wrote "GALLON" on both sides that could face out of the cupboard.
The first world solutions thread is over there.
-
That's not how you're supposed to use the abbr tag you monster! You broke all semantics!
-
-
-
@accalia Is Doing It Wrong™
-
Ah, so sad that we can't let the bot name someone else...
-
Ah, so sad that we can't let the bot name someone else...
that reminds me that is on my TODO list for the bots.....
-
I'd have to figure that out in JS, and, well....effort.
-
I'd have to figure that out in JS, and, well....effort.
or you wait for me to do it and then finally update your bots. :-P
or is that also effort?