« first day (424 days earlier)      last day (4525 days later) » 

8:00 PM
I don't want a crappy printer at home.
 
@StackedCrooked No the quality colour printer at home is reserved for nice nudes.
Curiously enough, it is only a few months ago I wrote a small utility that lets me format stuff to lpr. i.e. cat stuff | lpr-extra
 
Useless use of cat!
 
@CatPlusPlus my apologies fluffy one! Even though thats a fairly common usecase for me, or maybe tail stuff | lpr-extra
comes in very handy for logfiles and code too
NB. the tail is not your holiness' tail!
 
8:22 PM
woof
 
collapse
 
Would someone with Linux experience like to help me with an emergency online situation?
 
@kerrek - might be able to help
 
@Xeo Erm, no? C == C++ is undefined behavior. Sequence points yadda yadda.
 
@FredOverflow Is it?
 
8:25 PM
@FredOverflow Yo, when I slept with yo momma, she left me a message- you're killing the mood
 
c = c++; // definitely ub
c == c++; // ..?
 
@FredOverflow surely that one is unspecified, not undefined?
 
Yes, because you modify C and read it without an intervening sequence point.
 
it's not UB if C is an operator-overloaded class type
 
8:26 PM
Zing!
 
@awoodland So, I'm logged into a remote machine via SSH
 
@StackedCrooked c == c++ should be UB too
 
warning: operation on 'c' may be undefined [-Wsequence-point]
 
@KerrekSB ok
 
However, my user has been deleted. The logged in session is still active, though
 
8:27 PM
@DeadMG There are no classes in C.
 
Can I somehow get all my data off the account?
 
2 hours ago, by Xeo
Oddly enough, C == C++ in C and C++.
 
SCP doesn't work, because it says "you don't exist"
 
Xeo
@FredOverflow Oh right, reading too
 
The user has been deleted? Did you run him through the wood chipper?
 
Xeo
8:27 PM
Whatever :s
 
@KerrekSB rsync?
 
@FredOverflow your logged in user has been deleted? whtever you do dont log out, you still have your priviledges
 
(and is that SCP from dying machine to another target?)
 
@FredOverflow True, but there are in C++, meaning that it's only guaranteed to be UB in C
 
@awoodland If rsync uses ssh, it'll be the same problem...
 
8:28 PM
@CaptainGiraffe WTF are you talking about?
 
"Guaranteed" to be UB, lol
 
@FredOverflow sry @Kerrek
 
Xeo
@Kerrek: Do you have access to root?
 
@KerrekSB netcat would do
 
kek
 
8:28 PM
@KerrekSB Pack them and upload from that machine.
 
"You don't exist, go away!"
 
tar to stdout, pipe to netcat, run netcat on another host and write it to a file on the other host
 
No, don't connect from your machine to that one. Make it the other way around.
 
@awoodland All machines are behind some NAT. I could netcat to my home machine?
 
@CatPlusPlus +1
 
8:29 PM
@KerrekSB yeah that should work
 
No no, FROM the machine on which I'm logged in I cannot run SSH
 
fairly sure there's a superuser question on how to do it, hang on
 
Then run something else.
 
OK... I need to set up my local firewall first then
 
ftp, netcat, whatever.
 
8:30 PM
Could you give me the netcat syntax?
 
man netcat
 
Xeo
I still wonder how @KerrekSB managed to to have his user deleted while he was logged on
 
@KerrekSB tl;dr You are logged into a machine (unix like) your user on that machine has been deleted.
 
@Xeo It was long overdue. I just got away with it for too long :-)
(Don't tell me I should have made backups sooner.)
 
You should have made backups sooner.
 
8:32 PM
@KerrekSB we wont. the hurt is too close to home
 
you should have made backups sooner
 
1
Q: inserting an object that has const fields into a container

ShmoopySuppose I have: class A { public: const int x; A() : x(3) {} } And I'd like to create std::vector<A> g++ complains that the default assignment operator won't work since it tries to do this->x = x, which can't be done since x is const. Is there any way around this?

 
You should have not stored data on machine you don't control.
 
Sigh, yet another "I want my objects to be const and assignable at the same time" question...
 
@RMartinhoFernandes You're still 21 you have no say in this! DeadMG really???
 
8:33 PM
@CaptainGiraffe What?
 
@CaptainGiraffe I'm 24.
 
@KerrekSB think you want something like tar cvz - ~ | netcat your.remote.host portnumber and on your.remote.host netcat -l portnumber > my_files.tar.gz
 
I think. Lemme check.
Yep, 24.
 
@RMartinhoFernandes 24 = 4 * 3 * 2 * 1
 
@RMartinhoFernandes I rest my case.
 
8:33 PM
Oooh, I can downvote something.
Finally rep divisible by 5.
Woooo.
 
@CaptainGiraffe Hehe, thanks!
 
@CatPlusPlus glad I'm not the only one who tries to do that!
 
I lost my password database in HDD failure once.
Backups = good.
Dammmit, he removed it.
I DON'T WANT THAT 1 REP WHY DOES IT HAVE TO GIVE ME BACK THAT 1 REP.
;_;
 
@awoodland Everyone tries to do that. Right?
 
I downvoted some other answer
 
Xeo
8:36 PM
Dec 11 at 0:53, by Xeo
So, I have 20.001 rep. Who wants a downvote?
 
@CatPlusPlus just never press recalc and then it'll stay a nice number
 
Now I have 48835 rep
 
They recalc periodically.
 
Xeo
Damn it.
 
@CatPlusPlus mine too, now, thank you :D
 
Xeo
8:39 PM
640 flag weight, 9 flags waiting for review
// later
637 flag weight, 8 approved, 1 declined
 
Fail.
 
OK, proof of concept is set up
I can now telnet into my public IP on port 25565
 
this is stupid question, but how do people have xx5 flag weight under 500?
 
Xeo
Now tell me that this "answer" didn't deserve a "not an answer" flag, it contains the exact same code the OP already had in his question.
 
8:40 PM
@Pubby Maybe with declines?
@Xeo Hehe, that's what you get from flagging stuff just for the badge.
 
I thought declines were -10
 
@Xeo It's a wrong answer!
 
delete vote imo
 
Small hitch: There's no netcat on the remote box
 
Xeo
8:42 PM
11 flags just to get back to 640, bah
 
There is "nc" though
 
@KerrekSB that's proably it
several things go by the name nc sometimes
so some distros rename it
 
I'd $ man nc first.
 
Xeo
@KerrekSB man nc and see for yourself
 
8:43 PM
worst case get a statically linked one
 
Just in case it's Nuke Computer.
 
base64 encode it
 
Nuke China
 
do cat > netcat
paste it
then do Ctrl-D
chmod a+x netcat and unencode it
 
@awoodland ???
Ohhh
Clever.
No, I think "nc" should do the trick
 
8:45 PM
it's sort of like typing it it, but with copy and paste instead :)
 
It has the same syntax as netcat, so I ought to be fine.
It's live! 800MB, through an inner-city broadband ISP. Let's hope the connection doesn't cut out.
Thanks a lot everyone!!
Ahh, the fine Acrobat cache. What would I have done without that...
 
Btw, what server are you stealing data from?
 
obviously the CIA
 
It's an old account in a place I used to be at. It's my own data. I'm always logged in via SSH. Today they decided to kill my account, it seems.
 
lol I hope I'm not now an accomplice in some nefarious deeds
 
8:47 PM
Nah, you've saved large swathes of my work! :-)
 
yeah, your work setting up an international terrorist organization
 
@DeadMG Shhh :-)
 
Xeo
"your" work, eh? I don't know if we should believe you.
 
@Xeo Hey, this included my old carefully crafted website! What would I do without that?
 
Xeo
@DeadMG So long they only terrorize Java coders, I got no problem with that.
 
8:48 PM
Luckily I had port 25565 already forwarded for purposes of Minecrafting.
OK, excuse me while my internet connection is saturated for a few hours :-)
(Luckily I've capped already)
 
your mother's capped already
with a bathcap
 
@DeadMG Hmmm... I preferred the wide-screen yo-momma joke.
 
Arrghh. std::iota sucks.
 
eh
I probably have said plenty of good and not-so-good yo-momma jokes
 
@RMartinhoFernandes One of the most-needed algorithms!
 
8:51 PM
It's not std::iota's fault actually. It's iterators in general.
 
Xeo
Why?
 
Is there any x86 raw assembly simulator?
 
@DeadMG I have not heard a good yo moma joke, please enlighten me
 
I want to initialize a const vector with f(i) for i from 0 to N, where N is a runtime value.
 
@RMartinhoFernandes boost::counting_iterator + std::copy
 
8:53 PM
@CatPlusPlus the electronics dept at my school are using one, not sure what its called though.
 
or the iterator range constructor
 
well I'm sure not going to re-iterate every "yo momma" joke I've ever told
 
@DeadMG Thank you. Nobody here would want that to happen :-)
 
@awoodland Yeah, that. std::copy would suffer from the same issue as std::iota.
 
@DeadMG Arrange them in a priority queue pop one
 
8:54 PM
your momma would because they flatter her
 
@RMartinhoFernandes std::copy would work with std::back_inserter
 
you know, I swear, two minutes ago, I had a cookie I was eating
 
Xeo
@awoodland To a const vector?
 
@awoodland Into a const vector?
 
int * const vector;
I wish the Java folks got that one
 
8:55 PM
wtf even is std::iota
 
@RMartinhoFernandes Ah const. - that could still work with a copy ctor from the non-const one :)
 
Xeo
@awoodland Hmm, good idea.
 
I'm going to do the work in a lambda with a mutable vector that I move out into the const vector.
Or just make the vector not const.
 
what are conditions when variables are 0 initialized?
 
@RMartinhoFernandes I like the idea of a lambda for that - I'd always done it with anonymous NS functions and relied on RVO, but lambda + move is quite neat
 
8:57 PM
templates and static storage?
 
Xeo
std::vector<T> values;
int i = 0;
std::generate(values.begin(), values.end(), [i]{ return f(i++); });
std::vector<T> const final(std::make_move_iterator(values.begin()), std::make_move_iterator(values.end()));
Now if only the STL operated on ranges... /sigh
 
@awoodland "anonymous NS functions and relied on RVO," what is NS avd RVO?
 
0
A: Initializing object with indetermine value

kronosNo, int is not an object. In fact you have just 2 unitializied int values and get a warning about using an uninitalized variable.

 
std::vector<T> const final = []() -> std::vector<T> {
    std::vector<T> values(n);
    int i = 0;
    std::generate(values.begin(), values.end(), [&i]{ return f(i++); });
    return values;
}
 
A.k.a. why OOP destroys brains.
 
8:59 PM
@Xeo Better. Less moves.
 
Xeo
@CaptainGiraffe namespace, return-value-optimisation
 

« first day (424 days earlier)      last day (4525 days later) »