« first day (400 days earlier)      last day (4566 days later) » 

5:00 PM
@Fanael it's a separate rule that just says "an extern inline function or function template definition may be defined multiple times in the program ..."
 
Als
@RMartinhoFernandes: In absence of deletor?
 
user784668
So there's no name?
 
i'm sorry i just confused the function template instantiation with the function template itself
well first, the function template definition is allowed to appear multiple times
 
@Als If you don't provide a deleter, it uses the default one.
 
and then there is no rule that says "a function template instantiation may only exist one time". so they can be instantiated multiple times naturally
 
Als
5:03 PM
@RMartinhoFernandes: So same problems as the static_cast.
 
note that an instantiation is not "defined". it is generated by a compiler
 
Als
@RMartinhoFernandes: How....
 
@Als Because the deleter will be called on the original pointer, which has the correct type.
 
user784668
Uhm, okay...
 
Als
5:05 PM
@RMartinhoFernandes: Yup, I noticed.
Thanks
 
although sometimes the spec talks about "the definition of the function template is instantiated", but I think "definition" is a bit overloaded. one thing is the program text called "definition" and the other thing is the part that the definition actually denotes (i.e a function itself) which is called "definition" too
 
user784668
I gotta go before my mind blows up.
 
Als
I need to run though..in a bit of jiffy today.
See ya.
 
the ODR in 3.2, i think, does not restrict function template instantiations, and in fact, the list of 3.2 does not enlist them.
but for template instantiations, clause 14 does have a separate rule " A specialization for any template may have points of instantiation in multiple translation units. If two different points of instantiation give a template specialization different meanings according to the one definition rule (3.2), the program is ill-formed, no diagnostic required."
note how it adds itself template instantiations to adhere to the rule list given at 3.2 for the other kind of entities.
 
@JohannesSchaublitb what is origin of discussion?
 
5:10 PM
12 mins ago, by Fanael
What's the standardese for the type of linkage that inline functions and template instantiations have?
 
oh. well you know if you fully specialize a function template in a header, you'll have to add inline. or else.
do you think that might be what the question is about?
 
but then it's not an instantiation anymore
an instantiation is a generated specialization. if you fully specialize the template, then you have an explicit specialization.
 
yeah, formal terminology
 
@JohannesSchaublitb "If two different points of instantiation give a template specialization different meanings..." How can this happen?
 
if you specialize explicitly, you may add "inline" and then you have an inline function that the rules apply to
 
5:13 PM
but then there are not any partial specializations of function templates
 
so template<typename T> void f(); template<> inline void f() { }
is alowed to appear in a header multiple times in a program
 
well if you fix it
 
because the explicit specialization is a normal inline function (note: it is not a non-template inline function, but it is also not a function template anymore)
 
the meaning of the phrase non-template function is highly difficult to deduce from the spec, but it actually means "function that is not a function template specialization"
 
5:16 PM
i think they should have hired the guy that came up with the name "exxon"
 
@StackedCrooked it can happen if you have different ADL reachable functions in the different TUs
 
or there should be some mark that says when a term is used in a purely formal sense as opposed to descriptive
 
in general, if you have the dependent names be defined different.
hm the thing about dependent names is actually already specified by clause 3.
not sure whether there can be any more conflicts in template instantiations than dependent names that would only affect the instantiation. things like, where an expression will get different values seem to need a different "outside" world already and would seem to either require a different dependent name or a violation of the rules in the outside world already
so i believe until seen otherwise that the rule about dependent names would be sufficient. but nontheless clause 14 applies the entire rule list to all instantiations, just to be safe I think
wow im writing nonsense again xD
 
it's good that at least you realized
:)
 
5:35 PM
Someone ought to make a buzzword dictionary.
The definitions would just point to other buzzwords.
 
is std::carray a real (standard) C++ thing?
 
never heard of it
 
std::array, sure
but std::carray? very unlikely
the Standard doesn't think of them as "C arrays" like we do
 
@DeadMG it definitely says std::carray here for reasons I can't quite figure out
 
typo? it's just one character
 
5:39 PM
n3290 does not mention "carray" anywhere.
@awoodland where?
 
@FredOverflow it's a type that SWIG provides a wrapper for
 
never heard about carray
 
Anyway, it's not in n3290, so it's not standard.
 
it looks like it's a precursor to std::array from a book by "Nicolai M. Josuttis" perhaps
 
teh swig header says "std::carray - is really an extension to the 'std' namespace."
 
5:42 PM
I just read about SWIG. Maybe array is a reserved word in so many programming languages that they decided to replace the C++ name array by something else?
 
'"The C++ Standarf Library", by Nicolai M. Josuttis'
 
it certainly is reserved for C++/CLI
 
also they have another funny typo '"The C++ Programming Language", by Bjarne Stroustup.'
 
@JohannesSchaublitb "Standarf" standing for "Standard Barf"? ;)
 
they became swiggy
 
5:43 PM
Teh C++ Porgamming Langauge!
 
lol
Porgamming League
 
void bjarne(str ou, str up);   // That's how I remember the spelling
6
 
@awoodland They are all prefixed with 'c'.
 
3
I just love this :)
 
@FredOverflow Any details on how the sound is generated?
 
5:53 PM
It appears to be influenced by the value that is currently being looked at. The higher the value, the higher the frequency.
 
Ah, here's a video by the same author with an explanation:
 
You haven't seen those videos?
I feel Internet old.
 
> This particular audibilization is just one of many ways to generate sound from running sorting algorithms. Here on every comparison of two numbers (elements) I play (mixing) sin waves with frequencies modulated by values of these numbers. There are quite a few parameters that may drastically change resulting sound - I just chose parameteres that imo felt best.
@CatPlusPlus I just rediscovered them and still like them.
@CatPlusPlus They're only 1,5 years old.
 
That's the worst part.
 
Gnome sort, originally proposed by Hamid Sarbazi-Azad in 2000 and called [http://sina.sharif.edu/~azad/stupid-sort.PDF Stupid sort], and then later on described by Dick Grune and named "Gnome sort", is a sorting algorithm which is similar to insertion sort, except that moving an element to its proper place is accomplished by a series of swaps, as in bubble sort. It is conceptually simple, requiring no nested loops. The running time is O(n²), but tends towards O(n) if the list is initially almost sorted. In practice the algorithm can run as fast as Insertion sort. The average runtime is O...
^ I think of all these as bubble sort.
 
5:57 PM
So what is your favorite sorting algorithm? I think mine is Heapsort. It's just so elegant and beautiful!
 
Mergesort is simpler.
 
@FredOverflow i don't remember their names mostly. the basic insert sort and selection sort, and bubbling as implementation technique for them. radix sort, quick sort, merge sort. i would have to look up heap sort to implement it. i think i like radix sort and other bin sorts best. after all it's what the postal service uses or used to use.
but basically, i think it's generally best to avoid full fledged sorting. better to put new data in sorted relationship immediately. like put it in map, or whatever.
 
sbi
@FredOverflow Sleep Sort. My favorite sorting algorithm by far.
 
I'm trying out Vimperator.
 
sbi
@CatPlusPlus That certainly sounds pretty close to Wimperator to my ears.
 
6:04 PM
: This article is about the programming language. For other uses, see Supercollider. SuperCollider is an environment and programming language originally released in 1996 by James McCartney for real-time audio synthesis and algorithmic composition. Since then it has been evolving into a system used and further developed by both scientists and artists working with sound. It is an efficient and expressive dynamic programming language which makes it an interesting framework for acoustic research, algorithmic music and interactive programming. Released under the terms of the GNU General Pub...
 
@CatPlusPlus Mergesort requires external storage.
 
damn that sorting sounds thing hurts ears xD
 
6:21 PM
Damn, had to switch to another user to kill a rogue Flash.
 
^ This appears to not be Lenna?
 
> I came here for the music and her playing technique.
Also, seems totally like she's not playing Guitar Hero.
 
@RMartinhoFernandes how does one play it?
 
@AlfPSteinbach Like that, but it looks like she's just randomly pressing buttons.
 
sbi
@RMartinhoFernandes Which buttons? Yours?
 
6:25 PM
@sbi The guitar! There's buttons on the guitar!
Maybe I never saw my friends playing on Expert.
 
sbi
@RMartinhoFernandes I don't believe you.
 
Okay, query time. Who has blogs or whatnot and would like to make @Feeds do a blogroll.
(Software development themed, obviously.)
 
@sbi I like this comment:
> How could anyone just walk by?! I would've stopped to watch...
 
sbi
@RMartinhoFernandes Do you like the guy? Interestingly, I have only just found him when I went to see Katie Costello, which he was touring with. She must have eaten something wrong (while in Hamburg), and actually went to the hospital that night, so Greg had to do the concert by himself. I went with a friend, and we were quite disappointed, but Greg managed to convince us that he's good enough on his own.
This was taken shortly before she got sick.
@CatPlusPlus I'm confused. How do you want to make @Feeds do anything?
 
6:37 PM
By... adding feeds.
 
sbi
Ah, I see. Sorry for being so dense.
Well, I dunno. I've never been someone for regularly reading blogs. I can't keep up. The only one I have been keeping up with (for almost two years now) is Twitter, but that has lots of private stuff coming by, so it seem unfit for this.
(afk)
 
It's just a thought. It might spawn some interesting discussion or two.
7
Q: Why does removing the else slow down my code?

pessimopoppotamusConsider the following functions: def fact1(n): if n < 2: return 1 else: return n * fact(n-1) def fact2(n): if n < 2: return 1 return n * fact(n-1) They should be equivalent. But there's a performance difference: >>> T(lambda : fact1(1))...

Silly benchmarks, Python edition.
It's even better than usual silly benchmarks.
 
why we have two remove algo's i.e remove_if and remove , why didn't standard provide the overload remove to accept predicate also?
 
NullUserException ఠ_ఠ says the functions are not tail recursive. Am I completely misunderstanding tail recursion, or the functions are tail recursive?
 
Those two aren't.
 
6:45 PM
Why not?
 
Tail recursive function calls itself as the absolutely last thing.
These do multiplication after the recursive call.
 
Oh.
So I was misunderstanding it.
 
@LewsTherin you there?
 
7:03 PM
@sbi Just to make sure I got it right, you were disappointed because of Katie missing, not because of Greg's performance, right?
 
7:17 PM
The hardest part of installing Linux is coming up with a color scheme for GRUB.
 
If you have OCD.
 
White on black. Done.
 
White on black looks icky.
 
The default one. Who cares, really.
It shows for entire 5 seconds once a day.
 
@CatPlusPlus i'm not sure what "blogroll" is, but you could always add alfps.wordpress.com
 
7:18 PM
Well, you have to see it every time you turn on your computer. Might as well make it nice.
 
if it isn't dangerous
 
@AlfPSteinbach I mean it would announce new posts.
 
@CatPlusPlus unfortunately i haven't posted in about a year
 
Well, let's just add some and see if it's annoying or bearable.
 
Why not add Herb Sutter's or some other "important" C++ person's blog?
 
7:20 PM
Gimme feeds and I'll add 'em.
 
 
No shit, Sherlock.
 
7:21 PM
 
hi
 
Are you sure @Feeds is okay with the added workload?
@jalf Hi.
 
That's what he's paid to do.
 
 
7:24 PM
If something proves to be too high-volume, we can always drop it.
 
Alf P. Steinbach has stopped a feed from being posted into this room
 
so the feed guy goes back about 18 months or so
?
 
It's a common technique of failing at implementing feeds on chats.
By not rejecting the initial backlog.
 
I think it processed everything.
Everything back to normal, you can come out from under the table, everyone!
2
 
7:32 PM
.
.
.
 
now i almost have to write a blog posting again heh :-)
 
7:58 PM
Hey, anyone around?
 
I'm trying to pass in a string literal from main to another function which opens a file with that string.
What datatype/header file do I need for "string".c_str()?
 
"string" is an array.
No headers are needed.
 
Well, if I do something like this:
bool encode(string);
 
c_str() is a function on std::string. You need to #include <string> for that.
 
8:01 PM
fileIn.open((filename + ".txt"));
 
What's the type of filename?
 
@RMartinhoFernandes string
1 min ago, by Moshe
bool encode(string);
filename is that argument.
 
filename += ".txt"; fileIn.open(filename.c_str());
 
ifstream takes a char const* as argument.
You can just call c_str().
 
Don't remember if (filename + ".txt").c_str() would work.
 
8:03 PM
@CatPlusPlus It does, but I want to avoid calling that method if I can.
Is there some simpler way to do it?
 
@CatPlusPlus Yes, it does. The temporary lasts for the entire function call.
 
Use Boost.IOStreams.
 
No, this is someone else's hw, can't use external libraries.
 
@Moshe To use ifstream you have to.
It's a sucky part of the standard library.
 
There's no way to handle "somefile" as a c string automatically?
 
8:05 PM
Pass it as a C string?
 
Literals are C strings, but you don't deal with a literal here.
 
(But then you lose the ability to append.)
 
Nor you should.
 
@RMartinhoFernandes What does that look like? Single quotes?
 
Just forget about it and call c_str.
The entire purpose of this method is interop.
You need it, call it.
 
8:06 PM
Oh boy, everytime I have to explain stuff like this I hate C++.
 
They're doing arrays now.
@CatPlusPlus I'm trying to figure out the wrong alternative way, not sure how the prof taught it.
I'm not arguing that it's better, just trying to see what the alternative is/was.
 
The wrong alternative way is strdup and strncat.
 
@Moshe but what exactly was the task given?
 
The "alternative" is using a char const* and do the allocation, appending, and deallocation manually.
 
Really, don't bother.
 
8:07 PM
Sticking to c_str() is way better.
 
@RMartinhoFernandes Ok, thanks. That's what I wanted to know.
@AlfPSteinbach Calling an RLE encode and decode function, where the filename is passed in from main();
So I wanted to find out if the passing was happening correctly.
 
Wait, it can't be char const*, it has to be char* for appending.
 
strdup.
 
you can do things like this:
 
You can't pass a literal if you make it char*.
 
8:09 PM
#define BASENAME "whatever"
#define TXTFILE_NAME BASENAME ".txt"
 
You don't need macros for literal concatenation.
 
@AlfPSteinbach And then that will be passed in as a C string?
 
#define ENCFILE_NAME BASENAME ".enc"
yep
 
ok, but why can't I just use quotes then?
 
@Moshe But the name will be fixed. And you can't do the appending otherwise.
 
8:10 PM
That's so strange.
 
What quotes?
 
never underguesstimate the Power Of The Preprocessor (POTP)
 
Why must I #define it, instead of declare a variable?
 
I think only one of you should answer him :)
 
well you can just write it out instead of declaring a variable?
 
8:11 PM
char* filename 'filename'
@AlfPSteinbach What type should the parameter be then?
 
Single quotes is a character literal.
 
Ok, is the filename fixed or is it input?
 
bool encode(string);
@RMartinhoFernandes Yes, it is.
 
const char* filename = "filename";
 
8:12 PM
ok
 
Never assign literals to char*.
 
@Moshe Then just write it out!
 
Writing code this messy and horrid is killing me inside
 
Ok, thanks. After listening to you and fiddling, I'm going to stick with the string and c_str method.
 
8:15 PM
Don't ever question the guardians of Lounge<C++>.
 
<insert maniacal laughter>
@KianMayne Who's forcing you?
 
Myself
 
Ok, here's a solution to your problem: don't force yourself.
 
I'm rushing out something so I can see it working and so I can use it then I plan to make it prettier
 
I think you have mother issues.
 
8:17 PM
Haha
 
(I have no idea what that means, but I hear shrinks like to say it.)
 
I found a great registry hack that lets you remote over to people while they're logged on :) Thank you internet
 
@KianMayne Link?
 
sbi
@RMartinhoFernandes Yes, indeed. As I said, we didn't even know Greg, despite the fact that he was listed first on the posters. :) We went to see Katie, who was listed underneath, and were actually considering not to go to the concert at all when we were told she's sick and won't appear. Then it turned out the nice chap talking to actually was the guy whose name was atop the poster, and he seemed nice, so we decided to give it a try nevertheless. And it turned out that he is pretty good, too.
 
@sbi Apparently they do a lot of stuff together.
 
sbi
8:26 PM
@RMartinhoFernandes Do they? What have you found?
 
(At least that's the impression I got from spending the last hours browsing Youtube for them.)
 
@Moshe It was a while ago so give me a minute
 
sbi
@RMartinhoFernandes I'm surprised. Most of what I found of her was she alone. He did collaborate with some other woman/women in other videos. I'm hazy on the details, though.
 
He authored the video here.
And there's some other mentions of him in other videos.
 
8:28 PM
They don't appear in many videos together though :)
Btw, thanks for posting that link and mentioning Katie. I'm in love with her music now.
 
It would help if I updated my server when I get my client to send random packets to actually know what to do with those packets
 
sbi
@RMartinhoFernandes Nice one, that.
@RMartinhoFernandes Yeah, I seem to have completely missed that.
 
@KianMayne Cool!
 
sbi
@RMartinhoFernandes Nice. I have her Kaleidoscope Machine album (bought from iTunes, I don't own a CD), and while I like it and think it's a nice one, it's never been at the top of my list of most favorite albums. But I really, really like the first Berlin Session where they sing Out Of Our Minds. That is soo great! I since keep coming back at listening to songs of her new album, contemplating whether to buy it. :)
BTW, if you like Katie Costello, you might want to have a look at Sarah Blasko. (Note: I can't see that video myself – here in Germany, for the usual reasons –, so I hope it's the right one.)
 
For inexplicable reasons, I don't really like buying non-physical music. Even though I only use the CDs to rip the tracks once and then shelve them and never use them again.
WTF? 60 quid?
 
sbi
8:43 PM
@RMartinhoFernandes Actually it's the same here, it's just that I don't have the money anymore to buy everything I would want to, and buying albums downloadable is cheaper. :-/
@RMartinhoFernandes That's hilarious indeed. I just tweeted her about it. (She's been quite responsive to me on Twitter so far.)
 
It's 10 bucks on the Amazon US store (as is on her website), but that requires me to be raped by shipping costs.
 
sbi
@RMartinhoFernandes I just wanted to gladly report that it's only €8.99 at amazon.de, but that's only mp3's. :-{
@RMartinhoFernandes How much is shipping from the US?
 
@sbi Last I checked was on the order of 10 bucks per order, plus 10 bucks per item.
Outrageous.
Seems like it's got a lot better now, though.
 
when a ctor fails, throw or set failbit?
 
$3.99 per order and $2.49 per item.
Amazing.
 
sbi
8:55 PM
@RMartinhoFernandes I could buy it from amazon.com for less than $10, shipping included.
The cheapest offer is $4.65, shipping is $5.30.
@wilhelmtell Usually shutting down the program is the only option left.
 
hey, check what I can do:
Interval X(-1,2);
debugf(X);
debugf(X*X);
debugf(X/X);
debugf(X+X);
debugf(X-X);
gives
main.cpp:26: X = '[-1..2]'
main.cpp:27: X*X = '[-2..4]'
main.cpp:28: X/X = '[-INF..+INF]'
main.cpp:29: X+X = '[-2..4]'
main.cpp:30: X-X = '[-3..3]'
damn that is sweet :)
 
@sbi why?
 
@eisbaw You're using using Boost.Interval?
 
@wilhelmtell usually, you call a constructor because you need the object. How many situations can you think of where it's ok for a constructor to fail?
 
@sbi Yep, seems like the US store is actually usable now :)
 
8:58 PM
yes, and my own int-wrapper (called Integer)
 
i know that usually people say "throw when ctor fails", but fstreams use the failbit at that point. it implies there are pros and cons. i just wonder.
 
Throw.
 
Integer allows for int-aritmetic but also supports infinities
 
those situations exist, sure, but they're rare. Usually, when a constructor fails, you're screwed
 
Invalid objects are useless.
 
8:59 PM
Go tell that to the Java folks.
 
... these are int's, not some floating points ;)
 
@wilhelmtell or, it implies that iostreams use a goddamn stupid broken design and we're lucky we got the STL to change the direction of the language away from it ;)
 
sbi
@wilhelmtell Oh, it's a constructor! Sorry, for some reason I read dtor. No, a ctor should throw, IMHO.
 
I prefer not being chased by a pitchfork mob.
 
I'm working on a BCL (base class library) for C++, similar to .NET. One of the things I've been wondering; is, how to support international characters in my library in a cross-platform manner.
 

« first day (400 days earlier)      last day (4566 days later) »