« first day (673 days earlier)      last day (4290 days later) » 

12:00 AM
user image
5
puppies :)
 
omg.... they are awesome!
 
Aight. My documentation generator is already starting to get shape. Except that it documents all entities, including those from #included headers.
 
@TonyTheLion The only better than @DeadMG is two @DeadMGs.
 
dawwwwwww
 
12:02 AM
@Mysticial haha
 
I hope "DeadMG" isn
t a term about a pet dying.
 
we will never know what it is, I think
he refuses to talk about it's origins
 
I hate laptop keyboards
 
lol
I hate the hot weather
can't breathe
even though I'm a lion
 
I knew I shouldn't have let my wife talk me into buying one without a full sized keyboard
@TonyTheLion I feel your pain. I live in the Mohave Dessert
 
12:04 AM
I even have a numeric pad on mine
 
or is that desert? lol
 
@Chimera oh ghosh
Arizona?
 
@TonyTheLion Close, Nevada
 
oh yea
it's hot out there
haven't managed to get to Vegas yet, when I was in LA
 
I'm pretty sure it's Mojave, not Mohave.
 
12:05 AM
hopefully next time
 
@CatPlusPlus See and yet again my spelling fails me
@TonyTheLion It's a great place to visit, just not in the summer.
 
@Chimera yea, not summer
 
Or after an apocalypse. Too many radscorpions, man.
 
To be fair though, the rest of the year the weather is quite nice.
 
yea but I don't know when the next apocalypse is...
@Chimera do you have anything else besides sun though?
 
12:08 AM
@TonyTheLion That will be when I have a starfest again.
 
@TonyTheLion Not really.......
 
I thought so
 
Some rain... but mostly cooler temps and sun.
 
one drop
 
12:09 AM
I do miss the snow of my home state Wisconsin
 
I saw LA rain, woah, 10 mins, miserable little bit of water coming out of the sky.
 
It's funny I moved from one extreme to the other, Oregon to Nevada ( rain all the time to it never rains)
 
yea that's quite extreme
 
It's beautiful in Oregon though, the rain makes it possible.
 
yea
I was in Washington State, that's beautiful, can only imagine Oregon being similar
 
12:11 AM
Yes, very similar.
The coast is absolutely beautiful in both states...
 
I went to see Bourne Legacy tonight
not a bad movie
 
Actually the whole Pacific coast is amazing..
 
@TonyTheLion Haven't seen it yet... maybe the wife and I will see it tonight,.
 
worth a watch for sure
 
12:13 AM
I enjoyed the other two.
 
There was three
 
Oh, this is the 4th one?
 
Wow, either my memory is really bad or I missed one.
 
The Bourne Trilogy is a series of three novels by Robert Ludlum, which have been adapted to a series of three films starring Matt Damon. The series has since been further extended by Eric Van Lustbader after the death of Robert Ludlum. Novels The original three Jason Bourne novels are: * The Bourne Identity (1980) * The Bourne Supremacy (1986) * The Bourne Ultimatum (1990) The new Jason Bourne novels: * The Bourne Legacy (2004) * The Bourne Betrayal (2007) * The Bourne Sanction (2008) * The Bourne Deception (2009) * The Bourne Objective (2010) * The Bourne Dominion (2011) * The Bourne Imp...
 
12:14 AM
@CatPlusPlus Radscorpions are not that problematic.
 
Lol... I was just going to post that link.... I remember now...
I was forgetting the first one... Identity
I have yet to see a scorpion, and I've been in the desert for nearly two years... well I suppose Las Vegas wouldn't have that many of them out in the open...
 
Radscorpions are easy to spot. They're big.
 
I am considering the layout and navigation or the HTML formatter. Doxygen is difficult to navigate.
 
@R.MartinhoFernandes Are they a part of a game?
 
|genre=Action role-playing, open world |modes=Single-player |ratings=|PEGI=18+|OFLCZ=R18|USK=18}} |platforms=Microsoft WindowsXbox 360 |media=Blu-ray DiscDVD |requirements= See "Development and marketing" }} Fallout: New Vegas is an action role-playing open world video game developed by Obsidian Entertainment, and published by Bethesda Softworks. It was released for Microsoft Windows, PlayStation 3 and Xbox 360 in October 2010. The game is based in a post-apocalyptic environment in and around Las Vegas, Nevada. Even though it directly succeeds it in order of Fallout game releases and also...
 
12:18 AM
Ah ok...
yet another game I've not played
 
hello everyone :)
 
brb .. gotta drop the kids off at the pool.
@ITNinja hello
 
how is everyone tonight?
 
good good, u?
 
great :) just about to get to work on my cluster software :)
 
12:23 AM
Cluster software?
Ok the kids are now dropped off.
 
I think I will go with a GitHub API Documentation-like approach. I like it.
 
I remember how much I used to code for fun, until I did it for a living.
But my professional life has nearly all been in 'C'. C++ offers new excitement for me.
 
I will make it so that eventually it is not only for C++; you can write plug-ins easily.
 
@RadekSlupik Sounds like a good start
 
I write plug-ins for C, C++, Objective-C and Objective-C++ first.
 
12:28 AM
good plan.
 
@Chimera yeah :) just something i decided to make on the side to deal with boredom lol.
 
I don't know who ever thought it would be a good idea to create a city in the desert... It just causes water usage problems.
 
Output can be HTML, JSON or LaTeX.
@Chimera Notch.
But custom output generators can also be written.
 
@RadekSlupik Will the HTML support CSS stylesheets?
 
@Chimera I will use Twitter Bootstrap, which you can easily customize using LESS (superset of CSS).
 
12:30 AM
@RadekSlupik Ah ok
 
If you need custom HTML, you can tweak the HTML writer or write your own writer.
I will use Jinja2 for templates.
 
I am slightly intoxicated.
 
How come?
 
@RadekSlupik alcohol
 
12:34 AM
My documentation generator is already better than Doxygen, and all it does is printing a list of function declarations and their locations in the source code, and printing an index of the functions with hyperlinks to their documentations.
 
Yeah, right.
 
@R.MartinhoFernandes ((.).(.))
 
Thank you for inventing the boobs.
 
Looks like Stewie from Family Guy.
 
12:37 AM
I invented boobs? Then how come I don't have them?
 
You are a robot.
 
You gave them to the community.
 
It is so fucking hot. T_T
 
That's what she said.
 
It is over 30° in my room.
When you enter my room, instant fever.
 
12:44 AM
@RadekSlupik i'm sweating like a hot potato in my room
 
Me too, but I am hot by definition.
 
@RadekSlupik In a way, that means my shape is a lot more flexible than meatbags'.
 
lol
BTW what does "Aight" mean
 
user379888
hello all
 
i see ppl use that term
 
12:47 AM
@JohannesSchaub-litb It's a weird way of saying "alright". Somtimes written "a'ight".
 
ohh
too bad "alright" doesn't end with a "b" :)
so they could just say "litb" AAAHAHA
 
@JohannesSchaub-litb alrightb
 
@Johannes let it be allright
In the winter you should be lits.
Mein Code ist Scheiße.
 
@RadekSlupik Zo relaxen und watschen der blinkenlichten.
 
Mah documentation generator will automatically figure out possible exception types from function definitions, including std::bad_alloc, even when the function has no throw() specification. Can I safely ignore functions marked nothrow?
 
1:02 AM
Have fun with that.
 
@Mechanicalsnail Hehe.
 
@CatPlusPlus it's not that difficult. Just find the throw expressions in the function and in all the functions it calls.
 
@RadekSlupik What the cat said.
 
Don't forget to do it with regexes.
 
@RadekSlupik And instantiate templates while you're at it.
 
1:03 AM
libclang
Fuck regexes while parsing C++.
 
So, your documentation generator basically compiles my code?
 
And then figure out why documentation generators usually don't do extended static analysis of the code.
Have fun.
 
I always have fun.
 
Anyway, you probably don't want that. If something isn't supposed to throw X, and it does, you want that to be a bug, not documented.
Apply SRP.
 
lol imagine how long it would take if you have a large code base.
Static analysis on C++ code.
It needs to have access to the standard library too.
 
1:09 AM
@RadekSlupik And don't forget to account for all the functions that are dynamically linked
 
lol decompiling the DLL.
 
And to look across virtual function calls.
 
don't forget dynamic_cast and typeid as potential throw candidates
 
@Johannes I don't, and also new.
Virtual functions are not a problem; the documentation generator has an index of all classes so it can figure out the subclasses of a given class.
 
@RadekSlupik "the documentation generator has an index of all classes" no, it doesn't.
 
1:13 AM
class template specializations are potential derived classes too
 
If you think it does, you're missing the point of virtual functions.
If the number of possible types is bounded, you can just use boost::variant.
With virtual functions the number of possible types is not bounded.
 
If you give the documentation all your source files, it has all classes. You cannot have classes that are not in your source code.
 
@RadekSlupik Yes, you can.
 
link them dynamically
 
1:16 AM
Or statically. In someone else's code.
 
if you link to boost::filesystem
 
but then he doesn't have the class
 
what are you gonna do, decompile the .lib/.dll to see the implementation?
 
struct foo { virtual void f(); virtual ~foo(); };
void blah(foo& x) {
    x.f();
}
// this function can take references to objects of types from code that was not written yet
 
In that case, list all the found exceptions and “anything thrown by my_param->foobar()”. xD probably with a note that the class has virtual functions or that a function definition could not be found (in the case of linkage with libraries).
 
1:18 AM
FWIF if a virtual function has a throw specifier, you are guaranteed that no exception not in the list of the specifier is thrown
 
What about bad_alloc?
 
@JohannesSchaub-litb Not in C++11, I believe.
 
Yeah, but he was trying to infer it for functions without a specifier.
 
i think this is illformed: struct A { virtual void f() throw(int); }; struct B : A { void f() {} };
 
@RadekSlupik Yeah, let's document all the steps taken in the implementation.
 
1:19 AM
would be surprised if this changed in C++11
 
@JohannesSchaub-litb Throw specifiers are invariant?
@RadekSlupik My main point is: I don't want a documentation generator to document stuff I don't want documented.
 
@R.MartinhoFernandes i think it means covariant
the overriding functions's throw specifier can be more specific
 
Documenting stuff means that you can never change it again without annoying clients.
 
some things like what nasty exceptions are able to escape better go undocumented!
 
lol putting in a library if (rand() < 2) throw 1337; to troll the users of the library.
In some random function.
 
1:25 AM
if(typeid(int).name()[0] == 'a') 1 / 0;
is this UB, unspecified or implementation defined behavior?
when we execute that if statement
 
hmmm
 
Implementation-defined, and if the implementation documents that if the name of int starts with an a, UB.
 
@RadekSlupik Actually, I suspect otherwise.
 
Ask it on SO and you will probably get an upvote or ten.
 
I don't know for sure, but the Standard mandates constexpr operations on integers in some situations.
 
1:27 AM
lol
i already know the answer
 
if this is one, then it could be that they have separate wording for it.
I mean, consider char x[1/0]; // UB?
 
Answer your own question! Instant karrrmaaa!!!
 
OK hold on
if(typeid(int).name()[0] == 'a') rand() / (rand() * 0);
 
ok
well, it's definitely IB instead of UB, since the result of typeid is IB, and if it doesn't start with a then there's no way UB can occur.
 
what if the condition is unspecified whether it yields true or false
 
1:29 AM
then unspecified
 
I will partially answer: the result of typeid(int).name()[0] is unspecified
now what is the behavior of that entire program?
 
It shoots the programmer who wrote it.
 
if you ask it on SO i will upvote it
 
Why is it unspecified?
 
I won't ask it on SO. I don't think it's a good question (it shares a lot of characteristics with the i++ + ++i questions).
 
1:31 AM
If typeid(int).name() is an empty string, [0] will be '\0'.
 
I also don't think it's a particularly good question
it sums up as "Did you memorize every little arcana of the Standard?"
and that's a bad question
 
@DeadMG my friend says "OK the behavior of my compiler is XYZ, so this if statement is all fine. aswell on all other compilers that show that behavior."
claiming that the behavior of his if statement is unspecifier behavior. but I want assurance!
 
@JohannesSchaub-litb What do I care what your friend says?
unless he has a more representative use case
 
Hmm, headache.
Ow.
 
1:32 AM
What is unspecified behavior?
 
There's no such thing.
There are unspecified values.
 
@R.MartinhoFernandes you are definitely so wrong: |------------------------------------------------------------------------|
 
If the if statement is ID, then it is also ID whether or not the body is UB.
 
what about unspecified behavior
 
What is unspecified behavior?
 
1:35 AM
This is boring. I think I'll get back to work on ogonek.
 
@RadekSlupik it is behavior which the Standard leaves more than one possible behavior for an implementation to choose, but doesn't require documentation of the behavior
 
I want to work on doxx. Writing the doccomment extractor.
 
Let's see if I can get a reasonably featured text ready next week.
 
@Johannes aahhh.
Cool.
 
actually the solution is, the behavior is effectively undefined behavior !
even with regard to before the undefined behavior occured
 
1:37 AM
I don't see the point of type_info::name() if it is ID.
 
What would be the point of it if it was defined?
 
so this may immediately crash: time_t t = time(), u = t + 100; while(time() != u) ; *(int*)0 = 0;
even before the 100 seconds passed
 
Nothing either. xD
Hmm. How would one do duck typing in C++.
 
Templates.
 
Obviously xD
Duck taping.
 
1:48 AM
by buying a roll of duck tape and applying it to your hard drive
 
Ell
Herro all
@RadekSlupik Duck typing in C++ is templates
static duck typing, anyway
 
I am getting horny. libclang already parses documentation comments.
 
libclang
to me, it seemed spectacularly unhelpful
I couldn't even find an API to say, give me a list of all members of a type
 
You walk the AST.
 
That sounds wrong.
I don't want to deal with a syntax tree to analyse semantics.
 
1:54 AM
The syntax tree contains class definitions and their members.
 
well, also, it's O(N) in AST
 
It does? Does it have the implicitly defined ones? Does it have the inherited ones?
 
rather than O(1), being just a data member lookup
 
If it does, that sounds like a gross SRP violation.
struct foo : std::vector<int> {}; has a truckload of members, but on a non-abused syntax tree it will have only one.
 
Ell
SRP violation?
 
1:57 AM
Single responsibility principle.
I'm usually not a big fan of too strict adherence to this kind of rules, but there are a few like SRP and DRY that I really really find hard to violate in an advantageous manner.
 
agree
SRP and DRY are like "Don't ever use a Singleton"- technically, they might have an exception somewhere, but I've never seen any evidence for it's existence
 
@sehe How can credit you for the review in my blog post? "sehe" or your real name? (I generally prefer to use a real name, but I can understand a desire for anonymity)
 
clang_Cursor_getParsedComment returns a parsed documentation comment for the given declaration. That was easy.
clang puts comments in the AST if they document declarations.
 
2:14 AM
wow, "hello world!" completed!
i mean with google app engine
:)
 
Woot even works with Unicode!
 
Try with a pile of poo.
 
i don't think it pushes updates to clients
only if one adds comment or other action
 
lol the documentation generator will be a piece of cake.
 
Ell
what is the relevance of an IV in encryption? why don't you just need the passphrase?
 
2:20 AM
IV?
 
Initialisation vector.
It's a random input to asymmetric cryptography algorithms (along with a key and the plaintext).
 
so, for RSA would that be the two prime numbers?
 
Maybe. I only have superficial knowledge about this.
 
I heard someone refer to the rotor offsets in an enigma as an initialization vector of sorts, but the enigma encrypts in a symmetric fashion
 
@R.MartinhoFernandes It's to initialize the cryptographically secure PRNG to ensure that the keys are chosen randomly.
the algorithm has little purpose if it's the same private key every time
 
Ell
2:24 AM
prime random number generator?
 
pseudo-random
 
@Ell Because encrypt("foobarfoo", "my key") would yield "xxxyyyxxx" for an hypothetical algorithm that encrypts three bytes at a time (most (all?) algorithms only encrypt in fixed-size blocks).
That allows an attacker to know that the three final bytes are the same as a the first three, even if they don't know which bytes they are.
 
Ell
ahh right okay
so is the iv for padding or something?
 
There are strategies to add variation to the key from one block to the next so that the result could be "xxxzzzyyy" instead. The IV is for that.
@Ell Padding schemes are another issue (which I purposedly sidestepped in the examples)
 
I'm heading off for the night
tartar
 
2:32 AM
bye
 
@DeadMG Have fun.
 
Ell
ohhh I get it
just just testing google chrome mobile browser
Woo JavaScript works sufficiently well
 
ohlol the clang APIs for the documentation comments are from yesterday. No wonder they are not yet available in the Python bindings. :<
 
@melak47 Maybe the concept can be applied to symmetric algorithms as well. But in asymmetric algorithms it's important because the attacker, having the public key, can generate ciphertexts. This would allow one to, in the insecure example I gave above, learn that "xxx" means "foo" (by encrypting "foo" himself).
 
I think I’ll use Markdown anyway.
 
2:53 AM
Is it allowed to do arithmetic on function pointers?
 
I think not. Function types don't have a size.
 
void foo(int my_int = 1) {
  (&foo + (&exit - &foo) * (my_int / 10))(my_int);
} // executes ten times!
Integer division is so funny.
Meh GNU extension. sizeof(myfuncptr) == sizeof(void) == 1.
 
Wut? The size of a function pointer should probably be 4 or 8.
 
Oh w8. Size of a function. :)
Functions and void have size 1 in GNU C.
Even while functions are not even objects. :<
> An object is a region of storage. [ Note: a function is not an object, even …
Standard y u vague.
“object” is like, the most important term in the standard.
 
3:21 AM
Seems to me that sizeof function should result in compiler error then.
 
Not in GNU *ugh* C.
 
@StackedCrooked sizeof is an operator, not a function. But yes (C99, §6.5.3.4/1): "The sizeof operator shall not be applied to an expression that has function type or an incomplete type, to the parenthesized name of such a type, or to an expression that designates a bit-field member." Violating that requires a diagnostic.
 
@JerryCoffin I meant sizeof(function) :P
 
@StackedCrooked Ah, got that covered.
@RadekSlupik "For addition, either both operands shall have arithmetic type, or one operand shall be a pointer to an object type and the other shall have integer type.", "For subtraction, one of the following shall hold:"
— both operands have arithmetic type;
— both operands are pointers to qualified or unqualified versions of compatible object
types; or
— the left operand is a pointer to an object type and the right operand has integer type.
So no, you can't do math a pointers to functions.
 
3:41 AM
What happens when we have two pointer p and q and we do p - q when q > p?
 
Take a guess.
 
magic?
 
UB
 
@RadekSlupik Hint: ptrdiff_t is signed.
 
3:42 AM
Oh. Negative result then? :p
 
@RadekSlupik Yes -- not UB (unless you overflow a ptrdiff_t).
 
And assuming they're both on the same array.
 
@R.MartinhoFernandes Well yes, but that's implied by q > p -- if they aren't in the same array, you can't compare them with > at all (but you can compare them with std::less or std::greater).
 
Or cast them to intptr_t and then do >?
 
3:47 AM
@RadekSlupik Maybe. Not sure what's guaranteed about the results of casting to intptr_t.
 
(intptr_t(p) - intptr_t(q)) / sizeof(*p) is not guaranteed the same as p - q. In practice it is (everyone used that to guarantee alignment).
 
Screw pointer arithmetic.
 
@JerryCoffin That it can be used to convert back to the original (so p != q implies intptr_t(p) != intptr_t(q), but not much else).
 
Spent so much time away from C# lately when I find myself going back to C# from C++ I find myself trying to use -> on .NET objects in C#
 
 
2 hours later…
Ell
5:23 AM
meh who needs sleep anyway
 
5:38 AM
#include <iostream>

struct Pipeable
{
    double  value;

    Pipeable operator|( double f( double )  ) const
    { return Pipeable( f( value ) ); }

    operator double() const { return value; }

    explicit Pipeable( double const v ): value( v ) {}
};

Pipeable put( double const x ) { return Pipeable( x ); }

double square( double const x ) { return x*x; }
double plusOne( double const x ) { return x+1; }

int main()
{
    using namespace std;
    cout << (put( 6 ) | square | plusOne) << endl;
^ Just some silly code that you can use as a basic idea to create even more silly more complex thing?
 
Say I have a function that looks like this:
std::wstring func1()
{
std::wstringstream wss;
wss << ...;
return wss.str();
}

and then, I have a class with a constructor that needs std::wstring:

class1::class1(std::wstring str, ...)
{
class1::class1(std::wstring str, ...)
{
InternalFunction(str);
}
and I'm doing something like:

auto class1 = std::make_shared<class1>(func1());
 
why should anyone say all that?
 
and it crashes.
class1's constructor gets a string with garbage in it
I tried moving it, but it doesn't help
and I think that this string's lifetime should end after the constructor's code is done, right?
the temporary string that is returned from func1() and passed as a parameter to class1's constructor. What I'm doing wrong here?
 
it's in some of the code you haven't shown
ask a proper SO question
 
There's nothing wrong with what you've shown.
 
5:48 AM
with a minimal but complete example that reproduces the problem
 
Luc Danton, then what could cause that string to be garbage once I break at class1's constructor's first line?
 
Anything and everything.
 
that's pretty precise :)
 
You're asking for psychic debugging.
 
wait
let's try to get some useful info here
@karim: can you tell us why you thought we might be skilled at telepathy/ESP?
 
5:53 AM
I don't think that you might be skilled at that.
 
now, this works:
std::wstring str = func1();
std::make_shared<class1>(str);
 
then next, possibly also useful: exactly how did you decide what to include and what to leave out in the code you presented?
 
this has to be something with object's lifetime that I'm not understanding
 
[note: the algorithm you employed resulted in zero useful code to be communicated]
 
5:55 AM
alright, then let me rephrase my question:

When does

std::wstring str = func1();
std::make_shared<class1>(str);

and:

std::make_shared<class1>(func1())

make any difference?
 
depends on the constructor
in the first case the actual arg is an lvalue expression, while in the second case it's an rvalue expression
this can select different constructors, depending on the formal argument types
 
ok, and in case of the second case, when it is an rvalue expression, what is that temporary rvalue's lifetime?
different constructors in std::wstring?
or in my class1? because class1 has only one constructor.
 
well the rvalue is not temporary: "rvalue" is a property of the expression
but you're right that the expression produces a temporary
it lasts till the end of the full-expression, in effect till the semicolon
 
which means, that it should be still alive while the constructor gets it and passes it to an internal method? (synchronously).
 

« first day (673 days earlier)      last day (4290 days later) »