« first day (492 days earlier)      last day (4448 days later) » 

8:00 AM
@robjb As soon as floating point is involved, people tend to underestimate things
 
@sehe I'm aware ;) There are a lot of tricky formatting issues to get right, esp. when you consider scientific notation, etc.
Which is why I wondered if there's a STL or boost solution before attempting such a thing
 
@robjb you seem to be contradicting yourself?
 
@robjb if(stream >> i) { /* yep, that was an int */ } else { /* nope */ stream.clear(); } how could that go wrong?
 
@robjb You could use Spirit or you could abuse lexical_cast
 
@sehe Well, I'm aware there are a lot of things to get right... but what I need to currently support is limited. For example, no need for scientific notation.
 
8:04 AM
@LucDanton : Is the member here a lik2 object? If so, I did pass it as const.
 
@LucDanton Uh, well skipws could have been unset...
 
@robjb Set it, duh!
 
And I'm unsure whether any truncation would happen trying to extract an integer, that would be something I'd need to test
 
@FaheemMitha No? *this is clearly not a member of itself.
 
Ah, I both answered and commented on a question. The answer is the comment marked with ¤. Yay!
0
Q: there are many ways to split a string in c++, whose performance is best?

user1220171as suggested by this post: How to split a string in C++? there are many ways to split a string, but whose performance is best ? is there any benchmark on this test ?

 
8:06 AM
It looks like declaring data_stat_from_pvals_partial gets rid of the error, but I'm unclear why.
 
Can't call a const member from a non-const member.
Or is it the other way around? Check your const-correctness.
@robjb In any case I was being facetious.
 
@LucDanton : I think the other way around. Both ways don't work I suppose.
To summarize, if I am passing a struct object as const &, then the members functions have to be const too?
 
@LucDanton I thought there was some specific edge case or bug you wanted me to recognize. I usually would use getline() and iterate over the buffer rather than the extraction operator :p
 
Seems like it.
 
He he, a question that has a high vote and is not "answerable", and the meta police forgot to delete it! :-)
247
Q: How to split a string in C++?

AshwinWhat's the most elegant way to split a string in C++? The string can be assumed to be composed of words separated by whitespace. (Note that I'm not interested in C string functions or that kind of character manipulation/access. Also, please give precedence to elegance over efficiency in your ans...

Oh dang, now they know!
 
8:09 AM
@FaheemMitha Those const qualifiers apply to the implicit parameters, i.e. *this. You can think conceptually of the members to be declared as return_type T::the_member(T cv* this, /* rest of params */);. Then you can see that if the_member is const, it accepts T const* this, and inside it you can't pass this to a member taking T* this only. Does that help at all?
 
@LucDanton : Hmm, not sure. I think this is the kind of question that is better asked in SO proper. Needs some context. OTOH, it has probably been asked and answered many times on SO and other places already.
 
sbi
And we again have someone from the meta police watch over us. I really, really, really, do not believe this to be accidental anymore.
 
Or post the damn code (in a paste) so that we can stop this silly psychic debugging.
By the way your error is on line 42.
 
@robjb Here's a quick and dirty sample using Spirit: http://ideone.com/zCj3v
@robjb For fun I threw in 'heuristic' detection of the kind of numeric literal in the input
@robjb and it uses 'scanf' style input iterator advancement so you can continue where it stopped parsing
 
@sbi We have two from the meta-police here.
 
sbi
8:15 AM
@AlfPSteinbach Yeah, I just noticed.
 
@robjb Make it a question, and I'd be able to get an upvote (I mean, we'd be sharing for the good of humanity :)) - and I might add some more detail
 
@sehe Very nice, you didn't need to but that's very instructive... thanks :)
Will do
 
so I am not using pascal anymore
 
@AlfPSteinbach I'd be focusing on the fact that we have (a) no flame wars going on (b) are actually discussing c++ stuff of any quality during the last (roughly) 5 hours?
 
free pascal's debugger keeps crashing on me, so back to C/C++ :)
 
8:17 AM
@AdamScottRoan Good for you.
 
sbi
So, @Tim & @Marc, what made two such adorable girls come to this brawly place? Got a secret affectation for boys discussing sex, drugs, rock'n'roll, and C++?
2
 
@LucDanton I think this question is similar for example.
4
Q: error: passing xxx as 'this' argument of xxx discards qualifiers

AlanShore#include <iostream> #include <set> using namespace std; class StudentT { public: int id; string name; public: StudentT(int _id, string _name) : id(_id), name(_name) { } int getId() { return id; } string getName() { return name; } }; ...

 
@AdamScottRoan Oh, that's the reason? Jump ship to GNU Pascal and just use gdb :)
 
Quote: "you're calling a non-const member function on const object which is not allowed because non-const member functions make NO PROMISE not to modify the object; so the compiler is going to make a safe assumption that getId() might attempt to modify the object but at the same time, it also notices that the object is const; so any attempt to modify the const object should be an error."
 
sbi
BTW, @Alf, you got the prospect of a job?
 
8:18 AM
sehe, nah, i hear it doesn't generate that good of code. :)
compared to free pascal or delphi. :)
 
@FaheemMitha I already told you to check your const-correctness so I don't see what new information this question/answer brings.
 
@LucDanton : It doesn't, but it confirms what I already thought.
 
@AdamScottRoan but it probably has decent debugging capabilities... TBH I last programmed Pascal in 1992, I think. I stayed clear of Delphi (not that I'd hate it that much)
 
Funny, I was not aware that objects in an STL like set were stored as const.
 
@sbi well i got a mail from a norwegian company on friday, that they were interested in me. but i'm thinking about it, because it is consulting. and i did not quite fit in in the consulting world (at Andersen Consulting, now Accenture)
 
8:21 AM
That means once they are in the set you can't modify them? Bummer.
 
sbi
@AlfPSteinbach Consulting, eh? Ick.
 
user50049
@sbi We were hoping you could tell us. We got really drunk and woke up here.
 
right
otoh money would be nice :-)
 
@FaheemMitha Yup. FAQ. The key must be immutable. So you can go and have struct element { int key; mutable std::string other; }; to make the other data mutable
 
sbi
@TimPost Don't tell stories, out with the truth. What is it with someone of you almost always being here?
 
8:22 AM
@sehe : Hmm, I see. I probably knew this once. But I don't use C++ enough to keep such details fresh.
 
@TimPost Another moderator! It's a siege!
 
@FaheemMitha same goes for the key_type std::map (std::map<>::value_type corresponds to std::pair<const map::key_type, map::mapped_type>)
@TimPost Good morning
 
user50049
I'm not sure what brought @Marc here, I sopped in after noticing the flag count continuing to climb. It's kind of hard to have 'context' around those flags without opening up the transcript. Rather than continuing to do that a bunch of times, I just joined the room.
 
sbi
@AlfPSteinbach Yeah, a certain amount of income does tend to make it easier to pay the rent. (What are you living on now?)
 
@sehe Makes obvious sense for maps. Modifying keys would cause all sorts of wackiness to ensue.
 
user50049
8:24 AM
I didn't find any to be really actionable, just people having a good time on a Sunday.
 
@sbi you don't want to know
 
@FaheemMitha Exactly the same for std::map
 
sbi
@TimPost I don't believe a word you say there.
 
@sbi Why not?
 
sbi
@AlfPSteinbach Ouch. Well, shouldn't you have an easy time finding a job as a C++ developer?
 
8:25 AM
@FaheemMitha: this is an approach too
7
A: How can I improve this design that forces me to declare a member function const and declare variables mutable?

seheYou can't. Set elements are required to be const for container correctness: It forces you to realize that the key part needs to be immutable, or the data structure invariants would be broken. struct element { std::string key_part; // const in the set bool operator<(const element&...

 
@sbi Well not right now, since I have an illness involving bleeding and a foul stench (also at times quite painful, to the point of being immobilized). However, I'm on a cure for that. I will hopefully be OK in just three months.
 
@FaheemMitha so basically, you'd use a map as-a set
 
@sehe : Interesting. Thanks for the link.
 
user50049
@sbi Fine. I'm not really a person. I'm a bot that the other moderators wrote to spy on you. Better?
 
sbi
@sehe Since the night we got besieged by the meta police last week, there rarely has been a few hours were none of them were here. OTOH, we didn't have any of them here — except someone dropping in (and out again immediately) for the occasional flagging war — since the day Jeff dropped in to offer a C++ job.
 
8:27 AM
Yay! Substitute robot!
 
const seems to be a big deal for c++. I guess it is an outgrowth of strong typing or some such. I habitually using const something& name in my code, because I read somewhere once it was good practice. But I don't think about it much.
 
sbi
@AlfPSteinbach Oh. Well, here's wishing you well!
 
@sbi Thanks.
 
@sbi Yeah I know about that. However, Tim wasn't here before (?) and it could be he was prompted by the same signals as our benevolent PHP room owner :)
 
sbi
@TimPost See this. I can't believe this is all accidental.
 
user50049
8:29 AM
Not kidding about the hangover though. I worked quite late last night on my new Redis client lib (well, more of a wrapper that adds stuff), got something working and did a little too much 'celebrating' with rather strong lagers :)
 
@sehe Alright, posted
0
Q: Parsing numeric strings of unknown type?

robjbWhat's the best approach to parsing std::string to some numeric type in C++, when the target type isn't known in advance? I've looked at lexical_cast, but that takes the target type name as a template parameter. I could write wrapper functions that abuse this by catching bad_lexical_cast and ret...

 
@sehe Hey, I voted you up!
 
sbi
@sehe They all either state individual reasons for being here, or plain ignore the question. But if all this is still a random pattern, I'd better leave the house now and grab some lottery tickets, because probability just got unhinged. /cc @Tim
 
user50049
@sbi If there's some kind of voodoo going on behind the scenes, I'm not aware of it. I honestly just noticed the flag count climbing and dropped in .. then forgot I was here until you pinged me a few minutes ago.
 
@sbi To be honest, why would you think think the supposed meta police would take such an interest in this room, really. Nobody gets hurt and if they were bothered by any of us, they'd easily close down the joint. Rather meh.
@sbi I don't believe in coincidence, but I don't believe in conspiracies any more
@FaheemMitha So I heard (my phone is on plink). Thanks
 
sbi
8:33 AM
 
@sbi Jeff offered a C++ job?
 
sbi
@sehe Well, let's all run and grab lottery tickets then.
@DeadMG Yeah, about a year ago. Or even longer. Not for himself, but for someone else. Plus he admitted to suck at C++.
 
@sbi I loved that joke.
 
ah
 
sbi
:(
 
8:35 AM
@DeadMG he also gave an offer about reviewing some C++ book manuscript
i think
 
@robjb Ok, I posted as an answer rather verbatim. Need to get in the office really, will be afk. But plink me if you'd like additional details/testcases
 
sbi
@AlfPSteinbach That was what I referred to:
Nov 16 '10 at 18:48, by Jeff Atwood
hey guys -- I have an editor at Pearson looking for C++ experts to review a C++ book.. $75 per chapter honorarium
Nov 16 '10 at 18:51, by Jeff Atwood
ok, I suck at C++ so I will leave now
 
I need to get a job
 
user50049
@sbi If I wanted to waste my time doing something sneaky, I'd go fake another moon landing. Seriously, don't smoke too much of that stuff, it makes you paranoid.
 
@sehe Your bulleted link is broken, apart from that looks great :)
 
8:37 AM
@robjb Just added it
 
@TimPost nice video below:
 
Ok, afk for a while
 
sbi
8:50 AM
@TimPost In my whole life, I haven never smoked a single cigarette, let alone something else. (Quite an achievement for a German of my generation.) And I have listed very good reasons for not believing in accidents anymore regarding this. You had nothing to offer to appease those suspicions.
 
@sbi I remember the vending machines in Bavaria :|
Not so many in Baden-Wuerttemberg though.
 
Well, we now have three moderators in here.
 
Don't mind me - I'm just here for the paranoia ;-P
 
He he
Besides, as I understand it you're not a mod, just a company man, yes?
 
@AlfPSteinbach Yup!
 
8:58 AM
oh hai
 
I was on the phone a bit ago, talking about this room as an example of a community-within-SO, and realized my laptop had gone to sleep and logged me out :-/
 
there must be something about this room that gets people to come back
@ScottW same old, same old
 
@AlfPSteinbach Nice
 
sbi
@ScottW An operator that shouldn't be used except in conjunction with a smartpointer. Someone had to make obvious joke.
@Shog9 Yeah, laptops do get tired, too, sometimes. So what about this community?
 
9:09 AM
I think it's scary how the "close" voters totally ignore reality.
In some cases there is an accepted solution. They vote it is not answerable.
In some cases there are no "SO-answer" responses at all. They vote it will likely lead to extended debate.
It is like they are idiots
 
This room ain't big enough for two apes.
 
sbi
@AlfPSteinbach Well, I guess your tone didn't help matters. A actually decided against upvoting your comment, despite the fact that it was factually right.
 
@sbi vs @TimPost
 
But the polite thing has been tried, and did not work.
 
sbi
@IntermediateHacker What?
 
9:11 AM
@sbi What about it? Well, it exists, for starters... This room's nearly always active, there's a group of regular users, you self-police to a reasonable extent - that's useful to have. (The conversation I was in was regarding this, which presents some challenges to implement on SO)
 
sbi
Oh.
 
The opposite is just as bad, when people start answering a non-question or a poll
 
user50049
Clearly, there is only one ape and one Gorilla.
 
which should be closed
 
@TimPost puppy!
 
sbi
9:12 AM
Well, he's but a chimp. I eat those for breakfast.
 
um... why are some people's names in blue?
 
it means moderator
 
sbi
@IntermediateHacker That's the meta police.
 
I'm a puppy, not a dog
also, non-animal Gravatars don't count
 
sbi
@DeadMG We know. There's three dogs plus you.
 
9:14 AM
lol
@ScottW Hey, I am the puppy, and no matter what your gravatar is a picture of, you can never take that away from me :P
that's practically a dog :P
my puppy was three months at the time this was taken, I think
 
user50049
My gravatar is inspired from WaffleBBS in the days of old. If you typed a command that didn't exist, Waffle would say Monkey + Typewriter = (command you just typed)
 
unfortunately, dog and hyper are far from mutually exclusive
now my puppy is approaching eighteen months or so and she's still pretty hyper
 
user50049
I doubt anyone would remember Waffle. Damn I feel old sometimes.
 
Mandatory.
 
9:30 AM
13 mins ago, by Tim Post
I doubt anyone would remember Waffle. Damn I feel old sometimes.
^ Another grumpy old ape...
 
sbi
@TimPost Wasn't he a regular on meta? Is he gone?
 
user50049
@sbi Hehe no not waffles, WaffleBBS. We're going back to the early 90's here.
 
Were you at the Well?
 
user50049
Waffle is a bulletin-board system created by Tom Dell which ran under DOS and later UNIX. The software was unique in many ways, including the fact that all of the configuration files were in readable text files, and that it fully supported UUCP on the DOS platform. A Usenet news group named comp.bbs.waffle was created for discussion of the Waffle BBS System. The last version seems to be v1.65. It was possible to link Waffle (under DOS) to Fidonet and WWIV using external gateway utilities. External links *[http://www.faqs.org/faqs/waffle-faq/ comp.bbs.waffle FAQ] *[http://www.simtel.net/...
 
sbi
@TimPost Ah. I didn't have Internet back then, except at university.
 
9:32 AM
Huh, it (the Well) still has an internet presence. Them old ones never really die.
 
user50049
The typical use for it was dial up. I had one copy running at the university (which was my UUCP gateway), and another copy running at home for dial up access. It was my first exposure to writing platform portable code.
 
@sbi bbs != internet?
 
@sehe not nowadays. most bbs'es are now accessible via internet.
 
sbi
@sehe Right, I messed this up. But I was living in East Berlin in the early 90s, where we still didn't have a phone.
 
@ScottW I wasn't even born in the early 90's. :'(
 
9:35 AM
@sbi wow. I don't remember having no -phone-. I do remember having B&W television for the first 10 years of my life
 
sbi
@Shog9 Indeed, it exists. Sometimes I wonder whether this is because we oppose so much of what seems to be regular's consensus on meta (offering a refuge for like-minded users) or despite us opposing (threatening the establishment).
 
@IntermediateHacker get out
 
@ScottW February 27, 95' .
 
I was 14yrs in 1990
 
sbi
@sehe It took a while for the west German industry to catch up and to wire all of the east.
 
9:36 AM
@sehe ??? what did I do?
 
... not too old, but not too young I guess
@IntermediateHacker Be a baby :)
 
@sehe I'm not a baby. >:(
@ScottW yeah. In 7 days.
:)
 
sbi
@IntermediateHacker Hey, you're the 2nd person I know sharing a birthday with that of my kids.
@sehe Practically a still kid.
@ScottW '95 wasn't a leap year.
 
17 is an adult. right?
 
sbi
@IntermediateHacker In which country? Here, you're legally becoming an adult when you turn 18.
 
9:40 AM
@sbi in the wizarding world. :D
 
sbi
@IntermediateHacker In HP? I don't think so.
 
@sbi In HP, wizards come of age at 17.
 
^ History
 
@ScottW ....damn. :(
 
9:47 AM
So, one can create vectors from subranges of other vectors, like
vector<int> c(b.begin()+2, b.begin()+5);
but it seems one cannot do this sort of thing to create temporaries. ie
like in python on can do b[2:5]
 
@FaheemMitha you can always use any available constructor to create a temporary
it goes like vector<int>( b.begin()+2, b.begin()+5 )
 
@AlfPSteinbach : Ah, right. Like
cout << vector<int>(b.begin()+2, b.begin()+5) << endl;
 
sbi
@FaheemMitha What problems are you having with this? If b is a std::vector, then b.begin() yields a random-access iterator. Those beasts have + defined for them, so that you can indeed do things like b.begin()+2. (You need to be careful, though, to stay withing the vector's size when doing this.)
 
well, if you have defined an << operator for vectors :-)
 
sbi
@FaheemMitha Unless you wrote one, there's no output operator for std::vector.
 
9:50 AM
@sbi : No problem as such.
 
why do people prefer to return a vector<>* in functions rather than a vector<>& or const vector<>& ?
why not return a reference?
 
@IntermediateHacker they're aliens?
 
@AlfPSteinbach I have, yes. Hard to manage without one, I find. Surprised something like that isn't in the std library.
 
The best, especially with C++11, is to just return a vector by value.
You might be surprised at how fast a few million elements' vector is returned.
 
@IntermediateHacker : I personally treat const... & as a default. My reasoning "const" means cannot be modified, & means no copying.
@AlfPSteinbach Not sure what you mean.
 
9:53 AM
I suddenly remembered when we need non-null pointer and can't replace it with reference - it's when we need mutable pointer.
 
e.g. write `vector<int> foo() { vector<int> result( 10000 ); return result; }
then you can time it
if and only if measurements say that dang that's too slow, consider doing something like (multi-line code follows):
void getFoo( vector<int>& callResult )
{
    vector<int> result;
    // DO stuff.
    result.swap( callResult );
}
Then you can wrap that in a three-line return-by-value function for those who want easier notation.
But since this is extra work and since it is ugly and verbose usage, only do it if really necessary (IMO).
 
@AlfPSteinbach You mean passing by value is better than const ref? I thought it was better not to make copies.
 
The swap is necessary for exception safety. You don't want to change callResult when the function fails.
@FaheemMitha I talked about returning by value. Passing by value is a different matter.
 
@AlfPSteinbach : Ok. I always return by value.
 
@FaheemMitha Boost Range: make_iterator_range and sub_range<>(f,l)
@FaheemMitha that won't even make copies. And you can filter it and join it:
 
9:59 AM
@sehe : For vector ranges?
But nothing like that in the std library, right?
 
@FaheemMitha It's boost. It's generic
 
@FaheemMitha There is std::valarray, or whatever it's called (I forget, sorry).
 
@sehe Ok.
 
Lame example: join(range1 | filtered(predicate) | sort, range2)
 
I'm using Boost 1.42. I wonder if I should upgrade. On Debian squeeze.
Is boost range popular?
 
10:02 AM
@FaheemMitha Mmm join wasn't in the docs for 1.42.
 
@sehe : Hmm.
 
@FaheemMitha It is with me. I like pythonista style. Another link coming up:
3
A: C++ range/xrange equivalent in STL or boost?

seheBoost irange should really be the answer (ThxPaul Brannan) I'm adding my answer to provide a compelling example of very valid use-cases that are not served well by manual looping: #include <boost/range/adaptors.hpp> #include <boost/range/algorithm.hpp> #include <boost/range/irang...

That example requires boost 1_43, I guess
 
@sehe : Thanks.
 
10:37 AM
ummm hi
 
Hello
Hm, computers are going to replace humans in trading/economics. Wasn't there a book about this?
 
Wall-E?
 
10:53 AM
Na, it was "The Evitable Conflict". Never read it though.
 
trading is already being done by computers for like 70% of all trading done worldwide
 
maybe it's like the computers helping to keep a by design unstable plane, stable
 
lol
it's called "high frequency trading", interesting subject actually
 
suddenly you're a billionaire, or suddenly you're broke and worse, and don't know why
just them computers deciding
 
@AlfPSteinbach not really. you just manage it at a higher level. Still people deciding, just computers used trying to out-maneuvre the competition
I worked on an international dealing room (derivatives, equities, treasuries and bonds) for a year and a bit
Helped them wire in the satelite realtime trading system when it was still 'new' being accepted by the bond traders.
I was found doing dubious stuff like caching real time stats for network distribution, and using DDE to 'integrate' into their long-developed excel monster applications that the traders used.
I can tell you this, traders have big egos and they won't have the appearance of a computer deciding their bonus.
 
11:18 AM
hmmm interesting
so would you advice any other dev going into the finance industry?
 
@sehe :) interesting ...
 
sbi
11:30 AM
@sehe This isn't fully decided yet. Computers might have caused the 2010 Flash Crash.
The May 6, 2010 Flash Crash also known as The Crash of 2:45, the 2010 Flash Crash or just simply, the Flash Crash, was a United States stock market crash on May 6, 2010 in which the Dow Jones Industrial Average plunged about 1000 points—or about nine percent—only to recover those losses within minutes. It was the second largest point swing, 1,010.14 points, and the biggest one-day point decline, 998.5 points, on an intraday basis in Dow Jones Industrial Average history. Background On May 6, US stock markets opened down and trended down most of the day on worries about the debt crisis i...
> ...how high-frequency traders (HFT) started aggressively selling, accelerating the effect of the mutual fund's selling and contributing to the sharp price declines that day.
 
In that environment you better be very good at supporting your stuff or you will get scolded so that you'd wish you hadn't been born.
In fact, once you earn a stripe (or two and then some), it gets pretty normal. But the standard dealer is certainly an arrogant prick. The money market corner was the most 'human' corner to hang out.
@sbi Ah nice. Glad I wasn't there by then :) I think my escapade dates 2003/2004 or thereabouts
 
sbi
> The joint report said prices stopped falling when, "At 2:45:28 p.m., trading on the E-Mini was paused for five seconds when the Chicago Mercantile Exchange ('CME') Stop Logic Functionality was triggered in order to prevent a cascade of further price declines. In that short period of time, sell-side pressure in the E-Mini was partly alleviated and buy-side interest increased. When trading resumed at 2:45:33 p.m., prices stabilized and shortly thereafter, the E-Mini began to recover [...]"
@sehe So a 5sec downtime restored everything to normal. We definitely aren't speaking humans here, since human traders would still be scratching their crotches wondering what when the 5secs were already elapsed.
 
@sbi In my experience the traders were pretty quick with the fallback buttons, though. It could be that RTT is so much standard practice that they tend to forget...
 
sbi
@sehe Yeah, but we're talking a 3min span here for the market to crash, and 5secs to revert the trend and make it recover. That'd be a lot of humans hitting the same buttons within 5secs — and that's discounting the 3secs they need to even realize something happened. Call me paranoid, but I believe those decisions were mostly made by algorithms.
 
I have been studying my chat patterns. seems I use ' :( ' , ' :'( ' and ' ... ' a lot.
Also, why in the world would someone hire a C++ developer as VP Global Rates and Currencies at a bank?
 
sbi
11:46 AM
@Pubby If you're interested in this kind of stuff, Charles Stross has a series of pretty good SF books (not his Fantasy stuff), among them Accelerando, which describes a possible future scenario (starting right now). One of the main characters (well, actually I think it's the main character) sets up an army of scripts (Python, I think) creating and dismantling companies, and trading stocks, to finance his daughter after his divorce. When she's 18, she is quite rich through that.
Eventually, this ends in Economy 2.0, which is computers driving humans off the earth. Other books of him (Singularity Sky, Iron Sunrise) are in a pretty similar/the same universe, with humans driven off the earth, and computers thriving there.
 
@sbi That's what I meant to imply: back then the traders really didn't trust the systems enough to let it run loose for more than 5 seconds. I'm sure the culture has changed a lot since then. (Also, on the other hand, it would be like a group of automobilists responding to an acute traffic jam/accident. It wouldn't really surprise you if most in the front row would slam the brakes simultaneously, after an initial reaction time of some 1-2s)
@sbi "to finance his daughter after his divorce" - LOL
 
@sbi Sounds pretty interesting. Thanks!
 
sbi
@sehe ISTR he didn't want the money end up in his ex-wife's hands, but I'm hazy on this, since I read it years ago.
@Pubby Singularity Sky is an darn good book. It got me hooked on SF again, after 20 years of abstinence. I have read little else than SF&F since.
4
 
@sbi Alright. I guess I'll add some SF to my ever-growing reading list.
 
sbi
Oops. Who starred that? Another Stross fan afraid to com out?
 
12:11 PM
Hello All ! Has anyone here implemented a huffman encoder ? I am concerned about the efficiency of mine (it takes 5 seconds for a 12 meg file, close to 2 mins for 180 meg) , I know it can be sped up a bit , but is this really too slow , or acceptable ?
 
@angryInsomniac How fast does Winzip or whatever compress that file?
 
@KianMayne Link's always in my profile.
 
And whether or not that is acceptable depends on your needs.
 
@angryInsomniac Why on Earth are you huffman-encoding a big file? Why not just use 7zip or whatever?
 
12:13 PM
@FredOverflow The time is comparable , but my compression ratio is nowhere close to theirs !
 
Also "Installed 273 times.". Ha.
 
@AlfPSteinbach Just a project :) I would never use this for practical purposes !
 
@angryInsomniac What? I thought huffman was optimal.
It should be the same ratio, no?
 
@Pubby ?! I highly doubt that , I'll check again , but seriously I highly doubt it !
 
@Pubby The compression you can achieve depends on what knowledge you can assume the receiver/unpacker has about it. The more knowledge, the better compression. As an example, for English text it helps tremendously if you can assume the receiver has the same large dictionary as you have, then encode whole words and phrases.
 
12:15 PM
@angryInsomniac Because Winzip does not use Huffman only.
 
Plain Huffman won't beat LZMA.
 
@AlfPSteinbach Well yeah. I'm assuming completely random information.
 
The input string "AAAAAAAAAABBBBBBBBBBCCCCCCCCCC" cannot be compressed at all with Huffman.
 
@FredOverflow I know ! Thats why I am not even compairing the two !
 
You can't compress completely random information.
 
12:17 PM
in SD-Humour, 9 mins ago, by Kian Mayne
I can't get into Lounge<C++> because of filtering :(
^Has he been banned or something?
 
@FredOverflow I know I know :D You asked about winzip , so I mentioned that :D Plain hufman is nowhere near LZW or the commercially used compression algorithms
 
Maybe he doesn't have enough rep?
 
@CatPlusPlus Oh, you can. That's the easiest case. All you have to assume is that the receiver can't compare it to the original, ever.
2
 
We can't ban people from entering rooms.
 
then what's the problem?
 
12:18 PM
Silly corporate firewall?
 
So , no takers on my original query ?
 
If your goal was to learn how to implement Huffman, you're done. If you're goal was to optimize the shit out of everything, you're not done yet.
 
@CatPlusPlus 501 server error
@CatPlusPlus Sorry my bad. It was 'Error Code: 502 Proxy Error. Connection refused(10061)'
 
My goal is much crappier than either of those :P
But the program needs to be reasonably fast , it is kinda an assignment , which shall be judged !
 
12:22 PM
Workplace filtering prolly
 
@FredOverflow I think that typo illustrates that the human nervous system is based on delegating even quite high level tasks to relatively autonomous sub-processors, sort of.
 
@sehe Apparently they don't like www.
 
@CatPlusPlus true. dropped it and works
 
sbi
@IntermediateHacker Presumably we use too many bad words in here. :)
 

« first day (492 days earlier)      last day (4448 days later) »