« first day (62 days earlier)      last day (2797 days later) » 
03:00 - 18:0019:00 - 22:00

7:04 PM
5 hours ago, by sehe
@exitc0de depends :) you can reverse it: http://coliru.stacked-crooked.com/a/0ce08e4fbac0f13f
Yawn. Just reverse that. And use the reference. Done.
@exitc0de It's the header that defines std::reference_wrapper<>. Yeah. That should have been <utility> IMO
@milleniumbug tsk tsk ^
@exitc0de This is why I post complete, self contained examples. So you can /see/ what I'm doing.
$ clone github.com/exitc0d3/Contingency-Project
Cloning into 'Contingency-Project'...
remote: Counting objects: 95, done.
remote: Compressing objects: 100% (54/54), done.
remote: Total 95 (delta 47), reused 86 (delta 38), pack-reused 0
Unpacking objects: 100% (95/95), done.
Checking connectivity... done.
$ Contingency-Project/
$ g++ -std=c++11 *.cpp
$ ./a.out
Welcome to The Contingency Project.
A global nuclear war is about to take place
Will you be able to survive with the smallest population decrease percentage?
What an emotional rollercoaster /cc @milleniumbug
 
:D
@sehe I don't see you using std::reference_wrapper though...?
 
$ wc {Weapon,Vehicle,Region,PlayerController}.*
0 0 0 Weapon.cpp
0 0 0 Weapon.h
0 0 0 Vehicle.cpp
0 0 0 Vehicle.h
0 0 0 Region.cpp
0 0 0 Region.h
0 0 0 PlayerController.cpp
0 0 0 PlayerController.h
0 0 0 total
It's Good(TM) that he knows how to organize zero code though
 
@sehe ah, indeed
 
7:22 PM
?
I fixed it
 
@exitc0de In the last five minutes?
$  git log --all {Weapon,Vehicle,Region,PlayerController}.*
commit 17741621f455bcf62236fe413bed3fd9d5179183
Author: Finn Fallowfield <finn.fallowfield@gmail.com>
Date:   Sun Sep 11 15:38:28 2016 +0100

    added additional files, incomplete
 
just did this:
class PlayerController // Player specific methods and variables
{
public:
Region* playerRegion;
RegionHandler regionHandler;

PlayerController() {
playerRegion = regionHandler.chooseRegion();
}

};
I made it so the regionhandler returns the playerRegion
and I set playerRegion in the PlayerController constructor to the return value of the playerRegion method
which unfortunately means I have to make a random object to the player controller class when I want to prompt the user for the playerRegion
but its fixed
and yes on github
in the last 5 minutes
@sehe
 
@exitc0de you wat. "make a random object"?
> (PlayerController.playerRegion = &regions[playerRegionIndex]);
^ That was returning a ref (pointer, in this case) to a local
 
PlayerController playerController;
check the github
its updated
@sehe
 
WOOF!
 
7:26 PM
I implemented it badly yes
Had to absorb a load of downvotes to figure it out
but I understand it now
 
You might notice I actually look at your github. Don't yell at me ("check the github"). I'm sure it can wait 3 minutes while I look at the code I have r.n. Not going to throw away what I had made in changes.
 
@sehe didn't realize you were looking at it right now. Submit a merge request if want to change something.
its still a really bad way of doing it
 
nwp
 
@sehe I think I need to implement it in a different way because I do not want to have to call the input when the class constructor is called
I might have to put the method inside the PlayerController class or completely rework the RegionController class
 
7:43 PM
So here's that second one on a branch github.com/sehe/Contingency-Project/tree/sehe
@exitc0de HAHAHAHAHAHA you have shit in main.cpp AND main.h. main.h is not include.
Fix yo mess before adding a dozen empty files to make it look organized?!
That way to fix Weapon is also ok-ish I guess (contrast with mine in my branch if you're curious)
In your new commit, this is an infinite loop or a no-op:
> while(playerRegionIndex < 0 || playerRegionIndex > 5);
 
8:00 PM
Oh those files are temporary
I just copied and pasted the original ones
I shouldn't have pushed them yet
 
You shouldn't have them.
 
I know
I meant to write them earlier today
Your code is a little too sophisticated for me @sehe
But I like the enum idea
 
No it isn't. I'd drop the enum idea. It's just a sync problem you don't need
 
then I call Region.name() to get a name? @sehe
 
Yes.
 
8:11 PM
I assume I'm getting rid of the RegionHandler class then?
 
Anyhoops, here's the version I'd do (removing bugs I made earlier): github.com/sehe/Contingency-Project/tree/updated-sehe - also Live On Coliru
@exitc0de I would. Your code was just changing the reference-to-local problem into a reference-to-class-member-of-a-class-member. Not really helpful. And the RegionHandler in main was simply not used.
Note the nice change from sleep_for to sleep_until. Always use the right function for the job.
Also notice the input validation and stream error handling (unless you like infinite loops spamming std::cout)
 
why don't you like using std::cout; ? @sehe
 
Why do you?
 
it means I don't need to type std::cout all the time
and can instead simply type cout
 
Note I do suggest a using-declaration for high_resolution_clock. Mainly because that makes it so much easier to switch to a different clock without tedium.
@exitc0de Golf clap. I don't think you have your priorities straight for c++ code.
 
8:18 PM
haha @sehe
I have no idea how expensive using std::cout is
 
If you want quick-to-write go with Ruby or Python
 
No thanks
I tried rust once
Anyway, how do I merge your fork to my repo?
after I figure out what everything does
 
@exitc0de Depends on how you look at it. It's ~zero cost to type std::cout and everybody knows what it is. It's a GoodSignal(TM) for readers of your code.
@exitc0de I could make it a PR
 
@sehe That would be great
 
@exitc0de Not exactly a language in the same category
 
8:20 PM
I know
Its a functional language @sehe
 
?! I don't think that's true
 
it is!
Its about as functional as it gets
 
what!?
 
17
Q: Does/Will Rust support functional programming idioms?

Sebastian GrafAs Rust gets fleshed out more and more, my interest in it begins to pique. I love the fact that it supports algebraic data types and in particular matching of those, but are there any thoughts made on other functional idioms? E.g. is there a collection of the standard filter/map/reduce function...

 
8:22 PM
@sehe Fair enough then. I'm happy using C++ for now.
Although as soon as Rust gets good library support and becomes a little more mainstream I'll probably jump straight on it
If I want to merge your fork with my repo do I make your fork the head fork and my repo the base fork?
or the other way around @sehe?
Ah I got the pull request dw @sehe
 
Gotta love them plinks :)
 
@sehe by the way do you think buying Accelerated C++ might be a good move?
I know I should probably buy a book to read
 
Depends on what you have been reading. But in general, yes.
I gave my colleague that book. Means it doesn't suck
4265
Q: The Definitive C++ Book Guide and List

grepsedawkThis question attempts to collect the few pearls among the dozens of bad C++ books that are published every year. Unlike many other programming languages, which are often picked up on the go from tutorials found on the Internet, few are able to quickly pick up C++ without studying a well-written...

 
I have Programming P&P by Bjarne and I found it pretty slow
I've read that list quite a few times, I'm just deciding which one to get @sehe
 
@exitc0de I must admit it's one of the few books I didn't read
 
8:30 PM
its over a thousand pages long
Shouldn't I probably make it so if the user enters wrong input it tells them and asks them again? @sehe
That's why I had the while loop
 
@exitc0de It does now.
@exitc0de No. You had an infinite loop there. I pointed it out earlier.
39 mins ago, by sehe
In your new commit, this is an infinite loop or a no-op:
18 mins ago, by sehe
Also notice the input validation and stream error handling (unless you like infinite loops spamming std::cout)
Actually, the live sample (coliru) shows the input validation
 
Ah but it doesn't accept non integers
 
Whoops. It shows I had a bug there. Mmm.
Looking at it
 
Thank you again for your help though, I appreciate it.
I have a lot to work on and think about.
 
:)
 
8:44 PM
I don't know whether you remember me a while ago on the lounge
I've learnt a lot since then
It was pretty embarrassing to be honest, I was clueless.
 
I do
@exitc0de Now imagine your self-assessment in 3 months :)
 
At least I know how little I know now after taking on a bigger project
even if I will probably never finish it
 
9:06 PM
@sehe Would it be better to get C++ primer which I believe Accelerated C++ is based on because it is updated to the C++ 11 standard?
Or to just go for Accelerated C++ and then get Effective Modern C++ or learn C++11/14 on my own @sehe?
 
@exitc0de I'd check the book list. Turns out there are more of these I didn't read than I initially realized (I think it's because there are so many advanced books).
 
@sehe both are on the book list
both are in the same section
 
So. Take their advice, not mine
 
Both are Highly Recommended by ACCU
its whether I go for C++11 with the C++ Primer 5th edition
Or the advantage of Accelerated C++ being a lot quicker
and then learning C++11/14 myself @sehe
I think I'll get accelerated C++
because its short
and cheaper
and then I'll get effective modern C++
alright sorted
 
@exitc0de I'd go with quick. TBF I think books should just lay the foundation. All the details will just whoosh by on first read. You can get them later
 
03:00 - 18:0019:00 - 22:00

« first day (62 days earlier)      last day (2797 days later) »