« first day (1052 days earlier)      last day (3882 days later) » 

12:00 AM
isn't /proc/pid/maps supposed to be accurate?
 
Ell
Idk
If you could meet any programmer in person, who would it be?
 
already met bjarne, herb, STL
 
Ell
You've met bjarne and herb?
 
at Bristol
 
@Ell Carmack
or Gates (or maybe Newell)
 
12:06 AM
maybe Gates
 
Ell
You can include passed away programmers too
Gates would be interesting indeed
I'd want to meet RMS, to see what he's like in person
one would need a lot of strength to Not be bitter I think
 
@sehe Hrmm...I don't see a way to sign up for a username...
nvm...I found it
 
After hearing how boring Carmack is, probably Gates.
 
@Ell Who is RMS?
Root Mean Squared? =p
 
Richard Stallman.
 
Ell
12:20 AM
^
 
ahh
 
Ell
Or torvalds
 
aaaargh mah stummick
why does it hate me so.
 
@Ell You want to meet Torvalds? You must like being insulted
 
12:46 AM
@Borgleader Linus sees consent as optional when it comes to insulting.
You can't deduce @Ell wants the abuse because he'd get it either way.UNLESS he wanted to wear a full on gimp outfit at the time or something.
 
dayum
I just finished watching Kick-Ass 2
I dunno
I thought it was fun enough
but not quite as good as the first
 
1:03 AM
 
@DeadMG I thought it was better than the first.
 
eh, I dunno
 
Anyway, I swear this code compiled last time...
 
the first like, half an hour of the film, I ended up just skipping past it
 
Stupid thing is complaining when I initialize a std::wifstream with a std::wstring.
Guess it only accepts std::string.
Thought it would've at least been std::basic_string that was added.
Guess not.
No way to use file streams with foreign file names? TIL
 
1:11 AM
Yup. You can use boost::basic_fstream from Boost.Filesystem.
 
Guess I might as well.
 
The gist of it is that paths in Standard C and C++ can only be expressed as narrow strings.
 
Hi, I just wanted to know if it's "best practice" to write function prototypes along with their variable names such as int foo(int a) or is it "better" to write int foo(int) ? Thanks for your opinion.
 
So e.g. there's int std::remove(const char* path); and nothing else.
 
Is the TR2 FS library going to be like this?
 
1:14 AM
no.
 
Hoping not if it's based on Boost's.
 
it is
they just upgraded from v2 to v3
 
@AmberRoxanna IMO this falls in the realm of personal preference.
 
I haven't written function prototypes in so long
 
@AmberRoxanna The only real advantage here is that many IDEs will show the names when you are calling that function with their completion information. So if you give it a descriptive name, the IDE can show that name and help you know what parameters to pass.
 
1:17 AM
I wonder what's the status on modules.
 
What's the library to link to for basic_fstream?
 
boost_filesystem-mt-d-wtf-arg-wut-lol
 
I rename all the .a files to stuff like boost_library and boost_library-d if it's debug
:s
 
I couldn't be bothered to do that.
 
Oh, of course I just messed up some library search path.
 
1:22 AM
@LucDanton I use a tool to do it obviously
 
Joking aside I only ever link to boost_foo-mt-d or boost_foo-mt. I don't build any other variant to begin with.
 
Or not, I have no idea why it can't find it.
 
@Rapptz I couldn't be bothered to use a tool to do it.
It's not like I'm going to flip the bits by hand with a magnet anyway :v
 
You wouldn't want to anyway, the tool I use is the ugliest UI I've seen
 
rename :v
 
1:23 AM
Yeah but renaming with wildcards failed me 10/10 times I used it :[
 
Ohh, that's why.
 
That's why I use regexps! (Cue joke about mo' problems.)
 
I switched it to the MinGW64 one to test something at one point and never switched back.
 
Well despite the UI sucking ass it does the job pretty decently
 
Ell
Holy sheesh what the hell is that
Kill it! Kill it with fire!
 
1:26 AM
I've seen that before, never used it.
 
Ell
Regexp would be much easier IMHO
 
33
A: How can I mass rename files from the command line or using a 3rd party tool?

Jim McKeethI know in your title you say "in dos" but I get the impression you are just looking for a way to do this and are wondering if that is the best way. The absolute best tool I have found for this is Bulk Rename Utility. It isn't a command line tool, but they do have a command line version if y...

 
rename 's/libboost_(\w\+)-mt-d/libboost_\1/' whatever then do the same without the -d.
Can feed that to find, too.
 
Windows rename sucks
really bad
 
I don't have that issue.
 
1:30 AM
You can only use wildcards like * and I think ?
So you have to do stuff like ren *.txt *.cpp :s it's pretty bad
 
When you mentioned wildcards at first I thought you were talking about globstar-ing your way out of this.
 
Yeah it's the only thing it supports.
 
@MonadNewb me neither. Why would I, anyways
 
the opengl site is such a mess, where the hell do i dl gl3.h/gl3ext.h
 
@MonadNewb Just did the "genome sequencing" thingie: coliru.stacked-crooked.com/a/0a034589a982ca72
Note I heretically used goto ^
 
1:39 AM
boo
 
:D I knew I could count on you
 
using namespace std looks weird to me even in a .cpp file
 
Yeah, I dunno why I copied that suggestion from the site, really. I shamefully admit that I think it does make the code more readable.
 
looks bare to me
 
Ell
@borgleader just the headers or you want extension loading too?
 
1:41 AM
Actually i don't really care about the extension (loading/header), gl3.h should do.
 
Ell
You need extension loading to do anything above 1.3 or something
 
Hmm...
 
Ell
Just download glew
 
let me check Nicol Bolas' website
 
Ell
I think they provide headers
What platform are you on?
 
1:45 AM
@LucDanton There, removed the gratuitous abuse of (stateful (mutable)) lambdas and the abuse of set to order solution_sizes. Much better, no? /cc @Rapptz coliru.stacked-crooked.com/a/840899b23963ddd7
 
Ell
Your driver should provide headers and libraries if you're on Linux
 
@Ell Windoes
 
Ell
But you need to load extensions in any case
 
Well, I must confess to some serious tl;dr. Although I did notice the goto the first time around :p
 
@LucDanton Woot. That's not too tricky since the label stuck out like a sore thumb with my inconsistent loop body bracing style :/
 
Maybe I should partition my annex into separate things.
 
I had a flat directory structure with my utility thing and split it into subdirectories
you could try that
 
Already the case, more or less.
 
@LucDanton lol. time to think about naming again
 
1:52 AM
lol
 
@LucDanton Ah I see. I think it's fine (just looked)
 
separate "things"
quite enticing
 
you can create more 'things' by simply separate them
 
I find that it's grown a bit out of hand. Some things I actually like, some things I've written because it's a playground. I think they clash together.
 
I don't know, it's a personal thing. Most of my stuff that I enjoy grows out of things I played with so I tend to keep the playground stuff anyway
 
1:57 AM
Oh, I don't want to get rid out of it altogether. But put it somewhere. Almost anything I write in C++ depends on annex already, because I don't want to spend time writing, say, ResultOf over and over. But that means I bring some completely unrelated stuff in, too.
 
It's kinda the same thing with boost.
 
Meh, I don't mind installing them all.
 
Well, then what's the difference :D
 
There's only one monolithic libannex.so. Not the case with Boost.
 
Oh, I had for some reason assumed most of the stuff was header-only.
 
2:02 AM
@sehe Well, I don't know :D If this were the Haskell ecosystem they'd be packages. But there isn't a single, consistent C++ practice, is there?
 
I'm wondering how modules are going :/
It's kinda my most anticipated feature and I'm blindly hopeful for it not to suck.
 
I'm waiting on Ryppl.
 
Looks okay
and really old, most of the links 404.
 
Oh, I assume that as a would-be project it lives in people's heads, emails and mailing lists. Since that's how Boost operates. There's mention of an IRC channel though.
 
they have a repository and a site
 
2:11 AM
Right but I assume there's nothing in there. I.e. no release yet.
 
FWIW it looks pretty dead
 
People's heads. And their physical storage I guess.
 
It must be really old. I see mentions of it from 3+ years ago.
Anyway from what I read this sounds like NuGet
 
The reference is CPAN.
I've never done any Perl, I don't know much about it. But I do know there's CPAN.
 
Well I mean relative to the language, since NuGet actually works for C++.
 
2:19 AM
Everyone imitates CPAN. Pick a language, get a CRAN-like thingy. Except C++ of course.
Even R named theirs CRAN as a nod to CPAN.
 
Wow this glLoadGen thing by Nicol Bolas is pretty intense o.O
 
@LucDanton What's CPAN?
 
Comprehensive Perl Archive Network.
 
You want code, you grab code. Then everything installs and you start using it.
 
It's a package manager.
Lik npm for Javascript, easy_install or pip for Python, or NuGet for C# and C++
 
2:22 AM
I'm not sure if NuGet is an appropriate comparison. It's specific to one platform, isn't it?
Abstracting over platforms and what have you is, imo, an important feature here.
 
Yeah unfortunately.
 
less simple to do in C++ than some other systems.
 
It's the only thing C# has though, that I know of anyway.
 
@DeadMG That's not true at all.
 
@LucDanton it probably is in Windows, leave them to it.
 
2:24 AM
The goal of such a system is not to give a way to distribute any and all kind of software easily. It's to distribute some software. E.g. small libs and stand-alone executables.
 
@LucDanton C++ has way less functionality as Standard than a language like C# or Python
 
@DeadMG That has no impact.
Something like CPAN keeps track of dependencies. So a CPAN-hosted package can depend on other packages.
Then the language can have no standard library at all and it doesn't matter as long as someone wrote the dependency you need and the system can install it for you (and your users).
 
It'd be cool to have I guess.
 
GoingNative has a My Favorite C++ 10-Liner by Herb Sutter. Looks interesting.
 
Hacking with Haskell is fun. Hacking with C++ is frustrating and lonely. And I don't mean the languages, I mean the ecosystems.
 
2:27 AM
I've been messing with build systems lately.
Not really fun.
 
The worst thing is that Haskell's ecosystem is often decried as primitive and with many flaws ._.
So even if something C++ish comes along you know it'll have to do a lot of things to get on the level of the others.
 
I'm thinking of modulating my meta build script thing to make it more usable but I don't know if it's worth the effort.
 
You would use a "communication channel like sockets, named piped or etc" — SimpleCoder 16 secs ago
lol'ed
 
@Rapptz I use Premake. It's not that bad.
 
Ell
> Low Prices on Procedural Texture. Free UK Delivery on Eligible Orders
3
oh Amazon ad, you don't know what you're talking about
 
2:39 AM
@DeadMG It's not something big like Premake, it's just a meta-build system for Ninja.
 
@Ell So we've found the opposite of "Download more RAM for your computer!" sort of thing. lol
 
When is it a size, and when is it a length?
 
Ell
Haha yeah, we need to download more ram for all of these procedural textures Amazon is selling us
Length is the size of a 1 dimensional thing
 
Hrm...
In this case, I was contemplating how to get said property of a snake.
 
@Ell It's unfortunately not that consistent from what I've seen. For example, we always talk about the "size" of memory even though memory is addressed linearly in virtually all modern systems.
 
2:49 AM
That reminds I really want to swap range::count and range::length around.
 
Has a snake game ever had powerups?
 
Does it matter?
If you want to make power-ups. Do it.
 
you can have a multiplayer snake game
 
@Telkitty猫咪咪 already planned
I am not getting much done though.
 
@Pawnguy7 It would certainly make your game different from the 20349820981 different Snake clones out there.
 
2:54 AM
Haha, yes.
 
Say, I made the result of cycle(r) a bidi range. I'm not sure if that serves any purpose.
It does mean I can get up to random-access though. Ah well I think I might just split that functionality (i.e. cycling vs 'merging' two ends) one day.
MeasurableRange? More like miserable.
 
Do you feel that TODO in your source give you false sense of accomplishment. For example I need to make something a seperate class (io worker thread) but instead I wrote a todo comment saying I would do it at a later time
fuck I got pointers to threads now
You can't spell the interjection 'oops' without object oriented programming
 
@Mikhail VTC: Primarily opinion based ;)
 
@Borgleader Whats the state of the C++ lounge now days?
 
Ell
3:10 AM
Leaving seems to bo fashionable :/ fortunately returning with a "not-" prefix is also fashionable
Man, I'm still absolutely flabbergasted by nvidias Ira tech demo. Its just incredibly realistic
 
@Ell link
Also check this out :)
 
3:26 AM
@melak47 Good news! I've swapped the names of range::count and range::length some more!
 
4:02 AM
To clamp is to fit a number in a range, but what do you call it when you want to move a range (meaning maximum - minimum is constant) to fit a number? :|
 
Example?
 
@Ell Awesome.
 
you have x = 40, and a range [70, 80]. You want to move the range so that 40 is included, and the result would be a range [40, 50]. This is trivial to accomplish, but I have no idea if this operation has a name of some sort
 
I don't think so. I mean you're just sliding the range down (or up) until that value is in.
Not sure in which context you would want to do this either
 
@MohammadAliBaydoun .. where'd 50 come from?
.. why would anyone do this?
 
4:09 AM
@Rapptz The size of the range is constant
 
constant = max - min, new_min = x, new_max = x + constant?
 
yes, precisely, it's trivial, I just wanted to name it
 
shrink_to_fit
 
if(val < min) newRange = [min - (min - val), max - (min - val)] else newRange = [min + (val - max), max + (val - max)]
if i understood correctly
 
@Borgleader yup
shrink_to_fit sounds good
 
4:12 AM
youre not really shrinking the range though, it's more like sliding
 
slide_to_fit sounds even better :D
Also, you are free to punch me in the crotch for asking questions on a Monday morning.
 
this monday is a holiday for me :P
 
I'm still on Summer Vacation U:
 
 
4:27 AM
-4
Q: have any body went to Nokia gate5 Interviews?

user501239I made an interview with Nokia Gate5 in Berlin over phone on a (Qt/QML/Linux software engineer). Now i have been invited for an on-site interviews. what is the kind of questions that i would be asked? Is there any one passed over those interviews?

lol
 
4:48 AM
sigh
 
5:07 AM
> error| '*((void*)(& range)+12).std::_Head_base<0ul, unsigned int, false>::_M_head_impl' may be used uninitialized in this function [-Werror=maybe-uninitialized]
This is new.
 
i dont even understand what that means laughs
 
Eh, doesn't seem to affect the resulting code. Could be a false positive.
 
5:36 AM
1 message moved to bin
 
@Rapptz is it not c++ ques?
 
@Karimkhan Please read this. You'll understand.
 
@Karimkhan This isn't a "dump my C++ questions" room. You should go to Stack Overflow for that. See the tag that says: and the Newbie hints.
 
oh fuck, it's 6:43 already.
 
@DeadMG No, it's 1:43. Find a real time zone.
 
5:43 AM
the timing of my illness over the last few days is really quite unusual.
 
5:44 UTC!
 
I dislike experiencing even more new symptoms
it makes me feel bad about the probability of the accuracy of my doctor's diagnosis
 
Wow AS is horrible.
 
AS?
 
ActionScript
 
5:57 AM
It's by Adobe, what did you expect? :P
 
That feeling when you find a bug while testing that would've been annoying to track down.
 
@Borgleader Macromedia
 
Huh?
 
@StackedCrooked Same difference
 
Oh that's what he meant.
@Borgleader I think ActionScript was all of Macromedia's doing.
 
6:05 AM
random inquiry: based on (Amazon) reviews on ABSOLUTE C++, how come nobody has mentioned in it stackoverflow.com/questions/388242/…?
it in*
 
Do you have a ToC?
Amazon doesn't have it.
nvm found it
Uh.. weird book.
It talks about std::vector in chapter 7, C-style strings in chapter 9, and then talks about dynamic arrays (you know, what std::vector replaces) in chapter 10. And.. templates all the way in chapter 16.
 
@NimaVaziri Judging by what @Rapptz just found, probably because it's bad.
 
hmm, fair enough
 
Wow this book's huge.
I don't know the actual contents, to be honest it does address common pitfalls and stuff it seems. mypearsonstore.com/bookstore/absolute-c-plus-plus-013283071X
Oh wow, $149.
 
If I had to recommend a book to learn C++ it would be Programming Principles and Practices Using C++ (~50$ on Amazon)
 
6:12 AM
C++ Primer 5th ed is good too
 
6:53 AM
Someone downvoted both answers in this question.. I think to delete the question.
 
7:04 AM
@Rapptz -> hey
why I face with this:
C:\Program Files (x86)\Windows Kits\8.0\include\um\winnt.h(8482) : error C2146: syntax error : missing ';' before identifier 'ContextRecord'
 
Hey. Please read the newbie hints. They're in the starboard ->
Also, I do not know. The error is pretty clear though. You're missing a semicolon.
 
winnt.h is a header in the Windows SDK
not mine
 
Like I said, don't know.
 
probably a missing ; before identifier ContextRecord
 
every thing is ok in mentioned line:
typedef struct _EXCEPTION_POINTERS {
    PEXCEPTION_RECORD ExceptionRecord;
    PCONTEXT ContextRecord;
} EXCEPTION_POINTERS, *PEXCEPTION_POINTERS;
 
7:17 AM
It means PCONTEXT is invalid.
 
morning
 
7:33 AM
@Rapptz MSVC has a tendency to diagnose unknown identifier as such
Mar 10 at 5:55, by R. Martinho Fernandes
I knew that. "cannot convert from 'Derived *' to 'Base *'" is MSVC-speak for "missing header".
@Rapptz ^ sorta relevant
 
lol I forgot MSVC is bad at errors too.
 
morning
 
Anybody know how to make VS make a audible knows when it finnishes building. I usually do this in Linux, I am wondering if there is a good way to do this in windows (maybe a post build event?)
 
7:48 AM
> The GoingNative 2013 conference starts Wednesday and is just about sold out. A few seats remain, so register now (or get on the waitlist in case there’s a last-minute cancellation you can snag).
 
Xeo
@Rapptz nonono, actionscript was the doing of a sadistic devil
@FredOverflow yaaay
 
@FredOverflow rand() Considered Harmful Do you agree ?
 
Do you not agree?
 
@Mikhail It's easy to use wrong. Also, it's not threadsafe. Impossible to explicitely manage (copy/share) state
 
@Mikhail Depends on your needs. I wouldn't use rand() when you need random numbers for security purposes.
 
7:50 AM
@sehe What do you mean by threadsafe?If you call rand it fails or crashes?
 
> With Examples in C++84, C++98, C++11, and C++14
 
@FredOverflow certainly...
 
Whoa, C++84 heh
 
@FredOverflow Well, what would you use? I'm not aware that c++11 has a suitable solution there
 
@Mikhail ok man, NEVER do any multi-threaded code, you clearly can not handle it
 
7:51 AM
@sehe C++11 has <random>, doesn't it?
 
@Rapptz Only Bjarne can promise that. Everyone else would be "guessing" what the "standard" was, back then
 
@FredOverflow It does.
 
33
Q: Random number generation in C++11 , how to generate , how do they work?

user72424I recently came across new way to generate random numbers in C++11 but couldn't digest the papers that I read about it (what is that engine, maths term like distribution, "where all integers produced are equally likely"). So can anyone please explain what are they, what does they mean , how to ...

 
@FredOverflow It does. How does that give cryptographically strong random? It's all pseudo random
 
@thecoshman w/e my code is already multithreaded... But seriously what goes wrong with it...
 
7:52 AM
@sehe There's a (conditionally supported?) source of entropy.
 
@Mikhail you do not know what 'thread-safe' means, stop writing threaded code rightnow
 
@LucDanton Oh, TIL :O
 
@sehe Ah, okay. But it's still better than rand() in the sense that the sequences are longer, so you need more elements to predict the next one.
 
@thecoshman Sorry but its already threadsafe. I got like 4 std::unique_lock<std::mutex>... Should keep me safe...
 
7:53 AM
You're trolling, aren't you?
 
@Rapptz Wow, you're quick :)
 
@FredOverflow Ah well, that's Implementation Defined, IYAM (of rand, that is). Anyways, of course <random> is way superior, that's just not what I asked you about. See this message
 
Xeo
multithreading is easy. if it doesn't work, just throw more locks at it!
 
> Note that std::random_device may be implemented in terms of a pseudo-random number engine if a non-deterministic source (e.g. a hardware device) is not available to the implementation.
 
1 min ago, by thecoshman
@Mikhail you do not know what 'thread-safe' means, stop writing threaded code rightnow
 
7:54 AM
@Xeo Yay! And you'll end up with synchronous code clever guised as multi threaded code
 
The fact your code 'works' is just chance. Until you properly understand what it means to write thread-safe code, stop writing threaded code. Go learn what it means, and why it is important.
 
@sehe Well, I would say that it is more thread-safe than rand(), because the C++11 random objects are scoped, so you can be sure that nobody else is using them at the same time.
 
@Mikhail rand cannot be used concurrently, period. It might crash, it might send your mom a suicide note. Or a cheese cake. (IME it crashes)
 
@sehe oh, I'll have some cheesecake :)
 
@sehe I wonder if if race conditions in rand() actually make it more random because the next value is generated from a write collision (some of the time)? But seriously shit never crashed...
 
7:56 AM
@FredOverflow Ermm... What are you telling me for. Did you read that at all?
@Mikhail Unless it breaks
 
@sehe I'm guessing libstdc++ and libc++ implement it with a non-deterministic source?
 
@sehe It seems you are a little grumpy this morning. Text me when you feel better.
 
I actually don't know.
 
@Mikhail And yeah, it could become more random, e.g. by returning 1 each time. You'll have to agree, this is completely unexpected and extremely random
 
7:58 AM
@sehe Oh, so not conditionally-supported then: you query the amount of entropy and if it's a PRNG it tells you there's none of it.
 
@Rapptz I would have understood C++83 (first named C++) or C++85 (first release), but why C++84?
 
@FredOverflow Ask Bjarne!
 
@FredOverflow Obviously a compromise during the standardization process.
 
@FredOverflow I honestly don't know why you tell me that <random> is better with regard to threadsafety, since that was the very first thing I said, in immmediate response the original question. You might have missed it - perhaps I shall link to it.
 
@LucDanton They didn't even think about a standard back then.
 
7:59 AM
Murderer! Of jokes!
 
@sehe It's okay, I believe you. I tend to miss things.
 
@LucDanton That's conditionally supported, right. It conditionally tells you whether it has it
@FredOverflow Cheers. Good morning, by the way
 
@sehe Well, not the class itself, as it's always here :)
 
lol. It's not about the class names, this once!
 
terminate called after throwing an instance of 'std::runtime_error'
  what():  random_device::random_device(const std::string&)
 
8:01 AM
@FredOverflow the working draft obviously :P
 
> C++ has indeed become too "expert friendly" at a time where the degree of effective formal education of the average software developer has declined. However, the solution is not to dumb down the programming languages but to use a variety of programming languages and educate more experts. There has to be languages for those experts to use-- and C++ is one of those languages.
> I think [making computer languages easier for average people] would be misguided. The idea of programming as a semiskilled task, practiced by people with a few months' training, is dangerous. We wouldn't tolerate plumbers or accountants that poorly educated.
> We don't have as an aim that architecture (of buildings) and engineering (of bridges and trains) should become more accessible to people with progressively less training. Indeed, one serious problem is that currently, too many software developers are undereducated and undertrained. [source]
 
@Rapptz I think it gave you a random device
 
Oh.. I get it. I think coliru doesn't have /dev/urandom
 
@Rapptz I doubt that constructor does anything. I have no entropy no matter what.
 
8:05 AM
Yeah I have 0 on my machine too.
 
> An Effective C++11/14 Sampler (Scott Meyers) oh boy oh boy oh boy oh boy oh boy oh boy oh boy oh boy oh boy oh boy :-)
 
@FredOverflow Yeah, but most programming isn't mission critical... Most programs are more like paintings done for amusement and less like structures on whose integrity rest people. I am sure my non threadsafe usage of rand() (about which I don't give a fuck) would not be tolerated in mission critical cases (where you need rand()?) but it might be fine for me and my silly scattering codes
 
@Mikhail What exactly are you using rand() for?
 
@FredOverflow I am building structures that I simulate E&M wave propogations through. I guess parametric optomization...
 
And why do you need multi-threading for a simulation?
 
8:07 AM
@FredOverflow Grid is rather large I have 4 threads build the data structure
 
And how do you make them "play nicely" on the borders? :)
Going Native starts at 9 am on the west coast, so I guess I can watch it at 6 pm in Germany. Awesome!
@Borgleader sure it is :)
 
8:38 AM
concepts lite haven't been approved yet, have they?
 
Xeo
8:54 AM
@FredOverflow ooh, I'll have to leave earlier on Wednesday
 
The humble programmer. Posted on reddit today, I had not read this before but I think it's an interesting read.
 

« first day (1052 days earlier)      last day (3882 days later) »