I think this is related to the string discussion. Scroll down to the Equality of Strings.
[URL="http://www.ikriv.com/en/prog/info/dotnet/ObjectEquality.html"]http://www.ikriv.com/en/prog/info/dotnet/ObjectEquality.html[/URL]
Not sure though.
About the whole string interning thing, just use ReferenceEquals and you'll see:
[code]
string foo = "test";
string bar = "test";
Console.WriteLine(Object.ReferenceEquals(foo, bar)); //Prints True
[/code]
[QUOTE=efeX;22031201]+1[/QUOTE]
+2
Anyone here active and working on SFML? I'm having issues running it on Linux. When using linker settings:
[code]lsfml-graphics
lsfml-window
lsfml-system[/code]
but I get the error: "cannot find -lsfml graphics".
Porting HLLib and HLExtract to Mac, because GCFScape doesn't exist for Mac, and it doesn't run via WINE or the like. One of the most painless ports I've done in a long time.
[QUOTE=nos217;22042459]Anyone here active and working on SFML? I'm having issues running it on Linux. When using linker settings:
[code]lsfml-graphics
lsfml-window
lsfml-system[/code]but I get the error: "cannot find -lsfml graphics".[/QUOTE]
Make sure that your linker is able to look in the directory where the libs are.
[QUOTE=nos217;22042459]Anyone here active and working on SFML? I'm having issues running it on Linux. When using linker settings:
[code]lsfml-graphics
lsfml-window
lsfml-system[/code]but I get the error: "cannot find -lsfml graphics".[/QUOTE]
Test:
[code][B]-[/B]lsfml-graphics
[B]-[/B]lsfml-window
[B]-[/B]lsfml-system[/code]
[img]http://grab.by/4svO[/img]
Excellent. :v:
Awesome
What do you guys name the main file of your projects? I used to just call it main.cpp, but recently I've started using the name of the project instead.
I'm trying to build a basic top-down RPG game. I'm following various online guides to help me do this. I've now managed to read a plain text file and recreate it in my form as the tiles that the text represents. This is all well and good.
[IMG]http://dl.dropbox.com/u/99601/tilesdemo.jpg[/IMG]
Ignore the question I asked previously, I was being stupid.
[URL="http://pastebin.com/ccZy0aA5"][/URL]
[QUOTE=Overv;22043748]What do you guys name the main file of your projects? I used to just call it main.cpp, but recently I've started using the name of the project instead.[/QUOTE]
I do both, but I usually just call it main.cpp
[QUOTE=Overv;22043748]What do you guys name the main file of your projects? I used to just call it main.cpp, but recently I've started using the name of the project instead.[/QUOTE]
I always name my files after the class they contain, so usually Program.cs
[QUOTE=Hexxeh;22043087][img]http://grab.by/4svO[/img]
Excellent. :v:[/QUOTE]
Saw your blog about running TF2 on mac. Might be tempted to give it a go later.
[QUOTE=explosiveegg;22043846]I'm trying to build a basic top-down RPG game. I'm following various online guides to help me do this. I've now managed to read a plain text file and recreate it in my form as the tiles that the text represents. This is all well and good.
[img]http://dl.dropbox.com/u/99601/tilesdemo.jpg[/img]
But now i'm trying to make this process into a class, so I don't have to add a shitload of code whenever I want to load a map. I am having trouble though, as the code to read the text file is in the class, but obviously the Handles Me.Paint part of the process needs to be in the form, this requires information that the class produces.
How do I get the information from my class back to my form? For anyone interested, the source code is here:
Form:
[url]http://pastebin.com/m2jQ8gZD[/url]
Class:
[url]http://pastebin.com/ccZy0aA5[/url][/QUOTE]
I'm not sure I understand your problem... Just pass it as constructor? Alternatively, you can have a method in your class called DrawMap or something like that that takes a Graphics object, and in your Form's OnPaint, just pass it that Graphics object.
Also, try-catching the whole thing is usually bad practice, try to prevent errors instead.
[QUOTE=Xeon06;22041965]About the whole string interning thing, just use ReferenceEquals and you'll see:
[code]
string foo = "test";
string bar = "test";
Console.WriteLine(Object.ReferenceEquals(foo, bar)); //Prints True
[/code][/QUOTE]
Also
[code]
object a = "foo";
object b = "foo";
Console.WriteLine(a == b); //Prints true
[/code]
[QUOTE=Ortzinator;22045470]Also
[code]
object a = "foo";
object b = "foo";
Console.WriteLine(a == b); //Prints true
[/code][/QUOTE]
That's for a completely different reason though, string literals are also pooled at compile time.
[cpp]
string a = "foo";
string b1 = "o";
string b = "fo" + b1;
Console.WriteLine(Object.ReferenceEquals(a, b)); //Prints false
[/cpp]
(Simply doing "fo" + "o" seems to result in a compile-time optimization, hence the intermediate variable)
Really Off Topic here: but why did my thread get locked? [url]http://www.facepunch.com/showthread.php?t=940324[/url]
[QUOTE=Loli;22045643]Really Off Topic here: but why did my thread get locked? [url]http://www.facepunch.com/showthread.php?t=940324[/url][/QUOTE]
Undescriptive thread title.
[QUOTE=Ortzinator;22045470]Also
[code]
object a = "foo";
object b = "foo";
Console.WriteLine(a == b); //Prints true
[/code][/QUOTE]
You don't understand. This doesn't explicitly prove that the reference are equals, since the string's Equals method probably checks for other stuff.
[QUOTE=robowurmz;22042846]Make sure that your linker is able to look in the directory where the libs are.[/QUOTE]
If you mean due to file permissions then it's definitely not that. The libraries are in my home folder and I've even tried running Code::Blocks as root, and that resulted in the same error.
[QUOTE=Xeon06;22046365]You don't understand. This doesn't explicitly prove that the reference are equals, since the string's Equals method probably checks for other stuff.[/QUOTE]
But it's not using the string's Equals method, it's using the object == operator.
[editline]03:05PM[/editline]
That's why I declared them as objects instead of strings.
Usually == checks for reference equality but that operator is overloaded for strings to check their value instead.
[QUOTE=hyrsky;22042935]Test:
[code][B]-[/B]lsfml-graphics
[B]-[/B]lsfml-window
[B]-[/B]lsfml-system[/code][/QUOTE]
Huh? That's what I have. Oh wait never noticed the dashes.
Yeah those hyphens are already in my linker settings, I just forgot them when I posted them here.
I just learned how to use the Shunting-yard algorithm and started working on an expression parser in C++. It detects parenthesis and operator/number mismatches.
[img]http://www.imgdumper.nl/uploads2/4bf43c90db835/4bf43c90d2f82-expression.png[/img]
Eventually I want to write an implicit equation solver like null, but without the graphing. It just returns the first solution it finds.
[QUOTE=Overv;22047000]I just learned how to use the Shunting-yard algorithm and started working on an expression parser in C++. It detects parenthesis and operator/number mismatches.
[img_thumb]http://www.imgdumper.nl/uploads2/4bf43c90db835/4bf43c90d2f82-expression.png[/img_thumb]
Eventually I want to write an implicit equation solver like null, but without the graphing. It just returns the first solution it finds.[/QUOTE]
How do you plan to calculate the solution? Even MS Excel has troubles with that.
What if you have a curve with multiple roots? You should implement a feature to return as many results as possible.
[QUOTE=nos217;22046413]If you mean due to file permissions then it's definitely not that. The libraries are in my home folder and I've even tried running Code::Blocks as root, and that resulted in the same error.[/QUOTE]
That's probably the error. I'll hypothesize that you have not set up the linker to search for libraries in your home folder, so it will only search in the default libraries folder (if any are set up, normally /usr/lib on UNIX based systems).
[IMG]http://i162.photobucket.com/albums/t259/nos217/Random%20Stuff/Screenshot-Compileranddebuggersetti.png[/IMG]
Hypothesize all you want.
[QUOTE=Overv;22047000]
Eventually I want to write an implicit equation solver like null[/QUOTE]
Cool. Minus the part where my grapher doesn't actually *solve* implicit equations :v:
Sorry, you need to Log In to post a reply to this thread.