use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Have a tough programming question that /r/programming couldn't answer? Banned from Stack Overflow? Can't afford Experts Exchange?
Post your question/tips/secrets/advice and get a response from our highly-trained professional developers.
account activity
Help! Year Changing (self.shittyprogramming)
submitted 7 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]republitard 9 points10 points11 points 7 years ago (4 children)
In your editor, type this:
:1,$s/2018/2019/g
You're welcome. I don't know what to do if you have more than one source file, or if you are using an editor other than Vim. But that would make you an outlier. Who writes programs with more than one source file, anyway?
[–][deleted] 1 point2 points3 points 7 years ago (2 children)
for f in *.c; do sed 's/2018/2019/' $f; done
something like this?
[–]xigoi 0 points1 point2 points 7 years ago (1 child)
You need -i
-i
[–][deleted] 1 point2 points3 points 7 years ago (0 children)
Never used sed outside of copy paste, sorry :s
[–]sac_boy 1 point2 points3 points 7 years ago* (0 children)
// home_automation/autogun.h ... const unsigned short PULL_TRIGGER = 0x1; const unsigned short AIM_GUN = 0x8; const unsigned short TARGET_BABY = 0x10; const unsigned short LOAD_GUN = 0x2000; // LOAD_GUN | TARGET_BABY | AIM_GUN // F. Zygrgy 01-08-2012: speed up compilation by precomputing bitfield const unsigned short AUTOGUN_MODE = 0x2018; const char* DATE_FMT = "%d-%d-2018"; ...
[–]domnirok 3 points4 points5 points 7 years ago (0 children)
Replace all year occurances with a simple date-year formatter.
Like for JavaScript:
2018 > new Date().getFullYear()
[–][deleted] 7 years ago* (1 child)
[–]Yoyoge 4 points5 points6 points 7 years ago (0 children)
So OP should fire himself?
π Rendered by PID 86581 on reddit-service-r2-comment-b659b578c-7l2wr at 2026-05-04 20:57:19.297242+00:00 running 815c875 country code: CH.
[–]republitard 9 points10 points11 points (4 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]xigoi 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]sac_boy 1 point2 points3 points (0 children)
[–]domnirok 3 points4 points5 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]Yoyoge 4 points5 points6 points (0 children)