• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Programming |OT| C is better than C++! No, C++ is better than C

I hope someone makes it possible to run windows executables from inside the linux subsystem.

I thought about trying to do it myself. The idea would be to write a linux kernel driver that watches for process launch attempts. First it tries to launch it using the normal linux mechanism. If it fails, check the return code, and if the return code indicates that the file was not found or that it was in an invalid format, send an IPC to localhost on a pre-determined port.

On the other side, you've got a windows kernel driver listening on this same port, and when it gets process launch requests, it tries to launch it from windows. success or fail, it sends the response back over the same socket.

capturing terminal IO would be difficult unfortunately, but I think you could do it with some similar hackery. You'd probably need to inject a thread into the windows process that would monitor the terminal and send it to some daemon running in linux.
 

Koren

Member
I hope someone makes it possible to run windows executables from inside the linux subsystem.
That's quite tricky unless Microsoft decides to allow it.

Still, Wine/WineX works decently well, even if it's not 100%. Or CrossOver if you're ready to pay for something more "ready to use".

In fact, I've managed to run Windows software on my Debian that... I couldn't make work on Windows ^_^

RDP also helps if you have a running Windows server.

First it tries to launch it using the normal linux mechanism.
Why would you have to try to launch it to know whether it's Linux or Windows?

I don't think you can mistake any kind of Windows executable with an ELF binary?
 
That's quite tricky unless Microsoft decides to allow it.

I don't think it's that microsoft "won't allow it", it's that it's a legitimately hard problem. When you run bash on windows, you are actually running linux. Windows is completely out of the picture at that point. It would be like saying "Imagine you boot up your linux system and try to run an exe". It doesn't even make sense. So I think it's purely a technical challenge and not something they are trying to restrict.
 

Koren

Member
I don't think it's that microsoft "won't allow it", it's that it's a legitimately hard problem. When you run bash on windows, you are actually running linux. Windows is completely out of the picture at that point. It would be like saying "Imagine you boot up your linux system and try to run an exe". It doesn't even make sense. So I think it's purely a technical challenge and not something they are trying to restrict.
Well... when I'm under Linux and I want to use a windows executable, either I double clic on it, or I type "Wine myprogram.exe" in a console, and in many cases, it just works.

The main issue is that for Windows applications to work on Linux, you need to recode the whole Windows API. Which is both a huge task, and also a difficult one because, if I'm not mistaken, huge parts of the API isn't public (and probably copyrighted, too). And Microsoft software engineers code faster than Wine contributors reverse-engineer each entry point.


At the end of the day, the Ubuntu support in Windows is just the reverse of Wine... There's no Linux running on Windows, it's just real-time translation of syscalls. But it's easier to write since everything on the Linux side is open, AND Canonical helped.

Open-source the Windows API and I think you'll have quickly really impressive results (especially if Microsoft is directly helping). The comparison isn't really fair.

The "allow" was probably a bad choice of words... It's not a matter of actively closing the door, it's just hiding it.


And even Linux command line software support on Windows is still hit and miss.


That being said, if you really want to run a Windows inside Linux, it's actually pretty easy and it works well. That being said, the reasons I'm giving up on Windows are:
- I don't want to pay a license anymore (and I dislike more and more their ToS)
- I'm not fond of the recent interfaces, and with each version, the customization capabilities are narrower (on Windows 95/98, I used to use different window managers, for example).
So, I don't see really a point into running an actual Windows inside Linux...
 
Have any of you tried your hand at porting a project? I'm always stuck for ideas when it comes to programming projects so I'm thinking of just trying to port something.
 
Well... when I'm under Linux and I want to use a windows executable, either I double clic on it, or I type "Wine myprogram.exe" in a console, and in many cases, it just works.

The main issue is that for Windows applications to work on Linux, you need to recode the whole Windows API. Which is both a huge task, and also a difficult one because, if I'm not mistaken, huge parts of the API isn't public (and probably copyrighted, too). And Microsoft software engineers code faster than Wine contributors reverse-engineer each entry point.


At the end of the day, the Ubuntu support in Windows is just the reverse of Wine... There's no Linux running on Windows, it's just real-time translation of syscalls. But it's easier to write since everything on the Linux side is open, AND Canonical helped.

Open-source the Windows API and I think you'll have quickly really impressive results (especially if Microsoft is directly helping). The comparison isn't really fair.

The "allow" was probably a bad choice of words... It's not a matter of actively closing the door, it's just hiding it.


And even Linux command line software support on Windows is still hit and miss.


That being said, if you really want to run a Windows inside Linux, it's actually pretty easy and it works well. That being said, the reasons I'm giving up on Windows are:
- I don't want to pay a license anymore (and I dislike more and more their ToS)
- I'm not fond of the recent interfaces, and with each version, the customization capabilities are narrower (on Windows 95/98, I used to use different window managers, for example).
So, I don't see really a point into running an actual Windows inside Linux...

For me, I don't want to run Windows inside of Linux. I'm already on Windows, but they have this fancy new bash shell that lets you run bash on Windows. Since cmd sucks, I want to use bash, but then I can't run Windows programs from inside bash, like my compiler toolchain for example. So it's basically relegated to find, gep, sed, ask which is kinda limiting. I wish it could run my compiler
 
That's literally what I work on. I've ported a few 500k-1m+ line projects. Anything in particular you want to know?

Wow, sounds impressive. I'm thinking of taking something old and just modernizing it, though I haven't figured out exactly what yet. This article inspired me.. Back when the Handmade Quake series was still a thing I was really enjoying getting back to coding in C almost every day and I want to get back into the groove.
 
Wow, sounds impressive. I'm thinking of taking something old and just modernizing it, though I haven't figured out exactly what yet. This article inspired me.. Back when the Handmade Quake series was still a thing I was really enjoying getting back to coding in C almost every day and I want to get back into the groove.

Modernizing old code is a worthy goal, but it's a pretty different beast from porting. Whichever route you decide to go though, one of the best things you can do is look for new ways to test the code. If you find an old codebase that has no testing infrastructure at all, add one. I'm personally pretty fond of gtest. If there's already a test system in place, add more tests.

Adding tests is a good way to learn the ins and outs of a codebase, and you find opportunities for modernization and/or porting along the way. Start with simple data structures. Is there a red black tree or some kind of generic data structure implemented? An options parsing framework? Along the way you'll find things that are hard to test because something simple and seemingly independent depends on some other major component, so you can't test the "independent" thing without setting up some complicated object hierarchy. These are good candidates for refactoring and introducing abstractions.

All the while you're getting experience with the codebase and learning how it works.

Choose something with an active open source community or you'll burn out quickly, feeling like there's no practical value in what you're doing. Plus having contributions to major open source projects on your resume looks good.

Not *too* big though, or you'll find out there's already a massive testing infrastructure in place and you'll spend more time trying to find something to test than actually getting your hands dirty.

I used to hate tests. I just wanted to write cool code. Add features, etc. But man, it feels so good to burn through a test suite of 50,000 tests and everything comes out clean. Especially when you're working on a big project, and you're the goto guy for components X, Y, and Z, you don't have to worry about wasting your time fixing a thousand bugs in the components you own, because with a comprehensive set of tests, the person who breaks something will find out before they commit, and it's on them to fix it.

Edit: Also, I just read that article. The type of porting he did is very different than what I'm used to. He took a piece of software, made it work on a different platform, and shipped it.

It doesn't appear that there was any requirement for him to make sure there was a SINGLE codebase that ran on Linux and the original platforms. He mentions that porting is not software development, but making something cross-platform very much is. It depends on the scope of the project though and it can vary wildly.
 

Koren

Member
For me, I don't want to run Windows inside of Linux. I'm already on Windows, but they have this fancy new bash shell that lets you run bash on Windows. Since cmd sucks, I want to use bash, but then I can't run Windows programs from inside bash, like my compiler toolchain for example. So it's basically relegated to find, gep, sed, ask which is kinda limiting. I wish it could run my compiler
You can't? Why? That's a strange idea to keep both world apart... The main reason I'm running Cygwin is to be able to run bash and Linux tools, while keeping access to any Windows binaries.

It doesn't appear that there was any requirement for him to make sure there was a SINGLE codebase that ran on Linux and the original platforms.
You still have to access the original toolchain to be able to check whether your ported code still work on the original platform, which isn't always convenient.

That's the reason why I believe in middleware and cross-platform toolkits and toolchains. Once you've developped something for those, it should work on any platform that support those.

Supporting several toolchains and toolkits is like, to me, writing code that compile in different computer languages: it's a nice exercise, but it's kinda vain.
 

KingJ2002

Member
I've been contemplating going into a program to gain a better understanding of javascript and other programming structures and I wonder what the community thinks of bootcamp programs.

For the people that have been a part of them... what are the pros and cons? is it worth taking out a loan for it or should i continue to work with free resources such as codecademy and code wars?
 
You can't? Why? That's a strange idea to keep both world apart... The main reason I'm running Cygwin is to be able to run bash and Linux tools, while keeping access to any Windows binaries.


You still have to access the original toolchain to be able to check whether your ported code still work on the original platform, which isn't always convenient.

That's the reason why I believe in middleware and cross-platform toolkits and toolchains. Once you've developped something for those, it should work on any platform that support those.

Supporting several toolchains and toolkits is like, to me, writing code that compile in different computer languages: it's a nice exercise, but it's kinda vain.

Why? If it runs on multiple platforms, whether it be through one cross platform codebase or multiple forks, there's going to be bugs. Suppose you start with one codebase, ship it, fork it and then port the fork, then ship the port. Now a bug pops up. Chances are you need to fix it twice now.

A properly designed cross platform codebase has the platform specific bits very localized and the other 95% of it is all shared

It doesn't always matter because maybe it's throwaway code like a game where you ship it, support it for 2 years and then it's done.

But maybe it is the middleware. Or the toolchain. Or otherwise some piece of software that you need to support indefinitely.
 

Koren

Member
Why? If it runs on multiple platforms, whether it be through one cross platform codebase or multiple forks, there's going to be bugs. Suppose you start with one codebase, ship it, fork it and then port the fork, then ship the port. Now a bug pops up. Chances are you need to fix it twice now.

A properly designed cross platform codebase has the platform specific bits very localized and the other 95% of it is all shared

It doesn't always matter because maybe it's throwaway code like a game where you ship it, support it for 2 years and then it's done.

But maybe it is the middleware. Or the toolchain. Or otherwise some piece of software that you need to support indefinitely.
Well, toolchains and middleware are special cases...

Beside this, I vouch for portability. That's one of the reasons I won't use Visual.

That being said, do and dont seems ill-fated to me here, since it's a case-by-case problem. I agree that you can raise the problems with bugs.

But it depends on who did the original, whether it's still maintained/developped, who do the port and why, if they share the same views, if port require rewriting some structures, if the port is multiplatform itself, although with a different toolkit (which can make the original useless), if the originalis still used, if the people doing the port CAN even test whether the original still work...

If you can factorize the code for portability, that's all good, but if the issues are greater than the benefits...

Now, a single company that actively work on two forked versions, they better have good reasons.
 
Well, toolchains and middleware are special cases...

Beside this, I vouch for portability. That's one of the reasons I won't use Visual.

Visual studio is just an Ide. Of course this hasn't really been true until recently, as it has always tied you to Microsoft's toolchain and build system. But now with CMake you can target the visual studio project system as well as more portable ones like make or ninja. With clang you can have a single compiler that can target (and even cross compile!) code for any platform. You can do it all from visual studio (if you're using CMake, for example). Add bash into the mix and now you can cross compile for Linux from Windows, and immediately turn around and run it *in linux* on the same machine. This is even better than what you get coming from the other direction with Wine, because Wine is not a true implementation of Windows. It's not the actual Windows bit for bit user space running on linux. It's someone's best effort at rewriting it.

In fact I would argue that having a Windows first mentality is exactly what you should do if you are trying to write portable code, because that's where all your assumptions are going to break down, forcing you to design the proper cross platform abstractions early when it's easy, rather than after everything depends on your broken assumptions and it's too late.

See Git for Windows as an example of portability done wrong for this very reason
 

JesseZao

Member
Been hitting a roadblock at work trying to read files in a remote directory from within an intranet C# MVC app.

Previously, I've just had a virtual directory created on the app root which pointed to a local folder on the server. I can manage/interact with the directory just fine in this context.

Now, the files I need to read are on a network share and the previous system is now being denied access. Is the problem purely a permissions/IIS configuration or is there another way to access a remote drive?

I only handle the coding end, so I don't know for sure how my colleague configured the virtual directory or the server.

Has anybody dealt with this niche use case before?
 

Kieli

Member
Is there any good online resources to learning simple parallel computation/concurrency concepts like locks, monitors/mutexes, semaphores, threads, interrupts, and so on?

I'm struggling immensely right now with this section as I can't seem to implement even the most simplest of functions.
 
Is there any good online resources to learning simple parallel computation/concurrency concepts like locks, monitors/mutexes, semaphores, threads, interrupts, and so on?

I'm struggling immensely right now with this section as I can't seem to implement even the most simplest of functions.

Is this for a course or for your own personal development? Do you want theory or practice? A particular programming language or general concepts?

There's a lot of good resources on multithreaded and parallel programming but it really depends what you're looking for
 

Kieli

Member
Is this for a course or for your own personal development? Do you want theory or practice? A particular programming language or general concepts?

There's a lot of good resources on multithreaded and parallel programming but it really depends what you're looking for

I'm taking a simple course in computer architecture and I want to pass the final exam because 50% of the material will be on identifying concurrency problems and using the pthread API to resolve them.

We are coding in C (which I love more than C++ because it isn't trying to masquerade as OOP).
 
I'm taking a simple course in computer architecture and I want to pass the final exam because 50% of the material will be on identifying concurrency problems and using the pthread API to resolve them.

We are coding in C (which I love more than C++ because it isn't trying to masquerade as OOP).

Ouch, I'll ignore that brutal unprovoked attack :)

For pthreads specifically this book is the goto authority, and for a conceptual and theoretical background, try this one. The best work i know is the free online book Is Parallel Programming Hard, and if So What Can We Do About It?, but it's quite long and if you just need to pass a final, it might be too much
 

Koren

Member
Visual studio is just an Ide.
I was talking about the toolchain, not the IDE. I'm not really into testing whether the code compiles fine with too many compilers, and deal with different syntax in the odd case I need a pragma...

I know CMake is now supported, I think it's great.

because Wine is not a true implementation of Windows. It's not the actual Windows bit for bit user space running on linux. It's someone's best effort at rewriting it.
Linux on Windows is real-time translation of system calls, it's not that different from Wine...

In fact I would argue that having a Windows first mentality is exactly what you should do if you are trying to write portable code, because that's where all your assumptions are going to break down, forcing you to design the proper cross platform abstractions early when it's easy, rather than after everything depends on your broken assumptions and it's too late.
Well, I'm not sure I see exactly what you're alluding to, but since most people I could distribute the software I write will probably be Windows users, it's my first concern...

See Git for Windows as an example of portability done wrong for this very reason
I've used git on my Windows laptop for my robotic club for seven years, and I wasn't even aware that there were a problem with it ^_^ But maybe I'm not using the git you're talking to. What are the issues, I'm curious?

That being said, I think, personally, that Git is awful. I'm sold to Mercurial...

For pthreads specifically
Out of curiosity, is there still any reasons (beside support issues) to still use pthreads over std::thread? I was reluctant to add a Boost "dependency" (although many see Boost as part of core C++), but know it's in the norm...
 

robin2

Member
I've written this Java class.

Code:
public class TerrainGenerator {
	
	private static abstract class TerrainGradient {
		public static int Ra;
		public static int Rb;
		public static int Ga;
		public static int Gb;
		public static int Ba;
		public static int Bb;
	}
	
	public static class Classic extends TerrainGradient {
		public static final int Ra = (210 - 100) / (63 - 0);
		public static final int Rb = 100 - (Ra * 0);
		private static final int Ga = (185 - 120) / (63 - 0);
		private static final int Gb = 120 - (Ga * 0);
		private static final int Ba = (170 - 50) / (63 - 0);
		private static final int Bb = 50 - (Ba * 0);
	}
	
	public static final class Mountain extends TerrainGradient {
		private static final int Ra = (245 - 45) / (63 - 0);
		private static final int Rb = 45 - (Ra * 0);
		private static final int Ga = (240 - 40) / (63 - 0);
		private static final int Gb = 40 - (Ga * 0);
		private static final int Ba = (235 - 35) / (63 - 0);
		private static final int Bb = 35 - (Ba * 0);
	}

	public static final int[] generateVoxelColor(TerrainGradient gradient, int voxelYCoordinate) {
		return new int[]{
			gradient.Ra * voxelYCoordinate + gradient.Rb,
			gradient.Ga * voxelYCoordinate + gradient.Gb,
			gradient.Ba * voxelYCoordinate + gradient.Bb
		};
	}

In my noob mind it should work like this:
elsewhere i call the method "generateVoxelColor", passing as first parameter one of the static nested classes, to determine which type of terrain color to compute. example:
Code:
int[] colorRGB = generateVoxelColor(TerrainGenerator.Classic, myYCoord);
But in this call the "TerrainGenerar.Classic" bit gives me an error: "cannot be resolved to a variable".
Am I required to make instances of classes (so not making them static) to be able to pass them?
 

JesseZao

Member
The way you're calling .Classic is as if you're passing an instance. Since you made everything static, you have to call static variables directly from the class.

I'd you really want to keep this pattern, then you could pass an enum that represents each subclass and then use a switch statement to call the correct class static variables.

I'd probably look at not making the classes/variables static and just have a static default or make the child classes singletons. The parent class could just be an interface as well.

Making everything static is ugly.

Edit: With this pattern you also duplicated your variables. You're never using the variables in your parent class. It looks like you meant to use an interface.
 

Jokab

Member
I think that's doing what you want:
Code:
find d1 d2 -name "doc" -exec cp -r --parents {} `dirname $1/{}` \;
You're obviously need the /
Edit: well, not really... but I find handy to be able to use as argument a directory with or without the last /

But when doing cp --parents to copy a directory, you don't have to specify the name of the copied directory. dirname allow you to strip the last element of the path.

Just had the chance to try this at work, and it seems to work. Thanks!

Can you elaborate on why it works?
 

Koren

Member
Just had the chance to try this at work, and it seems to work. Thanks!

Can you elaborate on why it works?

Suppose you want to copy the directory /a/path/to/dir/ to /another/path/to/dir/, you would write
Code:
cp -r --parents /a/path/to/dir/ /another/path/to/
omitting the last "dir/" (don't ask me why, I still don't know why you can't rename the directory while copying it using --parents)

So, you need to convert the /another/path/to/dir/ you get with $1/{} into /another/path/to/

That's exactly what the dirname command is doing: removing the last element of a path.

The `...` means that you want to execute the command between the backquotes and use the result in the other command outside the backquotes. It's really handy.


As for $1/{} or $1{}, since it's concatenation, it doesn't matter...
But if you write $1{}, you have to put a / at the end of your argument.
If you write $1/{}, you can avoid the / or put it (a//path////to///dir is perfectly correct), it doesn't matter, so I prefer the second solution.
 

poweld

Member
You can't have static abstract classes.

Edit: wait, what. You can. How does that work?

The static modifier to a class is only applicable to an inner class, and pretty much promotes it to behaving as though it were a top-level class. It can be referenced and instantiated without referencing or instantiating the outer class.

I've written this Java class.

*snip*
I'd recommend passing along an instance of TerrainGradient to the generateVoxelColor method. If you're concerned about creating new instances when you're just referencing static variables, consider using the Singleton pattern (careful if you're multi threading).
 

Makai

Member
I've gotten really pessimistic on the usefulness of Scrum. Appears to be complete snake oil, not to mention exactly opposite of the agile manifesto.
 

poweld

Member
I've gotten really pessimistic on the usefulness of Scrum. Appears to be complete snake oil, not to mention exactly opposite of the agile manifesto.

I found myself in the same position after years of agile. I'm so very thankful that my current gig doesn't adhere to that nonsense.

firewall: I'm sure it can work for some groups, but I've never seen it be effective myself.
 

Somnid

Member
I've gotten really pessimistic on the usefulness of Scrum. Appears to be complete snake oil, not to mention exactly opposite of the agile manifesto.

Most anything related to "agile" is just trying to cram certain values into an existing corporate structure. People hate these things not because they don't work but because it's often at odds with something else in the organization and therefore takes on the feeling of pretending to be something it's not.
 

Jokab

Member
Suppose you want to copy the directory /a/path/to/dir/ to /another/path/to/dir/, you would write
Code:
cp -r --parents /a/path/to/dir/ /another/path/to/
omitting the last "dir/" (don't ask me why, I still don't know why you can't rename the directory while copying it using --parents)

So, you need to convert the /another/path/to/dir/ you get with $1/{} into /another/path/to/

That's exactly what the dirname command is doing: removing the last element of a path.

The `...` means that you want to execute the command between the backquotes and use the result in the other command outside the backquotes. It's really handy.


As for $1/{} or $1{}, since it's concatenation, it doesn't matter...
But if you write $1{}, you have to put a / at the end of your argument.
If you write $1/{}, you can avoid the / or put it (a//path////to///dir is perfectly correct), it doesn't matter, so I prefer the second solution.
Ah, I see. Seems obvious now that you've explained it.

I've gotten really pessimistic on the usefulness of Scrum. Appears to be complete snake oil, not to mention exactly opposite of the agile manifesto.
I very much disagree that Scrum is not agile. What about it do you think is not agile?
 

Kansoku

Member
Can you guys elaborate on the Scrum/Agile stuff? I'm just entering the market now and I'm curious about your opinions. There's some stuff I don't like, but can't say for sure whose fault it is (if its agile, if its the company, if its the people, etc.).
 

Somnid

Member
Agile is really just a bunch of simple ideas that anyone who's worked in software for bit immediately realizes.

- Release early and often. Early releases provide value, it makes no sense to hold up business or consumer value on a few features, they can be updated and improved later. What's more important is you get feedback, because usage data is what makes you build good products, not sound-smart ideas.

- Continual feedback and development. Software is never "done." It ships but modern consumers expect updates, and you learn quite a bit about your own product when people use it. The end result may not be what you envisioned when you started, so you keep improving and keep expecting change.

- The team decides how it wants to work. Your programmers know what they need better than anyone, design knows what they need, as does QA, that, and every project is different so let them use the tools and strategies they find are most effective given the requirements.

- Reassess working structure. You make assumptions and sometimes they are wrong, sometime unforeseen things happen. The team should evaluate their own process regularly to see if there are places for improvement.

Where it goes wrong:

- Existing management, business structure mandates unneeded or unwanted things.
- Scrumaster or PO tries to manage, rather than stick to their role.
- Bureaucracy makes getting things hard (very often IT is a huge bottleneck).
- Assuming software development is a "one-time" cost.
- Not paying enough attention to process improvement (just concentrating on deadline)
- Not allocating enough resources, bad dev to QA ratio, unavailable designers etc.
- Adherence to agile "rituals" (poker estimation, demos, retros, standups etc) even when they aren't providing team value
 

Koren

Member
Awesome thread! Working my way through Learn Python The Hard Way.
Maybe I'm repeating myself, but this book is #1 on my list of worst programming books ever written for any language I've read. And I've read a LOT of bad books.

I don't understand how it's suggested so often... even if I'm suppose that there's different books for different kind of people.


(And yes, I know I'm definitively not the target... I read it looking for ressources for beginners students, not for myself. I just disagree with many, many choices, the only thing I easily agree with is the fact that you shouldn't copy-paste).
 

Makai

Member
I very much disagree that Scrum is not agile. What about it do you think is not agile?
First rule of the manifesto:

Code:
Individuals and interactions over processes and tools
Suddenly, it's all about points, tickets, meetings, etc. Collaboration is discouraged because you won't get points for it. Unplanned refactoring and promoting the health of your codebase is discouraged because you won't get points for it. Fixing bugs is discouraged because you won't get points for it. And holy shit, there was a long period where we had a bunch of meetings to discuss whether we should add more meetings. Huge productivity sucker because the time leading up to, during, and after a meeting is time I'm not coding or in the groove of coding.
 

Makai

Member
I taught somebody on the web team generics today. I was pretty shocked they hadn't heard of them before. Like I know they're used to dynamic typing, but surely they've run into it before.
 

Somnid

Member
First rule of the manifesto:

Code:
Individuals and interactions over processes and tools
Suddenly, it's all about points, tickets, meetings, etc. Collaboration is discouraged because you won't get points for it. Unplanned refactoring and promoting the health of your codebase is discouraged because you won't get points for it. Fixing bugs is discouraged because you won't get points for it. And holy shit, there was a long period where we had a bunch of meetings to discuss whether we should add more meetings. Huge productivity sucker because the time leading up to, during, and after a meeting is time I'm not coding or in the groove of coding.

That's just bastardizing it into a classic business style. Points are just a means of tracking velocity so you don't overload and overcommit, you aren't trying to optimize them.

And you should be tracking longer meetings and refactoring (whether anyone wants to do that though...)
 
I posted this to the UE4 AnswerHub and Forums and I still haven't got a response yet on how to fix this so I thought "well shit, might as post this as many places possible. See if someone's encountered this".

I've been following the Building an RPG in Unreal book to help me transition from C# to C++ and Unreal. There's some....real issues in this book but it's a super good resource in learning turn based in that engine.

Anyway.

So, I've been fixing issues as I go along as best as I can and I hit this snag when compiling

Code:
 TestDecisionMaker.h (8) - error C2504 : 'IDecisionMaker': base class undefined
 TestDecisionMaker.h (10) - error C3668: 'TestDecisionMaker::BeginMakeDecision': method with override specifier 'override' did not override any base class methods
 TestDecisionMaker.h(11) - error C3668 : 'TestDecisionMaker::MakeDecision' : method with override specifier 'override' did not override any base class methods

Normally the C2504 error would let me assume that the IDecisionMaker class hasn't been included into the script, however

TestDecisionMaker.h

Code:
#pragma once
 
 #include "IDecisionMaker.h"
 
 class TestDecisionMaker : public IDecisionMaker
 {
 public:
     virtual void BeginMakeDecision(UGameCharacter* character) override;
     virtual bool MakeDecision(float DeltaSeconds) override;
 };

Errr.......so the include is right there and it's declared as inheriting from IDecisionMaker.
So! The next two errors I imagine are totally because it can't define IDecisionMaker as the base class, but I'll attach the TestDecisionMaker.cpp script below in case I've missed something.

Code:
 #include "DickAround.h"
 #include "TestDecisionMaker.h"
#include "TestCombatAction.h"
 
 
 
 void TestDecisionMaker::BeginMakeDecision(UGameCharacter* character)
 {
     // pick a target
     UGameCharacter* target = character->SelectTarget();
     character->combatAction = new TestCombatAction(target);
 }
 
 bool TestDecisionMaker::MakeDecision(float DeltaSeconds)
 {
     return true;
 }

Project name is literally because I intended it to be a project to mess around with.
I should really rename the project...

So I know this is might be more an "Unreal Engine" problem, but I figured that someone around who's familiar with C++ encountered both C2504 and C3668 at once. *fingers crossed*
 

Makai

Member
Most anything related to "agile" is just trying to cram certain values into an existing corporate structure. People hate these things not because they don't work but because it's often at odds with something else in the organization and therefore takes on the feeling of pretending to be something it's not.
We even have a full time agile coach.
 

balgajo

Member
Passed here just to comment that I'm porting Qt5 for an embedded device and the compilation process already surpassed 1,5 hour...
Fuck...Stucked at work 4:00 a.m
:(
 

Kieli

Member
Passed here just to comment that I'm porting Qt5 for an embedded device and the compilation process already surpassed 1,5 hour...
Fuck... :(

At least your thing compiles. I saw something that really cracked me up
Code:
/*
 * DO NOT REMOVE OR PROGRAM WILL NOT COMPILE
 */

#DEF FIVE 5
#UNDEF FIVE 5
 

Rush_Khan

Member
I just wanted to say that regular expressions have become a regular part of my daily programming life (I'm doing a lot of extraction from files). I encourage everyone here to learn about them if you haven't already, they're one of the most powerful tools I've ever used.
 

Kieli

Member
I just wanted to say that regular expressions have become a regular part of my daily programming life (I'm doing a lot of extraction from files). I encourage everyone here to learn about them if you haven't already, they're one of the most powerful tools I've ever used.

I don't like regular expressions. :(
 
Regex is super powerful.

When I was presenting my own app and a user wanted to search for something specific I told him to just type regex into the search field. Apparently they didn't think this was a very good solution even if it's the best solution.
 
Top Bottom