marijnh

Members
  • Content count

    354
  • Joined

  • Last visited

Community Reputation

182 Neutral

About marijnh

  • Rank
    Member
  1. Also, if you have an academic library near you you could see if they have the journals with articles in question there -- they'll often let you read or copy them for free.
  2. Loading unicode text files

    It would probably help if you knew which encoding your file uses. Read these: http://en.wikipedia.org/wiki/Unicode http://en.wikipedia.org/wiki/UTF-8 Once you (globally) understand what you are trying to do, I'm sure you can find a library that does it for you (though writing your own unicode-reading lib can be entertaining too).
  3. more scheme questions

    The first one just requires you to do (cons (cons ...) ...). The second is probably easier to solve with recursion than with list comprehension, but it is possible both ways. Apply (lambda (x) (* 5 x)) to (1 .. n) and then sum the result.
  4. Quote:Original post by Extrarius I just want to learn about what 'should' be thought about when designing a language to avoid common mistakes and to take advantage. How many programming languages do you know? Learning a few very different languages is a good way to get an overview of what works and what doesn't.
  5. Quote:Original post by Trap C++ 2.7s java -server 3.6s C++ CLR 5.5s java -Xint 50s clisp 144s yours would be around 160s (60 times slower than c++) What exactly are you measuring here? The really fast times for C++ surprise me. I tried printing out the first 40 fibonacci numbers, using the function shown to calculate each one separately, and I get less huge differences: C++: 19 sec Steel Bank Common Lisp: 34 sec (not a VM, I know) Edit: Oh I see. I tried CLisp... and let's just say that if it continues at this rate it will probably be done in 20 minutes or so :P I guess you just calculated less numbers in your tests, or you have a really fast computer.
  6. Because your VM does not have indirect adressing (i.e. write/read from basepointer+4 in one instruction) you already need more instructions than the equivalent intel-processor program. (But that shouldn't give such a huge difference) Also, is the C-version of the algorithm implemented equally inefficiently? (Recursive, instead of just looping)
  7. That is quite close to the hardware instruction set. How are you implementing the VM? (Especially the way you select code for an instruction, and the way your stack works) You could try looking at the assembly that the compiler generates for it - and even count instructions there.
  8. Your virtual instructions are probably a bit more high-level than the machine's instructions (unless you modelled your instruction set after machine instructions, which is usually not a very good idea), so the deduction that there are 80 machine instructions executed per VM instruction is probably false. Can you give us an idea of what kind of virtual instructions you use? That would probably lead to more useful comments.
  9. (or just use the DO macro, which is part of the language and pretty much a generalized C for loop) Also: Quote:Original post by flangazor Also, in my experience, emacs tabbed code that gets an ugly distance horizontally can almost certainly be refactored into something cleaner (and left oriented). Can you give some examples of this? The field where I get the most ugly wide code is usually when I try to define internal functions in a function (flet or labels in CL) - I often end up just making helper functions top-level to avoid this, but it would be nice to be able to have the code itself indicate "this is just an internal helper function!".
  10. How many entrants?

    Half of them will probably fail to make the deadline. I better get back to work myself!
  11. Timezone paranoia

    According to http://www.timezoneconverter.com: 23:59:00 Monday October 31, 2005 in EST converts to 04:59:00 Tuesday November 1, 2005 in GMT I'll probably be joining you in the last-second, tuesday night submitting :P
  12. Blender Python: Transformed vertices?

    My solution is to just select everything and apply the rotation and scaling with ctrl-A before exporting it (adding the translation to the vertices during the exporting). Depening on what you are trying to do this may not be a workable solution though.
  13. If it looks like the AI code is doing lots of things that it should not be doing (iterating through a set of all game objects for example), it might help to have your Game object provide certain services that will be needed by the AI code - for example getting nearby object, checking whether there is a clear path between two points, etc. It might be a good idea to put this functionality into a different class that contains a pointer to the Game object, to prevent cluttering your Game class with this stuff.
  14. I thought I put on the sarcasm pretty thick in my previous message :P Anyway, you claim that network & parser programming is 'of vital importance'. I disagree. Unless you want to do uncommon stuff, or just want to learn about these subjects, it is enough to have a basic understanding of them and a good library that handles them for you. Just like you do not need to write your own renderer to write a 3d application, you do not need to write you own low-level networking code to write a networked application.
  15. Oh god forbid people do not code every single detail by hand. Network & interface programming is so much fun that it would be a real shame, using a tool built exactly for what you want to do instead of programming it all in plain C. Now I do not have experience with MUD tools, but the text-adventure tools mentioned in the first post leave you free to get as creative as you want, while providing a convenient framework which saves you a lot of time & work. I suspect there are MUD tools that do the same.