« first day (353 days earlier)      last day (4588 days later) » 

hey
12:06 AM
hey
I am not native English speaker, maybe you can explain what does compliment mean in maths?
srry for offtopic
 
Complement?
 
hey
yeah
 
As in sets, or binary numbers?
 
hey
read it on wikipedia, still not getting
here is an example
 
Sorry, I don't have access to that.
 
hey
12:10 AM
Probably sets I guess
 
Though from the title, that sounds like logical complement.
It's also known as "negation".
 
hey
F=A(CD+CD)
 
Basically "not true = false" and "not false = true".
 
hey
F=x'y'z+x'y'z
 
 
8 hours later…
7:49 AM
Well this is the kind of food one tries once and find "interesting", and don't do any more, namely reindeer shavings in a sauce with sour cream, goat's cheese, berries, mushrooms etc., with a large helping of potato mash:
he he sorry sbi
 
sbi
8:20 AM
@AlfPSteinbach I don't believe for a minute that you are sorry for doing this to me.
@TonyTheLion Did you start to read?! And Pratchett, even! Great!
 
you know
 
Or maybe he saw that quote flung around here (or somewhere else on the Internet).
 
it occurs to me that I have a right under national legislation to view any data that the university holds on me
and that actually, withholding my results is probably illegal
 
Can anyone tell me what exactly is the difference between the computer science program and the computer engineering program over here
@DeadMG ?
 
@sbi No, it was just a cool quote :)
 
sbi
8:36 AM
@RMartinhoFernandes I'm sure he hasn't read the book, I was just pulling his leg.
 
you'd have to ask the specific university what the difference is
 
I wonder why they are charging double for computer engineering?
 
Because people pay for it.
 
@sbi that's why my leg feels so weird, you've been pulling it... :P
2
 
@RMartinhoFernandes Why don't they just pay for the computer science program?
looks almost similar to me.
 
sbi
8:39 AM
@TonyTheLion Actually, Pratchett's books are full of such cool quotes.
Recently I have developed the quirk of folding a corner of a page whenever I encounter a memorable quote, in order to easier find it later, when I'm searching for one. Had I already done it when I ploughed through Pratchett's books, they would look really funny, because I would have had to fold every other page, and fold some several times.
 
I am seriously beginning to think the university rips people off this way...
 
8:53 AM
what is a good C++ design for an object that you can query repeatedly to obtain successive solutions of this puzzle:
 
Provide an ordering sort of like std::next_permutation works?
That or an input iterator for iterating.
Although to be fair an input iterator would most likely be wrapping around a preexisting interface/design so that's not really an answer at all.
 
yes, that's interface, but regarding implementation i feel like this is the kind of thing where a continuation or full coroutine would be right. but we don't have that, do we?
 
Boost.Coroutine is orphaned IIRC :(
Tbh not knowing how solving works I don't really know what an implementation would map gracefully to. There's like 3 different Boost libraries for automata if that's your kind of thing.
 
why not try it? i posted a program for first solution yesterday, just because of weird error in codepad.org compiler setup (claimed that it didn't find [stddef.h], far down in the source code)
 
9:20 AM
 
@MrAnubis i'm stealing that too for facebook! :-)
 
9:41 AM
oh hai
 
hai is japanese, isn't it?
 
@AlfPSteinbach It is. But "oh hai" is LOLcat.
 
got my results
 
u passed?
oh no, you failed?
 
well
I failed, but because of my sickness claim, I get to try again
it'll be a mess, though
 
9:51 AM
hm, but now you can concentrate on only the thing(s) were you failed, right?
i bet it was that prolog thing he he :-)
 
@DeadMG at least they're giving you a second chance
I'd go for it, and make the best of it, perhaps you can get through :)
 
Holy mother of flags!
 
I know, the PHP room seems to be having flag wars
 
Some seem valid. Like spammed requests for help.
 
10:06 AM
I just always click invalid
can not be asked to do anything else
 
well
my mother is right and suggested I transfer to another university
 
I can’t tell – is this guy in the comments just trolling me or does he have a point?
3
A: Purpose of Unions in C and C++

Konrad Rudolph If this isn't the intended behaviour of unions, what is? Can some one please explain it elaborately? “undefined” does not necessarily equal unintended. The fact that this behaviour is undefined follows logically from the fact that hardware and software architectures differ and C tries to cat...

Put differently: is it UB to call a function that is not defined in the standard?
 
the thing is, I much prefer the programming part, whereas the modules I failed were mathematical
so if I were to change university, I might get a more suitable course
 
@KonradRudolph It's not UB to call a function, no. Assuming proper declaration / compatibility with implicit declaration (for C).
 
So just a troll?
I had to ask …
 
10:22 AM
Also there's a way to use dlsym for function pointers that invokes implementation specific behaviour (though that's somewhat up to interpretation) and no UB.
 
@Luc True, it’s actually in their documentation.
 
Yes, that one ;)
 
But as curiousguy himself said, this is interpretation of the standard is contentious. It does silence the compiler warnings, though.
 
I think it's actually quite safe. Conversion to void** will be implementation defined and since the implementation guarantees a 'nice' value I don't see the harm in dereferencing and assigning.
Perhaps some care could be taken regarding aliasing, I'm not sure.
 
Ugh, vanilla VS2008 sucks.
 
10:36 AM
vanilla VS2008?
 
@KonradRudolph he's not trolling, he's an idiot. i would guess very young aspiring hacker (due to comments about sockets programming).
 
@TonyTheLion Yes, VS2008 as it comes out-of-the-box.
 
oh I see
never heard the "vanilla" expression
 
Really?
Well, it comes from the fact that vanilla is the "default" ice cream flavour.
 
yes
lol, woah, TIL vanilla
 
10:40 AM
Vanilla is a common expression for the basic out-of-the-box version of software
 
Not just software, it applies to pretty much everything.
I like strawberry VS myself.
 
(Ok, now I'm stretching the metaphor a bit.)
 
hove many of these flame warriors have you met?
 
@RMartinhoFernandes hi sorry the thing kept disconnecting me last night
 
sbi
10:54 AM
Wow, 33 flags in the PHP room. And nothing of this an hour ago.
 
@AlfPSteinbach If you look at some of his other answers you’ll see that he’s not a complete idiot. At least one answer offers a very rare insight into C++ arcana. He even stumped Johannes.
 
@RMartinhoFernandes I still don't see the point though, can't we check to initialize Foo.x to 1 or something?
 
@KonradRudolph I looked at that. It seems he picked that up from me and Johannes discussing that issue in clc++. I have in recent years often encountered people who appear to have insights about this and that, only to discover that they're more or less blindly copying what others have said, guided only by vague associations.
I think it is a problem of recognizing "weird" motivations. Me, when I discuss something most often the goal is to learn, or teach, or sometimes (I have to admit) not very nice but, stomping on someone just because I'm very irritated. In contrast, the copycat folks have as goals to put on an appearance, to fit in socially, such things, and if one assumes normal goals then it can all be very very baffling - at least to me... :-)
 
sbi
in Tavern on the Meta on Meta Stack Overflow Chat, 4 mins ago, by sbi
The PHP room on SO is just now drowning us in a flag war. Is any of the mods here to have a look at that?
 
@sbi It didn't seem like a flag war to me. I looked like some user spammed the room with help requests. I validated some of those flags.
 
11:04 AM
me 2
oh dang, now i finally understood e=mc2. i is m, c 2.
 
right, it's probably "is mc 2" i.e. is motorcycle 2. einstein fervently wished for a motorcycle. he never got one, just a boat. i probably need more coffee.
sorry
 
> error: 'T& val<T>::operator()(T&) const [with T = int (&)[16]]' cannot be overloaded
 
I was about to say you already had too much coffee, but well... :)
 
Any clue as to what that error means?
 
11:09 AM
Is there another operator()?
 
I'm guessing operator()(T&&) conflicts due to reference collapsing.
 
Is everything in C++ pass by value as it is in Java?
I think it is pass by value
 
In Java everything is pass by value, but most things are actually references.
In C++ you get to pick on a case-by-case basis.
 
eh I think it is pass by value...even references are pass by value
 
@LucDanton Swap the order around. GCC should complain about the other. That could confirm it.
 
11:11 AM
as are pointers
 
@RMartinhoFernandes The larger problem (which prompted me to write that overload in the first place) made me switch the angle of attack, I'm trying something different now.
 
@LewsTherin well reference arguments open for some diverging opinions. but a view of pass by value is practically helpful for understanding things.
 
I'm not sure what the standard says, but I never thought of C++ references as "having value".
 
@AlfPSteinbach I think a pass by value is not only helpful but it is also *right*
There is nothing like pass by reference
but there is pass by reference value or pass by value reference whatever
#include <iostream>
using namespace std;

void myFunc(int *a, int **b)
{
    *a = 20 ;
    a= NULL // doesn't change what b points to
    *b = NULL ; //changes what b points to .. hence pass by value
}
int main (void)
{
    int a = 10 ;
    int *b = &a ;

    cout << a ;
    cout << endl << b;
    myFunc(b, &b) ;
    cout << endl << a ;
    cout << endl << b;

    return 0;
}
That shows that there is no pass by references
the crap thing is I can't figure out how to do the same in Java
it is impossible so I guess it behaves in a similar fashion to C++ references
 
Yes, if you don't use references, there is no pass by reference.
 
11:17 AM
@LewsTherin You can hack around and simulate pass by reference with arrays.
 
@LucDanton Even C++ pass by reference is pass by value. Just that you can't rebind
 
That's a common hack in Java to get "closures".
 
@RMartinhoFernandes how ?
 
@LewsTherin oh, I was thinking of like void foo( int& x ). it's debatable. but you can still apply a mental picture of implementation based on pointers (which are then passed by value).
 
There's a clear difference between these two:
// Java
void f(Object o) { // pass a managed reference (a "handle") by value
    o = new Object(); // changes nothing outside
}

// C++
void f(T& t) { // pass a reference
    o = T(); // changes the thing outside
}
 
11:18 AM
@LewsTherin C++ pass by reference is pass by reference in the CS meaning. I'm not sure how rebinding enters in the picture.
 
Is there a minimum rep requirement to self-answer now?
 
@awoodland Dunno, but I'd expect you to have crossed it.
 
@LucDanton what I am trying to say is you can't make the pass reference point to another object or value..which means not variable in the function parameter is different it isn't the reference passed in
@RMartinhoFernandes where does o come from?
 
@LewsTherin void nullify(int*& p) { p = nullptr; }
 
? p is just a normal variable then?
 
11:21 AM
@LewsTherin Does it matter? It won't change. Object a = new Object(); f(a);
 
*& cancels each other
 
Nope. That's the operators.
 
@LewsTherin Do not mistake the type annotations & and * with the operators.
 
so what does int*&p mean?
 
@LewsTherin What's a 'normal' variable?
 
11:22 AM
It's a reference to a pointer.
 
@LewsTherin Do you understand what T& is?
 
@RMartinhoFernandes hiw di you change what a points to in f
@LucDanton yeah a reference to type T
 
What's int*? As a type?
 
oh I see because it is in a declaration it is different
a pointer to an int
 
So you understand int*& :)
 
11:23 AM
@LewsTherin In Java it doesn't change. That's the point. In C++ it does change.
To get behaviour similar to C++ references in Java you need to do something like this:
// Java
void f(Object[] o) { // hack to get "pass-by-reference-ish" in Java
    o[0] = new Object(); // changes stuff outside
}

Object[] o = new Object[1];
o[0] = new Object();
f(o);
(WTF were those numbers?)
 
@RMartinhoFernandes - wasn't for me. A question I saw got answered in an edit by the OP rather than as a self answer so I commented suggesting that answering as an answer would be more appropriate.
 
@RMartinhoFernandes Line numbers you selected?
 
I've moved it to a CW answer anyway now
which I think is the right action over flagging
 
@RMartinhoFernandes ok I will try it..to make sense of it
 
@LucDanton Oh right. Stupid websites.
 
11:25 AM
Huh.
 
@LucDanton I understand your code :) cool Now for @RMartinhoFernandes
@RMartinhoFernandes so you pass an array of references to a function
Only a reference to the first element is passed yeah?
 
@LewsTherin can't do that in c++
 
No, a (Java) reference to the array is passed. The array is an array of (Java) references. You cannot replace the array with a new one, but you can replace the (Java) references inside it with new ones.
 
@AlfPSteinbach I am talking about java xD
 
That's why you get to see the changes outside.
 
11:30 AM
@lews: this is where the pointer implementation picture breaks down for references: the standard is very pedantically careful to not pin down how references can be implemented, so for one thing you can't have an array of references
 
It's the "standard hack" to get pass by reference.
 
@RMartinhoFernandes i think to find that on the web, easiest is to search for "swap in java"
 
@RMartinhoFernandes I'm getting confused is it a reference to the first element passed into the function or a reference to the array itself? Isn't it the same thing..
 
C++ has true pass by reference, so you don't need these hacks.
@LewsTherin A reference to the array. It's not the same thing in Java. You cannot assume that one language works like another.
 
Oh
Oh the reference type is different
int a[] = new int[5] is a reference to 5 elements a[0] is a reference to one int
or something like that :S
 
11:35 AM
a is a reference to int[].
 
yeah but a[0] is a reference to int*
 
You need to be clear on what language you're talking about...
 
@LewsTherin No such type as int* in Java.
 
Java lol
here
damn it
so hard to forget about C++ when learning Java
or not make comparisons
 
If the arrays confuse you, you can achieve the same with this:
// Java
class Box<T> { T item; }

void f(Box<String> box) { // hack to get "pass-by-reference-ish" in Java
    box.item = "Blah"; // changes stuff outside
    box = new Box<String>(); // doesn't change anything
}

Box<String> box = new Box<String>();
box.item = new String();
f(box);
 
11:38 AM
that's even more confusing lol
 
The function takes a reference to a Box.
And if it changes the inside of the Box, the caller will see the insides changed.
 
I don't get it. GDB segfaults hard when reading the symbol of my executable but Valgrind happily works with it.
 
However, if it replaces the whole Box, the caller won't see it.
 
Oh I think I get it
public class ChangeRegs {

	public static void func(String[] s)
	{
		s[0] = "ds" ;
	}
	public static void main(String[] args)
	{
		String[] arr = new String[3] ;

		arr[0] = "Hello";
		arr[1] = "Ha";
		arr[2] = "!";

		func(arr) ;
		System.out.println(arr[0]) ;

	}

}
arr elements contain references to string items
 
11:40 AM
but only the reference to the array is copied into s
but s contains references and can be used as if they were locals
 
The s is a local reference, but its contents are what s refers to, which is not necessarily local.
Your code will print ds.
 
Yeah but what I mean is s[0] is actually arr[0] so I used arr[0] as if it was a local in func
 
That's more like it.
But s is not arr, so if you do s = null it won't break anything outside. Get it?
 
Yeah I believe so or nearly there at least
 
Good. Now don't confuse yourself when you're back to C++ :)
 
11:45 AM
lol trust me that will be very hard trying not to
ha thanks :P
 
mawning
 
It's almost 13, but well, morning.
 
got my results
 
Are they good?
 
no
but could be worse, rly
 
11:48 AM
@DeadMG you are student? Omg I'm really screwed
 
I will have to resit one module
@LewsTherin Why? And you can say "fucked" in here
 
Which one?
 
won't know till tomorrow
 
Because I am a student and I know jack shit.. You guys are in college and way beyond me
 
but it'll be either "Prove the formula for a rotation matrix" or "Prove this software bugless"
@LewsTherin I've been programming since 3 yrs old, so don't worry about it
 
11:50 AM
That's very weird. You know you didn't pass one, but don't know which...
 
well
the guy told me the module code
i just didnt have the list of what codes were what modules
 
@DeadMG xD sure...
 
besides
I get the full thing tomorrow, so
 
@LewsTherin Well, keep learning. I don't know about others, but that's how I do it.
(I hope I haven't spilled yet another secret.)
 
11:52 AM
@RMartinhoFernandes I'm a genius and absorb information from the ether to be as smart as I am.
 
That's an unusual way of learning, but still learning, no?
Also, there's no ether.
Well, there is, but probably not what you think.
 
yeah I have no choice anyways :)
 
Unless you're really... let's say "drugging" yourself with ethers.
 
Thanks, have to get to class now
 
lol
 
11:54 AM
lulz
 
@RMartinhoFernandes 'There is nothing in the world more helpless and irresponsible and depraved than a man in the depths of an ether binge [...]'
 
is this valid:
const struct S
{
  uint8_t a;
};
I've never seen it
 
no
structs cannot be const
 
I'd say no, but I've seen a lot of quirky syntax.
const struct S
{
  uint8_t a;
} x;
 
11:56 AM
it might be valid if you also declared a variable there
 
@RMartinhoFernandes This is valid though.
 
not sure what the point of the const struct would be though?
 
it isn't
 
@RMartinhoFernandes lulz you replied to yourself?
 
the const would more apply to whatever variables you declared
 
11:58 AM
@TonyTheLion Well, someone posted messages in between, and it seemed the easiest way to make clear which message I was referring to.
As expected, GCC does not accept it: ideone.com/tL7Zz
@TonyTheLion where did you see that code?
 
0
A: const struct declaration

Tony The Lionconst struct S { uint8_t a; } is not a valid construct. This const struct S { uint8_t a; } x; could possibly be valid as you're declaring a variable x that is now const, meaning it cannot change.

 
You forgot the semicolon :)
 
nitpicks
 
Well, I fixed it instead of nitpicking in comments :)
I wish I could get rep for edits.
Lunch time, I'll back later.
 
university education is expensive...
38000 AED per semester :(
good thing i am still in high school for now.
Umm..by the way; I don't get the caption.... white on white - for your convenience?
 
12:19 PM
what's an AED?
 
UAE Dirhams.
The dirham () (sign: د.إ; code: AED) is the currency of the United Arab Emirates. The ISO 4217 code (currency abbreviation) for the United Arab Emirates dirham is AED. Unofficial abbreviations include DH or Dhs. The dirham is subdivided into 100 . History The United Arab Emirates dirham was introduced December 1971. It replaced the Qatar and Dubai riyal at par. The Qatar and Dubai riyal had circulated since 1966 in all of the emirates except Abu Dhabi, where the dirham replaced the Bahraini dinar at 1 dirham = 0.1 dinar. Before 1966, all the emirates that were to form the UAE used th...
 
oic
how much is that in like, USD?
 
10346.6 USD
@DeadMG 10346.6 USD
Is this considered expensive in the US?
 
sbi
12:39 PM
@RMartinhoFernandes The few I saw I couldn't confirm. I mean, yeah, someone asked "help me" repeatedly, but would that really be spam, inappropriate, or offensive? It would, had they told the guy repeatedly that this was unwanted, but in order to decide that I would have to look at that room's transcripts from that time to see it. And I definitely wouldn't want to spend my time doing that.
 
Well, in Germany it's like 200€ (250-300 USD) per semester. Damn well expensive.
 
sbi
This whole flagging mechanism in the chat is a mess and a nuisance more than anything else.
 
we talking about flagging yet again
I'm sure there's more to this world then flagging
lol
 
@sbi Well, I can't disagree with that. But at least this time the flags were not unwarranted. (Yeah, I peeked in the PHP room.)
.
This is crazy.
 
hi who worked with mpi library?
 
sbi
1:08 PM
@RMartinhoFernandes So you read my retweet? :)
Real road sign in the US warning about status updates http://twitpic.com/6uw9p9
 
Yeah, ended up there after twitter mailed me "@tweetsbi mentioned you".
 
sbi
"You humans have the nasty habit of mixing sex, love, reproduction, and business. You break SRP." @martinfernandes @ http://chat.stackoverflow.com/transcript/message/1597592#1597592
 
malloc doesn't give properly aligned memory, does it?
 
sbi
@RMartinhoFernandes It does.
Well, it has to. How else would you be able to obtain aligned memory?
 
Aligned for objects of the size you request, like new[]?
 
sbi
1:11 PM
@RMartinhoFernandes IIRC malloc() is supposed to return memory aligned for any data type on the given platform.
 
sbi
As always, I don't have chapter and verse at hand, though. If you need a definitive answer, you will have to ask some of the lovers of the holy standard.
 
Nah, that's fine.
 
back
I don't understand `super()` and `super.`
how is that possible?
is super overloaded..oh and this is Java :P
 
How is that possible? Because the language designers said so.
 
1:16 PM
so it is overloaded?
 
I guess you can say it's an overloaded keyword, yeah.
 
so keyword overloaded for an object ref and a function call bloody cool mindfuck
 
Wtf, I delete both copy and move constructors and my code still compiles. What does std::tuple<T>(std::tuple<T&> {}) do exactly?
 
Default construct a temporary tuple and move construct another one from it?
 
Since the types don't match it's a conversion.
Now imagine that T is not movable and you have my code, except it compiles and runs fine.
I'm so confused.
 
1:24 PM
Maybe GCC is playing revenge on you.
 
I picked the wrong specialization of the template; the other one triggers error.
Still, I do move and copy the other specialization around so no idea really.
 
What does default constructing a tuple of a reference do?
 
It's not valid, I messed up the example (in my case I was using std::forward_as_tuple(*this)).
 
this should have been of type T&. As it is, it's a pointer that you can't assign to, and that cannot be null. Also know as a reference.
What weird reasoning led to making it a pointer?
 
References weren't in the language at this point.
Silly, right?
&self would have been just fine.
 
Dan
1:39 PM
Does anybody here use eclipse CDT? I've got an annoying problem
 
#define self (*this)
Hmm.
 
Has anyone been digging in the CPython source code?
 
Today's WTF is a good vintage.
 
Huh...
> -- which then implemented the data into a trajectory, wound up with a whirr, and threw the engine block overhand across the 100' gap.
O_O
OMG.
I have to admit. The old man had skillz.
 
1:55 PM
I really didn't see that coming.
 
But he was certifiably insane.
 
I wish we had a ballpark on the weight of those things. Should we assume a car engine block?
Random googling suggests 100kg as an estimate.
 
I can tell from experience that those things are heavy.
(My father is a mechanic.)
So, how much is 100' (feet, I assume)?
About 30 meters?
 
Yeah.
No wonder it made so much noise.
 

« first day (353 days earlier)      last day (4588 days later) »