« first day (1208 days earlier)      last day (3741 days later) » 

7:00 AM
how r u?
and what's been keeping you busy lately?
 
awwww
oh
 
how's the store running?
 
@sudorm-rfTelkitty My parents have 2 dogs like this one. I want the lion though :3
 
7:05 AM
<3
 
If PHP had a garbage collector, would it have to collect itself?
 
@Borgleader lol
I can't believe I'm having to parse XML with C++
 
Cant use PugiXML?
 
Xeo
@TonyTheLion Boost.PropertyTree, whee
 
da fuq?
> Error 7 error C2512: 'std::vector' : no appropriate default constructor available
what the hell does that even mean?
I just created a std::vector<foo>
 
Xeo
well, you fucked up, obviously
:p
forgot <vector>?
 
I forgot a semicolon apparently
lol
6
 
7:49 AM
14
Q: Does temperature affect takeoff performance?

woliveirajrA few days ago, a Copa flight from Porto Alegre to Panama was delayed from noon until 12:30 AM. The company explained that the high temperature (about 40 degress Celsius) would require a longer runway for takeoff since the air was thinner, and that resulted in non-operational conditions for the w...

TIL
 
Mmmh, can’t overload a name from multiple bases?
 
You mean, overload function foo(), in C, where C inherits from A & B and who both have a function called foo?
 
Welp, this sucks.
 
Xeo
@LucDanton using
 
@Xeo Won’t help.
 
Xeo
8:02 AM
example?
 
template<typename... InjectMeSomeInterfaces>
struct foo: compute<InjectMeSomeInterfaces>::type... {};
The whole point is to ‘add’ members after the fact.
 
Xeo
oh
that sucks
 
I suppose in some cases the user can e.g. ensure that only one interface has the overloaded members.
 
Xeo
I wonder if you could make it work with manual recursive inheritance + checking for interfaces with overloads... but that sounds like a bitch to even try
 
mornin
 
8:10 AM
There’s nothing to check. You’d need the name. Which if you had, why not use a using decl?
 
Xeo
right, I guess. seems like something that would come up more often
 
-2
Q: In Visual C++ , Call A Function And Execute Rest Of The Program, Simultaneously

user3273780Parallel programming or threading, it should be for Visual C++. A function takes a large amount of time To complete, as a result the rest of the code will not be executed for ex main() { timeconsumingcode(); nextstep(); } nextstep() Will not Take Place Until timeconsumingcode() gets...

new one
 
controlling = con + tolling
what a great word! :p
 
@Borgleader dat Peer Pressure
 
JBL
Good morning !
 
8:21 AM
Sooo. I couldn't resist. Created a PaulaBean entitity in azure storage :)
@Xeo ugh
@TonyTheLion PugiXML is quite good
Nov 26 '13 at 14:40, by sehe
                pugi::xml_document doc;
                auto result = doc.load(response.body.c_str());
                logicErrAssert(result.status == pugi::status_ok);

                pugi::xpath_node_set entries = doc.select_nodes("/feed/entry/title/text()");
                for (auto const& entry : entries)
                    items.push_back(entry.node().value());
oh god
the hurt
 
user1804599
I think I have used that library before.
 
user1804599
It was a total nightmare. It is better to just embed Python and use Python to parse XML.
 
@Borgleader marked as dupe of stackoverflow.com/questions/985281/…
@rightfold lolwut. it's quite usable. As you can clearly see
 
GCC treats calling a set of non static members overloaded on const& and const&& as ambiguous :(
 
It would be great to have a xml -> cpp compiler. So you could treat an xml file as a dictionary.
 
8:33 AM
Speaking of, it seems the 60′000th bug report has been reached by now.
Eric Niebler appears to have filed that bug already.
 
@xslr ... what do you mean? something that can translate xml into a cpp source file with the same data?
 
OMG why is youtube spamming me too now?
 
like <var><type>int</type><name>myInt</name><default>666</default></var> converted to int myInt = 666;?
 
@thecoshman ew
 
I thought websites such as google & youtube never spam people ...
 
8:37 AM
@melak47 it's not my idea!!
but yes, 'ew'
 
user1804599
Storing ASTs as XML is nice.
 
this question is exactly the same as this one from 3 hours ago. Does it warrant VTC as duplicate?
 
user1804599
It is a dupe.
 
yeah but the other one doesnt seem to have a good answer
 
@Borgleader yes, he can always offer a bounty
 
8:45 AM
@Borgleader it's the SAME question, by the SAME person
he can rot in hell
 
user1804599
Downvote, close and ban.
 
@Rapptz I wonder if a drugs SE would be rejected.
 
@StackedCrooked depends... legal or 'recreational'
 
I even formatted his original question myself. Apparently he was incapable of doing it himself.
 
@thecoshman why so 'ew'?
btw, i was thinking more along the lines of car['colour'] = 'red'.
 
8:51 AM
@xslr well, using the schema you are basically putting a lot of extra work in to writing the same data. What advantage are you getting the xml.
 
The data should stay in the xml.
 
@xslr that's not xml though
@xslr what data? why should it? who said so?
 
16 mins ago, by thecoshman
@xslr ... what do you mean? something that can translate xml into a cpp source file with the same data?
 
wow, found this clever trick on reddit
template<std::size_t I>
using foo_t = typename std::tuple_element<I, decltype(foo())>::type;

foo_t<0> a;
foo_t<1> b;
 
keep the data out of cpp/h. But instead of saying pugi.blabla, you could access the xml nodes using thier own properties.
 
8:53 AM
template aliases are really powerful
 
Xeo
@StackedCrooked wut?
 
@xslr don't answer my questions with my own questions ಠ_ಠ
 
@thecoshman <car colour= 'red' />
 
@Xeo see reddit link for context
 
Xeo
oh, that makes more sense with the code in the reddit question
 
8:54 AM
@StackedCrooked Damn, that is cool.
 
@xslr do you actually want this data compiled into the source code, or just loaded at run time. Because those are very different things.
 
@thecoshman runtime.
 
@Borgleader not sure if useful, but definitely cool :)
 
@xslr so NOTHING to do with compiling at all
 
Xeo
@StackedCrooked C++14: tuple_element_t<I, decltype(foo())> :D
 
8:56 AM
@thecoshman it is a converter if you will. Because the objects will have methods/properties that are based on the structure of the xml schema.
 
@xslr ... are you just wanting to load data from a file at run time, or actually generate code at compilation time. These are two VERY different tasks.
 
@thecoshman both.
 
Xeo
@StackedCrooked yeah, tuple-as-library only works so far
 
user1804599
If you want the latter, use Perl to generate C++ code.
 
user1804599
C++ is too fucked up to add tuple unpacking.
 
user1804599
8:58 AM
The syntax would probably be as ugly as your mother so it would still not be worth it.
 
user1804599
If you want to write concise code, don’t use C++.
 
:v
 
@rightfold I want concise code.
 
user1804599
Don’t use C++.
 
I understand now. Thanks.
 
Xeo
8:59 AM
the main problem is that a single declaration does not allow unrelated declarators.
 
@rightfold what's your choice then?
 
user1804599
The right tool for the job.
 
@xslr the former, is relatively easy. I find it's easier to start with C++ code/class, and work out how to export it, then write the importer. There are already XML libraries, so the only hard bit is working out the scheme. The latter, generating code is very non trivial. There is a reason we have programming languages.
 
@Xeo I uh... is it bad if I don't understand what you say?
 
@Borgleader not if you don't admit you don't know :D
 
user1804599
9:03 AM
You can write an XML parser using Boost.Preprocessor that generates C++ code but it would be very limited.
 
user1804599
It is better to use a Turing-complete programming language to generate the code.
 
Xeo
@Borgleader basically, a single declaration needs to declare all variables with the same type (modulo pointer, reference, array, function stuff)
 
user1804599
XSLT should do fine.
 
@thecoshman i agree that it's not a simple task to translate a xml schema into c++. But the traditional method of using a XML lib to process the xml structure directly results in ugly code.
 
@rightfold it can't generate 'any' code though, can it?
 
user1804599
9:04 AM
@thecoshman the whole point of the preprocessor is code generation.
 
@xslr don't use XML to generate C++ code.
@rightfold I mean, you have to provide ~template~ snippets right... sort of like when using a template language?
 
@xslr why do you want this in the first place?
 
user1804599
@thecoshman How are you going to generate code without template snippets?
 
user1804599
clang also has template snippets internally, but in LLVM IR form instead of text.
 
@melak47 so that xml parsing in c++ is less verbose.
 
9:06 AM
@xslr it's a bit inconvenient though if to parse a file, you have to recompile :D
 
@rightfold my point, you can't just write XML and have it generate any C++ code you want. You have to provide building blocks of C++ for it to use.
 
user1804599
No shit.
 
@melak47 >_> I mean writing the code that will interface with something like pugixml. That code is ugly.
 
@xslr I think what you want is not what you are saying.
 
@Xeo Ok so the limiting factor lies in the fact that there is only one way to declare variables?
 
user1804599
9:08 AM
@xslr how about embedding Perl or interfacing with Haskell or w/e to parse the XML.
 
user1804599
It won’t be ugly that way. Only marshalling would be a pain.
 
Xeo
@Borgleader basically, yes
 
@rightfold Never interfaced with another language, but it will probably be uglier than directly interfacing with pugi.
btw, is it possible to overload [] to take in strings?
 
user1804599
Yes.
 
Then an interface like python dictionary can be implemented to walk through xml nodes and their children/properties, based on the schema. Right?
 
user1804599
9:12 AM
You have to deal with the burden of static typing.
 
Yes. It will be quirky though.
 
@rightfold oh now really, there has got to be a easy enough to use library to handle XML in C++.
 
user1804599
I would just use fork/exec to pass the XML through xsltproc and then use XSLT to transform the XML into actual parsable format. vOv
 
@rightfold what would that 'parsable format' be?
 
user1804599
Depends on what type of content you’re dealing with.
 
9:17 AM
@xslr I trust you have the C++ objects that you want to create based on the XML worked out right...
 
@thecoshman nope. I am just thinking out loud.
 
oh yeah, had a great moment at work the other day. A while ago I wrote some code that can abstract the differences between what is effectively two data sets. The same attributes in both, but what they call them would be different, or at least, when I wrote it, that was the plan. It turns out when this second scheme came along, it had no differences, so someone removed that abstraction I had. Welp, the other day, someone had to go and fix a bug introduced because of a difference between schemes
@xslr well, like I said. The way I would do such things, is first write your C++ class 'foo' you want to have, make sure you can read all the data you want to save, and set all the data you want to load. Then create a second class that can take a 'foo' and return a string for the XML (or what ever serialised format you want) of that object. Then write the reverse function, take that string and return a foo.
Try to keep the class focused on what they do. You main 'foo' class should be messing around with serialisation, xml, file writing nonsense.
 
@thecoshman Good idea. In a recent project, I had to implement a few HMIs whose description was in XML documents. And the cpp code ended up being rather long winded. Partly because I merged the xml handling and HMI loading into one class.
But what if the 'foo' class can be autogenerated based on the schema. It is a boring piece of code to write, afterall.
 
@xslr separation of concerns is very important. Yes it can seem easier in the short term to add just one more function to a class to handle doing this one small additional task, but it is NEVER one more function. You have to be strict with it, even it seems like more work in the short term.
 
newb mistake 101
 
9:31 AM
@xslr firstly, your schema would have to very strict into to allow you properly generate C++ class based on it. You also have to keep in mind what the rest of your code is going to do. How can you write code to access that data, if it doesn't know what that data is?
 
How does the rest of the code know that you are going to load an object that is going to end up being of type 'car' and have a field it can read called 'colour' that is going to return another object of type 'rgbColor' that has three fields each of type int?
@melak47 oh that is nice. The saving the data into the URL is a nice enough feature too.
 
177
A: What XML parser should I use in C++?

Nicol BolasJust like with standard library containers, what library you should use depends on your needs. Here's a convenient flowchart: So the first question is this: What do you need? I Need Full XML Compliance OK, so you need to process XML. Not toy XML, real XML. You need to be able to read and wri...

 
@thecoshman I can define a mapping between schema names and class member names. A class declaration can then be generated based on the schema and the name mapping rules. This declaration can be included by consumers of the xml document.
 
@R.MartinhoFernandes morning. Did you fix the AVs? because I'm not getting any
 
9:41 AM
Yes.
 
Obviously
 
@R.MartinhoFernandes nice chart
 
@StackedCrooked were you the one looking for xml parsurs?
 
Ah. Yes. No?
 
cpx
9:43 AM
How do I find a string in vector<char>? Possible?
 
@cpx you will only find chars.
 
@xslr I'm sorry... you've lost me here. Frankly, if you are just throwing hypothetical scenarios around, it's hard to really say much to help you.
 
cpx
Unless I check all the chars in sequence
 
@cpx find the first char, find the next char from there, etc :p
 
cpx
Ah yes
 
9:44 AM
@cpx vec.data() will return const char*
 
cpx
Nice.
 
string(vec.data()).find :D
 
cpx
xD
 
Godaamit guys
 
what? :c
 
9:45 AM
std::search
 
@thecoshman oh sorry about that. I think I'll try and implement something and see if it works out ^^
 
@cpx don't try this with any other standard container
@R.MartinhoFernandes TIL about std::search
 
cpx
std::search to check a range.
 
std::search would actually work with non-contiguous containers
 
I am 90% sure she failed me because she's a fucking dumb bitch
 
9:49 AM
aww, need a hug?
 
Now I won't be able to get my degree in time
It's ok, I mean, fuckers everywhere
 
@BartekBanachewicz why do you need it urgently?
 
Well to get out of here ASAP
 
out of your country?
 
Out of my uni
My country isn't that bad
Anyway
I can waste another year and something
Or end this BS now
Basically BSc is "bullshit completed"
 
9:52 AM
maybe you can be best friend with Cat++ or something
then you can complain about uni together
hahaha
 
Going to that university was the worst decision of my life by far.
 
Don't worry. You have plenty of time to make worse decisions.
Wait, that's not gonna cheer you up.
 
JBL
That wasn't a bad decision, how could you've known ?
That would've been bad if you knew it would actually end badly :P
 
what matters most is that you got the degree
 

« first day (1208 days earlier)      last day (3741 days later) »