« first day (1491 days earlier)      last day (3464 days later) » 

user1804599
4:12 PM
> GCC 4.7.2
 
user1804599
On a scale from Debian to now, how outdated is that?
 
user1804599
Wasn't current GCC 5.9?
 
@rightføld incomplete C++11 support, IIRC
 
user1804599
Oh 4.9.
 
@rightføld 4.9
 
user1804599
4:13 PM
@Abyx lol
 
do you sometimes have a design where objects are their own owner? i.e they do delete this; when their time has come?
 
user1804599
I can't get Perl to work with ØMQ on Debian for some reason.
 
user1804599
So I'm trying to find another language.
 
user1804599
But apparently C++ is out of the question too.
 
@StackedCrooked usually you do this only when you write an intrusive ref-counted pointer
 
4:14 PM
Use C99
 
user1804599
lol Debian stable has like, clang 3.0
 
Debian always had only outdated stuff
 
@StackedCrooked I virtually never have, but some people do it a lot. For one example, @JamesKanze used to work on a system for (telephone) call routing where each call was represented by an object that destroyed itself when the parties on the call hung up (after logging the call information for billing and such).
 
user1804599
@TonyTheLion lolno
 
user1804599
what moron uses c
 
4:18 PM
@JerryCoffin I see.
 
user1804599
I could use PHP.
 
@rightføld But you said "Language", didn't you?
 
Being your own owner is bad. James Kanze is nuts.
 
I always make sure objects are owned. But sometimes that ends up being a free list on a lower-layer object for lack of a better candidate. And then the higher layer objects that need to ask the lower layer to remove themselves so they will be deleted.
 
user1804599
I haven't used Ruby in a while.
 
user1804599
4:20 PM
I think I'm gonna keep it that way.
 
@rightføld and that is any better than C99?
 
It's kinda fake RAII.
 
user1804599
@TonyTheLion Of course it is.
 
ahahahahahahahahahahah
No.
 
user1804599
Have you used C and have you used PHP?
 
4:21 PM
yes
 
user1804599
Which versions?
 
I have used PCP.
It's a protocol for opening ports.
 
@rightføld C99 and PHP god knows what fucking version (a shit one)
oh wait...
 
Never had a close look at c99 and c11. I'm kinda curious if anything interesting was added.
I recall they enabled function overloading via macros... somehow.
 
@Puppy It's going to take a lot more than a bald assertion to support that. If I'm left to choose based upon whose judgement I'm more likely to trust, sorry, but you lose.
 
4:24 PM
hi
 
@JerryCoffin that was quick :D
maybe there are billions of lost objects floating around in the telecom now
all because of James Kanze
 
that url
@Borgleader lol
 
@StackedCrooked If it leaked, it'd be visible pretty quickly. The system he worked on handles a substantial percentage of calls for continental Europe.
 
user1804599
4:30 PM
what language should I use
 
@rightføld KLINGON
 
@rightføld I think German works well for cussing.
 
Bad judgement about ownership of cpp objects is not typically considered a failing of mine
 
store.steampowered.com/app/294860 - wow now Valkyria Chronicles is on Steam
 
@rightføld For programming, I think you should work on reviving IPL-V.
 
4:35 PM
If you want proof that Kanze is nuts, just go through his answer history- he advocates manual deletion all the time.
I would do it for you but mobile
 
I would like to make a library of template classes to serialize C ++ objects in JSON format, do you know if is there already a libreira like that?
 
For C++03, i.e. pre-useful smart pointers (shared_ptr notwithstanding).
 
No
 
user1804599
@AngeloDM What is C ++?
 
sorry C++ :)
 
4:37 PM
Cant Google, I'm guessing
 
Also I think he advertises 'manual memory management means self-deletion' precisely.
 
@AngeloDM Come on, why don't you Google it yourself?
 
@AngeloDM Boost Serialization is probably about as good as it gets.
 
Well, since I'm him, gotta feed muttkins
Home
 
I checked, but I want know if it can be useful for other developer
@Jerry Coffin, does the boost serialization use JSON?
 
4:44 PM
@AngeloDM It doesn't necessarily, but can.
 
Boost serialization is focused on the C++ objects. If you write a JSON backend for boost::serialization then it might generate code that doesn't look like you had in mind. If you need to comply to a pre-decided JSON structure then you're gonna have to build a C++ model around it (and use a JSON library to serialize it manually..)
I think.
 
@BadMiiversePost, Kyoto, Japan
The worst posts (and sometimes best) from Miiverse. Tweets by @daniel_switzer, send complaints his way. Send your bad posts to badmiiverseposts@gmail.com
815 tweets, 39.3k followers, following 2 users
 
@StackedCrooked, I already developed a open source backend JSON library, now I would create a simple way to serialize any C++ object using this backend, I'm thinking a set of template classes to simplify this job, without manually create each time a dedicated class. My question is: can this set of template class useful for other developer, so I can think to start development?
 
That's for you to decide. If you aren't certain if it's gonna be useful then make at least make sure you're gonna have fun developing it.
So it's not a total loss ;)
 
5:00 PM
I'm thinking at the following syntax: class MyClass : public TSerialize{public: TJSonType<TNumber> MyNum; TJSonType<TString> MyStr;}
and MyClass MyObj; MyObj.Encode();
 
What is TJSonType useful for?
 
using TJSonType you can save any member inside a string or file
 
user1804599
Yes yes yes, I just had my eureka moment.
 
user1804599
For solving the JS coroutine problem while still keeping interop.
 
ok
what did you do?
 
5:03 PM
Why not TNumber MyNum; directly? What’s the benefit? I write int member; normally, not type<int> member;.
This is more of a nitpick, I should say.
 
TNumber is same a double member
 
user1804599
@StackedCrooked I'll just add to every Styx function definition a flag to indicate it's a Styx function, make every Styx function return a promise and at every call site I insert an if-statement to wrap the result in a promise if it's not a Styx function.
 
user1804599
It makes function calls slower but I don't give a shit.
 
you can use the following members: MyObj.MyNum = 10;
sorry above
members
and serialize the object without other work, using Encode() method
the JSON source contains: {MyNum:10}
 
How does Encode() find the members?
 
5:07 PM
I have found a solution
 
@rightføld Christopher Kohlhoff does. (See the diagrams on futures vs callbacks.)
 
in the constructor I pass the member name using a dedicated macro
 
user1804599
@StackedCrooked I don't want explicit async I/O.
 
user1804599
Async I/O is an optimisation and having it be a different programming paradigm is retarded.
 
user1804599
Even Go, which gets everything else wrong, gets this right.
 
5:09 PM
 
user1804599
> Greenspun’s Tenth Rule: Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.

Steele & Crockford’s Corollary to Greenspun’s Tenth Rule: Any sufficiently interesting JavaScript library contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Haskell.
 
user1804599
lol
 
^ This was original copy assignment operator code for vector.
 
user1804599
For call stack shit I can use trampolines.
 
I suggest you drop the need for using TJSonType then. Whatever it does, if Encode() needs it then it can do it behind the covers.
 
5:13 PM
@rightføld Trampolines seem cool. Even if I don't understand what they are.
Some kind of mutual recursion?
 
user1804599
In the base case you return value. In the recursive case you return thunk.
 
And if whatever information you collect with the macro you can still obtain outside of a constructor, then presumably you don’t have to require the TSerialize base either. The net benefit being that pre-existing types could still be encoded without intrusive modification, by being generic about it.
 
No, runtime generated function
 
user1804599
Thunks are then evaluated after one another.
 
what is thunk?
 
user1804599
5:14 PM
@Puppy homonym
 
I'm thinking to start project as suggested by StackedCrooked, I inform you about progress( if you are interested). For now I have to rewrite my JSON C++Builder open source library for C++ standard. Thank you for your feedback!
 
Its a runtime generated function that forwards it's arguments.
 
@rightføld Coffin's corollary: any sufficiently complex Common Lisp program contains an ad hoc, completely unspecified, bug-ridden, hideously slow implementation of 90% of C and Fortran (and would be improved it it attempted to imitate C++ instead).
 
@StackedCrooked lazy evaluation, instead of evaluating wtv right now you shove it in a thunk and only execute the thunk if you need the result of wtv that expression was. IIRC
FP pros feel free to bash wtv i just said
 
@StackedCrooked A thunk is a very thin wrapper function, that does (almost) nothing but call another function.
 
5:16 PM
Nothing to do with it at all.
 
I thinking to this:class TMyType : public TSerialize
{

public:

TJSonType<TNumber> NumVar;
TJSonType<TString> StrVar;
TJSonType<TBool> BoolVar;
TJSonArray<TNumber> Array;

TMyType()
{
InitJSonMember(NumVar);
InitJSonMember(StrVar);
InitJSonMember(BoolVar);
InitJSonMember(Array);
}

};
 
That is merely one use of think.
Another example is virtual function call targets which adjust this then call impl.
 
user1804599
That's an example.
 
user1804599
It's O(1) in space.
 
5:18 PM
@AngeloDM please post a link to longer code snippets, instead of inlining them in the chat
 
Ok sorry!
 
@TonyTheLion ...where "longer" means anything over about 5 lines.
 
user1804599
Of course Thunk shouldn't be used for anything else as that would break generic code.
 
@JerryCoffin yea
 
@rightføld That looks cool.
 
user1804599
5:21 PM
I think ES6 allows TCO.
 
@TonyTheLion ...though the acceptable length does vary, depending on how busy the room is at the moment. The acceptable length is inversely proportional to current activity level.
 
user1804599
In ES5 it's not allowed since you can inspect the arguments passed to the callee, the callee's callee, etc.
 
goodbye to all!
 
3 years from now we will remind you of your TJSonType and you will cringe.
3
Hopefully :)
 
user1804599
lol "JSon"
 
5:24 PM
enum { JSon, JSoff };
 
@StackedCrooked You forgot "JSFileNotFound".
 
Another person who prefixes template classes with T?
 
@JerryCoffin or crap
 
I dare say it's another @ThePhD
 
user1804599
Only problem I see with thunks is side-effects.
 
user1804599
5:28 PM
It might break there.
 
user1804599
Oh wait, it won't. Nice.
 
@Rapptz I don't get any of these prefixes, i because it's an int, _ because it's a private variable, p for point etc. it's all nonsense. If you need prefixes to know what the fuck is going on sort your shit out!
 
@Rapptz Given the mention of C++ Builder, chances are better that he's just following the old Borland convention of a T prefix on everything. In their case, it sort of made a little sense--they started doing it long before namespaces were invented, and (for example) TurboVision and MFC had a lot of class names that were identical other than their vendors' chosen prefixes.
 
I wonder if it would be good to use noexcept(false) a lot.
To increase awareness of what may throw.
 
@StackedCrooked You probably can't trust a simple false. You probably need noexcept((false != false)==true).
 
5:35 PM
noexcept(!!!false)
oh wait
 
:19970363 ?
 
user1804599
noexcept(CHAR_BIT - CHAR_BIT * sizeof(char)) for extra confusion.
 
void f() noexcept(!"this shit gonna throw");
 
user1804599
Wait.
 
user1804599
I solved the problem differently by not generating JS code but writing a bytecode interpreter in JS.
 
user1804599
5:39 PM
Perhaps with JIT compilation.
 
writing a bytecode interpreter in JS? how does that work?
 
user1804599
Instead of writing it in C++ you write it in JS. vOv
 
How do you access the bytecode from JS?
 
user1804599
bytecode[programCounter]
 
-1
Q: I want to write aprogram in c++ for solving password using genetic algorithm

sazeenI want to write a program in c++ for solving password using genetic algorithm how can I do it?

 
5:43 PM
bytecode is a binary array containing ..bytecode?
 
user1804599
let stack = [{ vars: [], programCounter: 0 }];
for (;;) {
    switch (bytecode[stack[stack.length - 1].programCounter]) {
        case Opcode.Nop: ++stack[stack.length - 1].programCounter; break;
        case Opcode.PrintHelloWorld: alert("Hello, world!"); break;
    }
}
 
bytecode is portable or dependent on underlying JS implementation?
 
user1804599
Except with lower-level opcodes, and more opcodes.
 
user1804599
@StackedCrooked Portable.
 
@Rapptz 'genetic' algorithm, eh?
 
5:44 PM
Ah, ECMA-262.
 
user1804599
@StackedCrooked It's just like writing an interpreter for Java bytecode.
 
user1804599
Except you do it in JavaScript instead of C++.
 
user1804599
And with Styx bytecode instead of Java bytecode.
 
user1804599
But since you're not tied to the JavaScript calling mechanism you can use your own call stack which is persistent across yields, and that way you can implement coroutines.
 
Defining your own bytecode in order to be able to write bytecode seems far-fetched.
 
user406009
5:46 PM
I think trying to match asm.js would be better than writing your own bytecode.
 
user406009
Then at least you have an existing standard.
 
@rightføld PrintHelloWorld is an opcode?
You suck.
 
user1804599
4 mins ago, by rightføld
Except with lower-level opcodes, and more opcodes.
 
I found a weird question and I don't know how to answer properly

http://stackoverflow.com/questions/26948828/declaring-a-vector-with-car-objects-prints-unrelated-error
 
5:51 PM
I don't feel right now (or generally) any ideas on this weird thread?
 
> Car(std::string name="Ship")
lol
 
Undefined reference? That's odd that you get a linker error, considering your code shouldn't even compile (your constructor takes a string and you pass an int). — Etienne de Martel 55 secs ago
I have the feeling he isn't showing us everything.
 
@EtiennedeMartel No kidding. Where is this 'id' variable coming from?
 
Either his compiler is ancient, or the code in the question isn't the one he's trying to compile.
Said differently, he can't SSCCE worth a damn.
 
Welcome to Stack Overflow :)
 
user1804599
5:55 PM
@StackedCrooked jsfiddle.net/rdrq0dyp
 
user1804599
programCounter also functions as return address.
 
user1804599
But I haven't implemented calls.
 
user1804599
Though it's trivial.
 
@StackedCrooked What about the Car(std::string name = "Ship") I don't get what you mean
 
user1804599
Wait, lemme implement calls.
 
5:57 PM
@niCk I just thought it was funny.
I'm not really into sophisticated humor.
 
@Borgleader Of course you do. The argument might be e.g. a call to a function template with multiple template arguments present.
 
@StackedCrooked I saw it now :D
 
@EtiennedeMartel I compiled the code from thread (only linker error persists)
 
user1804599
@StackedCrooked Here it is with calls (and TCO!): jsfiddle.net/rdrq0dyp/2
 
6:02 PM
@StackedCrooked About that thread ( or generally ) this linker error is solved how?
 
@Columbo ... That's a month old
dafuq
 
@Borgleader I forgot to reply back then.
 
kinda pointless to do so now
 
user1804599
Actually, incrementing program counter in return is faster than in call.
 
It's never too late.
 
6:03 PM
@Borgleader I know. I'm bored
 
user1804599
Because not all functions return.
 
@StackedCrooked Is that also a phrase from "Stacked Crooked"?
 
Oh Columbo is Loopunroller.
 
Not sure.
 
Makes sense.
 
6:05 PM
Wow... i dont know who the fuck wrote Mitsuba's blender exporter but it's broken. It's like they blindly made changes and didn't bother to even fucking run it
 
Columbo is someone that was here before. Not sure if Loopunroller.
 
Yeah it is loopunroller
 
guys does anyone have any idea how to answer that? I stuck terribly
http://stackoverflow.com/questions/26948828/declaring-a-vector-with-car-objects-prints-unrelated-error#26948828
 
@niCk If we want to answer questions, we do, no need to spam them in here
 
user1804599
s/stuck/suck/
 
6:07 PM
@rightføld Eh?
 
is that your sock puppet or something
 
user1804599
@Columbo What eh
 
@Borgleader sorry for double-posting, I reposted because the source code changed
I will delete the above comment
 
I need 1 more answer.
 
New Pornographer's lyrics are incomprehensible most of the time. They make sentences that sound right, but there's no coherence overall. e.g
 
6:08 PM
What should I answer?
 
@rightføld In what language do not all functions return? I mean, when executed with well-defined behavior
 
user1804599
Any Turing-complete language with functions.
 
user1804599
Any language with functions and exceptions.
 
Ahh, exceptions.
 
user1804599
Any language with functions and exec or exit.
 
6:09 PM
@rightføld Ahh, exit.
 
@Columbo [[noreturn]] void f() {}
 
@Rapptz UB?
 
user1804599
However, you can compensate with fork and clone, which return twice! :D
 
When executed?
 
lol what?
I didn't throw yeah
 
6:11 PM
So, yup.
But anyway.
 
err..
void f() {} has no return statement
it's not UB
it has no attributes
 
@rightføld Had a brief look at zeromq. Does it actually decompose the program in multiple processes that communicate?
 
user1804599
@Columbo Bullshit.
 
That's not what I mean.
 
user1804599
That's not the case with main or with void.
 
6:12 PM
rephrase your assertion
 
user1804599
@StackedCrooked That is possible.
 
because it's ambiguous and dumb
 
I'll rewrite my assertion.
 
user1804599
You can choose the underlying protocol.
 
user1804599
AFAIK TCP, Unix domain sockets and queues are supported (the latter only within the same process).
 
6:13 PM
[dcl.attr.noreturn] "If a function f is called where f was previously declared with the noreturn attribute and f eventually returns, the behavior is undefined."
So I was right with the fact that executing your first f results in UB.
 
3 mins ago, by Rapptz
I didn't throw yeah
 
user1804599
@StackedCrooked It's pretty much tbb::concurrent_bounded_queue<std::vector<char>> with networking support.
 
user1804599
And automatic reconnecting and stuff like that.
 
@Rapptz You could've exited via std::exit`.
 
user1804599
Yes, but std::exit is [[noreturn]].
 
6:17 PM
@rightføld ... exactly?
 
I hate it when people answer such low effort questions.
 
user1804599
 
user1804599
 
I don't care 99% of the time except when I'm closing a question.
 
IOW, you no longer give a shit.
 
6:26 PM
@Rapptz Depends. If somebody just says "the answer is X", that's pretty bad. Although link-only answers are verboten, in this case an answer like: "you can download a draft of the Standard from Y", or "you can find things like that on cppreference" would really be better.
 
I'm at 199 answers
What should be #200?
 
@Rapptz A good one (of course). Good luck finding a good question to answer though...
 
lol I've been looking for 9 hours
 
(Did I use "good" enough in that sentence?)
 
It was good enough.
 
user1804599
6:28 PM
Oh wow there is actually clang 3.5 for Debian.
 
user1804599
> Debian clang version 3.5.
 
are you on sid or what?
 
user1804599
LLVM's repository.
 
@Jefffrey Oh good!
 
the llvm deb builds are frequently updated
 
6:30 PM
Good evening btw.
 
no surprise there
 
user1804599
> Let's see an example that pushes out weather updates consisting of a zip code, temperature, and relative humidity. We'll generate random values, just like the real weather stations do.
 
user1804599
lol
 
lol
 
user1804599
6:48 PM
 
user1804599
instanceof has precedence over !.
 
user1804599
I still don't know what language to use.
 

« first day (1491 days earlier)      last day (3464 days later) »