« first day (1602 days earlier)      last day (3347 days later) » 

3:00 AM
@LucDanton u avin a gegl m8?
 
@MarkGarcia I don't get it. banana works, but not these? :(
 
@melak47 I hope that’s a WIP and it’s supposed to work.
 
user3010322
You know what
 
user3010322
Fuck all the bitches
 
user3010322
tmp is good enough namespace name for me.
 
3:01 AM
Wow you're still on that
 
The way I remember it is that identifier can start with, and consist only of, UCNs.
 
pile of poo all the identifiers!
 
user3010322
You want a temp file? CALL IT TEMP, FGTS.
 
@LucDanton No... it's really humiliating... the \s in the \NNNs...
 
Morkdown can’t `\`.
 
3:02 AM
@LucDanton UCNs?
 
\\\\\\\\\\
 
10/10 would pun again
 
@Borgleader Kind of cheating with "Tutan-".
 
@melak47 Universal character name, when you feed auto α = 3; to a conforming compiler it is allowed to pretend it received auto \u03B1 = 3; and then it must deal with that correctly.
@Rapptz Super cool pointer, ta
 
Ah.
 
3:11 AM
$ git git commit -m "Make include path relative to project directory"
git: 'git' is not a git command. See 'git --help'.
welp
 
So much for being a git ambassador eh.
 
IIRC Robot said the package manager in Ubuntu was shit, can that be replaced by another one?
 
@ParkYoung-Bae Next time, end the sentence with a period!
 
@Borgleader Pretty sure that'd be Cat.
And no.
I don't mind apt-get on Debian but it always gives me issues on Ubuntu.
 
@LucDanton I think I never do :D
 
3:13 AM
I don't end my git commits with a period either
I am wrong.
 
I could always link one of those foaming-at-the-mouth rabid guides that dictate how you must write your commit novels messages.
 
I always end them in a period.
I don't even notice it.
Shit I'm doing it now.
 
yer fuckd
.
 
@LucDanton Entertain me
 
MLM
@LucDanton I don't think I will be able to use std::function :( - I am getting this weird error on this barebones code and my actual project. "undefined reference to `std::__throw_bad_function_call()'"
 
3:16 AM
@MLM Ditch the setter nonsense. Use a constructor that initializes all your member variables to a useful state.
Oh, sorry I misread. I thought it was throwing.
@MLM What does the compiler/linker invocation looks like?
 
Chances are he just presses the magic Ardunio button.
 
@ParkYoung-Bae paragraphs upon paragraphs of 'why bother?'
 
MLM
@Rapptz True but I am looking
 
is there not a 'verbose' mode?
 
don't think so
 
35
Q: Does DNA have the equivalent of IF-statements, WHILE loops, or function calls? How about GOTO?

coderworksDoes DNA have anything like IF-statements, GOTO-jumps, or WHILE loops? In software development, these constructs have the following functions: IF-statements: An IF statement executes the code in a subsequent code block if some specific condition is met. WHILE-loops: The code in a subsequent co...

nice
 
> Introduction: Why good commit messages matter
dis gon b gud
 
@MLM neat
 
My feelings is that if either a) at review/git blame time the dev has the time to read the novel, the dev would have time to read the actual changes in the commit b) if reading the actual changes in the commit isn’t understandable, then it’s possibly a bad commit
 
MLM
@LucDanton compiler/linker verbose output: pastebin.com/jw2DfRPd
 
3:20 AM
Certainly I could see how some changes could use a novel. I don’t think it’s usual and I don’t see the need for guidelines for exceptional stuff.
@MLM Yeah, it’s linking with gcc and not g++, without adding the C++ libs to the command.
Maybe it’s on purpose and those libs simply don’t exist. In any case you’ll have to dig around to see if there is a fix.
 
> Do not end the subject line with a period
 
MLM
My belief/misconception is that the std isn't available for Arduino. That is why stuff like this exists
 
@MLM but then why do you have useless std headers?
 
Making your own stdlib sounds taxing.
 
@MLM The fact that #include <whatever> even works suggest there’s more to it than that.
 
3:25 AM
I have an Arduino.
 
MLM
I am using a Teensy 3.0/3.1 btw: pjrc.com/teensy/index.html
 
10
A: How to use c++11 to program the Arduino?

jose.angel.jimenezOn the latests versions of the Arduino IDE, in fact it is very easy to change the flags for any element of the toolchain, including the assembler, compiler, linker or archiver. Tested on the Arduino IDE version 1.5.7 (released on July 2014), Locate the platform.txt file, AVR architecture => {...

maybe try what that answer describes?
 
MLM
I am using C++11 now which is awesome. Lamdas work great from what I have used
I did follow those instructions earlier to activate c++11
 
So, essentially, you have a C++11-activated Arduino
 
MLM
Correct
 
3:29 AM
Fancy.
That's more C++11 than sbi.
 
But is it industrial strength?
 
I await my reply from him about this in 6 months.
 
@Rapptz hey, at least our tr1::function works :p
 
MLM
@ParkYoung-Bae Not sure what proof you want to qualify as such
 
@MLM Does the config allow you to specify which executable to use? E.g. select the linker?
 
3:32 AM
@melak47 Do you work with him?!
 
@Rapptz since last May
 
Sounds fancy.
 
MLM
@LucDanton Maybe in one of the .txt config files
 
right
 
WTB compile-time map or something to nicely map enum values to strings pls
 
3:35 AM
it is a bit odd that they'd include the standard headers, but it does look like they only have a c stdlib
 
@ParkYoung-Bae Well, Boost.MPL does have maps. When it comes to 'nicely' though…
@melak47 Yeah that’s sort of weird. I guess there is a market of people willing to write their own stuff.
 
@ParkYoung-Bae define 'compile time'?
 
template <typename E>
class EnumParser
{
    unordered_map<string, E> enum_map;
    unordered_map<E, string> value_map;
    //you see where this is going...:p
not so much compile time :p
or nice :p
 
@Rapptz No runtime constructors called for map/string/wtv
 
3:38 AM
@MLM Try changing avr-gcc to avr-g++ and see what happens.
 
oh that's fucky.
maybe a constexpr string type would help there
 
VS2013 ;_;
 
Or maybe the link command from using the C compiler to the C++ compiler.
 
oh
definitely FUBAR then
sorry
 
Alrite, thx
 
3:39 AM
maybe you can do something with macros
 
Won’t the usual template<enum_type E> struct description; work?
 
That's very tedious
 
@Rapptz With something like lambdas returning string literals.
 
@ParkYoung-Bae But not quite 'FUBAR'. Or as definitive.
 
@LucDanton I assumed "nicely" was a requirement.
 
3:40 AM
Oh okay.
 
Hence no constexpr -> no nice API
IMO anyway
 
eh
The problem starts at the lack of string_view for me. I don’t like C strings.
 
also I like fancy struct cstring
 
anyone know off hand if you can call asio::io_service::poll() from multiple threads at once? and if so, what actually happens when you do? To me it would seem that whichever thread calls poll first would just drain the ready handlers and return and any other threads would be blocked until that happens
 
@Rapptz template<typename...>?
 
3:42 AM
no
 
Doesn’t seem very fancy :Þ
 
struct cstring { const char* data; size_t N; constexpr cstring(const char (&arr)[N]) ... };
etc
fancy-ish
 
@Pris Yes, and what happens is that the polling threads are handed off handlers and run them.
 
I wonder how curl_easy_setopt works
 
@Rapptz very well, thanks for asking!
 
3:44 AM
@LucDanton kty
 
@melak47 wot
 
:p
 
MLM
@LucDanton Changing compiler.c.cmd and compiler.c.elf.cmd to avr-g++ makes no difference in errors. Verbose compile output: pastebin.com/fcaw9qSV
 
user3010322
@ParkYoung-Bae You can make compile-time strings and then make compile-time template-based == for them and have find_if<target, a, pred>::value
 
5 mins ago, by Park Young-Bae
That's very tedious
 
user3010322
3:45 AM
Oh well.
 
/* This preprocessor magic that replaces a call with the exact same call is
only done to make sure application authors pass exactly three arguments
to these functions. */
#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)
..wot
 
I want static auto const descriptions = const_map<Enum, const_string> { ... }; return descriptions.at(enum_value);
 
user3010322
You can do that with what I described, it's just going to take you a lifetime to implement that with Buggyadics and Shitfaced non-constexpr.
 
@MLM It’s still using gcc and not g++ to compile. Either the changes we made weren’t taken into account, or we modified the wrong thing.
@ParkYoung-Bae Without constexpr?
 
@LucDanton I realize it's not possible without constepxr so I give up
I'll just unordered_map
 
3:47 AM
@Rapptz C compilers, I presume.
Or spot how they declared the function.
 
@LucDanton well, now I really don't get the appeal of arduinos. yay c++11! no libs!
 
Oh.
 
wait for it…
 
I thought it'd be more impressive.
this is just lame
3 points for effort I guess
 
wtf is the va_list for if you're only supposed to pass 3 args
 
3:51 AM
Don’t want to deal with 6kloc with my piece of crap.
 
@melak47 it's a dynamic 3rd parameter
it can be long, char*, a function pointer, etc.
 
Here it is!
 
That's why I was interested in how it was done
I forgot va_args existed though
but it was terrible
NOT AS MAGICAL AS I IMAGINED
@ParkYoung-Bae Impossible w/o constexpr.
 
can’t be done. need constexpr
 
9 mins ago, by Park Young-Bae
@LucDanton I realize it's not possible without constepxr so I give up
 
3:56 AM
btw GW2 50% off this week-end
 
@LucDanton -75% no?
 
ya right
 
I tried to see if I could mock something up w/o constexpr.
error: 'constexpr' needed for in-class initialization of static data member 'const char* description<type>::str' of non-integral type [-fpermissive]
forgot about this
 
Yeah, the verbose mapping is a way to select a SSDO, but you can’t read it.
 
MLM
@LucDanton Changed some other settings and I think it is using g++ now but I get more errors and that is all the output in the paste. Sticks at that line at the bottom: pastebin.com/3kgq8bmi
Changed these lines(gcc to g++) in the config: pastebin.com/XQkU0Gak
The ## Compile c++ files is already using g++
 
4:00 AM
@MLM Is the file truncated? All I see is warnings.
Presumably not from your code, so there isn’t much to do about it.
 
MLM
Not truncated, just sticks at that point
Do I want to be only changing the ## Link config to g++? I assume I don't want to compile the S or c files with g++.
 
Sticking -Wno-sign-compare somewhere (with other compiler flags) will get rid of the warning, although it will also skip those warnings for your own code.
@MLM Yeah.
If you see a -Wall somewhere, that’s where to add -Wno-sign-compare.
 
MLM
## Link as g++ and ## c++ as g++(default) output: pastebin.com/q0nwtXEn
 
nice
 
user3010322
Guys
 
4:08 AM
finish last
 
user3010322
Is there a preprocessor macro that can take an input string and split it up into chunks?
 
@MLM Can you compile a standalone test C (not C++) program that does just #include <stdio.h> int main(void) { puts("hello"); } to see what happens?
 
@ThePhD Never.
 
user3010322
@MarkGarcia Doopid.
 
MLM
@LucDanton Compile manually, main isn't a thing with arduino? Is an equivalent with the setup() good?
 
4:10 AM
Put it in whichever entry point, we want to see if puts is found.
 
MLM
I assume so, making it
 
I’m seeing linker errors mentioning libc_s.a so I’m curious.
 
I don't think Arduino has stdout.
 
MLM
@Rapptz That is correct. There is Serial.print
 
Yep.
 
4:11 AM
um if there is no C Standard library I wouldn’t have high hopes for C++ then.
 
There is a C lbrary
It's a free standing implementation, I just don't think it has stdio.h.
 
It’s a shame we need _kill[_r] and _getpid.
 
user3010322
SHITTER SPLITTER
 
@MLM Yeah we want an implementation of some of the C Standard library functions.
wtf 27 attributes combo in GW2
 
MLM
4:20 AM
@LucDanton What do those functions look like on normal platform? Can we just bodge them in?
 
@LucDanton wat
 
@ParkYoung-Bae Now that I think about it, it’s probably counting the low-level one or two attribute stuff.
@MLM Heh, I guess we can.
 
MLM
_getpid doesn't look relevant to arduino at all
 
Put an int _getpid(void) { return 0; } somewhere in the program.
 
MLM
"ISO C++ forbids declaration of '_getpid' with no type"
 
4:23 AM
Slip of the fingers.
 
I was talking to my ex like.. a month ago.
She said she was playing GW2.
Was odd.
 
user3010322
OH TOO FUCKING BAD
 
@ParkYoung-Bae Apparently buying additional accounts for log-in rewards is a thing.
 
user3010322
GCC 4.8 STILL NOT HOLDING UP std::remove_reference_t
 
@LucDanton Also inventory storage
 
MLM
4:26 AM
@LucDanton Put it at the top but still have "undefined reference to `_getpid'"
 
@ThePhD what
 
user3010322
@Rapptz Try it.
 
I already know
Why would GCC 4.8 have C++14 things?
 
user3010322
Question, why isn't "hi" not allowed as a template parameter?
 
You know GCC 4.8 is older than that proposal?
 
4:29 AM
@MLM In std_function_test1.cpp, right?
 
MLM
@LucDanton Correct. It is a .ino mainfile arduino thing
 
Mmmh I think the order is right, i.e. our .o with the definition appears before the library that needs it. Sanity check?
I actually don’t know at which stage libc_s.a is linked.
 
MLM
@LucDanton Yes. .o? pastebin.com/Dn2rpxeV
 
@MLM Nah.
Would make sense to have libc_s.a first, since it’s here to provide things for the rest :/
So unless I’m wrong the actual workaround would be to build a new combined lib based on the missing definitions + libc_s.a, then link against that instead of libc_s.a. A lot of effort (would involve custom linker invocations), with no obvious pay-off.
 
Is it guaranteed that enums start at 0?
Or just a common implementation choice?
 
4:33 AM
@ParkYoung-Bae Yes.
Also guaranteed that the next enumerator is one more than the preceding one.
 
Oh, that's great! Thanks
 
MLM
Maybe the template is the way I have to go then :/
 
@LucDanton What if I got 2^32 enums?
 
@Mikhail Then the last one has value 2^32-1.
counting is hard
 
the dreaded off by one
 
4:36 AM
lol
 
MLM
It looks like I do have std::move so your(Luc's) demo concept will work
 
@MLM I think it would be simpler to crib a function<Sig> from somewhere else than to workaround the linker quirks btw.
should you need it
Or offshore the job to the Lounge!
 
user3010322
Does anyone know of a macro that stops doing something after a certain count/limit has been reached?
 
user3010322
You know what, actually.
 
user3010322
I don't need it.
 
user3010322
4:44 AM
If I have a variadic expansion, can I arbitrarily cut elements out of it?
 
user3010322
For example...
 
MLM
hmm, maybe the template won't work because of needing to change the lambda through the lifecycle :/ - coliru.stacked-crooked.com/a/8a9898b84a9fb5fa
 
user3010322
my_template<1>::value // exists
my_template<2>::value // exists
my_template<0>::value // doesn't exist for 0

my_list = { my_template<I...>::value... } // for any I == 0, excluded from list?
 
4:56 AM
I think template aliases are one of my favourite C++11 features
 
there are so many to pick
 
MLM
@LucDanton What do you mean by "crib a function<Sig>"?
 
next: "crib a unique_ptr<T>"
 
Works as function<R, A, B, C> instead of std::function<R(A, B, C)> although there are some of us that consider this a feature. I think we may be in the minority though.
@Rapptz This one doesn’t throw.
 
5:01 AM
He could just pass -fno-exceptions.
 
slowpoke.gif
@Rapptz tl;dr the dev env already does that. But it doesn’t matter, the issue comes with having to link to stuff. And I think the typical implementation of std::unique_ptr doesn’t need to link.
You have to for std::function because of std::bad_function_call.
 
MLM
What does "crib" mean? Google isn't helping me here :/ polyfill?
 
In context, 'borrow'.
@ParkYoung-Bae I had a better crib in Saints Row by far.
 
@ParkYoung-Bae even over variadics?
 
5:09 AM
so many to pick
C++03 looks so bad in comparison
 
MLM
@LucDanton Seems to work well :) Awesome, refactoring my code to use it. Thank you for all of the help
 
The actual std::function<Sig> has some more goodies such as target and target_type. target is straightforward to provide, while you have no RTTI for target_type.
 
MLM
You should post that crib as a gist for others to discover. Very nice standalone snippet
 
Also you’ll get a null pointer blowing up in your face if you use-after-move. Hope you have a debugger.
@MLM I, huh, have a whole library for defining that sort of thing on the fly.
 
MLM
I don't have a debugger for the Teensy. Debugging consists of Serial.println
 
5:14 AM
@Pris Eeeeeh variadicks are great too.
I was just saying that because I'm rewriting code that uses boost::interprocess long-ass names with usings
And it's a pure joy
 
auto is cool too.
 
auto is a pretty cool guy
 
MLM
Still not sure about the use-after-move thing. It was also apart of the template script with std::move. Need to find some more info on what that exactly means
 
Alright my fucks given have reached 0.
Should I watch a movie or play a game?
 
@MLM Something like if(functor) return functor->call(…); else fail("bad function call"); where fail outputs something to Serial.println before killing/hanging the process then.
@Rapptz I know I’ll grab a bite. Probably movie?
 
MLM
5:18 AM
So I just need to make sure the lambda is set before calling it? And put some sanity checks so I don't pull my hair out on what is failing
 
@MLM Lambdas are fine, it’s the function in particular that can end up in an 'empty' state.
I.e. if you have some_type f; and do blah(std::move(f)); you cannot assume that f is in any particular state.
 
It is a bad idea to use a macro to simplify out-of-class template definitions?
 
@Mysticial Maybe.
 
Say I have a class that takes 10 template parameters. Every function that's defined outside is basically gonna have two lists of 10 things each.
 
Sometimes macros help cut the tedium/boilerplate. That’s what would ultimately matter. Templates, definitions, that’s all circumstancial.
 
5:21 AM
Once in the template<...> and once in the myclass<...>::method...
 
Eh, I would use my editor to write that without hassle. And I think it would be easier to read than a macro alternative.
 
It's like, half the lines of code is just template. It's kinda dumb. :)
 
That’s kinda why some of us lost the patience of defining things out of line for templates.
 
And then when I modify the template parameters, I need to go through and edit them it all 50 functions.
 
@Mysticial Editor again.
 
5:23 AM
@LucDanton Yeah. I wanted to do that. But I'm not a fan of files that have thousands of LOC.
 
Mmmh I think I’ve had ~1k tops for variant. And I do define a lot of stuff out of line there.
 
MLM
So since you use std::move in the crib. I should check f before calling it?
int i = 0;
function<int, int> f = [&i](int j) { return i+j; };
if(f) {
	Serial.print("asdf: " + String(f(4)) + "\n");
}
else {
	Serial.print("fail: f use-after-move");
}
 
user3010322
Wow
 
user3010322
WOW
 
user3010322
It failed.
 
user3010322
5:25 AM
I am ashamed.
 
user3010322
Also fuck variadics.
 
user3010322
Also I am ashamed.
 
user3010322
But also fuck variadics.
 
@MLM No. Personal policy is to make it as plain as possible that all codepaths are sane, and to avoid queriable empty states.
I.e. atm you cannot check whether a function has been pilfered, and I would advise against it.
Then again, I do have a debugger.
 
MLM
5:27 AM
The problem is I don't know how to avoid/get into a empty state so this whole notion is eluding me. I have never used std::move and only barely played around with it today.
 
If you don’t use std::move, then you shouldn’t run into any issue.
 
MLM
I am guessing an empty state could occur because std::movedoesn't duplicate the object and something else could mangle it. kk
 
Using a variable after std::move is a bit like using a pointer after free: there are things you can do (e.g. reset to a known state) and things you can’t (read it, because the variable is in an unknown state). It’s the same class of error.
@MLM Yup. Think of it as std::relinquish or std::give_up.
std::move is somewhat of a contentious name.
 
std::descend_into_darkness
 
user3010322
Hey
 
user3010322
5:38 AM
HEY
 
user3010322
HHEY
 
user3010322
HEEEEY @ParkYoung-Bae LISTEN!
 
user3010322
 
Whooooaaaah
 
user3010322
I think @R.MartinhoFernandes will appreciate that I did even better than VC++ and only have implementation of strings up to 50 in length, meaning I'm about as far back at the 1960s!
 
5:40 AM
Here's a kiss <3
 
user3010322
 
50 is vastly enough
Too bad it doesn't work on VS2013 though
:wink:
 
user3010322
Awww. q_q
 
user3010322
What broke?
 
error C2975: 'C' : invalid template argument for 'c_string', expected compile-time constant expression main.cpp 134
 
user3010322
5:46 AM
It doesn't like STR("hi") ?
 
user3010322
Well, that's... kind of shitty.
 
user3010322
Let me ope-
 
user3010322
.... I don't have VS 2013 anymore q___________q
 
user3010322
Oh wait, maybe I do.
 
user3010322
@ParkYoung-Bae So yeah it can't handle "MyConstString"[0] in a template expression 'cause VS 2013 is DUMB.
 
user3010322
5:52 AM
Although I have no idea if it'll even work in 2015 either.
 
user3010322
Your alternative is to instead do 'P', 'a', etc. etc., although that's kind of shitty.
 
user3010322
Gotta try it in VS 2015, then maybe back-engineering it...
 
user3010322
It compiles in VS 2015.... but the Intellisense Compiler still complains.
 
user3010322
D00pid compiler.
 
user3010322
Oh well. uh. Trying to think of a way to do string expansion that MSVC will like...
 

« first day (1602 days earlier)      last day (3347 days later) »