« first day (488 days earlier)      last day (4458 days later) » 

6:01 PM
I'm always confused when I see 13K rep users asking basic C++ questions, until I remember SO isn't C++ specific :/
then again, this asker has more C++ tags than any other by a large margin...
 
For advertising this PC repair business, I've posted flyers, and just set up an adwords campaign, what else could I do?
 
@MooingDuck I worked in a C++ shop for 11 years, have 40K on SO, and still probably couldn't answer anything beyond the basics. But hey, if you got a winAPI question...
 
@KianMayne Write a virus to infect local computers, drum up business.
 
@Potatoswatter Haha
I thought about putting up this 1m x 0.6m poster up, but I could get fined for £75
 
@Shog9 he was asking what C++ data types matched which ISO standards for floating data types.
@Shog9 we still have a mod here? Are you stubborn, or an assigned watchdog? :D
 
6:11 PM
@MooingDuck :)
 
@MooingDuck Eh, if I don't keep at least one room open on chat.SO, it logs me out of all of them. This one's been interesting ;-)
 
Nineteen Eighty-Four (first published in 1949) by George Orwell is a dystopian novel about Oceania, a society ruled by the oligarchical dictatorship of the Party. Life in the Oceanian province of Airstrip One is a world of perpetual war, pervasive government surveillance, and incessant public mind control, accomplished with a political system euphemistically named English Socialism (Ingsoc), which is administrated by a privileged Inner Party elite. Yet they too are subordinated to the totalitarian cult of personality of Big Brother, the deified Party leader who rules with a philosoph...
 
@Shog9 You didn't make to be SO community controller for nothing. Nice reply. ;)
 
We are The Room.
 
@Shog9 But you still get notifications on the main SE, right? That works a little oddly…
 
6:12 PM
Niepokonani. @CatPlusPlus
 
@Potatoswatter Only if I ignore them here
 
@Shog9 Ah, thanks for the explanation. Being logged out would force you to ignore them?
 
@Potatoswatter Yup. Well, for about a day. After that, they just disappear.
 
There are three separate chat servers, and they all act independently - so if you're not in at least one room on each, you eventually lose the ability to get notified (for that server)
 
6:15 PM
SO, meta and SE?
Arf, stupid .NET update makes ngen go crazy.
 
@CatPlusPlus Probably, but who knows, my friend, who knows.
 
What?
 
SO, Meta and SE servers. Shog9 is mad at us and won't reply, so our chance is only to guess.
 
@EtiennedeMartel that movie is trully scary... Watched and have to admit it was really good.
 
6:26 PM
That's a game.
 
There is a game? Didn't know it.
Is it worth to buy the game? @EtiennedeMartel What could you say about gameplay?
 
I haven't seen it mentioned, but I assume it's bad form to move std::cout to another stream?
wait, it doesn't even make sense. Nevermind
 
:) Lol I thought he bought the game, but he just replied on your comment. @CatPlusPlus
 
@MooingDuck Well you can change the streambuf pointer. I've seen it argued against, yes.
Better to write code against a 'generic' stream object than to write against std::cout and redirect that, was the consensus.
 
I have a hex value 0x40f and I want to check whether the f changed to e, what bitmask do I use to AND it?
 
6:39 PM
@DzekTrek On the phone... @Cat got it right
 
@Shog9 Our polish pal is always right. :)
 
@TonyTheLion (value & 0xf) == 0xe
 
but what about the 0x40 before it?
 
@TonyTheLion what about it?
 
don't we have to take that into account?
 
6:41 PM
Gets chopped off by the mask, which means it's ignored in the comparison.
 
that's what (value & 0xf) was for
otherwise we'd just have value == 0xe
 
Ah, so you want the 0x40 too?
 
ah, now actually, I just want to see if the bit changed, is it the same check?
yea well, the 0x40 is always there, you cannot ignore it
 
(value & 0xfff) == 0x40e perhaps?
The previous version only checked the least hex digit.
This checks that you get 0x40e.
I still don't know which one you want.
 
ah, if I should get a c at the end?
@LucDanton this one
 
6:44 PM
@FredOverflow hereby stolen for FB
 
7:02 PM
Can I compare (most) C/C++ questions to a question about the German/English language? Is that a fair analogy? Or is that too much of a stretch?
 
Ell
yay english is superior! (I'm joking of course!)
 
@Ell I'm cool with that statement in both contexts :D
 
Ell
:D
argh i dont understand why this doesnt work :S
 
Why what doesn't work?
 
Ell
I think its Eclipse doing something wrong, but a simple "Hello World" programme doesnt work
it compiles, but I get no output
 
7:07 PM
That is Scheiße.
 
lol
trying to develop sorting algorithms in freakin' hard...
 
@Ell did you run it?
 
my brain hurts at bucket sort
 
Ell
@MooingDuck yeah :S
 
@JonathanDewein develop an O(1) sorting algorithm.
 
7:08 PM
@daknøk on what type of data?
 
Ell
@daknøk easy. just change the defenition of "sorted" :D
 
@JonathanDewein I've never seen a bucket sort like the one posted just a bit ago, Im' not convinced it works. Or at least, it seems harder than required
 
@daknok I have written an insertion sort. it was fairly straightforward, but bucket is....strange
 
@MooingDuck an array filled with real random numbers.
 
@JonathanDewein I've done a library sort, that wasn't so bad.
@daknøk double? How much RAM do I get?
 
7:10 PM
@MooingDuck With real I mean "not-pseudo random". Don't know the exact term.
 
Ell
I just thought - is there such thing as "submarine sort"? like bubble sort but the opposite
 
Infinite RAM.
 
@MooingDuck I have only written a basic linear sort and an insertion sort, after a lot of thinking. I am just learning about algorithms
 
Ell
ahh g2g - playing spring :) bye bye
 
@JonathanDewein "linear sort"?
 
7:11 PM
Hello.
And bye.
 
Hi.
 
@daknøk infinite? Easy! Counting sort!
 
I meant linear search, sorry
 
@JonathanDewein got a bubble sort? Or a quick sort? Both are relatively easy
 
Sorting algorithms are cool.
Oh God I'm such a nerd.
 
7:12 PM
@MooingDuck No. I tried bubble sort and was told that it's really not worth it
 
@Maxpm Design one for ranking chess players. Comparison of any two takes about an hour, infinite number at a time, but each player can only play one game at a time.
 
O(1) sorting: 1. Acquire omnipotency. 2. Let data be sorted.
 
@JonathanDewein bubble is slow, but it's easy-ish. quicksort is much more useful
 
Plain quicksort sucks.
 
@CatPlusPlus The complexity always depends on what you know about the data. E.g. statistical distribution, or that just a few elements are in wrong positions. If you know that it's already sorted, then the complexity is O(1).
 
7:14 PM
@CatPlusPlus (1) put elements in random order. (2) see if they aren't sorted (3) if not sorted, destroy universe. (4) only universes left are those where data is sorted, continue
 
Just send it to a web service that does the sorting for you. O(1) sorting!
 
@CatPlusPlus it's better than bubble, and implimentable by novices
 
Everything is better than bubble.
 
@daknøk I don't think that counts
 
while(!issorted(array)) {shuffle(array);} O(∞) worst case :D
 
7:15 PM
@CatPlusPlus not the bo[z|g]o sort
@CatPlusPlus or the sleep sort
 
Merge sort is actually easier, and has less terrible worst case.
 
@CatPlusPlus but slower on average, and hard to do in place
 
@MooingDuck I haven't taken any programming classes, just self taught. Do you think there is value is writing my own bubble and buckets sorts from scratch?
 
Immutability is fun.
 
I like the insertion sort because it is easy and intuitive
 
7:16 PM
@JonathanDewein bubble is a common homework for learning, go for it. Bucket is harder, but doable
@JonathanDewein true that
 
@JonathanDewein There is educational value in writing anything yourself, as long as you don't use it in production code.
6
 
In-place QS is a headache.
 
@CatPlusPlus pft, nonsense. There's standard algorithms that make it a breeze
@CatPlusPlus std::partition-> quicksort half done
 
@CatPlusPlus I once tried to read a paper about in-place Quicksort, but it was apparently written before the LaTeX era.
 
@CatPlusPlus QuickSort is normally done in place isn't it? I've never seen it any other way, except in novice homework
 
7:17 PM
@MooingDuck Yeah, let's not implement the most important part of quicksort when implementing quicksort. Very educational.
 
@MooingDuck No, normal Quicksort uses O(log n) stack space. The O(1) version is a bit more complicated and about 10% slower.
 
@CatPlusPlus it's good for recursion and such
 
7
Q: Is imperative Quicksort in situ or not?

FredOverflowQuicksort is often described as an in situ algorithm, despite the fact that it requires O(log n) stack space. So does in situ mean "requires less than O(n) additional space", or does stack space generally not count as space complexity (but why would that be the case?), or is Quicksort actually no...

 
Merge sort is recursive, too.
 
I think writing insertion sort and selection sort is instructive for the novice. Because those are the foundations. Also one bucket/radix sort.
 
7:18 PM
@FredOverflow I've never heard of that
@CatPlusPlus true
 
Since I am having so much trouble with understanding bucket sort, do you think I should try and write a bubble sort first?
 
well you shouldnt start with bucketsort
 
@JonathanDewein Do bubble then selection then insert then bucket
 
@JonathanDewein bucket sort is harder
 
@AlfPSteinbach I've already written insertion sort. It seems like the easiest
 
7:20 PM
Then note that bubble isn't really an algorithm but a way to implement to selection and/or insertion sort.
 
Bubble and bucket sorts belong to two different families.
 
Bucket sort is almost trivial. You simply count the number of as, bs, cs, ds and so on in the input text, and when you're done counting, you generate the appropriate number of as, bs, cs, ds and so on as the output text. Done.
 
@FredOverflow ^ Nice explanation. :-)
 
Also, sorting algorithms are boring.
 
"An algorithm is sometimes informally called in-place as long as it overwrites its input with its output. In reality this is not sufficient (as the case of quicksort demonstrates)" Huh, I thought that was the definition. I gotta look up what in-place actually means then
 
7:22 PM
@CatPlusPlus Blasphemer!
 
3
A: Get array size inside a function using C++

Joachim PileborgIn your example you can use the sizeof operator to get the size of the array. You can do that because the function prototype includes the size which means the compiler knows how big it is. If you however want to know the number of items there is in the array, there is no way for the compiler or ...

needs more downvotes
 
you're forgetting i am pretty much new to this...and so it is both fascinating and difficult for me
 
@MooingDuck It means it doesn't use any additional space than the one consumed by the input.
 
@FredOverflow I downvoted it a while ago
 
@AlfPSteinbach Unfortunately, it only works for types with a small value range like char or short, so I've never used Bucketsort in practice.
 
7:23 PM
@CatPlusPlus is that possible? Doesn't every algorithm require at least a variable?
 
I'm not a theoretician.
I don't really care.
I prefer to play with cool stuff instead.
 
@MooingDuck "A variable" does not depend on n. O(1) space is in-place, O(log n) is not.
 
@CatPlusPlus eh, true enough.
@FredOverflow so any O(1) space is in-place? Makes sense
 
Yeah, that's probably more likely.
@Maxpm Compilers, now that's fun.
A sorting algorithm stand-alone is boring and pretty much useless.
 
Speaking of compilers, why do people think it's a good idea to write compilers in the language they're compiling?
It's incestuous.
 
7:26 PM
@FredOverflow done, but still more are needed
 
@CatPlusPlus I think Sorting Networks are interesting, mostly because most people haven't heard of them. They're pretty niche.
@Maxpm proof of concept, validity, and usability
 
@MooingDuck That's dumb.
 
@Maxpm Because they're most often that language experts. Because it might be high-level language, which makes the compiler smaller and more maintainable.
 
@Maxpm I don't think so, a compiler is complex, and good proof that the language can handle complex projects
 
@FredOverflow I think it's an interesting phenomenon that an answer like that, wholly wrong, gets so many upvotes. I think it illustrates one way in which the voting system Does Not Work. Other tags don't necessarily have as active a community as C++.
 
7:27 PM
Bootstrapping is a low price for getting rid of low-levelness.
 
@CatPlusPlus Maybe. Maybe.
 
Typically first version of a compiler is not written in a target language, unless it's an already-established language.
 
it's weird to me that shellsort (based on bubble sort) is one of the faster sorting networks.
 
Should I learn Python or x86 assembly next?
Shit, I just asked a "Which language should I learn next?" question.
 
You probably don't need more than basics of x86 assembly, and only for debugging.
 
7:30 PM
Mmh.
 
Unless you want to write bootloaders and kernels, but that's whole different league anyway.
 
@CatPlusPlus I've always been interested in writing a (simple) compiler/JIT thing, which requires assembly.
 
Yeah, compiler programming sounds neat.
 
Worry about codegen when you've got things to codegen from. :P
 
@CatPlusPlus The company I work for has a very simple custom language + interpreter. I've always wondered if I could JIT the thing to go faster.
 
7:34 PM
There are generic reusable JIT libraries.
 
guys do know a big pure c++ opensource project?
 
sbi
C++ Concurrency in Action eBook is now available! Congratulations Anthony Williams. http://bit.ly/dxyC
@bamboon Boost?
 
@Maxpm Knowing basic assembly is very useful for debugging, and almost essential for low-level HPC.
 
@Mysticial HPC?
 
7:48 PM
high performance computing
 
Oh.
 
@sbi well maybe more of application type
 
But you probably will never need to get in-depth with assembly unless you're actually writing it.
 
sbi
@bamboon Well, yeah, I should have added a smiley. Sorry.
 
@sbi no prob
 
Xeo
7:53 PM
Wow, not having an internet connection is really helpful for coding my game oO
 
I can't code without Internet access. I need Google to be efficient.
5
 
Xeo
not being able to code != not being efficient
But atleast I wasn't distracted by the web
 
The Lounge is not a distraction.
 
Xeo
No, not at all.. :P
 

« first day (488 days earlier)      last day (4458 days later) »