132 byte By
ChemComa at 2007-10-2 21:40:24
I need a checkers board code written in Java. With, two differnet collors. Can someone please supply me with the code pleasE?
Hi all,I am a PhD student at the University of Auckland, New Zealand. As part of my research I have performed an empirical study on a large corpus of Java software (which includes applications like Ant, Tomcat, Eclipse, Netbeans, Azureus). You can see how the structure (design) of the classes ...
Hi all,I need to use a UML modeling tool for my java projects desin and implementation.for the time bein i use a good tool called umbrello ; but only on linux OS.I prefer to use an Eclipse UML plugin that has most capabilities as umbrello ; so I can use it on windows also.I tied some free ...
Hi,I am currently taking content out of a database to be displayed on a page in an XHTML format. However, the content I am receiving is a mixture of encoded and unencoded eg I sometimes get & and other times I get & within strings. This will typically be in a url. I wondered if anyone ...
is it bad oop practice to keep all your global constants in main() and have your other classes access them from there?also, would anyone happen to know of a good online resource that addresses proper oop practices and goes beyond explaining the foundation stuff like inheritence, encapsulation, ...
I am working on a project in which I am going to need to reuse a lot of the functionality of some existing singletons in the code base of my company's application.There are ligitimate reasons for these objects to be singletons (i.e. they store data that I only want stored once, etc). But, in ...
1858 byte By
abthma at 2007-10-2 21:47:08
I'm trying to use MVC for the first time, and I'm trying to follow the example given in http://java.sun.com/developer/onlineTraining/GUI/Swing2/shortcourse.htmlThe main part of my model (the equivalent of IntVectorModel) is capable of creating message generators. It keeps a list of which ...
4406 byte By
nootcha at 2007-10-2 21:47:39
I've heard that using the instanceof operator isn't such a great code technique, and since I'm in the design phase, I feel like I should be able to avoid this. Right now, part of my design requires use of the instanceof operator as well as casting.Let's say you have a common notifier ...
2167 byte By
ktm5124a at 2007-10-2 21:47:42
Two questions:1) Let's say you have an instant messenging server. (I am using the conditional because I have already made the server and am really curious about the client, yet this is the same problem with an easier example to explain.) The server has to validate the user's registration, ...
1063 byte By
Miklewa at 2007-10-2 21:50:22
I work for a bank where we sell various financial products. For example credit products. Let's say the name of a credit product is BicycleLoan with which you can buy bicycles. Buying a bicycle on loan can be done only if you fullfill the requirements of the Bank. If it is ok, you can get that ...
889 byte By
Fabio_Aa at 2007-10-2 21:51:06
Hi,I have an application that calculates standard deviation of an image.the image is in RGB space and calculate standard deviation for each channel separately...this is the codefor (int i=0; i<256; i++){DeviationtempR+=Math.pow(((IstoRed[i]*i)-MediaR),2); ...
2834 byte By
_dnoyeBa at 2007-10-2 21:52:59
I have a class that implements two interfaces. ONe is a management interface and the other is a usage interface. Users should only know about the user interface. But I wanted to prevent the ability to cast to the management interface. Since the clas simplemented both there was no way to prevent ...
694 byte By
diniakia at 2007-10-2 21:54:09
Hi,I have a JSP page which displays attributes of an object in view-only mode. The user might click 'Edit' or click cancel and move on to some other page.Currently I am storing the object id as hidden value in the view jsp and when the user clicks edit I make an explicit db call, retrieve the ...
3920 byte By
qwedwea at 2007-10-2 21:54:33
Hello everyone,I need help in inserting values into an array of class, which i have read from a file. Length of the array is 5. I should insert values one by one into that array.If the array is full (if count = 5), then I should split the array into 2 arrays and adjust the values to left and ...
Is there some good method for determining the best order of items (without checking all combinations of course). I am using Taguchi method for checking several factors against several levels. But I would like to check several factors in different orders (of course, with the least number of ...
1102 byte By
_dnoyeBa at 2007-10-2 21:57:22
I have two model classes. System and Component. And two views, SystemView and ComponentView. When the SystemView is closed the ComponentView needs to be closed. However, the ComponentView does not know anything about the SystemView. The only way I have found to connect the ComponentView with ...
Somebody at work has just made an interesting observation and its bugging me, comments please.When I started Java I just used classes (and abstract classes), and didnt bother with Interfaces I understood them to be a way of getting round the lack of MultipleInheritance and it wasnt a problem ...
need help writeing method fillShape that takes in a 2D array of shapes and points(in other words it will draw the shape and fill it in into my Screen array(ex: Color[][] String = new Color[700][1000]) basicly a 2D array of colors which are painted in my paint method... anyways im sent this 2D ...
171 byte By
OcELLa at 2007-10-2 22:01:18
Hi! I need to check if a JPEG file is ok. I can't use any multimedia library. Anybody knows how can determine if a file is a JPEG file, and it's ok.Cheers!
368 byte By
cjrena at 2007-10-2 22:02:58
hey guys, i have some questions needing yours helps.when i read the Thinking in Java and tutorial, they use PrintWriter and BufferedReader for networking using socket, but you must know that some ones suggested use the DataInputStream and DataOutputStream instead. Any diffenents? I'm a newB, ...
250 byte By
Aknibbsa at 2007-10-2 22:04:48
I am trying to learn more about creating enterprise applications and I am looking for a easy to understand explanation of using DAO's as well as how to create them within a JSP/struts application. Any suggestions would be greatly appreciated.
545 byte By
rajanaga at 2007-10-2 22:09:26
Hi, We www.tejasoft.com is focused on j2me development and has worked with international clients like www.dotphoto.com in developing high value and most reliable midlets. We are now developing a product which needs an algorithm which could recognize the boundary of gif image. gif image boundary ...
381 byte By
ANDYAa at 2007-10-2 22:10:30
Does anyone have source code for a class able to compute multiple linear regression. I've been using the jama for matrix operations.A previous post was very similar to this, but I was unable to find anything in the linked answers that I could incorporate into what will be a high volume ...
I'm currently reading Core J2EE Patterns to try and improve my design skills. It's my first real introduction to patterns, and the first 150 or so pages were an okay read. When it gets into the pattern section there are a lot of references to other patterns, not covered in the book, which are ...
when using an applet to display my game i have the paint() method first draw the backround and then all of the other objects the belong on the screen. when the game moves a little faster the objects flicker over the backround. is this normal?if its not normal... then can somone please test this ...
Hey,This is my first message, so hello to everyone.I'm thinking of a way to compute a football match.I got some questions, I need your ideas:-I decided to do it with AI. All player's will have AIs, and I will put them on the pitch and set them FREE!. Then wait for the score and statistic ...
I'm making a game for school that is a vertical scrolling shooter (like the Raiden series), based off of the anime Galaxy Angel. For anyone who has seen GA would know there's 5 main characters, all of which I have put in my game. My program is an application (so swing answers only please), ...
4637 byte By
davedesa at 2007-10-2 22:30:39
Hey everyone.I'm looking for suggestions on the best way to build a scripting language specific to a simple game I plan on creating. The scripting language would be primarily meant for game "modders" who wish to build on my game in a nice and easy way, without needing to know anything about ...
While working on implementing a primality test based on Fermat's Little Theorem, I naturally came across java.math.BigInteger to mainly utilize it's method for Modular Arithmetic.I also noticed that it has two other methods; isProbablePrime and ProbablePrime.As such, I was wondering which ...
1759 byte By
Miklewa at 2007-10-2 22:33:26
Hello,I work for a bank as a java programmer. We have products like loans and systems that help the office clerks to sell that loans. Now we use self made RMI client-"server" architecture. The client is a Swing GUI connecting to the RMI server object. We are planning to have more kind of ...
I'm in desperate need of an answer since this game is due the next day...Simply put, when I hit a key, my images don't move.I tested to see if the problem was with the keyListener itself, but it was working fine. I tried putting the movement code directly into the keyPressed method, but it ...
2000 byte By
dv8dana at 2007-10-2 22:39:05
I am very new to hibernate and this question might seem a little elementary, but here it goes:I have a classpublic List<PurchaseOrder> getPurchaseOrders with a method that creates the query in question:public Object doInHibernate(Session session)throws HibernateException, SQLException ...
1765 byte By
_dnoyeBa at 2007-10-2 22:42:12
I have a situation here and I havent been able to conceptualize a good solution.BackgroundI have an object that processes changes in things that contribute to changes. And then I have this system of objects.ArchitectureSystemComponentComponentInstanceThe architecture does not really change, its ...
I need some help developing an algorithm for parsing and evaluating conditional statements. I need to be able to handle variables, logical operators, relational operators, mathematical operators, and parentheses.For example:if ( (a+1 > b*5) and ((c +2) * 6 <= 5) )All the variables ...
This is the rule of the game :The player is dealt two cards, the 'hole'. Five 'community' cards are then dealt. The player hand is then the best possible five card hand that can be made with the two hole cards and the five community cards. Is anyone here have the scripts ?please help ...
Hi,What is the best place to check security constraints. Is it the front controller of web app or a session facade.Thanking You,Chamal.
114 byte By
idomeena at 2007-10-2 22:46:50
could someone please explain in detail the difference between a parameter and an argument.Thank you.
Alright i got java from a friend and was playing around with it and now im trying to design a game, i thought it would be simple but now i am lost, i am trying to make a memory matching type game but when i flip the cards i dont know how to remove it or flip it back over, if anyone can help ...
Hi,I did read the singleton topic. But it stays confuse to me.How to garantee that only one instance of Class per VM ?I am building a component to stay running forever doing some tasks... From command line this can be started and stopped..I am trying to implement a class, a singleton. Some ...
1994 byte By
nootcha at 2007-10-2 22:52:20
As it turns out, a quick search in google reveals that the issue of return type vs. exception is somewhat hotly contested, but I thought I'd check to see what people here thought, based on a particular example that I'm dealing with.In an interface I've developed, I have the method:public ...
I am currently a Sophmore in high school, and I just finished creating a simple arcade game in my spare time (for fun). It is located at http://students.hightechhigh.org/~dturnbull/10thGradeDP/Java/IGMESMAG/index.php. Any suggestions or criticisms, however harsh, would be greatly appriciated. ...
I hope this is the right forum to ask this question since it deals with a design decision.I'm writting an implementation for a new type of file format called "NAP" (Network cAPture) which stores captured network packets in a file. Similar to PCAP and SNOOP file formats.I'm designing the ...
I have 2 vectors containing String objectsI need to determine whether each String present in the first Vector is present in the 2nd Vector or notIs there anyways to to this such that its complexity is less than O(n^2) i.e Order(n square)The result obtained should be fast as this is algorithm is ...
Hey Folks,I am trying to find a better implementation of Soundex algorithm than the org.apache.commons.codec.language.RefinedSoundex or org.apache.commons.codec.language.DoubleMetaphone. Has anyone any idea whether there are other implementations available? We are getting lots of false ...
hi everybodyI guess this is not a java-specific question, but this is the best forum I know ;-)recently I posted a topic asking for nice plugin frameworks to include into my projects, and I decided to go with JPF... also because I haven't found any other option =Pshortly I'll begin a ...
565 byte By
andy786a at 2007-10-2 23:09:52
What are the recommended approaches for dealing with errors that arise in the Model (observable/subject/publisher) piece of an MVC architecture? For example, if an error occurs in the Model during a database update that resulted from a database access initiated from View to Controller to Model, ...
562 byte By
Supes73a at 2007-10-2 23:11:06
In the J2EE patterns catalog it is stated that there is typically a one to one mapping between a Business Delegate and a Session Facade. I have been, for sometime, been under the impression that the Business Delegate can be a singleton. Does it make sense to have a singleton Business Delegate ...
341 byte By
LOLOa at 2007-10-2 23:12:37
Hello all,I'm trying to make a code that search inside some files.. I did it in sequential way but it's very slow and not effeicient..I want to do it using binary search tree.. how can I sort files (or strings) and then search within these strings..with all my respect..Message was edited by: ...
Hi,I understood the structure of DAO pattern like : The business Object uses Data AccessObject which encapsulates the DataSource. The DAO creates/uses the Transfer Object and the BusinessObject obtains/modifies the Transfer Object. Can i get the sample code for this pattern and any links for ...
1299 byte By
at 2007-10-2 23:19:36
I have three quicksort related questions that are all related to each other more or less so I am grouping them here.1) Why does Collections.sort have to call toArray() ? This is just whining i suppose but I don't want my List implementation turned into an array because it defeats the purpose ...