 |
 |
Index ‹ java-programmer
|
- Previous
- 1
- Eclipse jboss toolsHi,
has been any efforts to ports jboss tools plugin for Eclipse?
It contains some parts written in C (i think having to do with GUI editors).
Using eclipse-devel 3.3.2 and jboss tools 2.1.1 (previously known as JBossIDE and
now commercially named as "Jboss developer studio).
Installing the jboss tools plugins from within eclipse, asis, results in a highly unstable eclipse
environment.
Any ideas?
--
Achilleas Mantzios
- 1
- A Pixel Matching Problemthis problem is like a miniature OCR problem.
Let's say you have some images that contain text, or screen snapshots
obtained by the Robot class. How can you extract the text from them?
You have the advantage that you probably have access to the fonts used
to create the text.
How might you go about creating an OCR for images? I was thinking of
writing this up as a student project.
The advantage you have over true OCR is all matches will be exact.
The complications are a variety of colours for foreground/background,
antialiasing and painting over muticoloured backgrounds. For JPGs you
may not have the fonts used. The edges of the text may be tweaked in
various ways, e.g. 3D, blurred, warped.
I thought you might proceed like this:
1. find rectangular regions containing only two colours.
2. draw an e in 10 font sizes for each font as your search templates.
3. look for a hole the right shape. When you find one, check all the
e's you have with that size/shape hole to see if you have a match on
the entire letter, check the whole rectangle.
4. if you have a match, calculate the baseline and starting point. now
draw a template ea in that same font and compare. If it fails try eb
etc. Work your way both left and right pulling that line.
You might construct a hashMap indexed by a digest of the glyph so you
can more rapidly check for matches. Your digest algorithm might trim
the glyph top/bottom/left/right so you don't need the stringWidth
information by actually drawing the character pair.
5. You carve the rectangle out of the bigger one, and break the
remaining into rectangles.
6. repeat until there are no more rectangles.
7. export the text each labelled with x.y where it was found.
8. In another program allow the user to highlight text, e.g. a column
or box to determine the linear order of the text desired.
Potential uses for such software include:
1. capturing filenames, error messages, crash locations that were
displayed in a non-cut/pasteable way.
2. by people trying to defeat my email munger. See
http://mindprod.com/applets/masker.html
3. by blind people extracting textual information from images.
4. To allow you to copy from any Swing Component.
5. to extract information from a screen snapshot without having to
retype it.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
- 3
- record numbersMaybe my question is stupid and wrong but I hope that you will understand.
So, image that you need to create web application which will used by many
peoples in one LAN. They processing some documents and every person has the
particular number of documents in particular order (1. person has documents
from 1 to 100, second from 101 to 200 etc), which process with the
particular number (first document -> number 1 in a database). If they all
work in a same time, what is the easiest and the most safety way to manage
that? Adding number manually is the logical solution but if 2 person put the
same number, can they freeze the database or databases are imune on that ?
- 3
- Java Printing API and Tobit FaxWareThis example for the Java Printing API
http://java.sun.com/products/java-media/2D/forDevelopers/sdk12print.html#printable
creates different output in Suns JRE 1.4 and 1.5 (tested with Windows
2000). This can be easily checked using the 'print to file' option.
The different behaviour of the new 1.5 JRE is causing problems with the
Tobit FaxWare printer driver.
Tobit FaxWare detects special command strings in the document, which
start with @@, followed by a command name and optionally a space
character ($20, #32) and a character, finally @@ again. For example, the
receiver fax number is encoded as @@NUMMER +4996421@@. If a document is
printed on the FaxWare printer driver using JRE 1.4, the document will
be sent as a Fax to this number.
In JRE 1.5 however, the printer output contains the character $a0 (#160)
instead of space, this is causing an error message in Tobit FaxWare.
I would like to find the reason for this change but could not find
information in the JRE 1.5 releasenotes
(http://java.sun.com/j2se/1.5.0/compatibility.html#incompatibilities),
is there another place where i could find informations about the
background of this change?
Many thanks in advance,
Michael
- 6
- get the number of children of a given elementI want to get the number of children of a given element. Below is my
code attempt and
the xml sample file. The caller is getElementChildNumber("persons");,
I expect
to get 2. Since there are 2 children that are under persons element.
Any ideas??
/**
get the number of children of a given element
*/
public int getElementChildNumber(String elementName)
{
DocumentBuilderFactory dbf = null;
DocumentBuilder db = null;
Document doc = null;
try
{
dbf = DocumentBuilderFactory.newInstance();
db = dbf.newDocumentBuilder();
doc = db.parse(fileName);
NodeList nodelist = doc.getElementsByTagName(elementName);
return nodelist.getLength();
}
catch (Exception e)
{ e.printStackTrace();
}
return -1;
}
<?xml version="1.0" encoding="UTF-8"?>
<response>
<persons>
<person>
<name>Joe</name>
<age>10</age>
</person>
<person>
<name>Mark</name>
<age>30</age>
</person>
</persons>
</response>
- 6
- Swing Threading issue?Hi,
My UI hangs whenever I m trying do something without threading. I'm
quite amatuer with threads and need help please.
How can i make my UI thread safe?
THANKS!
/**
*
* @author Ho Wai Kit
*/
import java.net.*;
import java.io.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.border.*;
public class Stratego extends JFrame implements ActionListener{
private static final int ROWS = 5;
private static final int COLUMNS = 5;
private final Card[][] cards = new Card[ROWS][COLUMNS];
private JPanel centerPnl, boardPnl, rightPnl;
private Client clientGame=null;
private Server serverGame=null;
private AIGame aiGame=null;
private Socket con;
boolean isStarted, isConnected, isClient, isServer;
private Card inHand, target;
private String otherHostname = "";
private JLabel statusLbl;
private JMenuItem menuItemNewGame;
private JMenuItem menuItemLoadFile;
private JMenuItem menuItemSave;
private JMenuItem menuItemSaveAs;
private JMenuItem menuItemConnect;
private JMenuItem menuItemCloseConnection;
private ConnectionManager conMan;
private GameLogic gl;
private Protocol protocol;
DataOutputStream output;
DataInputStream input;
private char[] pieces = {Card.FLAG, Card.BOMB, Card.BOMB,
Card.MARSHAL, Card.MINER, Card.CAPTAIN, Card.GENERAL, Card.CAPTAIN,
Card.GENERAL, Card.SPY};
/** Creates a new instance of Stratego */
public Stratego(){
super("Stratego");
initCenterPnl();
conMan = new ConnectionManager();
//menu bar
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
JMenu gameMenu = new JMenu("File");
JMenu settingsMenu = new JMenu("Network");
menuBar.add(gameMenu);
menuBar.add(settingsMenu);
menuItemNewGame = new JMenuItem("New game");
menuItemNewGame.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
playAIGame();
}
});
gameMenu.add(menuItemNewGame);
menuItemLoadFile = new JMenuItem("Load file...");
menuItemLoadFile.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
//if (isFileChanged())
// askForSaving();
JFileChooser fileChooser = new JFileChooser();
//fileChooser.setCurrentDirectory(new
java.io.File(fileChooserDir));
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
fileChooser.resetChoosableFileFilters();
//fileChooser.addChoosableFileFilter(new
PGNFileFilter());
int choice = fileChooser.showOpenDialog(null);
if (choice == JFileChooser.APPROVE_OPTION) {
//loadFile(fileChooser.getSelectedFile());
//fileName =
fileChooser.getSelectedFile().getName();
//setTitle(TITLE + " - " + fileName);
//fileIsChanged = false;
}
}
});
gameMenu.add(menuItemLoadFile);
menuItemSave = new JMenuItem("Save");
menuItemSave.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
//if (fileName != null && fileName.length() > 0) {
// save(fileName, false);
//} else {
// saveAs();
// }
}
});
gameMenu.add(menuItemSave);
menuItemSaveAs = new JMenuItem("Save as...");
menuItemSaveAs.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
// saveAs();
}
});
gameMenu.add(menuItemSaveAs);
gameMenu.addSeparator();
JMenuItem item2 = new JMenuItem("Exit");
item2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
if (clientGame!=null||serverGame!=null) {
int choice =
JOptionPane.showConfirmDialog(null, "Are you
sure?", "Close connection?", JOptionPane.YES_NO_OPTION);
if (choice == JOptionPane.YES_OPTION) {
closeConnections();
} else
return;
}
System.exit(0);
}
});
gameMenu.add(item2);
JMenuItem serverSettingsItem = new JMenuItem("Host Game");
serverSettingsItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
playGameAsHost();
}
});
settingsMenu.add(serverSettingsItem);
menuItemConnect = new JMenuItem("Join Game");
menuItemConnect.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
String input = JOptionPane.showInputDialog(null,
"Connect to IP : ");
if(input.trim().equals("")||input==null){
JOptionPane.showMessageDialog(null, "No IP
specified", "Error", JOptionPane.ERROR_MESSAGE);
}else{
playGameAsClient(input);
}
}
});
settingsMenu.add(menuItemConnect);
menuItemCloseConnection = new JMenuItem("Close connection");
menuItemCloseConnection.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
int choice =
JOptionPane.showConfirmDialog(
null,
"Are you sure?",
"Close connection?",
JOptionPane.YES_NO_OPTION);
if (choice == JOptionPane.YES_OPTION) {
//boardConnector.closeConnection();
//connectionClosed();
}
}
});
settingsMenu.add(menuItemCloseConnection);
menuItemCloseConnection.setEnabled(false);
//end of menu
Container c = getContentPane();
c.setLayout(new BoxLayout(c, BoxLayout.Y_AXIS));
c.add(centerPnl, BorderLayout.CENTER);
}
public void initCenterPnl(){
centerPnl = new JPanel();
centerPnl.setLayout(new BoxLayout(centerPnl,
BoxLayout.X_AXIS));
boardPnl = new JPanel();
fillBoard();
boardPnl.setSize(450, 450);
boardPnl.setMinimumSize(new Dimension(450, 450));
boardPnl.setMaximumSize(new Dimension(450, 450));
initRightPnl();
centerPnl.add(boardPnl);
centerPnl.add(rightPnl);
}
public void initRightPnl(){
rightPnl = new JPanel();
statusLbl = new JLabel();
rightPnl.setBorder(BorderFactory.createTitledBorder("Game
Status"));
//rightPnl.setSize(100, 450);
rightPnl.add(statusLbl);
rightPnl.setMinimumSize(new Dimension(250, 450));
rightPnl.setMaximumSize(new Dimension(250, 450));
}
public void fillBoard(){
boardPnl.setLayout(new GridLayout(ROWS, COLUMNS, 1, 1));
boardPnl.setBorder(BorderFactory.createTitledBorder("Board"));
for(int i = 0; i < ROWS; i++)
{
for(int j = 0; j < COLUMNS; j++)
{
cards[i][j] = new Card(Card.GRASS, i, j);
cards[i][j].addActionListener(this);
cards[i][j].setXCoordinate(i);
cards[i][j].setYCoordinate(j);
boardPnl.add(cards[i][j]);
}
}
//initialise water
cards[2][2].setCardType(Card.WATER);
cards[2][2].drawImage(Card.WATER);
}
public void closeConnections(){
if(isServer&&isConnected){
conMan.allDone = true;
isServer = false;
}else if(isClient&&isConnected){
isServer = false;
}
try{
con.close();
}catch(Exception e){
e.printStackTrace();
}
isConnected = false;
}
public void playAIGame(){
newGameBoard();
aiGame = new AIGame(cards, this);
System.out.println("AI game started");
isStarted = true;
placeCards(cards, Card.RED_PLAYER);
}
public void playGameAsHost(){
try {
JDialog notify = new JDialog();
conMan.start();
JLabel notifyLbl = new JLabel("Listening for connection...
...\n", 0);
notify.setTitle("Server IP : "
+InetAddress.getLocalHost().getHostAddress());
notify.getContentPane().setLayout(new FlowLayout());
notify.getContentPane().add(notifyLbl);
notify.setLocation (400, 300);
notify.setSize (250, 90);
notify.setVisible(true);
//ServerSocket server = new
ServerSocket(ConnectionManager.PORT_NO,
ConnectionManager.MAX_CONNECTIONS);
while(true){
con = conMan.getConnection();
//con = server.accept();
if(con!=null){
notify.dispose();
break;
}
}
isServer = true;
isConnected = true;
//serverGame = new Server(this, con);
System.out.println("Hosting Game");
isStarted = true;
placeCards(cards, Card.RED_PLAYER);
//repaint();
protocol = new Protocol(con, this);
input = new DataInputStream(con.getInputStream());
output = new DataOutputStream(con.getOutputStream());
InputReader inReader = new InputReader(input, protocol);
inReader.start();
//gl = new GameLogic(this, protocol);
sendMessage("server cone");
//readInput();
}catch(Exception e){
e.printStackTrace();
}
}
public void playGameAsClient(String ip){
try{
con = new Socket(InetAddress.getByName(ip),
ConnectionManager.PORT_NO);
if(con.isConnected()){
isConnected = true;
isClient = true;
System.out.println("Joining game");
isStarted = true;
placeCards(cards, Card.BLUE_PLAYER);
//repaint();
//clientGame = new Client(this, con);
protocol = new Protocol(con, this);
//gl = new GameLogic(this, protocol);
input = new DataInputStream(con.getInputStream());
output = new DataOutputStream(con.getOutputStream());
//usage of thread to read data (works)
InputReader inReader = new InputReader(input,
protocol);
inReader.start();
//end
sendMessage(Protocol.ATTACK_NOTIFICATION);
//without implementing a thread(does not work)
//readInput();
}else{
JOptionPane.showMessageDialog(null, "Connection cannot
be established.\nServer might not be active.", "Error",
JOptionPane.ERROR_MESSAGE);
}
}catch(Exception e){
e.printStackTrace();
}
}
//place the cards automatically(testing)
public void placeCards(Card[][] cards, String playerColor){
int k=0;
for(int i = 3; i < 5; i++){
for(int j = 0; j < COLUMNS; j++){
cards[i][j].setExposed(false);
cards[i][j].setOwn(true);
cards[i][j].setCardType(pieces[k]);
cards[i][j].setPlayerColor(playerColor);
cards[i][j].drawImage(pieces[k], playerColor, true,
false);
k++;
}
}
}
public void wonGame(){
if(aiGame!=null){
aiGame.killAI();
aiGame=null;
}
//clientGame=null;
//serverGame=null;
}
private void lostGame(){
}
public void newGameBoard(){
for(int i = 0; i < ROWS; i++){
for(int j = 0; j < COLUMNS; j++){
emptyField(cards[i][j], cards);
}
}
cards[2][2].setCardType(Card.WATER);
cards[2][2].drawImage(Card.WATER);
}
public void emptyField(Card inHand, Card[][] cards){
int x = inHand.getXCoordinate();
int y = inHand.getYCoordinate();
cards[x][y].setCardType(Card.GRASS);
cards[x][y].setExposed(false);
cards[x][y].setOwn(false);
cards[x][y].drawImage(Card.GRASS);
cards[x][y].setSelected(false);
cards[x][y].setPlayerColor(Card.NULL_PLAYER);
}
public void sendMessageToLbl(String msg){
statusLbl.setText(msg);
}
public void actionPerformed(ActionEvent e){
Card card = null;
if(isStarted){
card = (Card)e.getSource();
if(aiGame!=null){
if(card.getCardType()!=Card.WATER){
if((inHand==null||inHand==card)&&card.isOwn()){
if(card.getCardType()!=Card.BOMB&&card.getCardType()!=Card.FLAG){
inHand = aiGame.selectCard(card, cards);
}
}else{
target=card;
if(aiGame.move(inHand, target, cards)){
inHand=null;
target=null;
}
}
}
}else if(isConnected){
if(card.getCardType()!=Card.WATER){
if((inHand==null||inHand==card)&&card.isOwn()){
if(card.getCardType()!=Card.BOMB&&card.getCardType()!=Card.FLAG){
inHand = gl.selectCard(card, cards);
}
}else{
target=card;
if(gl.move(inHand, target, cards,
Card.BLUE_PLAYER)){
inHand=null;
target=null;
}else{
JOptionPane.showMessageDialog(null, "You cannot
move back and forth between two tiles for three consecutive
turns!\nPlease try again.", "Invalid move", JOptionPane.ERROR_MESSAGE);
}
}
}
}
}
repaint();
}
public void paint(Graphics g){
super.paint(g);
}
public static void main(String args[]) {
JFrame.setDefaultLookAndFeelDecorated(true);
Stratego t = new Stratego();
try{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}catch(Exception e){
}
t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
t.setSize(600, 500);
//t.setResizable(false);
t.setVisible(true);
}
public void sendMessage(String msg){
try{
output.writeUTF(msg);
output.flush();
}catch(Exception e){
e.printStackTrace();
}
}
public void readInput(){
while(true){
String msg="";
try{
msg = input.readUTF();
}catch(Exception e){
}
if(msg!=null&&!msg.equals("")){
System.out.println(msg);
protocol.handleInput(msg);
msg="";
}
}
}
}
- 7
- Java Technology Concept MapThe Java Technology Concept Map 1.0 is an interactive diagram,
a web of linked terms, to show the relationships among and uses
of the Java technologies. You can use the Map to get an overview
of the Java landscape as well as learn more about the details of
its components.
Launch the Map here:
http://java.sun.com/developer/onlineTraining/new2java/javamap/intro.html?ssobm=ng
- 7
- "cannot find CactusTask" errorHello:
I am attempting to use the <cactifywar> and <cactus > tasks in an Ant
build file. I have set up <taskdef> element to point to all the
necessary jar files, including cactus-ant-1.6.1.jar as below:
<taskdef resource="cactus.tasks">
<path>
<pathelement location="${lib}/cactus-ant-1.6.1.jar"/>
and so on and so on.
</path>
</taskdef>
The CactusTask class is inside cactus-ant-1.6.1.jar but upon execution
I received the following error:
"cannot find org.apache.cactus.integration.ant.CactusTask"
Well, Ant must have found "cactus.tasks" inside cactus-ant-1.6.1.jar
or else it wouldn't have known the classname in the error message!
Now . . . junit.jar is also on my classpath. Is there a difference
between the junit.jar that comes with Cactus and the jar named
ant-junit.jar that comes with Ant? I put both in my classpath but to
no avail.
Help!
Eric Hamacher
email***@***.com
Madison, Wisconsin
- 7
- Thunerbird help... [not java related , but please help if you can!]Hi all...
I know this is not a java question, but after seeking help on the
Thunderbird newsgroup, I was not able to get an answer to my question.
So since i know there are a lot of smart people in this group, I thought
of asking here.
here is the link to my question on the Thunderbird forum, please read,
and offer your insight!
http://forums.mozillazine.org/viewtopic.php?t=334466
many thanks
- 8
- socket & JVMThis is a multi-part message in MIME format.
Hi i'm trying to create a some sort of JAVA print server:
I've a machine that accept (throught a socket) some spool file........
Here's the JAVA code:
ServerSocket TServer;
int i = 0;
try{
TServer = new ServerSocket(TPort);
while( true ){
//frame.TModel.addElement("+++ WAITING REQUEST " + i );
Lpd_request request = new Lpd_request(TServer.accept(),frame,PQ,NumQueue);
request.start();
i = i + 1;
}
}
the problem is: every request launch another JVM for handle the print and create a pdf of the the spool data: for some reason if i create a batch that launch 5 spool file one after the other, the print server launch 5 thread, but some thread terminate not correctly.
In particular the exit code are 1-0-1-0-0 so the first fail, the second is executed and so on.....
Can I put a delay between thread execution for solve the problem???
Any suggestion????
--
---------------------------------------------
Mauro Anceschi
IT Department
Global Service Srl
Gruppo Motor Power Company Srl
www.motorpowergroup.com
Tel +39-0522-688189
Fax +39-0522-683552
IMPORTANT: This e-mail message is intended only for the named recipient(s) above and may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this e-mail message.
--------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>Hi i'm trying to create a some sort of JAVA print
server:</FONT></DIV>
<DIV><FONT face=Arial size=2>I've a machine that accept (throught a socket) some
spool file........</FONT></DIV>
<DIV><FONT face=Arial size=2>Here's the JAVA code:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>
<P><FONT face=Arial size=2>ServerSocket TServer;</FONT></P>
<P><FONT face=Arial size=2>int i = 0;</FONT></P>
<P><FONT face=Arial size=2>try</FONT><FONT face=Arial size=2>{</FONT></P>
<P><FONT face=Arial size=2> TServer = new
ServerSocket(TPort);</FONT></P>
<P><FONT face=Arial size=2> while( true )</FONT><FONT
face=Arial size=2>{</FONT></P>
<P><FONT face=Arial size=2>
//frame.TModel.addElement("+++ WAITING REQUEST " + i );</FONT></P>
<P><FONT face=Arial size=2> Lpd_request
request = new Lpd_request(TServer.accept(),frame,PQ,NumQueue);</FONT></P>
<P><FONT face=Arial size=2>
request.start();</FONT></P>
<P><FONT face=Arial size=2> i = i +
1;</FONT></P>
<P><FONT face=Arial size=2> }</FONT></P>
<P><FONT face=Arial size=2>}</FONT></P></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>the problem is: every request launch another JVM
for handle the print and create a pdf of the the spool data: for some reason if
i create a batch that launch 5 spool file one after the
other, the print server launch 5 thread, but some thread
terminate not correctly.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>In particular the exit code are 1-0-1-0-0 so the
first fail, the second is executed and so on.....</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Can I put a delay between thread execution for
solve the problem???</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Any suggestion????</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><BR><FONT
face=Arial size=2>--
<BR>---------------------------------------------<BR> <BR>Mauro
Anceschi<BR>IT Department<BR> <BR>Global Service Srl<BR>Gruppo Motor Power
Company Srl<BR></FONT><A href="http://www.motorpowergroup.com"><FONT face=Arial
size=2>www.motorpowergroup.com</FONT></A><BR><FONT face=Arial size=2>Tel
+39-0522-688189<BR>Fax +39-0522-683552<BR> <BR> <BR>IMPORTANT: This
e-mail message is intended only for the named recipient(s) above and may contain
information that is privileged, confidential and/or exempt from disclosure under
applicable law. If you have received this message in error, or are not the named
recipient(s), please immediately notify the sender and delete this e-mail
message.<BR> --------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>
- 13
- Going to NMU jikes (C++ ABI update)
I'm notice on <URL:http://people.debian.org/~mfurr/gxx/rebuild.html>
that jikes need a rebuild due to the new C++ ABI. I asked on
#debian-java if anyone is working on that, but got no reply. It is a
build-dependency on 119 packages, so it is probably a good idea to do
it quickly. I plan to do the NMU myself shortly, so this is just an
warning email.
I only change debian/changelog, adding this entry:
jikes (1:1.22-2.1) unstable; urgency=low
* Non-maintainer upload to get a rebuild with the new C++ ABI.
-- Petter Reinholdtsen <email***@***.com> Fri, 22 Jul 2005 01:08:42 +0200
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 13
- 13
- GridBag Layout queriesIt might appear long, but I think the answers will be of
just a few words describing the correct command/syntax.
After the Jbutton part has run successfully, the following
difficulties are coming in the next step.
- Individual buttons are not coming as same width. Whichever
button has more text or wider letters is coming wider, and
others are coming less wider.
- though left edge of a column of button is duly aligned,
the right edge is becoming zigzag due to the above.
- width of the largest button in a column is deciding the
width of the the entire column.
how to force all button to be of same width? If all buttons
in a column are of same width, the above are automatically
solved.
I am also finding that the three characters I have to
display are appearing in the centre, and there is huge space
left at the left and right of my text in the button.
Because of this, I have to unncessary keep my window wide so
that characters remain visible, otherwise several characters
are not becoming visible.
When I put setmargin I got this compile error.
setMargin(java.awt.Insets) in javax.swing.AbstractButton
cannot be applied to (int,int,int,int)
button[gridY1][gridX1].setMargin(0,0,0,0);
The best method would have been if we could have just given
a single width for all buttons, and it would have compressed
whatever text within that width.
- Even after giving gridwidth as 2 or 3, though the button
is reserving the width of those many columns, its width is
still that of a single button. the area next to it is coming
blank.
how to make it wider to fill the columns it is covering.
- Even after giving gridheight as 2, though the button is
reserving the height of those many rows, its height is still
of a single button. the area below it is coming blank.
how to make it taller to fill the rows it is covering.
ipadx or ipadx are not working. while trying to use
gridBagL.setConstraints(button, gridBagC);
it is giving error
setConstraints(java.awt.Component,java.awt.GridBagConstraints)
in java.awt.GridBagLayout cannot be applied to
(javax.swing.JButton[][],java.awt.GridBagConstraints)
what is the default height and width of a button?
in place of using an icon in setrolloverenabled(), can we
have some way to make it display whatever text is there in
the button, in a larger font size?
to set the horizontal alignment, if I am giving
button[gridY1][gridX1].setHorizontalAlignment(0);
it is still appearing at the centre. what are the options
for (int) are not shown in the tutorial.
Thanks.
-Rawat
- 13
- Array List IssueI have been having this unique issue with Array List I am trying add
say about 10 Objects in an Array List and conevr that to an Array.
Later when I parse through the Array i am having an Array of length 10
however i am only having the same element for all the 10 of them. can
anyone out there throw some light onto what i am doing wrong here here
is the peice of Code I am using
Course course = null;
for(int i=0;i<10;i++){
course = new Course();
course.setCourseName( "Course ".concat(Integer.toString(i)));
aList.add(course);
System.out.println(course.getCourseName());
}
Course[] courses = (Course[]) aList.toArray(new Course[0]);
Thanks
Sri
- 13
- Fax QuestionHas anyone used 'RFax 1.0 - Java [TM] fax component' from
http://www.java4less.com/java_fax.htm?
Good or bad (other comments)?
thanks!
|
| Author |
Message |
Roedy Green

|
Posted: 2004-7-6 0:30:00 |
Top |
java-programmer, HTTP creep
If you look at the packet headers going back and forth to your HTTP
server, you will discover a HECK of a lot of blather that really is
not doing much.
It is made worse by it all being human readable without abbreviations.
Add this overhead up on all packet headers being transferred each day
and you see a stupendous waste of bandwidth.
HTTP should be put on a diet, with rigid defaults, bitfield headers,
and compressed messages.
The original protocol was designed for maximum flexibility. Now we
have some experience, we can tighten it up.
It matters now that you have tiny handhelds trying to surf the net
over limited bandwidth.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
|
| |
|
| |
 |
Mike Schilling

|
Posted: 2004-7-6 4:38:00 |
Top |
java-programmer >> HTTP creep
"Roedy Green" <email***@***.com> wrote in message
news:email***@***.com...
> If you look at the packet headers going back and forth to your HTTP
> server, you will discover a HECK of a lot of blather that really is
> not doing much.
>
> It is made worse by it all being human readable without abbreviations.
>
> Add this overhead up on all packet headers being transferred each day
> and you see a stupendous waste of bandwidth.
>
> HTTP should be put on a diet, with rigid defaults, bitfield headers,
> and compressed messages.
>
> The original protocol was designed for maximum flexibility. Now we
> have some experience, we can tighten it up.
>
> It matters now that you have tiny handhelds trying to surf the net
> over limited bandwidth.
Compare total text size to total image size --how much are you saving?
|
| |
|
| |
 |
Tor Iver Wilhelmsen

|
Posted: 2004-7-6 4:52:00 |
Top |
java-programmer >> HTTP creep
Roedy Green <email***@***.com> writes:
> HTTP should be put on a diet, with rigid defaults, bitfield headers,
> and compressed messages.
... and SOAP should be turned back into EDIFACT.
Won't happen that either, though.
|
| |
|
| |
 |
Grant Wagner

|
Posted: 2004-7-6 5:10:00 |
Top |
java-programmer >> HTTP creep
Roedy Green wrote:
> If you look at the packet headers going back and forth to your HTTP
> server, you will discover a HECK of a lot of blather that really is
> not doing much.
>
> It is made worse by it all being human readable without abbreviations.
>
> Add this overhead up on all packet headers being transferred each day
> and you see a stupendous waste of bandwidth.
>
> HTTP should be put on a diet, with rigid defaults, bitfield headers,
> and compressed messages.
>
> The original protocol was designed for maximum flexibility. Now we
> have some experience, we can tighten it up.
>
> It matters now that you have tiny handhelds trying to surf the net
> over limited bandwidth.
Most modern Web browsers support gzipped output from Web servers, and most
servers support gzipping output. There is already technology in place to
put HTTP on a diet, but no one uses it: <url:
http://webreference.com/internet/software/servers/http/compression/ />
I can hear your objection already, compressing the output of all your Web
pages everytime they are requested would place a considerable load on the
HTTP server, so I propose some mechanism by which all static content is
pre-gzipped, and then simply served from disk.
For dynamically created content, it would have to be compressed each time,
but then again, your proposed solution would suffer from the same problem,
each dynamically created resource would have to be "encoded" by whatever
means you decide, so there would always be overhead for dynamic content.
Of course, the real problem isn't implementing something on the server,
even something that is resource intensive (after all, we can always throw
more hardware at the problem), the real problem is there are 30+ user
agents in the world, running on millions of computers, and they all expect
RFC2616-compliant headers. Even if servers supported your proposed
functionality tomorrow, we would be supporting HTTP/1.1 for many, many,
many years to come.
Not to mention, what do you propose I do with a Perl script that does:
print "Content-Type: text/html\n";
print "X-my-custom-header: value;value;value\n";
print "Content-Length: 0\n";
print "\n";
?
|
| |
|
| |
 |
Silvio Bierman

|
Posted: 2004-7-6 5:47:00 |
Top |
java-programmer >> HTTP creep
"Grant Wagner" <email***@***.com> wrote in message
news:email***@***.com...
> Roedy Green wrote:
>
> > If you look at the packet headers going back and forth to your HTTP
> > server, you will discover a HECK of a lot of blather that really is
> > not doing much.
> >
> > It is made worse by it all being human readable without abbreviations.
> >
> > Add this overhead up on all packet headers being transferred each day
> > and you see a stupendous waste of bandwidth.
> >
> > HTTP should be put on a diet, with rigid defaults, bitfield headers,
> > and compressed messages.
> >
> > The original protocol was designed for maximum flexibility. Now we
> > have some experience, we can tighten it up.
> >
> > It matters now that you have tiny handhelds trying to surf the net
> > over limited bandwidth.
>
> Most modern Web browsers support gzipped output from Web servers, and most
> servers support gzipping output. There is already technology in place to
> put HTTP on a diet, but no one uses it: <url:
> http://webreference.com/internet/software/servers/http/compression/ />
>
> I can hear your objection already, compressing the output of all your Web
> pages everytime they are requested would place a considerable load on the
> HTTP server, so I propose some mechanism by which all static content is
> pre-gzipped, and then simply served from disk.
>
> For dynamically created content, it would have to be compressed each time,
> but then again, your proposed solution would suffer from the same problem,
> each dynamically created resource would have to be "encoded" by whatever
> means you decide, so there would always be overhead for dynamic content.
>
> Of course, the real problem isn't implementing something on the server,
> even something that is resource intensive (after all, we can always throw
> more hardware at the problem), the real problem is there are 30+ user
> agents in the world, running on millions of computers, and they all expect
> RFC2616-compliant headers. Even if servers supported your proposed
> functionality tomorrow, we would be supporting HTTP/1.1 for many, many,
> many years to come.
>
> Not to mention, what do you propose I do with a Perl script that does:
>
> print "Content-Type: text/html\n";
> print "X-my-custom-header: value;value;value\n";
> print "Content-Length: 0\n";
> print "\n";
>
> ?
>
> --
> | Grant Wagner <email***@***.com>
>
Roedy talks about headers. GZIP compression in HTTP compresses the
request/response bodies, not the headers.
It only matters if you use HTTP as a transport protocol for a very dense
application level protocol because body sizes can be relatively small then.
In such cases it is best to use as few headers as possible. Quite soon
bandwith will not be so limited even for handhelds so I do not think HTTP
should be altered. When it was invented people had the same objections for
use in plain computers.
Silvio Bierman
|
| |
|
| |
 |
Tim Smith

|
Posted: 2004-7-6 6:32:00 |
Top |
java-programmer >> HTTP creep
On 2004-07-05, Grant Wagner <email***@***.com> wrote:
> Roedy Green wrote:
>> If you look at the packet headers going back and forth to your HTTP
>> server, you will discover a HECK of a lot of blather that really is
>> not doing much.
...
> Most modern Web browsers support gzipped output from Web servers, and most
> servers support gzipping output. There is already technology in place to
> put HTTP on a diet, but no one uses it: <url:
> http://webreference.com/internet/software/servers/http/compression/ />
That compresses that page content, not the HTTP headers.
--
--Tim Smith
|
| |
|
| |
 |
Roedy Green

|
Posted: 2004-7-6 6:44:00 |
Top |
java-programmer >> HTTP creep
On Mon, 05 Jul 2004 21:09:33 GMT, Grant Wagner
<email***@***.com> wrote or quoted :
>I can hear your objection already, compressing the output of all your Web
>pages everytime they are requested would place a considerable load on the
>HTTP server, so I propose some mechanism by which all static content is
>pre-gzipped, and then simply served from disk.
From a pure economics point of view, which is cheaper, adding extra
cpu power to do the compression on adding extra bandwidth?
From the client point of view, compression should always be faster
unless you were really strapped for CPU power. Unzipping is a lot
faster than zipping.
There are other types of compression you could use that would be
faster to compose. see
http://mindprod.com/projects/htmlcompactor.html
You could glue precompressed bits together with other bits compressed
on the fly.
The big problem is the inertia of converting to anything else. That
is why I want to wring the necks of people who released half-assed
inefficient interconnection protocols. You can never fix them later.
XML is another such idiocy.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
|
| |
|
| |
 |
Roedy Green

|
Posted: 2004-7-6 6:52:00 |
Top |
java-programmer >> HTTP creep
On Mon, 05 Jul 2004 22:32:23 GMT, Tim Smith
<email***@***.com> wrote or quoted :
>That compresses that page content, not the HTTP headers.
The point is not that the headers need to be compressed, but rather
dispensed with or abbreviated. Everyone keeps tacking just one more
field on.
Watch with a packet sniffer. You will be amazed how bloated they have
become. It is a bit like waistline creep.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
|
| |
|
| |
 |
The Ghost In The Machine

|
Posted: 2004-7-7 0:00:00 |
Top |
java-programmer >> HTTP creep
In comp.lang.java.advocacy, Roedy Green
<email***@***.com>
wrote
on Mon, 05 Jul 2004 16:29:42 GMT
<email***@***.com>:
> If you look at the packet headers going back and forth to your HTTP
> server, you will discover a HECK of a lot of blather that really is
> not doing much.
>
> It is made worse by it all being human readable without abbreviations.
>
> Add this overhead up on all packet headers being transferred each day
> and you see a stupendous waste of bandwidth.
>
> HTTP should be put on a diet, with rigid defaults, bitfield headers,
> and compressed messages.
>
> The original protocol was designed for maximum flexibility. Now we
> have some experience, we can tighten it up.
>
> It matters now that you have tiny handhelds trying to surf the net
> over limited bandwidth.
>
The HTTP protocol seems to be a bit of a mess.
[1] HTTP is over TCP. OK, TCP contains state. No problem yet.
[2] HTTP is stateless. Huh? Wait...why not use UDP? Of course
there are issues with UDP routing on the Internet so TCP
is still defensible, but...
[3] Cookies. Yeppers, the browsers got hungry! Now we have
state again.
In its way, ASN.1 is worse (since nobody seems to
understands it!) but there's an awful lot of gunk in HTTP
that's not really needed; the above is but one example.
The Accept: header is another issue; the original spec
of HTML (which HTTP was designed to transport originally)
was that unrecognized tags were simply ignored. However,
I'd have to look regarding unrecognized image formats in
<IMG> tags.
Sigh. At least Java's RMI protocol makes some sense, even if
it is proprietary... :-) Create a stub on the local machine,
which downloads relevant stuff from the remote.
--
#191, email***@***.com
It's still legal to go .sigless.
|
| |
|
| |
 |
Justin Farley

|
Posted: 2004-7-7 6:36:00 |
Top |
java-programmer >> HTTP creep
Roedy Green wrote:
> If you look at the packet headers going back and forth to your HTTP
> server, you will discover a HECK of a lot of blather that really is
> not doing much.
>
> It is made worse by it all being human readable without abbreviations.
Being human readable without abbreviations is a /good/ thing, and not
something to be sacrificed without good reason.
> Add this overhead up on all packet headers being transferred each day
> and you see a stupendous waste of bandwidth.
"Stupendous waste"? What fraction of bandwidth is used by HTTP headers?
This is /not/ the bottleneck for web apps IME.
> HTTP should be put on a diet, with rigid defaults, bitfield headers,
Yuck! You don't apply the same principles to your source code, so why
should HTTP headers be any different? Ironically, it is probably the
non-abbreviated human-readable format, that enabled you to prematurely argue
for obfuscating it in the name of optimization.
|
| |
|
| |
 |
Roedy Green

|
Posted: 2004-7-7 9:06:00 |
Top |
java-programmer >> HTTP creep
On Tue, 06 Jul 2004 22:36:14 GMT, "Justin Farley" <email***@***.com>
wrote or quoted :
>"Stupendous waste"? What fraction of bandwidth is used by HTTP headers?
>This is /not/ the bottleneck for web apps IME.
Yes studendous! What do you think the planet is paying each year for
datacommunication services, the total amount in billions? Hint it
makes up about 7% of all consumer spending.
1% of a billion is $10,000,000.00
Heavens! even that's more than I make in a month.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
|
| |
|
| |
 |
JTK

|
Posted: 2004-7-7 11:35:00 |
Top |
java-programmer >> HTTP creep
Justin Farley wrote:
> Roedy Green wrote:
[snip]
>
>>HTTP should be put on a diet, with rigid defaults, bitfield headers,
>
>
> Yuck! You don't apply the same principles to your source code, so why
> should HTTP headers be any different?
Because HTTP headers are not source code.
Yikes, I just agreed with Roeds. I feel dirty.
|
| |
|
| |
 |
The Ghost In The Machine

|
Posted: 2004-7-7 11:41:00 |
Top |
java-programmer >> HTTP creep
In comp.lang.java.advocacy, Justin Farley
<email***@***.com>
wrote
on Tue, 06 Jul 2004 22:36:14 GMT
<yPFGc.19083826$email***@***.com>:
> Roedy Green wrote:
>> If you look at the packet headers going back and forth to your HTTP
>> server, you will discover a HECK of a lot of blather that really is
>> not doing much.
>>
>> It is made worse by it all being human readable without abbreviations.
>
> Being human readable without abbreviations is a /good/ thing, and not
> something to be sacrificed without good reason.
>
>> Add this overhead up on all packet headers being transferred each day
>> and you see a stupendous waste of bandwidth.
>
> "Stupendous waste"? What fraction of bandwidth is used by HTTP headers?
> This is /not/ the bottleneck for web apps IME.
If the headers get to be a significant fraction of an ethernet frame
(1460 bytes, IIRC), start worrying. :-)
A sniff of a Lynx request generates the following:
GET http://www.cnn.com HTTP/1.0
Host: www.cnn.com
Accept: text/html, text/plain, application/vnd.sum.xml.writer,
application/vnd.sun.xml.writer.global, application/vnd.stardivision.writer,
application/vnd.stardivision.writer-global, application/x-starwriter,
application/vnd.sun.xml.writer.template
Accept: application/msword, application/vnd.sum.xml.calc,
application/vnd.stardivision.calc, application/x-starcalc,
application/vnd.sun.xml.calc.template, application/excel,
application/msexcel, application/vnd.ms-excel, application/x-msexcel,
Accept: application/vnd.sun.xml.impress, application/vnd/stardivision.impress,
application/vnd.stardivision.impress-packed, application/x-starimpress,
application/vnd.sun.xml.impress.template, application/powerpoint,
application/mspowerpoint
Accept: application/vnd.ms-powerpoint, application/x-mspowerpoint,
application/vnd.sun.xml.draw, application/x-stardraw,
application/vnd.sun.xml.draw.template, application/vnd.sun.xml.math
Accept: application/vnd.stardivision.math, application/x-starmath, text/sgml,
*/*;q=0.01
Accept-Encoding: gzip, compress
Accept-Language: en
Pragma: no-cache
Cache-control: no-cache
User-Agent: Lynx/2.8.5rel.1 libwww-FM/2.14.SSL-MM/1.4.1.OpenSSL/0.9.7d
Referer: http://www.cnn.com/
This is the text (if I've done this correctly!) from byte offset 0x42
to 0x55c -- 1,307 bytes. I've wrapped it to keep it readable.
And this is *before* one adds in the 2047-byte URL requirement.
Ye gods. I'm hoping there's a tweak in /etc/lynx/lynx.cfg to
put this on a diet. I don't know where it's getting all this
from offhand.
(There is one saving grace: Lynx doesn't download pictures unless
specifically asked.)
wget is much more reasonable:
GET http://www.cnn.com/ HTTP/1.0
User-Agent: Wget/1.9
Host: www.cnn.com
Accept: */*
though part of that is because wget is a lot stupider; all it
needs to do is put the results somewhere.
I'll have to look to see what Mozzie does; I'm remotely logged
in at the moment and don't have SSH/X forwarding currently.
>
>> HTTP should be put on a diet, with rigid defaults, bitfield headers,
>
> Yuck! You don't apply the same principles to your source code, so why
> should HTTP headers be any different? Ironically, it is probably the
> non-abbreviated human-readable format, that enabled you to prematurely
> argue for obfuscating it in the name of optimization.
Maybe, but if 10M browsers are out there each generating 1K
per request, that's an extra 100Gb of bandwidth. If one
browses an average of a page a minute, that's 1.6 Gb/s
just throwing headers around.
Of course, compared to the viruses that's probably pretty paltry. :-)
>
> --
> Justin
>
>
--
#191, email***@***.com
It's still legal to go .sigless.
|
| |
|
| |
 |
Roedy Green

|
Posted: 2004-7-7 12:06:00 |
Top |
java-programmer >> HTTP creep
On Wed, 07 Jul 2004 03:41:19 GMT, The Ghost In The Machine
<email***@***.com> wrote or quoted :
>A sniff of a Lynx request generates the following:
and this does not even count the headers inside the HTML itself that
manages for example to use about 80 bytes to give 4 bits of data --
which of 16 "standards" are being used.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
|
| |
|
| |
 |
Silvio Bierman

|
Posted: 2004-7-7 16:06:00 |
Top |
java-programmer >> HTTP creep
"The Ghost In The Machine" <email***@***.com> wrote in
message news:email***@***.com...
> In comp.lang.java.advocacy, Justin Farley
> <email***@***.com>
> wrote
> on Tue, 06 Jul 2004 22:36:14 GMT
> <yPFGc.19083826$email***@***.com>:
> > Roedy Green wrote:
> >> If you look at the packet headers going back and forth to your HTTP
> >> server, you will discover a HECK of a lot of blather that really is
> >> not doing much.
> >>
> >> It is made worse by it all being human readable without abbreviations.
> >
> > Being human readable without abbreviations is a /good/ thing, and not
> > something to be sacrificed without good reason.
> >
> >> Add this overhead up on all packet headers being transferred each day
> >> and you see a stupendous waste of bandwidth.
> >
> > "Stupendous waste"? What fraction of bandwidth is used by HTTP headers?
> > This is /not/ the bottleneck for web apps IME.
>
> If the headers get to be a significant fraction of an ethernet frame
> (1460 bytes, IIRC), start worrying. :-)
>
> A sniff of a Lynx request generates the following:
>
> GET http://www.cnn.com HTTP/1.0
> Host: www.cnn.com
> Accept: text/html, text/plain, application/vnd.sum.xml.writer,
> application/vnd.sun.xml.writer.global,
application/vnd.stardivision.writer,
> application/vnd.stardivision.writer-global, application/x-starwriter,
> application/vnd.sun.xml.writer.template
> Accept: application/msword, application/vnd.sum.xml.calc,
> application/vnd.stardivision.calc, application/x-starcalc,
> application/vnd.sun.xml.calc.template, application/excel,
> application/msexcel, application/vnd.ms-excel, application/x-msexcel,
> Accept: application/vnd.sun.xml.impress,
application/vnd/stardivision.impress,
> application/vnd.stardivision.impress-packed, application/x-starimpress,
> application/vnd.sun.xml.impress.template, application/powerpoint,
> application/mspowerpoint
> Accept: application/vnd.ms-powerpoint, application/x-mspowerpoint,
> application/vnd.sun.xml.draw, application/x-stardraw,
> application/vnd.sun.xml.draw.template, application/vnd.sun.xml.math
> Accept: application/vnd.stardivision.math, application/x-starmath,
text/sgml,
> */*;q=0.01
> Accept-Encoding: gzip, compress
> Accept-Language: en
> Pragma: no-cache
> Cache-control: no-cache
> User-Agent: Lynx/2.8.5rel.1 libwww-FM/2.14.SSL-MM/1.4.1.OpenSSL/0.9.7d
> Referer: http://www.cnn.com/
>
> This is the text (if I've done this correctly!) from byte offset 0x42
> to 0x55c -- 1,307 bytes. I've wrapped it to keep it readable.
>
> And this is *before* one adds in the 2047-byte URL requirement.
> Ye gods. I'm hoping there's a tweak in /etc/lynx/lynx.cfg to
> put this on a diet. I don't know where it's getting all this
> from offhand.
>
> (There is one saving grace: Lynx doesn't download pictures unless
> specifically asked.)
>
> wget is much more reasonable:
>
> GET http://www.cnn.com/ HTTP/1.0
> User-Agent: Wget/1.9
> Host: www.cnn.com
> Accept: */*
>
> though part of that is because wget is a lot stupider; all it
> needs to do is put the results somewhere.
>
> I'll have to look to see what Mozzie does; I'm remotely logged
> in at the moment and don't have SSH/X forwarding currently.
>
> >
> >> HTTP should be put on a diet, with rigid defaults, bitfield headers,
> >
> > Yuck! You don't apply the same principles to your source code, so why
> > should HTTP headers be any different? Ironically, it is probably the
> > non-abbreviated human-readable format, that enabled you to prematurely
> > argue for obfuscating it in the name of optimization.
>
> Maybe, but if 10M browsers are out there each generating 1K
> per request, that's an extra 100Gb of bandwidth. If one
> browses an average of a page a minute, that's 1.6 Gb/s
> just throwing headers around.
>
> Of course, compared to the viruses that's probably pretty paltry. :-)
>
> >
> > --
> > Justin
> >
> >
>
>
> --
> #191, email***@***.com
> It's still legal to go .sigless.
Who on earth created lynx? This looks totally stupid. The accept header is
at best moderately usefull but never when used as it is here.
Although I would not like to see HTTP becoming less readable I would applaud
any initiative to set some standards on when to set which headers, which
should be done with care.
Silvio Bierman
|
| |
|
| |
 |
Tim Tyler

|
Posted: 2004-7-7 18:16:00 |
Top |
java-programmer >> HTTP creep
HTTP should be done using XML - i.e. that's probably how it would
be done if the protocol were reinvented today ;-)
--
__________
|im |yler http://timtyler.org/ email***@***.com Remove lock to reply.
|
| |
|
| |
 |
Tor Iver Wilhelmsen

|
Posted: 2004-7-7 23:00:00 |
Top |
java-programmer >> HTTP creep
Tim Tyler <email***@***.com> writes:
> HTTP should be done using XML - i.e. that's probably how it would
> be done if the protocol were reinvented today ;-)
What, even more bloat?
|
| |
|
| |
 |
The Ghost In The Machine

|
Posted: 2004-7-8 0:00:00 |
Top |
java-programmer >> HTTP creep
In comp.lang.java.advocacy, Tim Tyler
<email***@***.com>
wrote
on Wed, 7 Jul 2004 10:16:11 GMT
<email***@***.com>:
> HTTP should be done using XML - i.e. that's probably how it would
> be done if the protocol were reinvented today ;-)
Erm...XML might be used in the *payload*, although some proposals
are suggesting that major document sections can be grouped using
XML tags in the ESB using a publish-subscribe system (either JMS
or XSLT-based).
--
#191, email***@***.com
It's still legal to go .sigless.
|
| |
|
| |
 |
Grant Wagner

|
Posted: 2004-7-8 0:16:00 |
Top |
java-programmer >> HTTP creep
The Ghost In The Machine wrote:
> > Yuck! You don't apply the same principles to your source code, so why
> > should HTTP headers be any different? Ironically, it is probably the
> > non-abbreviated human-readable format, that enabled you to prematurely
> > argue for obfuscating it in the name of optimization.
>
> Maybe, but if 10M browsers are out there each generating 1K
> per request, that's an extra 100Gb of bandwidth. If one
> browses an average of a page a minute, that's 1.6 Gb/s
> just throwing headers around.
And if 192 people download the 52,315KB Java 1.4.2_05 SDK, they've used more
bandwidth then that. Dunno about you, but I downloaded two copies of Java 1.4.2_04
(one for work, one for home), I downloaded two copies of Java 1.4.2_03, I
downloaded a single copy of Java 1.4.2_05 from Sun, but FTPed it to work, so I
used the same overall network bandwidth.
So there's ... 6 of those 192 transfers of over 50MB of data (not to mention my
downloads of 1.4.2_01 and 02, and every SDK prior to that).
> Of course, compared to the viruses that's probably pretty paltry. :-)
It's paltry compared to downloads from CVS refreshes of FreeBSD packages and "apt"
and "yum" auto-download installations of RPMs and what "up2date" does and Windows
Update downloads and people downloading Fedora and Firefox and Mozilla and Camino
and people harvesting newsgroups and Kazaa and Bittorrents and streaming audio and
video.
Considering I can make almost 1,000,000 Web page requests with 1KB headers before
I "waste" as much bandwidth as I used when I downloaded FreeBSD 5.2.1 (just disc1
and disc2 ISOs mind you, not the miniinst or bootonly images) I think our
attention is better spent elsewhere.
So sure, let's form a standards group to design a new specification for HTTP that
supports all of Roedy's suggestions, I'm all for it. Except I'd suggest those
people have better things to do with their time then redesign a protocol that
"wastes" 0.01% (or less) of the bandwidth on the Internet.
|
| |
|
| |
 |
Roedy Green

|
Posted: 2004-7-8 2:36:00 |
Top |
java-programmer >> HTTP creep
On Wed, 07 Jul 2004 16:16:17 GMT, Grant Wagner
<email***@***.com> wrote or quoted :
>And if 192 people download the 52,315KB Java 1.4.2_05 SDK, they've used more
>bandwidth then that. Dunno about you, but I downloaded two copies of Java 1.4.2_04
>(one for work, one for home), I downloaded two copies of Java 1.4.2_03, I
>downloaded a single copy of Java 1.4.2_05 from Sun, but FTPed it to work, so I
>used the same overall network bandwidth.
I think that bandwidth too is a problem, not an excuse for further
waste. There should be a delta scheme to download just the
differences between versions automatically depending on what you have
now.
We have got into a Roman orgy style of thinking that waste is GOOD.
Waste for the sake of waste. It is the thinking behind our species'
ecological irresponsibility.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- _scripting engines for java applications_Hi All,
I've written java app with classes that strickly corresponds to user's
business domain. Now I want to add scripting feature to my program to
enable user to create own scenarios of processing objects of those
business classes. Where to start? Is there any scripting languages
implemented in java?
thanks,
Andrey
- 2
- Together J 5.5Hi,
once there was a "community version" of TogetherJ. I have a 5.5 on CD
from a Together Presentation long ago but I am missing the community
"licence.tg". It was free (long time ago) but no longer available now.
Anybody out there with one of theses files?
Thx,
Christian
- 3
- Site about CoffeeIf you're interested in the world of coffee, please check out
www.thecoffeeresource.com
The site will be updated somewhere this week with new content.
Thanks for your time,
TheCoffeeresource.com
- 4
- jdbc commit issueHi,
I'm facing some problems with the JDBC connection commit.
I'm using an Oracle8i client and server.
The jdbc library is classes12.jar
My application uses eclipse3.1 as an IDE and the jdk version is
jdk1.5.0_01
The flow of logic is such that I acquire 2 to 3 connections to my
database repository. On each of these connections some update/insert
statements
are executed (through jdbc PrepareStatement->executeUpdate())
After the update statements I issue a connection.commit() on each of
the connections where update statements are fired.
I have noticed sometimes that although connection.commit has been
issued, my DB does not have any data.
If anyone has any clue to this please let me know.
Thanks for your time.
Arti
- 5
- java script problems XP dpreview and other sitesMainly on the popular digital photo site dpreview.com but
unfortunately not restricted to this site I sooner or later run into
the problem that the site navigation and posting does not work any
more: Normally a list of available sub items is displayed on the left
side, when positioning the cursor on any a specific pull down pops up.
But every other week or so the site is displayed with an empty
background where the menu normaly is and therefore no further
navigation ist possible. I Opera I get the menus but when I click the
javascript enabled send button for posts nothing happens too.
I am running Windos XP Home with all current updates with Norton
Internet Security 2002 and Norton System Works 2002. Even after a
clean reinstall of all apps with all updates I don't get a stable
system. My only rescue so far is to load a system partion image of a
good status some weeks ago. But as I said, this does not last for
long.
I tried reinstalling Windows Script 5.6, but it did not help.
Albert
- 6
- SendMailServlet example & server setup ?I tried this example :
// import the JavaMail packages
import javax.mail.*;
import javax.mail.internet.*;
// import the servlet packages
import javax.servlet.*;
import javax.servlet.http.*;
// import misc classes that we need
import java.util.*;
import java.io.*;
public class SendMailServlet extends HttpServlet {
String smtpServer;
public void init(ServletConfig config) throws ServletException
{
super.init(config);
// get the SMTP server from the servlet properties
smtpServer = config.getInitParameter("smtpServer");
}
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
// get the message parameters from the HTML page
String from = req.getParameter("from");
String to = req.getParameter("to");
String subject = req.getParameter("subject");
String text = req.getParameter("text");
PrintWriter out = res.getWriter();
res.setContentType("text/html");
try {
// set the SMTP host property value
Properties properties = System.getProperties();
properties.put("smtp.mail.yahoo.com", smtpServer);
// create a JavaMail session
Session session = Session.getInstance(properties, null);
// create a new MIME message
MimeMessage message = new MimeMessage(session);
// set the from address
Address fromAddress = new InternetAddress(from);
message.setFrom(fromAddress);
// set the to address
if (to != null) {
Address[] toAddress = InternetAddress.parse(to);
message.setRecipients(Message.RecipientType.TO, toAddress);
}
else
throw new MessagingException("No \"To\" address specified");
// set the subject
message.setSubject(subject);
// set the message body
message.setText(text);
// send the message
Transport.send(message);
out.println("Message sent successfully.");
}
catch (AddressException e) {
out.println("Invalid e-mail address.<br>" + e.getMessage());
}
catch (SendFailedException e) {
out.println("Send failed.<br>" + e.getMessage());
}
catch (MessagingException e) {
out.println("Unexpected error.<br>" + e.getMessage());
}
}
}
and got this:
type Exception report
message
description The server encountered an internal error () that prevented it
from fulfilling this request.
exception
java.lang.NullPointerException
java.util.Hashtable.put(Hashtable.java:396)
SendMailServlet.doPost(SendMailServlet.java:40)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
with : properties.put("smtp.mail.yahoo.com", smtpServer);in line
40.That is my first servlet so if you be so kind to give me a detailed
answer.
- 7
- javax.mail truncated urlHi!
I use javax.mail to send http mails that include urls. On some mail
clients, including Lotus iNotes, urls contained in the mail are
truncated. For example:
http://www.crappysite.com/index.html?param1=foo¶m2=bar
becomes
http://www.crappysite.com/index.html?param1
Encoding in the email is set to "quoted-printable". I tried to set it
to "base64" but it didn't resolve the problem.
Thanks!
Alex
- 8
- evaluating the computers TCP and UDP socket statesI am looking to be able to read the TCP and UDP socket states of the
computer using Java2.
I want to be able to determine when a certain TCP socket is listening
vs. connected, etc.
Does the java2 API cover this sort of ability?
thanks,
Dave Haga
p.s. just to be clear, I want to understand the state of ALL sockets,
not just the ones opened by Java. for instance, "netstat -a" on a
windows platform provides the status of all TCP and UDP sockets.
- 9
- Using wildcard character in web.xml in Tomcat 5I am trying to achieve the following:
<url-pattern>/a*</urlpattern> then go into servlet A. This would
include /a, /aa, /abc/123 etc.
I notice that servlet 2.4 doesn't treat * as a wildcard character in
this case. Therefore, servlet A would only be called if the URL is
exactly /a*.
I need to create this pattern for all characters and numbers except
when the path starts with '/_'. Therefore, I can not use a '/*'
notation. Can anyone suggest a workaround to this issue?
Thanks,
TC
- 10
- Get the Verb of request in jspHi Guys,
Would anyone mind telling me how to get the verb of a request in jsp?
I would like to know whether the user is using a POST or GET request.
Thanks,
James
- 11
- Basic Struts loggingI'm learning Struts and I've got a simple example app running. I wanted
to get logging working, so in the perform() method of my Action I put
the code:
ActionServlet as = getServlet();
as.log("hello world");
This compiled with no errors and ran without any problem; but the string
was not written to either of the log files catalina.out or
localhost_log.2004-09-21.txt (this is on Tomcat).
Any hints or clues about how to get simple logging working? I looked at
log4j and commons-logging but I want to start simpler.
- 12
- 360degree rotation in Java2DI have a bit of a problem rotating Shapes using the Graphics2D function
rotate(theta).
My high-school trig lessons indeed tell me that sine and cosine functions go
between -90 degrees and +90 degrees (or 0 and 180, if you like), and I can
see why this means that when I call the rotate(...) function, it will not
rotate the object all the way round the whole 360 degrees.
Currently, I have a duplicate Shape object which is flipped so that for one
half of the rotation the original shape is drawn, and for the second half,
the other...
There must be a better way!
Any ideas?
Cheers :o)
Will
- 13
- awt default toolkitThe following will not show the image nor will it throw any exceptions. Not
throwing exceptions doesn't surprise me because the documentation show that
it won't. That is a little surprising in itself. I am not using Swing
components.
public void paint(Graphics g){
String fileName = "dir/a.gif";
Toolkit toolkit = Toolkit.getDefaultToolkit();
Image img = toolkit.getImage(fileName);
// an awt panel's Graphics context doesnot show the image
g.drawImage(img, 0,0, null);
//this works fine
g.drawString("aString",50,50);
}
thanks, mike
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
- 14
- [Static Classes]Hi All,
Can someone explain when and why we use 'static classes' in Java ?
Also why 'method local classes' are used and what is their significance
?
Plz reply
- 15
- jdk1.6 - has no applet pluginHello
I cannot find the plugin that, I thought, should
come with jdk1.6.
Have I lost my mind or have they hidden it somewhere?
Thanks for your time.
dkr
|
|
|