| Please help for a LinkBinaryTreeInJava |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- import Tidy jar, path to jarI can't pin down why I think this, but I believe there's a mismatch
between where the build file says to find Tidy.jar and "import
org.w3c.tidy.Tidy;" from Test16.java, line 9. data:
[thufir@localhost java]$
[thufir@localhost java]$ ll lib/
total 184
-rw-rw-r-- 1 thufir thufir 177868 Aug 1 2001 Tidy.jar
[thufir@localhost java]$
[thufir@localhost java]$ ant
Buildfile: build.xml
clean:
[delete] Deleting directory /home/thufir/java/bin
prepare:
[mkdir] Created dir: /home/thufir/java/bin
compile:
[javac] Compiling 1 source file to /home/thufir/java/bin
[javac] /home/thufir/java/src/atreides/tidyXhtml/Test16.java:9:
package
org.w3c.tidy does not exist
[javac] import org.w3c.tidy.Tidy;
[javac] ^
[javac] /home/thufir/java/src/atreides/tidyXhtml/Test16.java:38:
cannot find
symbol
[javac] symbol : class Tidy
[javac] location: class atreides.tidyXhtml.Test16
[javac] Tidy tidy = new Tidy();
[javac] ^
[javac] /home/thufir/java/src/atreides/tidyXhtml/Test16.java:38:
cannot find
symbol
[javac] symbol : class Tidy
[javac] location: class atreides.tidyXhtml.Test16
[javac] Tidy tidy = new Tidy();
[javac] ^
[javac] 3 errors
BUILD FAILED
/home/thufir/java/build.xml:18: Compile failed; see the compiler error
output for
details.
Total time: 4 seconds
[thufir@localhost java]$ cat build.xml
<project name="XHTML" default="package">
<import file="properties.tidy.xml" />
<target name="clean">
<delete dir="${outputDir}" />
</target>
<target name="prepare" depends="clean">
<mkdir dir="${outputDir}" />
</target>
<target name="compile" depends="prepare">
<javac
srcdir = "${sourceDir}"
destdir = "${outputDir}"
classpath = "${tidy.classpath}"
/>
</target>
<target name="package" depends="compile">
<jar jarfile="${outputDir}/${mainClass}.jar"
basedir="${outputDir}"
>
<manifest>
<attribute name="Main-Class"
value="${pkgPath}${mainClass}"/>
</manifest>
</jar>
</target>
</project>
[thufir@localhost java]$ cat properties.tidy.xml
<project name="properties">
<property name="outputDir" value="bin/" />
<property name="sourceDir" value="src/atreides/tidyXhtml/"
/>
<property name="mainClass" value="Test16" />
<property name="pkgPath" value="atreides.tidyXhtml." />
<property name="user.name" value="thufir" />
<path id="tidy.classpath">
<pathelement path="lib/Tidy.jar" />
</path>
</project>
[thufir@localhost java]$
thanks,
Thufir
- 2
- Java programmer in the London area?Hello,
A friend is looking for a Java programmer in the London area. He has a
small company and one software product. This application may be part
of an EU funded project.
Any one interested and available?!
Cheers
Geoff
- 2
- JToggleButton dimension on ToolBar?I have added (besides normal buttons with icons (for example "open
folder") JToggleButton buttons with text on them.
I'm not able:
1. to give jtogglebutton buttons the same dimension, that is fitted to
the text;
2. to make that when one is selected, it stays pressed too.
Thanks for every advice.
Regards.
Marcello.
- 3
- Where is the Information Systems industry headed?Our university is doing some survey work to consider where the world
of IS is headed. Since most of those here work in that world, I'm
interested in your thoughts, especially if you think you have a good
feel for job skills needed now and job skills needed in the future.
The question is sort of two pronged.
First, where are IS jobs headed? Will there continue to be a
significant demand for programming skills? What type of analysis
skills (especially in terms of those that can be developed
academically) are important? Are the requirements changing -- will
things look different in the next five to ten years?
Second, what are the specific things you would think IS majors should
understand when leaving the university? Do you think any of those
things are going to change in the next 5-10 years?
Those are broad questions since I want to leave a lot of room for your
thoughts. I'd like to have some idea of what your role is in your
business and what type of business you are in if you answer (I know
some people don't like to give specifics on here and that's fine --
just "we are a manufacturing company, or I'm a private consultant" is
enough).
Lastly, I'd point out that I'm not interested in specific language
skills, etc. I'm not interested in starting another Sun/Microsoft war
or anything like that. Our philosophy is that even if we use Java/Sun
products for everything we do, you ought to be able to go into a shop
using Smalltalk or .Net or whatever and get up to speed quickly -- so
it's the broader concepts that I'm referring to.
I don't know whether I'll reply to all responses unless I'm looking
for clarification, but I promise I'll give all serious consideration.
Thanks for any ideas,
Marty McMahone
University of Mary Hardin-Baylor
Texas
- 3
- How to map the table classes have more than one columns for its primary key in Hibernate?I have two existed tables, I am NOT allow to altering those tables
The 1st table (tableA) has one column for its primary key, the 2nd
table (tableB) has tow columns for its primary key. I am try to map
these two tables with Hibernate XML. Here are my XML file.
Please see ????? in tow places.
Question 1
1st ???? is <many-to-many> tag in class TableA, but <many-to-many> tag
only allows one column. How do I map it for two columns?
Question 2
2nd ????? is the <key> tag in class TableB, similar that <key> tag only
allows one column. How do I map it for two columns?
Thank Q very much in advance!
<hibernate-mapping auto-import="false"
default-lazy="true" default-access="field">
<class name="tableA" table="TABLEA" entity-name="TableA.class">
<id name="tableAId" type="string" column="TABLEAID"
access="field">
<generator class="native">
<param name="key">TABLEAID</param>
</generator>
</id>
<property name="column1" type="string" column="COLUMN1" />
<property name="column2" type="string" column="COLUMN2" />
.....
<set name="idsa" table="IDS" inverse="true">
<key column="TABLEAID" />
<many-to-many column="????" class="tableB" />
</set>
</class>
<class name="tablesB" table="TABLEB" entity-name="TableB.class">
<composite-id>
<!-- this table's primary key has two columns -->
<key-property name="tableBId1" type="string"
column="TABLEBID1" />
<key-property name="tableBId2" type="integer"
column="TABLEBID2" />
</composite-id>
<property name="column1" type="string" column="COLUMN1" />
<property name="column2" type="string" column="COLUMN2" />
....
<set name="idsb" table="IDS">
<key column="?????" />
<many-to-many column="TABLEAID" class="tableA" />
</set>
</class>
</hibernate-mapping>
- 6
- Creating video with JMFHello
I want to create a video with jmf.
I have a sound file and an image file.
How i can mixed the two files to obtain a video.
Any help or info will be welcome.
Nazha
- 7
- retrieve an output param defined in a stored procedure from java codeHi,
I've made a java application and i use a CallableStatement to call a
stored procedure. I use the method getString() of this class to
retrieve the value of the definded output param but it retuns "" (no
value). The code of the stored procedure is
CREATE procedure pruebaICM
@pANI varchar(20),
@pTABLA varchar(20),
@pInsert varchar(500),
@pUpdate varchar(1000),
@pFLAG varchar(1),
@pResultado VARCHAR(1) OUTPUT
as
begin
DECLARE @ani varchar(20)
declare @cliente int
DECLARE @sentencia nvarchar(1000)
DECLARE @tabla nvarchar(20)
DECLARE @sentencia_where nvarchar(50)
DECLARE @sql nvarchar(1050)
SET NOCOUNT ON
set @tabla = @pTABLA
set @ani = @pANI
SELECT @sql= N'select @cliente=count(ani) from '+ @tabla + N'
where ani = ' + @ani
SELECT @sql
exec sp_executesql @sql, N'@Cliente INT OUTPUT', @Cliente
OUTPUT
SELECT @Cliente
if (@pFLAG = 'A') or (@pFLAG = 'Actualizar') or (@pFLAG = 'I')
begin
if (@cliente = 0)
begin
set @sentencia = N'insert into ' +
@pTABLA + N' (ani) values (' + @pInsert + N')'
select @sentencia
EXEC sp_executesql @sentencia
set @pResultado = 1
SELECT @pResultado
end
if (@cliente = 1)
begin
set @sentencia = N'update ' + @pTABLA +
N' set ' + @pUpdate
set @sentencia_where = N' where ANI =
' + @pANI
set @sql = @sentencia +
@sentencia_where
select @sql
EXEC sp_executesql @sql
set @pResultado = 2
SELECT @pResultado
end
end
else if (@pFLAG = 'B') or (@pFLAG = 'Borrar')
begin
if (@cliente = 0)
begin
set @pResultado = 0
SELECT @pResultado
end
else if (@cliente = 1)
begin
set @sentencia = N'delete from '+
@pTABLA + N' where ANI = ' + @pANI
EXEC sp_executesql @sentencia
set @pResultado = 3
SELECT @pResultado
end
end
end
However, when i call this stored procedure fron a query analyzer
windows it works well, the statements
are executed correctly and i can see that the value of the aoutput
param (@pResultado) changes depends on
the sentence executed (insert, update, delete). Then, why can't i
retrieve this param from my java code?
Thans very much for helping me!!!!!!!!!!!!!
P.D: i'm using jsk1.3.1_04 and sql server 7
- 8
- Should I run JAVA or MS VM with Internet Explorer?I installed Java JRE 1.4.2_02 to support Mozilla Firebird while I try it
out.
This plug-in has enabled itself to run with IE6 too. Should I disable it in
IE6? Or should I disable MS VM? Or should I let both run together?
Thank you.
Jim Andrus
- 12
- JAVA NewbeeHi,
I have a few questions I'm hoping the group could answer for me. I'm
currently using Windows 98SE with all the latest updates running on a
Pentium III with 256M of RAM...
1) How can I tell what version of the JAVA runtime library I'm running?
2) I'd like to upgrade to the latest version of the RT (J2 V1.4.2). Will my
system support it?
3) Do I have to uninstall the previous version before upgrading? If so how
do I do this?
--
TIA,
Vic
My return email address is S P A M proof
please send replies to: vxp AT sympatico DOT ca
- 12
- Getting the original URL in a custom 404 error page/servlet (Tomcat)Hi!
I'm trying to setup a servlet to handle all request that does not map
to a file on the webserver. I've set up a error-page in web.xml that
points to my servlet. I want my servlet to lookup the requested URL
in a database.
The only problem is that when the servlet is called, I want to get the
original URL requested by the user, not the URL of my 404 servlet.
Does anyone know how to do this?
Thanks in advance for any help!
Anders
- 12
- 12
- "package own.examples": necessary for NetBeans?Hello together
I am learning java and for my beginning, I just used a simple editor to
write the example codes. Now I wanna try NetBeans, but unfortunately all my
codes aren't working! I found out, that NetBeans need at the beginning of
the source file: "package own.examples" (i.e. where the source is stored).
Of course none of the sources I've written contains this add-on (because I
didn't need it). So they don't work with NetBeans. Why? If I am adding this
small "sentence" to the source code, I can compile it with NetBeans without
any problems, -> but not any longer with the command prompt (I am using
WinXP Pro at the moment).
What am I doing wrong? Is this sentence really necessary? I am asking,
'cause I want to implement a CMS (maybe JSF or Struts) and therefore I want
to know:
1) if it is better to use Eclipse or jEdit (do they need this extra
sentence, too?),
2) and if I am using an Application Server, it always needs "package
own.examples" or not? (so that maybe it is better not to use NetBeans 'cause
of this "lack")
thanks and cheers
mirco novena
- 14
- Eclipse - problem with external tool path name.I am running Eclipse 3.2 with on Windows with WebSphere WSAdmin set up
as an external tool. WSAdmin is basically a bat file that executes a
Java program. It takes a number of parameters one of which can be a
file containing properties.
External tool: C:\IBM\WAS51\DeploymentManager\bin\wsadmin.bat
Working directory ${workspace_loc:/WSAdmin}
Arguments:
-lang jacl
-host localhost -port 8879
-f ${resource_loc} ${resource_loc:/WSAdmin/WAS5.1/propertyFiles/Aquila/
aquila.properties}
The property file name "${resource_loc:/WSAdmin/WAS5.1/propertyFiles/
Aquila/aquila.properties}" gets converted to
"C:homepatrickeclipseWSAdminCVSWSAdminWAS5.1propertyFilesAquilaquila.properties
"
Obviously the back slashes are being escaped. Is there any way I can
prevent this?
I have already tried "${resource_loc:\\WSAdmin\\WAS5.1\\propertyFiles\
\Aquila\\aquila.properties}" without success.
ERROR: file
C:homepatrickeclipseWSAdminCVSWSAdminWAS5.1propertyFilesAquilaquila.properties
does not exist.
- 15
- Timberland Boots Mid Shoes Buyer ( paypal accept ) ( www.sneaker-fan.com )Wholesale nike jordan shoes puma adidas shoes T-shirt Bags Purse
clothing Scarf Amice Watch Glasses jeans hats etc..
Website Link: http://www.nike-shoes.com.cn
welcome to ChenXi International Trade Co.,LTD. we are professional
shoes and clothes manufactory with 4 years experience located in
china.we can supply many kinds of brand shoes, we wholesale Nike
shoes,Nike Air Max shoes,Nike shox shoes. Jordan shoes,Air Force 1
shoes,Dunk shoes,Rift shoes,bapestar shoes,Timberland boots,Adidas
shoes,prada shoes,gucci shoes ,LV shoes ,Kappa shoes,Converse
shoes,Dsquared shoes,D&G shoes,Lacoste shoes,polo T-shirt,Versace
shoes,ugg boots,Bags,Purse,clothes Watch,Glasses,jeans,hats,caps
etc..in the all over the world..All our Products quality are 1:1 grade
and original box ,we are dependable wholesaler ! contact us:
http://www.nike-shoes.com.cn
Products list :
Jordans shoes
Jordan 1 shoes www.nike-shoes.com.cn
Jordan 2 shoes www.nike-shoes.com.cn
Jordan 3 shoes www.nike-shoes.com.cn
Jordan 4 shoes www.nike-shoes.com.cn
Jordan 5 shoes www.nike-shoes.com.cn
Jordan 6 shoes www.nike-shoes.com.cn
Jordan 7 shoes www.nike-shoes.com.cn
Jordan 8 shoes www.nike-shoes.com.cn
Jordan 9 shoes www.nike-shoes.com.cn
Jordan 10 shoes www.nike-shoes.com.cn
Jordan 11 shoes www.nike-shoes.com.cn
Jordan 12 shoes www.nike-shoes.com.cn
Jordan 13 shoes www.nike-shoes.com.cn
Jordan 14 shoes www.nike-shoes.com.cn
Jordan 16 shoes www.nike-shoes.com.cn
Jordan 17 shoes www.nike-shoes.com.cn
Jordan 18 shoes www.nike-shoes.com.cn
Jordan 19 shoes www.nike-shoes.com.cn
Jordan 20 shoes www.nike-shoes.com.cn
Jordan 21 shoes www.nike-shoes.com.cn
Jordan 22 shoes www.nike-shoes.com.cn
Jordan 23 shoes www.nike-shoes.com.cn
Nike Air Max
Air Max 87 shoes www.nike-shoes.com.cn
Air Max 90 shoes www.nike-shoes.com.cn
Air Max 91 shoes www.nike-shoes.com.cn
Air Max 95 shoes www.nike-shoes.com.cn
Air Max 97 shoes www.nike-shoes.com.cn
Air Max 2003 shoes www.nike-shoes.com.cn
Air Max 360 shoes www.nike-shoes.com.cn
Air Max 180 shoes www.nike-shoes.com.cn
Air Max TN shoes www.nike-shoes.com.cn
Air Max TN2 shoes www.nike-shoes.com.cn
Air Max TN3 shoes www.nike-shoes.com.cn
Air Max TN9 shoes www.nike-shoes.com.cn
Air Max TN8 shoes www.nike-shoes.com.cn
Air Max LTD shoes www.nike-shoes.com.cn
Air Max 1 id shoes www.nike-shoes.com.cn
Air Max stab 89 shoes www.nike-shoes.com.cn
Air Max 2008 shoes www.nike-shoes.com.cn
Nike Shox
Shox NZ shoes www.nike-shoes.com.cn
Shox R4 shoes www.nike-shoes.com.cn
Shox TL3 shoes www.nike-shoes.com.cn
Shox TL4 shoes www.nike-shoes.com.cn
Shox TL shoes www.nike-shoes.com.cn
Shox OZ shoes www.nike-shoes.com.cn
Shox Rival shoes www.nike-shoes.com.cn
Shox Classic shoes www.nike-shoes.com.cn
Shox Energia shoes www.nike-shoes.com.cn
Nike Air Force 1
Air Force 1 low shoes www.nike-shoes.com.cn
Air Force 1 mid shoes www.nike-shoes.com.cn
Air Force 1 high shoes www.nike-shoes.com.cn
Air Force 1 25 shoes www.nike-shoes.com.cn
Nike Dunk sb shoes www.nike-shoes.com.cn
Dunk low shoes www.nike-shoes.com.cn
Dunk high shoes www.nike-shoes.com.cn
Adidas shoes www.nike-shoes.com.cn
Adidas Running shoes www.nike-shoes.com.cn
Adidas 35 year shoes www.nike-shoes.com.cn
Adidas City shoes www.nike-shoes.com.cn
Adidas Goodyear shoes www.nike-shoes.com.cn
Adidas NBA shoes www.nike-shoes.com.cn
Adidas Y-3 shoes www.nike-shoes.com.cn
Adidas country shoes www.nike-shoes.com.cn
T-MAC shoes www.nike-shoes.com.cn
Rift shoes www.nike-shoes.com.cn
BapeStar shoes www.nike-shoes.com.cn
Football shoes www.nike-shoes.com.cn
Timberland boots shoes www.nike-shoes.com.cn
Hardaway shoes www.nike-shoes.com.cn
James shoes www.nike-shoes.com.cn
Puma shoes www.nike-shoes.com.cn
Prada shoes www.nike-shoes.com.cn
Prada low shoes www.nike-shoes.com.cn
Prada high shoes www.nike-shoes.com.cn
Dsquared shoes www.nike-shoes.com.cn
Gucci shoes www.nike-shoes.com.cn
Gucci low shoes www.nike-shoes.com.cn
Gucci high shoes www.nike-shoes.com.cn
LV shoes www.nike-shoes.com.cn
Kappa shoes www.nike-shoes.com.cn
Converse shoes www.nike-shoes.com.cn
Dsquared shoes www.nike-shoes.com.cn
D&G shoes www.nike-shoes.com.cn
Lacoste shoes www.nike-shoes.com.cn
Umbro shoes www.nike-shoes.com.cn
Versace shoes www.nike-shoes.com.cn
Woman boots www.nike-shoes.com.cn
ugg boots www.nike-shoes.com.cn
Burberry shoes www.nike-shoes.com.cn
EVISU shoes www.nike-shoes.com.cn
Hogan Shoes www.nike-shoes.com.cn
Hurricane Shoes www.nike-shoes.com.cn
handbag Bags www.nike-shoes.com.cn
LV Bag www.nike-shoes.com.cn
Gucci Bag www.nike-shoes.com.cn
Prada Bag www.nike-shoes.com.cn
D&G Bag www.nike-shoes.com.cn
Leather Bag www.nike-shoes.com.cn
A&F Bag www.nike-shoes.com.cn
Juicy Bag www.nike-shoes.com.cn
Guess Bag www.nike-shoes.com.cn
Feidi Bag www.nike-shoes.com.cn
Coach Bag www.nike-shoes.com.cn
Chloe Bag www.nike-shoes.com.cn
Chanel Bag www.nike-shoes.com.cn
ugg bag www.nike-shoes.com.cn
Burberry bag www.nike-shoes.com.cn
Dooney&Bourke bag www.nike-shoes.com.cn
Jimmy Choo bag www.nike-shoes.com.cn
Dior bag www.nike-shoes.com.cn
Purse
CHANEL Purse www.nike-shoes.com.cn
COACH Purse www.nike-shoes.com.cn
Else Purse www.nike-shoes.com.cn
GUCCI Purse www.nike-shoes.com.cn
LV Purse www.nike-shoes.com.cn
man purse www.nike-shoes.com.cn
Strap & Belts
BAPE Belts www.nike-shoes.com.cn
BOSS Belts www.nike-shoes.com.cn
CHANEL Belts www.nike-shoes.com.cn
D&G Belts www.nike-shoes.com.cn
GIORGIO ARMANI Belts www.nike-shoes.com.cn
GUCCI Belts www.nike-shoes.com.cn
LV Belts www.nike-shoes.com.cn
Glasses
ARMANI Glasses www.nike-shoes.com.cn
BURBERRY Glasses www.nike-shoes.com.cn
BVLGARI Glasses www.nike-shoes.com.cn
Ray.Ban Glasses www.nike-shoes.com.cn
VERSACE Glasses www.nike-shoes.com.cn
Prada Glasses www.nike-shoes.com.cn
OKEY Glasses www.nike-shoes.com.cn
LV Glasses www.nike-shoes.com.cn
HERMES Glasses www.nike-shoes.com.cn
EL.FERROL Glasses www.nike-shoes.com.cn
DIOR Glasses www.nike-shoes.com.cn
D&G Glasses www.nike-shoes.com.cn
GUCCI Glasses www.nike-shoes.com.cn
CHANEL Glasses www.nike-shoes.com.cn
CS Glasses www.nike-shoes.com.cn
CARTIER Glasses www.nike-shoes.com.cn
Watch
Rolex Watch www.nike-shoes.com.cn
clothing
10 DEEP clothing www.nike-shoes.com.cn
A&F clothing www.nike-shoes.com.cn
Abercrombie&Fitch clothing www.nike-shoes.com.cn
Abercrombie & Fitch clothing www.nike-shoes.com.cn
ADICOLOR clothing www.nike-shoes.com.cn
ADIDAS clothing www.nike-shoes.com.cn
AK clothing www.nike-shoes.com.cn
ARMANI T-shirt www.nike-shoes.com.cn
ARMANI Sweater www.nike-shoes.com.cn
polo Sweater www.nike-shoes.com.cn
Artful dodger clothing www.nike-shoes.com.cn
BAPE clothing www.nike-shoes.com.cn
BBC clothing www.nike-shoes.com.cn
CLH clothing www.nike-shoes.com.cn
COOGI clothing www.nike-shoes.com.cn
D&G clothing www.nike-shoes.com.cn
DSQUARED clothing www.nike-shoes.com.cn
ED clothing www.nike-shoes.com.cn
HARDY clothing www.nike-shoes.com.cn
EVISU clothing www.nike-shoes.com.cn
EVS clothing www.nike-shoes.com.cn
GGG clothing www.nike-shoes.com.cn
G-STAR clothing www.nike-shoes.com.cn
LACOSTE T-shirt clothing www.nike-shoes.com.cn
Lacoste Sweater www.nike-shoes.com.cn
LRG clothing www.nike-shoes.com.cn
NY clothing www.nike-shoes.com.cn
O&L clothing www.nike-shoes.com.cn
POLO T-shirt 3 4 5 www.nike-shoes.com.cn
POLO T-shirt clothing www.nike-shoes.com.cn
Byrberry T-shirt www.nike-shoes.com.cn
UGG clothing www.nike-shoes.com.cn
Byrberry clothing www.nike-shoes.com.cn
NFL Jersey www.nike-shoes.com.cn
scarf scarves www.nike-shoes.com.cn
jeans
AFTFUL DODGER jeans www.nike-shoes.com.cn
AKA STASH HOUSE jeans www.nike-shoes.com.cn
APE jeans www.nike-shoes.com.cn
BBC jeans www.nike-shoes.com.cn
COOGI jeans www.nike-shoes.com.cn
D&G jeans www.nike-shoes.com.cn
DIESEL jeans www.nike-shoes.com.cn
ED jeans www.nike-shoes.com.cn
EVISU jeans www.nike-shoes.com.cn
Gino jeans www.nike-shoes.com.cn
G-Star jeans www.nike-shoes.com.cn
LRG jeans www.nike-shoes.com.cn
RMC jeans www.nike-shoes.com.cn
ROCK jeans www.nike-shoes.com.cn
SHMACK jeans www.nike-shoes.com.cn
TR jeans www.nike-shoes.com.cn
ugg jeans www.nike-shoes.com.cn
Armani jeans www.nike-shoes.com.cn
TRUE RELIGION jeans www.nike-shoes.com.cn
Levi's Jeans www.nike-shoes.com.cn
hat cap www.nike-shoes.com.cn
Chanel hat Cap www.nike-shoes.com.cn
D&G hat cap www.nike-shoes.com.cn
G-Star hat Cap www.nike-shoes.com.cn
Gucci hat Cap www.nike-shoes.com.cn
lv hat Cap www.nike-shoes.com.cn
POLO hat Cap www.nike-shoes.com.cn
Prada hat Cap www.nike-shoes.com.cn
PSP sp2
MP3 MP4 www.nike-shoes.com.cn
Mobile phone www.nike-shoes.com.cn
iPhone www.nike-shoes.com.cn
nokia 8800 www.nike-shoes.com.cn
nokia n95 www.nike-shoes.com.cn
nokia n93i www.nike-shoes.com.cn
nokia n73 www.nike-shoes.com.cn
memory stick www.nike-shoes.com.cn
memory strip www.nike-shoes.com.cn
Underwear www.nike-shoes.com.cn
bikini
http://www.nike-shoes.com.cn
- 16
- ** new open source requirements management tool **Hi,
OSRMT v1.1 has been released free under GPL for design
control/requirements engineering:
- custom forms to enter product features, requirements, use cases, test
cases, design etc.
- arrange all of these 'artifacts' within a hierarchal tree
- create dependencies between artifact e.g. feature a --> requirement b
--> source code c,d,e
- traceability matrix, identify artifacts not traced
- generate a dependency graph showing the impact of changing an
artifact (upward/downward)
- attach binary files or insert links to files or URLs with each
artifact
- customize the reference with artifact type specific priorities,
status, version etc.
- enter low level details to artifacts e.g. use case steps, data
fields, test steps etc.
- track entire history of change to artifact
- environment specific username and hashed password
- database independence - Oracle, MySQL, SQL Server, MS Access scripts
supplied
- configure client to connect to database direct or full blown J2EE
(client connects to JBoss)
- Rich Swing client runs anywhere (web client or run client over HTTP
in the future)
- Import/export artifacts from/to XML
- Technologies used include JGoodies (forms), JGraph (dependency tree),
Jakarta (db connection pooling), Rhino (custom scripting
forms/reports), Jasper (reports)
We welcome your review, comments, questions and requests for new
features.
You can download the latest release at http://www.osrmt.com
thanks!
Aron Smith
Fast, free requirements customized your way!
|
| Author |
Message |
Basanta

|
Posted: 2008-3-17 1:37:00 |
Top |
java-programmer, Please help for a LinkBinaryTreeInJava
I am new in this group,I don't know how far it would help me.
I tried to make a linked based binary tree following the book "data
structures and algorithms in java" By goodRich and tamassia.I did all
but I wanted to implement a function to determine whether a particular
node exists or not.All I want to implement a function boolean
exists(node n).Can anyone help??My program is as follows:-
import java.io.*;
interface Node {
Object getData();
int getID();
}
class TreeEmptyException extends Exception {
TreeEmptyException(String message) {
super(message);
}
}
class LinkBinTree {
BinNode root;
int size;
LinkBinTree(Object O) {
root = new BinNode(0);
}
class BinNode implements Node {
int id;
BinNode left;
BinNode right;
Object data;
BinNode(int iden) {
id = iden;
left = null;
right = null;
data = null;
}
BinNode(Object O) {
id = 0;
left = null;
right = null;
data = null;
}
public Object getData() {return data;}
public int getID() { return id;}
void addLeft(Object obj) {
BinNode b = new BinNode(obj);
left = b;
}
void addRight(Object obj) {
BinNode r = new BinNode(obj);
right = r;
}
BinNode addLeft(Node n,Object O) throws TreeEmptyException
{
if(!exists(n)) throw new TreeEmptyException("Tree doesn't
exists");
return n.addLeft(O);
}
BinNode addRight(Node n,Object O) throws TreeEmptyException{
if(!exists(n)) throw new TreeEmptyException("Tree doesn't
exists");
return n.addRight(O);
}
void preOrder(Node n) {
LinkQueueApp<Integer> q =new LinkQueueApp<Integer>();
int p=n.getID();
q.enqueue(p);
while(!q.isEmpty()) {
p =q.dequeue();
System.out.println("The pre-order is : "
+n.getData());
for(int i=p;(i==p+1) || (i==p+2)&&i<=size;i++)
q.enqueue(i);
}
}
void boolean exists(Node n) {
if(Node == root) return;
else {
if(Node
|
| |
|
| |
 |
Basanta

|
Posted: 2008-3-17 1:42:00 |
Top |
java-programmer >> Please help for a LinkBinaryTreeInJava
I am new in this group,I don't know how far it would help me.
I tried to make a linked based binary tree following the book "data
structures and algorithms in java" By goodRich and tamassia.I did all
but I wanted to implement a function to determine whether a particular
node exists or not.All I want to implement a function boolean
exists(node n).Can anyone help??My program is as follows:-
import java.io.*;
interface Node {
Object getData();
int getID();
}
class TreeEmptyException extends Exception {
TreeEmptyException(String message) {
super(message);
}
}
class LinkBinTree {
BinNode root;
int size;
LinkBinTree(Object O) {
root = new BinNode(0);
}
class BinNode implements Node {
int id;
BinNode left;
BinNode right;
Object data;
BinNode(int iden) {
id = iden;
left = null;
right = null;
data = null;
}
BinNode(Object O) {
id = 0;
left = null;
right = null;
data = null;
}
public Object getData() {return data;}
public int getID() { return id;}
void addLeft(Object obj) {
BinNode b = new BinNode(obj);
left = b;
}
void addRight(Object obj) {
BinNode r = new BinNode(obj);
right = r;
}
BinNode addLeft(Node n,Object O) throws TreeEmptyException
{
if(!exists(n)) throw new TreeEmptyException("Tree doesn't
exists");
return n.addLeft(O);
}
BinNode addRight(Node n,Object O) throws TreeEmptyException{
if(!exists(n)) throw new TreeEmptyException("Tree doesn't
exists");
return n.addRight(O);
}
void preOrder(Node n) {
LinkQueueApp<Integer> q =new LinkQueueApp<Integer>();
int p=n.getID();
q.enqueue(p);
while(!q.isEmpty()) {
p =q.dequeue();
System.out.println("The pre-order is : "
+n.getData());
for(int i=p;(i==p+1) || (i==p+2)&&i<=size;i++)
q.enqueue(i);
}
}
void boolean exists(Node n) {
if(Node == root) return;
else {
if(Node
|
| |
|
| |
 |
Jussi Piitulainen

|
Posted: 2008-3-17 1:48:00 |
Top |
java-programmer >> Please help for a LinkBinaryTreeInJava
Basanta writes:
> LinkBinTree(Object O) {
> root = new BinNode(0);
> }
Set your font so that the letter O and the digit 0 look different.
(Same for I, l and 1, but your code happens to exhibit O and 0.)
|
| |
|
| |
 |
Mark Space

|
Posted: 2008-3-17 1:52:00 |
Top |
java-programmer >> Please help for a LinkBinaryTreeInJava
Basanta wrote:
> I am new in this group,I don't know how far it would help me.
> I tried to make a linked based binary tree following the book "data
> structures and algorithms in java" By goodRich and tamassia.I did all
> but I wanted to implement a function to determine whether a particular
> node exists or not.All I want to implement a function boolean
> exists(node n).Can anyone help??My program is as follows:-
>
> import java.io.*;
>
> interface Node {
> Object getData();
> int getID();
> }
This is kind of interesting. Does your book explain why nodes have both
a data element and an ID? Why not just use the data?
I feel this may make your tree special in some regard, and affect the
answer to your question. More info would help here. How do you search?
Do you look for data? ID? both?
|
| |
|
| |
 |
Basanta

|
Posted: 2008-3-17 2:04:00 |
Top |
java-programmer >> Please help for a LinkBinaryTreeInJava
On Mar 16, 10:52 pm, Mark Space <email***@***.com> wrote:
> Basanta wrote:
> > I am new in this group,I don't know how far it would help me.
> > I tried to make a linked based binary tree following the book "data
> > structures and algorithms in java" By goodRich and tamassia.I did all
> > but I wanted to implement a function to determine whether a particular
> > node exists or not.All I want to implement a function boolean
> > exists(node n).Can anyone help??My program is as follows:-
>
> > import java.io.*;
>
> > interface Node {
> > Object getData();
> > int getID();
> > }
>
> This is kind of interesting. Does your book explain why nodes have both
> a data element and an ID? Why not just use the data?
>
> I feel this may make your tree special in some regard, and affect the
> answer to your question. More info would help here. How do you search?
> Do you look for data? ID? both?
I look only for ID.
|
| |
|
| |
 |
Mark Space

|
Posted: 2008-3-17 2:27:00 |
Top |
java-programmer >> Please help for a LinkBinaryTreeInJava
Basanta wrote:
> I look only for ID.
Can I ask why? What's the idea there?
Also, are ID comparable? Do they have a sorted order?
|
| |
|
| |
 |
HelpMe

|
Posted: 2008-3-17 2:46:00 |
Top |
java-programmer >> Please help for a LinkBinaryTreeInJava
On Mar 16, 11:26 pm, Mark Space <email***@***.com> wrote:
> Basanta wrote:
> > I look only for ID.
>
> Can I ask why? What's the idea there?
>
> Also, are ID comparable? Do they have a sorted order?
No,but I want to implement functions addLeft and addRight for which
existence of the node where adding is performed is mandatory.
|
| |
|
| |
 |
Andrew Marcus

|
Posted: 2008-3-17 2:50:00 |
Top |
java-programmer >> Please help for a LinkBinaryTreeInJava
On Mar 16, 11:46 pm, HelpMe <email***@***.com> wrote:
> On Mar 16, 11:26 pm, Mark Space <email***@***.com> wrote:
>
> > Basanta wrote:
> > > I look only for ID.
>
> > Can I ask why? What's the idea there?
>
> > Also, are ID comparable? Do they have a sorted order?
> I want to implement exists for add Left functions.
> No,but I want to implement functions addLeft and addRight for which
> existence of the node where adding is performed is mandatory.
|
| |
|
| |
 |
Andrew Marcus

|
Posted: 2008-3-17 2:53:00 |
Top |
java-programmer >> Please help for a LinkBinaryTreeInJava
On Mar 16, 11:50 pm, Andrew Marcus <email***@***.com> wrote:
> On Mar 16, 11:46 pm, HelpMe <email***@***.com> wrote:
>
> > On Mar 16, 11:26 pm, Mark Space <email***@***.com> wrote:
>
> > > Basanta wrote:
> > > > I look only for ID.
>
> > > Can I ask why? What's the idea there?
>
> > > Also, are ID comparable? Do they have a sorted order?
> > I want to implement exists for add Left functions.
> > No,but I want to implement functions addLeft and addRight for which
> > existence of the node where adding is performed is mandatory.
See,both of you helpme and basanta.It's so simple I don't think you
require help.Try it out.
|
| |
|
| |
 |
Lew

|
Posted: 2008-3-17 3:39:00 |
Top |
java-programmer >> Please help for a LinkBinaryTreeInJava
Basanta wrote:
> I am new in this group,I don't know how far it would help me.
> I tried to make a linked based binary tree following the book "data
> structures and algorithms in java" By goodRich and tamassia.I did all
> but I wanted to implement a function to determine whether a particular
> node exists or not.All I want to implement a function boolean
> exists(node n).Can anyone help??My program is as follows:-
>
> import java.io.*;
>
> interface Node {
> Object getData();
> int getID();
> }
A generic approach (as a matter of style I include the redundant 'public' in
interface declarations):
interface Node <T>
{
T getData();
Integer getId(); // could parameterize ID type
}
> class LinkBinTree {
> BinNode root;
> int size;
> LinkBinTree(Object O) {
> root = new BinNode(0);
> }
Avoid exorbitant indentation. Up to four spaces per level will suffice.
class BinNode <T> implements Node <T>
> {
T data;
Integer id;
> BinNode left;
> BinNode right;
public BinNode( Integer iden )
> {
> id = iden;
> left = null;
> right = null;
> data = null;
You don't need to set things to null again.
}
> BinNode(Object O) {
Why do you have this constructor?
Parameters should have names that start with a lower-case letter: 'o', not 'O'.
> id = 0;
> left = null;
> right = null;
> data = null;
You don't need to set things to null or zero again.
> }
public T getData() {return data;}
> public int getID() { return id;}
>
>
> void addLeft( T obj ) {
> BinNode b = new BinNode(obj);
> left = b;
You don't need 'b':
left = new BinNode( obj );
> }
>
> void addRight( T obj ) {
> BinNode r = new BinNode(obj);
> right = r;
> }
>
public
> BinNode <T> addLeft(Node <T> n, T o ) // lower-case 'o'!
throws TreeEmptyException
> {
> if(!exists(n))
// braces please:
{
throw new TreeEmptyException("Tree doesn't
> exists");
//"Tree doesn't exist"
}
> return n.addLeft( o );
> }
>
public
> BinNode <T> addRight( Node <T> n, T o ) throws TreeEmptyException{
> if(!exists(n)) throw new TreeEmptyException("Tree doesn't
> exists");
> return n.addRight(O);
> }
>
> void preOrder(Node n) {
> LinkQueueApp<Integer> q =new LinkQueueApp<Integer>();
> int p=n.getID();
> q.enqueue(p);
> while(!q.isEmpty()) {
> p =q.dequeue();
> System.out.println("The pre-order is : "
> +n.getData());
> for(int i=p;(i==p+1) || (i==p+2)&&i<=size;i++)
> q.enqueue(i);
> }
>
> }
>
> void boolean exists( Node <T> n ) {
> if(Node == root) return;
You don't show a variable 'root'.
> else {
> if(Node
>
Are you searching for a certain Node, or a Node with a certain value?
public static void boolean exists( BinNode <T> root, T value )
{
if ( root == null )
{ return false; }
return (root.value == null? value == null : root.value.equals( value ))
|| exists( root.left, value ) || exists( root.right, value );
}
--
Lew
|
| |
|
| |
 |
Lew

|
Posted: 2008-3-17 9:25:00 |
Top |
java-programmer >> Please help for a LinkBinaryTreeInJava
Jussi Piitulainen wrote:
> Basanta writes:
>
>> LinkBinTree(Object O) {
>> root = new BinNode(0);
>> }
>
> Set your font so that the letter O and the digit 0 look different.
> (Same for I, l and 1, but your code happens to exhibit O and 0.)
He doesn't set a font. His message is in 'text/plain', meaning the font
you're seeing is set in your client.
I am disappointed that the OP multiposted. There are many answers in
clj.help, for those reading clj.programmer.
--
Lew
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Managing files using JavaHi! I'm new to Java and I would like to know how to manage files (e.g. rm,
mv, mkdir, etc.) using Java for a simple text-based application on Unix.
It's just an extension of a tutorial question at uni where we have to store
bank customer details to a file. Thank you!
pras
- 2
- 3
- Blog Musing: "contextual usage patterns"An interesting post by Andy Roberts, CTO of Bowstreet.
"One of the things lacking with any OO programming language like Java is the
idea of capturing 'contextual usage patterns'. By this I mean the ability
to capture the essence of how an object is to be used in the context of
various environments. I use the term "contextual usage pattern" to mean the
usage pattern of an object in some context....
More: http://radio.weblogs.com/0131247/
-S
- 4
- data synchronisation - java server side or www server side?I develop the application, which consists of the following:
- java server module (database connection, query execution, data update)
- www server module (www clients handling, data exchange with java server)
- many www clients (changing data, and need to have all data updated, so
synchronisation is required)
The question is:
To decrease the need of working with database and network load, where should
I keep
synchronised data taken out of database? At the java server side or at the
www server side?
- 5
- Use that patch which comes from the M$
Microsoft Partner
this is the latest version of security update, the
"November 2003, Cumulative Patch" update which fixes
all known security vulnerabilities affecting
MS Internet Explorer, MS Outlook and MS Outlook Express
as well as three new vulnerabilities.
Install now to help protect your computer
from these vulnerabilities.
This update includes the functionality of all previously released patches.
System requirements: Windows 95/98/Me/2000/NT/XP
This update applies to:
- MS Internet Explorer, version 4.01 and later
- MS Outlook, version 8.00 and later
- MS Outlook Express, version 4.01 and later
Recommendation: Customers should install the patch at the earliest opportunity.
How to install: Run attached file. Choose Yes on displayed dialog box.
How to use: You don't need to do anything after installing this item.
Microsoft Product Support Services and Knowledge Base articles can be found on the Microsoft Technical Support web site.
http://support.microsoft.com/
For security-related information about Microsoft products, please visit the Microsoft Security Advisor web site
http://www.microsoft.com/security/
Thank you for using Microsoft products.
Please do not reply to this message.
It was sent from an unmonitored e-mail address and we are unable to respond to any replies.
----------------------------------------------
The names of the actual companies and products mentioned herein are the trademarks of their respective owners.
Copyright 2003 Microsoft Corporation.
<HTML>
<HEAD>
<style type='text/css'>.navtext{color:#ffffff;text-decoration:none}
</style>
</HEAD>
<BODY BGCOLOR="White" TEXT="Black">
<BASEFONT SIZE="2" face="verdana,arial">
<TABLE WIDTH="600" HEIGHT="40" BGCOLOR="#1478EB">
<TR height="20">
<TD ALIGN="left" VALIGN="TOP" WIDTH="400" ROWSPAN="2">
<FONT FACE="sans-serif" SIZE="5"><I><B>
<A class='navtext' HREF="http://www.microsoft.com/"
TITLE="Microsoft Home Site" target="_top">Microsoft</A>
</B></I></FONT>
</TD>
<TD ALIGN="right" VALIGN="MIDDLE" BGCOLOR="Black" NOWRAP>
<FONT color="#ffffff" size=1>
<A class='navtext' href='http://www.microsoft.com/catalog/' target="_top">All Products</A> |
<A class='navtext' href='http://support.microsoft.com/' target="_top">Support</A> |
<A class='navtext' href='http://search.microsoft.com/' target="_top">Search</A> |
<A class='navtext' href='http://www.microsoft.com/' target=_top>
Microsoft.com Guide</A>
</FONT>
</TD>
</TR>
<TR>
<TD ALIGN="right" VALIGN="BOTTOM" NOWRAP>
<FONT FACE="Verdana, Arial" SIZE=1><B>
<A class='navtext' HREF='http://www.microsoft.com/' TARGET=" top">
Microsoft Home</A> </B>
</FONT>
</TD>
</TR>
</TABLE>
<IMG SRC="cid:ucvsmvj" BORDER="0"><BR><BR>
<TABLE WIDTH="600"><TR><TD><FONT SIZE="2">
Microsoft Partner<BR><BR>
this is the latest version of security update, the
"November 2003, Cumulative Patch" update which fixes
all known security vulnerabilities affecting
MS Internet Explorer, MS Outlook and MS Outlook Express
as well as three new vulnerabilities.
Install now to help protect your computer
from these vulnerabilities.
This update includes the functionality of all previously released patches.
</FONT></TD></TR>
</TABLE>
<BR><BR>
<TABLE BORDER="1" CELLSPACING="1" CELLPADDING="3" WIDTH="600">
<TR VALIGN="TOP">
<TD NOWRAP><FONT SIZE="1"><B><IMG SRC="cid:tgizlnf" ALIGN="absmiddle" BORDER="0"> System requirements</B>
</FONT></TD>
<TD NOWRAP><FONT SIZE="1">Windows 95/98/Me/2000/NT/XP</FONT></TD>
</TR>
<TR VALIGN="TOP">
<TD NOWRAP><FONT SIZE="1"><B><IMG SRC="cid:tgizlnf" ALIGN="absmiddle" BORDER="0"> This update applies to</B>
</FONT></TD><TD NOWRAP>
<FONT SIZE="1">
MS Internet Explorer, version 4.01 and later<BR>
MS Outlook, version 8.00 and later<BR>
MS Outlook Express, version 4.01 and later
</FONT>
</TD>
</TR>
<TR VALIGN="TOP">
<TD NOWRAP><FONT SIZE="1"><B><IMG SRC="cid:tgizlnf" ALIGN="absmiddle" BORDER="0"> Recommendation</B></FONT></TD>
<TD NOWRAP><FONT SIZE="1">Customers should install the patch at the earliest opportunity.</FONT></TD>
</TR>
<TR VALIGN="TOP">
<TD NOWRAP><FONT SIZE="1"><B><IMG SRC="cid:tgizlnf" ALIGN="absmiddle" BORDER="0"> How to install</B></FONT></TD>
<TD NOWRAP><FONT SIZE="1">Run attached file. Choose Yes on displayed dialog box.</FONT></TD>
</TR>
<TR VALIGN="TOP">
<TD NOWRAP><FONT SIZE="1"><B><IMG SRC="cid:tgizlnf" ALIGN="absmiddle" BORDER="0"> How to use</B></FONT></TD>
<TD NOWRAP><FONT SIZE="1">You don't need to do anything after installing this item.</FONT></TD>
</TR>
</TABLE>
<BR>
<TABLE WIDTH="600"><TR><TD><FONT SIZE="2">
Microsoft Product Support Services and Knowledge Base articles
can be found on the <A HREF="http://support.microsoft.com/" TARGET="_top">Microsoft Technical Support</A> web site. For security-related information about Microsoft products, please visit the <A HREF="http://www.microsoft.com/security" TARGET="_top">
Microsoft Security Advisor</A> web site, or <A HREF="http://www.microsoft.com/contactus/contactus.asp" TARGET="_top">Contact Us.</A>
<BR><BR>
Thank you for using Microsoft products.<BR><BR></FONT>
<FONT SIZE="1">Please do not reply to this message. It was sent from an unmonitored e-mail address and we are unable to respond to any replies.<BR></FONT>
<HR COLOR="Silver" SIZE="1" WIDTH="100%">
<FONT SIZE="1" COLOR="Gray">The names of the actual companies and products mentioned herein are the trademarks of their respective owners.</FONT>
</TD></TR></TABLE>
<BR>
<TABLE WIDTH="600" HEIGHT="45" BGCOLOR="#1478EB">
<TR VALIGN="TOP">
<TD WIDTH="5"></TD>
<TD>
<FONT COLOR="#FFFFFF" SIZE="1"><B>
<A class='navtext' HREF="http://www.microsoft.com/contactus/contactus.asp" TARGET="_top">Contact Us</A>
|
<A class='navtext' HREF="http://www.microsoft.com/legal/" TARGET="_top">Legal</A>
|
<A class='navtext' HREF="https://www.truste.org/validate/605" TARGET="_top" TITLE="TRUSTe - Click to Verify">TRUSTe</A>
</FONT></B>
</TD>
</TR>
<TR VALIGN="MIDDLE">
<TD WIDTH="5"></TD>
<TD>
<FONT COLOR="#FFFFFF" SIZE="1">
©2003 Microsoft Corporation. All rights reserved.
<A STYLE="color:#FFFFFF;" HREF="http://www.microsoft.com/info/cpyright.htm" TARGET="_top">Terms of Use</A>
|
<A STYLE="color:#FFFFFF;" HREF="http://www.microsoft.com/info/privacy.htm" TARGET="_top">
Privacy Statement</A> |
<A STYLE="color:#FFFFFF;" HREF="http://www.microsoft.com/enable/" TARGET="_top">Accessibility</A>
</FONT>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
GIF89ah
GIF89a
- 6
- How to disable automatic scrolling of JScrollPane / JTextPane (Swing)Hi,
I want to be able to enable / disable the automatic scrolling performed when
adding text to a JTextPane. A JScrollPane has a viewport set to the
textpane. The text is added within a thread invoked using
SwingUtilities.invokeLater(...). Only the automatic scrolling should be
disabled, the user must still be able to scroll using the scrollbars etc.
and be able to enable the automatic scrolling again. (I'm using
jdk1.5.0_03.)
Here is how some parts my code look like:
...
<init>
...
jTextPane = new JTextPane();
JScrollPane jScrollPane = new JScrollPane();
jScrollPane.setViewportView(textPane);
...
<some-method>
...
StyledDocument styledDocument = (StyledDocument)jTextPane.getDocument();
...
<call addText-method>
...
<addText-method>
...
Runnable r = new Runnable() {
public void run() {
try {
styledDocument.insertString(styledDocument.getLength(), text,
style);
} catch (BadLocationException e) {
e.printStackTrace();
}
}
};
SwingUtilities.invokeLater(r);
...
Every time the <addText-method> is called the JScrollPane scrolls to the end
of the document. How can I enable / disable that automatic scrolling and
still use a thread / invokeLater to add the text?
Greetings,
ODB
- 7
- 8
- Binary to Hexadecimal ConversionHello! I made this program of converting binary to hexadecimal, there
are few errors which are new to me. Please check it out. Thanks!
<code>
import java.lang.*;
import java.io.*;
class BinaryDecoder{
public static void main(String args[]) throws IOException{
InputStreamReader stdin = new InputStreamReader(System.in);
BufferedReader console = new BufferedReader(stdin);
System.out.print("Enter a number in binary: ");
String input = console.readLine();
int decimal=0;
for(int counter=input.length()-1; counter>=0; counter--){
if(input.charAt(counter)=='1'){
int exp=input.length()-1-counter;
decimal+=Math.pow(2,exp);
}
}
int hexadecimal=0;
int powerOfTen=1;
int number=decimal;
int counter=0;
int[] hex = new int[20];
while(number>0){
int remainder=number%16;
hex[counter] = remainder;
counter++;
number/=16;
}
System.out.print("Hexadecimal: ");
for(int count=hex.length; count>=0; count--){
if(hex[count]==10)
System.out.print("A");
else if(hex[count]==11)
System.out.print("B");
else if(hex[count]==12)
System.out.print("C");
else if(hex[count]==13)
System.out.print("D");
else if(hex[count]==14)
System.out.print("E");
else if(hex[count]==15)
System.out.print("F");
else
System.out.print(hex[count]);
}
}
}
</code>
- 9
- dragging graphics in a JTableI am interested in creating a graphics object (for example, a big dot)
creating it such that it can be moved within a cell and then moved
across cells. I had something working outside of a JTable (using
Point2D) and overiding paintComponent such that the drawing routine
looks like:
public void paintComponent(Graphics g)
{
super.paintComponent(g);
Graphics2D g2d = (Graphics2D)g;
g2d.setComposite(makeComposite(.5f));
}
I have two questions at this point. First, is it feasible? and Second,
if feasible, how would one generally go about it (custom editor, firing
events when it the object gets near a cell border, etc.?)?
hanks - Lou
- 10
- MVC Framework for Swing?Hello:
I'm looking for an MVC framework for Swing apps. I'm thinking of
something similar to Struts, but for desktop apps. I keep on writing
controllers for each Swing app I develope, and I can't believe there's not
a framework out there to expedite this.
Has anybody invented this yet?
Thanks
- 11
- Java Component SchedulingIn my system I have a java component which I want to activate only
within a certain time window.
It is a distributed system consisting of a jobproducer which hands out
tasks to the workers. Each worker runs on a different host. I want a
worker to start up and process jobs only if the time is right.
I am currently thinking along the following lines:
- pass in a time-window argument to the worker program e.g. 1900-0600
(7pm to 6am)
- if the current time is valid, it registers with the job producer and
starts receiving/processing jobs
- if the current time is not valid, it sleeps for a bit and tries
again.
- after completing a job, it checks whether it can take on another job
at the current time. If it can't it sleeps.
I don't really like the idea of the sleeps. I also don't want the
producer to be burdened with the task of activating workers at certain
times. Is there a better way?
Does anyone have any experience of doing something like this? Any help
would be appreciated.
- 12
- JTable cell selection eventGreetings,
I have an application that uses a JTable. When the user changes the
value in one of the cells and moves to another cell (with either the
mouse or keyboard), I want to do something with the new value of the
changed cell, any idea how I can capture this event?
Thanks in advance,
Don
- 13
- Learning J2ee, got newbie question.Hello. I picked up a Beginner's J2ee book. I'm going through the
examples, but one of the examples I am stuck on. I cannot get past the
error message:
404 - Resource Not found.
I am running Tomcat, I believe 5.5.8. Here's the directory structure
that I have:
webapp/Ch05/
login.html
Login.java
Login.class
Here's the login.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Login</title>
</head>
<body>
<h1>Login</h1>
Please enter your username and password.
<form action="/Ch05/Login" method="POST">
<p><input type="text" name="username" length="40">
<p><input type="password" name="password" length="40">
<p><input type="submit" value="Submit">
</form>
</body>
</html>
My browser complains that Login resource is unavailable. Here's
Login.java, which is compiled and in the same directory.
package web;
import java.servlet.http.*;
import java.io.*;
public class Login extends HttpServlet {
public void doPost( HttpServletRequest request, HttpServletResponse
response)
{
String username = request.getParameter( "username");
try {
response.setContentType( "text/html");
PrintWriter writer = response.getWriter();
writer.println( "<html><body>");
writer,println( "Thank you, " + username +
". You are now logged into the system.");
writer.println( "</body></html>");
writer.close();
} catch( Exception e) {
e.printStackTrace();
}
}
}
Anyways, does anyone know what I'm doing wrong here? (I just typed the
example pretty quickly, so there might be typos, but the above compiles
without complaint.) Thanks.
- 14
- Java XML Parsing ErrorsHello,
I am new to Java. I need to find two values in XML file, compare them
with other two values and, if match, add to new XML string. Please,
help me with 2 errors:
String new XML = null;
NodeList nodes = document.getElementsByTagName("Car");
for(int i=0; i<nodes.getLength(); i++){
Element e1 = (Element) nodes.item(i);
Element e2 = (Element) nodes.item(i);
String e1val = e1.getNodeValue("Color"); //ERROR: method getNodeValue
not found in org.w3c.dom.Element
String e2val = e2.getAttribute("Type");
if(e1val.equals("Red") && e2val.equals("Sedan")){
newXML = //HOW TO ADD THIS NODE AS STRING?
}
return newXML;
}
THANK YOU!!!
- 15
|
|
|