« first day (815 days earlier)      last day (4149 days later) » 

4:00 PM
Yeah, learning how to eat with chopsticks is pretty amusing.... for the first 30 seconds. After that you just rage.
 
Fuck chopsticks I'm eating with paws
3
 
@GigaBass Oh. You are still new here :)
 
Pffft, always going on the newbie.
 
Google is pretty useful.
 
Not in particular. I can just tell by the suprised responses you throw
 
4:02 PM
@CatPlusPlus How are you gonna learn, then?
 
haha I guess :P
 
Woah 51C in some parts of Australia
what an oven!
 
Xeo
@CatPlusPlus Actually, eating them with your fingers isn't bad.
 
Oh btw @sehe, I spent like 4h total just looking at your code and trying to figure it all out... why use the const so much? Does it lead to better performance?
 
Xeo
@GigaBass Yeah. The code won't even start if you're doing something wrong.
 
4:04 PM
@GigaBass It leads to fewer errors. And better performance, potentially
 
Xeo
That's as fast as you get for finding an error.
 
@Xeo I know
 
Ohhhh you're right, becasue if I mistakenly try to change it's value, which is not what I want, it'll complain!
Hmmm, sweet, will start using it frequently. The reasoning to use it is: "I just wanna read this: add const", correct?
 
Immutable by default
 
Do you guys like folk metal?
 
4:07 PM
Korpiklaani.
Folk metal, yes please.
 
@GigaBass Indeed. You'll be informed even when you forgot you were taking things by reference. You wan't be able to accidentally modify that collection, while some other part of the code is still iterating it. Etc.
 
Ahhh so that's why you left the &getLayer have a duplicate method, one with const, and the other without, so I have a means of still acessing a layer to change it! @sehe
 
wow, NuclearBlast has a lot of folk metal bands signed
 
@GigaBass Indeed. This is idiomatic c++: you can have const/nonconst and volatile/non-volatile overloads of the same method
 
Yes, NuclearBlast <3
 
4:08 PM
@Crowz not sure if I've ever heard it before
 
@GigaBass Also, >0 or can they get negative?
 
Hm, what you talking about, lost me there? The layers? Layers are always positive <--- This made no sense, what am I saying?
 
@GigaBass Pro tip: hover to see the subject message replied to
 
Ohhhh, I see. Is NuclearBlast negative? What? >_<
 
4:11 PM
@GigaBass You said:
2 mins ago, by GigaBass
Yes, NuclearBlast <3
 
OHHHH
 
You know, if that is signed... it could be <-13 as well
 
LOL, that joke. Yes, I'm totally not used to being here. <yet>
 
Nuclear blast is less than three
 
/* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT.
   But in fact it might be less smart and round addresses to as much as
   DEFAULT_ROUNDING.  So we prepare for it to do that.  */
lol
 
4:12 PM
@TonyTheLion Lol. Where is it from?
 
If malloc were really smart, it wouldn't be in libc
 
Yup, eluveitie, great band aswell @Crowz
 
@GigaBass they're definitely one of my favorites
 
There's just something about having music with windpipes that gets me rock hard
 
4:13 PM
/* Determine default alignment.  */
struct fooalign {char x; double d;};
#define DEFAULT_ALIGNMENT ((char *)&((struct fooalign *) 0)->d - (char *)0)
/* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT.
   But in fact it might be less smart and round addresses to as much as
   DEFAULT_ROUNDING.  So we prepare for it to do that.  */
union fooround {int32_t x; double d;};
#define DEFAULT_ROUNDING (sizeof (union fooround))
TMI
Also, confirmed non-female
 
hahaha
 
I dig bagpipes and violins.
 
Yeah, any girls here? It's more of a rhetorical question likely, but yeah
 
@sehe yep that's where it's from
 
is Objective C a lot like C or no?
 
4:15 PM
@sehe they also have some strange function declarations:
 
Not really, but also crappy
 
void
_obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
     struct obstack *h;
     int size;
     int alignment;
     POINTER (*chunkfun) ();
     void (*freefun) ();
     POINTER arg;
{
dafuq?
 
@GigaBass Yes. No. Maybe
 
@GigaBass Nolwenn LeGuin (or however exactly it's spelled) is, but not here at the moment.
 
what's all that crap doing between opening brace and end of func args?
 
4:16 PM
K&R prototypes
 
You aren't sure about yourself, you mean @CatPlusPlus? Well, you do have an image of a cat :)
 
Dinosaurs.
 
It's ancient even for C
Irrelevant pre-standard crap
 
@Crowz The advocates will tell you (accurately) that it's a pure superset of C. That said, programming using it is entirely different -- it's mostly Smalltalk with C syntax.
 
Being a superset doesn't mean that much semantically
 
Xeo
4:18 PM
@JerryCoffin s/Guin/Guen/
 
I had no idea about montreal, @EtiennedeMartel
 
Are you accusing Jerry of not trying to make a joke/pun
 
in PHP, 4 mins ago, by Neal
I hand a subdomain to the js room and this is what they come up with: http://lemon.thedoctoriscool.com ... OY
 
Unfortunately, I hate French. With a passion.
 
@GigaBass passion is a French word, not?
 
4:19 PM
Yes. The irony in and of itself! :D
 
French is literally Hitler
 
Apparently it's Greek.
 
@CatPlusPlus I'm careful to say something serious at least once a month.
 
It is? Close enough..
 
@Xeo Ah, that's it. Always reminds me of Ursula Le Guin.
 
Xeo
4:21 PM
lol
 
@CatPlusPlus A unjustified speed ticket gets him serious.
 
Does everyone here have a degree/currently doing it, on CS? Don't you constantly feel it's all for a diploma and that you actually learn very little of use?
 
@GigaBass Yeah, I hear that often.
 
@GigaBass Yes
 
@GigaBass Yeah, I got the degree mostly because it gets your resume on the stack.
 
4:22 PM
The other day I said that to a professor directly, and he got pretty upset about it... e ven though I was pretty soft on how I said it
 
Otherwise it might end up on the heap
2
 
@GigaBass Oh god. Not another. I think we need to create the "CS Uni Haters" chat room.
 
Montreal only makes me think of satanic panic in the attic. Which is an album by a American band called Of Montreal.
 
@CatPlusPlus lol
 
Formalised education sucks
 
4:23 PM
lol @JerryCoffin x) But it's true.
 
@sehe At least one person who gets it
 
@CatPlusPlus As I've pointed out before: if it sucked, it would actually be good for something.
 
I also got it @CatPlusPlus, tsk tsk
Well @JerryCoffin, what's your say about CS Uni?
 
@CatPlusPlus Resume resume = new Resume. There, now it's on the heap.
 
A degree does have it's uses
I managed to get to work without, but it was hard.
 
4:25 PM
When you run out of toilet paper
 
also lots of closed doors
because companies will consider you as a last option generally, when you don't have a degree
or you get the shit companies
 
Really? Well, a degree is a requirement for stuff nowadays...
 
either one
 
I already got a job thanks to that degree so :v
 
@GigaBass yes, that's what I've found. Especially in IT field.
 
4:26 PM
I've decided to postpone the use viagra during my professional career. I'm beginning to see it causes very bad spelling. (Thanks spam)
3
 
It is a reference
 
To be a street cleaner you need the 12th degree done (what you do before enrolling in uni)
 
@GigaBass My experience with it was so long ago, it probably doesn't mean much any more.
 
@TonyTheLion I got another offer for Viagar in the mail :)
 
4:26 PM
Oh, ok jerry
 
It is a piece of paper that gets jobs
 
Eh, new DLC for AC3, and Ubi announces it with... a press release.
 
Unless you're one of those crazy people who actually enjoy academic environment
And have OCD focused on three letters before your name
Or after
@EtiennedeMartel Isn't that how you announce stuff?
 
@EtiennedeMartel "New DLC for AC3, and Ubi AIW APR." FTFY.
 
@sehe lol
 
4:30 PM
@CatPlusPlus Well, the fact that it's a press release makes me think this announcement isn't aimed at gamers, it's aimed at shareholders.
 
I do love being in university, yes, I just hate that I feel like I actually learn nothing or very little
the ONLY subjects I felt were useful, were Introduction to Computer Networks and Systems
 
"Hey, we're gonna make some more money with that DLC, so why not buy some more Ubisoft stock, hmm?"
 
where I learned what are bits, bytes, and all that low-level shit, and I loved it, and this semester's follow-up to it, Functioning of Operative Systems
 
It's AC3
 
@EtiennedeMartel Impress shareholders: press release. Impress gamers: Booth babes.
 
4:32 PM
Players don't care :v
 
@CatPlusPlus Stop using words like "everyone" and "players" when you mean "I".
@JerryCoffin It's always about the tits.
 
@EtiennedeMartel No, @EtiennedeMartel, it is not. youtube.com/watch?v=qpMvS1Q1sos
 
So many plinks.
 
@EtiennedeMartel There's more to life than tits -- legs and butts matter too!
 
4:34 PM
@JerryCoffin Also faces, but that's my romantic side speaking.
 
@JerryCoffin Adebisi disagrees, @JerryCoffin youtube.com/watch?v=ZX_6_R1NsoQ
 
@GigaBass His loss.
 
haha
 
@EtiennedeMartel Well, yes -- I took that for granted (but probably shouldn't have).
 
Xeo
4:39 PM
Alright, time to screw this 32->64 bit conversion for today.
See ya guys tomorrow.
 
cya
Ignore the portuguese article: see the video below
 
@EtiennedeMartel very inconvenient place to land a plane
 
@TonyTheLion Yeah, it appears to be a bug.
 
Holy shit, they claim it can run ANYTHING? Of modern games?
 
4:50 PM
Well, modern smartphones have ridiculous power and they are limited by their battery life, so it's not that much of a stretch.
 
@GigaBass Why not? At least as far as I could see, it doesn't seem to include a hard drive though, so it ends up either expensive (SSD) or external. Personally, I prefer one big box to a bunch of little ones, but others undoubtedly disagree.
 
hello
 
user1182183
hm what's the best way to represent big numbers in C++ code? In PAWN I can do : 1_000_000_000
 
user1182183
will be 1000000000
 
1000000000
 
4:53 PM
Actually you're right
 
user1182183
@Rapptz and a more readable way?
 
1000000000
 
Looking at the smartphones there are today... not much of a surprise.
 
user1182183
ah okay, so the c++ preprocessor lacks this functionality :/
 
read more
you get used to the lack of commas quickly
 
user1182183
4:55 PM
@Rapptz commas? in pawn if you use return 1,000,000,000 will be an error xD and return 1_000_000 wil return 1000000
 
I thought we established that Pawn was crap on a biscuit.
 
@Rapptz Heeeeeeeey broooo
 
hello
 
@EtiennedeMartel But it's buttered crap on a biscuit.
With garlic flavoring.
 
I am at work. :D
 
4:56 PM
o_O
Quick, everyone post the most annoying, full-screen NSFW pictures you can!
 
Oh my it has numeric literal separators waaaaaaaaa I want this everywher
 
@CatPlusPlus ?
 
Numeric... literall... ... separators?
 
THE BEST LANGUAGE EVER
 
4:58 PM
I never heard of PAWN until Gam Emix mentioned it a while ago.
 
@Rapptz Ahh.
 
You're not missing out on anything
 
I figured
 
@CatPlusPlus Actually, that would be kind of nice. Of course, if you want it in C++11, you could do something like "1_000_000_000"I.
 
you could probably find a way to do it with commas.
 
4:59 PM
What do you mean by Numeric Literal separators, though? :c
 
It's pretty trivial to do with PP
 
I'M SO CONFUUUSED
;~;
 
@ThePhD When you write a number on paper, you usually separate hundreds, thousands, etc with a comma. i.e. (1,000,000,000)
 
Well, trivial with right scaffolding already in place but that's PP
 
@Rapptz what time did you get for 39? I got 57 ms (12 ms when threading it)
 
5:02 PM
@Rapptz You could, but it'd be ugly. The problem is that something like 1,000,000 will use the built-in comma operator, so you need to force a context where the pieces get treated as your type that overloads the comma operator. (e.g., integer(1),000,000,000 could work, but it's ugly).
 
@JerryCoffin I was thinking something like a string with commas.
 
user1182183
int FUNCTION ReturnVersion()
{
return "1_000_000_000"I;
}
 
user1182183
return type does not match return value of function error
 
user1182183
0
Q: Representing big numbers in source code for readability?

Gam ErixIs there a more human-readable way for representing big numbers in the source code of an application written in C++ or C? let's for example take the number 1,000,000,000,000 , in C or C++ if we wanted a program to return this number we would do return 1000000000000. But this is not really reada...

 
@Rapptz That's trivial. Making "1,000,000,000"I could be made to work.
 
5:03 PM
Yeah exactly. No point overcomplexing
 
@CatPlusPlus ## paste operator?
 
#define NUM(...) NUM_SEQ(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))
#define NUM_SEQ(seq) BOOST_PP_SEQ_FOLD_LEFT(NUM_FOLD, BOOST_PP_SEQ_HEAD(seq), BOOST_PP_SEQ_TAIL(seq))
#define NUM_FOLD(_, acc, x) BOOST_PP_CAT(acc, x)
 
@GamErix Yes, it takes a bit more than that to actually make it work -- this would be a user defined literal.
 
variadic macros are TEH_DEVIL
 
Gam Erix your question is spawning bad answers :(
 
user1182183
@Rapptz changed the question
 
@CatPlusPlus Post that on his shitty question
 
I have a question. Do you think it would be possible to program knowledge of music theory into a computer?
eg, it knows what the most logical note and chord progressions are and can on the fly make a song?
 
@Crowz no
@Crowz yes
 
5:10 PM
Well what I have in mind is you select a style, styles have certain progressions of chords most of the time... it selects one just by chance
 
Why are my high-precision C++ timers giving me the same time for two completely different programs >:O
 
Then for the harmony it knows strong/weak/medium beats, instruments used by that style, and general note progression (for example, root to third)
 
@Mysticial FYI, I think I beat this with a time of 11 seconds on a question on meta. I'd have to go into the SEDE to verify though (although it should be there now with weekly data updates).
 
Is there some limit at which the precision hits an upper barrier or something?
 
user1182183
ok lol let that question be viewed by other people because I think it's actually a good question. However I just changed the design... also a solution ;> just a #define VERSION(main,sub,build) (build+sub*1000+main*1000000)
 
5:13 PM
Seriously, this is your ENORMOUS NUMBER that requires digit grouping to be readable
 
user1182183
@CatPlusPlus Yes..
 
lol
 
Ell
Hi guys
 
0.00167619 milliseconds... this number meaningful in any way with respect to C++ timers?
 
user1182183
well that NUM solution is actually very good ; o
 
user1182183
5:16 PM
@MarcusStuhr standard C++ timers or high res timers like QueryPrecisionTimer (windows)?
 
@GamErix QueryPrecisionTimer
 
0
A: Representing big numbers in source code for readability?

DavidMaybe you can use this notation: return static_cast<int>(1e6); Or maybe you can consider using the hexadecimal numeral system. I found a hex converter here. 2345879444641 == 222314f9ca1

 
@MarcusStuhr In C# you can get the resolution of the Stopwatch
 
Ell
hmm. "Exceptions handling is a mechanism to handle errors. An exception is handled by saving the current state of execution in a predefined place and switching the execution to a specific subroutine known as an exception handler." <-- why does the current state need to be saved?
 
USE HEX IT WILL MAKE YOUR NUMBERS SUPER READABLE
 
user1182183
@MarcusStuhr then it should be meaningfull, but it can depend on some variables
 
Timer.h: http://pastebin.com/raw.php?i=TjTRKqgD
PE1.cpp: http://pastebin.com/raw.php?i=tcg8vCa3
If anyone would be willing to pop these in and tell me what runtimes they see (and if they too get 0.00167619 frequently)
 
lol you did it the summation way
 
O(1) time though
 
What the hell are you measuring
 
5:20 PM
yeah I know but 1000 operations isn't much
 
Time of execution
 
A function that can be completely optimised out?
 
@Rapptz No but it's fun to optimize something to the hilt
So you could increase the bounds and it'd still be O(1)
 
@Ell in what language? It's not saved in C++
 
yeah I understand
 
5:22 PM
What's it called in a database when an attribute determines another attribute?
 
user1182183
@Crowz isn't that a relation?
 
Ex: genre determines subgenre
 
I'm still not quite sure if the value I'm getting is simply "as fast as it can reliably measure" or an actual problem that needs addressing
 
@GamErix Well I mean that one attribute is completely tied to the second attribute. So in order to get a subgenre of "heavy", the genre attribute MUST be "metal"
 
5:24 PM
Functional dependency
 
@MarcusStuhr what do you get if you just measure start/stop?
 
Maybe
 
Ell
@MooingDuck I didn't think it was - it's on this programmers question (programmers.stackexchange.com/questions/181850/…) language agnostic I tihnk?
 
@MarcusStuhr missing inline
 
@MarcusStuhr If I did it right I can measure 0,000310305943041482 ms resolution (C#)
 
5:25 PM
@Ell in C++ the state is not saved
 
@JohanLarsson Same thing
 
user1182183
boost/variadic .. where the hell is that : o
 
Of course I can increase the time by adding in longer processes in the function but it still calls into question if it's actually measuring properly
 
Ell
@MooingDuck yeah. I still wonder why it would be in other languages?
 
5:26 PM
@Ell I think the answer is wrong, I don't know any language where state is saved
 
Gah, now I want to make a template solution
 
@MooingDuck Missing where exactly?
 
@MarcusStuhr timer class
 
user1182183
Why my boost is always incomplete thefuck ; o no variadic in /preprocessor XD stupid PC
 
user1182183
probbly unpacked it with errors and didn't let me know ;>
 
5:28 PM
Maybe download a new version
 
Remember when I said PHP was the Nickelback of programming languages? I apologize. That was unfair to Nickelback.
 
@MooingDuck Even when I inline the entire class, same value
 
user1182183
@CatPlusPlus I have 1.51 that's not so old ; o
 
I don't know when this was added
 
user1182183
found it in thhe archive
 
5:29 PM
bost 1.51 is from like september 2012
 
@MarcusStuhr no, I mean... if you make another cpp file, and #include "Timer.h", you'd get errors, because the Timer members are not inline and so are ODR violations
 
user1182183
anyway g2g to work, bye
 
@MarcusStuhr also the macro ought to be _WIN32 (with an underscore)
@MarcusStuhr I timed it and encountered a problem. The compiler is smarter than you are. The assembly it's generating for for(int i=0; i<1000000000; ++i) ans += PE1(); was mov edi,dword ptr [esp+0Ch].
 
@EtiennedeMartel Sigh. I've only been in this room for like what? 2 weeks? And I'm already tired of people bashing PHP (and Java). And I was already tired of people bashing Nickelback WAY BEFORE that.
 
@AndreiTita But... Java sucks...
 
5:35 PM
@ShotgunNinja * head explodes *
There. I hope you are happy.
 
@AndreiTita How can you be tired of people bashing stuff? Unless you like said stuff.
 
@MooingDuck Not familiar with such an error
 
@MarcusStuhr when I change it to for(int i=0; i<laps; ++i) ans += PE1(i);, then I get 1.02475e-005 seconds.
 
@AndreiTita No, really... My job entails Java web application development. Also, I am very happy. Just not with what I do at work.
 
@MarcusStuhr basically you have two functions that are exactly identical (or so the compiler thinks, since the file was included in two cpp files) and it gets confused. It should have a linker error.
 
5:37 PM
Perhaps we're using the programs in different ways, because I don't encounter any linker errors or anything like that. I'm just running the cpp, which includes Timer.h -- for now looking at the output of a single call to PE1()
 
@MarcusStuhr yes, since you only have one cpp, the error doesn't appear. If you use two cpp files, the error appears. Program as you sent it runs fine, it's just considered "poor code".
 
@AndreiTita Indeed we are. We're equal opportunity bashers though -- we bash all the languages that suck (including C++).
 
@JerryCoffin I disagree, we bash C++, python, Haskell, and a few others far less than say, Java and PHP.
 
Got the Timer class from songho.ca/misc/timer/timer.html
 
@MarcusStuhr he probably had the functions defined in a cpp instead of the header
 
5:40 PM
@MooingDuck We probably bash them less, but that doesn't contradict what I said.
 
@MarcusStuhr I downloaded it, he has the function definitions in a cpp, which is the right thing to do
 
He did -- I pulled them into the header. Probably why
What's the correct way to use it?
 
@JerryCoffin Yeah. I spent like 5 hours trying to debug a stupid C++ error I made in a Matrix lab for a computer graphics course; turns out I had an off-by-one error and a size declaration error which caused a runtime dump when a free() failed.
 
@MarcusStuhr exactly. Easiest to put "inline" in front of each of the function definitions.
 
If I was using any other language with managed array sizes, I would have found the error in a matter of seconds, but I wasn't.
That is my issue with C++; uninformative error messages.
 
5:41 PM
@ShotgunNinja so debug with a managed array then
MSVC's array class does that I think. Tests bounds in debug mode. Same with vector.
 
@AndreiTita It's our duty to future generations to make PHP and Java die
 
@MooingDuck I wasn't allowed to, for the sake of the class. Also, we were on linux, because of it being a low-level graphics course.
 
@MooingDuck I think .at() tests bounds in all modes, too
 
@ShotgunNinja So basically, you're saying you used an array instead of an std::array or std::vector? This isn't one you get to bash C++ for -- it's entirely your own fault.
 
@ShotgunNinja Then code array yourself, it's not that hard.
@AndreiTita also in release.
 
5:42 PM
@JerryCoffin Again, I wasn't allowed to use std containers, for the sake of the class. I also wasn't allowed to introduce my own custom classes.
 
@MooingDuck That's what I was saying!
 
Education is shit
Those rules don't help anything
 
@ShotgunNinja Okay, then it was your teacher's fault.
 
The entire point of that lab was to make sure the C++ noobs understood exactly how that particular situation can be fucked up.
 
@AndreiTita That's why I did not recommend that. It slows down release builds
@ShotgunNinja actually, that makes sense.
 
5:43 PM
@MooingDuck Ah I see nvm.
 
Bounds testing is not a bottleneck
 
Rarely.
 
I think the reason why I moved them was because I couldn't access the functions if I only included the header
 
In fact, that was posed as a hypothetical question at the end of the lab assignment: "What is the design flaw inherent in the operator[], and how could it be solved in future assignments?"
 
23 mins ago, by Cat Plus Plus
A function that can be completely optimised out?
 
5:45 PM
@CatPlusPlus Not usually -- but needing it is more often a sign of poor design (though I do wish some sort of range were standardized, so we'd have an easy "better design" to recommend that would almost always eliminate the problems).
 
@CatPlusPlus I know better than to argue performance with you
 
~performance~
 
@CatPlusPlus "can be" is slightly different than "is"
 
It's one expression full of constants
 
anyone read this one yet? http://shop.oreilly.com/product/9780596515171.do
looks interesting...
 
5:46 PM
Added inline, put things back into .h and .cpp
 
Sometimes I wished I had a script which starred everything by @Cat except anything containing "Java" or "PHP".
 
@CatPlusPlus and with a minior change the compiler no longer optimized it out. Still all constants
@MarcusStuhr wait, only do one of those >.<
 
@AndreiTita You could write one, but we'd hate the language it would be written in.
 
@MooingDuck What did you change?
 
@ShotgunNinja lol :))
 
5:47 PM
looks like Stroustrup is the first interview/chapter
 
@CatPlusPlus passed a parameter to the function instead of using the default parameter. PE1(i) instead of PE()
 
@JerryCoffin I like my safety checks
Well it's not constant then, at least not as constant
 
@CatPlusPlus I prefer code that's obviously correct.
 
I prefer to not worry about that and have compiler verify it
 
@JerryCoffin Isn't that part of the KISS law?
 
5:48 PM
PE1(1000) would be optimised out as well
 
I must be misunderstanding you; what exactly should the structure of this be? A .h and a .cpp? .h only?
 
@MarcusStuhr Either one. I prefer h only since the class is so tiny.
 
Before, I had everything in the header
 
If i is that loop variable then PE1(i) is not constant
 
@MarcusStuhr if it's h only, you need inline. If you split it into a cpp, there's other pros and cons and you need to not have inline
 
5:50 PM
@ShotgunNinja Mostly it's paraphrasing from C.A.R. Hoare, who said something code so complex it wasn't obviously incorrect vs. code so simple it was obviously correct.
 
@CatPlusPlus the sum total of the loop is, but I see your point.
 
So you mean something like pastebin.com/G9UbRgZf ?
 
Compiler would probably have to aggressively and entirely unroll the loop to notice that
Dunno
 
@MarcusStuhr header and destructor too. Otherwise yes
 
do you mean constructor?
 
5:51 PM
@CatPlusPlus or could notice that loop bounds are constant, body is constant based on index, ergo... but that'd be pretty advanced.
@MarcusStuhr yeah, sorry about that
 
But really measuring that function doesn't mean much anyway
 
@CatPlusPlus If i variable then i not constant. (We can reduce the statement it even further to make it point-free.)
 
Hmmm, still the same timing
 
@MooingDuck Loop bounds are constant, but the expression has different value in each iteration
 
@MarcusStuhr oh yeah, it was a "is the code good" thing, it wouldn't affect the timing. But now your header works in more programs than just that one.
 
5:53 PM
Hi everyone
 
So it'd have to basically run that loop at compile time
 
Good to know
 
@CatPlusPlus yes
 
It's been a while :)
 
Regardless, I'm still concerned that it seems to be outputting the same value each time
 
5:53 PM
Then notice all parts are constant
Then optimise the loop out and replace it with a precalculated sum
 
@MarcusStuhr sorry if I wasn't clear that it wouldn't affect this particular program in any way.
@CatPlusPlus I don't know the sum, that's what computers are for.
 
No, I appreciate it either way -- always good to learn more
 
@MarcusStuhr probably minimal timer accuracy.
 
And something like that is bound to have like million corner cases, so no wonder it doesn't do that
@MarcusStuhr Because it doesn't do anything
 
@MooingDuck That was my initial hunch but I get the value for two completely separate programs, one of which is still fast but not O(1)
 
5:54 PM
@kfmfe04 Glanced through it at the store. Wasn't impressed enough to buy. Even if it were free, it looked to me like the time to read it was more than the book was worth.
 
@MarcusStuhr did you check the assembly for the function?
namely, when I tried your code there was no assembly because the program didn't actually call that function.
 
The true way of ~performance~ is throwing more pointless microbenchmarks at it not inspecting the code
The function would be inlined even if it wasn't completely optimised out
It's just one expression
 
@CatPlusPlus It's a general structure to be extended in a consistent way for more problems than just this one
 
Your problem is measuring time with this instead of a profiler
 
The ideal goal in the end is to get the runtimes for many problems in aggregate
or a listed distribution etc
 
5:58 PM
I was thinking about Factor EDSL to generate C++ boilerplate today
Compilation firewalls and all that
 

« first day (815 days earlier)      last day (4149 days later) »