What happened to OC? - CLOSED Carnage?!

nil

Member
  • Content count

    110
  • Joined

  • Last visited

  • Raffle Tickets

    0

Everything posted by nil

  1. Of course, true programmers use tabs for indentation instead =P. Yet these forums seem to hate those as well for no good reason.
  2. I personally would stick with one OS I like to use most whilst having the option to boot into (or virtualize) other OS's when rarely necessary. I.e, your primary OS in your case would be Windows since you rely too much on developing for it, and games. Also, RAR files are evil. I rarely encounter even them. Whoever uses them should be shot.
  3. Not really. I'd rather run games natively than have them virtualized. You seem to heavily rely on Windows anyway for some reason =p. Age of Empires II has a native port but I believe it's dead old and unsupported. III is probably supported and runs, though. (EDIT: FYI, I know almost nothing about AOE, don't trust me on what I say here).
  4. Somehow coincidently, I've recommended people to start with the same tutorials WaeV mentioned, and an editor like sublime text 2 or notepad++. Never read them myself, though. And yeah, I favor Python over the other languages.
  5. Actually your answer is incorrect (although your code is correct). I'm sure you might know of some other ways..: [spoilers] But isn't one of the points of Project Euler not to give away solutions to people that haven't solved them? = ). [EDIT]: there's also "for number in (0...1000)"
  6. I've used the C implementations of Ruby, Python, and lua before. I'm clearly biased in that I can't possibly imagine working in an environment where it's difficult to talk to C \=. Didn't know you were trying to also embed an editor.
  7. Lua is appealing because it is lightweight and well documented on how to embed. Lua is terrible because it has a small standard library, making code difficult to write. I do not know about some of the other languages you listed, but I guess it depends on your needs. I personally prefer an extensive language over a lightweight one. I've no idea why you'd worry about autocompletion and syntax highlighting which aren't that important, and which are the programming editor's job (whichever one you decide to use). Making your own form of scripting is probably the worst way to go .
  8. I think your avatar is going to cause me headaches.
  9. The advantage of PHP is that it's been dominant in the web and installed on every server.. For a simple script I may use it. For anything complicated, I would probably venture into Ruby or Python web frameworks.
  10. Note I called parallelizing "tagsWithMeta.NextTagMetaOffset = tagsWithMeta[i + 1].MetaOffset;" part overkill, which I don't see any expensive computation in here. That is, unless you largely simplified the code here.
  11. I found this small function interesting since I'm totally unfamiliar with MS's frameworks. Now I'm guessing the "from file in... where file.Name...select file" is a part of LINQ, although I'm curious as to why it reads somewhat backwards (i.e, instead of select file from blah where name is.. or select file where name is.. from blah) This function appears to be a synchronous operation on whole, eg: file = GetFile("FileIWant.txt") if (file != null) { // this won't execute until GetFile is "done" } So why do asynchronous operations have to be used? I am guessing await waits for the "GetFilesAsync" operation, hence pausing execution anyway. I don't really see how raising an exception would be faster here either.
  12. Just some Halo today:
  13. C++ will give you the choice since it doesn't want to tie you to overhead, unlike other languages which don't give you the choice for more of a consistency and featureful reason (there are things you cannot do unless objects are on the heap). It's true Obj-C doesn't have namespaces and I was a little vague when I said namespace pollution but I meant this: in header file: using namespace whatever; pollutes everyone's code who #include's it. You may need to work with pointers which can be NULL, though. And if you want to pass it to a function that passes by reference, you have to dereference it. You may also have to check it's not NULL before dereferencing it. You're right that I'm not a fan of Java, and I would find exception handling annoying in it, but that's not really so much why I don't like the language. It gives me impression that it hasn't had any real updates in a long time, it is actually not very portable considering it requires you to install its virtual machine, we hear about exploits all the time as of recently, and it's not really that nice to code in.
  14. Choice between objects being on stack or heap, namespace pollution, lack of reflection, constructors on global variables, etc.. C++ has many faults I don't particularly find in other languages. A language is a tool, and the quality of it, will have an effect on quality of code. @nil: Trade-off between convenience and safety I suppose. Because messaging nil doesn't do anything, in some scenarios you can avoid polluting your code with != nil checks. This reminds me why I mostly hate exception handling and languages that impose that on me heavily.
  15. There's a few downsides for having messaging a nil object doing nothing but returning nil. Maybe a Haskell programmer would even argue the entire concept of null sucks. What I meant about interactive environment: I on occasion fire up irb or python to write an expression or small procedure to test. e.g, 0b101+3*2. Not fire up something in LISP and using an awkward notation like (+ 1 2) which kind of defeats the point.
  16. I'll give a list of languages I have used on some sort of basis. I don't think I know that many uncommon ones, unfortunately . C: A necessary language often used as lowest common denominator. Many low level and portable libraries are written in C, OS's and many high-level languages are written in this, and many languages are embeddable and extendable from this language allowing one to easily mix languages together. C++: A mess. Objects on stack vs heap? Pass by reference or pointer? Virtual vs non-virtual? Functions in header files? Can easily encounter bad practices (eg: #including 'using namespaces'). Lack of reflection. That said, C++11 has some nice things coming along like new use of auto, lambdas, and foreach loops. Have to try it out one day. Objective-C: A true superset of C that adds features from dynamic OO languages. Supports metaclasses, has the most readable messaging syntax from any language I've ever used, which is borrowed from Smalltalk. Supports neat tricks like forwarding messages an object may not respond to, method swizziling, changing an object's type dynamically, adding methods to a class via categories. Has automatic reference counting, optional static typing, can drop to C when needed. A little verbose as a language, though. Ruby: 1.8.x is widely used and pretty bad compared to 1.9. There should be more of a push forward. Has lots of neat tricks I mentioned in Obj-C, and probably even more. Uses a concept called mixins unlike mulitple inheritance. Documentation on embedding/extending it is lacking, but it's surprisingly easier than other languages. Has a classic mark-and-sweep garbage collector which may cause performance issues. Lacks list comprehensions. Python: Another highly dynamic OO language. Indentation as scope is very nice, has list comprehensions, lacks real closures though. CPython's GC uses reference counting along with a cycle detector, which is probably more deterministic than other GC implementations, but makes it a little more annoying to extend/embed. Using interpreters python and ruby provides are a nice bonus. Haskell: Truth be told, I need to finish learning this language one day and don't know too much about it. But it is a functional language that interests me. Has static typing with a very good type inference system, list comprehensions, high order functions, currying and partial applications, lazy evaluation, pattern matching. Compiled language but still has a interpreted environment.
  17. I don't format because a) I don't believe the file system my OS uses is bad, b) I am moving to trend of using SSD's anyway, c) major OS upgrades come frequently enough (per-year) which may happily "clean" things, negating all this. Point being is that I shouldn't think about it. I primarily use OS X, but have Ubuntu running under virtualization, and installed Windows 8 via dual boot just yesterday. My desktop uses a AMD graphics card and my laptop uses some kind of integrated one. Graphics card isn't really something I particularly care much about.
  18. What languages do you already know, what kind app do you want to make (is it a game?), etc, etc. Either way you probably need a Mac and need to download Xcode tools.
  19. I'm not necessarily stating that dll injection and what I said are mutually exclusive. Imagine that I write a procedure in a dynamic linked library, have it injected/linked into the process, and modify the process' code to call my own procedure.
  20. Unfamiliar with Windows kernel, but personally I'd generally avoid creating threads if possible, and go with swizziling/overriding functions or.. allocate memory inside another process, write code to it, and somewhere in original program have it JMP there - I think some people call this creating a code cave. It seems too inconvenient that the only way to inject code is to create a thread inside the target process.
  21. To elaborate further on why player_control function is not only an expensive operation but also leaking memory, there is also a GL "free texture" function (not being used) along with the "create texture" one. Although in your case, you should just load the textures once anyway. Windows file paths use backslashes and UNIX file paths use forward slashes. Don't ever use backslashes. Use forward slashes; standard libraries in Windows will accommodate for this. The #undefing main is a platform specific thing, which SDL should handle properly. By the way, I also remember one of your non-void functions wasn't returning a value if the execution didn't go through one of your if branches. 'Should also fix that.
  22. Had some time today so I decided to grab your code and debug it a bit. http://i.imgur.com/ENSlMYk.png Personally the code is a little bad but the actual thing is pretty cool : ). I recommend breaking up your main() function into smaller ones. Updating game state and rendering should be separate, and they don't even have to be updated with the same interval (in fact, in a good real-world game loop, they're not). Don't use windows file paths in your text files (images/Texture_list.txt and images/Global.txt), or in your code (search for \\'s). Especially if you want it cross-platform. tag tex[tc]; ^ Don't do this; don't rely on variable-length arrays on the stack, especially when the length is file input. clang++ won't compile this in particular, and it's not good to use (and easy to blow up the stack) anyway. Allocate it on the heap using new. Your "player_controle" function (why is it misspelled, why is the capitalization different from your other function names, and why are the functions in a header file?!) calls your loadTexture function all the time - an expensive operation, likely freezing your computer and leaking memory (although mine is fast enough to process it). I played around with it a bit, tried some of the controls like using up arrow. I know there's still other problems/segfaults. But hopefully this should help. [EDIT]: Oh yeah, #undef'ing main is definitely the wrong thing to do - I know you did it to get the program to compile or whatever as a hack. With SDL, Windows and OS X at least need some initial setup to get a SDL game running. On OS X, there is a SDLMain.m file, on Windows I'm pretty sure you are suppose to link to SDLmain or something.
  23. vld probably requires you to build and compile in visual C++, apparently. Why are you running g++ as root user via sudo? You still haven't showed us your code properly.