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...
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.
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.
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...
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...
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...
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...
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...
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...
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?
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...
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...
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...
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.
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...
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"...
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"...
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...
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...
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...
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?
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...
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...
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...
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...
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...
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...
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.
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...
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...
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...
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...
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...