« first day (1579 days earlier)      last day (3385 days later) » 

6:02 AM
I was coding some structures for a var generic type in C++ while listening to Sonic the Hedgehog's Marble Zone track, in fact, the code for the var datatype worked pretty good, in fact, but a question came to my mind.
By chance, can memory replication be achieved in C++? I'm talking about a generic expandable object. javascript enables you to do var obj = []; and later add methods and variables. How can we get the "reflection" of that object? Has anyone achieved something similar?
JSON and msgpack formats allow to pack data into a string via serialization and I've seen serialization in Boost but, is it expensive?
 
Hi guys, please take a look at my question. Need help for this. stackoverflow.com/questions/28437237/…
 
@JoelSeah Well you've already posted that in Stack Overflow , so there's a good chance most of the people on this room already saw your post. Linking here is redundant at best.
 
6:53 AM
 
@JerryCoffin lol @ jerry_coffin_method()
 
In my experience a reboot usually resolves the issue, but if there's a persistent problem it's worth checking for a patch using Windows Update. Not sure why being in an airplane would make a difference. — user777 9 hours ago
lol
(see full question for context)
 
@MarkGarcia But....I'm running Linux!
 
@MarkGarcia lol
 
@JerryCoffin You Lunitix!
 
7:27 AM
@Rapptz I attended an HIV party like that once
 
8:16 AM
> I need to invoke Mymethod. please provide correct code sample
-11
Q: How to invoke method with parameters using reflection in C#.net?

WellaSystem.Reflection.Assembly AssemblyName = System.Reflection.Assembly.LoadFrom("myAssembly"); object AssemblyObject = AssemblyName.CreateInstance("className"); AssemblyObject.Mymethod(para1,para2); I need to invoke Mymethod. please provide correct code sample

-11 in the blink of an eye
 
wow, only 3 minutes
 
The hero that stackoverflow deserves.
 
A dynamic and self-motivated software developer with 2 years success devising innovative and tailored solutions to meet ever changing requirements within diverse industries should have no problem solving this, or know how to find an answer. — Willem van Rumpt 3 mins ago
ouch
 
@Mysticial Lol the question isn't as terrible as others.
Must be a bad day.
 
Well, he lists "Java Scripts" as one of his specialties. I Java Scripts too.
 
8:23 AM
lol @ flag!
 
lol
 
@AMostMajestuousCapybara lol @ profile.
 
> Graduated in Computer Science & Technology, having adequate competence to work in the industry and possessing excellent analytical skills required to maintain a successful career.
 
That's -30 rep.
 
@Rapptz I think it's copy-pasta from a job requirement.
 
8:24 AM
Definitely.
 
Made me giggle
Very nice
He also got a top kek website
 
@Rerito Oh please don't I am trying not to click it!
 
@MarkGarcia There is nothing there.
 
Under Constructions !!!
 
8:27 AM
> !!!
He got one step closer to the question ban
 
user1804599
> CPython implementation detail: While a list is being sorted, the effect of attempting to mutate, or even inspect, the list is undefined.
 
user1804599
lol, so it's UB in CPython
 
user1804599
as an implementation detail
 
Not sure anywhere it would be safe to read an object that is being written to.
 
lol.. The kernel handles scroll bar events? o.o
 
yeah I was a bit surprised over that too
> After some work we managed to create a reliable exploit for all versions of Windows – dating back as of Windows XP to Windows 10 preview (With SMEP and protections turned on).
Apparently they moved GUI to the kernel in Windows 2000?
 
To think that software security are just a bunch of if statements piled up upon one another is frightening.
 
> scrollbar handling
> kernel mode
 
user1804599
Does this also work for related bindings such as <c-w>k? — райтфолд 12 secs ago
 
user1804599
8:56 AM
help
 
It got patched though so that's good.
 
But it's scary
 
RIP
 
Makes you wonder what is yet to be discovered
Why did they rank it only "IMPORTANT" though?
Oh, their definition seems fair.
 
@AMostMajestuousCapybara It's the highest IIRC.
 
9:00 AM
@Rapptz I wonder if is still affects Windows Server 2012 with no GUI.
 
They fixed 3 CRITICAL ones.
Wonder what those were.
 
> Java Scripts, VB Scripts
 
@AMostMajestuousCapybara Ah yes, remote code execution is the highest. Elevation of privilege is next.
 
@BartekBanachewicz I know, right?!
 
@wilx Gay muslim left-wing dinosaurs.
 
Why are you on mumsnet
Isn't that the site that spawned that dumb 'tendies' and 'good boy points' shit?
 
@Rapptz I got the link from my G+ feed via Richard Dawkins Foundation for Reason and Science.
 
@Rapptz Wasn't it 4chan?
 
9:04 AM
@MarkGarcia No.
The /r9k/ board was parodying a post on there.
 
@wilx It's an obvious troll, frankly
 
@AMostMajestuousCapybara I am not so sure, unfortunately.
 
@wilx Why are you on G+
:P
 
@wilx It is well crafted.
 
9:06 AM
Mumsnet is full of trolls.
 
@MarkGarcia Because it is not Facebook.
I am not Facebook as well, though.
 
Exhibit B above.
 
> How do we even know the Tyrannosaur's name if it was around so long ago?
Nice
 
hi , beginner here , what does this do in bash script ? php -r
3
 
> flags is a combination of the git_diff_option_t values above
there are no values above ffs
 
GRAGWGH libgit you piece of shit
 
@AMostMajestuousCapybara Thx
 
fucking VS2013 and his shitty autoformat
 
uh seriously why is python so goddamn slow
 
browsing libstdc++ code on the gcc source tree is a pain
 
@BartekBanachewicz ~ease of use~
 
hmm
seems that C++/CLI is too dumb to even resolve access specifiers statically.
 
std::ios_base::Init is complicated as fuck
 
@Rapptz ya
 
Ell
Fuck I forgot how to tie a windsor
 
9:30 AM
 
TIL that is called a windsor
 
Ell
Its k, got it now
 
French spotted (zee sounds)
 
Gay spotted (french)
 
Anyhow, he's handsome
 
9:35 AM
I'd fuck him
What do you think @райтфолд
 
@AMostMajestuousCapybara lolplease
 
@BartekBanachewicz Did you notice the squiggles of sarcasm
 
ahmm Jedi Outcast added to Humble Bundle
I think I have that one already, but who cares
good game is a good game
 
Xeo
@Rapptz Why do you do it, then? :P
 
iunno
How do you guys deal with those pesky global init functions in C libraries?
I keep running into these.
 
Xeo
9:45 AM
I don't
 
init_library() and then cleanup_library() is annoying
:(
 
wrap in some object
 
I've done that before.
 
or when there's stuff like begin() ... end() I wrap in an object that takes a lambda
that's about it
 
A stupid init class.
But I can't do it in this case I think.
reference counting seems dumb though
annoying
 
Xeo
9:51 AM
Just init libraries at the start of main, and destroy at the end? I don't quite see the problem, unless you want to also use the library before main
 
I'm wrapping it + not all platforms need the init call.
 
@Rapptz scope_exit?
 
atexit
I forgot a semicolon somewhere and now I have 323 errors.
 
-ferror-limit is your friend
 
@AMostMajestuousCapybara lol, compilers should have a 'give up now' count to cut down on error log size:)
 
9:55 AM
Using a compiler that defaults that to 20 is your friend.
 
I forgot a comma once and I got 16 MB of errors.
@Griwes Pressing F4 just redirects me to the first error anyway.
 
@MartinJames there is something like that
 
@MartinJames They do
 
I go as far as using GHCiD often
 
Also nvm it was a }
 
9:57 AM
this is a live rebuild daemon that displays the first error in a refreshing window
 
you can like ... shrink the error log window if that makes you feel better
 
simple and effective
 
Ell
I'm an hour and a half early :3
Time to prep
 
@BartekBanachewicz oh. that's neat
 
std::map<Item,int,bool(*)(Item*,Item*)> test_map(Item::CompareLess);
Is this the only way to pass a static member function as a comparator to std::map? its so ugly:
 
10:00 AM
@AMostMajestuousCapybara Then is should default to something other than 'fill disk with one line that actually indicates the error and 16MB of resultant gunge' :) Same with linkers.
 
Ell
std::map<Item, int, decltype(myfunk)>
 
oh yeah! bless c++11
though... if you think about it, shouldn't you be able to get away without specifying the type
like, for std::map<X,Y> isn't the only valid signature for the comparator 'bool compare(X const &a, X const &b)'
 
@MartinJames High expectactions I see
 
@AMostMajestuousCapybara Well, I can dream :)
 
template<typename A, typename B, typename Func> auto make_me_a_map(Func && f) { return std::map<A, B, Func>{ std::forward<Func>(func); }; } or something
Remember, every problem can be solved by adding another level of indirection. :P
 
10:06 AM
> IN the UNITED STATES, BLUE IS ALWAYS BLUE, BY DEFNITION, you idiotic twat.
 
@Ell std::map<Item, int, decltype(&Class::StaticMemberFunc)>
 
Ell
Sure that
Man seriously how do people walk anywhere in a suit
I hope my ears, hands and face can remove all of this excess heat
 
user1804599
@Rapptz TIL typedef T A, B;
 
> Unexpected Behavior of Prolog program
inb4 "it actually works"
 
user1804599
I also run when I notice UB.
 
user1804599
 
@R.MartinhoFernandes lol
@ÓlafurWaage iz you drunk
Strong typedefs and "semantic errors" is a very interesting topic to discuss, but I think you went kinda overboard with unifying those
 
in particular, there's nothing inherently more "semantic" about an error you get from a strong typedef compared to any other type error
 
Yes, there is?
 
@AMostMajestuousCapybara elaborate, please
let's talk an example of "Any (untyped) -> Number -> Linear Velocity"
 
10:24 AM
A type error is more valuable than a runtime error
 
@AMostMajestuousCapybara yes.
 
@райтфолд Well, typedef is just an annotation of a declaration.
 
@BartekBanachewicz Then that goes against your statement above of "there's nothing inherently more "semantic" about an error you get from a strong typedef compared to any other type error"
 
typedef int * a, b; <3
 
@AMostMajestuousCapybara "compared to any other type error"
 
10:25 AM
oh
my brain inserted "of"
:D apologies
Why is it allowed to declare a virtual method in a final class
 
Ell
Overridden virtual methods can still be declared virtual I guess
 
2
Q: How do I use a debugger to fix my C++ code?

sashoalm This is intended to be a Canonical Question for C++ debugging questions where the problem seems to be that OP doesn't know what a debugger is or how to use one. For the meta discussion, see Canonical question for "How do I use a debugger to debug my C++ code?". Please use it to mark questions ...

 
user1804599
@Feeds ugh
 
I'm done, type erasure can't be achieved with the current standard. Not even anonymous structs with static declarations, sigsegv, not even anonymous lambdas, it can't be done, I even tried storing memory address, pointing to it, try retrieve datatype with decltype it doesn't work either.
 
@Ell But what's the point?
 
user1804599
10:38 AM
@VictorLopez use virtual
 
user1804599
the compiler does all that shit for you
 
user1804599
don't write C
 
@Feeds gh
@VictorLopez what
lol, "can't be achieved"
you mean "I can't achieve it"
 
user1804599
> Debugging requires you to use a tool known as a Debugger.
 
user1804599
lol
 
10:42 AM
Factually correct.
 
user1804599
No.
 
user1804599
It's bullshit.
 
^
unless you're the tool
 
Ell
@AMostMajestuousCapybara there is no point
What's the point in disallowing it?
 
user1804599
> (by extension, slang, pejorative) An obnoxious or uptight person.
He won't sell us tickets because it's 3:01, and they went off sale at 3. That guy's such a tool.
 
Ell
10:44 AM
Its an additional exception which doesn't have any side effects
@VictorLopez type erasure can certainly be achieved
 
@Ell It can't, you all are crazy.
 
std::function would like a word with you
 
also std::shared_ptr
 
also boost::any
 
user1804599
boost::none :D
 
user1804599
10:49 AM
boost::all
 
I really try to make small commits but sometimes I get carried away somehow
 
@Feeds Gosh, a list of YouTube tutorials.
 
The Grumman F11F/F-11 Tiger was the first supersonic, single-seat carrier-based United States Navy fighter aircraft in operation during the 1950s and 1960s. Originally designated the F11F Tiger in April 1955 under the pre-1962 Navy designation system, it was redesignated as F-11 Tiger under the 1962 United States Tri-Service aircraft designation system. The F11F/F-11 was used by the Blue Angels flight team from 1957–1969. Grumman Aircraft Corporation made about 200 Tigers, with the last aircraft being delivered to the U.S. Navy on 23 January 1959. == Design and development == The F11F (F-11) Tiger...
ahahhaa lol
this is great
 
:( I think I'll stick with having a get<type>(). Why would you even want to have mutable objects? Real men code C++.
 
@VictorLopez what
 
11:05 AM
I have a class, the class is called var, and it achieves good for primitive data types, it holds a pointer to a class (placeholder), then, the data is stored in a derived template class from placeholder, call it, holder<DataType>(value). But when you want to retrieve the data with
operator ValueType() const {
}

it then needs to
auto* container = std::dynamic_pointer_cast<holder<decltype(type)> >(content);

But you can't access the type from content since it is a pointer from base class and derived is the only that has the <DataType> stored variable. If you cast with a wrong datatype then t
 
Ell
What do you want to achieve?
 
@Ell javascript-like vars.
 
Ell
Okay
You want a class Var that holds a std::map<string, Var>
It should have Var operator [](string)
It should have template<class... ArgTs>Var operator()(ArgTs&&... arcs)
It should have similar overloaded operators
Then you need some way of defining behaviour for primitive types
Hmm maybe there should be some inheritance or something also maybe. Who knows.
I'll implement it in two days time vOv
 
A Most, Puppy, I'm reading about those with using voidFoo = void(*)(std::shared_ptr<void>), reinterpret_cast and make_shared.
@Ell For the [] map, that's for the field methods and variables. I saw Jules JUCE code for the Var class, it is the same as you're saying.
 
user1804599
far far away
 
11:17 AM
0
A: Proposal for canonical question: "How do I use a debugger to debug my C++ code?"

R. Martinho FernandesIn general I'm not opposed to this idea. I've told many people to learn some debugging before coming back to the site with yet another question to be closed. Having somewhere I can bring them to that explains what that "debugging" thing is would be nice. I don't like this incarnation of it, thou...

@VictorLopez That's dynamic typing, not type erasure.
 
ho boy
opening a VC6 project
 
@VictorLopez why
 
@R.MartinhoFernandes That's what I'm reading right now.
 
@R.MartinhoFernandes actually markdown-like thing for videos sounds funny
imagine if the video of screencast was a script
so you scripted ui actions and recorded them automatically
that way you can easily branch for new UI versions and whatnot
 
@BartekBanachewicz I have a small lib that loads data from the user as JSON or MsgPack, since the data may contain multiple fields I'm thinking about a var object to retrieve each field. There are some implementations but I can't find one in which Boost is not required.
 
11:29 AM
Accessing JSON data is a known problem.
Have you looked at the existing solutions?
 
Ell
@BartekBanachewicz that'd be handy
The script screencast thing
 
@Ell I think that's what I'll be doing.
 
Xeo
Sigh. Why does UE have to duplicate stdlib stuff, and then not even make it compatible...
 
@Xeo #gamedev
 
Xeo
Oh look, they do have begin/end, but only... as private, to allow range-for usage.
 
11:38 AM
is range-for implicitly friend of any type o.O ?!
 
@Ell probably complicated though
 
Xeo
@sehe nah, they make it a friend, with the disclaimer "DO NOT USE DIRECTLY"
wait, why the heck do they put it under private as a friend
 
lol
@Xeo I do that often, really.
 
Xeo
The private doesn't have any influence on the friend declaration, or does it?
 
Ell
It doesn't does it?
 
11:41 AM
No.
 
I've been rumbled: '@MartinJames didn't ask for your input. what is your problem. do you just sit behind your computer all day and attack people on stack over flow. ffs'
 
oooh and three-phase init
10
constructor, Init(), and FinalConstruct()
 
Xeo
wow
where's that
 
a Microsoft sample
 
@Puppy Wow! I've never managed to get that in any of my code. I must be slipping.
 
11:50 AM
@Puppy uh oh
 
I've got some classes with a 'Startup' method as well as ctor, but never got to 3-phase:)
 
it's the kind of code where every method body locks, even if it's return E_FAIL;.
seriously, they lock to return a constant.
 
@Puppy lol
 
@MartinJames is there a shred of truth :)
 
11:53 AM
> Edit: I see there are 5 people who think the question should be closed. That's to be expected, the topic is controversial. I've cast my reopen vote, and let's see if 2 others can be found who agree with me that the site needs such a question.
> reopen (1)
heh
 
@sehe Some might say that. I couldn't possibly comment.
 
@MartinJames linkage?
 
1
A: fork() bomb explanation in terms of processes?

StenSoft How does it work in terms of processes? It creates so many processes that the system is not able to create any more. Do children keep being produced and then replicating themselves? Yes, fork in the name means replication. is the only way to get out of it is by rebooting the system...

 
My copy of C++ Primer 5e actually claims that signed char c = 256; is UB O_o
 
@CaptainGiraffe Have you ever taught C++?
 
11:57 AM
@T.C. Is it?
 
@milleniumbug No!
 
Well, it certainly overflows char. And signed overflow is UB.
 
@T.C. Because it is?
 
there's also SESE and CorruptMemoryIfPossible() calls.
 
Well, certainly not everywhere, but it's not a completely bollocks claim.
 
11:59 AM
@R.MartinhoFernandes No it isn't, the conversion is implementation-defined.
[conv.integral]/p3
 
user1804599
lol
 

« first day (1579 days earlier)      last day (3385 days later) »