« first day (590 days earlier)      last day (4584 days later) » 

09:00
Today I've managed to puzzle a university professor by proving that it's possible to use a negative array subscript in C :( I'm not sure if I want to live on this planet anymore.
@LucDanton Can you say [](int n) { return n == 0 ? 1 : n * operator()(n - 1); };?
Negative array subscripts simply go back in memory. And time.
@ScarletAmaranth huh, what's new about that?
is it the professor's reaction that makes you wanna leave the planet?
@CheersandhthAlf For me ? Nothing. For a person with Phd. after name, apparently breaking news.
Yes, that's exactly my point.
oh, they're just humans trying to eke out a living
09:03
noone knows (remembers) everything
It was as a question in my final exam.
ow
I claimed it's possible and they didn't want to believe me (2 people with Phd. actually), so they demanded I prove it ...
I almost said: "In your face" as it compiled correctly ...
I don't know if it's about remembering, it's just logical thinking, arrays are basically an abstraction of continuous virtual memory and pointer arithmetic. If you're sufficiently offset within the boundaries of the array, it's logical that -n will take you to the address lower for -n * sizeof(type)
@DomagojPandža Why do you always explain THE OBVIOUS :) ?
09:06
@FredOverflow I think the gist of it is that they're seeking a superior alternative to the present Usenet groups + the discussion groups that are internal to the Standard Committee. Check this and this.
I am just stating it's not about remembering (Abyx statement)
@DomagojPandža Yeah in that case i agree with you, it's just them being derps and the uni being shit.
@DomagojPandža, it could be UB, just because Standard says so
@Abyx Definitely, I don't endorse using it either.
@FredOverflow That would refer to the enclosing operator() or be invalid, if there's none. A lambda expression doesn't have a scope (although you can bring in the identifiers from the enclosing context via capture). Although that may not be how they're specified, I think that's the spirit.
09:08
@DomagojPandža I've never claimed it's a wise idea to use it :)
@ScarletAmaranth Did someone say you had? :P Don't be so defensive, we're all here for the joy of programming, nobody thinks less of anybody.
Except for PHP/Java "programmers".
But we still recognize their freedom of speech.
@DomagojPandža I'm important!
@LucDanton where u stumble onto secret gruups?
@CheersandhthAlf lol, I didn't.
Well, do you mean the present internal groups used by the SC or those I linked to?
09:13
@Neil So what planet are you planning to move to? ;)
the linked ones
I'd recommend Risa.
90 LY from Earth.
@FredOverflow Some place where the rocks show more intelligence.
@DomagojPandža Though Risa sounds lovely.
@CheersandhthAlf I don't remember, sorry. Somewhere on the Internet today. Since there are in fact messages from Herb on those I'm surprised he didn't write something about it. That will come soon I suppose.
I heard there was a significant amount of platinum group precious metals embedded in asteroids that would make asteroid mining quite profitable indeed
Apparently a company has been founded by google cofounder and Ross Perot's son to do precisely this, though that's about all I know on the matter.
Anyone know if they're actually going to do this or if this is some sort of prank?
09:24
It's an actual plan that has recently been set in motion.
It's going to take time but they do intend to do it.
I don't see why not, it's well within our abilities.
It's just that people like to invest more money into killing each other rather than exploring our own planetary system.
12
A: How do I use arrays in C++?

Cheers and hth. - Alf5. Common pitfalls when using arrays. 5.1 Pitfall: Trusting type-unsafe linking. OK, you’ve been told, or have found out yourself, that globals (namespace scope variables that can be accessed outside the translation unit) are Evil™. But did you know how truly Evil™ they are? C...

@CheersandhthAlf When are you going to write 5.2? ;)
@DomagojPandža Yeah I noticed that. For me it's not even a question of if.
@FredOverflow lemme see. i have a blog about LSP principle unfinished. and a windows programming blog unfinished. that's because it's so much work and i'm too ill to do that much work. then i'm writing this book-like thing, which is much less work and i'm making some progress at least. i dunno about SO. it just faded into the background, sort of.
@CheersandhthAlf Maybe we should just delete 5.2 then?
Maybe someone else could write?
it's issue of memsetversus memmove
and memset versus initializing in declaration (with curly braces)
09:37
Is there someone familiar with Qt?
and memset of non-POD type
and memset of floating point type (practically OK, formally dubious)
and one thing that I don't know enough about
namely SSD instructions
Pointer types?
do you know that?
sorry i meant memcpy versus memmove
and one infamous person in this Lounge was very confused by the layers of memcpy, strcpy, and std::string assignment, and ditto for comparisons
9
Q: Is it legal to access a bidimensional array as if it where a one-dimensional one?

K-balloConsider the following code: int array2d[10][10]; int *array1d = array2d[0]; I never heard of an implementation where it wouldn't work, but is it legal to access and manipulate array2d via array1d? Which section of the standard allows this? Is there anything in the standard preventing implemen...

found a duplicate, please vote to close
09:44
Oh wait, Jesse already found it, why didn't he vote to close??
@FredOverflow how much rep do you need to vote close?
I don't know, but that's probably the issue. Jesse "only" has 2.5k rep.
09:58
@thecoshman Right on time
@FredOverflow voted to close
@sehe I actually like this one :D
10:16
Yawn, not enough sleep.
@sehe It's too early in the morning to watch men do synchronized dance moves.
Would unsynchronized be better? I think it's cool. They're just the local student rowing team. It is great PR, really, and shows they're a real team
@sehe nope!
10:32
Confession time
I haven’t read “What Every Computer Scientist Should Know About Floating-Point Arithmetic”, nor do I intend to, since I find that article horrible
2
stop posting it to every IEEE question, FFS
@KonradRudolph Me neither :)
@CheersandhthAlf FFS
@CheersandhthAlf That.
why does it not onebox urban dictionary
@RMartinhoFernandes Paging Dr Template
@RadekdaknokSlupik like that will make a scrap of difference
@thecoshman oh yeah, I forgot it's meta. Nobody will listen to you.
10:40
@RadekdaknokSlupik I upvoted the existing request, please add more votes
@CheersandhthAlf One does not onebox urban dictionary!
y !
oh, you said, one does not onebox urban dictionary, !
ha ha
One doesn't?
FIXED
how did you do that
10:43
hello ALL
@CheersandhthAlf look at the link, it's imgur :P
when is the may 2012 meeting?
@CheersandhthAlf it's a screenshot, silly. :P
@JohannesSchaublitb in may.
Also, may ends in three days.
So you are probably screwed.
@RadekdaknokSlupik but it hasn't happened yet..
y u no exist.
Also, what does lsssyst mean?
10:52
if you think recaptchas use real words, you're going to have a bad time
Doesn't it get those from books?
Sometimes it includes weird, untypable mathematical formulae or house number signs.
@RadekdaknokSlupik I've no idea where it gets them from, but I consider it a rare treat when I see one with real words
@KonradRudolph Me neither. I'd rather pull my nails with pliers than read that.
Fuck you Boost, with your lack of move constructors.
@RadekdaknokSlupik I can tag your question with that if you want
10:58
If you feel like it, that would be great.
@RadekdaknokSlupik just link me to it, though heading off for lunch right now
0
Q: Is it possible to move boost::optional?

Radek 'daknok' SlupikI've been trying to define a defaulted move constructor in a class with a boost::optional member variable. #include <boost/optional.hpp> #include <utility> #include <vector> struct bar {std::vector<int> vec;}; struct foo { foo() = default; foo(foo&&) = defau...

Also, close this piece of shit:
-2
Q: Please help me check c++ flowchart and pseudocode

mrexp21Please help me check c++ flowchart and pseudocode The source code files can be downloaded from here :- http://www.4shared.com/rar/jw-wLOJZ/Project.html

11:14
@KonradRudolph why do you find it horrible
mawning nubberies
    int const w = []() -> int
    {
        int number;
        wcin >> number
            || err( "Input operation failed." );
        return number;
    }();
here is C++11's compound literals:
#define COMPOUND_LITERAL(V) []()->add_reference<decltype(V)>::type{ static auto _1 = V; return _1; }()
then you can write
cin >> COMPOUND_LITERAL(42);
LULZ!
@DeadMG Mowning.
@JohannesSchaublitb Generic lambdas!
11:19
@CheersandhthAlf BTW, i think this is legal:
int const w = ([&]{ cin >> (int&)w; }(), w);
but can you make it const
@JohannesSchaublitb Loooong. And irrelevant. Separation of concerns: for somebody interested in the details of IEEE implementation, rigorous proofs may just not be relevant
@CheersandhthAlf look up
11:21
For a document that everybody is supposed to read, the author did not even try to keep it short, which is an instafail in my book.
ok, but i think that's UB, because it's originally const...
not sure though
since it's not a compile time constant
I think i aree to you that this is UB :(
@KonradRudolph Not to mention lacks structure and elegance of a long document that should be read by everyone. And you already probably know 90% of it, why torture yourself with an ugly document?
11:23
we need to fix the spec to make this well defined
i recommend the "comparing floating points" article
it's well written
@DomagojPandža Agreed on all counts
tho i tried that "sin(M_PI) + M_PI" trick, and it didn't work on any real calculator
i haven't got to fp in my writings yet
first do integral types
sin(3.14) + 3.14 was nowhere near to the real PI
then decimals, and rationals
11:24
If someone doesn't know fp intricacies and calls himself a programmer, that ought to sound an alarm. Suicide for a render architect.
but the article claims it should be 3.1415926535897932
It could be structured a lot better for people actually not knowledgeable in that area.
the first ten digits seem correct
luckily I’m in bioinformatics, I never need floating points … and when I work with probabilities I just log those bastards and I’m back to fixnums
yup, they're correct, 3.14159265358979323846...
11:25
@CheersandhthAlf i don't know it beyond that :/
i only recall the ten first digits because i memorized them in primary school
then i got mark down at some test because it was "obvious" i had used a calculator or something
so moral is, don't memorize the digits of pi
but e is so simple, 2.718281828
@JohannesSchaublitb Don't worry about it, it's basically just a futile exercise, entertainment. I hated literature in highschool, so I'd lower my head against the desk and memorized 3 new digits every 5 minutes.
it is difficult to not remember it
11:27
2.7182818284590...
I can google even more numbers if you want :P
i know also the ten first digits of 1, namely 1.00000000
you have it wrong
@CheersandhthAlf or 0.99999999.
itis 0000000001
i know the first 100 digits of PI AHAHA
11:29
@JohannesSchaublitb you do?
Knowledge that you will never need.
well ok leading zeroes
nopes!
there'S no trick. it's the first 100 digits
integral of sqrt(1 - x^2) from 0 to 1 yields pi/4. Enjoy your digits.
11:32
More useless knowledge!
now i know the 300 first digits of e
in the factorial numeral system
it's just 10.11111111111111111111111111111111... and so on. :-)
base 4 ?
what's this
lol "Why do they call it a Xbox 360? Because when you see it, you turn 360 degrees and walk away."
@RadekdaknokSlupik O'rly?
Base 4? Where you have four digits, from 0 to 3.
@Jeremy so you walk towards it?
11:34
@RadekdaknokSlupik thats the joke.
@RadekdaknokSlupik only if you see it in a mirror!
All bases are base 10.
And they are all belong to us.
they are all base litb
Its funny because whoever initially published that joke didn't realise 360* was a complete turn.
There's a difference between the mental concept of a number and it's radix-appointed notation.
11:35
@Jeremy º
PI is a litb threesome
the mental concept of a number is its value
daknok is base 0x64616b6e6f6b.
a radix appointed notation is just a lexical representation of it
@RadekdaknokSlupik I don't have that key on my keyboard and I shall not learn the alt-code for it.
11:36
Precisely, many people don't distinguish the two.
I'm so damn hungry.
i wondered yesterday what the meaning of "word" is
word |wərd|
noun
a single distinct meaningful element of speech or writing, used with others (or sometimes alone) to form a sentence and typically shown with a space on either side when written or printed.
that does not answer it :(
• a single distinct conceptual unit of language, comprising inflected and variant forms.
• (usu. words) something that someone says or writes; a remark or piece of information: his grandfather's words had been meant kindly | a word of warning.
• speech as distinct from action: he conforms in word and deed to the values of a society that he rejects.
• [ with negative ] (a word) even the smallest amount of something spoken or written: don't believe a word of it.
• (one's word) a person's account of the truth, esp. when it differs from that of another person: in court it would have been his wo
idk :S
11:38
@RadekdaknokSlupik You must go deeper than that.
A word is a word.
Boom, instant inf. recur.
i mean whether "word" is the lexical representation in a particular language, or whether "word" is the actual meaning
A word is a word is a word is a word.
But only between Ferengi.
so is "one" and "eins" the same word?
@JohannesSchaublitb A word is the lexical representation.
i think they are different words. but what is the thing called that is the meaning of them?
"wordmeaning" ?
11:39
Is malloc the lexical representation or the actual meaning?
Same thing.
@RadekdaknokSlupik i think so too. word is the lexical representation
In language, a word is the smallest element that may be uttered in isolation with semantic or pragmatic content (with literal or practical meaning). This contrasts with a morpheme, which is the smallest unit of meaning but will not necessarily stand on its own. A word may consist of a single morpheme (for example: oh!, rock, red, quick, run, expect), or several (rocks, redness, quickly, running, unexpected), whereas a morpheme may not be able to stand on its own as a word (in the words just mentioned, these are -s, -ness, -ly, -ing, un-, -ed). A complex word will typically include a root...
Maybe this helps.
morpheme is the smallest unit of meaning.
Note that a word doesn't necessarily have any meaning.
Sounds like a good definition to me
For example, the word the hasn't got any meaning, if I'm right.
11:41
is it correct to say the token value in a lexical analyzer is the token's morpheme ?
Tokens themselves don't carry meaning.
A semantical analyzer gives meaning to them.
sure they do. lexemes don't do
Fuck it, I'm not good at languages.
the meaning of "1" in C++ is the value "one"
Depends on the context.
that's the difference between a lexical analyzer and a scanner. a scanner will not care about the meaning but only about the separation of the lexemes
Oh yeah. :P I was confusing the two.
There must be a separation of what we type and what we mean. It's basically like SI units (or any other definition). We assign something and point a finger at it.
@RadekdaknokSlupik but then the two tokens are "int" and "foobar1" and not "1"
11:44
You can't numerically express a unit of volume.
i think there are two meanings. one is the lexical meaning and one the semantic meaning
But for example, * is ambiguous to the lexer (dereference operator or multiplication operator?).
taking "foo" in c++. the lexical meaning is an identifier consisting of a sequence of characters. the semantic meaning may be a name referring to some entity.
Yup.
lexeme |ˈlekˌsēm|
noun Linguistics
a basic lexical unit of a language, consisting of one word or several words, considered as an abstract unit, and applied to a family of words related by form or meaning.
the lexical meaning may aswell be a number expressed in base36 or something else
11:46
Oh shit I still have to implement numeric literals in my lexer.
Ah well, I need to put them in the spec first. Such things are the boring stuff.
Things written off as trivial are usually the most complex to actually comprehend.
Too near to their axiomatic definition to actually pull sense beyond it.
I find it difficult to write unambiguous rules in specs. Stupid ambiguous English language.
i believe there is a formal language
but I don't understand it. something to do with types
and weird symbols lol
11:53
For example, this:
> Whitspace and newlines shall be ignored, except between identifiers and
reserved words, and where noted otherwise.
This could be interpreted as that whitespace is not ignored only when it's not between an identifier and a reserved word.
foobar foobar // ignored
foobar bool // not ignored
I could do this, but it seems overkill to me.
> Whitspace and newlines shall be ignored, except when between identifiers and identifiers, identifiers and reserved words, reserved words and reserved words, and where noted otherwise.
Wait, I can simplify this.
Whitspace and newlines which aren't between identifiers and reserved words are ignored. Exceptions are noted otherwise.
what about "except between two tokens that are identifiers or reserved words.".
2. Whitspace and newlines shall be ignored, except when between words, and
where noted otherwise.
3. A word is a reserved word or an identifier.
The fuck is whitspace?
hm not really better
The delimited set of tokens imposed by Johannes seems like a good rigorous definition.
Idk mang.
> Whitspace and newlines shall be ignored, except when between two tokens that are identifiers or reserved words, and where noted otherwise.
That's better. Thanks litb.
Whitspace?
Is something wrong with my eyes?
11:59
ohh i'm glad you like it

« first day (590 days earlier)      last day (4584 days later) »