« first day (1826 days earlier)      last day (3123 days later) » 

9:00 AM
@CatPlusPlus it's not so much the formatting, it's the adding extra shit to it, such as time and jsonification.
 
@AndyProwl But that's different levels of abstraction IMHO.
 
what I then test is that report_touch_alarm() was called with the right position, rather than parsing the string "I got a touch alarm at position (1, 2, 3)"
 
@thecoshman It's all stateless
 
A "logger" is something that takes text (and possibly console formatting) and spits it out somewhere in a programmed fashion.
 
Which is nice
 
9:01 AM
Your report_touch_alarm is a formatter really.
 
@AndyProwl I'd favour having the "I got a touch.." part of my class, and have your types implement ostream operators vOv
 
@thecoshman ostream operators kinda suck for logging.
 
λ runWriterT $ tell ["abc"] >> tell ["def"] >> lift []
[]
it :: [(a, [[Char]])]
@R.MartinhoFernandes ^ "logging"
 
@CatPlusPlus it is yes, but if you want all your logs to have a time stamp, you don't want to do that for every location where you want to log a message
 
> In a programmed fashion
 
9:01 AM
@thecoshman You need tricks with temporaries to do it right.
 
When loungers fail to pedant
 
@thecoshman There's this thing called functions
 
@sehe oh come on. :P
 
@R.MartinhoFernandes well I meant for if you want to do things like output state of the thing you are logging aobut.
 
@Griwes I think the context of what I'm saying goes back to the origin of the discussion, which was about "adding explicit dependecies to your classes for logging purposes is sort of crazy"
 
9:02 AM
@CatPlusPlus yeah...
 
@Griwes Well. You tell me what it means then.
 
My API looks like log(event_id, some_data = 'whatever', some_other_data = [1, 2, 3])
 
my point is, I want to do that, because I prefer abstracting out (as you spotted) the details of formatting/logging
 
@thecoshman I don't see how that changes the fact that they require tricks to keep atomicity.
 
And that emits something like { "event": event_id, "timestamp": "...", "some_data": "whatever", "some_other_data": [1, 2, 3] }
 
9:03 AM
@sehe It means that the place where the logs are spat out depends on a specific instance of the interface rather than on the interface itself.
 
@AndyProwl everybody does. it's basic separation of concerns, duplication avoidance and a point of Endirection
 
@R.MartinhoFernandes ah, I wouldn't know about that :\
 
@Griwes That's not an essential feature of a logger, IMO
Many loggers don't have this "enterprisey" feature you speak of
 
@sehe Being able to log to either a regular file, standard output, or, say, syslog, is IMO an important feature.
 
@sehe Yeah, that's my stance. Not sure everybody does that though. My preference for explicit dependencies was quite controversial here
 
9:04 AM
Maybe not essential, but important nevertheless.
 
(and pretty much everywhere else lol)
 
@Griwes Sure. You were providing a definition of loggers in general though
 
@AndyProwl it's not that extreme :P
 
@thecoshman You want each log message to be kept as an indivisible unit. Try doing that with ostream operators (i.e. consider os << x << y; vs os << x; os << y;). It's possible but needs tricks with temporaries and strict rules for usage.
 
@Griwes Nah
 
9:05 AM
@thecoshman I actually understand the counter-arguments. It's just that all in all, I find it a better design than the implicit dependencies on a global/singleton logger
 
If you always spit logs onto stdout/stderr, you can just plug something on top of it that takes it and redirects it wherever
 
And then there's Cat who thinks JSON is The Logging Format.
 
@AndyProwl Nah. Many people don't, most people don't all the time. I was just confirming that this motivation to have a logger abstraction is shared for the obvious reasons
 
Got it
 
@CatPlusPlus What if I also want to have stdout and stderr?
 
9:06 AM
It is for people who know what they're doing (it doesn't have to be JSON exactly, but it does have to be structured)
 
oh no
 
@Griwes Then use fd3
 
@R.MartinhoFernandes ... well that would be logging one thing about x and y compared to log one thing about x then another about y...
 
@R.MartinhoFernandes I would only consider e.g. variadic write() that streams the arguments to an internal stream, then atomically writes the resulting string.
 
@AndyProwl Well. I love explicit dependencies, and in fact I've used an injected logger in my last project (indeed passing it across modules). Butttt the bulk of all logging was done using static logger instances.
 
9:07 AM
(Or you know have the log redirector that gathers your log output spit it out on its own stdout/stderr if they match whatever)
 
So it depends on what kind of logging is done
 
stream ops just not meant for this kind of work and the interface just doesn't really work for it
 
@sehe oh, okay, that I can understand
 
@sehe I believe this is a correct approach - give an ability to specify a different logger, but use a global one by default.
 
@AndyProwl Awesome that you spotted it without the reply-to
 
9:08 AM
ah fuck, so much time to kill before parcel delivery
@sehe hey now
 
what
 
be nice pls
 
where was I unnice¹
 
o_0
 
windows task bar not autohiding again argh
this will force me to restart
 
9:09 AM
¹ not the exhaustive list pls
 
@sehe Comparing char* against string literals is always pointless though, isn't it? Like if (p == "hello")?
 
@AndyProwl kill explorer.exe?
 
@sehe preparing for Christmas are we
 
@sehe yeah I was thinking if that would be a good idea
 
@fredoverflow Not if they always point to constants
 
9:09 AM
@fredoverflow Compilers can pool them together, so it can work, it's just not guaranteed to and doesn't always happen.
 
Then identity comparison is cheaper
 
@AndyProwl As long as you know Ctrl-Shift-Escape, File/Run...
 
@CatPlusPlus Hmm, so I could use string literals as enums? Interesting.
 
@LucDanton Yeah. The naughty list can wait
 
You can const them yourself if you don't trust compiler pooling
You probably want to anyway because repeated literals is dumb code
 
9:10 AM
@CatPlusPlus Actually, my compiler does the pooling :-D
 
@sehe I think it should even auto-restart
 
Only if not explicitly killed, for the obvious reason (at least, that's been my experience)
 
awesome
@sehe thanks for the tip advice
I hope that's not starrable
 
I need to be studying some kilometers of Schubert scores. Bbl
 
this should work
 
9:12 AM
@AndyProwl Just the tip
 
@Puppy Hmm, so a warning would definitely be justified, wouldn't it?
 
@CatPlusPlus behold
using string_views left as an exercise etc.
 
@LucDanton ah the joy of C declarator hell
 
cba’d to alias
 
@fredoverflow Yes. It'll fail in plenty of cases and strcmp should be used instead, assuming that you're still a muppet who hasn't gone to C++ yet
 
9:15 AM
@LucDanton sure, but
 
5 mins ago, by Cat Plus Plus
You can const them yourself if you don't trust compiler pooling
<snide comment about arrows>
 
never trust cimpoler
 
I meant you should name them anyway, so const char* whatever = "xxx"; so you don't repeat magic constants all over the place
 
it can optomaze your verbibols away
 
optimaze
 
9:16 AM
@CatPlusPlus So you agree that comparing against string literals is probably a bug.
 
octomaze
 
I've ICE'd just about every compiler I've used :-\
 
@ScarletAmaranth With the same piece of code?
 
optimazing is when the cimpoler does some really nice optimization
 
I frequently use immutable strings where you might expect integers
Identity comparison costs the same and they're self-explanatory
 
9:17 AM
@CatPlusPlus I am doing that. Using my own array rather than one that comes from the compiler, but still.
 
@Griwes hard to write a valid Java program in a C++ cimploler
 
wat
 
@LucDanton You still repeated the literal :v
 
every as in every; for every language I've written
 
:( coliru isn't giving me any output... even for broken code
 
9:18 AM
coliru and wandbox seem down... No live sample for now :( — sehe 21 secs ago
 
@CatPlusPlus Show me a concrete example of a comparison, please.
 
@StackedCrooked ^^
 
@CatPlusPlus Where you’d be repeating a variable name.
 
Java stuff is tough to ICE but it's become easier in 8
 
It never rains when it poors
 
9:18 AM
@LucDanton Well, yes
 
Well?
 
@thecoshman sometimes it happens, just retry in a while
@sehe I've seen a "C++ console" somewhere
didn't look bad, lemme see if I can find it again
 
They're traceable and autocompleteable
And you can change the contents
 
@ScarletAmaranth You can tell C++ is making strides when everybody is copying it.
 
ah, no C++ shell
cpp.sh /cc @sehe
 
9:19 AM
@fredoverflow I don't write C++, I do that often in Python though, it's just doing reference comparison instead of string comparison
 
@AndyProwl not that desperate
 
you don't get to pick the compiler but should be ok for live examples
 
@LucDanton lol
 
@AndyProwl ergh... it's not nice
 
@thecoshman yeah, but if everything else is down vOv
 
9:21 AM
@thecoshman But why? In any other context they're indistinguishable. And you can't implement it normally to get the behaviour you describe. The obvious op<< implementation (append thing, return os) doesn't behave like that.
 
0
A: How to convert boost::date_time::date::day_of_week() to string type?

seheI suggest boost::lexical_cast<> here: std::string day = boost::lexical_cast<std::string>(today.day_of_week()); Or simply: std::cout << today.day_of_week(); Live On C++ Shell #include <boost/date_time/posix_time/posix_time_io.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #include <

@AndyProwl Cool. Boost supported
 
@R.MartinhoFernandes oh... maybe I just don't know streams well enough
 
@thecoshman noone does; where's Dietmar?
 
day_of_week return a number, converting it to a string will give you that number as a string. You could use e.g. an std::unordered_map to map the number to a string. — Joachim Pileborg 25 mins ago
Joachim has a habit to dismiss everything he doesn't know about off-hand. A bit like @pantarei
 
> Abusing programming instead of drugs.
:P
 
9:23 AM
reality is for those who can't face drugs
 
@CatPlusPlus How are strings compared in Python? Does it have equals method or something?
 
is the "SOreadytohelp" thing still meaningful?
 
I saw it in someone's profile here on SO
 
I had it there for a while hoping I could really get a t-shirt or something like I've read, but I got no notification
 
so you were shirtwhoring
 
9:25 AM
@fredoverflow Python has operators for both value and identity comparisons
 
@ScarletAmaranth yeah
I want the t-shirt
 
@CatPlusPlus Please show them to me, I don't Python.
 
Uh, x == y, x is y
 
show him your Python
 
@CatPlusPlus Those look reasonable.
 
9:28 AM
@AndyProwl I always read that as #SOrrytohelp
I don't know what is was about in the first place
@AndyProwl oh aha
 
@AndyProwl what is it supposed to mean?
 
I think i want to drop out
 
@BartekBanachewicz From?
 
I havent event managed to start the semester and I'm already failing it
 
@BartekBanachewicz I thought you've wanted that for years now.
 
9:32 AM
@BartekBanachewicz Do not be retarded. Make every effort to finish the school!
 
@BartekBanachewicz do you have a bachelor's at least yet?
 
I just got an anonymous message saying that I should really appear on some classes
 
@BartekBanachewicz I think you're human.
 
@BartekBanachewicz well then go appear in some classes
class appear
 
My daughter has the same. Everything that doesn't come naturally is a chore
 
9:33 AM
@BartekBanachewicz lol
 
@sehe hehe
 
@Tony I work full time. I was sick for the past two weeks, having chronic headaches and stomach problems
 
My phone provider wants me to use the power of my smartphone to solve cancer while I sleep
 
@BartekBanachewicz :(
 
Going to work has been a challenge itself
 
@sehe like Haskell?
 
@TonyTheLion It's hard to puncture though. It's really a fear of failure, I feel. Quite crippling
 
@BartekBanachewicz Did you notify them? Because if you didn't, then... well.
 
@sehe I know how it feels ._____.
 
@JohanLarsson huh?! haskell comes naturally
 
9:34 AM
@ScarletAmaranth not for pre noobs
 
@R.m intensifies
 
Advice from my personal experience would be "make a decision now and stick to it". Either drop it now or suit up and go to class. Don't drag it along.
 
^^^ good advice imho
 
@BartekBanachewicz well, it's not the first time you entertain and voice these thoughts, right?
 
@TonyTheLion Yup.
 
9:34 AM
but he can always decide to procrastinate
 
You know it's just I've realized that if I get the paper ill hang it on the wall and it will remind me for years about all the time I've wasted
 
...
 
@R.MartinhoFernandes But the discounts
 
The years I spent trudging through (missing) the classes and (missing) the exams were the worst.
 
@BartekBanachewicz pffft. perspective
 
9:35 AM
@sehe it's worse every time
 
@JohanLarsson maybe take a small lookie-look at untyped lc or simply typed lc and then retry Haskell
 
@BartekBanachewicz First off, it is not just the paper. Uni teaches quite a lot of stuff that you actually might find useful. Second, the "paper" is for your future. You might have a job now, but the "paper" might be useful in the future to get a different job.
 
If I had known that a piece of paper saying I got "a degree in blah blah" would more easily land me a good job, I would have got one
 
You could also look at it and be content that you can muster the discipline for hard things.
At least to some people, the paper will mean more than just that.
 
@ScarletAmaranth I have not tried it yet really. I was just taking a shot at the bear :)
 
9:36 AM
sadly I was dumb and I didn't go for it
 
@wilx oh god cut that cargoculting bullshit
 
Shit, I still regret dropping out. Especially since I had like 302 credits out of 320.
 
@Bartek oh, don't get me wrong: don't make a rushed decision. Think it through properly, but just make sure you come out of it determined to go through with whatever you decide.
 
I finished my degree but now I don't work with what I studied for.
 
You didn't study for your brain/
 
9:37 AM
@BartekBanachewicz dude, I ran into it so many times "oh you don't have a degree?" and then the conversation about the potential job ends
 
If you start a sentence with "uni teaches" near me you're either going to swallow it or I'll punch it back your throat
2
 
@BartekBanachewicz He's right about the future, though.
 
@sehe can't parse
 
20 secs ago, by Bartek Banachewicz
If you start a sentence with "uni teaches" near me you're either going to swallow it or I'll punch it back your throat
Bartek Banachewicz, 2015
 
You're still doing BSc?
 
9:38 AM
@JohanLarsson I didn't finish my degree but now I work with what I studied for.
 
I was suggesting you don't study for the brain.
You study for _you_ and surely you use that (e.g., your brain)
 
I wanted to drop out too - shrug. Uni shortly thereafter became very little work tho. Hand in some assignments, show up just enough to pass the class, done.
 
@tony a potential job where having a degree was important. Sounds like an amazing job alright
 
BTW didn't we have that conversation last week already? And the week before that too?
 
@BartekBanachewicz It might not "teach" you anything, but that piece of paper that claims you've done it in the end, is something employers still value from what I've seen.
 
9:38 AM
@GregorMcGregor He is being flippant, but I value the humor there
 
@BartekBanachewicz stop being so cynical.
 
@GregorMcGregor It only needs some dog dragons and it'll be proper story
 
@sehe fair enough, learn to learn etc. Now brain is broken any way.
 
@r.m the thing is I think strategically its best for me to drag it out
 
@BartekBanachewicz The paper is not important for the job itself, for the day to day work. It is important to get it, though.
 
9:39 AM
@JohanLarsson it went with the "10 million questions" thing, if you write that on the SO profile or share it on twatter, you get a t-shirt (simplified version of what I seem to remember having read)
I tried it but no t-shirt
 
If I keep working full time I keep ahead in money
 
@BartekBanachewicz What do you mean "strategically"? As in, towards what end?
 
also reminds me I need to get the Lounge t-shirt from @R.MartinhoFernandes: will you be in Berlin 4th-6th December?
 
@AndyProwl Yes.
 
ah, cool
 
9:40 AM
Also, sorry again to everyone whose shipments I've yet to do.
 
If I just pass one subject a year and finish after 10 years I'll spend a lot on uni, but only in money
I won't have to fuck up my life because schedules and added work
 
gf takes all my time (my fault)
 
The End nice and fevery.
 
So it's really whether I want to spend my health and sanity (do it in one sem) or just money (drag it out) @r.m
 
@AndyProwl I might actually not even go to Prague for meet-the-parents :S Life sucks.
 
9:41 AM
so you're not considering to drop out actually
 
@R.MartinhoFernandes Sorry to hear that
 
I find working and studying at the same time hard
 
@R.MartinhoFernandes Enjoy but don't you dare drop out of the C++ Unicode work for a mere GF! :)
@chmod711telkitty Same here.
 
@scarlet I think that dealing with this kind of choices is get another kind of hint that maybe I shouldnt be doing that
 
@AndyProwl I'll know for sure tonight. It's either vacation or gf lands a job, so win-win, I guess.
 
9:42 AM
@R.MartinhoFernandes In case you're going, is it still 11th-14th?
 
mentally inserts missing 1 Yes.
 
I tried to go to a different school after I dropped out (two, actually). And I found it impossible to go to work in the week, go to school on Saturday and have a family and kids at the same time.
 
ouch, then I'm afraid I won't be able to pay a visit
 
I don't have kids
 
@BartekBanachewicz vOv - I've been there, it got better after the first 3 semesters basically. Better as in MUCH better - I barely do anything for uni now. Well, ok, now I'm working on my Master's thesis but that's more fun than anything else, I could choose my own topic of research.
 
9:42 AM
nor friends
 
But I have dunno my life and private study and research which is kinda important for me
 
@R.MartinhoFernandes lol sorry
 
@scarlet do you work full-time?
 
I also find building a house and doing apps at the same time nearly impossible - my mind can only be occupied with one thing and one thing only at a time. I'll be thinking about it nearly all the times - the rest times? I just want chill.
 
@BartekBanachewicz no, I occasionally do contracts
 
9:44 AM
Are you guys looking at this?
 
Cinch alert
 
@chmod711telkitty You are not a woman enough, it seems! :)
 
My job gives me food, a sense of satisfaction, allows me to buy a motorbike and dunno go for cool vacation. Uni in the meantime gives me headaches and a paper that "sometimes might let you live a better life with a good job"
 
I can handle 20% extra course load than an average uni student or even a full time job and a part time job at the same time (as long as it doesn't require thinking after work). But I can't study & work at the same time.
 
9:45 AM
I HAD A GOOD JOB AND A GOOD LIFE FOR THE LAST THREE YEARS
 
> Aubagne: Une tête de sanglier a été accrochée devant la mosquée
lol
@BartekBanachewicz Nobody put me in a potato (Portal 2 SPOILER alert)
 
then I'll just redirect you to @R.MartinhoFernandes's advice - make a decision and stick with it
 
The potato chose Cicada.
 
@BartekBanachewicz do you have your BSc. at least?
 
9:46 AM
@BartekBanachewicz Well, I think I can't help any more. It's up to you to do the weighing. You know I'm a dropout who dragged it out for eight years. I still value the first four years when I wasn't dragging it out, but dread the last four. That's where my advice comes from.
 
@BartekBanachewicz How do you still not have BSc.?
 
@BartekBanachewicz Also, women. These days, it is better to have the paper even for that! :D
 
@BartekBanachewicz maybe get that and should you choose in the future, you can finish your master's? (if you so fancy)
 
@Griwes because I failed one exam and then had to wait out a whole year to attempt it again. Then I passed and cleared out 6 semesters.
 
you only have a single attempt at an exam?
 
9:47 AM
No well it was a few ones
But I was unable to pass it then
 
we have an actual law here in Slovakia that states that you are to be given at least 2 tries
 
The "teacher" didn't want me to pass so.
 
yeah that can be a problem then
there are ways around it though
 
Or rather, didn't give a fuck and had no interest in helping me
 
there are committees
 
9:49 AM
@BartekBanachewicz I'd believe your happiness if it weren't for the fact that you can't say that without shouting
4
 
@scarl I really didn't give a fuck, I just started working full time and living a reasonable life
 
@BartekBanachewicz Do not worry. It will not last for ever.
 
most of us are aware of the current state of formal education (from first hand experience) - it sucks
 
@sehe I am shouting because uni drags behind me like a fucking shadow or dunno genetic sickness or a bank loan which constantly reminds you there's something you haven't done
 
except for I think @sehe actually didn't blame the uni per se IIRC
 
9:50 AM
@BartekBanachewicz "happiness"
 
I am happy when I forget about the uni.
 
Exactly what he meant.
 
@ScarletAmaranth I think it's the human condition. True education is something that only happens to rare individuals that run into the right mentors
 
How many semesters do you have left?
 
@BartekBanachewicz So how many courses do you have left to finish before getting a BSc.?
 
9:51 AM
7 or something
1 sem
3 months
 
So why not finish it?
 
@sehe agreed, it's all about people you meet; but this has never prevented anybody to study on one's own
 
I think Bartek is really just here to vent, not even considering dropping out. It's a stress relief thing.
 
@BartekBanachewicz Dude, that is effort that you can manage. Do it.
 
Oh, yeah, above everything, don't fucking drop out with one exam left.
6
 
9:52 AM
@BartekBanachewicz Then, like, just fucking do that.
 
RobotSorrow
 
(Hence the "make a decision now")
 
@R.MartinhoFernandes that shit is expensive, at least where I live :(
 
> Forgotten semicolons perhaps?
> Isn't that always a compile-time error? Or do you have a compelling example where leaving out a semicolon is valid but confusing?
 
@wilx I know! Although a lot of the times it's because I am always doing new things, so I am always learning and have to thinking about the things I am doing.
 
9:53 AM
^ Anyone up for the challenge?
 
@chmod711telkitty :D
 
@fredoverflow heh hehhhhh
 
@fredoverflow I would start with #define ^^
 
@fredoverflow does it have to be C++?
 
@fredoverflow The struct foo {}; vs void bar() {} distinction trips up beginners I believe.
 
9:54 AM
I can use sfinae tricks to specialise a template class if the T has a certain function right?
 
I don't understand the challenge
@thecoshman yeah
 
@fredoverflow template<typename...T> void(T......) comes to mind (but t's not actually ambiguous to the compiler). Also, not very beginner
 
@thecoshman yes, you attempt to declare the type an operation returns
 
@AndyProwl know of any articles I can read that covers this foundation stuff?
 
@sehe That's comma, not semicolon.
 
9:55 AM
@fredoverflow A type with both unary and binary op*. Too long to write, but you can have both f() * g(); and f(); * g(); be valid.
 
@thecoshman Consider writing a function template that does whatever adapting your class template can use instead.
 
@thecoshman decltype(foo(declval<fooArgT>()))
 
@thecoshman there are several SO Q&A IIRC. Perhaps seen the concrete context can help us provide guidance
(including "don't do that")
 
@R.MartinhoFernandes uu this is excellent
 
@R.MartinhoFernandes That can only occur in C++, I think.
 
9:56 AM
@ScarletAmaranth Well, assuming you have things you can multiply and indirect :)
 
@AndyProwl basically, if a class has a function like static string get_name() I want to use that, else I'd fall back to just saying "a class"
 
@LucDanton well, he wanted a case where it could potentially come into play (the semicolon shenenigans)
 
I know I could use type_id stuff, but it's mangled and ugly
 
@Puppy Missing context, so I assumed such.
 
9:57 AM
@ScarletAmaranth It’s for the benefit of beginners though.
 
@thecoshman so you have a function template that will have to call get_name() if T has get_name(), and do something else if it doesn't?
 
@fredoverflow It's not compelling, though.
 
@AndyProwl yes
 
@AndyProwl yeah
 
I figure I need to version of the function and use enable_if to control which one is used
 
9:58 AM
If we had ints as iterators that'd be it.
 
@thecoshman and you get T from where? From a function argument? Explicitly passed? or is it a template parameter of the class template your function is a member of?
 
3 mins ago, by Luc Danton
@thecoshman Consider writing a function template that does whatever adapting your class template can use instead.
@thecoshman Separate the concern of 'selecting the right thing to do' to elsewhere than the class template which is a client.
 
@AndyProwl it's a class template parameter, and this function is a member of that template class.
 

« first day (1826 days earlier)      last day (3123 days later) »