| Great Documentation for Investment and Trading Systems |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- Tomcat and QueueHi,
Does any one know about the Coyote connector queue in Tomcat?
How does it work? if a connection gets queued then when does it get a
thread? will it be given preference over the requests arriving after
its arrival??
rgds,
Prashant
- 6
- MacOS X (was javax.usb)Steve W. Jackson wrote:
>>http://en.wikipedia.org/wiki/Macos#Mac_OS_X
>>
>>Mac OS X brought Unix-style memory management and pre-emptive
>>multitasking to the Mac platform. It is based on the Mach kernel and the
>>BSD implementation of UNIX, which were incorporated into NeXTSTEP, the
>>object-oriented operating system developed by Steve Jobs's NeXT company.
>>
>>Cheers,
>
>
> That's an interesting read, but it should not be taken as any form of
> "gospel" since it contains some inaccuracies of its own.
It's easily fixable, should you be so inclined. What's wrong with it
though - it's what I've read in the past, that MacOS X is the Mach
microkernel (tightly) wed to bits and pieces of a BSD (I'm not sure
which, I think FreeBSD or NetBSD).
--
David N. Welton
- http://www.dedasys.com/davidw/
Linux, Open Source Consulting
- http://www.dedasys.com/
- 6
- Fwd: Reminder: Call for FreeBSD status reports!FYI.
Ernst
---------- Doorgestuurd bericht ----------
Subject: Reminder: Call for FreeBSD status reports!
Date: maandag 29 september 2003 23:33
From: Scott Long <email***@***.com>
To: email***@***.com
All,
Don't forget to submit your FreeBSD status reports by Oct 1, 2003!
These reports are open to not only official project memebers, but also
to anyone who is engaged in the development of projects that relate to
FreeBSD. Kernel, userland, ports, documentation, installation,
integration, etc, reports are all welcome and encouraged. Reports should
be 1-2 paragraphs in length, focus on one topic, and should follow the
template that is available at
http://www.freebsd.org/news/status/report-sample.xml.
Submissions must be made to email***@***.com. Submissions for multiple
projects per person are welcome.
Thanks!
Scott Long
Robert Watson
-------------------------------------------------------
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 6
- Connection Pooling in Java application for interacting with Websphere MQI have following infrastruture at my site.
1> Machine #1 has below
- Websphere MQSeries 6.0 (client setup - Slim Client)
- OS = Windows 2003
- i/p address : 10.1.11.10
- Tomcat web server 5.5
- No Websphere Application Server.
2> Machine #2 has below
- Websphere MQSeries 6.0 (Server setup)
- OS = Windows 2003
- i/p address : 10.1.11.21
- Queue Manager Name : qMngr
- Queue Name (client will put the message) : toServerQ
- Queue Name (client will get the message) : fromServerQ
- I have developed the web application in Tomcat web server 5.5 using
MQ base classes for accessing the Websphere MQ.
- Since it is web application there can be atleast 25 request at
time.
i.e. when client#1 request data from queue he must get data related
to client#1 only not other than client#1.
- For accessing the websphere MQ, I am using websphere MQ base classes
in Client mode. (Not JMS)
==>>>> Source Code as follows
Class MQInterface (Servlet) is used for getting the web request from
user and reply the response in html format.
------------------------------------------------------------------------------------------------------
public class MQInterface extends HttpServlet {
protected void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
String Output = "";
System.out.println("!! Entered into Banking Servlet !!");
String requestParam = request.getParameter("OPRN_CODE");
if (requestParam.equalsIgnoreCase("GET_NAME_DETAIL")){
String id = request.getParameter("id");
Output = MQDataObject().getNameDetail(id);
return Output;
}
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println(Output);
}
Class MQDataObject is used for getting and putting data(message) into
Websphere MQ.
------------------------------------------------------------------------------------------------------
public class MQDataObject {
private String hostname = "10.1.11.21";
private String channel = "Chnl1";
private String qManager = "qMngr1";
private MQQueueManager qMgr;
private ISISSSLAdaptor ssl;
private ISISConfigHelper ConfigHelper;
private String Output;
public MQDataObject(){
MQEnvironment.hostname = hostname;
MQEnvironment.channel = channel;
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES_CLIENT);
MQEnvironment.sslCipherSuite =
"SSL_RER_WERH_3KIUD_EQW_CRT_SSA";
try{
ssl = new DEMOSSLAdaptor("DEMOSSLAdaptor.config");
ConfigHelper = new
ISISConfigHelper("MQConnection.config");
}catch(Exception exception){
System.out.println("Exception Details => " + exception);
}
}
public String getNameDetail(String sendMessage){
....
....
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES_CLIENT);
String msgText = "";
try
{
....
....
// Create a connection to the Queue Manager.
qMgr = new MQQueueManager(qManager);
// Set up the options on the queue we wish to open
int openOutOptions = MQC.MQOO_OUTPUT;
// Specify the queue to open and open option
MQQueue sendingQueue =
qMgr.accessQueue("toServerQ",openOutOptions,null,null,null);
// Define the MQ message and write some text in UTF
format
MQMessage sendingMessage = new MQMessage();
sendingMessage.writeUTF(sendMessage);
// Specify the message options..
MQPutMessageOptions pmo = new MQPutMessageOptions();
// Put message on the queue
sendingQueue.put(sendingMessage,pmo);
// Close Sending Queue
sendingQueue.close();
// Receiving the message back
// Wait for 5 seconds to get reply from receiving queue
Thread.sleep(5000);
// Set up the options on receiving queue we wish to open
int openInOptions = MQC.MQOO_INPUT_AS_Q_DEF |
MQC.MQOO_OUTPUT;
MQQueue receivingQueue =
qMgr.accessQueue("fromServerQ",openInOptions,null,null,null);
MQMessage receivingMessage = new MQMessage();
// Set and Get the message options
MQGetMessageOptions gmo = new MQGetMessageOptions();
// Receiving the message off the queue.
receivingQueue.get(receivingMessage,gmo);
// Get the message from the receiving queue.
msgText =
receivingMessage.readStringOfByteLength(receivingMessage.getMessageLength());
// Close Receiving Queue
receivingQueue.close();
// Close a connection to the Queue Manager.
qMgr.disconnect();
// Parse the received message using parser.
String output = new IFXXMLParser().runExample(msgText);
}
catch (MQException mqex){
System.out.println("MQ Error : " + mqex);
}
catch (Exception ex){
System.out.println("General Error : " + ex);
}
return Output;
}
}
The message for sending the receiving is in XML format.
Could any one help me following in questions.
1> Since there is 30 request at time so for improve the performance
and resources I need to do connection pooling.
How can I achieve this using base classes.
2> While retrieving (getting) the message for particular request how
can I identify the response message.
i.e. when client#1 request data from queue he must get data related
to client#1 only not other than client#1.
because In above scenario there are separate queues for getting the
message and putting the message.
I have read the tutorial on connection pulling but I am little
confused.
Thanking in Advance
Sanjeev
- 6
- A little optimization question: Local var allocationI often wonder: Does it make any difference in EXECUTION TIME which
version I choose:
#1:
String st;
while (true){
st=dis.readLine();
if (st==null) break;
< do something else >
}
#2:
while (true){
String st=dis.readLine();
if (st==null) break;
< do something else >
}
It's obvious that st is valid outside the loop in #1. But does it get
allocated on the stack for every iteration in #2, or just re-used? If
not, I suppose #2 is preferred as far as limiting the scope, enabling
gc, is an issue.
Chris
- 6
- JTextArea append method doesn't always appendI have an application with many custom loggers, and a number of JTextArea
instances for displaying the log entries written to the loggers. Each
JTextArea has a thread associated with it that continuously pulls entries
out of a particular logger and appends that text to the JTextArea. Thus,
each entry written to a logger should show up in the associated JTextArea.
The problem I have is that not all the log entries show up in the text area,
and what shows up and what does not can change with each execution. I've
put print statements before and after the log statements, and before and
after the text area append, and all the expected log entries show up at all
those places. Only in the JTextArea is there variability in what shows up.
Is this a bug in JTextArea, or is this some known behavior?
--
=================
Lee Graba
email***@***.com
=================
- 7
- Automated Basic Authenication with an Applet for the Browser ?I like to automate web access to secure pages and proxies, which are
proteced with a Basic Authenication scheme.
The Basic Authentication within an Applet works really well, I get all
the information I need when I attach the
Authorization: Basic base64encodeUID_PW to the request Header.
or
if I use the Authenticator Class of the JDK1.5.
My problem is that the browser does not notice that I already have
a UID/Password combination for the desired web page.
When I did the same with a form based authorisation the URLConnection
was setting the Cookie inside the browser implicitly, the
showDocument() method displayed the secure page, because the browser
used the cookie to access it.
Is there any way to access the cache for the UID and Password of the
browser to set these values that when I invoke the showDocument() to
display the page inside the browser, I don't have to enter the UID and
Password again?
My current code to authenticate myself is this, I also tried a direct
socket connection and a HttpURLConnection there was no difference:
String urlString =
"http://www.demo.com/basicprotectedpage/index.html"
AppletContext appCont = getAppletContext();
//created password authenticator.
mmAuthenticator myPassAuth = new mmAuthenticator(uid,pw);
//setting password.
Authenticator.setDefault(myPassAuth);
//URL created.
URL url = new URL(urlString);
//opening connection
URLConnection conn = url.openConnection();
//setting do input and do output.
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setUseCaches(true);
//Data Input Stream
BufferedReader bin = new BufferedReader(new
InputStreamReader(conn.getInputStream()));
String inputLine;
System.out.println("web page data " );
while ((inputLine = bin.readLine()) != null)
System.out.println(inputLine);
bin.close();
appCont.showDocument(new URL(urlString)); // this should
display the secure page without the prompt for uid password
Thank you in advance. Have a nice day.
FB
- 11
- Hot opportunities for Java Consultants in ClevelandHey All -
I'm putting out an A.P.B. for Java Developers in the Cleveland area,
or folks who are willing to work in Cleveland. Sun Certification is a
huge plus, and consulting experience would make you a rock star.
Contact me via e-mail with a resume if you're interested, and feel
free to tell friends!
Thanks,
Jerome
- 11
- setCursor() for a ContentPanel
Joana,
I was having a similiar problem and did some searching and found the
following forum:
http://forum.java.sun.com/thread.jsp?forum=57&thread=110928
Basically, I think you need to use setCursor on the GlassPane. I used
the following code in my application and it seems to work.
Component gp = getGlassPane();
gp.setVisible(true);
gp.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
//do your computations
gp.setCursor(Cursor.getDefaultCursor());
gp.hide();
Hope this helps,
Kin Wong
On 14 Jun 2003 09:09:45 -0700, email***@***.com (Joana)
wrotE:
>Hi!
>
>May I ask you for a favour ... a hint would please me a lot ...
>
>When the Graph is completely shown in the window I can see no
> WAIT_CURSOR, but DEFAULT_CURSOR.
>When I move the mouse out of the window and hit back the window area I
>get the WAIT_CURSOR.
>
>Could You please tell me, where is my bug or better what should I do,
>to get the WAIT_CURSOR during the graph computing process
>
>Thanks a lot for every single answer!
>
>Best regards,
>Joana
- 11
- Crystal Report Change Data SourceI have a few crystal reports (XI) that uses JDBC to connect to MS SQL
Server. The JDBC Driver is JTDS 1.1. Now I am trying to update the data
source definition to include JNDI name so it can be more portable. The
trouble is I can't update it.
Here's what I've tried on existing working reports:
- Go to "Set Datasource Location" dialog, expand current data source
properties, add JNDI connection name. Crystal now pops up a dialog box,
asking me to confirm connection info. So I put in user ID and Password.
Clicking "Finish" and Crystal pops up a message saying "Logon failed.
Details: SQL Exception: [SQL State:] 08501 [Error Message:] Network
error IOException: Connection refused: connect". Then the same
connection fonfirmation dialog come up again as if i typed in wrong
user name and password.
- The next thing I tried (since I can't manually add JNDI name) is to
replace existing datasource with another one. Again, I go to "Set
Datasource Location". I've already defined another JDBC connection with
JNDI name in it. now selecting existing connection in the tree at the
top and select the new connection in the tree at the bottom, click
"Update". Now connection confirmation dialog pops up. After entering
user id and password, I click Finish. Then Crystal says
- "Data Object cannot be opened/accessed."
- "Database Connector Error: 'Unexpected error'"
- "Data Object cannot be opened/accessed."
- "Database Connector Error: 'Unexpected error'"
- "Some tables could not be replaced, as no match was found in the
new data source. Please specify the table required for any unmodified
tables."
Some more information regarding existing reports. When I created the
reports, Crystal complains about not able to find the tables and offer
me to remove the related fields from the report. I clicked "No" and the
reports still runs perfectly fine.
There isn't much I can do after this. So I look up on the web, I think
it may have to do with the not so well implemented "verify database"
functionality, but I have no way to prove or solve it.
Can anyone help me on this? The database is the same, so theoretically
there shouldn't be any problem updating the datasource defintion,
especially when the datasource is the same as before. And adding JNDI
name to the report shouldn't be a problem either because it won't get
use until a Java app try to run it.
Any suggestions?
Thanks,
Jo
- 12
- 14
- User privilege for getMetaData()When using a basic user with only data query and update privileges I
cannot get column data from the DatabaseMetaData object returned from
getMetaData() (on a connection using the JDBC Oracle thin driver).
When I use the schema owner with full privileges, I get the column
data. What privilege is necessary to get column information from
getMetaData?
- 15
- What is J2EE and an application server?Can someone explain to me what java enterprise edition is?? I've been
looking into the web for some info, but can't really make sense of the
info found. Is there also an tutorial avaible?
I've found one at the java site, but there it was attached to an
application server. And that's my second question, what is a
application server and what can u do with it??
Thnx someone.....
- 15
- jxta in subnetHallo,
i have a broblem with the jxta technology. I build up a testbed
consisting of a server a router and two clients. The router is
connected to the two clients and the server. Any connection from one
client to another or from one client to the server goes through the
router. Client 1 is configured with ip 192.168.100.1, client two with
172.16.0.1 and the server with 10.0.0.2. So the router routes for
three different subnets. No machine has access to the another (except
the router). There is also no connection to the internet.I wrote an
application built on jxta. The application runs on the server and the
two clients. I configured the peers as rendevouzs and added to every
peer the ip's of the two others to the list of known rendevouzs peers.
When i run my application, the peers can find each other, BUT it needs
a lot of time, somtimes about 10 miutes. I cannot understand this,
because the peers know each other by the list of known rendevouzs. How
can i improve the time the peers need to find each other? I think my
configuration settup is ok (, otherwise the peers never would find
each other?).
Can anyone help me ?
Michibeck.
- 15
- Reading file lines into large ListHi all,
I have tried posting this problem a few times looking for a solution.
What I have works but is slow.
I have to read unordered data from a text file. Data A has a
one-to-many relationship with Data B, and Data B has a one-to-many
relationship with Data C . Once I find Data A, Data B and Data C could
be anywhere in the file. So I do a RandonAccessFile.seek(0) . This
needs to be repeated hundereds of times for lots of Data B and Data C
relationships.
I'd like to put the file in memory. However, I'm using Scanner and
regex to get the data. I don't think I can run Scanner on ByteBuffer
per line.
So my latest idea is to read the file per line and store it in List. So
a 10,000 line file would have a 10,000 size List. That way I could run
Scanner on the Strings in the List, and Iterate repeatably. The data in
the List would be read only.
Any advice appreciated.
iksrazal
|
| Author |
Message |
Rick

|
Posted: 2005-9-14 9:56:00 |
Top |
java-programmer, Great Documentation for Investment and Trading Systems
Just wanted to let people know about a new, free Encyclopedia for Investors
and Traders who are building or maintaining systems:
Http://www.itsdoc.org
"itsdoc" stands for "It's Documentation."
The site attempts to provide highly accurate documentation in an
encyclopedia format. It's 100% free, with no
advertising whatsoever and no soliciting. The entity is entirely non-profit.
Users are invited to contribute high quality material to the site and also
draw
from the considerable knowledge base hosted there. If you are coding
investment
and trading systems you will probably find this site extremely helpful.
It's new, the official launch isn't until January so the site has a few
rough
edges right now. Still, its very useful.
I hope you get a lot out of it. Please help promote it and put something
back into it too.
Rick
|
| |
|
| |
 |
Harrison D Reiser

|
Posted: 2005-9-28 5:35:00 |
Top |
java-programmer >> Great Documentation for Investment and Trading Systems
Would you kindly peddle your shit elsewhere?
|
| |
|
| |
 |
Rick

|
Posted: 2005-10-6 20:13:00 |
Top |
java-programmer >> Great Documentation for Investment and Trading Systems
"Harrison D Reiser" <email***@***.com> wrote in message
news:dhcdti$o5u$email***@***.com...
> Would you kindly peddle your shit elsewhere?
Mr. Reiser,
I assure you that http://www.ITSdoc.org has substantial substance and has
nothing to do with whatsoever with peddling.
It's a highly relevant bank of documentation, specifically constructed to
support open source coders working on investment and trading systems. The
site is neutral.
In the short time since launch we have over 70 registered users, many of
whom are open source Java programmers. One in fact is "world class"
currently working at CERN and implementing the knowledge posted on the site.
Others are from around the world interested in the documentation base.
I'd suggest you have a look at the site yourself and see if first hand if
your original assessment is indeed correct. We will be happy to directly
respond to any rational criticism from the open source community.
Rick Labs
ITSdoc.org
|
| |
|
| |
 |
Takashi

|
Posted: 2005-10-10 17:05:00 |
Top |
java-programmer >> Great Documentation for Investment and Trading Systems
Rick wrote:
> "Harrison D Reiser" <email***@***.com> wrote in message
> news:dhcdti$o5u$email***@***.com...
>
>
>>Would you kindly peddle your shit elsewhere?
>
>
>
>
> Mr. Reiser,
>
> I assure you that http://www.ITSdoc.org has substantial substance and has
> nothing to do with whatsoever with peddling.
>
<snip>
As admirable as your intentions may be, it does show an inherit lack of
understanding of what it takes to succesfully trade the financial
markets - consequently, your apprach then (in so far as actually
attaining your stated goals) is fundamentally flawed.
All you can ever hope to attain is to attract academics and programers -
not real traders. You may come up with some nice theories (the
physicists will be most helpful in this regard) and some conceptually
sound system architectures (the computer scientists and programmers will
be mostly useful in this regard). You may throw in concepts such as
Behvourial finance and AI etc and come up with elegant theories and
formulae which "explain most of the data" - the one missing ingredient
is that of the imput of a real (i.e. succesful) trader.
How can I be so sure of that?. Well there are two reasons:
1). What is good for the goose is not necessarily good for the gander -
when it comes to trading. Trading is a very personal affair and so in
this case, the whole (i.e. the collective) will be of considerably less
value than the sum of its parts - especially considering the fact that
the parts are not likely to be succesful traders - see below
2). The experience of trading exacts a lot (mostly mentally as well as
financially) from a trader. A sucessful trader would have paid his or
her "dues" - several times over - and is constantly being challenged by
the market - by definition, he is paranoid, knowing that he/she can
never rest on his laurels - the only things that keeps him coming back
for more are
i). The belief (backed by historical fact) that he/she can deal with
pretty much what the market throws at him/her
ii). The almost unbelievable rewards that are attainable once one has
mastered the "art" of trading - note "art" not science - any fool can
put together a bunch of scientists and programmers together and "sort
out" the salient properties of the "science part"
Traders are essentially lone eagles - they fly solo, they do not hunt in
packs - and therefore they have a *fundamentally* different mindset from
those whom you will attract. If all you want to do is to write "clever"
systems then by all means go ahead. If you want to *consistently* make
money from the markets - then you simply will not achieve it going down
this route (do you seriously think you are the first person to have
acted on this idea?). I have stated so many times on this ng: The only
way to become a succesful trader is either to learn from a succesful
trader - by watching him trade and asking questions to learn how he
thinks and more importantly, deals with stress situations (you then
adapt your stress responses accordingly - depending on your mental
makeup) or to start small (so that you can survive the truly stupid
miustakes you will make along the way) and learn from your mistakes -
never trade bigger than your risk rules allow and never get too "cocky"
with the market. If trading was as easy as most people thinking - people
who have a 9-5 job must be truly morons (is that the case?)
But this advice is as sexy as the old but sage advice: "If you want to
move out of the ghetto/escape poverty - get a college degree and don't
have kids while you're in your teens". This si common sense - but how
many people heed it?. They would much rather head for the "short cut"
which almost always leads to the jail house. Trading is exactly the same
- the rules don't change for anybody. there is no quick way (unless you
have a mentor - and as I have explained many times already in this ng,
the best mentor is normally a family member - father/uncle etc, or
failing that, a very close *personal* friend - other than that you're on
your own - regardless of what the glossy brochure says.
I am 100% confident however, that you are convinced that I am mistaken -
after 3-5 years of your life has been wasted with little results to show
for it (other than a few "friends" made over the interval and maybe a
really "clever system" - that does not *consistently* make money yet),
you will be less confident about this idea and you will remember this
conversation. What will I be doing in the mean time?
You probably guessed right - I'll be on the otherside of most of your
trades - selling to you when you need to buy (for a "small fee" of
course), and buying from you when you need to sell (for a "small fee"
ofcourse). It's part of the education that you (anyone for that matter)
needs to learn before they either blowout or become good traders. You
see after all, I'm really an educator at heart ;-)
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- How do you write a program that prints 20 random cards?I have to write a program that prints 20 random cards (suit,
faceValue). I have to have a driver program and write a constructor
with my own methods. I am fairly new at java, and this concept is
confusing to me at the moment. So far, I have written both the driver
and constructor programs. However, they do not work. It compiles and
runs, but every card says "Spade null". I think it has something to
do with my random number generator. Please help. Here's my driver
program:
***********************************************************
import java.util.Random;
class CardGenerator
{
public static void main (String [] args)
{
// Use to get random numbers
Random generator = new Random();
// Print out to screen
System.out.println ("Dealing 20 random cards: ");
// repeat this loop 20 times to get 20 cards
for (int i=1; i<=20; i++)
{
// declare new object
Card myCard = new Card (1,1);
// get random numbers for suit and faceValue
int suit = generator.nextInt(4) +1;
int faceValue = generator.nextInt(13) +1;
// get number from my methods
suit = myCard.getSuit();
faceValue = myCard.getFaceValue();
// print card
System.out.println (myCard);
}
}
}
************************************************************
Here's the program with the constructor and my methods:
************************************************************
// import classes
import java.util.Random;
class Card
{
// declare variables
private int suit;
private int faceValue;
String cardType;
String suitType;
// constructor
public Card (int suit, int faceValue)
{
// call methods
getSuit();
getFaceValue();
}
// gets value for suit
public int getSuit()
{
return suit;
}
// gets value for faceValue
public int getFaceValue()
{
return faceValue;
}
// decides the suit and card according to the random number
picked
public String toString()
{
// if statements to get suit type
if (suit == 1)
suitType = "Heart";
else if (suit == 2)
suitType = "Diamond";
else if (suit == 3)
suitType = "Club";
else
suitType = "Spade";
// switch statement to get card type
switch (faceValue)
{
case 1:
cardType = "Ace";
break;
case 2:
cardType = "2";
break;
case 3:
cardType = "3";
break;
case 4:
cardType = "4";
break;
case 5:
cardType = "5";
break;
case 6:
cardType = "6";
break;
case 7:
cardType = "7";
break;
case 8:
cardType = "8";
break;
case 9:
cardType = "9";
break;
case 10:
cardType = "10";
break;
case 11:
cardType = "Jack";
break;
case 12:
cardType = "Queen";
break;
case 13:
cardType = "King";
break;
}
// returns string
return (suitType + "\t" + cardType);
}
}
******************************************************
If someone could help me, please do. Because I am stuck and lost
right now. Thanks.
David
- 2
- ReportViewer.jarI need ReportViewer.jar file which is required to call Crystal Reports
within Java. All other required .jar files, I have got.
Please provide me this file at <email***@***.com>
imediatly, if you have. I will be very thankfull to you.
HERE IS CODE:-
*/
import java.awt.*;
import javax.swing.*;
import com.crystaldecisions.ReportViewer.*;
// Use these to talk to RAS
import com.crystaldecisions.sdk.occa.report.application.*;
import com.crystaldecisions.sdk.occa.report.reportsource.*;
public class HelloWorldSwing
{
private static void createAndShowGUI()
{
try
{
//Make sure we have nice window decorations.
JFrame.setDefaultLookAndFeelDecorated(false);
//Create and set up the window.
JFrame frame = new JFrame("HelloWorldSwing");
frame.setTitle( "Testing 1, 2, 3");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ReportViewerBean viewer = new ReportViewerBean();
viewer.init( new String[0], null, null, null);
ReportClientDocument rpt = new ReportClientDocument();
// FLui: set the RAS server if you are using RAS
rpt.setReportAppServer( "localhost" );
rpt.open( "ras://C:\\Reports\\MyReport.rpt", 0 );
IReportSource rptSource = rpt.getReportSource();
viewer.setReportSource( rptSource );
frame.getContentPane().add( viewer, BorderLayout.CENTER );
frame.setSize( 700, 500 );
frame.setVisible(true);
viewer.start();
}
catch ( Exception exception )
{
System.out.println( exception.toString() );
}
}
public static void main(String[] args)
{
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
//
com.crystaldecisions.ReportViewer.ReportViewerFrame.main( args );
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
createAndShowGUI();
}
});
}
}
- 3
- Teach online turn your wisdom into wealth at GoogleSpammer.comOn Sep 30, 10:27 am, email***@***.com wrote:
> Every one ..
..has realised that most of the spam on the internet
originates from Google Groups. So apparently some
'smart' Google spammers are trying to obscure their
origins by showing a public address of yahoo* or
hotmail*.
It won't work though, since listed clearly in the
headers of the post is..
"X-Trace: posting.google.com 1191112075
31470 127.0.0.1 (30 Sep 2007 00:27:55 GMT)"
* Yes, and they are, in order, probably the next
biggest sources of spam.
Andrew T.
- 4
- Struts Readonly...Hi,
can anybody tell me, if it's possible to set sturts fields in an jsp
site to readonly via an action?
Hope it is understandable what I want, my englisch isn't the best...
Greetings
Laverna
- 5
- please refer me some good java consultanthi,
I have a very good oppertunity in louisville,KY for Java developer
And also i have fulltime position in louisville,KY for Java Developer.
please refer me some references who have very good in Java,
J2ee,Struts,
Location: Louisville,KY
Duration : 3 to 6 months go longer
- 6
- Mixed SAX and DOM processing: echoing with occassional changes.I need to write a tool which will allow me to process a huge document
with chunks of it in memory. The procedure is to echo XML coming from
some input to an output, then when I hit a certain type of element,
read all of its children into a DOM and somehow manipulate it
(specifically, the goal is to hand it to a rules engine which will add
flags). After that is complete, serialize it right back out to the
stream and resume processing.
My approach currently involves a ContentHandler object which simply
serializes every event using a TransformerHandler object. When I see
the element I want, I start creating Node objects in a stack and
assembling them into a DOM as I hit closing elements. The problem is
that there is no direct way of serializing that DOM to the same output
stream without violating encapsulation. At first I thought that I
would be able to pass the DOM to a SAX ContentHandler (which I would
provide with a reference to the TransformerHandler doing the
serialization). However, it turns out that isn't the case. I do not
want to reinvent the wheel and walk the DOM manually nor do I want to
create (potential) side-effects by writing directly to the OutputStream
wrapped by my Result object using XMLSerializer on the DOM. XMLFilters
do not appear to be a solution because I cannot apply my rules in a
streamable fashion (and getting a DOM from the incoming stream is not
the difficult part anyway).
I've looked around and found a variety of mixed parsing techniques, but
it seems that none of them quite meet my needs. Writing a class which
takes a DOM, walks it, then calls the appropriate ContentHandler
methods would not be too painful, but this seems horribly inelegant to
me. Also, I cannot even begin to fathom that I am the only person who
wants to do this.
Any suggestions?
(What follows is some code which may give an idea of where I am at.
Simplified for brevity.)
// Initial invocation
final SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
final SAXParser parser = factory.newSAXParser();
final XMLReader reader = parser.getXMLReader();
final TransformerHandler handler = getTransformerHandler(System.out);
reader.setContentHandler(new EvaluationHandler(handler));
reader.parse("foo.xml");
// EvaluationHandler (derives from a class which echoes to a provided
ContentHandler)
public void startElement(final String uri, final String localName,
final String qName, final Attributes attributes) throws SAXException
{
if (performDOMProcessing())
{
final Element element = this.host.createElementNS(uri, qName);
addAttributes(element, attributes);
this.buffer.push(element);
}
else
{
super.startElement(uri, localName, qName, attributes);
}
}
public void endElement(final String uri, final String localName, final
String qName) throws SAXException
{
if (performDOMProcessing())
{
final Node element = this.buffer.pop();
if (this.buffer.isEmpty())
{
if (this.host.hasChildNodes())
{
final Element root = this.host.getDocumentElement();
this.host.removeChild(root);
}
this.host.appendChild(element);
// Do processing against this.host with rules engine.
// Pass off to serialization.
}
else
{
this.buffer.peek().appendChild(element);
}
}
else
{
super.endElement(uri, localName, qName);
}
}
public void characters(final char[] characters, final int start, final
int length) throws SAXException
{
if (performDOMProcessing())
{
final String text = new String(characters, start, length);
final Text textNode = this.host.createTextNode(text);
this.buffer.peek().appendChild(textNode);
}
else
{
super.characters(characters, start, length);
}
}
- 7
- How to accept the Untrusted cert?Dear All,
I use JSSE to implement a proxy server which support http/https.
However, I find my code can't support some secure site which provide a
certificate which doesn't signed by CA.
and here is the error message:
javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: No trusted certificate
found
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA12275)
at Proxy.SSLNegotiation.startNegotiation(SSLNegotiation.java:101)
at Proxy.SSLProxyProcess.makeNegotiation(SSLProxyProcess.java:383)
at Proxy.SSLProxyProcess.run(SSLProxyProcess.java:83)
at Proxy.ProxyProcess.run(ProxyProcess.java:107)
Caused by: sun.security.validator.ValidatorException: No trusted
certificate found
at sun.security.validator.SimpleValidator.buildTrustedChain(SimpleValidator.java:304)
at sun.security.validator.SimpleValidator.engineValidate(SimpleValidator.java:107)
at sun.security.validator.Validator.validate(Validator.java:202)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(DashoA12275)
at com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(DashoA12275)
... 10 more
java.net.SocketException: Socket is closed
at java.net.Socket.setSoTimeout(Socket.java:920)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.setSoTimeout(DashoA12275)
at Proxy.HttpResp.<init>(HttpResp.java:53)
at Proxy.SSLProxyProcess.makeNegotiation(SSLProxyProcess.java:385)
at Proxy.SSLProxyProcess.run(SSLProxyProcess.java:83)
at Proxy.ProxyProcess.run(ProxyProcess.java:107)
what should i do to accept the self-sign certificate?
Thank,
Jake
Here is my code.
package Proxy;
import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.KeyStore;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManagerFactory;
public class SSLNegotiation {
private Socket socket = null;
private String host = null;
private int port;
private String keyStore = null;
private char keyStorePass[] = null;
private char keyPassword[] = null;
private String sslContextInst = null;
private String keyStoreInst = null;
private String keyManagerFactoryInst = null;
private String trustManagerFactoryInst = null;
public SSLNegotiation(Socket socket) {
this.socket = socket;
host = socket.getInetAddress().getHostName();
port = socket.getPort();
}
public SSLNegotiation(String host, int port) {
this.host = host;
this.port = port;
}
public SSLNegotiation(Socket socket, String host, int port) {
this.socket = socket;
this.host = host;
this.port = port;
}
public void importKeyStore(String ks, String ksp) {
importKeyStore(ks, ksp, ksp);
}
public void importKeyStore(String ks, String ksp, String kp) {
keyStore = ks;
keyStorePass = ksp.toCharArray();
keyPassword = kp.toCharArray();
}
public void setInstance(String content, String ks, String kmf, String
tmf) {
sslContextInst = content;
keyStoreInst = ks;
keyManagerFactoryInst = kmf;
trustManagerFactoryInst = tmf;
}
public Socket startNegotiation(boolean connectServer) {
KeyStore ks = null;
KeyManagerFactory kmf = null;
SSLContext sslContext = null;
SSLSocket sslSocket = null;
try {
ks = KeyStore.getInstance(keyStoreInst);
ks.load(this.getClass().getResourceAsStream(keyStore),
keyStorePass);
kmf = KeyManagerFactory.getInstance(keyManagerFactoryInst);
kmf.init(ks, keyPassword);
sslContext = SSLContext.getInstance(sslContextInst);
if (trustManagerFactoryInst == null)
sslContext.init(kmf.getKeyManagers(), null, null);
else {
TrustManagerFactory tmf =
TrustManagerFactory.getInstance(trustManagerFactoryInst);
tmf.init(ks);
sslContext.init(kmf.getKeyManagers(),
tmf.getTrustManagers(),
new java.security.SecureRandom());
}
SSLSocketFactory factory = sslContext.getSocketFactory();
if (socket != null)
sslSocket = (SSLSocket) factory.createSocket(socket, host, port,
false);
else
sslSocket = (SSLSocket) factory.createSocket(host, port);
sslSocket.setUseClientMode(connectServer);
sslSocket.setEnabledCipherSuites(sslSocket.getSupportedCipherSuites());
if (connectServer)
sslSocket.startHandshake();
} catch (UnknownHostException uhe) {
uhe.printStackTrace();
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
return sslSocket;
}
}
}
- 8
- 2 nested result setOn 19 Gen, 03:41, Lew <email***@***.com> wrote:
> > A ResultSet object is automatically closed when the Statement object that generated it
> > is closed, re-executed, or used to retrieve the next result from a sequence of multiple results.
I've resolve usig two different statement.
Thank you so much (and to the java doc too :) )
- 9
- JFrame start bar iconIs it possible to create a Frame or JFrame without the start bar icon?
If so, could someone please tell me the trick?
Thanks,
Tim
- 10
- Newbie question - Development environment (IDE)Hi folks,
I am new to java. I am thinking of switching to java because of
multiplatform support and I am currently on Windows with VB. I also did some
Javascripting within some ASP pages and I have rusty memories about Pascal
and C++ from my MS DOS times. But in the last years I focused on VB. So far
the introduction.
I am a little confused about what is the difference between Java and J2EE,
JSP, JavaBeans, JavaApplets, Servelets and some other keywords that you face
when looking around about Java. However, I would need Java for Client
applications, server side services for scripting and web applications. As I
am not satisfied with the evolution of the .NET (apart that it keeps me
dependent on Microsoft Windows platform) I guess I am better with Java,
correct?
I have seen some development environments (IDE) yet (like NetBeans and
Eclipse), but talking with other guys I always hear new names so I decided
to ask here at the newsgroup what would be the best thing to use. I am sure
that it depends even on personal preferences but I would really be glad to
hear/read your opinions. It would be a good orientation for me. So please
tell me, what you prefer and why?
Thanks a lot in advantage for all who give an idea,
Martin.
mailto:email***@***.com
http://www.may.co.at
- 11
- Signed applet problem with plugin 1.4.2Hi Java gurus,
I have an applet signed in JDK 1.4 jarsiner and using a Verisign code
signing key. It works nicely in Netscape & IE.
My troubles began when Sun upgraded to plugin 1.4.2_01-b06. When using
this plugin with IE, the applet still shows the "trust applet?" popup,
but when I click OK, an exception occurs as soon as the applet reaches
a privileged operation like system.getProperties(). I get
"SecurityControlException: access denied". This occurs in IE 5 and IE
6, on any platform I tested: XP, Win2000, Win98 etc. The applet still
works file on Netscape.
I also tried to sign the applet with JRE 1.4.2, but still IE denies
it.
Any clue?
Thanks in advance
Sruli Ganor
- 12
- exception in at javax.swing.SwingGraphics.createSwingGraphicsI am getting the following exception sometimes in my GUI. How can I
debug this? There is nothing from my code in the stack and the
exception is not easily reproducible. Any help will be greatly
appreciated.
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1064)
at
javax.swing.SwingGraphics.createSwingGraphics(SwingGraphics.java:147)
at javax.swing.JComponent._paintImmediately(JComponent.java:4670)
at javax.swing.JComponent.paintImmediately(JComponent.java:4488)
at
javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
java.lang.NullPointerException
at javax.swing.JComponent._paintImmediately(JComponent.java:4671)
at javax.swing.JComponent.paintImmediately(JComponent.java:4488)
at
javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
In paintImmediately null graphics
- 13
- keystroke latency patternsHi,
my name is Christian Seifert and I am graduate student as Seattle
University currently researching Keystroke Latency Patterns.
I would like to invite you to participate in the project by providing
me with your own keystroke latency patterns. I have created a data
collections java applet which can be accessed through the project site
at http://students.seattleu.edu/seiferc/independentStudies/index.asp.
Participating will not take longer than 5 minutes.
I have posted a message about a week ago and I would like to thank all
those who have participated. I am posting this again, because I need
much more data to create a valid algorithm.
Thanks for participating,
Christian Seifert
- 14
- Creating session state without http or ejbHi all,
I want to duplicate a feature I used in an ejb-based web service, in an
non-ejb tomcat-based web service. I want to allow a user to login via a
web service, on successful authentication return a session id String,
and on future call pass in the session id:
public ReturnWeb_Login web_Login(
String user_name,
String user_password) throws RemoteException {
soap_session_id = serviceLocator.getSoapSession_Id(soapSession);
if (athenticate(user_name,user_password)) {
return new ReturnWeb_Login (soap_session_id, user_name);
}
}
The idea here is that soap_session_id is generated from a Stateful
Session bean, and times out. Once logged in, subsequent calls are like:
public ReturnWeb_Base doSomething(
String soap_session_id) throws RemoteException {
//check authorization
SoapSession soapSession = checkAuthorization(soap_session_id);
if(soapSession!=null) {
//do something
}
}
The above works without messing around with the internal servlet the
web service uses, axis in this case.
My question is simple, though the answer may be difficult: How can I
create a session id that times out, independent of http or ejb ?
iksrazal
- 15
- Sending text read from GUI to a methodHey,
Have a problem sending a String from a GUI to a method.
The method definitely works as I can use with text that I set in code.
track.deleteFromList("some object name"); // removes object called
"some object name" from the list that the track object stores.
When I try to use a text box to read in the text it doesn't work.
The String is read in correctly, checked.
The String is read by method correctly, checked.
It should then make a comparison with each place in the list to see if
it's the correct identifier (Strnig is identifier/name of the object to
be deleted) but doesn't seem to realise when there is a match and
therefore should execute remove form list.
I suspect that the String has to be declared in some special way before
it is passed to the method? as it is not of definite value when the
prog starts running. It's read and fed properly, but because it's
dynamic it's not being compared correctly?
Relevant code is below, thanks very much for your help.
t1: text box, b1: button
FROM MAIN, everything else works, track is instance of Tracker2 class
///////////////////////////////////////////////////////////////////////
b2.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e) {
String inny = t1.getText();
track.deleteFromList(inny);
}
});
///////////////////////////////////////////////////////////////////////
import java.util.*;
public class Tracker2 {
private List<Array_test> list_of_test_objects;
//construct
public Tracker2(){
list_of_test_objects = new ArrayList<Array_test>();
}
.......
......
......
......
// delete from list given a certain identifier
public void deleteFromList(String old_array_test_object) {
int i = 0;
while (i < list_of_test_objects.size()) {
if ((list_of_test_objects.get(i).getIdentifier()) ==
old_array_test_object) {
list_of_test_objects.remove(i);
i = list_of_test_objects.size();
}
i++;
}
}
......
......
......
......
|
|
|