« first day (2995 days earlier)      last day (2032 days later) » 

1:00 AM
In Unity3D im trying to set the directional light a little behind the main camera by using this script `

using UnityEngine;

public class cameraLight : MonoBehaviour {

public Transform cameraPosition;

// Use this for initialization
void Start () {
transform.position = cameraPosition.position;
transform.rotation = cameraPosition.rotation;
}
}`

But nothing happens. I have assigned the transform component of the main camera to the variable cameraPosition
 
 
1 hour later…
2:05 AM
@DMGregory :)
 
2:16 AM
@abobakrdy Why not just parent your directional light to your camera, that way it follows automatically, no script required?
 
 
4 hours later…
5:48 AM
@Josh uh.. i think i made it, it generates and compiles everything..
i'm not sure about one thing though
at the end of the file, it seems that link_directories("blabla.lib") is not working.. is it because the target is a static library?
@DMGregory congrats!! :D
 
 
4 hours later…
9:30 AM
oh well, i actually found something useful: rix0r.nl/blog/2015/08/13/cmake-guide
 
 
5 hours later…
2:23 PM
@GabrieleVierti Thank you! :)
 
2:58 PM
Well, it seems I can legally buy pot now...
@DMGregory and you too :P
 
3:15 PM
:D
 
@Almo hehe and you too Almo!
Someone made the math, and came to the conclusion that it's going to be cheaper to buy a joint than to buy a coffee from Starbucks.
 
Why stop there? It's only a matter of time before Starbucks makes a 4:20 brew - it'll cost more than both combined.
 
@Pikalek Oh, yeah, why not!
 
Well, I haven't checked the fine print in your legal code - I'm not sure what sort of licensure is involved with providing forms of said product. Also, I don't know how that might interact with rules regarding public use. Still, if there's profit to be made, eventually businesses will seek out opportunities.
 
@Pikalek Ah, you're right. They won't allow it. As for the places where it can legally be consumed, that's where the crap hits the fan.
In Montreal, some neighbourhoods will allow it everywhere cigarette is allowed, and some will just forbid it in any public places. So if you live in that neighbourhood, and your landlord has forbidden smoking in their building, you're kind of screwed. You'll have to go smoke in another neighbourood. Or keep on smoking illegally.
 
3:33 PM
@AlexandreVaillancourt The golden rule right? Those with the gold (or in this case property ownership) make the rules.
 
:D
 
Yeah, well I can understand them wanting to preserve their investment.
 
user4704
@GabrieleVierti I'd recommend against link_directories.
 
user4704
In general, the CMake commands that manipulate targets but do not take targets as reference (and/or don't include "target" in their name) are probably old cruft you should avoid because they manipulate a bunch of implicit state.
 
user4704
using target_link_libraries directly is better
 
user92578
3:39 PM
why is all software first written like that?
 
user92578
glPushMatrix etc.
 
@Josh but that still wouldn't work right?
 
user4704
@GabrieleVierti It would work fine.
 
user4704
The reason "link_directories" doesn't work for you is that you are doing it wrong.
 
you can't link .lib files to other .lib files
 
user4704
3:40 PM
Sure you can.
 
@Josh Going through the back log & applying as needed sounds like a good alternative to me having 'spirited debates' with my compiler output.
 
user4704
link_directories() tells the linker what directories to search when looking up library names to link.
 
user4704
What you are passing to link_directories in your code looks like actual library names
 
uh huh
 
user4704
So that will not result in the linker trying to link those libraries.
 
user4704
3:42 PM
Only in trying to search directories with those names (which don't exist) when it does link libraries (which never happens because you don't ask for it to link anything)
 
oh yeah ahahaha that's so true tho :D
 
user4704
In general you never need link_directories, specifically, because you do everything in cmake with absolute paths. find_package(Foobar) and such will give you absolute paths to libraries for that package, so target_link_libraries(MyTarget PRIVATE Foobar) will link using the full path
 
user4704
@Pikalek I'm not sure if the tag is actually the best/easiest way to identify "this is current policy" though?
 
user4704
A big CW like we have for the tags might be better. I'll update my answer a bit
 
@Josh you can though? i didn't know that..
 
user4704
3:47 PM
@GabrieleVierti "linking" is basically just shoving object files together, so yes
 
user4704
you can
 
huh.. well thanks anyway!
 
user92578
class IFileStream
{
public:
	virtual void ReadLines(std::vector<std::string>& lines) = 0;

	std::vector<std::string> ReadLines();
};
 
user92578
Why does providing an implementation for the virtual function hide the other function, so that it cannot be called at all?
 
user4704
@Tyyppi_77 It shouldn't? How are you "providing an implementation?" are you replacing = 0 with {}, or implementing in a subclass?
 
user92578
3:51 PM
implementing in a subclass
 
@Josh oh also, do you have to provide both header and cpp files in the add_library function? can you just omit them?
 
user4704
(also return-by-value on that vector >:)
 
user4704
@GabrieleVierti A library is neither a header file nor a cpp file.
 
user92578
It's a convenience function that makes one and calls ReadLines(madeVector);
 
user4704
3:52 PM
Go look at what add_library does.
 
user92578
No way to avoid the return by value I believe
 
user4704
(You can omit the header files since you don't need to pass them to the compiler, but you shouldn't because they won't appear in your generated project files then, and that makes them harder to use.)
 
user92578
That's really weird, I can't see why my code does not compile
 
user4704
Even if you include the header files in the listing, the generated files won't pass the headers to the compiler.
 
user4704
@Tyyppi_77 Can you shove a minimal example on godbolt? Or copy-paste the actual error at leats?
 
user92578
3:55 PM
ReadOnlyFileStream::ReadLines': function does not take 0 arguments
 
user92578
I'll try to setup something that does not compile on godbolt
 
@Josh so that means that i don't have to list them,but at the same time i do, otherwise the generated project would not work?
 
user4704
@Tyyppi_77 So one ReadLines is calling the other ReadLines?
 
user92578
yup
 
user4704
The no-arg one calls the virtula one? Or the other way around?
 
user92578
3:57 PM
no-arg calls virtual
 
user92578
std::vector<std::string> IFileStream::ReadLines()
{
	std::vector<std::string> results;
	ReadLines(results);

	return results;
}
 
user4704
Should be fine; if you do the other way from the derived class you'd need to prefix the call with IFileStream:: in some cases.
 
user4704
@GabrieleVierti You don't have to, but you should, yes. you don't have to list more than one .cpp file
 
user4704
You can just add foo.cpp
 
user4704
and have foo.cpp #include "bar.cpp" and so on
 
user4704
3:59 PM
But that's dumb.
 
user4704
So don't.
 
user4704
Not listing the headers can also exclude them from dependency checking done by certain cmake generators. So basically you always should.
 
you can include .cpp files from other .cpp files??
Man i really need to get some C/C++ book to read and memorize :P
 
user92578
it's just a file extension
 
user4704
4:04 PM
#include is dumb textual copy-paste.
 
but still, it's cool ..
 
user4704
You can #include jpgs if you wanted
 
but that wouldn't compile..
 
user4704
It might.
 
user92578
yeah if prefixed with the right stuff
 
4:05 PM
how hahahahah :)
 
user92578
I use some magic macro stuff for coupling data with enums
 
user4704
Type "int main(){}" into a text file, save it.
 
user4704
Rename it foo.jpg
 
user4704
#include "foo.jpg" Profit
 
well ok hahahaha
i was assuming jpgs didn't have c++ code in them :D
 
user92578
4:07 PM
dunno why i cant get godbolt to not compile my code, i'm doing a rebuild to see if visual studio is just acting up
 
user4704
They wouldn't even really need to, a binary file that had some bytes that as ASCII were equivalent to whitespace followed by // for example, could also work as long as it didn't have embedded nulls, etc
 
eeeh
sounds so much like a super-special case scenario, but ok
one thing i don't understand about programmers is all the "let's call an object foo or bar or foobar" stuff
 
user92578
 
user92578
Finally spotted the difference between your example Josh and mine
 
user92578
I have a pointer to AFileStream instead of IFileStream
 
user92578
4:09 PM
But why does it matter?
 
user4704
This is gonna make you rage
 
user4704
"i->IFileStream::ReadLines();" will fix you
 
user92578
omg why is that necessary?
 
user4704
It has to do with the name lookup rules, which are onerous.
 
user92578
all right, thanks a ton, definitely would not have figured this out by myself
 
4:13 PM
The terms foobar (), or foo and others are used as placeholder names (also referred to as metasyntactic variables) in computer programming or computer-related documentation. They have been used to name entities such as variables, functions, and commands whose exact identity is unimportant and serve only to demonstrate a concept. == History and etymology == The etymology of foo is obscure. Its use in connection with bar is generally traced to the World War II military slang FUBAR, later bowdlerised to foobar. The word foo on its own was used earlier. Between about 1930 and 1952 it appeared in the...
oooooh alright then
the more you knooooow!
oh yeah, have you seen this? youtu.be/kHBcVlqpvZ8
their robots are becoming so techy and andvanced overtime..
 
user4704
@Tyyppi_77 The relevant clause is 13.3.1.1.1 "Call to named function;" name lookup stops once "ReadLines" is found in AFileStream, so the overload set considers of exactly one item: ReadLines(vector) from AFileStream, and you're call with no arguments doesn't match it.
 
user92578
Sort of seems like an oversight in the system?
 
user4704
So the compiler yells. A using directive for IFileStream::ReadLines in the same scope should also work, I think, and is somewhat less surprising than the ->Scope::Bullshit()
 
user4704
I don't think it's an oversight, as it's never been "corrected" and there have been many attempts.
 
user4704
It's just how it is designed. The scope resolution/using stuff was added to address it. It doesn't actually come up all that much
 
4:19 PM
@GabrieleVierti I had a colleague with a programming naming policy that went something like this "if you cannot come up with a good clear name for the thing in question (variable, method, class, etc) then you should deliberately pick a clearly ridiculous one so as to not accidentally mislead others who might need to use/read/maintain your code"
 
user4704
By design, C++ has this property where the most-derived names "dominate" the less (en.wikipedia.org/wiki/Dominance_%28C%2B%2B%29)
 
@Pikalek oh that's great hahaha :D
 
@GabrieleVierti while I didn't always agree with him, when I see a variable named fred, I didn't make many assumptions about what it might represent. If it had been named rate I might have come to a wrong assumption about what proportion of change it represented .
Obviously, like many things, it can be taken to unusable extremes. The point being though, when I use foo in my code, I know that it's something temporary, that was difficult to name & needs to be changed.
I can waste a lot of time trying to code from the top down. Sometimes, it's better to just use foo and hand the problem of figuring out exactly what should be going on (and what names those things / actives need) to your future self.
 
cool! I'll start using these temp names starting from now
i think about var names wayy more than i should ;)
 
All things in moderation - future me sometimes begrudges the work that past me left unfinished.
 
4:27 PM
:)
 
Good names are hard because they are also important.
I resort to foo when the perceived cost of using it (i.e. the reduced clarity & increased difficulty in reading my code) outweighs the cost of not (i.e. spending another 20 minutes trying to see the pattern of my incomplete solution).
 
4:42 PM
1
Q: How are policy questions revisted?

PikalekWhat is the protocol for revisiting general policy decisions on meta? Specifically, I'm not talking about debating whether or not a particular situation warrants an exception to a rule. Rather, I'm asking about situations where the rule itself needs to be revised or replaced in terms of being a c...

0
Q: Should we clarify that game-specific tags are for mods?

JoshWe have several game-specific tags on the site, such as skyrim, world-of-warcraft and minecraft because modding questions for games are considered on-topic here. We also have mods, which serves as identifying questions about modding that are not game-specific or for games too unpopular to get ga...

 
 
2 hours later…
6:47 PM
Ok so, I'm creating the static lib, and I'm trying to link the other libraries to it. In Visual Studio i'm still getting unresolved external errors... somehow cmake is not linking the .lib files.
 
user4704
Again, you don't need link_directories() at all.
 
user4704
What's the exact error VS is giving you?
 
user4704
You probably don't need to be setting CMAKE_ARCHIVE_OUTPUT_DIRECTORY, et cetera, yourself either
 
how do you send images again? :D
 
user4704
Click the upload button.
 
user4704
6:55 PM
Just copy-paste the text.
 
user4704
From the output window.
 
ok
1>------ Build started: Project: test, Configuration: Debug Win32 ------
1>main.cpp
1>Omge.lib(OGLWindow.obj) : error LNK2019: unresolved external symbol _glfwInit referenced in function "public: __thiscall OMGE::OGLWindow::OGLWindow(char const *,int,int)" (??0OGLWindow@OMGE@@QAE@PBDHH@Z)
1>Omge.lib(OGLWindow.obj) : error LNK2019: unresolved external symbol _glfwTerminate referenced in function "public: __thiscall OMGE::OGLWindow::OGLWindow(char const *,int,int)" (??0OGLWindow@OMGE@@QAE@PBDHH@Z)
I've created a test project with only the .lib file linked to it
 
user4704
What is "test?"
 
the name of the test project
 
user4704
That's not in your cmakelists.txt
 
6:57 PM
yeah, because i created a new project
it's not the generated one
that one compiles fine
 
user4704
Well that's your problem.
 
user4704
(probably)
 
huh?
how could that be?
 
user4704
When you use target_link_libraries you're setting up transitive dependencies in cmake
 
user4704
But then you don't use cmake for the "test" project
 
user4704
6:59 PM
So that information about transitive dependencies is lost.
 
oh god this is so complicated
 
user4704
I mean, if you read the documentation, it says this.
 
user4704
"Library dependencies are transitive by default with this signature."
 
user4704
"When this target is linked into another target then the libraries linked to this target will appear on the link line for the other target too. This transitive “link interface” is stored in the INTERFACE_LINK_LIBRARIES target property and may be overridden by setting the property directly."
 
user4704
7:00 PM
If you're going to use CMake, you should use it for everything.
 
user4704
Your test project can just use add_subdirectory() in its own CMakeLists.txt to import the CMakeLists.txt of the library, or you can just make it all one big CMakeLists.txt, etc.
 
The thing is that i also wanted users to create a separate project and then use the .lib file to make an application
or maybe generate projects at runtime-ish
 
user4704
That's probably signing yourself up for a world of hurt.
 
user4704
Especially since:
 
user4704
a) you have no idea what you're doing and
 
user4704
7:03 PM
b) you have no users
 
okok
wait
It's a personal project
 
user4704
Distributing .lib files directly is problematic, because they need to be for the same architure/runtime/etc as the executable consuming them.
 
nothing big
 
user4704
So you have to build a ton of different versions.
 
gotcha
 
user4704
7:04 PM
For that kind distribution, you don't usually want your library to actually link against (as in include) standard libraries
 
user4704
because the user might want or need to use a specific version already
 
user4704
You need to just state the dependencies and their version and let the user sort it out.
 
huh..
I'll just stick to cmake then
 
user4704
Distributing the dependency as source, and with CMake, allows you to overcome most of this at the cost of having users have to build the library themselves. But this is usually advantageous for everybody, as long you take the time to make building your library reasonable.
 
alright thanks :)
@Josh it's incredible how I can get you worked up :D
 
user4704
7:07 PM
It's incredible how you think point out that you don't know what you're doing means I am "worked up."
 
I'm not trying to make anything huge, I'm just having fun, imitating people like you ;)
 
user4704
Sure. By that logic, your main() function should look like this:
 
user4704
int main() { int *p = 0; *p = 32; }
 
I'm not a dev, i have no experience
 
user4704
I mean, it's just a small learning project right? Doesn't matter if it's completely wrong, right?
 
7:08 PM
yeah
who cares in the end
I still want it to work well though
 
user4704
You'll just learn how to do everything wrong, and ultimately, have wasted your time.
 
it needs to be presentable to someone
@Josh but why?
 
user4704
Because if you learn a bunch of stuff that is wrong, what have you learned?
 
Then what should i do to "try make everything the way it should be done?"
 
user4704
Don't use the excuse "but it's just a personal project" to justify poor decisions.
 
7:10 PM
ok
then how can i make good decisions?
 
user4704
Mostly through experience.
 
I have no experience in the industry
there haha :D
 
user4704
You don't need experience in the "industry"
 
user4704
You need experience, period.
 
user4704
That means doing stuff, watching it fail, and learning from that.
 
user4704
7:11 PM
If you don't internalize the lessons you learn, it's a waste of time, though.
 
user4704
There's two ways you can do that:
 
What can i do to fail?
 
user4704
You can actually try things on your own, fail at them, and figure out why you failed and how to fix it.
 
isn't this what I am doing though?
 
user4704
Or you can listen to people who presumably know what they are talking about and accept (and/or dig into) their advice. Don't brush it off with childish excuses like "it's a personal project."
 
7:12 PM
I'm failing still
 
user4704
I mean for the most part, but not entirely.
 
user4704
Trying to link your library and failing and asking about it was good.
 
user4704
But then brushing off the explanation why your larger goal has problems was not so good.
 
user4704
The implication is that you're only going to take advice that is easy, or already aligned with what you want.
 
user4704
Which eventually will annoy people who try to help you, and make them abandon you.
 
7:14 PM
So I should try more on my own instead of asking for specific things?
 
user4704
No, not necessarily. All I'm trying to say is that "but it's a personal project so I don't care if I do it in an objectively bad way" is not conducive to learning about good ways to do things.
 
he's more saying that if you do ask a specific question, the proper response to an answer isn't "but I don't want to do it that way"
if you want a better way, feel free to ask; we like helping.
But repeatedly being greeted with "but I don't like that solution" is frustrating
 
I'm sorry about that
I understand
I'm seriously trying to work on it as best as I can though
 
I'm not mad, just trying to help. :)
 
Yeah I know, text is so inexpressive
I'm not mad, I'm just saying :D
So I honestly don't know what I am doing, true, but I'm putting all i can into it
 
7:22 PM
I hope it works out for you :)
 
yeah hahaha :)
I mean I'm just trying... i know i suck at it hahahahahaha :D
by the way...
i'll try to use cmake to create a project
I think I'm gonna go to bed now. Have a good night/day chat! :)
 
 
4 hours later…
11:30 PM
Hello
 
Hey
 
hi
 
Hey guys. How are you doing?
 
Trying to get better at work, work, life balance
 
that already sounds unbalanced
 
11:32 PM
Very unbalanced.
 
Super unbalanced - but if I ever wanna get to just standard work life balance I've gotta have that second work.
Alternatively I could just be all work, and not worry about the life part. Or maybe just work / work
 
I'm trying to figure out some code I wrote a while back. It's way too clever, and I'm now not as clever as I was when I wrote it.
 
I have a design choice that needs to be made very soon? Re-initialized my retro style for my game or 3d.
 
Always the worst - I wrote a card game system that managed the deck and hand with bitwise operations. Had to throw it all out.
What's the code?
 
A system-W-like type inference system
*algorithm W
 
11:37 PM
@Jimmy I have done that before. Wrote a pretty decent text game in C years ago. Now the source code just looks like madman's scribblings. Probably was actually...
 
@JesseDorsey cut the tie and beard and you got me planning and trying to explain my game project ideas.
 
woah namechange
 
I know. Thought I accidently pinged someone else at first when the message finally sent.
See you peoples laters. Ping me if ya have comments.
 

« first day (2995 days earlier)      last day (2032 days later) »