« first day (1174 days earlier)      last day (3999 days later) » 

10:06
Hy guis
How's your Crash Day going
JBL
JBL
VS crashes, so as expected.
@Borgleader It's 11am here
@Telkitty "Not allowed to browse Questionable category"
10:17
@Telkitty awwww
10:38
Man. I'm taking the low road here:
BOOST_FUSION_ADAPT_STRUCT(CloudBackup::Shared::DataContract::EntityId,
        (decltype(CloudBackup::Shared::DataContract::EntityId::Id), Id)
        (decltype(CloudBackup::Shared::DataContract::EntityId::UserId), UserId))
It's just that MACROS are evil...
BOOST_FUSION_ADAPT_STRUCT(CloudBackup::Shared::DataContract::EntityId,
        ((Incubation::Nullable<false, odata::edm::builtin::EdmGuid>), Id)
        ((Incubation::Nullable<false, odata::edm::builtin::EdmGuid>), UserId))
Won't ever work, it seems.
Not that I know what the macros do, but can you not do the second without the () around Incubation::Nullable<>?
What do you think :)
:)
Right.
It's not that I crave parentheses this much
11:11
morning
user1804599
@sehe Sure:
user1804599
" Reformat C and C++ code
fun! <SID>ReformatCXX()
    let l = line(".")
    let c = col(".")
    %!clang-format --style='
\{
\    BasedOnStyle: LLVM,
\    Standard: Cpp11,
\    IndentWidth: 4,
\    UseTab: Never,
\    AccessModifierOffset: -4,
\    NamespaceIndentation: All,
\    PointerBindsToType: true,
\}'
    call cursor(l, c)
endfun

autocmd BufWritePre *.cpp,*.hpp,*.c,*.h :call <SID>ReformatCXX()
11:28
@Ell the latter :)
@LightnessRacesinOrbit not good sir! sir, help needed
morning ;0
@Jefffrey Joke interview from ancient times.
user1804599
> HSSF - Horrible Spreadsheet Format
Macros are evil but they haven't really bitten me as much..
I guess it's because I don't do stupid things like #define min and max macros.
#define Q_FOREVER for(;;)
#ifndef QT_NO_KEYWORDS
#  ifndef foreach
#    define foreach Q_FOREACH
#  endif
#  ifndef forever
#    define forever Q_FOREVER
#  endif
#endif
Just found this in qglobal.h
Qt.
user1804599
It is terrible.
user1804599
11:37
Oh hey I am too dumb to understand what for (;;) means so somebody has to write a macro for it.
"forever" is more dignified ;0
The "for(ever)" trick is so dumb
you can disable it by doing CONFIG += no_keywords
They haven't interfered yet.
@Jefffrey WTF? April 1 is long ahead, yet.
11:46
huh? VLC for OS X 2.1.2?
Oh, it's VLC 2.1.2 for OSX.
yaml is hard
user1804599
OS X 2.1.2 does not exist.
Hence my confusion.
12:04
can you add no_stupidity to that config?
What?
@DeadMG It's ignored.
Just tried.
Oh wait.
Maybe it was not a full rebuild.
yep it's ignored
@rightfold Oh hey, this page told me I can use
map <C-K> :pyf /usr/share/vim/addons/syntax/clang-format-3.4.py<CR>
imap <C-K> <ESC>:pyf /usr/share/vim/addons/syntax/clang-format.py<CR>i
user1804599
You still have to configure it otherwise it would use the terrible defaults.
user1804599
Also I want it on save.
12:09
@rightfold That project is ooooooooooooooooooold. And said format are horrible :)
@rightfold I wager there is something akin to /.clang-formatrc maybe. Trumps doubling the size of my vimrc
user1804599
I gave an example configuration.
user1804599
It works for me.
user1804599
I will not change it.
Still looking for the sane place to put this configuration, not in vimrc (cause it's only for vim, and vimscript is yuck)
user1804599
@sehe You have a very small vimrc.
12:12
LoL, uhh...this is a bug, right?
I guess that's one way to "implement" uniform initialization - just allow curly braces for all function calls
> This program trigger strange link errors, I don't know why: #include <boost/coroutine/all.hpp> int main(){}
Posted on Coliru feedback.
A simple Google search would reveal that you need to add -lboost_system to the command line.
@melak47 >MSVC
@melak47 WTF
@StackedCrooked Remote Crucify the asker
12:22
Every dumb question shall result in 24h Coliru shutdown.
That's not very constructive.
@StackedCrooked turn the asker's code into DongML when they hit the button :D
@StackedCrooked But very effective. Even more effective: redirect feedback to /dev/null
@melak47 Or into MSVC-flavor C++
Feedback is a .txt file. Each entry is a line.
So I need use Vim dd.
NO!
:%d|wq
@StackedCrooked I know right. You're complaining about it, not /dev/null enough
Steam keeps its screenshots in the worst directory ever.
How annoying
12:25
What. Family pictures?
@Rapptz you can tell it to save lossless PNGs in a directory of your choice also
@Rapptz The worst directory ever?
Don't know where to find that setting
The trash can?
No.
12:26
@Rapptz I think it's per game :E
"Steam\userdata\<userid>\760\remote\<appID>\screenshots\"
@BartoszKP #define eternally forever
user1804599
@Rapptz because I did force push to replace the older Go code.
@sehe #define much_eternallness eternally
user1804599
More interesting question: why are you looking at my projects?
12:28
Because they're public.
user1804599
So you also buy things because they cost money?
@StackedCrooked for(always), while(ever), for(every : thing) :)
I like my while (42)
@rightfold Yes. Otherwise I'm not buying them, I'm receiving them for free.
for (;;)
12:30
goto
user1804599
Recursion.
user1804599
Hmm.
loop: goto loop;
user1804599
Recursive lambdas in C++14 with polymorphism and Y-combinator. :)
a program that runs an another program to restart the first one after it has finished
user1804599
12:34
Multithreaded loop!
@rightfold recursive lamba's? nice I've needed those a couple of times.
dang
799
LEGObricks.stackexchange.com

Beta Q&A site for Lego and building block enthusiasts.

Currently in public beta.

0.7 questions per day lol
I have used this pattern a couple of times:
void add_listener(F&& f) {
    auto old = this->notify;
    this->notify = [=] -> {
        old();
        f();
    };
}
As a way to compose callbacks.
I think it's kinda expensive.
I think registering 100 callbacks like that would result in a lot of indirections.
looks like you're looking for chained calls
@Rapptz that's a lot
12:42
there's an implementation of them here somewhere
I search many questions on SO daily.
Only occasionally I need to ask one.
Why not a list of callbacks instead? Do you frequently chain them?
A list would be easy to implement.
However, the chain is only a few items long. Perhaps 4 or 5.
And I was lazy at the time :)
auto stackoverflow = []()->void{ (*this)(); };
stackoverflow();
12:45
@melak47 Does that work?
@StackedCrooked if by work you mean does it overflow the stack, then yes :p
in release mode though it's a nice endless loop :D
@melak47 vOv
@Collin, It's -std=c++1y (not --std=c++1y) and nope. :)
yeah, I realized that was silly.. this would be whatever class you were in
12:53
@Collin only if you captured this :p
@Collin nope ^
ahh my brain
I thought this might not exist for stateless lambdas, but doesn't seem to make a difference
12:54
therefore it doesn't work
case closed
it works in MSVC :)
so MSVC is clearly superior, case closed :p
Yesss, clearly.
user1804599
Who wants to see blood?
@rightfold I do. YOUR BLOOD.
I demand a Youtube video.
I demand a twitch live stream
I also demand youtube to die as soon as possible.
And lounge's people working there, to find a new better job.
hmrph, is there any way to get around "can't convert from {init-list} to whatever" without explicitly specifying the types in the init list?
@StackedCrooked tbh honest I'm not worried about facebook/google+ knowing what I like or what pages to visit
it's just a lousy gift :)
if they can use those informations to get me better advertising, then I'm even happier
yeah I think so too
13:05
so instead of "enlarge your penis" ads, I'll get the "shorten your penis a little" ad, kind of thing
3
if they can recommend me new anime torrents then that would be excellent
I have an init list in the form of { { string, { args, that, should, make, a, "Blah" }}, {string, {other, args, {which, should, also, makea, "Blah"}} } } ...is there any hope of getting it to work without having to throw the types on the respective curly braces?
You can always hope.
@melak47 just hope is not enough, you need to sacrifice an animal
13:19
hm, I sort of got it working, but with extra braces around everything :/
@TonyTheLion hahahah
4chan gonna 4chan
4chan or not, it was funny
@TonyTheLion brilliant :DDD
13:26
close enough I suppose
what's better and why: a) int func(int x*){ ... } b) int func(int x[5]){ ... } please?
@Luka c) int func(std::array<int, 5> x){...} :p
is there really any advantage using std::array vs c-style array?
yes
plenty
@Luka I don't know what it is, yet I can see already that it probably has it's bounds checked
13:32
i know people love c++ stuff because they are easier to use than c... other than that, why use c++?
because easier to use implies (a) more productive (b) less error-prone
@Luka templates
@Luka Why use C? Why not B? Why not assembler? Why not straight machine code?
yeah, people that are easier to use imply productiveness, but I'm not sure about their errors ;0
13:34
@Jefffrey :(
why would it?
ok, those are valid points but many c++ function are slower than c. vectors are slower than c arrays in most cases, because under the hood vectors is (i guess) a c style array, right?
It depends on what your criteria are, and which conditions you are working under. Personally, I consider it useful that I can write shorter, cleaner and faster code which is less likely to contain errors, just by using C++ instead of C. But your mileage may vary
@Luka Do show us a benchmark where vectors are slower than C arrays
@Luka No, no, NO.
@jalf there is a line between easy to use a and performance
13:34
@Luka is there?
Again, show us a scenario where C++ is slower than C
oh my that C++ vs C again
The nice thing about C++ is that it doesn't sacrifice performance in order to become easier to use
@Luka also, C-arrays and std::vector have two very different goals
it's slower in terms of compilation though :P
but after that there is probably no difference
and no std::array and C-style arrays are not different in performance
13:36
@jalf please, try cout and printf
A vector is a thin wrapper class around a C array, but it is not slower because it is trivial for the compiler to inline, eliminating the difference completely
@Luka Easier to use is a super important goal.
@Luka Yes? There's no law preventing you from using printf from C++ code :)
@Jefffrey very true but if I am ok with what c style arrays provide feature wise, why not use them?
But yeah, iostreams and everything connected to it stinks
I was talking about the sane parts of C++
13:37
@Luka It's true that iostreams is hideously slow, but that has nothing to do with it's C++ origins, it's just a bad library. A Modern C++ replacement would be just as fast as printf. But you can still call printf or roll your own equally fast I/O library in C++. Not to mention that I don't give a shit about how fast your buffer overruns are.
@Luka Go back to school, because the features they provide aren't good enough.
@DeadMG i just want a static array. why bother with c++ arrays and vectors?
@Luka you mean to-pointer decay when passed to functions?
@Luka Er, you don't need a std::vector, you can use a std::array.
that's their best feature
and the answer is "Because C-style arrays are hideously unsafe"?
13:38
@Luka to us it sounds like "but if I am ok with eating shit".
they're non-type-safe with all that hideous pointer decay shit, no debugging machinery in debug mode, no iterator or other interface support
@DeadMG this is the price to pay for performance
@Luka For example, because a C++ array doesn't decay to a pointer. It is, and stays, an array. And because it does this without sacrificing performance
@Luka Er, it really isn't, std::array is just as fast as T[].
@Luka Once again, can you show us this "price"?
Can you show us a test case where a C array is faster?
13:39
@Luka stop with this performance nonsense :|
@DeadMG "no iterator" -- std::begin/std::end vOv
@Abyx lol, it's more like: why waste 1 million on a supercar if I am ok with a 100k car?
@Luka nope
@Luka You wouldn't say that if you had a family and the 100k car had no seatbelts.
Please, if you ever want to be a programmer, understand this, because it is probably the most important lesson in all of programming:
13:39
61
Q: Produce the number 2014 without any numbers in your source code

Joe Z.So, now that it's 2014, it's time for a code question involving the number 2014. Your task is to make a program that prints the number 2014 without using any of the characters 0123456789 in your code. The shortest code (counting in bytes) to do so in any language in which numbers are valid toke...

which is the position every developer is in, whether they realize that or not.
Hard-to-use does not imply performance
C arrays being unsafe and ugly and weird does not magically grant them additional performance above what std::array can do
It just makes them unsafe and ugly and weird
I see, maybe I will mature one day and understand
Don't assume that just because something is nicer to use, it is necessarily slower
13:41
@Luka in fact, don't assume anything ever about "performance" until you actually benchmark it ;0
but again, the reason why I program many things in C++ and not in java is because C++ is much faster and uses much less memory. now, you may say
@Luka It is a very important feature of C++, that it enables abstractions which aren't just "nearly", but actually free in terms of performance
the vast, vast, vast majority of code isn't performance-sensitive anyway.
profiling peeps
go there and use assembly, but assembly doesn't worth it
13:42
@Luka Java and C++ are totally different beasts in vastly many highly important ways, and performance is just one of those differences.
54 secs ago, by BartoszKP
@Luka in fact, don't assume anything ever about "performance" until you actually benchmark it ;0
Also, I tired benchmarks
i'm tired too man
A vector is a thin wrapper around a heap-allocated C-style array, and because its definition is visible to the compiler, the compiler can inline all the std::vector code, reducing the generated code to exactly the same as it would be if you used a C array
for example java uses bout 3-5 times more memory for an array (i don't remember the exact number but the difference was huge)
13:43
@Luka can you show us?
@Luka I thought we were talking about C and C++?
@Luka That's bullshit.
java uses 3-5 times more memory just by being java
Java being slow and bloated proves nothing other than that Java is slow and bloated.
@all: ok, wait a moment to show you why c function are faster than c++
Remember to enable compiler optimizations :)
13:44
I guess we're all ears ;0
it's always on o2 and release x64
@Luka the irony. We have to wait to be shown a fast thing :)
:P wait
does this look reasonably concise for authoring json from c++?
by the way, it is a common misconception, because C++ is pretty unusual in its abstractions being free. In Java and C# and pretty much any other language, you actually pay a performance price for wrapping stuff in classes. (And you certainly can pay that price in C++ as well, but you don't have to)
13:47
@Luka man wtf you can write C code in C++, and with features from C++ it will be better (safer, easier to read and maintain, etc)
omg, fucking idiot. I've spent like 3 days trying to solve this without shell=True flag, and there he comes, a wise wizard to announce it to me, that I shouldn't use this flag:
Do not use shell=True unless necessary. There's no need for it in this case. — Piotr Dobrogost 1 hour ago
@melak47 are you using using json::array = std::vector<boost::any>?
@melak47 uh json
@melak47 looks pretty decent to me
@Jefffrey pfff as if I could just put any thing in json :p
13:48
@jalf there you are, claiming the same nonsense as @Luka :) In general that's also "performance" nonsense. For most simple tasks you won't notice this difference
@BartoszKP what?
@melak47 you can, as long as they can be converted to string :)
@jalf which part you don't understand? : )
@BartoszKP who cares about your simple tasks?
In Java in particular, the difference between ArrayList<Integer> and int[] is pretty noticeable
13:50
@melak47 sharey? I'm implementing JSON serialization right this very moment.
@BartoszKP I don't understand what you are talking about.
@Abyx don't know ;0 who cares about yours?
mostly because generics in Java are stupid of course..
@jalf about the fact, that talking about "performance" in general, without a particular context, and some tests really doesn't make sense
@sehe lol I also implemented JSON s11n a few months ago
13:51
is json the new snake?
I blame Casablance for not being truly portable
but JSON is a bad format for statically typed languages
@BartoszKP No, talking about whether a performance different is meaningful depends on context, but we can certainly discuss whether a performance difference exists
Which, you may note, is what I was doing
I know it is hard to accept that there are people in this world who have a more nuanced view of performance than just "is it slow enough to be annoying yet?", but that's just how it is.
@sehe you can have it if you like, but don't hit me if it's terrible :p
@jalf performance difference exists for any two things, because law of physics forbid two events to occur at exactly the same time :) What's important is whether this difference is meaningful - in general, or in a context.
13:54
@melak47 I won't. Mine isn't viable yet
@Jefffrey You can put a Wide semantic analyzer in JSON?
@BartoszKP Please, if you have nothing to say, just don't say anything.
@sehe also, this doesn't do any deserialization/parsing :)
When discussing whether performance is exactly the same, I really really really don't give the slightest fuck in any way whether you think the difference is meaningful
@melak47 oh... nevermind then :/
13:54
A non-meaningful difference is still a difference.
@jalf I'm shattered by your substantial argument ;0
@BartoszKP You mean, the argument that boils down to "you are talking about something completely unrelated to what we were discussing"
@BartoszKP I, on my part, am shattered by your meaningless argument
@DeadMG I don't know what you are talking about
@sehe haven't gotten there yet. Shouldn't this be easy for a spirit wizard? :)
13:56
We can always "get philosophical" to avoid discussing things
@Luka are you able to dig up those benchmarks?
@melak47 That was the easy part :/
@jalf how to set dynamically the size of an std:: array?
lolwut
Instant discredit and riducule
@Jefffrey Merely referring to the fact that your definition of JSON would in fact permit that.#
13:56
@Luka You can't. That's the point of the class. Just like you can't do that for a stack-allocated C array
If you want something dynamically sized, use a vector
@jalf i can with malloc
@sehe lol, it's not philosophical. It's pointing out, that talking about "performance in general" is nonsense. If you care about every possible to imagine bit of "performance" then, to reiterate someone's comment from few minutes ago: go ahead and use assembly
@sehe the parsing was the easy part? then what's the hard part :S
@Luka Yes, and then it is no longer a stack allocated array
@BartoszKP Er, actually, compilers started beating human assemblers some time ago.
13:57
std::array is equivalent to a local/stack-allocated C array (int i[40])
@melak47 magically mapping structs to a JSON format :/
std::vector is equivalent to a heap-allocated C array (int* i = new int[40])
@BartoszKP Yes it is philosophical
@DeadMG all right, whatever :) the point still holds
@sehe well, it's simple - you just, uh....iterate, over the struct members...err..
@BartoszKP No, no it does not.
13:58
@DeadMG well, I would allow every type, as long as it can be converted (has a valid function overload for json::to_string, for example) to a json format
@BartoszKP The point that you seem incapable of wrapping your head around is this: we are discussing whether a difference exists
Not whether it is relevant to your life
@sehe just serialize the struct as a base64 blob :p
OK, i tried benchmarks
@BartoszKP Do you also shut down discussion of distant supernovae because they are not "meaningful" to you and your life?
@Jefffrey Why not just... convert them to a string beforehand?
13:59
@sehe That is something nice about having reflection, GSON does a pretty nice job of that
Google Summer Of Nosepicking?
@Luka your benchmarks are inaccurate
Ell
Ell
Morning
@DeadMG haha (it's a json library for java)
@melak47 That's what I'm doing
13:59
@jalf there is no point in discussing that - it's obvious that there will be some difference always. The whole point is to define whether it's meaningful, not just "in my life" (don't know how did you come up with that).

« first day (1174 days earlier)      last day (3999 days later) »