 |
 |
Index ‹ java-programmer
|
- Previous
- 1
- Bubble-Mind : online mind-mapper with a Java server appHello,
Sorry if this post appears like an ad... but I want to have your
feedback on a webapp I just deployed.
With Bubble-Mind you will be able to design brainstormings, heuristics
or other mind-maps. Personally I use this tool to store my knowledge
(thus making it my knowledge base) as trees...
The app is at : www.bubble-mind.com
Quickly here are the technos/tools I used : Spring, Hibernate, Axis
(1.3), Acegi and Maven... It was all new to me and looking backwards I
am wondering if SOAP was the best connectivity solution for that kind of
application - it was such a mess to make it work. Maybe something
lighter would have been better. *What would you have used in such an
application ??*
If you encounter any bug (oh yes you will), please use the 'bugs,
feedback' button on top-right to let me know...
thanks a lot,
--
Mathieu LEMAIRE
www.bubble-mind.com
- 1
- Java and POP3 IO (?) problemLo all,
I've written a simple program that connects to a POP3 server, allows me
to authenticate and then retrieves a certain message. The problem I'm
having is that when it retrives the message and prints it to the
console, I get different results depending on if I use a while loop or a
do-while loop. When I use a while loop, I get some of the headers but no
message body. When I use a do-while loop, I get some of the same
different headers (and message body), but some of the headers that I got
from using a while loop are missing. Does anyone have any idea what the
problem is?
My code as it is now:
import java.net.*;
import java.io.*;
public class mail
{
public static void main(String[] args) throws Exception
{
BufferedReader user = new BufferedReader(new
InputStreamReader(System.in));
System.out.print("Server address: ");
String host = user.readLine();
System.out.print("Port: ");
int port = Integer.parseInt(user.readLine());
// Connect to server and set up input/output streams
Socket mySocket = new Socket(host, port);
InputStream in = mySocket.getInputStream();
BufferedReader from = new BufferedReader(new
InputStreamReader(in));
OutputStream out = mySocket.getOutputStream();
PrintWriter to = new PrintWriter(new OutputStreamWriter(out));
String response = from.readLine();
System.out.println(response);
// Authenticate
System.out.print("Username: ");
String username = user.readLine();
to.println("USER " + username);
to.flush();
response = from.readLine();
System.out.println(response);
System.out.print("Password: ");
String pass = user.readLine();
to.println("PASS " + pass);
to.flush();
response = from.readLine();
System.out.println(response);
// Get message no. 5
to.println("RETR 5");
to.flush();
do
{
System.out.println(from.readLine());
}while(from.readLine() != null);
// Close streams and connection
to.println("QUIT");
to.close();
from.close();
mySocket.close();
if(mySocket.isClosed())
System.out.println("Disconnected");
}
}
Thanks.
- 2
- Eclipse 3.0 Running ILLEGALY on KaffeDalibor Topic <email***@***.com> writes:
>> When I instruct my computer running the Debian OS to load and run
>> eclipse, the code from some JVM package and the code from the Eclipse
>> package and from dozens of others are loaded into memory. The process
>> on my computer is mechanical, so we should look back and see who has
>> designed and created this particular combination. In this case, it
>> was Debian, who took the top level Eclipse component and selected
>> a particular JVM and particular support libraries to include.
>
> That's the 'running is illegal/GPL puts restrictions on use' fallacy. :)
I'm not talking about running; I'm talking about making a copy of
Eclipse and a copy of Kaffe and putting them both on an end-user's
system such that when I type "eclipse" I get a program made out of
both.
But you can see that it's not mere aggregation, because they invoke
each other when run.
-Brian
--
Brian Sniffen email***@***.com
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 3
- Change listbox mouse selection to not use ctrl keyI'm converting a program from Windows where the LBS_MULTISEL option allows
selecting rows in a table with a single mouse click. On the other hand,
with Swing you need to hold down the ctrl key and then it's buggy,
seemingly requiring rows to be clicked from top to bottom.
If there's an example of changing the Swing behavior, I haven't found it.
I've made some progress figuring it out but can't spare much more time.
Anyone know of a working solution? I can't be the only one needing it.
I can post what I've tried so far if a ready-made solution isn't available.
John
- 3
- trying to fix oneTouchExpandable button size in JSplitPane's dividerThe BasicSplitPaneDivider class uses some custom-painted buttons for
the oneTouchExpandable buttons on the divider. Trouble is, they're
effectively hard coded to a fixed pixel size (final static int
ONE_TOUCH_SIZE = 6). At 144 dpi, that's really too small to use
comfortably.
I really don't want to subclass all the assorted JSplitPane pieces to
fix this and am hoping there's another way.
I tried scaling the Graphics2D in the paint() of a containing panel
and then of JSplitPane directly, either way the UI gets out of whack -
components don't get placed correctly, the divider drag hotzone
doesn't line up with the divider visually, etc.
Am I approaching the scaling wrong or is this a dead end? Other
alternatives?
- 3
- JTextComponent questionI have a Paste method that will take in a JTextComponent. I am passing
either JTextField's or JTextArea's. I need to do something differently
based on a JTextArea.
I have no problem determining if I have a JTextField or a JTextArea. The
problem I am having is that I need to know which JTextArea component I
have. What is the instance name of the JTextArea.
Example say between these two..
JTextArea jTextAreaA
JTextArea jTextAreaB
I have tried some reflection. What could I be missing?
private void paste(JTextComponent target)
{
final String method = "paste(JTextField "+target.getText()+" ): ";
if (DEBUGMODE )System.out.println(_Debugheader+ method);
appUtil.setStatus(jStatusArea, _readyMsg, _READY);
try {
Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();
Transferable content = cb.getContents(this);
String s = (String)content.getTransferData(DataFlavor.stringFlavor);
target.setText(s.trim());
} catch (Exception e) {
appUtil.setStatus(jStatusArea, _errorMsg, method + " " + e);
}
if (target instanceof JTextArea) {
//
// if jTextAreaA
// do something
}
}
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
- 4
- SQLJ program ....ok, this is a SQL program program that runs fine (on DB2). What does it
mean to have iterator declared outside the class declaration (from a Java
perspective, what are we doing here??)...I was under the impression that
import statements were the only statements that could come before the
class statement. Where is it documented that iterator type #sql statements
are to be declared outside the class definition.
import java.sql.*;
import sqlj.runtime.*;
import sqlj.runtime.ref.*;
#sql iterator Named_Iterator(String lastname);
class sqlj2
{
public static void main(String[] args) throws Exception
{
Named_Iterator namedItr = null;
String data = "jdbc:db2://localhost:50000/SAMPLE";
Class.forName("com.ibm.db2.jcc.DB2Driver");
Connection conn = DriverManager.getConnection(data,"user","passwd");
DefaultContext Ctx = new DefaultContext(conn);
DefaultContext.setDefaultContext(Ctx);
#sql namedItr = {SELECT LASTNAME FROM db2admin.EMPLOYEE WHERE WORKDEPT =
'A00'};
while (namedItr.next())
{
System.out.println("Lastname is: " + namedItr.lastname());
}
namedItr.close();
}
}
TIA
Raquel.
- 6
- Server vs Client validationOn Fri, 30 Jul 2004 11:52:25 +0200, Rogan Dawes <email***@***.com>
wrote or quoted :
>And it is developers that think like you that enable exploits like
>buffer overflows, SQL injection, etc
>
>Sudsy has it 100% right. The server can NEVER trust what the client is
>sending it. ALWAYS revalidate EVERYTHING that you receive.
>
>By all means, make it easy for the client by performing interactive
>validation, prompting, etc.
In email, Rogan brought up the issue of what servers have to do to
revalidate Strings.
I mentioned earlier if the String must have one of a fixed set of
values how you can convert that to a country-index, state-index etc.
Then all you need do in the server is bounds check on the int.
For general strings, in DOS Abundance I categories characters as
numeric, alphabetic, lower case, upper case, accented, printable,
space, control char.
You can declare that a string can only contain certain classes of
character. That gets automatically checked on a keystroke basis, and
automatic conversion sometimes happens to lower case, to upper case,
or to strip accents.
If you had a similar facility in your client level validation, you
have to repeat it in the server. You don't need to deal with
translation, just validation, since any missing translation is clear
fraud.
Sometimes strings are combos of words, e.g. a list of fruit names from
a fixed list of fruit names. These can be converted to int bit masks.
The server does not need to validate these at all, just mask off any
unused bits.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
- 7
- javadoc wierdness - on suns own sourceWhat the heck is going on here? The only error in my projects documentation,
and it's in suns own source!?
C:\j2sdk1.4.2_04\source\javax\swing\table\AbstractTableModel.java:64:
warning -
@param argument "column" is not a parameter name.
C:\j2sdk1.4.2_04\source\javax\swing\table\AbstractTableModel.java:64:
/**
* Returns a default name for the column using spreadsheet conventions:
* A, B, C, ... Z, AA, AB, etc. If <code>column</code> cannot be
found,
* returns an empty string.
*
* @param column the column being queried
* @return a string containing the default name of <code>column</code>
*/
public String getColumnName(int column) {
String result = "";
for (; column >= 0; column = column / 26 - 1) {
result = (char)((char)(column%26)+'A') + result;
}
return result;
}
--
Mike W
- 12
- javaw?Hi,
I can't find any documentation of this, but perhaps I'm not
looking in the right place.
OS: We're running on Windows XP.
I've got some Java code that's being called from a
C++ executable via CreateProcess().
The command line argument works out to be,
javaw.exe -Xmx512m -jar foo.jar
I've looked in the online documentation and searched
on the net, but haven't found any documentation that would
allow to figure out what's going on here.
Can anybody point me in the right direction?
TIA,
Gerry Murphy
- 13
- Threading. Is this an Issue?Sup everyone!
I wrote this code for Tomcat appserver but I am told from an
associate that it has threading issues. The basic idea is to store a
read only data table for everyone to use. It takes some time for the
table to be created. I want to store the table in a singleton and
update it periodicly, basicaly when a user logs into the system. By
keeping 1 table allocated I don't have to worry about memmory usage
and if a user does need the latest updated table he can log off and
then back in to refresh the table(if nobody else has done so already).
If this sounds like a cludge maybe it is, but right now I question my
knowledge of threading. Functionality can change and maybe updating
the table is best in a worker thread that updates periodicaly on a
timed interval.
So here is the suspected threading issue:
I have a singleton, pretty basic class.
private constructor.
GetInstance
GetTable
SetTable
with a self and table class variable.
the table is created in a javabean that is accessed in the servlet.
A user accessing the table will
GetInstane().SetTable(javabean.createTable()) if
firstTimeAccessingTable == true else GetInstane().GetTable()
My associate says that the getters and setters are the problem. He
said that if thread1 does myTableRef = GetInstance().GetTable() and
uses the table while thread2 does
GetInstane().SetTable(javabean.createTable()) that thread1's
myTableRef will change once thread2 does the set.
So my sandBox test is not threaded but I think should be a good enough
example. In my test I tested a "dataType" even though I am not sure
one calls the String class a true dataType and a created class. My
result show that myTableRef will not change once the setTable happens
from another thread. Here is the Code.
public class Singleton {
static Singleton me = null;
private String testDataType = null;
private TestClass testClass = null;
private Singleton(){
}
public static Singleton getInstance(){
if(me==null){
me = new Singleton();
}
return me;
}
public String getDataType(){
return testDataType;
}
public void setDataType(String dataType){
this.testDataType = dataType;
}
public TestClass getTestClass(){
return testClass;
}
public void setTestClass(TestClass testClass){
this.testClass = testClass;
}
}
public class TestClass{
public int value = 0;
public TestClass(int value){
this.value = value;
}
public TestClass(){}
}
public class SandBox {
public static void main(String[] args) {
Singleton x = Singleton.getInstance();
String origDataType = "freaky1";
TestClass origTestClass = new TestClass (5);
x.setDataType(origDataType);
x.setTestClass(origTestClass);
String retrieved1DataType = x.getDataType();
TestClass retrieved1TestClass = x.getTestClass();
String newDataType = "freaky2";
TestClass newTestClass = new TestClass (10);
x.setDataType(newDataType);
x.setTestClass(newTestClass);
String retrieved2DataType = x.getDataType();
TestClass retrieved2TestClass = x.getTestClass();
System.out.println("woot!");
}
}
In Debug mode at the "woot" println I find that the object ID's for
retrieved1DataType and retrieved2DataType are different as well as the
TestClass counterpart.
This tells me my associate is wrong. But what do you think? Should I
test a multithreaded senerio? Do you think the setters and getters
are thread safe? Will a getters's reference be safe from another
threads setter?
Thanks a bunch!
Erik
- 14
- Javascript : formname.body.value.length == 0 validationHi,
We have a J2EE application which had jsp's that represent a form. When
we submit the jsp's the form is converted into a mail and is sent using
a mail server.
In the jsp there is a validation where we check for the length of the
body using the following:
if (formname.body.value.length == 0)
{
isFormComplete = false;
}
Need to know which are the possible cases when the length of the form
could be '0'.
The behaviour is real weird. Roughly 2 out of 10 times the length comes
as 0 even when the user enters all the details. What could be the
reason for the same ?
Any pointers are highly appreciated.
Regards,
Parag
- 15
- HELP Unkown Error!!"Alex" wrote:
> I wrote a java gui program under win, and there is no problem ,
> all is OK, when i run it on linux on the console appear a message
> every few seconds:
>
> 25-ago-2003 17.15.04 java.util.prefs.FileSystemPreferences
> syncWorld AVVERTENZA: Couldn't flush system prefs:
> java.util.prefs.BackingStoreException: Couldn't get file lock
Sun fucked up the new preference API implementation. It tries to get
access to a file under /etc. Check the VM installation instruction and
create the file.
- 15
- Sun Network Berlin, Germany December 3-4,2003SunNetwork Berlin will feature technical sessions, case
studies, and birds-of-a-feather sessions offering in-depth
technical information on development platforms, tools, and
techniques. Session tracks include: Platforms and Tools;
Accelerating Service Deployment with Java Technology;
Driving Better Resource Utilization; Mobility, Security,
Scalability and Performance; and Innovations in Public Key
Cryptography, Auto-ID, and Throughput and Grid Computing. A
Hands-on Lab will enable test-driving Sun's latest
solutions. Keynoters include: Scott McNealy, Mark
Tolliver, Jonathan Swartz, and Greg Papadopoulos
http://sunnetwork.sun.com?ssobm=yg
- 16
- Wall Street Journal article on PHP and JavaHere is the beginning of a story in the 29 Sep 2005 Wall Street
Journal. The WSJ web site requires a paid subscription to access
articles.
PHP Language Wins Supporters
As Tool for Making Web Software
Alternative to Sun's Java
Is Adopted by Companies,
Developers Like Andreessen
By DAVID BANK
Staff Reporter of THE WALL STREET JOURNAL
September 29, 2005; Page B4
'Back when the Web was young, Marc Andreessen, then the wunderkind
co-founder of Netscape Communications Inc., gave his backing to a new
software programming language from Sun Microsystems Inc. That blessing
launched the Java language as a counterweight to Microsoft Corp.'s
technology dominance.
A decade later, Mr. Andreessen is endorsing another programming
language called PHP as an alternative to Java for creating a new
generation of Internet software.
PHP, like Java, has the support of some of technology's heaviest
hitters, including International Business Machines Corp., Oracle Corp.,
Intel Corp. and SAP AG. In an indication that "Internet time" still
moves quickly, Mr. Andreessen and other developers say Java is being
superseded by the simpler, faster PHP for building Web applications and
services.
"When it comes to the Web and Web applications, Java is not the right
language," Mr. Andreessen says.
Java remains useful for building major pieces of software
infrastructure, such as financial management or airline-reservation
systems, Mr. Andreessen says. But he adds: "PHP is the language to
build Web applications and Web sites that people use on a daily basis.
PHP is to 2005 what Java was to 1995."'
|
| Author |
Message |
RSB

|
Posted: 2004-9-30 1:13:00 |
Top |
java-programmer, CRC check logic/program
Hi Everyone,
I want to write the CRC check routine. And looking for help.. ;o((
Any link or leads will help me..
Thanks.
RSB
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2004-9-30 2:16:00 |
Top |
java-programmer >> CRC check logic/program
On Wed, 29 Sep 2004 17:13:26 GMT, RSB wrote:
> I want to write the CRC check routine.
Start here.
a) <http://www.google.com/search?q=%22CRC+check%22+algorithm>
>...And looking for help.. ;o((
Or maybe, ..start here.
b) <http://www.physci.org/codes/javafaq.jsp#cljh>
> Any link or leads will help me..
c) <http://www.physci.org/codes/sscce.jsp>
Search a), then write a c) before you post to b).
--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
|
| |
|
| |
 |
Michael Borgwardt

|
Posted: 2004-9-30 19:54:00 |
Top |
java-programmer >> CRC check logic/program
RSB wrote:
> I want to write the CRC check routine. And looking for help.. ;o((
http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/CRC32.html
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- converting between double and integerI have a variable declared as a double as :-
sValue = Math.floor(Math.sqrt(polynomialDegree));
where 'polynomialDegree' is an integer.
How do I convert 'sValue' to an integer?? I cant declare sValue as an
integer straight off because its returning an error message saying 'possible
loss of precision', and have tried to convert it to an integer using
intValue() but keep getting an error saying 'double cannot be dereferenced'
Where am i going wrong?
Thanks
- 2
- [Sizing: Tomcat 4.1.x] Memory Usage for the Session TrackingHello all,
i'd like to know how much memory the application server
have been used for tracking a new session.
i've tried the jProfiler from the ej-Tech however i found
seems it don't have an easy way to calculate the total
amount of memory the related object instacnes used for the
session tracking. i guess org.apache.catalin.session* is
the point to start with, however, to me, it's a little too
hard.
do anyone of you have did this similar thing?
say, to calculate the total amount of memory used, when a
browser visit a particular page, and the server create new
sesssion related objects and return the browser a new cookie
with 2 attributes initialized? e.g., name="matthew", sex="M"?
thanks a lot in advance.
---
matthew
- 3
- Creating tiled image from multiple tiff sources in JAIHi all,
My situation is as follows. I have a number of tiff files containing
adjacent tiles which I would like to combine into one image. Currently I
achieve this goal in the following manner using the Java Advanced Imaging
library:
1) Create a target TiledImage with attributes appropriate to hold all tiles.
2) Load each tiff file into a separate PlanarImage.
3) Get the Rasters of each of these PlanarImages and translate coordinates
according to the rectangle they must occupy in the target TiledImage
4) Invoke TiledImage.setData(Raster) with the translated raster for each
tile
This works ok, but it does not seem to take advantage of the JAI's
pull-model; image data is loaded into memory immediately, probably as a
consequence of the call to getRaster(). However I wish to defer the loading
of image data into memory until it is needed, because only a subset of all
tiles are two be displayed at any one time.
I hence believe I need something along the lines of the NullOpImage class.
Unfortunately, the constructor for this class only takes a single source,
while I need to be able to pass a source for each tiff tile. One solution is
to subclass NullOpImage (or its superclass, PointOpImage) and take care of
things myself. Is this the way to go about it, or is there a better and
easier solution?
Any suggestions will be greatly appreciated.
Regards,
Michael.
- 4
- c prog socket connect to java programmy c program wants to send a message to java program through socket.
The problem i have is the message received by java socket server
is not a complete message most of time. Please see my attachment of
c prog and java program.
Thank you very much for your kind help.
Mei
Here is my c client program:
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
void error(char *msg)
{
perror(msg);
exit(0);
}
int main(int argc,char **argv) {
FILE *fileIn; /* declare a FILE pointer */
FILE *fileOut; /* declare a FILE pointer */
char buffer[8000];
char line[4000];
char c;
int create_socket;
int bufsize = 1024;
int len=0;
int cnt=0;
char *cmd = "XML2Marc,/export/home/mml/Marc4jProg/Marc4jTest/testcase/exporttsamnonowner5.xsl,MARC8,";
int sockfd, portno, n;
struct sockaddr_in serv_addr;
struct hostent *server;
fileOut = fopen("data/out.xml", "w");
if(fileIn==NULL) {
printf("Error: can't open file.\n");
return 1;
}
else {
strcat(buffer,cmd);
if ( (fileIn = fopen("data/test.xml", "r")) != NULL) {
fgets(line, sizeof(line), fileIn);
}
fclose(fileIn);
strcat(buffer,line);
strcat(buffer,"\r\n");
len= strlen(line);
printf("debug::buffer:: %d \n %s", len, buffer);
fprintf(fileOut,"%s", buffer);
portno = 5088;
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if (sockfd < 0)
error("ERROR opening socket");
server = gethostbyname("hopper2.rlg.org");
if (server == NULL) {
fprintf(stderr,"ERROR, no such host\n");
exit(0);
}
bzero((char *) &serv_addr, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
bcopy((char *)server->h_addr,
(char *)&serv_addr.sin_addr.s_addr,
server->h_length);
serv_addr.sin_port = htons(portno);
if (connect(sockfd,&serv_addr,sizeof(serv_addr)) < 0)
error("ERROR connecting");
n = write(sockfd,buffer,strlen(buffer));
sleep(20);
if (n < 0)
error("ERROR writing to socket");
bzero(buffer,4000);
printf(" test ");
n = read(sockfd,buffer,4000);
if (n < 0)
error("ERROR reading from socket");
printf("output::: %s\n",buffer);
printf("%d",n);
if(strlen(buffer)<2){ //try another time
n = read(sockfd,buffer,4000);
if (n < 0)
error("ERROR reading from socket");
printf("output::: %s\n",buffer);
}
printf("File opened. Now closing it...\n");
fclose(fileIn);
fclose(fileOut);
return 0;
}
}
and here is the partial java program:
public class Marc4jWorker extends Thread{
....
public void run(){
char[] ln=new char[8000];
OutputStream outbound=null;
InputStream inbound =null;
while(true){
String line="";
int cc=0;
String action= null;
String style=null;
String encode="UTF8";
String xmlstr=null;
//String line;
try{
inbound = client.getInputStream();
int btecnt = inbound.available();
byte[] bf=null;
if(btecnt<=0)
continue;
else {
bf = new byte[btecnt];
inbound.read(bf);
}
//why the message is incomplete ????
System.out.println("server: input bytes length:"+bf.length);
line =new String(bf);
if(Config.ENDREQ.equalsIgnoreCase(line)){
outbound.close();
client.close();
System.err.println("request end");
break;
}
//line = bf.toString(Config.ENC_UTF8);
int ps_firstcomma =line.indexOf(',',0);
int ps_secondcomma = 0;
int sz=line.length();
if(ps_firstcomma>0 && ps_firstcomma<sz-1)
action=line.substring(0,ps_firstcomma).trim();
ps_secondcomma=line.indexOf(',',ps_firstcomma+1);
if(ps_firstcomma<ps_secondcomma && ps_secondcomma>0 &&
ps_secondcomma<sz-1)
style=line.substring(ps_firstcomma+1,ps_secondcomma).trim();
ps_firstcomma=ps_secondcomma+1;
ps_secondcomma=line.indexOf(',',ps_firstcomma+1);
if(ps_secondcomma>0 && ps_secondcomma<sz-1){
encode=line.substring(ps_firstcomma,ps_secondcomma).trim();
Log.println("server encode:"+encode);
//for action is xml2marc, input xml encoding is always UTF8
if(action.equalsIgnoreCase("xml2marc")){
xmlstr= new
String(bf,Config.ENC_UTF8).substring(ps_secondcomma+1);
}else if("marc2xml".equalsIgnoreCase(action)){
if(Config.ENC_UTF8.equalsIgnoreCase(encode))
xmlstr= new
String(bf,Config.ENC_UTF8).substring(ps_secondcomma+1);
else
xmlstr= new
String(bf,Config.ENC_ISO).substring(ps_secondcomma+1);
}else{
System.out.println("Unsupported Action!");
continue;
}
}
FileOutputStream fout =null;
String rs = null;
if(action.equalsIgnoreCase("xml2marc")){
if(Config.ENC_UTF8.equalsIgnoreCase(encode)){
fout = new FileOutputStream("/tmp/servertest.input",true);
fout.write(xmlstr.getBytes(Config.ENC_UTF8));
fout.close();
}
else {
fout = new FileOutputStream("/tmp/servertest.input",true);
fout.write(xmlstr.getBytes(Config.ENC_ISO));
fout.close();
}
rs = Xml2Marc.toMarc(style,encode,xmlstr);
}else if(action.equalsIgnoreCase("marc2xml")){
if(Config.ENC_UTF8.equalsIgnoreCase(encode)){
fout = new FileOutputStream("/tmp/servertest.input",true);
fout.write(xmlstr.getBytes(Config.ENC_UTF8));
fout.close();
}
else {
fout = new FileOutputStream("/tmp/servertest.input",true);
fout.write(xmlstr.getBytes(Config.ENC_ISO));
fout.close();
}
rs = Marc2Xml.toXML(style,encode,xmlstr);
}
fout = new FileOutputStream("/tmp/servertest.output");
outbound =client.getOutputStream();
if(rs==null || rs.length()==0)
rs="00005";
if("Xml2Marc".equalsIgnoreCase(action)){
if(encode.equalsIgnoreCase(Config.ENC_UTF8)){
outbound.write(rs.getBytes(Config.ENC_UTF8));
fout.write(rs.getBytes(Config.ENC_UTF8));
}else{
fout.write(rs.getBytes(Config.ENC_ISO));
outbound.write(rs.getBytes(Config.ENC_ISO));
}
}else if("Marc2Xml".equalsIgnoreCase(action)){
outbound.write(rs.getBytes(Config.ENC_UTF8));
fout.write(rs.getBytes(Config.ENC_UTF8));
}
outbound.flush();
fout.close();
} catch (IOException e) {
Log.println("Read failed"+e.toString());
System.exit(-1);
}catch(Exception e){
Log.println("server error:"+e.toString());
}
}
}
- 5
- renameTo for Directories on SolarisI've been attempting to rename a directory on Solaris 8 and continue to
have problems.
I read other threads that mention it is not possible to do when moving
between partitions on Solaris, but I am renaming to the same
paritition.
I am basically attempting the following:
File oldName = new File("/opt/OldDirectoryName");
File newName = new File("/opt/NewDirectoryName");
if ( oldName.renameTo( newName ) )
// Successfully renamed
else
// Failed to rename
For some reason I seem to continually be unable to do this.
Any ideas?
Eric
- 6
- cloudscapeI'm a newbie in cloudscape (Java too) and I'm having a problem. I've
followed the tutorial that comes with cloudscape to the letter. Everything
worked as advertised up untill this program:
/*
* Licensed Materials - Property of IBM
*
* (C) Copyright IBM Corp. 2000, 2001
* All Rights Reserved.
*/
import java.sql.*;
public class CreateWorldDB {
public static void main (String[] args) {
try {
Class.forName("com.ibm.db2j.jdbc.DB2jDriver").newInstance();
System.out.println("Loaded the Cloudscape JDBC
driver. Hello, World!");
Connection conn =
DriverManager.getConnection("jdbc:db2j:HelloWorldDB;create=true")
;
System.out.println("Created and connected to
database HelloWorldDB");
} catch (Throwable e) {
System.out.println("exception thrown");
e.printStackTrace();
}
}
}
I run it with "java -Dbd2j.system.home=C:\tutorial_system CreateWorldDB"
And results in:
Loaded the Cloudscape JDBC driver. Hello, World!
exception thrown
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at CreateWorldDB.main(CreateWorldDB.java:18)
What's going on? It can connect with that driver but it can't create/access?
I'm highly confused...
I'm running J2SE/HotSpot VM 1.4.2_03 and cloudscape5.1
Thanks,
Rob
- 7
- Socket functionality on jre 1.6.0 beta b59g
OK, it seems that on Windows XP Pro, that Socket has changed significantly,
breaking lots of my code.
Using "localhost" no longer appears to work to create a Socket object
on a port. Have to use "127.0.0.1" instead. Other aspects of Socket
also appear to be flaky/changed... I can certainly "ping localhost" so
it's not that localhost has a problem.
Can someone please explain the plain Socket changes for this new 1.6 ??
java version "1.6.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-beta-b59g)
Java HotSpot(TM) Client VM (build 1.6.0-beta-b59g, mixed mode, sharing)
- 8
- Struts, Spring, ... what about Swing?So many Web frameworkings seem to have sprung up but are there any
really good frameworks for fat clients using things like Swing?
I am most interested in how the server side objects interact with Swing
components, the design patterns behing client/middleware/server/db apps
etc.
thanks
Tim
- 9
- Eclipse won't startHi
I have just installed eclipse-2.1.1_2 on my FreeBSD 4.8 computer.
When I try to run it I get:
java.lang.UnsatisfiedLinkError:
/usr/local/eclipse/plugins/org.eclipse.swt.gtk_2.1.1/os/freebsd/x86/lib
swt-pi-gtk-2135.so: /usr/local/lib/libgthread-2.0.so.200: Undefined
symbol "pthread_attr_destroy"
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1382)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1290)
at java.lang.Runtime.loadLibrary0(Runtime.java:749)
at java.lang.System.loadLibrary(System.java:820)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:108)
at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:18)
at org.eclipse.swt.widgets.Display.create(Display.java:469)
at org.eclipse.swt.graphics.Device.<init>(Device.java:111)
at org.eclipse.swt.widgets.Display.<init>(Display.java:303)
at org.eclipse.swt.widgets.Display.<init>(Display.java:299)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1361)
at
org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoade
r.java:858)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:468)
at java.lang.reflect.Method.invoke(Native Method)
at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
at org.eclipse.core.launcher.Main.run(Main.java:747)
at org.eclipse.core.launcher.Main.main(Main.java:583)
(eclipse:9359): Gtk-WARNING **: Unable to locate theme engine in
module_path: "redmond95",
Btw I have heard Eclipse has a C++ plugin, would it be possible to get
that into the port collection?
br
socketd
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 10
- J2EE programming on very old computerHi
I've old computer (Celeron 300 HHz, 64 RAM, WIN98)
Cold You say me, which app I need to start learn Java (J2EE) on this computer.
Best regards
Krzysztof
- 11
- client server communication in java I have a java web service that returns byte arrays to the client.
First a byte array is returned and the server gets the acknowledgement,
then the next byte array is sent and so on. But I don't have much idea
how to implement it. How can I resume from where I stopped at the
server side? Can anyone give me some idea so that I can proceed?
- 12
- javaw.exe - Xrs -jar my.jarAs I understand when Java program started this way it should ignore user
logoff
and continue working but it doesent for me :(
I run my application from cmd on WinXP like this :
javaw.exe - Xrs -jar my.jar
When I logoff from system application exits , what I'am doing wrong ?
regards,
Os
- 13
- Regex syntaxI have managed to form the regex for the following two:
CTL = <any US-ASCII control character (octets 0 - 31) and DEL (127)>
String CTL_REGEX = "([[\\x00-\\x1F]\\x7F])";
LWS = [CRLF] 1*( SP | HT )
String LWS_REGEX = "((\r\n)??( |\\x09)+?)";
However, the following stumped me for hours.
TEXT = <any OCTET except CTLs, but including LWS>
String TEXT_REGEX = ...... // help me out please.
- 14
- HELP needed: Small Java applet I need a graphic Java applet that makes the following steps:
Given a circumference of radius "r",
Draw onscreen, say, 20 random radius.
Then, every time you press a button:
Rotate the 20 radius a given random angle (same for everyone).
Draw the new radius onscreen.
Note: The radius endpoints should be stored in float arrays and drawn as
float. (Of course one of the endpoints of every radius would be the center
of the circumference.)
I'm not very good at Java at the moment but I'd like to transform an old
program from QBasic into a java applet and I think that this little
framework is all I need. What I am getting at the moment is a lot of
compilation errors I don't understand.
The program I want to transform is here:
http://www.josechu.com/moving_fractal/index.htm
Thanks,
Josechu
- 15
- Nike Merge Transit Anthracite/Purple Steel Ladies Watch WC0033-201 ReplicaNike Merge Transit Anthracite/Purple Steel Ladies Watch WC0033-201
Replica, Fake, Cheap, AAA Replica watch
Nike Merge Transit Anthracite/Purple Steel Ladies Watch WC0033-201
Link : http://www.aaa-replica-watch.com/Nike_Merge_Ladies_Watch_WC0033_201.html
Buy the cheapest Nike Merge Transit Anthracite/Purple Steel Ladies
Watch WC0033-201 in toppest Replica . www.aaa-replica-watch.com helps
you to save money! Nike-Merge-Ladies-Watch-WC0033-201 , Nike Merge
Transit Anthracite/Purple Steel Ladies Watch WC0033-201 , Replia ,
Cheap , Fake , imitation , Nike Watches
Nike Merge Transit Anthracite/Purple Steel Ladies Watch WC0033-201
Information :
Brand : Nike Watches (http://www.aaa-replica-watch.com/
Replica_Nike.html )
Gender :
Model : Nike-Merge-Ladies-Watch-WC0033-201
Case Material :
Case Diameter :
Dial Color :
Bezel :
Movement :
Clasp :
Water Resistant :
Crystal :
Our Price : $ .00
Availability: In StockNike Merge Transit Anthracite/Purple Steel
Ladies Watch WC0033-201Anthracite and purple steel design watch. Made
with polyurethane for flexibility and comfort and laser-etched with
patterns for a crafted touch. Chronograph. Laser-etched graphics on
strap. Leather strap top layer, polyurethane bottom layer. Mineral
glass crystal. One-piece hinged buckle. One-touch backlighting.
Stainless-steel buckle and back plate. Time, date, alarm, 2 time
zones. Two-segment interval timer. Water resistant at 50 meters (165
feet). Nike Merge Transit Anthracite/Purple Steel Ladies Watch
WC0033-201Nike Merge Transit Anthracite/Purple Steel Ladies Watch
WC0033-201 is brand new, join thousands of satisfied customers and buy
your Nike Merge Transit Anthracite/Purple Steel Ladies Watch
WC0033-201 with total satisfaction . A Haob2b.com 30 Day Money Back
Guarantee is included with every Nike Merge Transit Anthracite/Purple
Steel Ladies Watch WC0033-201 for secure, risk-free online shopping.
Haob2b.com does not charge sales tax for the Nike Merge Transit
Anthracite/Purple Steel Ladies Watch WC0033-201, unless shipped within
New York State. Haob2b.com is rated 5 stars on the Yahoo! network.
Nike Merge Transit Anthracite/Purple Steel Ladies Watch WC0033-201
Replica, With the mix of finest craftsmanship and contemporary
styling, not only does it reflect the time but also care you put into
looking good. choose one to promote your quality and make yourself
impressive among people
Thank you for choosing www.aaa-replica-watch.com as your reliable
dealer of quality waches including Nike Merge Transit Anthracite/
Purple Steel Ladies Watch WC0033-201 . we guarantee every watch you
receive will be exact watch you ordered. Each watch sold enjoy one
year Warranty for free repair. Every order from aaa-replica-watches is
shipped via EMS, the customer is responsible for the shipping fee on
the first order, but since the second watch you buy from our site, the
shipping cost is free. Please note that If the total amount of payment
is over $600(USD), the customer is required to contact our customer
service before sending the money in case failed payment. If you have
any other questions please check our other pages or feel free to email
us by email***@***.com.
The Same Nike Watches Series :
Nike Merge Transit Black/Iron Ladies Watch WC0033-002 :
http://www.aaa-replica-watch.com/Nike_Merge_Ladies_Watch_WC0033_002.html
Nike Mettle Blade Black/Silver Watch WC0037-001 :
http://www.aaa-replica-watch.com/Nike_WC0037_001.html
Nike Mettle Blade Black/Light Chocolate Unisex Watch WC0037-077 :
http://www.aaa-replica-watch.com/Nike_WC0037_077.html
Nike Mettle Chisel Black/Sport Red Unisex Watch WC0045-012 :
http://www.aaa-replica-watch.com/Nike_Chisel_Unisex_Watch_WC0045_012.html
Nike Mettle Press Men's Watch WC0038-002 :
http://www.aaa-replica-watch.com/nike_mettle_press_mens_watch_WC0038_002.html
Nike Mettle Chisel Black Unisex Watch WC0045-001 :
http://www.aaa-replica-watch.com/Nike_Chisel_Unisex_Watch_WC0045_001.html
Nike Mettle Blade Black/Blue Frost Watch WC0037-047 :
http://www.aaa-replica-watch.com/Nike_WC0037_047.html
Nike Mettle Blade Black Unisex Watch WC0037-002 :
http://www.aaa-replica-watch.com/Nike_WC0037_002.html
Nike Mettle Blade Black/Grass Watch WC0037-033 :
http://www.aaa-replica-watch.com/Nike_WC0037_033.html
Nike Mettle Hammer Deep Nomax Green and Black Digital Unisex Watch
WC0021-340 :
http://www.aaa-replica-watch.com/Nike_WC0021_340.html
Nike Mettle Hammer Black and Atomic Red Digital Unisex Watch
WC0021-064 :
http://www.aaa-replica-watch.com/Nike_WC0021_064.html
Nike Mettle Hammer Watch WC0021-001 :
http://www.aaa-replica-watch.com/Nike_WC0021_001.html
|
|
|