Jump to content

DarkWater

Members
  • Posts

    6,173
  • Joined

  • Last visited

    Never

Everything posted by DarkWater

  1. Yeah, I noticed that too. I mean, you could always press Tab and then enter, but just Enter would be easier.
  2. I know you already have an answer, but I think I just worked out a slightly shorter way to get it. Let's say that A is $yearlybill, r is $inflrate, n is the number of years and P is the cost [tex]P = \displaystyle\sum_{i=0}^n A\left(r\right)^i[/tex] We can move the A out: [tex]P = A\displaystyle\sum_{i=0}^n r^i[/tex] And then we can simplify the sum to: [tex]P = A\left(\frac{1-r^{n+1}}{1-r}\right)[/tex] So basically: [tex]P = 5000\left(\frac{1-1.05^6}{1-1.05}\right)[/tex] I got 34009.5640625. Is that the number you get with your code? If it is, then this expression is very easy to put into PHP.
  3. Yeah. The only reason that I did 1 + .05 instead of 1.05 is because I was originally compounding it monthly for some reason. Didn't read the question that carefully. xD
  4. That won't loop back if he needs more though. Just saying.
  5. abcdefghijklmnopqrstuvwxyzaaabacadaeafagahaiajakalamanaoapaqarasatauavawaxayazbabbbcbdbebfbgbhbibjbkblbmbnbobpbqbrbsbtbubvbwbxbybzcacbcccdcecfcgchcicjckclcmcncocpcqcrcsctcucv That's the output of: <?php $str = 'a'; for ($i=0;$i<10;$i++){ echo $str++; } ?> The increment and decrement operators actually go from y to z to aa to ab, etc. So technically, we can rewrite this as: <?php $str = 'a'; for ($i=1;$i<101;$i++){ echo ($str == 'aa') ? ($str = 'a') : $str++; } ?> Now it works as desired.
  6. Well, if you were doing this on paper, it would be: [tex]P = 5000\left(1 + .05\right)^t[/tex] Where 5000 is the yearly bill and t is the amount of years. Correct?
  7. ++ and -- work to increment and decrement letters, actually.
  8. $player1last = mysql_real_escape_string($player1last); $sql = "INSERT into names (last) values ('$player1last')"; You definitely want to be using MSRE here. I know it was already suggested, but I just separated it from the SQL string so you could see it more clearly.
  9. I don't think that employers would be checking to make sure that you were "hardcore" certified. You'd at least need a more appropriate adjective.
  10. The background on the register page is indeed white. =/ Anyway, on the main page, there's a ton of extra scroll space that's completely unneeded. And the picture of the Jamaican dude (I'm guessing that because of the shirt) is stretched out. There's nothing attractive about your web page. And I'm too lazy to register, so is there a test account? And it seems like every gangster/mob website has the exact same home page. ._.
  11. Also, why would you want to show the exam paper to a dog?
  12. I think he needs more help than we can possibly offer here.
  13. I'm fairly sure he didn't realize he needs delimiters and got really lucky since he used a character class as his whole regex. [ ] counts as a delimiter pair, so it didn't throw an error. Try this instead: $blah = split('/[:@]/', $raw);
  14. Have the functions accept data of type void *, which is a pointer to a void. That's actually C's way of implementing a generic pointer; it can point to any kind of data. Now, you can either use that data directly as is, or you can make a copy of it so the initial code can free the pointer.
  15. First of all, you're make a new connection each time. You could just do: <select name='tech' id='tech' tabindex='2'> $result = mysql_query("SELECT * FROM tech") or die(mysql_error()); while ($row = mysql_fetch_array($result)){ $name = $row['TEAM']; $id = $row['ID']; echo "<option value='$id'>Team $name</option>"; } And put your connection information once at the top of the page.
  16. You shouldn't be seeing '\r\n' in plain text like that. You put it into the database incorrectly, I think. Can I see your code for inserting it?
  17. Umm, well, I'm sorry, but I don't like it all that much. It looks very dated, and the colors don't work too well. It's very boxy. =X The markup looks okay, but you need to fix the one remaining validation error for XHTML Transitional or the 9 errors for XHTML Strict. Also, you have like 3 strange characters (looks like a BOM) in the beginning of your markup and site as it loads. Also, what is the purpose of the random white space on the sides of the red center content area? And I find the background image to be distracting, too. You should look at some popular modern sites and read some design blogs to get a feel for how to make your site look more modern.
  18. I tested it on 5.3 alpha and it worked. It might be >=5.3...I don't understand why you'd need a linked list-esque structure when an array works just as well.
  19. The site seems pretty bland, design-wise. It's a great idea, but you really need to spruce up the template as it seems very generic at this point. I'd definitely make a real logo and make the design wider with colors that stand out more. Also, I have a functionality suggestion. I don't know if you're already planning this (as you said some features weren't ready yet), but I'd suggest letting each user set up their own personal quotes that it can cycle through for their account. It wouldn't be too hard to implement, and it would be pretty cool. If you need an idea of what I'm talking about, it's kind of like Crayon Violent's signature box, only each user could establish their own set of quotes.
  20. Err... Let p be the number of posts, let m be the number of posts per page and let y be the number of pages. [tex]y = \frac{p}{m}[/tex] You'd need to use ceil() in PHP on the result to get the actual number of full pages though.
  21. I'm fairly sure that he doesn't mean over the web, guys. I think he means like, a keylogger that will be used on the computer that it's running on.
  22. @wildteen: No, you can't do if (something >= 1 && <= 2). You need to list the variable twice. <?php $grade_level = 10; if ($grade_level >= 9 && $grade_level <= 12) { ....
  23. You can't get the MAC address of a computer through HTTP.
  24. array_push() is very slow compared to just using the empty bracket syntax, [], so I'd suggest not using it at all.
×
×
  • 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.