Search results

  1. G

    YMMV $70 PNY 9800GT at BB B&M

    I was able to get this deal at my local BB in Atlanta. The card was marked as $89.99 on the shelf and in the computers. I took it up to the register and said I had seen online other BB stores in the area selling it for $69.99. The cashier called the manager over to confirm and after a short...
  2. G

    Euler Problem 234 Help - SPOILER ALERT

    How big of a hint would you like?
  3. G

    C++, help with coding chess

    You already have classes for Game and each piece, but not a class for the Board itself. Why not? I would solve this by making the Board a class and then having it be a shared member of all the pieces and the game.
  4. G

    Java Prime Number help

    launch your program in a debugger; you'll quickly see where you're going wrong.
  5. G

    VS 2005 + MSSQL question

    The error seems pretty self-explanatory to me. MS SQL will not run a database where the main data file is on a network share. Why? Probably because this would lead to absolutely horrible performance.
  6. G

    MySQL question, is it possible to count+get the result+limit all in 1 shot?

    before doing anything else you need to learn what SQL Injection is and the proper way to avoid attacks that leverage it. go go google
  7. G

    Euler Problem 234 Help - SPOILER ALERT

    you should be able to cut down on the modulus division by keeping an intermediate result as the lps and ups numbers will not change as often - so just find the lps and ups once, calculate the modulus result then and then iterate all values by one. then you only have to do an equality check...
  8. G

    Euler Problem 234 Help - SPOILER ALERT

    Why not instead of doing sqrt (which is very expensive as mikeblas has pointed out), you refactor lps to find the largest prime which when multiplied by itself is smaller than the target number. ups is the smallest prime which when multiplied by itself is larger than the target number...
  9. G

    Java Homework Help (v. Teacher is a little stumped)

    In a non-void method, all control paths must return a value. What happens when I pass a value that is not 1, 2, 3, or 4 to the getOctet method? Of course *you* may know that it is not valid to call that method with these values, but you have to write the code to tell the program that. How...
  10. G

    So Many Questions . . .

    fork() is a system call which allows a programmer to spawn an entirely new process, based on the POSIX standard. Threads are a general computing concept which are implemented in a variety of ways, depending on the language / operating system. So, really, comparing them doesn't make much...
  11. G

    mySQL table(s) structure

    I will echo what the people above are saying - the requirement that the ids in the URLs be sequential for the reasons you've given is not a very compelling argument, especially in the face of the facts Mikeblas has given that it makes your database model much harder to maintain. It seems...
  12. G

    Java class produces no ouput when ran

    You have some issues with your equals() method. If you're trying to override Object#equals(), your signature needs to be modified. I am not sure of the specifications of the assignment, but I would suspect the instructor wants you to implement this method rather than the "proprietary" equals...
  13. G

    Interesting Problem in Visual Basic 2005

    More to the point, isn't it the case that in general (or by default in VS 2005) building for debug would eschew the sorts of optimizations a release build would typically have?
  14. G

    Interesting Problem in Visual Basic 2005

    Since you are using an iterative solving technique in conjunction with floating point arithmetic, it sounds like you could be running into some rounding errors - however a discrepancy that large seems quite strange indeed. I would point to possibly the compiler also optimizing out some of the...
  15. G

    Binary Search Tree height

    Think about it for a little while. Your comparison this == null assumes that "this" could be null at some point. My argument is that situation is 100% impossible. The reason why is a very fundamental concept in OO programming, and it's something you need begin to grasp very quickly in order to...
  16. G

    Binary Search Tree height

    A simple test case and a run through a debugger will quickly illuminate where things are going wrong. As it stands right now, I'm surprised you're not seeing a NullPointerException. Have you learned about this concept yet? What happens when you try to do something with a null reference? Can...
  17. G

    InterlockedSList: atomic pop item and get count?

    From my naive understanding, you are describing exactly the functionality a semaphore provides. Most multithreading libraries expose a semaphore object that handles the atomic check-and-set functionality for you, so you don't have to worry about writing your own and getting it right.
  18. G

    Simple AJAX Error

    It might have been prudent of amromousa to explain that he works for Appcelerator, so he has a bit of a vested interest in pushing that over something else. Nothing personal, but I figured I might let you know. I actually have a friend that works there, and work with a bunch of people that are...
  19. G

    Simple AJAX Error

    If you want to dabble with AJAX, I'd recommend checking out some javascript libraries that abstract out some of the boilerplate code. Some that come to mind would be Prototype, Scriptaculous, YUI, etc. This would allow you to write code like: <script type="text/javascript"...
  20. G

    C++ Heap

    Generally I've found many academics are fairly out of touch with pragmatic programming; at least where I went to school, I found I enjoyed the content much better if they focused on the concepts and eschewed trying to play with language-dependent features or quirks, or trying to write "clever"...
  21. G

    How do I see if a user entered a number within my range (ie. SAT GRID INS)?

    OK, those instructions are the best place to start. They seem to specify exactly what to do very explicitly and provide you with some great test cases to start with. You noted before your language of choice is PHP. While mine is Java I think we could throw some code around fairly easily and get...
  22. G

    How do I see if a user entered a number within my range (ie. SAT GRID INS)?

    This is a pretty interesting problem. You have two parsing problems and a comparison problem, essentially. The first parse would be pulling the answers off the "grid-in" which seems to have a fairly well-defined domain. I would simply solve this by getting this value as a string and looking for...
  23. G

    Java loop

    Perhaps the first thing you should figure out is how to climb one floor, counting each step on the way. Once you can climb one floor, treat that block of code as a single "piece". Now, how would you climb multiple floors? Or, what if each floor only had one step? Then how would you climb...
  24. G

    FF/IE Javascript FAILING! ZOMG!

    maybe: http://simonwillison.net/2003/Aug/11/documentAll/ ? Are you required to use the HTML 4.01 transitional doctype? The DOM manipulation you are doing is rather outdated it seems. Can you explain in plain english what you're trying to accomplish?
  25. G

    Turning Outputted Data into a Graph

    What format does the graph need to be in? Can you use Swing? Have you checked out JGraph (http://www.jgraph.com/)? There are plenty of other native Java libraries that you could integrate with that might make things easy. Although Excel is pretty easy if you just need to create some one-off...
  26. G

    Very high traffic media server, solving the I/O issue... help!

    Well yes, that sounds like a problem to me. Your RAM is filling up and you are getting into swap space, and then your I/O load is going to shoot up because you're swapping in/out from disk. Why are you trying to cache everything in RAM? You're using lighttpd which claims to be able to perform...
  27. G

    Very high traffic media server, solving the I/O issue... help!

    It seems that it could be an issue with the driver for your ATA controller. Perhaps you're hitting some I/O threshold and running into a priority inversion due to a poorly written driver. As mikeblas says, you really need to start measuring some things; anything else is just a shot in the...
  28. G

    Very high traffic media server, solving the I/O issue... help!

    How are you serving the content? Perhaps you have a slow memory leak in a user-space application somewhere that is eventually leading getting you into swap space. That seems to meet the symptoms fairly well. Have you changed any software configurations recently that might coincide with the new...
  29. G

    Dorm room internet

    Most schools frown on routers. There are quite a few reasons for this, including someone plugging it in the wrong way (i.e. connecting the wall jack to one of the LAN ports) and your router starts serving DHCP leases to the entire school (seen it happen) as well as other topology issues such as...
  30. G

    [SQL] Table Design/Normalization Question

    better yet, when the management decides to change the shifts so that there are three shifts now (morning, afternoon, evening), how could your database handle that? Why not just go ahead and build your shift table with a startTime and endTime column? That seems the most extensible option to me...
  31. G

    Indenting in code - Tabs or Spaces?

    spaces dear god, and set "soft tabs" -- tab = 4 spaces
  32. G

    Trouble with a piece of C++ code

    You do know that he's doing this for a class right? Most everything you do in school is generally a fairly contrived exercise to teach you how something works, and isn't very applicable to real-world coding in itself.
  33. G

    BFG 8800GT 512MB OC $249 Shipped @ BestBuy

    Nice, I had a similar experience. I went to look and the shelf was empty, but I had an employee check stock and he said they had one left. I wasn't sure if it was done on purpose or not, but the one remaining had been pushed all the way back and behind the other video cards, on the bottom shelf...
  34. G

    BFG 8800GT 512MB OC $249 Shipped @ BestBuy

    Damn, I bought one Friday for $279 from Best Buy. Do they do retroactive price matching?
  35. G

    Trouble with a piece of C++ code

    Or just compile with -Wall -Werror, to catch all errors and treat them as warnings, which you should be doing in the first place?
  36. G

    Trouble with a piece of C++ code

    double post FTL
  37. G

    Java program question

    I believe the OP has an assignment to write a multi-threaded system to simply learn about message passing and/or shared memory between threads. There are plenty of good ways to do this in Java. However, this seems like a homework assignment, so unless the OP can share more information about...
  38. G

    Annoying java problem

    Are you familiar with modular arithmetic? You could clean up your if conditions a lot if you simply used division modulo 7 and used a switch statement. for (int i = 0; i < letters.length; i++) { int remainder = i % 7; switch (remainder) { case 0...
  39. G

    Java: Best way to handle HUGE SQL query result

    No problem :) Yeah, I wasn't sure if there was a reason you were doing that or not. The data you provided in the #4 post led me to believe the only thing that might appear in that column would be "document" so I was a little puzzled why you wouldn't be using strict equality. I'm not sure why...
  40. G

    Java: Best way to handle HUGE SQL query result

    My guess is the reason for the discrepancy is the additional constraints you're placing on the cfX fields at the end of the query. Also, is there any reason you're using a completely unanchored LIKE query? Why don't you just say where node.type = 'document'. This should provide a performance...
Back
Top