« first day (446 days earlier)      last day (4495 days later) » 

12:00 AM
the ^ is a giveaway
 
@Mysticial Can't say I ever played a serious game of Matrix chess. I just loved the challenge to prove these guys that I could whip it up in a few days (well, took 2 weeks, really). But I even implemented a GUI forking DreamChess. You can see what it looks like in the demo vids
 
ok :) now I'll know what I'm learning, thanks :d
 
@MooingDuck Every IDE is a PITA.
 
@CatPlusPlus notepad isn't bad
 
{| align="right" | | | | |} {| align="right" |-valign="top" |+ | | |} Castling is a special move in the game of chess involving the king and either of the original rooks of the same color. It is the only move in chess (leaving aside promotion) in which a player moves two pieces at the same time. Castling consists of moving the king two squares towards a rook on the player's first rank, then moving the rook onto the square over which the king crossed. (Castling is in rule 3.8) Castling can only be done if the king has never moved, the rook involved has never moved, the squares b...
 
12:02 AM
That's not an IDE.
 
How in the world does someone get his king down there?
 
@Mysticial Lol
> White could have checkmated by 18. 0-0-0# but instead played 18. Kd2#
What does 0-0-0 mean?
 
Queen's side castling
Ke1-c1 (Ra1-d1)
 
And why is Kd2 not checkmate in this situation?
 
both would have worked
 
12:05 AM
@StackedCrooked In het Nederlands: 'lange roccade'
 
@Mysticial Ah, I thought so.
 
Though I would've gone with the castle. Since checkmating someone with a castle is waaaaay cooler than a lame one-step move... And it gets bragging rights too, "I checkmated you with a queen-side castle!"
 
It wouldn't have occurred to me.
 
Github down? Can't clone my own gist/refresh webpage.
@StackedCrooked also, even grandmasters might prefer not to take risks (doubting whether special rules apply; a simple mate is 'safer' than the fancy-pants version)
Github works again. Mmm. Ghosts
 
It would be epic fail.
 
12:17 AM
@Mysticial I added the code generating the castlings for all 3d/2d chess variants to the gist: gist.github.com/…
As you can see, I had great fun keeping everything absolutely generic.
 
Help, I keep opening tabs.
 
If you look closely, you'll see strange memory management thingies like mtx_board_destroy - that is because I had designed it with a pure C API to enable easy integration into an existing Chess UI (such as DreamChess, which I picked for it's fantastic graphics).
Internally, everything was generic C++ though. I should redo this thing in C++11. I expect the code base to shrink by about 50%
 
My own hobby project doesn't work that well with OOP... So I ended up writing all of it in essentially C99 with C++ compatibility...
 
Mmm. Fixed my botched copy/paste to github. Is now more useful excerpt :)
 
12:24 AM
I didn't need any C++ features, so there wasn't a point to use them for the sake of using them. Keeping C99 compatibility does open up some doors for integration with other C projects.
On the other hand, my code-analyzer project was initially over-engineered with C++ constructs for integration with LLVM.
 
@Mysticial I see what you mean. I had this conservative 'wisdom' when I did that toy project. However, if I had to do again today (lol) I would definitely write it all in pure C++0x and just write a C wrapper API if I had to.
 
C99 has no RAII. No generic programming. No exceptions.
 
I'd actually try to learn Boost Python for the occasion
 
It's just ridiculously primitive.
 
@CatPlusPlus bicycle doesn't have boobs.
 
12:26 AM
What?
 
I mean: 'duh' everyone knows that.
 
@CatPlusPlus That's really all you need when you're just crunching numbers... Most of my other non HPC projects are C++.
 
@sehe The "I bicycle" part thrown me off track.
 
@Mysticial depending on the nature of the crunching, I'd deffo stick to C++11 as well
@CatPlusPlus LOL I missed that. (Ah, that's where the 'I' had gone! I missed an I on my other message. Clipboard fail x2)
 
Lol.
The elusive migrating 'I'.
 
12:29 AM
@CatPlusPlus (Apple wants it back)
@crunching: gives you options to play with allocators, alignments, SIMD (-ftree-vectorization?) move semantics if appropriate. Most interesting algorithms have unpredictable runtime behaviours depending on CPU arch, L2 cache etc.
Then again, the 'plain dull' just-get-cracking-fast type of crunching hardly needs tuning of that sort (nothing that can't be seen up-front)
 
@sehe who is crunching? SO has no user by that name. Oh, @ the topic.
 
@MooingDuck I read the newbie hints the other day (YAY)
Apparently I should refer to @topics by using @ampersands as well
 
@sehe uh oh. I'll have to read them again to know what you're talking about
 
@MooingDuck ^
 
"Refer to specific messages by clicking on the down-and-right arrow that appears at the right of all messages when you hover over them (or by clicking the v arrow as mentioned above and picking "reply to this message" from its menu). This will start the message with :NNNNNNN, where NNNNNN is the message's ID. "
"Mentioning others using the familiar @syntax will notify them — auditively if they are in the chat, and through the StackExchange inbox feature across the whole SE network. The UI will suggest matches after you type @ and the first letters."
 
12:34 AM
I might not have read them too well, but I thought 'heh - that's actually quite practical'. So, if it's not there, I made it up based on the confusing jumble that is in the newbie-hints :)
 
@sehe I read them about every other month because I forgot something
 
so it seems.
 
#letsbetwitterforawhile
 
@sehe You don't need to tell me that... :) I think I know too well...
 
12:42 AM
@Mysticial It's never too well. Besides, tomorrow's CPU architecture will happily invalidate all your branch predictions, prefetch optimizations and you'll still have work to do :)
 
@MooingDuck: A friend of mine who's on the Clang team opines that array-placement-new is essentially unusable, and he's surprised it wasn't actually defined as`deleted` in the new standard.
 
Sigh. All this bootloader debugging and ridiculous workarounds to find that the bootloader was never installed in the first place. A checkbox in the installation wizard is inverted.
 
@sehe I hate that some algorithms are optimized for thier BigO instead of reality. like std::lower_bound with bidirectional iterators is optimized for comparisons at the expense of any number of movements.
 
wtf is up with people and code bloat?
 
I'd file a bug, but the project is practically dead.
 
12:43 AM
@sehe What I meant is that I know too well how unpredictable it is.
 
oh noes, your binary, it might be ... a couple of hundred bytes bigger! EMERGENCY!
@MooingDuck Uh, I'd expect that the number of movements involved in lower_bound is pretty trivially low. In addition, moving is a pretty damn cheap operation.
 
@MooingDuck Usually gotten around by just doing linear search for small (iterator) ranges of data. But, yeah, that might be done in the library (like they use specialized sort algos for small ranges, IIRC)
 
@KerrekSB He also suggested the "limit" version of the placement operator that allows for bounds checking which Howard Hinnant suggests in his answer.
 
@Mysticial Yeah true. That can be unnerving.
@Maxpm which one?
 
 
12:47 AM
@DeadMG yeah but std::lower_bound on a linked list will do on average double the number of node traversals as std::find
 
traverse a linked list and you get what you ask for
 
Oh, actually array-placement syntax doesn't even compile if you don't #include <new>.
 
You know what was really disappointing? Haiku r3.
 
@Maxpm Anyone ever used that?
 
@DeadMG applies to std::deque too, to a much smaller extent. If that memory is paged, std::find would be significantly faster.
 
12:48 AM
> Q. Who is Gobo?
>
> A. Apart from Fibo, his loyal servant, no one who saw him survived to tell the story. Beyond that, we never risked digging any deeper into the subject.
 
@MooingDuck Uh, std::find and std::lower_bound do distinctly different things
 
@sehe I mean besides its developers.
 
@sehe In a half hour or so, I'll be dual-booting it.
 
@DeadMG assuming the target element is in the list once, they don't.
 
12:50 AM
@CatPlusPlus Yeah, people use it, if the fora and mailing list is any indication.
It is a very small community.
 
Abandoning FHS always struck me as bit too ambitious for a Linux distro.
 
ok
 
@Maxpm In half an hour, I was dual booting Xubuntu Oneiric, Linux Mint DE and Linux Mint 12. And I installed Debian over my Solaris fileserver.
 
so this function is the same as this other function assuming some arbitrary pre-condition that might well not actually be true in an unknown number of invocations of it
 
Gentoo is the best distro anyway.
 
12:51 AM
@CatPlusPlus Gobo does it pretty well, actually.
@CatPlusPlus Funtoo is better.
 
(Nah, the latter took 15 minutes after that to make NFS sharing of my 30-odd filesystems work transparently like before.)
 
@sehe There's a set of micro-optimization techniques that seem to produce very good code on nearly all architectures. (some of which I've developed myself and published as part of my grad-school research) The idea is knowing how to "work with" the compiler...
 
I hate to break it to you, but std::find and std::lower_bound do distinctly different things
 
@CatPlusPlus It is. But is also annoyingly unpractical. I 'got off' gentoo in 2004.
 
@DeadMG fine. Fair enough. Point stands. std::lower_bound should be specialized for non-random-access iterators.
 
12:52 AM
@sehe That's why I don't use Linux on desktop. Well, one of the reasons.
 
I don't even have documentation for that algorithm
 
@Mysticial Linky? I'm always interested in good general guidance.
 
@DeadMG er, wait, I mean, std::lower_bound
 
well, it's a random access iterator
the whole point of random access iterators is to access them randomly
 
@CatPlusPlus It's not the desktop aspect. It is the 'you will always prefer to compile' aspect. I mean, the apt-get install - 3 seconds - run cycle really won me over.
 
12:54 AM
that kind of implies that actually, it shouldn't be a big performance hit to go randomly accessing them
 
I gave up on Gentoo/Funtoo when I realized I would waste so much more time compiling shit than I would save with speed/up-to-date-ness.
 
since that's their whole purpose
 
@CatPlusPlus apt-get source --compile or apt-build get you the rest.
 
@DeadMG what object was a random access iterator? I was talking about std::list
 
I use Gentoo on the server.
 
12:54 AM
> @DeadMG fine. Fair enough. Point stands. std::lower_bound should be specialized for non-random-access iterators.
 
apt-get always annoyed me.
 
@DeadMG That completely ignores CPU and memory architectures. For non-performance critical stuff, random access has O(1) access time. However, when CPU caches get involved, each layer of cache adds an order of magnitude to the latency
 
@DeadMG right, non-random-access
 
if the algorithm requires random access to be performant, then it does, and there's no way around that
@sehe No, it means that you should take it into consideration before advertising that you have a random access iterator
 
EASEUS Partition Master is the most well-designed software I've seen for Windows in a while.
 
12:56 AM
also, my MSDN page says that it takes a ForwardIterator
 
From a user interface perspective, at least.
 
@Maxpm: shame it isn't GParted :)
 
@DeadMG yes it does. And it runs slow unless given a RandomAccessIterator, because the standard is overly strict
 
you're asking it to perform a fundamentally random access iteration algorithm
of course it's going to run slow with a ForwardIterator
 
Here's the one that's been published.
http://www.ideals.illinois.edu/handle/2142/28348
It isn't about micro-optimizations, but it has a section on it.

That one only touches on some of the tricks. I'm currently working on a paper on FFTs that will go much more in-depth with portably micro-optimizing SSE/AVX and SIMD in general.

I will warn though that they are not very suitable for OOP heavy applications.
 
12:57 AM
Hmm... I have 64GB to play with. How big should I make my home partition?
 
@DeadMG whoa deja vu. I could have sworn you told me that exact same thing days ago
 
IMO, the defect here is that the algorithm is stated to only take a ForwardIterator
 
@DeadMG I would have relaxed the strictness of the standard for non-randomaccess iterators
 
meh
 
Woah these look nice:
- Convert dynamic disk to basic disk (WIN!)
- merge two adjacent partitions (Huh? Innovative, but is it useful)?
 
12:58 AM
it's a random access algorithm
no surprise that it doesn't play nice with only forward or bidirectional iterators
 
@sehe I've never tried merging. To be honest, I don't really know how that would work.
 
and you'd have to be an idiot to use a sorted std::list, since std::set is exactly that but vastly faster for this kind of operation
 
@DeadMG well, true, but I was making a container adapter that keeps elements sorted. I designed it to only require bidirectional access, in case someone comes up with something cool, but then discovered that std::lower_bound is slow for lists when it's trivially made faster. I wouldn't actually use a std::list.
 
@Mysticial Thanks. Re: "OOP" disclaimer: I don't mind. Knowing your stuff around CPU's has little to with the programming paradigm. (Yes, using many shared_ptr<>'s can kill cache locality, e.g. but in general: just be aware and do stupid things :)). Not even language-dependent (I've seen great real-time code on Java; Obviously C++ gives you way more control in general)
 
Oooh, it can format things to EXT3.
 
1:03 AM
@Maxpm WTF how's is that even worth an ooh? I can format things to EXT3 using a magnet and my bare hands (not on SSDs, yet)
 
user457812
Real men use space dust.
 
@sehe I didn't expect it from a Windoze©®™ app because Micro$oft sux0rz.
 
Well, AESEUS != Microsoft. That helps
 
@sehe Indeed, most people won't need to know it anyway. Unless they're trying to squeeze out that last 2 - 10x performance. (which is arguably less important than making the code readable in most applications)
 
@Mysticial So that's where your insane FFT experience came from, then - large number multiplcation by doing convolutions on the FFT (IIRC?)
 
1:07 AM
@sehe I was imitating the Linux fanboys who bash Microsoft every chance they get. :P
 
@Maxpm Who, me? :)
9 mins ago, by sehe
Woah these look nice:
- Convert dynamic disk to basic disk (WIN!)
- merge two adjacent partitions (Huh? Innovative, but is it useful)?
^ - Convert dynamic disk to basic disk >WIN< refers to that: end vendor lock-in
 
@sehe Yes, that's where it started. Though now my focus has shifted to mainly FFTs themselves and HPC programming in general.
 
By golly, 2am. I should really have liked to hasten my self to my bedlinnen
 
(\_/)
(o.x)
c(")(")
 
@Mysticial I think I envy that. Sometimes. Then again, I ditched applied mathematics for musical theory (strange chiasm lurking there), so I'm probably not brute enough to survive the area of research :)
In rhetoric, chiasmus (from the , chiázō, "to shape like the letter Χ") is the figure of speech in which two or more clauses are related to each other through a reversal of structures in order to make a larger point; that is, the clauses display inverted parallelism. Chiasmus was particularly popular both in Greek and in Latin literature, where it was used to articulate balance or order within a text. As a popular example, many long and complex chiasmi have been found in Shakespeare and the Greek and Hebrew texts of the Bible. It is also used various times in the Book of Mormon. Today, ch...
 
1:13 AM
What's that widget thingy called that lets you see things like core temperature and load?
 
@sehe I actually tried to get into EE - my Dad's field (he does cool things with lasers...) but I failed... and ended up with computers.
I didn't have the math to handle EE...
 
@Mysticial Hehe. I tried to applied maths - but it turned out maths is fun if you're motivated. So I got my required 'study points' with some informatics subjects to avoid getting penalized
 
@Mysticial Now you're stuck with us.
 
@Maxpm Not a problem. I like doing C++. Now only if my job allowed me to get back to it. I'm sure it will, though. I've been doing 36 months of straight C++ programming for 2 clients before my current gig - which is a C# gig
 
@sehe I tried EE (electrical), CE (computer engineering), AP (applied math), and CS during my undergrad. I ended graduating with EE and CS degrees. The CS degree was easy, but EE degree - oh I had to fight for that... not an easy subject
 
1:18 AM
@Mysticial You're dad must be proud anyway! I just skipped all of those. Don't know if I regret it (I'm sure I will when I'm a grumpy old man)
 
I don't care for math much at all.
 
I dropped CE because I didn't have time to take the two hardcore hands-on classes. And I dropped AP because Modified Bessel Functions were too much for me...
 
Damn. Nuked my own message by accidental edit. Repost:
@Mysticial Yeah some of the fellow students with the most brilliant math fu crossed the road to physics or EE.
 
My EE area was in VSLI - transistors and computer design... so it really didn't have any of the nasty Maxwell's Equations that my Dad taught me 30 times and I still couldn't grasp, lol.
 
@Maxpm I love maths. I really admire the beauty and elegance of it. I really love reading answers by math masters; they can really defuse complexity in a single sentence ("oh, that's just a complete cover problem, use the A* algorithm" or "transform it into a graph problem and use disjoint sets to locate the connected components; done." kind of wizardry.)
Alas, I wasn't smart / ambitious enough :)
 
1:25 AM
Math doesn't come to me nearly as easily as programming.
 
@Mysticial I can still hear my roommates complain ("Physisch Transport" - I think it translates to Transport Phenomena?)
@Maxpm I always expect this to happen: Until you do lisp and, then you 'get' maths :)
 
Heh.
I really must look into that language.
 
@sehe Same, I actually do enjoy math. But not proofs...
@sehe Mathematica is somewhat Lisp-like, and I use a lot. But for some reason, I hate Lisp, but love Mathematica...
 
@Mysticial Like in music, I really believe some brains are just geared towards that stuff more than others. See how Feynman + friends talk about Physics/maths. They just have been 'intuitively' doing math all their lives and it comes natural
I think a major factor with that would be, that back in the days, people used lookup tables for stuff like exponentiation/logarithms etc. They learned how to do multiplcation using sums of logs by hand. The absense of computers/calculators might make a profound difference on the way people learn maths and visualizing numbers
 
@sehe Speaking of music, I used to do a lot of it in middle and high school. I used to compose too... the problem is that I don't have freaking perfect pitch or even perfect relative pitch. So by the time I get home from school, I had already forgotten the tune I had in mind.
 
1:30 AM
@Mysticial Aw. :(
 
People would be able to 'estimate' the outcome of complex formulations mentally. They would 'see' how functions would behave and interfere.
 
I've tried many times to write down what I had in mind in class on music score... it always turned shit when I get home to play it back...
 
@Mysticial musical memory has preciously little to do with perfect pitch. I do have developed perfect pitch. That was a blast when auditioning at conservatory !
 
@Maxpm Not that perfect pitch is a good thing... but perfect relative pitch would definitely have been helpful
 
However, for practical purposes, perfect pitch can be a nuisance
 
1:32 AM
@sehe My math teacher calls that number sense. It's become a bit of a buzzword, actually. Whenever someone in the class doesn't understand something, he shouts, "I must have bad number sense!"
 
I've always wanted perfect relative pitch - but it never got any better than octaves and 5ths, lol
 
Relative pitch is pretty much a prerequisite. I remember the profs going further and further, until they had me enumerating all the pitches in a random cluster (facing away from the piano) and sing Webern a prima vista :)
@Mysticial Now, that is partly why I quit my studies: I didn't envision a career teaching solfege and harmony at conervatory. I couldn't imagine how I would 'teach' someone the difference between a major third and a minor third. I mean.... that's supposed to be obvious :) I used to think it was innate
 
hi, anybody who can help me with this?stackoverflow.com/questions/8735562/…
 
Thinking back, I must have learnt it while playing/singing along in church. I brought my blues harmonica on sundays.
@user726730 You know that is PHP, right?
 
so what? Only C++ here?
php is builded in C
 
1:37 AM
@sehe He's got a point. We're talking about music in the C++ room. That doesn't even have anything to do with programming. :) ROFL
 
@user726730 As off-topic as we love to be in this room (I'm not being sarcastic), people here tend to regard PHP and Java with contempt.
The one answer your question has seems to be pretty good.
 
but it doesn't work... i tryed echo"piece<br>".str_repeat("\n",4096)
well try to open this page dap.ntua.gr/el/ssh.php
 
@Mysticial But we like music, unlike PHP.
 
and type some url ( stackoverflow.com for example)
with firefox and with ie to see the difference
I like music && PHP
 
If I just answered a question with a class that lets one iterate over a tuple of types derived from a base type, should I be shot? I'm thinking so.
 
1:42 AM
well delete the first question if you have priviledjes
:P
and then answer the other question
 
@user726730 Try it with something other than \n. Use printable text, so you can easily verify that the string is being repeated correctly.
 
@MooingDuck not unless you also referred to Boost Fusion, that has the functionality right there
 
i check this after all complete
right click --> view source
that's not the problem
 
@sehe I should learn boost some day
 
@MooingDuck Don't bother. you can implement that yourself. Trivially with c++11 support :) (LOL)
 
1:44 AM
@user726730 I'd still try it. Correct me if I'm wrong, but I think we should be seeing 4096 line breaks in the source between each message.
 
aaa the script in the url doesn't have this
wait a moment to fix it
 
@sehe I've definitely had some pretty bad horror stories of extremely perfect pitch people. My piano teacher's daughter (given a calculator), can name your frequency accurate to like 0.1%.
 
@user726730 Ah, OK.
 
@Mysticial: let me guess. Violinist?
 
@sehe that's all awesome
 
1:46 AM
No, just normal piano. But she in fact does get annoyed at the 440/435 difference between Europe and the US
 
check now http://dap.ntua.gr/el/ssh.php
Works in firefox now, but not as in ie
 
(which I had to try very hard to hear...) I have two recordings of Beethoven's Pastorale - one via the New York symphony and one via London symphony
 
wrong
 
@user726730 Yes, you're right, the non-printable characters are being sent.
 
it seems to work correct?
 
1:48 AM
@Mysticial At our home, we developed a whatchamacallit (not a meme). Whenever a chair made a shreeking noise, someone coughed or even farted, I'd bet my sister on the pitch! Then we'd go over to the piano to decide who was right. Most often, we just agreed.
2
 
I think so
 
Well, some of the messages are still being sent in chunks. I'm not sure if PHP is the best tool for managing this kind of thing.
 
@sehe don't think that's a meme
 
@Mysticial As far as I remember, most American-built wind instruments are generally sharp in pitch relative to Europe
@MooingDuck oh, English is hard. I fixed it :)
 
@sehe Nice... ROFL...
@sehe I think the US is A-440 and Europe is A-435, I can't tell the difference unless I hear them side-by-side
 
1:50 AM
@Maxpm i accepted the answer..
It seems to works..
So lazy..
 
@Mysticial My sister went on to become a professional violinist. See, she has that certain... discipline I lacked :)
Europe has 440. 435 is probably 'ancient performance' (what's that in english? The opposite of contemporary performance practice)
 
@sehe While I was in the school orchestra, I was able to tune timpani - despite not having relative pitch. I think what I have is recognition pitch, but not relative pitch.
 
I hated that when we would have Analysis classes and the prof would use a recording by, say, Frans Bruggen or Harnoncourt. I'd be the one hearing the Symphony in A-sharp-ish...? instead of B-flat
 
lol
 
It gets really annoying when you want to quickly refer to the modulations and keys passed. Nowadays, I have trained myself a bit to be more 'key agnostic'. But I do it using 'lookup tables': I actually transpose things visually. It's a trick I learned by playing orchestral scores on the piano (you know, with all the transposing instruments and fency clefs)
 
1:54 AM
in regular c i have a variable, int num = (rand() % 30)-15;, but i want that number to be taken from argv[1] instead, so how would i make that work?
 
@TrevorRudolph int num = atoi(argv[1])? (add error and bounds checking)
 
@TrevorRudolph Okay. argv[1] is a C-string, so the first step would be to convert that into an integer.
 
nice
let me try
 
Okay.
 
@TrevorRudolph don't forget #include <stdlib.h>
 
1:56 AM
i have it already
thx
 
Okay, I'm definitely going to bed now.
 
thx guys..
time for sleep(60*9)
 
@sehe Speaking of those, are you able to hear (or get annoyed by) the difference between a piano 5th vs. a violin 5th?
 
47 mins ago, by sehe
By golly, 2am. I should really have liked to hasten my self to my bedlinnen
 
AFAIK, pianos are tuned geometrically to the 12th root of the 2. And violins are done using A-G = 1.5
 
1:58 AM
I guess it is a little late to fix the spelling now :)
 
Piano A-G: = 1.49831
Violin A-G: = 1.5
 
@sehe thx it worked
 
or maybe I have my facts all wrong
 
@Mysticial You're somewhat right on the 'well-tempered' tuning of pianos. Stringed instruments allow all kinds of tuning!
I'd usually do perfect fifths (pure tuning), but you'd let your fingers adjust for the required harmonic 'meaning' (semantics if you will) depending on context. Most of that is automatic when doing ensemble music. It doesn't annoy me, it intrigues me.
This christmas I have been doing a concert and the organ turned out to be in Werckmeister III. I do have to take some time adjusting to that though!
 
*oops, I meant C-G in my last post:

Piano C-G: = 1.49831
Violin C-G: = 1.5
 
2:01 AM
good evening
 
@Mysticial It's okay, but in practice, pianos are tuned by humans and they tend to have their favourite 'mental devices' to approximate well-tempered tuning. So they learn to tune perfect intervals and then adjust for the 'commas' in the tuning (jargon... sry). They can be 'measured' aurally by counting the number of so-called Beats. But it is all a game of roundings
 
@sehe I had to google what a Werckmeister III was...
@sehe Clearly I'm trying to mathematicalize the human mind... I don't think I'm gonna succeed.
 
The best piano technicians I know, they will ask about the repertoire and cater a tuning to the liking of the pianist. The keys used in the pieces can warrant slight adjustments and the particular tuning among the chords per-key is going to influence the way the pianist will sound.
 
@sehe Damn... that sounds about as hard-core as parsing HTML with regex...
 
@Mysticial don't worry. I have a collegue who is completely obsessed with tuning and he likes to sing in pythagorean tuning... He actually has a very good voice and can perform good songs - but he's also a bit nerdy on the tunings :)
 
2:08 AM
We're still talking about music?
You people aren't supposed to be artsy.
 
You're making it sound evil. Piano tuning is an artform (being a concert piano technician, really)
Parsing HTML with regexen is just ... hilarious
@Maxpm Oh shut up Salieri
Anyways. My bed is calling.
 
Night then. :)
 
Cheers
 
@Maxpm music is the flip-side of mathematics/logic... ...geeky code and deep mathematics can be very artsy
 
@Maxpm haha, yeah shuddup... Just another side of us.
 
2:12 AM
Lounge<C++>: Come for the pedantry, stay for the art.
 
Code is art.
I feel something when I see beautiful code.
 
Mmh.
 
looks like this is the most lively chat haha
 
@Twinborn Of course. It's the best chat ever.
 
:D
 
2:20 AM
This is always the most lively chat.
 
2:34 AM
Even on sunday nights. Actually, especially on sunday nights.
 
It's Friday!
 
So... are we submitting a defect report for those placement-array-new things?
 
@KerrekSB I wouldnt have any idea how to go about doing that
but it sounds like a good idea
@CatPlusPlus I don't think it's Friday anywhere on the planet
 
2:56 AM
I have Friday classes today and state holiday tomorrow, so it's Friday.
 
 
1 hour later…
4:19 AM
Hey one more issue:
http://stackoverflow.com/questions/8737064/php-explode-paradox/8737192#8737192
Plz take a look
 
4:50 AM
Hi everyone!
I can't find a chat for [C] so I'm giving a try in this room to ask some question, its about C pl.
 
Careful about that. C isn't C++.
You might find some help if it's simple, but otherwise you're better off asking it directly on SO.
 
Thank you, and I'm aware of that.
I just wanna ask, where could I find a good source of online codes for C.
 
Erf.
Could you be a bit more accurate?
 
Let's say, I'm a student and I have bunch of homework for C.
 
5:10 AM
Okay.
And you're looking for code in order to...?
 
5:23 AM
Hoping to find some answer for my homework..
 
And what is the objective of the code you need?
I have a quick question for anybody who's willing to take a stab.
Anyone?
 
Okay thanks! I'm just delving into C++, and a few days ago, I asked what the return 0 part in the main function did. I've come to the conclusion that it tells the OS or observing program whether the application exited successfully or not. My question is, why would the programmer tell whether the app closed successfully? Isn't that the OS's job?
 
5:39 AM
The official answer is that it's "implementation defined".
That is, the standard says nothing about what that return value is for. It just says that it has to be int.
(It can differ for self-hosting implementations, but that's another story).
On UNIX, every process gives an exit code (by convention, 0 means everything went well, while a different value is an error) when it terminates.
That code can then be used by the process' parent to determine what went well or wrong.
 
it's useful in *nix systems to know whether a program has exited cleanly. For example, in bash:
$ foo1 && foo2 && foo3

means execute foo1. If it returns cleanly, execute foo2. If not, do not continue. foo3 will be executed if both foo1 and foo2 return cleanly.
 
In practice, it's as if the process was a function that returned an error code.
 
But why does the programmer decide what the error code is? If the application doesn't close cleanly, but you have return 0 in there, then what?
 
then you have a bug (because your program is telling a lie)
 
If the process does not call exit, then the OS killed it.
(And exit is called when main returns)
 
5:45 AM
Ohhhhh! I think I get it. So unless main returns successfully, which calls exit, then there's an error?
 
Yep.
That probably means something bad, like a stack overflow or a segfault.
 
Thank you guys so much! I've been reluctant to keep going through books and tutorials without knowing what that means.
 
Anyway, don't worry too much about it. In fact, in C++, you don't even need to return something. As long as the return type of main is int, then it's okay.
But that's only for main. For anything else, you must return something if the function is not void.
 
Good to know! Thank you!
 
42
Q: In Russian roulette, is it best to go first?

nikkitaAssume that we are playing a game of Russian roulette (6 chambers). Assume that there is no shuffling after the shot is fired. I was wondering if you have an advantage in going first? If so, how big of an advantage? I was just debating this with friends, and I wouldn't know what probability to...

Good read if you're bored - especially the second answer.
 
5:54 AM
Good to know if I ever get forced to play that.
 
room topic changed to Lounge<C++>: Sudden out of power of computer and it is stuck. [c++] [c++11] [c++-faq]
 
6:38 AM
> But it seems to me that b->isSelf(a) should really be b -> isSelf(&a) because isSelf expects an address of type C?!
 
6:51 AM
What is going on in the heads of some people I wonder.
 
7:06 AM
It's really stormy outside. At one point I thought my apartment might collapse.
 
7:23 AM
1
Q: Construction of const object

user1086635 12.1/15 During the construction of a const object, if the value of the object or any of its subobjects is accessed through an lvalue that is not obtained, directly or indirectly, from the constructor’s this pointer, the value of the object or subobject thus obtained is unspecified. [Exa...

@StackedCrooked Where did that come from?
 
1
Q: Why C++ member function uses & in argument?

user001#include <iostream> using namespace std; class C { public: int isSelf (C& param); }; bool C::isSelf (C& param) { if (&param == this) return true; else return false; } int main () { C a; C* b = &a; cout << boolalpha << b->isSelf(a) << e...

 
Hm. The guy probably did C first.
When he saw &, he thought "oh, that's the address-of operator in C, so it's a pass by pointer".
 
7:41 AM
@EtiennedeMartel Lol, I didn't even notice the &a in the latter. I thought he thought the spaces around the -> in the second call to isSelf somehow had different semantics.
 
8:10 AM
Did I miss anything here?
0
A: How to use friend function of local class?

PotatoswatterA friend function declaration in a local class is still useful for a function template specialization. This is only true in C++11, since in C++03 local types cannot be template arguments. template< typename t > int bar( t &o ) { return ++ o.x; } int main() { class MyClass ...

 
8:22 AM
Can someone explain this, "The Lex programming tool and its compiler is designed to generate code for fast lexical analysers based on a formal description of the lexical syntax. It is not generally considered sufficient for applications with a complicated set of lexical rules and severe performance requirements; for instance, the GNU Compiler Collection (gcc) uses hand-written lexers."
What makes hand-written lexers faster than generated ones?
 
It's more about complexity than performance.
I'd think.
 
What do you mean?
 
@Pubby generated ones use standard generic algorithms which can handle a broad class of problems, but probably won't be optimal, and won't be able to handle some "unusual" grammar features that can't be expressed by these standard means
 
Lex works by generating a state machine and implementing it naively. That leads to branchy code.
 
I thought regex only has 1 representation as a DFA
 
8:27 AM
More generally, you can't optimize the output of an automatic tool. If you've written modifiable source, you can run it through performance analysis and fix the bottlenecks.
 
One more thing, is the lookahead operator in Lex still regular?
 
I think lookahead in regexes needs NFA, but don't quote me on that.
(...which would probably not change the fact it's regular.)
 
if it's regular it can be implemented in a NFA, and every NFA can be a DFA
 
I'm just derping out loud.
 
8:50 AM
So I just glanced over the chat since yesterday afternoon... wtf are you all on about? :P
 
9:18 AM
what is type of this expression &func<int, int, int,int> , if func is variadic template function?
 
@MrAnubis depends on the signature of func
 
@Pubby void func(T...A)
 
@MrAnubis Then the type should be void (*)(int, int, int, int)
 
0
A: Most accurate way to do a combined multiply-and-divide operation in 64-bit?

MysticialSince this is tagged Visual C++ I'll give a solution that abuses MSVC-specific intrinsics. This example is fairly complicated. Although I have a simpler algorithm in mind, it's probably about 30x slower. This solution has the following constraints: It requires x64. It will not compile on x86. ...

If anyone feels like helping me verify it.
Probably one of the hardest questions I've answered on SO...
 
9:35 AM
@Pubby hmm.. I know that but I can't be changing param list all the time, well I think i should be using decltype then :)
 
9:56 AM
3
A: How does this implementation of 1D IDCT work?

Dr. Andrew Burnett-ThompsonI'm not an expert at DCTs but I have written a few FFT implementations in my time so I'm going to take a stab at answering this. Please take the following with a pinch of salt. void njRowIDCT(int* blk) You correctly say that the algorithm appears to be an 8-length Radix-2 DCT that uses fixed ...

@Mysticial check this answer out
not bad :)
 
@Mysticial Ask @Mysticial, he knows much of this stuff. Oh, wait..
 
@Pubby while using static_assert can I (const_cast) pass an non-const expression ?
 
@TonyTheLion He has the diagram backwards. Stages 1 - 3 are flipped in the code.
 
@Mysticial oh, wow, good observation. Could you leave a comment?
 
@TonyTheLion Sure
 
9:58 AM
:)
 

« first day (446 days earlier)      last day (4495 days later) »