« first day (1137 days earlier)      last day (3814 days later) » 

Ell
12:00 AM
@Pawnguy7 Yeah, it does feel like everyone else finds it so easy
 
@Ell Not necessarily related to difficulty. It is just, graphical details never really cross my mind.
Iam not sure why.
 
@zch Not sure if you remember my question a while back, but modifing KMP was able to do the trick
 
Anyone here knows if there's something special you need to do to implement a COM interface in C# so that you can then pass an instance of that C# class to a C++ COM server?
 
zch
@robjb, I’m glad I was able to help.
 
Ell
 
12:24 AM
2 new LLVM snapshots in a week, but still fails on iostream :(
 
@EtiennedeMartel adhere to COM compatible interfaces and make the class COMVisible
With the build options look for "register COM assdembly" or somethign (under advanced?)
 
Hmm. We're running in registration free COM stuff.
 
@Borgleader at least they have VS2013 integration now :)
 
@EtiennedeMartel same deal, just junk it all in a .manifest file or something is basically a a local "registry"
Don't remember .manifest or .policy
Either way, you're just looking for the way to author your COM interop assemblies. So, COMVisible attributes and the Interop namespaces
 
12:57 AM
@melak47 So? If I can't compile anything noteworthy that's not an improvement per say :P
 
@Borgleader pff iostreams suck anyway :p
 
No you =/
 
@melak47 What would be a good alternative, that's type safe, extensible, etc?
 
Does anybody remember if timeBeginPeriodis per thread, per core, or per process?
 
I don't remember, sorry.
 
1:07 AM
I don't like coming up with essay topics :\
 
i laughed more than i should xD
 
1:42 AM
So, you are one of them? :P
 
1:56 AM
Err, I forgot user name
I have client ID, but I can not login with it
 
2:26 AM
@Pawnguy7 Eh, sounds. I don't even know where to start with them.
 
@Jefffrey ohhai
 
hai, I took an overly long nap after dinner.
 
I don't either.
Just figured I should have some.
 
Does RVO + copy-elision cover this:
0
Q: Efficiency in a C++ function?

VeeThis is probably a simple question, but this came across my mind. It is regarding the difference between the two functions below: T func_one(T obj) { //for the purpose of this question, return obj + obj; //T is a large object and has an overloaded '+' operator } T func_two(T obj) ...

 
@Jefffrey so, progress?
 
2:35 AM
@Pawnguy7 I've committed yesterday IIRC, no much of a progress though, it's my first working copy with the new design (it's just the snake moving for now).
 
I really should commit soon.
But the AI is messed up.
What should I do?
 
You should drink.
 
Don't commit, or open an ai-dev branch.
 
@Pawnguy7 call it easy mode
 
lol
 
2:37 AM
@Jefffrey well here is my problem
 
@Mysticial The second one is covered by NRVO.
 
Well actually.
I guess I could add sounds and commit that without this couldn't I.
 
yup
 
@Mikhail Currently with them killing themselves, "unplayable mode" would be closer to the truth.
I really don't get it though.
 
user3010322
@melak47 I built my own streams, so ~~~~~~~
 
2:39 AM
The basic premise was, the closer you are to food, the higher scored that path is.
And a path that hits the food is worth a bunch.
Sometimes they beeline for the food, sometimes they endlessly wonder around it :(
 
@Pawnguy7 whats the game?
 
@Mikhail snake
@Jefffrey anyway, this score based thing feels so wierd
Everything I have done before is like.. directly checking.
Whereas in this, bad choices are just low scores. I never explicitly say "Don't run into this wall.", but by some seeming magic, they don't kill themselves.
 
The ending of ep 11 of Space Battleship Yamato is well done.
 
@Pawnguy7 yeah, is that A*?
 
@Jefffrey Not currently.
That one.. sort of worked.
They just ran into walls :\
 
2:49 AM
lol
 
Oh, and slow.
But I don't know what it does, so I am not debugging it.
 
Did you check all the possible paths every move?
 
@Jefffrey with A*?
Recursive with a depth limit.
 
No, with the one you have now.
 
But that one wasn't slow.
It is like so
This recursive function collects scores.
In each location, it finds the score (say, based on proximity to food), and adds it to further branching out, where we don't visit squares twice.
These wind back to four base functions that were started.
The highest-value is picked as the direction.
I thought that would work, but... it is acting oddly.
Can you picture it?
 
2:56 AM
Not quite. I don't get what path score is worth? Can't you just say: At every move we only have 4 possible cells to go. You pick the cell that gets you nearer the food and avoid the ones that consist in a death.
 
@StackedCrooked But would the compiler be able to optimize the second one into the first one using a combination of RVO and copy-elision.
I think the answer is yes. But I'm not sure.
 
@Jefffrey that was what my first AI did
 
First copy-elision turns it into a simple constructor call. Then RVO.
 
Anyway, let me make a diagram in a second.
 
yes, they are identical (esp in C++11 where the standard dictates that the move constructor be used for the return value, and allows the compiler to optimize away the move constructor).
 
2:58 AM
@Pawnguy7 Oh, wait. You want the snake to foresee the optimal move.
 
@Jefffrey or at least look ahead slightly
 
Oh right.
Like, you say that a snake that foresee 10 moves is difficulty = hard, and one that foresee only 4 is easy, or something?
 
That was the original plan, yes.
 
I can only see trees in that solution.
 
3:01 AM
You branch out of 4 every time (or < 4 if one of the moves leads to death) and you check the first one that leads to the food.
 
The -9999 is basically negative infinity.
 
@Mysticial in my experiments I found that GCC optimizes the move-constructor away even when compiled as -O0.
 
@Jefffrey More or less. Although, multiple paths could lead to food. For example, you could go away, then towards. But the path that was closer for longer should have a higher score, and so be chosen.
 
@Pawnguy7 well, my idea stops at a x limit. If the limit is 10 and the 10th move doesn't leads me to the food, then one of the 4 is chosen randomly.
 
@Jefffrey What if two lead to it?
 
3:05 AM
@Pawnguy7 randomly again
I wouldn't want the perfect snake AI, I'd want a non stupid AI.
Perfect AIs are not funny.
 
Hrm...
How about this, though.
Even if it does not directly find the food.
Odds are you are more likely to if you are closer to it.
 
Oh, yeah, of course.
 
I cannot remember why this doesn't work.
Lots of looping.
Haha.
Looping around the food.
> std::cout<<"Damn, last chance is "<<possibilities[0]+head<<std::endl;
Open source :D
@DeadMG hai
 
Something like this? (pseudo code)
 
greetings
 
3:18 AM
hey
 
So I was trying this AI thing again... :D
 
int best_distance = -INT_MAX; should be int best_distance = INT_MAX;, I think
 
user3010322
INT_MIN ?
 
What collection does the foreach use?
 
@Pawnguy7 whatever you like, if you want to store your 4 directions in a std::vector it should work fine anyway.
The idea is that you try to loop to all 4 possible directions.
 
3:21 AM
I have no idea what this does :\
 
I might have written something stupid, but the idea is that if we can foresee x moves, we loop x times and every time we save the best move of the 4 possible.
and push it to the final list of moves
 
So if the first best move is left.
The second best move is off of this move?
 
The best is choosen as: if move leads to the death, it's not a possible move in the first place; if the move leads to us being still alive then we choose the one closest to the food.
 
Off of the last best move?
 
so
how's A* going?
 
3:24 AM
@DeadMG gone, probably
Just kidding, I have no idea.
 
@Pawnguy7 I don't understand that question :/
 
I haven't touched it today.
 
lol
 
I had another idea, so I gave it a try.
 
fair nuff
 
3:24 AM
It is... very strange.
They do a decent job not dying, but they suck at finding food :\
@Jefffrey let's say the first best move is to go left
 
ok
 
Do we calculate the next best move after this?
Or do you only calculate one deep?
Ok.
I would think that would be about like mine, but slightly more fatal.
Though it would be faster.
 
if the first best move is left, then we assume all the optimal paths starts with left.
 
Much faster.
@Jefffrey unless you can only reach the food by going right :D
 
lol, my algorithm does not foresee shit
I'm bad at this.
 
3:27 AM
You did see my first video of this, right?
 
@Pawnguy7 yeah, nevermind
@Pawnguy7 first first video of the snake?
 
Of the AI.
 
I don't think so.
 
Wait, I just thought of something.
If the best move is left.
There is no reason for looking further.
 
yes there is
 
3:29 AM
In which case it is my first AI.
@Jefffrey what more information can you find?
 
if all the paths that starts with left leads to the death
 
Does your code check if it leads to death? :D
 
then don't turn left.
 
Kind of difficult to check.
 
@Pawnguy7 my code sucks, don't ever mention it again, please
 
3:30 AM
I considered checking for death.
But I am not quite sure how.
 
Oh yeah, I saw that.
 
Maybe if.
A square returns no neighbors.
Then it is death.
And return a big fat negative score.
 
The purple snake went crazy all the sudden, in one of those levels
 
Although my code has a problem.
If to the right there is a terrible, terrible path.
And the food - a good path.
It might choose another direction :\
@DeadMG what do you think of my concept?
 
implement it and if you fail, implement something else
 
3:34 AM
That was the implementation.
 
then implement something else
 
I miss this
 
@DeadMG the problem I see is...
All these AI have shortcomings.
Theoretically A* would work the best - if I could get it to work.
But... what do you do when enclosed?
 
A* is a pathfinding algorithm.
it can only get you from A to B.
it cannot describe how far ahead to look, or where you should go.
 
Maybe I can do something like.
if (path_exists) follow_path(); else survive_as_long_as_possible();
If I can find out some way to check for death.
A* didn't go so well though :D
@Jefffrey it is kind of fun to constantly be making new things like that, yes
 
3:42 AM
Well ... porno horror is just weird. Even though I like horror, the graphic description of this female ghost performing oral sex on this guy just sounds wrong. On the other hand, I absolutely love well written romantic horror - it is like watching season 4 & 5 of x-file, but instead of thriller, you are reading a horror. All the anticipation solving of the mysteries, the sexual tension between leading characters - it's awesome!
Also weird it's the second time in 3 months someone came up to me on the train and wanting to chat because I am using a macbook.
 
right
 
well, that seems to work :P
 
Maybe I should only take the best path.
Instead of summing the values.
@Jefffrey if by work you mean wonder aimlessly :D
They often get stuck in loops.
One such loop was directly around a food.
 
hmm
I think I've basically got to allow unsafe pointer indexing.
 
user3010322
3:58 AM
Why would you do anything else.
 
well I dislike it because it's unsafe.
but I think it's gotta be done.
 
user3010322
Have checked and unchecked variations.
 
If you don't like unsafe things, I hear Java is pretty safe :D
 
user3010322
Default to checked, let the user opt-out maybe?
 
well.
I guess that logically, unless you start garbage collecting everything, you can't guarantee that pointers are valid.
and you'll need pointer shenanigans to interoperate with C++ code and system libraries.
I don't have much of a choice about allowing unsafe pointer shenanigans.
 
user3010322
4:01 AM
Well, you got SEH on your side
 
user3010322
to trap them exceptions
 
watno.
 
user3010322
So at the very least you can do that around the Main Trampoline, right?
 
definitely watno.
 
4:12 AM
@Pawnguy7 Its advocates will tell you that, but they're largely wrong. A great of its supposed safety really comes down to the fact that it's so difficult to deal with problems when they do arise that almost nobody really bothers (witness the amount of "production" Java that simply prints out a (ridiculously deep) stack trace when it encounters a problem.
 
so
in a member function's argument list, could define this as in, this type?
yarrr sounds good.
 
@DeadMG You mean using this in the parameter list? (Use its type for other parameters?)
 
yeah- for anonymous types.
like, it's hard to say T(const T&) when T doesn't have a name.
 
this is implicitly declared, though I'm not sure if it applies to the parameter list.
So we'll try.
 
no, I'm defining the behaviour in Wide :P
 
4:20 AM
Oh oh oh! Hehe, got me there. :)
An implicit this_type type declaration perhaps will do, though I think it isn't that useful.
Not useful in the sense that you don't use it often.
 
Wide makes a lot higher use of anonymous types.
 
@Stacked Coliru's not working. :(
 
Anonymous types. Hmm.
wat
 
4:38 AM
damn
my list of stuff I need before I can begin writing more serious Wide libraries is growing by the second.
 
At least you got something working, not many people can say that
 
true.
 
5:00 AM
@DeadMG At least, don't anticipate all scenarios.
 
what?
 
@DeadMG The stuff you need. You could start some libraries without first having them all.
 
yeah I figured as much
but the real kicker is going to be exceptions.
so necessary, but so utterly hideous
 
@DeadMG with anonymous types you mean like this?
 
something like that.
but have fun declaring a copy constructor for it :P
 
5:05 AM
eh, any constructor actually :/
 
oh I already fixed that one.
in Wide I changed constructors/destructors to be type(...) and ~type(...).
for this reason specifically.
 
wait, why would you need a copy constructor for an anonymous type?
 
er, why would I need a copy constructor for any type?
because I need semantics more complex than memcpy().
 
@Jefffrey Type deduction can still infer the type.
 
@MarkGarcia oh, right.
 
5:07 AM
And can use that type to declare a value (not reference) object.
 
@DeadMG I guess type is a keyword there, right?
 
yep.
I stripped both struct and class and replaced them with type.
 
5:27 AM
Holy bumnuggets, it's been a month since I've published something on my blog.
 
inb4 "On the subject of being too busy to blog" ;)
 
"On the subject of my deep experience of bumnuggets"
 
or maybe "On the subject of Borgleader's shitty jokes" xD
 
TIL std::tuple is very nice.
 
how about "On the subject of it's 5:30am and I'm fucking cold"?
 
5:35 AM
rofl
 
@Jefffrey Instant aggregate types at your disposal.
 
@MarkGarcia I know this is probably not the best example, but things like this give me chills.
 
2awesum4u
so
which of these myriad issues should I address first, hm.
perhaps first, I should commit the things I already did.
 
6:00 AM
real men commit once a year
 
@Jefffrey Like they get married once a year?
 
I'm too committed to my code, I cannot commit to somewhere else.
 
@Jefffrey Real men don't use version control, because they write it correctly the first time.
 
real men find an irrational number whose bits happen to perfectly correspond to the bits of the compiled program.
 
Microsoft Help Viewer: Cancel current operation -> "Status: cancelling after current step is complete."
Wow.
 
6:06 AM
epic
 
6:17 AM
Sounds like I should go to sleep.
 
6:29 AM
@JerryCoffin what about real women? ... better still, really clever women?
 
6:43 AM
@Telkitty Most women I've seen were enough smarter (or less overconfident) that they didn't try to do things quite that foolish.
 
7:04 AM
@JerryCoffin hey man, u there?
 
How do I perform case insensitive comparison between two utf-8 chars?
 
7:21 AM
Case folding
 
My favorite WinAPI line of code: ShowWindow(hwnd, SW_HIDE);
 
Show window. NOT!
 
@MarkGarcia reminds me why I strive to stay away from WinAPI at least one layer or two.
 
7:48 AM
I hate the Lua API.
:(
 
yes, it's pretty fucking awful.
 
@sehe lol gluae
 
I'm not sure how I managed to the global table nil
 
@GamesBrainiac Sort of.
 
@MarkGarcia ShowWindow(hwnd, 0); //same but 'better' coz unreadable :x
 
7:57 AM
@JerryCoffin how ya been?
 
@MarkGarcia Thanks for letting me know.
 
@GamesBrainiac Oh, not bad. How 'bout you?
 
All right. Fiddling with some ruby right now.
 
@GamesBrainiac Well, I guess there are worse things you could do (e.g., anything involving PHP instead).
3
 
@JerryCoffin a lot of SO mods would be devastated to hear that ... better adding javascript to that ...
Too many PHP/Javascript mods, too few C++/Java ones
 
8:01 AM
@JerryCoffin Well its not that bad. But some things are weird, I mean, some functions like [2..4].include? 'something' is rather weird. I mean in does it much nicer in python.
 
@Telkitty "E.g." is an abbreviation for "exampli gratis" -- it translates roughly as "for example", implying that there are other possibilities.
@GamesBrainiac Python's list comprehension stuff is definitely quite nice.
 
@Telkitty "C++/Java" - now someone will come and want to lear "C++/Java" instead of "C/C++" shudder
 
@JerryCoffin Yea, you're right. I just wish I were better at Python/C++ iterop.
 
> If you have bananas on a pole, you'll lose your bananas.
The only truth in the monkey thread
 
@GamesBrainiac Beyond being aware of SWIG and Boost Python, I know nothing about interop between them.
 
8:05 AM
@ArneMertz I thought all good C++ developer would know C reasonably well since C is a subset of C++. But Java & C++ are like cousins, related but still different ...
 
@JerryCoffin Hmm. Well, I think the best approach to solving complicated problems is a Hybrid one. Basically, one language cant be the best at everything. So, for that Python is good, because you can start with a Python prototype, and then slowly start changing the parts which are very performance dependent. Having said that, I know few other languages with the same proficiency as python.
 
@Telkitty That's much better. ;)
 
@Telkitty The relationship between Java and C++ is much more distant than most people initially think. Despite the similarity in syntax, Java is really much more closely related to Smalltalk than to C++.
 
@StackedCrooked np. (Well, there is, and that's Coliru's downtime :P)
 
JBL
Good morning, loungers !
 
8:16 AM
@Telkitty I'd consider me a rather decent C++ developer, but by no means a C developer. I can read C code (mostly), I can write a few lines in C, but I'd never try to do a project in C. Simply because I don't know the subtle differences well enough, because I don't know the details of what is possible in C and what isn't. And because I can't (or don't want to) get my head around three-star-programming because I never needed to.
@JBL mornin :-)
 
user1804599
@GamesBrainiac in is ugly.
 
user1804599
Special syntax for this is beh.
 
@GamesBrainiac I'm in rather the opposite position--proficient enough at C++ that I only rarely bother mixing in much of anything else.
 
user1804599
Also, I hope you know that [1..4] is a single-element array containing a range, not an array of four elements. :)
 
The Python API to embed it into your system is worse than Lua.
 
JBL
8:23 AM
@JerryCoffin TIL when Jerry does webdev, he uses C++. Awesome !
 
@JBL same here. when I do webdev, I use C++.
 
I, at the moment, have been working on putting together a panorama. For what it's worth: Deviant Art allows larger uploads than almost any other image hosting site, and even so this is scaled down more than 2:1 from the original.
 
JBL
@ArneMertz Oh right. I could say the same then...
Fuck webdev.
 
@JBL Much as the other replies imply, about the only web dev I've done has been far enough into the back end that the "web" part was mostly incidental.
 
@rightfold what the hell does that mean?
 
user1804599
8:32 AM
Well, like [range(1, 5)] in Python. vOv
 
user1804599
If you want [1, 2, 3, 4], do (1..4).to_a.
 
Well, it's getting late. I think I need to get to bed.
 
Xeo
What, I only just woke up!
 
@Xeo Clearly time for me to go...
If people see me around you too much, they might start to realize that I barely know how to program.
 
JBL
@JerryCoffin C++ based front-end, that's the real shit.
 
8:37 AM
I hate when typing lags on my work computer ¬_¬
 
JBL
(Yet I think I recall some guys that tried to put up webdev C++ libs, dunno how it went...)
 
@rightfold :<
 
JBL
I want time to play with Cinder ;_;
 
@MarkGarcia I fixed a new issue. Hopefully this will make it stable. I wish I had more time to do it properly.
 
@R.MartinhoFernandes o_0 why does it look some sort of seedy sex club? Was there smooth jazz playing the background too?
 
8:48 AM
@thecoshman It was a seedy sex club. He was the entertainment.
6
 
Xeo
@thecoshman the C-Base is a club pretty much, AFAIR
 
@JBL exactly :)
 
9:04 AM
@thecoshman It's a space station. c-base.org
Yes.
Question part at the end, I think.
Thanks.
 
user1804599
lol
 
Oo, Tony is going to be devastated ... or maybe he's numb already
@ScottW have you thought about stalking SO mods?
 
yeah Robot
you pull off the scruffy beard thing pretty well
 
@ScottW because that would be fun thing for us to watch :p
 
JBL
9:34 AM
Mmmh.. What could I use to draw graph in images... ? Gnuplot seems nice but only writes to files it seems...
Ah fuck, let's do this the dirty way.
 
user1804599
Microsoft Excel.
 
because you've got no dick
 
JBL
@rightfold Ugh
 
user1804599
.ignored { display: none; } is best user style ever.
 
user1804599
9:57 AM
Duplicate code is good.
 

« first day (1137 days earlier)      last day (3814 days later) »