Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. Maybe you could give us some higher level requirements as well (not necessarily still in steps of 1)? As you see with the function I proposed, it look fine (IMO) on lower levels, but it turned out to quickly get out of hand as x grew.
  2. Actually, maybe that's not a very good function. 1,000,000 exp would then be level 17. I don't know how hard you want to make or how much exp you hand out, but it's a bit high. You can try to tinker with the function yourself perhaps.
  3. Maybe a function like this: [tex]f(x) = \mbox{floor}\left( \left(\frac{\log_{10}\left(\frac{x}{200}\right)}{0.3}\right)^{1.12} \right)+1[/tex] Or in php: function getLevel($exp) { return floor(pow(log10($exp) / 200, 1.12)) + 1; } That function will grow as in the attached graph. It will not be the same numbers as you requested, but the levels would be like this: Level 2: 400 Level 3: 722 Level 4: 1263 Level 5: 2165 Level 6: 3660 Level 7: 6119 Level 8: 10135 [attachment deleted by admin]
  4. Maybe what you're looking for is a function that grows logarithmically? Logarithmic growth "decreases" as the independent variable grows. Or rather, the derivative decreases if you know calculus. What this practically means in your case is that higher levels would need more exp to level up than lower levels would. I assume that's the kind of behavior your looking for. I've attached a graph to give you an idea of how logarithmic growth is. Specifically, that graphed function is the natural logarithm. I've also attached a graph of the function you're using now. It's essentially linear. The numbers you posted in your first post can, with good approximation, be both linear, quadratic, exponential and power growth (probably others as well, I stopped checking after that), so it's a bit difficult giving you a good formula without knowing more about it. [attachment deleted by admin]
  5. It has to be type="submit" A button is just that, a button. It doesn't have any default behavior.
  6. Hmm... the refresh thing seems to have gone away. I updated my graphics drivers yesterday. Maybe that fixed it. I'm not sure why that would have anything to do with it though.
  7. Daniel0

    IE8

    http://www.microsoft.com/windows/internet-explorer/get-the-facts/browser-comparison.aspx Oh okay, if you say so... Here is a comparison of me and everybody else: [/td]DanielEverybody else Is humanxx Smartx Intelligentx Awesomex Cleverx I swear it's true and I'm totally unbiased.
  8. What kind of skills do you have?
  9. FYI, .NET is a framework, not a language.
  10. Besides, you could easily create your own function that has the behavior you want: function cpsort(array $array) { sort($array); return $array; } $e = array(3,1,4,1,5,9); $k = cpsort($e);
  11. Time to upgrade. The latest OS that used DOS was Windows Me.
  12. You don't necessarily need a particular kind of math if you just want to do general programming, but the ability to think abstractly about a problem will help you. Maybe see this post. Maybe "advanced math" was the wrong term. You at least want to be sure you're confident with math and that you know something else besides elementary math. If you want to do something like computer science you would need advanced math though. You can probably jump right into it without knowing anything. I did, but it really took a long time being at least decent this way (decent by the standards I hold now - when I was younger and just started out I probably pretty quickly found myself good, but I wasn't). You can get something done very quickly in PHP without very much knowledge, and I suppose that is what makes it so difficult. The problem is just that if you don't know anything, you will have no idea of what is good and what is bad to do. If you don't know any common attack vectors people will use, you will have no idea of how to protect yourself from them, or even that you're vulnerable to them in the first place (see this tutorial for a primer on security). Don't be afraid to use the manual. It's quite well written, and it often contains notes about best practice.
  13. It matches as long as it can and as long as you don't stop the chain. So www.mydomain.com/test/154534 matches the first rule, and it becomes www.mydomain.com/index.php?id=test/154534, which doesn't match any further rules. You can switch the rules around and add [L] to the one with "test", or you can limit the regex in the current first one.
  14. Add RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d before the RewriteRule.
  15. I wrote this post a few days ago that you might want to look at. In short, it's not so much learning PHP's syntax (that's easy), but rather learning methodology and acquiring the right mindset for a programmer.
  16. The .htaccess will reside inside the document root. Apache doesn't care about what your PHP scripts includes, it just wants PHP to parse it because Apache doesn't know PHP. If at all possible you should put it in httpd.conf instead though. It's faster.
  17. Well, before the insertion to the database. The location of the temporary file is in $_FILES['photo']['tmp_name'], pass that to the function and it'll give you the relevant info.
  18. To be honest, while I like this place and all, I wouldn't wear PHP Freaks clothes.
  19. I think it's a great language, but it's somewhat difficult wrapping your head around functional programming after having used the imperative paradigm for numerous years.
  20. I've added Netbeans to the poll choices. It has come up in a lot of posts.
  21. Just a shame that the upcoming 6.7 release won't support the new PHP 5.3 features.
  22. Besides, we are not even trying to make revenue. We just want to cover the costs of operating this site. We use ads and donations for that.
  23. How about log_errors and error_reporting?
  24. Well, it says right there in the error message, set CMAKE_CXX_COMPILER to a valid compiler and install the boost libraries. It's right in front of you in plain English.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.