phresnel

Members
  • Content count

    3046
  • Joined

  • Last visited

Community Reputation

953 Good

About phresnel

  • Rank
    Contributor
  1. Just about the technical side: [quote]2) C++ wouldn't allow it, even if I wanted it - the function parameters are too identical so the function names would collide.[/quote] C++ allows to overload on const and non-const references.
  2. What is bigger?

    [quote name='Atrix256' timestamp='1297726342' post='4774287'] Well if you think about it bitwise, like if these 2 "values" were being loaded into a register... NULL is just 0 NaN is nonzero thus NaN is bigger! [/quote] NaN is neither nonzero, nor isn't it nonzero. Dividing anything by NaN yields NaN again, which is neither nonzero, nor isn't it nonzero, nor is it infinity. Whereas when you divide a non-zero number by NULL, the result will be infinity. Therefore, the real question is whether NaN not being infinity not or not not being infinity is worth more than x/NULL, with x!=0, which always gives infinity. Wait. ... ... Theeeeeerefore, NaN is bigger. NULL means invalid, but the result of a computation that uses NULL as one of the operands is not necessarily invalid, whereas NaN always stays NaN, never mind you push or pull or accumulate or pop it. Hear ye: NaN is he true dominator of thy scientific number cruncher, whereas the fool NULL hides deep deep in thy pipeline.
  3. What is bigger?

    Ich verstehe nicht so ganz, was das "Auch" dort bedeuten soll.
  4. Texture a Sphere

    [quote name='Zwingling' timestamp='1297698482' post='4774121'] here is a link to a pic. of the tiger: [url="http://www.mperfect.net/cfMDX/_images%5CMeshes.JPG"]Tiger[/url] [/quote] nitpick: URIs always use forward slashes to seperate directory names. Actually, when you copy and paste the url target, you get http://www.mperfect.net/cfMDX/_images%5CMeshes.JPG i.e. you now have _images%5CMeshes.JPG as a filename. The corrected version is http://www.mperfect.net/cfMDX/_images/CMeshes.JPG
  5. Coder or Programmer

    [quote name='Alpha_ProgDes' timestamp='1297724375' post='4774280'] a developer, programmer, and coder. And for bonus points, a software engineer! [/quote] ... and of course there's "hacker", to make the confusion even worse. Personally, I mostly use the nouns "[software] developer", "[software] programmer", and the verbs "hacking", "tweaking", "coding", "programming" (so basically all of them). I don't put too much meaning in those.
  6. Coder or Programmer

    [quote name='Milcho' timestamp='1297679382' post='4774022'] And seriously, more name calling?[/quote] I don't know whether "skip acting like a prima donna" is 100% equivalent to a german saying which goes "Die beleidigte Leberwurst spielen" ("To act like a offended liverwurst" ), the dictionary proposed it. It roughly means "don't feel offended by things that weren't intentionally offensive, within some social group". It is usually not used to offend people. [quote]To those of you who didn't just bash me, but actually argued: Thanks for the input, I'm sorry this turned into an argument over what I didn't intend, and if you felt insulted by me, believe me, it wasn't my intention. [/quote] Anyways, believe us that nobody intends to offend you.
  7. [quote name='Dan Mayor' timestamp='1297655282' post='4773942'] MinGW, and Intel XE studio both come with command line compilers. You can use them without having to use their IDE's. I actually found a ton of responses on google searching for "C++ Command Line compiler for windows". None the less there's no need for you to install and store the huge Visual Studio solution if you are only using it's compiler. [/quote] Nitpicks: Every compiler available is a "command line compiler", even Microsoft's and the Apple-sponsored LLVM. MinGW is not an IDE and doesn't come with an IDE.
  8. Texture a Sphere

    [quote name='Zwingling' timestamp='1297626119' post='4773768'] haha sry I just set it to float : [code] float latitudeBands=20; float longitudeBands=20; for (float latNumber = 0; latNumber <= latitudeBands; latNumber++) { for (float longNumber = 0; longNumber <= longitudeBands; longNumber++) { [/code] [/quote] You should never rely on floating point equality: http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.17 . I would make those integers again, and within the loops, convert them to angles.
  9. Coder or Programmer

    [quote name='Milcho' timestamp='1297674780' post='4774002'] And I did ask for all your opinions, but I didn't think you would take it so harshly. [/quote] Imho, the only harsh posts in this thread were made by you. Others are only harsh in your opinion and yours only, and I actually don't know why. Skip acting like a prima donna. This thread contains some useful information. Sidenote: Using memcpy, malloc and mmap all day is not necessarily the equivalent of being decent. In many use cases of C++, using it all day is exactly the opposite of being decent. And for every non-POD type, they are simply wrong and yield undefined behaviour. So skip that, too.
  10. You need to rework your post. Before reposting, use the "Preview"-Button.
  11. [quote name='ryan20fun' timestamp='1297254764' post='4771840'] this is what im useing to export stuff from my dll right now class MyClass { public: __declspec(dllexport) MyClass(); }; you can alternatively do this __declspec(dllexport) class YourClass { }; // and that will export all the stuff from your class Hope this Helps, annd can you PlEASE PM me or somthing as i would REALLY like to know if defineing the entrypoint in your lib/DLL works [/quote] I propose to post any solution in this thread. PM kills the purpose of this forum and makes the whole thread absurd.
  12. Unfortunately, you must flatten out the library dependencies yourself. So, if you have libfoo.lib which depends on libbar.lib, and frob.exe ... [code] foo.exe | libfoo.lib | libbar.lib [/code] then you have to make the project file of foo.exe like that: [code] foo.exe | | libfoo.lib libbar.lib [/code] If it wouldn't be like this, libraries would grow to monstrous size, as they would have to include the full set of each and every symbol of recursively included libraries. Compilation of libraries would take significantly longer to compile, as for the huge symbol tables, as well as for the possibillity of (indirect) mutual dependencies.
  13. I'm a bit lost when it comes to public/private variables.

    [quote name='Khulad' timestamp='1296725205' post='4768944'] @phresnel Whilst technically correct, I prefer to use getters/setters if any errors could arise (i.e. incorrect value set), as (set) Properties in C# do not return a value. i.e. [code] public string SetName("string" name) { if (name == validName) { _name = name; return ""; } else return "You did not enter a valid name"; } public int main() { string result = SetName("invalid name"); if (result != "") log("error setting name with " + "invalid name. Errors was: " + result); return 0; }[/code] Now if properties are used this cannot easily be achieved. [/quote] Though this is not common, I think most people assume that setters are infallible, including enterprise frameworks like DevExpress or Qt. If you assign something to a setter, it is expected that it will succeed, as with constructors. If it fails, than via an exception. Consider that a setter is basically used like an assignment, and people don't assume that a simple assignment may fail. In your case, it should be like [code]class Foo { string name; string Name { get { return name; } set { if (!IsNameValid(value) throw SomeMeaningfullException; name = value; } } static bool IsNameValid(string name) { /* do validation and return accordingly */ } } class Bar { void doSomething() { string n = "Mario + Luigi"; if (!Foo.IsNameValid (n)) MessageBox.Show (string.Format("Invalid name \"{0}\"", n)); else ... } }[/code]
  14. [quote name='Seaßourne' timestamp='1296807957' post='4769417'] every distro has their own package manager [/quote] Uhm ... There are only two "mainstream" packaging systems, debs and rpms. And in many cases, carefully stuffed packages install on many distros that understand the package in question. The last deb I've personally distributed e.g. would install on at least Ubuntus 10.x, Debians 5.x, Mint and gNewSense (others not tested). O.P.: Maybe [url="http://freshmeat.net/projects/statifier"]ELF Statifier[/url] could be of interest to you, though it completely circumvents the whole idea behind package managers. An extravagant idea could also be to setup a virtualbox-image
  15. How many of you use C for game programming?

    [quote name='Seaßourne' timestamp='1296695679' post='4768816'] [quote name='Fiddler' timestamp='1296679116' post='4768701'] [quote]Well frankly I don't have problems managing my own memory.[/quote] You just haven't worked on a big enough application. The underlying issues are still there, you just haven't hit them yet. [/quote] Oh trust me I have. My own personal project is quite big [/quote] My own main project is not so big (just 60000 lines, roughly), but there's a lot of data-sharing. Keeping track of all the sharing would be near-impossible with raw pointers. Sub-components may insert new objects into parent-objects, and vice-versa, whole trees are passed into external components, data structures are extended, et cetera. Without shared_ptr's, I would really have a hard time keeping it correct while doing all the mutations. Which code in my codebase depends on properly managing specific objects? Which are forbidden to releasre objects? Et cetera. And if this paragraph is slightly chaotic, then that's by intention. Of course, a lot is possible (see e.g. the kernel linux), but the more you automate, the more time you have for actual features your users are interested in. [quote]and I don't have problems because I actually know how to control it[/quote] But your users possibly don't. They won't help you as RAII would in exceptional cases. The number of flow-permutations in only a small sized project of <10KLoC is usually big enough already to make good testing a nightmare, and automating the right deletion moment even for exceptional cases helps a zillion tons.