« first day (325 days earlier)      last day (4622 days later) » 

10:00 AM
@RMartinhoFernandes XSLT is super-weird. I don't understand how people who do not got pointers could even get a clue about XSLT.
 
Why super-weird? Because it's functional?
 
It's functional ?
 
It's beyond horrendous because the syntax is XML.
@kbok Yes, it's somewhat functional.
 
Does it have monads? :)
 
Now that I think about it, it makes sense. But yeah, it's super weird. It's been a long time, but the "typing" system is obscure, and I don't know, it just feels unnatural.
 
10:03 AM
It can have monads (pretty much any language can). But I don't think you can get a neat syntax for using them (even ignoring the XML for a while).
 
It's XML, you can't get neat syntax for anything.
 
@RMartinhoFernandes I don't think you can have a neat syntax for anything in XSLT.
@CatPlusPlus Oh, you just beat me to that
 
Yeah, hence the horror.
 
hi
 
Ugh, conflicts in SVN are horrible.
 
10:22 AM
0
Q: Releasing attributes' memory of singleton class

saratConsidering the following singleton class, I am not releasing memory in the destructor. But the instance of this class will remain the life-time of the program as most of the single-ton class do. Is it really matter to release the attribute's memory other than best practices perception? class Si...

"SingleTon" :D
 
"A ton of what?"
 
Does it matter?
 
As opposed to a two-ton class?
Or an 18-wheeler?
 
10:36 AM
@CatPlusPlus or just a single ton. As opposed to multiple tons
 
ok I have a question about virtual functions in templates
template <typename T>
class Dynamic {
public:
virtual ~Dynamic(); // OK: one destructor per instance of Dynamic<T>
template <typename T2>
virtual void copy (T2 const&);
// ERROR: unknown number of instances of copy()
// given an instance of Dynamic<T>
};
 
Can't have a virtual template
That's unrelated to the fact that Dynamic is a template.
 
now it says this isn't possible because there would be an unknown amount of instances of copy, but if you do Dynamic<int> and Dynamic<double> those are just two instances, of different types, so how does it not know how many instances of copy there is for each of these types? I can only see one per type.
 
class not_a_template { template<typename T> virtual void foo(); }; exhibits the same error.
 
right.
 
10:39 AM
oh, so the buttons on the side of the mouse are "back" and "forth" in browser. that's why it's been going back to earlier pages. hah.
 
@TonyTheTiger Don't focus on what the error messages are saying -- here they're speaking in terms of the implementation.
In terms of the language, virtual templates are not allowed.
 
but the technical reason is because of what that error message says, no?
 
@TonyTheTiger it has to do with lack of support for dynamic libraries, and it has to do with the time the committee could use on it, and it has to do with what compiler vendors are willing to use time on implementing (remember export). other than that could be solved technically.
 
implementing such a feature would require implementing export
because you could instantiate the template separately from each TU
but the compiler would still have to collate the changes into a single type afterwards
 
@AlfPSteinbach I want a mouse with a FORTH button…
 
10:42 AM
heh
 
maybe I just don't understand what the implications are of using virtual
 
I really get the feeling that they'll add export back sooner or later. It would suck if they do so after repurposing the keyword.
 
afaik, it just means the function can be overridden in a derived and there will be a vtable pointer for the class into a vtable, but I don't know of any other implications, are there any other?
 
@TonyTheTiger you need one vtable entry for each virtual func. and when you're templating you're defining an unbounded number of funcs. a family of funcs.
 
so the only way the compiler can know where to put all the functions is to look at the whole program at once
 
10:44 AM
And virtual functions count as ODR-used (or is that pure virtual?)
 
which is in conflict with translation units
 
@AlfPSteinbach and the vtable is created when? At compile or run time?
 
Indexing into a template vtable would require a unique index for each type. Doing that with a flat table would be inflexible and require mapping typeids to a different index for each table. So a map or hash-map is more likely.
And to support combining DLLs, a combination of compile and program-initialization-time construction would seem to be necessary.
God knows what happens if 2 DLLs both provide binaries for the same specialization.
 
@TonyTheTiger at compile time. nothing of this is specified by the standard so compilers could in theory use other techniques, no vtable. but we're talking in-practice here.
 
@jalf Yeah, but a single ton of what? :P
 
10:48 AM
A ton of bad code.
Yes, code can be weighed.
 
if you print it on paper, it definitely has weight
 
23
A: How much does a gigabyte weigh on a hard disk?

jamuraaHard drive density is measured in bits per square inch, the maximum of which is currently (5/2010) 625 gigabits per square inch. This means that a gigabyte of data will take up about 8.25 millimeter2. The weight of the substrate (usually glass and ceramic) and the magnetic layer which actually...

 
@TonyTheTiger : vtable is built at compile time , virtual templates member can have many instance which is not good since you can have very long vtable
 
@MrAnubis Performance is secondary to capability… doing something is better than quickly not doing it.
 
The standard does not mention what happens in practice, but the committee considers what happens in practice. They don't want C++ to be a theoretical language.
 
10:52 AM
@MrAnubis That has absolutely nothing to do with it
 
Although, to be sure, virtual templates will be badly abused when "they" get them.
 
@DeadMG : i was talking about previous question not current one
 
really? because it seems to me like you were talking about exactly what I was talking about, which is virtual templates
 
my point is though if you instantiate the template with specific type like int for example, you know for that instantiation for which type the vtable should be created. So I fail to see what the problem is? or is the vtable created before the instantiation of the template for a specific type?
 
@DeadMG pardon me
 
10:55 AM
@TonyTheTiger The problem is that in "foo.cpp", you instantiate for int, and in "bar.cpp", you instantiate for std::string
 
hm, supporting C++11 is much work...
i did some more on code i showed yesteday, now looks like codepad.org/pEi4Jzf7
is that too creative naming of functions? i mean with namespace errorMessage...?
 
@DeadMG oh and separate vtables are too much hassle or work?
 
how can you possibly have separate vtables?
one class needs one vtable
 
oh i looked at it once more. there is a forgot-to-do-properly bug at line 60.
can anyone see what the bug is?
:-)
breakfast
 
@AlfPSteinbach hmm, what does it do?
 
11:00 AM
@AlfPSteinbach Delete?
That is, ignoring the dependency on ASCII.
 
@Als I was viewing you code , it was difficult for me to read , you really care about error :)
 
@DeadMG What's better than a vtable? Two vtables.
 
No! A vtable is a singleton!
 
vtable::getInstance().call("functionname", obj, args);
It's like the windows registry.
 
@RMartinhoFernandes well, it was mainly the ASCII dependency. such Windows code is never meant to support e.g. UTF-8 (would be difficult), but it should support common ASCII extensions -- with negative char codes...
Back after a slice of bread with ham, I looked at the code again and saw a missing inline.
 
11:11 AM
Even depending on ASCII, there's the hideous "delete" at 127.
 
@RMartinhoFernandes huh?
oh
 
ASCII 127 is a control character.
 
ok
no, the control characters in question here are silly CR and LF that Microsoft appends to every message (unnecessary)
 
Ah, ok. I didn't look at the surrounding code.
 
@AlfPSteinbach Why do you care to specify inline?
 
11:15 AM
@LucDanton because it's a header file
moar food
 
Code complete is a good book (I have it on my desk), but I don't think it is a most influential book (nobody else in my company has heard of it).
 
@StackedCrooked it's book i always wanted to read, because everyone said it was very good and very influential
but wasn't it written by Microsoft person?
 
@AlfPSteinbach It covers the very practical aspects of programming.
 
@AlfPSteinbach it's ok, I guess. I don't really think it's all that it's cracked up to be
 
11:23 AM
It is published by Microsoft. But I'm not sure if the author himself works for MS.
I should probably have a look at "Structure and Interpretation of Computer Programs".
 
what it covers isn't Microsoft-specific, at any rate
 
I think that, for good or bad, Design Patterns was a lot more influential than Code Complete.
 
there were a couple of chapters I found really informative, but also a lot of "well, duh", and some stuff that just seemed silly
 
Some interesting things I learned from Code Complete are table driven methods and the "pseudocode programming process"
 
@StackedCrooked I found the latter interesting because it's how I've always coded :)
 
11:25 AM
You mean writing entire thing in Python?
 
It also reminded me to always encapsulate repeated code into a function, even if it's only two lines.
 
 
@kbok How does this apply to the theory of evolution?
 
@StackedCrooked I think the end of the Cretaceous counts as a revolutionary improvement.
The end of the Triassic too.
 
Oh my, I added const to an int argument, and
1>d:\dev\libraries\progrock\winapi\error_handling.h(105): warning C4373: 'progrock::winapi::WinApiErrorCategory::default_error_condition': virtual function overrides 'std::error_category::default_error_condition', previous versions of the compiler did not override when parameters only differed by const/volatile qualifiers
 
11:32 AM
Birds are pretty damn smart, hard to say how the dinosaurs would turn out given 60 million more years. History is written by the winners, regardless of merit.
 
it's WARNING me that previous versions of the compiler were buggy
 
@StackedCrooked The pink part is where robots are.
 
@Potatoswatter Crows are smart. There a video on youtube where a crow bends a iron thread so it can be used as a hook in order to pick up food from a bottle.
 
@kbok scary
 
@Potatoswatter Well, it's how it turned out that counts. It led to improvements and it was certainly revolutionary.
 
11:34 AM
I don't think the human race will go extinct easily. We're 7 billion people spread all over the planet.
 
@AlfPSteinbach I think it would be much more scary without the wall (read: incremental modification from humankind to robot)
 
Puny humans.
 
We won't go extinct easily, but we easily lose what we like to think makes us human.
 
Good morning)
 
@StackedCrooked Dinosaurs said the same thing.
 
11:36 AM
@Potatoswatter Intelligence?
 
@CatPlusPlus If only they wrote books instead of posting junk on the internet, we would have been able to learn from their lessons.
 
I don't know how many dinosaurs there were and if they were all over the planet.
 
@RMartinhoFernandes Internet.
 
@RMartinhoFernandes Technology and cultural development. These things take resources to maintain.
 
@kbok You can learn from their lessons today: qwantz.com
 
11:37 AM
Intelligence is relatively useless by itself.
 
Oh, I never thought of technology as being what makes us human.
Of course, given that "human" in the non-biological sense is damn subjective...
 
Opposable thumbs are useful for crafting materials into things which are useful for improving your life.
 
@RMartinhoFernandes Yeah, it's too bad T-Rex didn't left the plans of the time travel machine.
 
And both technology and culture are subproducts of intelligence.
 
We have natural tools for making tools… the brainpower to figure out how is only part of the equation.
 
11:39 AM
template<typename T> class Dino { T Rex; };
 
Dino<int>::Rex
 
@TonyTheTiger : wrong way , Rex should be object of class template Dino grins
 
What's bigger than an int? A dinosaur.
 
Rex::~Rex <= wrecks Rex
 
lol
 
11:44 AM
if (--refcount == 0) throw ExtinctException();
 
#define cat int
static_assert ( sizeof ( long long cat ) > sizeof ( long cat ) );
 
Nah, it was more like vector<Dino>* dinos = new vector<Dino>; /* ... */ delete dinos;
 
You mean dinos.clear();
 
No, the whole vector is gone.
No more push_backing.
 
11:47 AM
Constructing a new dino requires a mommy and a daddy dino. I'm not sure how to put that in C++ code.
 
Here we go again…
 
dino d = mate(mommy, daddy);
 
dino baby = mommy.clone(daddy);
 
so if you are declaring a template with a non type parameter, would it be better to the first or the latter, in case the nontype was an array:
template<int buf[5]> class Lexer; // buf is really an int*
template<int* buf> class Lexer; // OK: this is a redeclaration
seeing that the array type would really decay to a pointer
 
The problem with the dinos was no std::future
 
11:48 AM
mommy.clone(female_dino); // runtime error or compiler error?
 
They had no cloning back then.
 
@StackedCrooked What the dinos do is their own business.
 
a Question : template template template parameters are allowed in c++ ? (though no need i felt so far )
 
@Potatoswatter We need to know. For science.
 
11:49 AM
@MrAnubis How would that work?
You mean template <template <template <typename> class> class T>?
 
yes
 
Yes, and the nested templates can even have default arguments.
 
The level of meta-ness shouldn't be limited imo.
 
Yes, that works.
 
@RMartinhoFernandes did you use them ever?
 
11:51 AM
template <template <template <template <template <template <typename> class> class> class> class> class>
 
Of course, 90% of the time, template template parameters are the wrong solution, but they are neat.
 
@MrAnubis No, and I'd really doubt it if I ever came up with such a design.
We need template lambdas.
 
@RMartinhoFernandes and if anyone uses that nesting , would you call that design bad?
 
@RMartinhoFernandes doesn't decltype do for templates what lambdas do for executable code?
 
decltype isn't obscure enough.
 
11:53 AM
@Potatoswatter Hmm, good point.
 
Thanks, I wasn't sure that made sense. I'll be falling asleep soon…
 
@MrAnubis I would seriously question it. It really looks like someone went overboard with template code.
For the same reason you don't usually see third-order functions (i.e. functions that take higher-order functions as arguments).
@Potatoswatter But decltype produces a type. Not a template.
Template aliases are more like it, except they have a name.
 
@RMartinhoFernandes : flying kiss to you
and i will never hunt your soul)
 
0
Q: On what does the size of an C++ object file depend?

Vinay KWhenever we compile a c++ file, an obj file is generated. I want to know that on what factors does the size of the obj file depend? Just to make my question more clear, For example a c++ file contains a class declaration and this class has 1 integer variable as data member and also has some memb...

 
@RMartinhoFernandes A template is a name which you add parameters to, so it's inherently un-lambda. If you could declare an unnamed class template within decltype, that would be something. Not sure how it would be useful, though.
decltype( template< typename T > struct { typedef typename traits< T >::foo; } )< bar >
 
12:01 PM
@Potatoswatter No, that wouldn't compile. decltype takes an expression.
 
There are a number of reasons it won't compile ;v)
But yeah, i suppose decltype isn't the natural keyword to enclose the "lambda" part.
The missing feature is more like class definitions inside template arguments, I guess.
Is there any way to make intializer lists work with a conditional expression without naming std::initializer_list or defining an array?
I want a range-for to select between two alternative sets.
 
12:18 PM
What's wrong with cond ? { args... } : { args... }?
Also std::initializer_list is uninvolved when it comes to arrays.
Do you mean list initialization syntax?
 
@LucDanton Doesn't compile in G++. I'm too sleepy to check the Standard.
Arrays are the best alternative I see, yes otherwise they are unrelated.
 
Oh yeah, that should have been cond ? std::initializer_list { ... } : and so on.
 
@LucDanton Well, if you're counting keywords, actually cond? std::initializer_list< std::whatever >{ ... } :
which really defeats the purpose of the syntactic sugar.
 
Yeah, today's chores exhausted me, can't think straight anymore.
 
Using list-initialization to define an auto array, the type doesn't need be named at all.
 
12:24 PM
@Potatoswatter To be fair { initializers } wasn't valid outside of aggregate initialization before; now it's extended to different kind of initialization but still won't appear outside of an initialization context.
 
I just want it to work in a subexpression of an initialization context. Which requires propagating the contextual information a bit further.
 
You can change T t = cond ? { blah } : { bleh }; to auto t = cond ? T { blah } : T { bleh };` but that won't work for arrays.
Well unless that alias trick is legit.
 
I can do auto a[] = { blah }, b[] = { bleh };
If I'm naming one alternative, I might as well name the other as well.
 
i finally got the top level usage down to practical proportions:
extern "C" HRESULT __stdcall DllRegisterServer()
{
    try { return (dll::registerServer(), S_OK); }
    catch( ... ) { return winapi::hResultFromX(); }
}
with this definition
    inline HRESULT hResultFromX()
    {
        try { throw; }
        catch( std::system_error const& x ) { return hResultFrom( x ); }
        catch( ... ) {}
        return E_FAIL;
    }
and -- i guess much code will look like this with C++11 ---
    inline HRESULT hResultFrom( std::system_error const& x )
    {
        std::error_code const&  error   = x.code();

        if( error.category() != winapi::errorCategory() )
        {
            return E_FAIL;
        }
        return HRESULT_FROM_WIN32( error.value() );     // Deals OK with HRESULT.
    }
 
what are you working on, again? sanitizing win32 error codes?
 
12:33 PM
at the very moment, yes. i just got it into my head that i want an analog clock in the Windows 7 toolbar
so it's a toolbar
Microsof has documented that the API may be removed in Windows 8+, so it's about last chance to do it... :-)
the problem with the built-in analog clock widget is that it won't keep position above task bar
it gets under
 
ah
 
i don't know why i used comma operator there, isn't the following more clear?
extern "C" HRESULT __stdcall DllRegisterServer()
{
    try { dll::registerServer(); return S_OK; }
    catch( ... ) { return winapi::hResultFromX(); }
}
 
1:18 PM
does anyone know about GLEW library? , is it openGL library?
 
@MrAnubis from the description at glew.sourceforge.net, it manages loading of extensions for OpenGL, and exposes the OpenGL library
 
sir thats what i couldn't understand, what does that means?
 
an "extension" extends, adds functionality
if OpenGL is like other libraries, then extension will be dynamic libraries
"dynamic library" is one that can be loaded at run time, and in this case is
 
so still i will have to install openGL seperately, it does loading part only?
 
1:23 PM
i am right now so confused what to learn and what not to learn, so much in c++
 
OpenGL is hardly C++-specific.
 
hm, hungry. dinner coming up.
current version of code i showed, criticism wery velcome:
 
what does this error means : undefined reference to `png_create_read_struct'
library linkup problem?
 
hey
this standard is quite pricey
 
@MrAnubis I think you need to -lpng
 
1:30 PM
still same error(
 
@hexa There are other publishers besides the ISO.
And a few days ago someone in this chat linked the TeX source, including makefiles. It's on github.
 
@Potatoswatter ANSI appeared to charge double the ISO price... :-(
 
76
Q: How to find and remove "spicy" media files from my PC

ScottI have an embarrassing problem: during my younger and wilder days, I used to download a certain type of movie clips and pictures. The combination of youthful foolishness and a couple of beers apparently caused me to put these files in odd places on my hard drives. My girlfriend is moving in with...

 
@MrAnubis in general, yuo don't need to install OpenGL. It comes with your OS and/or your graphics drivers
which is where it can get really confusing
 
@kbok lol
 
1:33 PM
@AlfPSteinbach There are publishers besides ANSI and ISO. They're all likely to be pretty expensive, but it should be < US$200
 
@jalf Runtime maybe, libraries and headers don't have to.
On Linux you need GLX and Mesa. OSX has OpenGL framework, dunno if it's installed alongside Xcode or available OOB. On Windows headers and libs are part of the WinSDK.
 
0
Q: Winsock: Overlapped AcceptEx indicates a new connection where noone is

IncubbusEDIT2: *all the nescessary code (I hope) on codepad, because its a bit confusing/much for in here:* http://codepad.org/nrTmfUjR In my program I am using Overlapped AcceptEx() to accept new connections. After a new connection has been accepted, the programm initiates another overlapped call to Ac...

 
@CatPlusPlus I assumed we were talking about the runtime :)
 
GLEW was the context AFAIR.
 
> A lot of research has gone into automatic identification of porn images. A quick google search brings up pages such as yangsky.com/products/porndetect/index.htm
 
1:38 PM
@kbok that is a silly question hahaha
I have a directory on my desktop called Educationals I even share it via DLNA so I can porn watch on my living room
:P
 
I'm actually surprised that no one proposed a viable technical solution.
 
I secretly hope one day I get my wife watching it
 
@kbok very silly. however, the page you linked to had some content not suited for work!
 
Nearly everyone advised him to talk to his chick. Come on, a real man would have written a perl script.
@AlfPSteinbach Actually I felt the danger and I did not click myself :)
 
my girl found all out my porn when we were still dating
she installed this "great program" called Picasa
that scanned the drive for pictures and stuff
It was funny
 
1:42 PM
Clbuttic.
 
mingw uses lib files as extension *.a?
 
Weird, usually carpoolers recognize themselves by looking at the cars. "I have a black ZX with plate number 44".
 
@hexa Picasa is how my sister found my collection. these days I use truecrypt.
3
 
But this chick told me : "I'm tall and I have pink glasses". Uh, finding her won't be a piece of cake.
 
@StackedCrooked Today I don't see much of a point to actually have videos and pics on the harddrive. You can stream for free on pornhub and the likes
but yeah, that was 3-4 years ago :P
 
1:48 PM
@hexa True. And clearing the history is just a keystroke away.
 
mingw uses lib files as extension *.a?
 
that is for static linking
.so for dynamic
or .dll for windows i guess
 
@hexa Some silly tools still output .so files, and you have to rename them by hand.
 
@hexa yes i was asking about static lib , so your answer is yes , right?
 
yes
 
1:50 PM
thanks
and MSVS 's static library extension is *.lib
which is good imaage lib , libpng or DevIL?
 
I use freeimage. I heard DevIL is good but never tested it.
 
libpng and DevIL aren't comparable.
 
libpng is very low-level, I don't think you really need that.
 
The first is an implementation of a specific image format.
 
yes indeed
 
1:56 PM
@MrAnubis depends on what you want to use it for
 
DevIL has a stupid name that requires extra thought for Google.
 
freeimage has a nice C++ binding
 
CImg worked remarkably well when I tried it, but I only needed some pretty basic functionality.
 
If you only want to load the image into a texture or something, then libpng would be just fine, if you can bear C API.
 
@CatPlusPlus SGI threatened to sue the guy for naming it OpenIL.
Apparently SGI thinks they own all Open*L names.
 
1:58 PM
Not Khronos?
 
But it's still a stupid name.
 
Except for OpenAL, who is owned by some big company and they only bully individuals that don't do it for the money.
 
@CatPlusPlus Khronos only took over a couple of years ago anyway. Might have been before then
 
@CatPlusPlus seriously ? i am right now looking at libpng , and it is horrible for beginners+ i think
 
1:59 PM
It's in C.
 

« first day (325 days earlier)      last day (4622 days later) »