« first day (1597 days earlier)      last day (3577 days later) » 

20:00
@Theorem Post it on ideone or coliru
pastie.org/9992070 @jPlatte can you check whats wrong in my code if you have time .
no
Yeah, the formatting :P
@Theorem What do you think if(m=1,m=2) does?
joke aside, you should say what you expect it do it
20:02
-1
A: What's the error within this code?

Vlad from MoscowThe MS VC++ 2010 does not support standard syntax for the range based for loop. But it supports the following syntax: for each (auto x in s) if(isdigit(x)) temp+=x;

wtf
is the guy trolling?
@milleniumbug i meant that if my cin = 1 or cin =2 then it immediately tells me that the number is prime .
@jPlatte I am expecting it to give me all the prime numbers less than 'm' .
I realise you've been off Stack Overflow for a while, but you appear to have forgotten all your C++ syntax whilst away! Please have a quick flick through your C++ book to get reacquainted with the language now that you're back. Cheers & hth.! — Lightness Races in Orbit just now
@rubenvb With his reputation, that seems rather unlikely. Weird ^^
@Theorem if (num == 1 || num == 2)
@jPlatte Yeah, high-rep users never troll. QED
20:04
@LightnessRacesinOrbit lol
@rubenvb there's a horrible MSVC extension called "for each", but I don't know the exact syntax
Just unlocked my phone's bootloader and I am now on KitKat :-D
thing is, he could be right
@Blob Got it , but one confusion is what if i use only one "=" .
20:04
@LightnessRacesinOrbit what if it does support it
@Theorem = is the assignment operator. It does not check for equality.
@Theorem Your C++ book should mention it.
@LucDanton oh my. this might just be the reason... :(
if (a = 1) means: assign 1 to a. then a's value (1), is checked by the if. if (1). that's always true.
@Blob Thanks a lot . I read a lot but didn't notice that at all .
20:06
@LightnessRacesinOrbit
@rubenvb nope
@Blob I will write down short notes on the side of the codes to explain what i am expecting , please have a look when u have time .
@jPlatte welcome you too
@Blob doesn't g++ normally warn you about assignments without an extra set of parantheses in if / else if statements? Because I compiled @Theorem 's code with -Wall -Wextra -pedantic and got not a single error message.
Oh, wow it does warn you without the comma, e.g. if(m=1) or if(m=2)
I like the "don't feel bad" ... "do feel bad about..." setup :) stackoverflow.com/a/28798416/85371
@jPlatte side effects in comma operators are really common (in fact, it's the only remotely useful purpose beside expression templates). It avoids braces! Yay
@jPlatte Is that a real pic in your avatar?
I can't resist asking as it strikes me that the picture seems like it could be taken from a 1979 television series or so, when your age is 18 :) I wonder whether this is just the pose + hairdo + instagram filter :)
Uhm yeah that picture is real
20:13
(don't worry, I'm just amused, people with remarkable hair are held in the highest regard in the c++ community)
And I am still only 18, in that picture I was probably 17 still ^^
And I do not use instagram or image filters in general xD
@jPlatte Nice to meet :)
@jPlatte As you might have gathered I was laying it on thick to avoid being taken too seriously
20:15
You see. Lightness can't read my messages. It appears I'm too offensive for his delicate sensibilities.
Huh, what? :D
Just thought I'd clarify the possibly odd responses he's giving in this conversation.
You mean, he can use the chat but didn't read your messages since a while or what? :D
user1804599
I'm seeking a way to simulate stackful coroutines in an environment that doesn't have them.
Hello?...
20:17
* get your messages
Can anyone say...
*GUI?
user1804599
I am thinking of transforming the entire program into a giant switch statement and using an array to represent the call stacks.
@райтфолд hehe. When you're basically drowning in VMs of your own invention, surely you can swap a stack or two
@jPlatte Indeed. You can ignore users that annoy you. (Click profile image "hide posts everywhere").
Inb4 plonks me :)
user1804599
Another option is using continuation-passing style for all function calls. However, this requires guaranteed tail-call optimisation whereas the platform I target guarantees a lack of TCO.
user1804599
seriously skullrape javascript
20:19
@sehe Oohhh he blocked you, I was confused there for a minute ^^
*GUI
Seems I managed
@sehe Okay then, what's the most flexible GUI solution for C++ cross platform?
@jPlatte Yeah. It's a sad state of affairs. I'm not sure whether it is for the best.
@Cinch Qt (well, beyond terminal :))
@sehe (is it free?)
Cinch: Did you never hear about Qt before? :O
20:20
@Cinch It is. It's not libre, so you have to link, accredit. But with a commercial license you can do whatever you want
@jPlatte Of course I've heard about Qt
user1804599
however
I've just never gone with Qt because it tries to dye you its color
user1804599
when I can guarantee a function does no context switches, the function can be optimised out of the switch statement
user3010322
Why not Crazy Eddie's GUI. :3c
20:21
@ThePhD No mobile, no mas
@Cinch It does? :)
user3010322
There it is.
Okay, I always expected it to be libre, because it's an open source project that's used by a lot of people who identify with the idea of free software...
user3010322
I've done it.
user3010322
sol compiles and works in g++ and VC++
20:22
Well, one reason more to use gtkmm :)
lol "too offensive for his delicate sensibilities"
user3010322
No idea about clang but that's not my business! \o/
that's a funny way of rephrasing "doesn't have time for my moronic shit"
@sehe Something like that. I kind of went away from it because it had it's own special IDE which give me bad thoughts
@Cinch Frankly I've not seen a GUI framework that doesn't intrude. And perhaps a truly "generic", modern C++ library to do so would be ridiculed if it existed
20:22
@ThePhD OMG YOU USE SOL?
yay
Just look at the "ermagad Boost is so bloated" crowd
I drink Sol sometimes
user3010322
@Cinch ... Wat.
@sehe But Boost is modular so it's not that bad
@Cinch Hah. you must hate F# for similar reasons?
@Cinch cough
20:23
@sehe I don't even know what F# is
@sehe Have you used gtkmm before? I think it's quite modern in comparison to Qt (I haven't used that, but seen some example code)
@ThePhD Yeah the Lua binding right?
@jPlatte Personally I don't think that's so bad indeed.
user3010322
@Cinch Yes.
@jPlatte Qt5 is catching up
@Cinch double cough then
20:24
@sehe Are they moving away from macros?
That too AFAICT (I'm not using Qt)
That's the thing that bugged me the most about the Qt code I saw
user3010322
QMake bugs me the most.
user3010322
Generating code behind my back. D:<
@LightnessRacesinOrbit hi
20:24
Also what is CMake and why is it better than make?
I bet answers to that exist on the web
@ThePhD Yeah, I really like Rapplz's binding. It's so easy to do
user3010322
/cc @Rapptz
@ThePhD Does one have to use QMake when writing Qt apps (or, is it a major PITA to use a different build system)?
user3010322
@Cinch Well, soon enough (if you use the bleeding edge of VC++), you should be able to use sol with Visual C++ too.
20:26
@ThePhD I don't care for Microsoft
And therefore I kind of just ignore MSVC
user3010322
Smart choice.
user3010322
I'm stuck here forever. ;~;
@jPlatte I think it's not really about the build system, right. It's more like a project definition system that does the Qt specifics AFAICT. Again, I don't really use it.
user3010322
Or at least, until I get my OpenGl bindings off the ground.
20:26
I did see a toolless replacement for MOC once on a Qt blog, I believe
@ThePhD lol OpenGL i'll learn that when i have the brainpower and time
What are you working on?
glNext is coming
user3010322
Doom 'n' gloom.
i might try to learn it this summer
user3010322
None of my DirectX / OpenGL projects are going to manifest soon.
user3010322
20:27
I'm too busy trying to make a proper GDB debugger for VS 2015.
user3010322
And doing machine learning.
user3010322
And having to tend to the occasional timesink of a class's homework assignments.
Kay peeps. Imma have fun offline tonight. Be nice and sleep well
user3010322
And learning vim, because GOD HELP ME IF HE FINDS OUT I USED NANO TO DO THE EXAM.
nanononon can't have that
user3010322
20:28
And learning vi*
user3010322
Because vim is also "too high level".
@ThePhD lol vi
@ThePhD i'm in exactly the opposite situation
teacher tells class to use nano, i use vim
Ugh, vi...
vi is probably best if you're working with embedded or linux
20:29
Why is that thing even in Arch Linux base :D
@Cinch
user3010322
Vim is neat. I need to find out the thing that puts it permanent Insert mode, though.
@Cinch why not vim or nano?
user3010322
Because really, for exams and the like I don't need it in edit mode.
vi is more likely to be vim in compatible mode rather than actual vi
user3010322
Or command mode.
user3010322
20:30
Or w/e it's called.
have i whined about how my school's computers don't have "vim", but have "vi" which opens Vim in vi-compatible mode?
:set insertmode
@ThePhD You don't want that. It's called insert mode, but you don't want that. It defeats the whole purpose of modes. If you don't want to have modes, don't use vim
@CatPlusPlus ik. some dude just built vim from source.
vi is best for being mr.general
vim is best for linux
emacs i don't know about
20:31
@CatPlusPlus in arch, vi is vi, and vim has its own package (which isn't in the base group)
notepad++ and geany is great
ideone.com/fmyuzc @jPlatte can you tell me whats wrong because i am getting every digit twice . :(
sublime costs money
Eclipse sucks for C/C++
user3010322
@jPlatte I always want insert mode, because for the exams and work I do I spend most time writing and making code, not necessarily editing bunches.
@Cinch i thought all it cost was a few clicks when trying to save?
20:32
@ThePhD Then don't use vi
@Theorem You really don't have to ask specific people for help, someone will read your questions :D
But I'll have a look at it :)
user3010322
@Cinch It doesn't mean I WON'T use command mode, it just means I want to default to insertmode.
@Cinch spf13-vim and Atom are nice alternatives :)
@jPlatte Arch is also shit so there's that
suppose i'd best get moving. it's either sit here playing halo hungry all night or go to the pub. only two options. for some reason
cyaaa
20:33
@Theorem Please fix your formatting though
@jPlatte So tell me why I should use anything else besides vi/vim, Geany/Notepad++, and maybe Code::Blocks/Eclipse/Sublime
user3010322
@CatPlusPlus Uh. How do I get out once I do that. x.x;
:help 'insertmode'
user3010322
I can't insert commands anymore. x_x
@jPlatte thanks
user3010322
20:34
And I can't ESC out either
@Cinch Why you should use something else? Well, if you're satisfied with them, use them...
@jPlatte k
Ctrl+O goes into normal mode
@jPlatte :)
: from normal goes into command mode
insertmode is dumb anyway because navigation is easier in normal
user1804599
20:35
I'll generate code like this: jsfiddle.net/wao8mce1
@CatPlusPlus Why are we arguing about vi?
user1804599
STACKFUL COROUTINES <3
Nobody is arguing about vi
user3010322
Yaay
also lol shitclipse
user3010322
20:35
My Vim is im permanent insert mode. <3
@ThePhD why would you want to do that
@ThePhD alias vim='nano'?
@ThePhD defeats the purpose of vi
user3010322
Okay, let me rephrase: it STARTS it Insert mode.
user3010322
Jesus. x.x
user3010322
20:37
I need to spend a day pimping out my Vim.
and you never switch out
Still better than Emacs-style modifier combos
might as well alias vim='nano'
user3010322
So I can have the command buffer down below
hm...
user3010322
20:37
And the text buffer up above
user3010322
And maybe 1 or 2 lines at the bottom for extra information
@Theorem What was the purpose of that thing again? My brain hurts trying to make sense of that double-loop. At least I can reproduce the number pairs though...
user3010322
Sweet deals!
@jPlatte The purpose was to produce all the prime numbers less than 'm'.
user3010322
Auto-insert-mode everywhere.
20:42
@Theorem Oooh okay
I don't get one thing though.
Why in the OpenID flow, I ask for 1 access token, and then use that one to get the data? Why can't I just get the data immediately?
@Theorem Well I can immediately think of a comprehensible way of accomplishing the overall goal, but I can't get my head around that double loop..
And I apparently have no clue how to print local variables in gdb :D
Like I redirect the user to "<url that defines the scope and all I need from the user>", and I get the authenticated data.
What is the best way to add Unicode support to C++03?
@Rapptz HI!
20:49
Hi
@Cinch robot has a library I think
C++11.
user1804599
Fuck it.
oh, ok, nevermind
user1804599
I'll go with CPS for all non-optimised function calls.
@Jefffrey ogonek? I dont think its ready for use yet
user1804599
20:50
And randomly insert yields to not blow the callstack until JavaScript allows TCO.
@Rapptz I don't have C++11 in my sights right now because I'm not ready for it
Still learning C++03
@Cinch One possible option would be using glibmm. It has a ustring class that provides exactly that. It's not a lightweight dependency though (if you're not already dependent on glib through other things like Qt or gtkmm).
@Cinch But C++11 is ready for you
@Cinch I agree with @Jefffrey :D
It's not a completely seperate language
@Cinch The problem with that is that you need to drop a lot of C++03 to learn C++11.
20:51
@jPlatte It most definitely is
there's little purpose in learning C++03 and then 11, just go straight to 11.
@jPlatte Feels like it.
@Puppy My compiler is set for C++11 but I don't want to make use of features I don't understand and then be helpless if I can't even compile it on a platform that doesn't work with C++11 in some places (i.e. default JNI)
and I feel like I don't understand C++11; I.E. I've only understood smart pointer's implementation recently because I've learned about how encapsulation works in the wild
user1804599
let clicks = channelFromEventTarget(button, "click");
spawn(sub { for click in clicks { alert("hi") } });
user1804599
very nice
20:53
@Cinch Screw the implementation. You don't need to know that.
ultimately, it's a question of "Do you want to learn C++" or "Do you want to target JNI", because they are totally different things.
@Puppy I want to be able to know C++ inside and out
You're never going to know it inside and out.
Not C++03, not C++11, not anything.
Especially not SFINAE :>
@jPlatte Well I still don't know it well enough to make code like you do
SFINAE is simple
IMO anyway
20:56
@Cinch Then start with 11 or 14 and downgrade only if you have to.
there's nothing more fundamental about manual functors compared to lambdas.
SFINAE looks really crazy syntax-wise, at the very least
@Rapptz It’s harder in C++03 anyway!
Lol yeah it is.
And the whole concept is weird. I'm so waiting for Concepts to become available :D
user3010322
Ugh, C++03's enable_if
20:57
I forgot how much simpler C++11 SFINAE is.
@Puppy Is C++11 standard yet (i.e. why did Google not use it for such a long time)
user3010322
I had to work on a codebase that EXPRESSIVELY FORBID C++11
@jPlatte SFINAE applies for something such as template<typename Item> auto foo(Item& item) -> decltype( item.bar() ) { return item.bar(); }
user3010322
So I was using std::tr1::unordered_map
@Cinch lol Google
user3010322
20:57
And my SFINAE looked like PISS.
@jPlatte Don't think so.
@Cinch Google don't use it because Google's C++ objective is to be maximally compatible with their C89, so they've thrown out basically every useful C++ feature.
@Cinch "to code like you do"? Have you read anything I've coded?
@Cinch C++11 was standardized in... drumroll 2011
Jul 25 '14 at 11:33, by Puppy
"Don't be evil" -> publishes Google C++ Style Guide
20:58
@jPlatte no. i don't think i've seen you before
@Cinch C++11 has been standard for 4 years.
The cool kids are already using C++14!
@Cinch Then why did you write that? :D
@Rapptz As if. -std=c++1z please!
Google's C++ style guide is good for exactly one thing- Google.
and even then, it's questionable.
if you're not working at Google, the best thing you can do is burn it with fire and tell everybody you meet to do the same
@jPlatte ah shit wrong person
20:59
Haha, okay
user1804599
who's this jPlatte guy? never seen him before!
user1804599
I'm scared!

« first day (1597 days earlier)      last day (3577 days later) »