How Do To Represent A TimeTable Within Java?
Hi,
I know this question has been asked by many before but I did not find one that understood well.
Basically I am wanting to find out how I would represent a timetable within Java, I was looking into it and was told hashmaps where a good idea. But the more research I have done into this area there very little help there is.
Would any body like to point my on the right course of how to do this?
Thank You
Chris
ChrisUK wrote:
Thats what am trying to avoid, I don't what you guys to do that. Im looking for some guidance of what is the recommend tools/method's to use:
e.g. ArrayList, Array, HashMap.. so on.This is really bringing out the analogies! That is like saying, "I want to build a shed. Should I pick up a hammer or a screwdriver first?"
Design first, implement second.
What is a timetable? What are its attributes? Does it have components? What can it do? What application tasks involve a timetable? What other objects does it communicate with?
Similar Messages
-
How do you access external .exe within Java?
Say I wanted to feed a command to a .exe, right? How would go about doing that in Java and is there a cross-platform method or does it vary?
helplessguyhelp wrote:
tlgkumar,
Hi can you help me to solve a problem??Dude, just start a new thread with your question, and whoever sees it and finds it worth their time will answer. -
How can I use MS Word within java programming
Hi everyone!
I am developing a Java program that will take data
from an Access 2000 database, and manipulate it,
display the results graphically and in tables. The
challenge for me is that I want the program insert the
graphics and tables into the MS Word template and then
prompt me to save it as a word * .doc. Do you know
of any articles or sources of sample code on how to do
this. The Java environment is Java2, JDK 1.3,
JBuilder4. The OS environment is XP.
Regards,
FaradHi, I also need that package. my e-mail is [email protected] Plese send me that. Thanks in advance
I have a package that will do this for you. I just
need to get your email to send an attachment and
examples. -
Setting Windows Envirnoment variables within Java code!!
Hello All,
How to setup Windows envirnoment variables within Java code dynamically.
int customer = jList1.getSelectedIndex();
System.out.println(customer);
switch (customer)
case 0:
System.out.println("HOME1");
break;
case 1:
System.out.println("HOME2");
break;
case 2:
System.out.println("HOME3");
break;
case 3:
System.out.println("HOME4");
break;
default:
System.out.println("HOME5");
break;
}set windows %HOME% variableWhat is it?
A system-wide resource? Something pertinent to the processes of a given user? Or does it apply only to your Java process? -
How to run python within Java?
I want to run python command within java. Not sure how to do this.
Seems like runtime.getRuntime.exec() is something that i can use.
but all the examples were for unix platform and not any other.
Can i run python command using getRuntime().. please let me know
ThanxI want to run python command within java.I've created a project, "Java Embedded Python" that might work for you.
Check out http://jepp.sourceforge.net . Maybe it'll work for you... -
How would i do to run scanner within java??
i have to make a button within java
clicking the button can start scanner
run scanner UI!
i find many books!
but i don't know what to do
do everybody have some program about that??
thx...Hi,
You can try a package named: JTwain, which is available at http://asprise.com/product/jtwain.
JTwain supports all kinds of digital cameras and scanners. You can use Java to access, contorl digital cameras and scanners, and of course, to acquire images with flexible settings.
The developers' guide is available @ http://asprise.com/product/jtwain/devGuide.php
In the simplest case, one line of Java code can solve your problem.
Good luck! -
How to get the Weblogic Server Id from within java code
I would like to log which server (among a cluster) a certain job is running on. Is there a way to get the server id from within Java code (this code is in a session bean if that is relevant.)
By server id I mean the "Name" column in the summary of servers on the weblogic console.
Thanks,
kenUse the two entries close to the bottom of the page: "list WebLogic
MBeans:listMBeans.jsp
display MBean attributes and operations:showMBean.jsp"
Nils
Anatoly wrote:
>
Cameron,
That page has these items on it:
which one do you think helps with my issue?
Misc WebLogic examples
LongRunningTask
Execute tasks in parallel using WebLogic Execute Threads
Weblogic stats (5.1)
Reload Servlet(s) programmatically (5.1)
Network classload from WebLogic:using reflection,or the launcher
Weblogic 5.1 debugging properties
Seppuku pattern readme
Using dynamic proxies to intercept EJB invocations (6.1)
list WebLogic MBeans:listMBeans.jsp
display MBean attributes and operations:showMBean
Thanks to Marcelo Caldas for filter by type option and nice UI!
Using com.sun.jdmk.comm.HtmlAdaptorServer with WebLogic 6.1
Cool
EJBGen
Dimitri
back
"Cameron Purdy" <[email protected]> wrote in message news:<3c7a745d$[email protected]>...
JMX ... see http://dima.dhs.org/misc/ for some info on JMX in Weblogic.
Peace,
Cameron Purdy
Tangosol, Inc.
Clustering Weblogic? You're either using Coherence, or you should be!
Download a Tangosol Coherence eval today at http://www.tangosol.com/
"Anatoly" <[email protected]> wrote in message
news:[email protected]..
Does anyone know who to get the managing server URL's port
from within the EJB code running on Weblogic 6.1?
The URL port is not default (not 7001), but when creating
initial context, I am not specifying the URL in properties.
Due to that, trying to the the PROVIDER_URL property from
environment does not return anything.
Appreciate any responses.
-Anatoly
============================
[email protected] -
Trying to use grep from within java,using exec command!
Hi all!
I would like to run a grep function on some status file, and get a particular line from it, and then pipe this line to another file.
Then perfom a grep on the new file to check how many of the lines above are present in that file, and then write this value to a new file.
The final file with a numerical value in it, i will read from within java,as one reads normal files!
I can run simple commands using exec, but am kinda stuck with regards to the above!
Maybe i should just do all the above from a script file and then run the script file from exec. However, i dont want to do that, because it kinda makes the system dependent,..what if i move to a new machine, and forget to install the script, then my program wont work!
Any advise?
Thanks
RegardsWith a little creativity, you can actually do all that from the command line with a single command. It'll look a little crazy, but it can be done.
Whether the script exists on the local machine or not has zero to do with platform indpendence. You assumedly have to get the application onto the local machine, so including the script is not really an issue at all. However, you're talking about system independence, yet still wishing to run command line arguments? The two are mutually exclusive. -
How to make a pop up within if else
I'm now making an user interface which will be used to control a remote robot. I want to make it so that when a button is pressed, a window will pop-up and tells the user what the robot is doing. At the moment, I can only make it to show the message in the cmd box. Code is as follow:
class ActionHandler implements java.awt.event.ActionListener
public void actionPerformed(java.awt.event.ActionEvent event)
Object object = event.getSource();
if (object == forwardButton) {
System.out.println("Robot moving fordward");
else if (object == backwardButton) {
System.out.println("Robot moving backward");
else if (object == rotateLeftButton){
System.out.println("Robot rotating to its left");
else if (object == rotateRightButton){
System.out.println("Robot rotating to its right");
The only way to make pop-up which I know is this one:
import javax.swing.*;
public class DisplayTextInWindow {
public static void main(String[] args) {
// create a String variable
String messageText = "Hello world";
// display it in the console window
System.out.println(messageText);
// now display it in its own window
JOptionPane.showMessageDialog( null, messageText );
Which I can put into the code for interface because I can't start another class within an if statement (as far as I know anyway...)
Can anyone please teach me how to make a pop-up within an if else statement?Which I can put into the code for interface because I can't start another class within an if statement (as far as I know anyway...)yes you can.
if (robotRotating)
newClass class = new newClass();
class.methods;
Can anyone please teach me how to make a pop-up within an if else statement?sure
if (robotRotating)
//i think this part is already answered in the previous post
javax.swing.JOptionPane.showMessageDialog(null, "your message here", "your title here", JOptionPane.OK_OPTION);
} -
How to manipulate a javascript object in java?
Hi, I am fiddling with the java scripting interface. As I understand the rhino engine is packaged with the jdk but what I don't understand is how does one reconcile the objects one gets from their engine (e.g. sun.org.mozilla.javascript.internal.ScriptableObject) versus the ones in the rhino api (e.g. org.mozilla.javascript.ScriptableObject)?
Is the one in the jdk heavily modified or wrappered up to suit their javax.scripting interface?
More specifically, how do I manipulate javascript objects from java?
e.g. suppose I have this java code:
ScriptEngineManager mgr = new ScriptEngineManager();
ScriptEngine js = mgr.getEngineByName("js");
jsEngine.eval("var foo = { x : 1, y : 'hello', z : false };");
Object o = jsEngine.get("foo");Now o is instanceof sun.org.mozilla.javascript.internal.NativeObject, which is a subclass of a bunch of other classes in the s.o.m.j.i namespace. Being internal I can't use these directly.
Looking at the Rhino API obviously you normally get a org.mozilla.javascript.ScriptableObject and can call the .get() .getIds() methods. But I don't know how to translate the objects I am getting in my actual java code which uses the jdk engine into org.mozilla.javascript objects.
Is this even possible? Am I misunderstanding something completely? Should I just be using the rhino js jar and not the javax.scripting interface? If so, for what reason is the javax.scripting interface implemented?Assuming that you DO want a deep copy, begin with a constructor that takes another hand.
public Hand( Hand h ) { ...Then for each instance variable, within that constructor:
this.instVar0 = h.instVar0;
this.instVar1 = h.instVar1;
. . .And last, for every reference, make sure there is a constructor (or copy method for arrays) that itself makes a deep copy:
this.ref0 = new Ref0Type( h.ref0 ); -
HOw to create a Batch file for java application and whats the use of this ?
HI,
How to create a Batch file for java application ?
And whats the use of creating batch file ?
Thanks in advanceFirst of all, you're OT.
Second, you can find this everywhere in the net.
If you got a manifest declaring main class (an classpath if needed), just create a file named whatever.bat, within same directory of jar file, containing:
javaw -jar ./WhateverTheNameOfYourJarIs.jar %*By the way, assuming a Windows OS, you can just double click the jar file (no batch is needed).
Otherwise use:
javaw -cp listOfJarsAndDirectoriesSeparedBySemiColon country/company/application/package/className %*Where 'country/company/application/package/' just stands for a package path using '/' as separator instead of '.'
Don't specify the .class extension.
Javaw only works on Windows (you asked for batch, I assumed .BAT, no .sh), in Linux please use java.exe (path may be needed, Windows doesn't need it 'cause java's executables are copied to system32 folder in order to be always available, see PATH environment variable if you don't know what I'm talking about) and use ':' as classpath (cp) separator.
The '%***' tail is there in order to pass all parameters, it only works on Windows, refer to your shell docs for other OSs (something like $* may work).
This way you have a command you can call to launch your code (instead of opening NetBeans just to see your app working). You could schedule tasks on it or just call it in any command prompt (hope you know what it is 'cause there have been people in this very same forum with no clue about it, if not just hold the 'Windows button' and press 'R', then type 'cmd' and run it).
Finally add dukes and give 'hem away.
Bye. -
How to create a oracle database by java code?
how to create a oracle database by java code?
please give some ways then that way's codeI'm not sure what you mean with "database". Do you mean an Oracle instance or an Oracle user/schema (probably the latter, because that's the equivalent to a MS SQL Database).
Creating an instance is definitely not possible from within Java. To create a new user this should be possible, as this can be done with SQL:
GRANT connect,resource TO <newuser> IDENTIFIED BY <password>;
I'm always cautious with questions like this. In 90% of the cases there is something wrong with the initial design. Creating a database shouldn't be something the application is doing.
Thomas -
How to Call abap functn/program from java layer
Hi all,
I have to develop a program which has to call abap function/program from java side or how to call a abap program through java ..
pls send me related links or explanations.. dont send unrelated answers..
Regards,
Arivarasu SHi,
You mean accessing ABAP functions from J2EE perspective, then I think we can do this by using SAP Java Resource Adapter and also through webservices.
SAP Java Resource Adapter (SAP JRA) can be used as an add-on for the SAP JCo SAP JRA enables the implementation of standard interfaces from diverse J2EE servers to the SAP JCo in the SAP Web AS. The SAP JRA thus simplifies
communication with ABAP within heterogeneous J2EE landscapes.
Go through the following links which has Good documentation on how to achieve this
Accessing BAPIs Using the SAP Java Resource Adapter
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ad09cd07-0a01-0010-93a9-933e247d3ba4]
Connectivity and Interoperability
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/326d82e5-0601-0010-fca4-9caf27b89c26]
Finally with WebServices. Accessing SAP Business Functions (ABAP) via Web Services
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/06adbf03-0a01-0010-f386-d8e45561a3c4]
Regards
Raghu -
How do I set System properties within WL6.0?
I am setting WL6.0 up to have a startup class, but this class needs to
read system properties which have not yet been set. How do I set these
up within weblogic? I was able to get the startup class set up, but it
needs these system properties to continue.
gmoCorrect on all points. The one advantage of doing this in java is that you can more easily do more
complex things like accessing configuration information from a remote data store (like a database).
Dimitri Rakitine wrote:
These are not needed if you simply replace java ...lots of options... weblogic.Server with
java ...lots of options... startmyWLS in the script which starts WebLogic, but, on the other
hand, this solution is no different from simply adding -DmyProperty=myValue to the startup script
(I think that the ultimate goal is the ability to deploy(and redeploy!) components,
without any mods to the particular vendor's startup scripts of anything of that nature).
Kumar Allamraju <[email protected]> wrote:
Thanks to robert for a quick workaround..
I tried to start the WLS with the following piece of code and actually i need to set
some additional properties
for successful server startup.
Here it is
import java.util.Properties;
public class startmyWLS
public static void main(String[] args)
Properties props = System.getProperties();
props.put("myProperty", "myValue");
props.put("bea.home", "E:\\bea");
props.put("weblogic.Domain", "mydomain");
props.put("weblogic.Name", "myserver");
props.put("java.security.policy",
"E:\\bea\\wlserver6.0\\lib\\weblogic.policy");
System.setProperties(props);
weblogic.Server.main(args);
Make sure you run this from E:\bea\wlserver6.0., as it tries to read config.xml
config\[your-domain-name] from this
directory.
Kumar
Robert Patrick wrote:
import java.util.Properties;
public class StartMyWebLogicServer
public static void main(String[] args)
Properties props = System.getProperties();
props.put("myProperty", "myValue")
System.setProperties(props);
weblogic.Server.main(args);
gmo wrote:
That won't work since it has to be 'outside' of the code. It's a service, and
services are started when weblogic is started up, not when I call a bean.
And it has to be dynamic, since the properties will vary on evry installation.
Robert Patrick wrote:
You can also use System.setProperty() or a combination of
System.getProperties() followed by a System.setProperties()...
gmo wrote:
They are not normal system properties. I'm using some open source code, and
it requires settings to be system properties, but they are specific to the
application, which means that they are not already in the system
properties. I know how to get them, and after some more research, you can
set them on the command line when starting up weblogic. However, is this
the best way to set system properties?
Robert Patrick wrote:
What "system properties" are you trying to find?
gmo wrote:
I am setting WL6.0 up to have a startup class, but this class needs to
read system properties which have not yet been set. How do I set these
up within weblogic? I was able to get the startup class set up, but it
needs these system properties to continue.
gmo
Dimitri -
How to invoke TaskService updateTask from within BPEL Process
Hi
I have to call the updateTask method defined within TaskService to update the BPEL payload. I initiate the Task in the same BPEL process but I want to update the payload somewhere down in the same BPEL process. Can someone assist me in finding out how I should do that without writing Java code? I want to know which task values I need to set before using the invoke activity and assigning the updateTask method to it.
Regards,
Jayesh
MCSE, MCSD, SCJP, PMPI saw a bug reported for this issue
here is the metalink
https://metalink.oracle.com/metalink/plsql/f?p=130:15:4302376104022705627::::p15_database_id,p15_docid,p15_show_header,p15_show_help,p15_black_frame,p15_font:BUG,5751185,1,1,1,helvetica
Bug No. 5751185
I have attached the text in metalink for those who do not have access to the metalink
Bookmark Fixed font Go to End Monitor Bug
Bug No. 5751185
Filed 08-JAN-2007 Updated 23-JAN-2007
Product Oracle(R) BPEL Process Manager Product Version 10.1.3.1
Platform Microsoft Windows XP Platform Version No Data
Database Version N/A Affects Platforms Generic
Severity Severe Loss of Service Status Code Bug (Response/Resolution)
Base Bug N/A Fixed in Product Version No Data
Problem statement:
(LOCAL) USERTASK FAILING WITH JAVAX.NAMING.NAMENOTFOUNDEXCEPTION TASKSERVICEBEAN
*** 01/08/07 03:24 pm *** When creating a usertask in BPEL 10.1.3.1 - I get 2 possible bindings - one SOAP based and the other one java based. When running locally the JAVA Binding is called - and fails with . < 2007-01-08 12:09:44,061> < ERROR> < oracle.bpel.services.workflow> < ::> java:comp/env/ejb/local/TaskServiceBean not found in ActivityManagerBean javax.naming.NameNotFoundException: java:comp/env/ejb/local/TaskServiceBean not found in ActivityManagerBean at com.evermind.server.ApplicationContext.lookupInJavaContext(ApplicationContext. java:306) at com.evermind.server.ApplicationContext.unprivileged_lookup(ApplicationContext. java:230) at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:195) at javax.naming.InitialContext.lookup(InitialContext.java:351) at oracle.bpel.services.workflow.task.client.TaskServiceLocalClient.initiateTask( TaskServiceLocalClient.java:48) at oracle.bpel.services.workflow.task.impl.TaskServiceWSIF.initiateTask(TaskServi ceWSIF.java:99) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at *** 01/08/07 03:27 pm *** After looking into the EJB refs of ActivityManagerBean .. exactly this one is missing .. . < session-deployment name="ActivityManagerBean" min-instances="50" location="ejb/collaxa/system/ActivityManagerBean" local-location="ejb_ob_engine_ActivityManagerBeanLocal" persistence-filename="ejb/collaxa/system/ActivityManagerBean.home_default_grou p_1"> < ejb-ref-mapping name="ejb/local/DispatcherLocalBean" /> < ejb-ref-mapping name="ejb/local/ProcessManagerLocalBean" /> < ejb-ref-mapping name="ejb/local/CubeDeliveryLocalBean" /> < ejb-ref-mapping name="ejb/local/MessageLocalBean" /> < ejb-ref-mapping name="ejb/local/ServerLocalBean" /> < resource-ref-mapping name="jms/collaxa/BPELInvokerQueueFactory" location="BPELjms/BPELInvokerQueueFactory" /> < resource-env-ref-mapping name="jms/collaxa/BPELInvokerQueue" location="BPELjms/BPELInvokerQueue" /> < /session-deployment> . and here are the missing entries .. . < ejb-local-ref id="EjbRef_ActivityManager_TaskServiceBean"> < ejb-ref-name>ejb/local/TaskServiceBean< /ejb-ref-name> < ejb-ref-type>Session< /ejb-ref-type> < local-home>oracle.bpel.services.workflow.task.ejb.TaskServiceLocalHome< /local -home> < local>oracle.bpel.services.workflow.task.ejb.TaskServiceLocal< /local> < ejb-link>TaskServiceBean< /ejb-link> < /ejb-local-ref> *** 01/08/07 03:27 pm *** (CHG: FixBy->10.1.3.3) *** 01/08/07 03:34 pm *** also in the orion-ejb-jar.xml < ejb-ref-mapping name="ejb/local/TaskServiceBean" /> . is missing *** 01/08/07 03:51 pm *** *** 01/18/07 09:22 am *** (CHG: Sta->16) *** 01/18/07 09:22 am *** *** 01/18/07 10:38 am *** (CHG: Confirmed Flag->Y) *** 01/18/07 10:38 am *** (CHG: Sta->11 Asg->NEW OWNER) *** 01/18/07 10:38 am *** *** 01/18/07 10:39 am *** (CHG: Asg->NEW OWNER) *** 01/23/07 01:09 pm *** (CHG: FixBy->10.1.3.4) *** 01/23/07 01:09 pm ***
.
Maybe you are looking for
-
Hi Experts , I am sending an e-mail aith a PDF attachment , the attachment contains a greeting card (BIT MAP file), When i find the mail , PDF is opening with error 'Drawing Error Occured'. Pls find the sample code ... CALL FUNCTION V_FORM_
-
Error while installing Oracle 9.0.1 on Linux Red Hat.
I am trying to install Oracle 9.0.1 on Linux Red Hat (Enterprise Edt), and getting this long error--- "Initializing Java Virtual Machine From /tmp/OraInstall0/jre/bin/jre. Please wait... :symbol errno. version GLIBC-2.0 not defined in gile libc.so.6
-
As titled. I bought many apps from iTunes at the end of last year, and then my computer had got problem that I had to format and reinstall everything. I just want to know how can I restore the previously bought apps once if I forgot to backup any of
-
IBook Rechargeable Battery Model a1008
Looking for a rechargeable battery model nol a1008 for an iBook Power PC G3 (12 inch screen?). It's an ibbok powerbook 4.1, a pretty old computer. It's white. Need to find and buy new one. Are these available? If so, where?
-
Hi, Is there any documentation that helps explain what some of the operators mean in the Query Generator? For example, our partner set up a query that is used for a user-defined value, but I'm not understanding what some of the operators/conditions/