« first day (1406 days earlier)      last day (3543 days later) » 

11:00 PM
sed -i anyway
 
yeah, it's the escaping shit that's super annoying.
don't bother with a real interface, everything's stringly typed and it's graet.
plus Bash is probably doing some escaping of it's own so I'd probably need to escape the escapes.
 
user image
3
Kind cool
 
@Puppy Uh
 
How do you add unicode characters on SO?
 
@Puppy what are you trying to do?
 
11:04 PM
@Jefffrey With a keyboard
 
I have a bunch of directives that are #include "file", and I need to change them to #include "otherfile".
 
@Puppy and how do you know what to go from to?
 
@CatPlusPlus I can't copy and paste this character
 
@thecoshman er.. wat? Failed to parse that.
 
@Puppy do you mean it's a simple case of swapping all #include "foo.h" to #include "bar.h"? or is there some logic for what to change it to?
 
11:07 PM
yes, that's it. There's no matching groups or anyshit like that, just swap foo.h to bar.h
 
... both?
 
s/#include \"file\"/#include \"otherfile\"/ should work as far as sed goes.
 
⁣ ⁣
ow
I did it
 
@Puppy so you just want to apply a regex to a load of files?
 
nope.
char 10- unterminated "s" command.
did I mention that bar.h actually is a path, so it's more like dir/bar.h? sed might be getting confused.
 
11:09 PM
do you even regex m8
 
@thecoshman Yes, a simple replace.
@Rapptz Not unless I really, really have to. And a super-simple match like this shouldn't require one.
 
use tr instead then
 
Did I mention I tested that on Windows? I can imagine stuff breaks trying the same thing on Linux.
 
s/#include \"my\/dir\/foo\.h\"/#include \"my\/dir\/bar\.h\"/
 
it's not a Windows/Linux thing.
anyone with relatively decent knowledge of regex would know you have to escape /.
 
11:12 PM
@thecoshman Nope.
 
im not that smart with sed, but I'd do something akin to if line = "#include \"foo.h\"" print "#include \"bar.h\"" else print line... but the exact format for that I am not to sure about. Then you just need to pipe all the files through that, and some option to tell sed to edit the files in place (to avoid twating around with shit)
 
If you're using sed, you don't have to use / for s... if you don't, you get to use / in your regex
 
and when I say "Nope", I mean, "If sed actually gave back informative errors, I would quote the real error for you, but "Unterminated s command" is all you get, so there's really nothing more to say."
 
@Ell Because I get barely any FPS with an empty thing because of all the waiting :v
WebCore is on its own thread already
 
s_#include..._etc
 
11:13 PM
@chris, yes, and using a different delimiter is advised when manipulating paths (easier to read)
mmm forget it, you dont
 
Ell
Ahh okay
 
@Puppy If you posted the command we'd tell you
 
@Puppy, Are you including the ending delimiter?
s/str/replacement/options or whatever delimiter
 
@CatPlusPlus The one that I replied to.
 
Also that's overly escaped
 
11:15 PM
> sed -i s/#include \"CodeGenFunction.h\"/#include \"clang\/CodeGen\/CodeGenFunction.h\"/g
 
sed -ie 's~#include "my/dir/foo.h"~#include "my/dir/bar.h"~'
That's multiple arguments bub
You have enclose the entire argument in quotes
 
ITT puppy fails at understanding basic CLI usage (yet again)
 
Wish Windows would let me use single quotes
 
Not the first and not the last time
@chris Use PowerShell
 
@CatPlusPlus use Linux
 
11:17 PM
Or bash or whatever
It's not platform specific
 
Oh, I didn't realize PS actually let you
 
It's purely shell specific
 
I do have a limited bash available, too, I guess
 
AFAIK powershell is actaully good
 
Yeah, I just pretty much don't know how to use it beyond what I get in cmd and some extra stuff like ls
Which I get in cmd anyway
 
11:19 PM
I use the bash.exe that comes with git now a days
 
@thecoshman Well, neither sed nor bash mentions it. So I don't know how you're supposed to know it. Psychically?
 
$ cat test.txt
#include "bar.h"
$ sed -i 's/\"bar\.h\"/\"dir\/bar\.h\"/' test.txt
$ cat test.txt
#include "dir/bar.h"
 
Of course bash mentions it, it's shell 101
 
It would be so great if I could just switch between OSes without having to close everything and without needing to wait forever for a VM to start
 
any way, time to stop mocking the young dog for not being able to learn old tricks
 
11:20 PM
That you don't read any manuals is your fault entirely
 
Yeah, I'm sure it's in the hundreds of pages of man bash.
 
Puppy: "I shouldn't have to read manuals!"
 
on the contrary, it's the software's fault if reading the manual is a requirement.
 
@Puppy actually spend a half hour actually learning the most basic of things about using a shell?
 
the rest of the world manages to get by just fine without it.
 
11:20 PM
called it
 
Or in the info bash if the man pages aren't installed
 
I never read any manuals for VS or Windows and have no such issues there.
 
here comes the funposting
 
@Puppy no. The world should not pander to the lowest common denominator
 
11:21 PM
And how many years did it take you to learn everything
 
Ell
Are you having a laugh?
Someone please tell me he's kidding
 
Did you magically know about Ctrl+C?
Or any shortcut really
 
last I checked, Windows never tells you how to log in, you just have to know that you are supposed to push those letters to make things write on screen.
 
@CatPlusPlus Duh, everyone knows how to copy. /s
 
@Ell no, he really is this fucking ignorant
 
11:22 PM
I think it tells you to punch the vulcan death grip keys to log on now
 
yes, it's super ignorant to want to actually get on with what you're doing
 
Heh guess I don't have to call EndInvoke if I don't want to wait
:cripes:
 
Ell
Expecting to not need instruction on something is pretty stupid
You have to be taught everything
 
Those damn cars
 
depends on what the thing is.
 
11:23 PM
Needing instructions on how to drive em
ALL I WANT IS TO GET TO CHINA
 
Google's working on it.
 
Well it works for shampoo... though I'm not sure what kind of person reads the instructions on that
 
But congrats on being the kind of user we all loathe and make fun of
6
 
@CatPlusPlus I very nearly used a car analogy at work today, mechanics specifically :(
 
11:24 PM
Nobody expects that from a programmer
 
Ell
You have to be taught how to shampoo
When you're young
 
@HWalters I have because I was bored.
 
any way, night y'all
also, cicada ¬_¬ new account? those look like your answers...
 
Park is Cicada
 
> new account
 
Ell
11:26 PM
My vision is jittery again
 
Sync https://dl.dropboxusercontent.com/u/26824/ShareX/2014-08/2014-08-23_01-25-45.png
Async https://dl.dropboxusercontent.com/u/26824/ShareX/2014-08/2014-08-23_01-27-14.png
:v
Now why colours are bad
 
School assignments almost ALWAYS never let the student use anything in the STL.. aka std::vector, std::string, etc.. It's probably why you've been using new in the first place. Also, be careful about using vectors with matrices and games.. seeing as this is a battleship game. Especially if you value performance. std::vector will always initialise the underlying memory to default/0 before allowing you to write to it. Might not always be desirable. But again, if you aren't allowed to use std::vector, all the other answers were deleted and you'd now be screwed by StackOverflow logic. — Brandon 2 mins ago
This guy is ruining it :c
 
This guy is an idiot
 
I wish you could downvote comments.
 
@thecoshman huh this is neat
its one of those rare things i wish windows had
 
11:33 PM
Unfortunately, this question has turned into yet another demonstration of why my participation at this part of the SE network has dropped off so lately. — David Hammen 33 mins ago
 
Manually managing memory doesn't seem necessary as a beginner topic at all.
 
it isn't
 
@chris It is, but its also very short. "If you're managing it manually, you're doing it wrong. End of chapter."
 
You can do all sorts of neat little projects without ever thinking of managing things manually.
 
bloo bloo school assignments
Too localised
 
11:38 PM
eh
 
it's an advanced topic but people think it's something 'beginners' should know so it's taught and the cycle continues.
 
Even for other things, you can often wrap them in a std::unique_ptr or something.
 
Fuck C++
Tell me why my channels are wrong :(
Huh it's ARGB not RGBA
Weird
Oh well works who cares
 
FWIW, we learned about new and delete and stuff, but at least we also covered usage of the standard containers on the way and moved to some iterators and algorithms after.
Our last assignment didn't require any sort of manual anything IIRC
Or reinventing standard algorithms
And they were pretty good with allowing at least algorithms on the others, though the point of them was usually to like implement a BST from scratch
Or using something we made in a previous assignment I guess
 
@CatPlusPlus I hate that theres 2 conventions.
 
11:41 PM
haha 2
 
like half the time its RGBA the other half ARGB
 
I'm going to make standard RABG
 
But they suck so there's that
 
@Jefffrey You might succeed in america... their date format is mm/dd/yy after all
 
11:42 PM
> Indicates if we should convert BGRA to RGBA.
 
Or XYZ
 
I guess they actually just flip it around
 
@Borgleader YYYY/MM/DD should be the standard
 
@Borgleader The other countries do it wrong, too
 
11:43 PM
Also my thing is like the only piece of code online that uses this shit
So marvel at it
It prints a butan you can't click
 
My country does DD/MM/YYYY which is not as bad as MM/DD/YYYY but not as good as YYYY/MM/DD either
 
1988
I find it appalling that we haven't enforced that in any way
 
dd/mm/yyyy i like most because its in order of what i usually need to check the most
 
Or encouraged it on forms and such
 
For consistency, that would imply SS:MM:HH dd/mm/yyyy
 
11:45 PM
YYYY/MM/DD is great for ordering
 
So is YYYY-MM-DD
 
We should just use Stardate.
 

« first day (1406 days earlier)      last day (3543 days later) »