| Something a bit goofy about Generics |
|
 |
Index ‹ java-programmer
|
- Previous
- 2
- Nunni FSM Generator v. 1.1 released!NunniFSMGen v. 1.1 has been released on August 12th 2004
NunniFSMGen is Open Source and comes with GPL license.
http://nunnifsmgen.nunnisoft.ch/en/home.jsp
NunniFSMGen is a java tool that starting from a transition table
generates the corresponding FSM (Finite State Machine) in Java, C
or C++ source code. It has been developped in 2003 at NunniSoft
for generating the FSMs of our own software and successfully used
(here at NunniSoft) since it's first internal release (in June 2003).
Changes since 1.0.3
- generation of C code is now more optimized for size
- some clean up
NunniFSMGen has also been used to develop two other Open
Source projects, distributed under the LGPL licence:
NunniMJAX http://nunnimjax.nunnisoft.ch/en/home.jsp
and
NunniMCAX http://nunnimcax.nunnisoft.ch/en/home.jsp
The above are two minimal and lightweight libraries for
parsing XML. The first is written in Java, the sencond in C.
Best regards.
--
Roberto Nunnari -software engineer-
mailto:email***@***.com
Residenza Boschetto 12 tel/fax: +41-91-6046511
6935 Bosco Luganese """ mobile: +41-76-3208561
Switzerland (o o)
========================oOO==(_)==OOo========================
- 3
- PAAppViewer3 (AppViewer3)?Hello,
Might anyone please kindly answer my question? Thank you very
much.
I can't read the result of performing bootstrapping in Amos 6.0.
In the Amos text output, on the left hand side, there are two
sections. The lower section is the result of performing bootstrap,
including estimates/bootstrap, estimates of bootstrap standard error,
estimates of bias-corrected percentile method.
However, I can't read any of them. Nothing shows up.
Also, I find this message,
Error number: 70
Source: PAAppViewer3 (AppViewer3)
Description: Permission denied
Call stack: frmMain hdoc_ onmouseover
How can I be able to read the result of performing bootstrapping in
Amos 6.0.?
Thank you very much and look forward to your kind reply.
Please take care
Best wishes to your life
Caroline
- 4
- 9
- run Client and the server on two different machine!! it doesen't work!!Hi,
I am trying to execute my Corba/Java program with the Client on one
machine and the server on another (things work
fine on a single machine).
-------------------------------------
- tnameserv -ORBInitialPort 1500
- java Server -ORBInitialPort 1500 -ORBInitialHost htest
- java Client -ORBInitialPort 1500 -ORBInitialHost htest
----------------
I've tried running tnameserv on the server only."htest" is the
servermachinename!!
But any attempt to use the name service results in the error :
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed:
No
at
com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:148)
at
com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:65)
at
com.sun.corba.se.internal.iiop.GIOPImpl.getConnection(GIOPImpl.java:67)
at
com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:652)
at
com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:594)
at
com.sun.corba.se.internal.corba.ClientDelegate.request(ClientDelegate.java:886)
at org.omg.CORBA.portable.ObjectImpl._request(ObjectImpl.java:431)
at
org.omg.CosNaming._NamingContextExtStub.resolve_str(_NamingContextExtStub.java:156)
at Test.Client.main(Client.java:48)
Any ideas on what is missing??????
thanks
Tina
- 10
- JNI Trouble calling FindClass from Worker threadHello
I am able to get the class object when i call FindClass in the main
thread. Now when i spawn a worker thread and attempt the same call
after caching the JVM and creating a new Env . it fails and triggers an
exception on the Java side .
My code for a DLL looks like this
JMVM *jvm = NULL ;
..
DLLMain()
{
}
JNIEXPORT jint JNICALL Initialize
(JNIEnv *pEnv, jclass)
{
pEnv->GetJavaVM(&jvm);
ASSERT(jvm!=NULL);
jclass cls = pEnv->FindClass("demoflashplugin/views/Objfactory");
if(cls!=NULL)
AfxMessageBox("cls found");
AfxBeginThread(WindowThread , NULL);
}
UINT WindowThread(LPVOID p)
{
JNIEnv *env = NULL ;
jclass cclass ;
if(jvm!=NULL)
{
if (0==jvm->AttachCurrentThread((void**)&env,NULL))
{
if ((env)->ExceptionOccurred()) {
AfxMessageBox("Exception occured");
(env)->ExceptionDescribe() ;
}
if(env!=NULL)
{
AxMessageBox(getenv("CLASSPATH"));
cclass = env->FindClass(demoflashplugin/views/Objfactory");
if(cclass!=NULL)
{
AfxMessageBox("Class is not Null");
}
else
AfxMessageBox("Class is s Null");
}
else
{
AfxMessageBox("env is NULL ");
}
AfxMessageBox("Finished checking for string");
}
else
{
AfxMessageBox("JVM IS Null");
}
}
}
- 10
- -Xmx---m getting smaller and smallerHi,
I have Windows XP SP3 with 4GB memory (I know Windows only allows apps to use
about 3.25GB.) I have no applications running. I ran System Mechanic 7 to
defrag the memory with the result of the largest contiguous block of memory
being 2.74GB.
However, everytime I started Eclipse 3.3.2, the JRE 1.6.0_04 JVM terminated
with a -1 code. I started at -Xmx1024m and continually decremented until I
reached -Xmx600m when Eclipse started okay. This morning I was running
Eclipse with -Xmx900m okay.
The only changes I made were to (1) set the system variable JAVA_HOME to
reference JDK 1.6.0_04 and replaced java.exe, javaw.exe, javaws.exe in c:
\WINDOW\System32\ with the JRE 1.6.0_04 files. They were 1.4.2_07.
Does anyone have any idea why the JVM terminates because of not enough memory
when there is more than enough contiguous memory? This is really
frustrating.
Thank you,
Don
- 10
- Getting the references of all the instantiated classes in my programHi All,
I want to do something like the following: Say I have an Auctioneer and a
Bidder class and then in my program I write:
a1=new Auctioneer(blah blah blah);
b1= new Bidder(blah blah blah);
b2= new Bidder(blah blah blah);
Is there a way I can get a list of references for the objects? I would
like to have an array with a1,b1,b2 as references. Is that possible?
I look forward to hearing from you soon.
Thanks,
Dil
- 11
- RMI first stepHello,
For testing purpose, I'm trying to use RMI...
Here is the exception when I run Main.java :
Exception in thread "main" java.security.AccessControlException: access
denied (java.net.SocketPermission 192.168.0.1:1099 connect,resolve)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java
:264)
at
java.security.AccessController.checkPermission(AccessController.java:427)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1034)
at java.net.Socket.connect(Socket.java:501)
at java.net.Socket.connect(Socket.java:457)
at java.net.Socket.<init>(Socket.java:365)
at java.net.Socket.<init>(Socket.java:178)
at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketF
actory.java:22)
at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketF
actory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569)
at
sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at testRMI.Main.main(Main.java:28)
(jdk1.5.0_01 - Win2000Pro - no firewall)
What am I doing wrong ?
Thanks for your help,
Martin.
The code :
===================================================================
Main.java :
package testRMI;
import java.net.MalformedURLException;
import java.rmi.AlreadyBoundException;
import java.rmi.Naming;
import java.lang.SecurityException;
import java.rmi.RMISecurityManager;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
public class Main extends UnicastRemoteObject implements Meeting
{
private String ivDate = new String("25/3/2005");
private static final long serialVersionUID = 1;
public Main() throws RemoteException {
}
public String getDate() throws RemoteException {
return ivDate;
}
public static void main(String[] args) throws
AlreadyBoundException,RemoteException,
MalformedURLException,SecurityException {
System.setSecurityManager(new RMISecurityManager());
Main ms = new Main();
Naming.rebind("rmi://192.168.0.1/Meeting",ms);
}
}
===================================================================
Meeting.java
package testRMI;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface Meeting extends Remote
{
public String getDate() throws RemoteException;
}
===================================================================
ClientRMI.java
package testRMI;
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RMISecurityManager;
import java.rmi.Remote;
import java.rmi.RemoteException;
public class ClientRMI
{
public static void main(String[] args)
throws RemoteException, MalformedURLException,NotBoundException {
System.setSecurityManager(new RMISecurityManager());
Remote r = Naming.lookup("rmi://192.168.0.1/Meeting");
String s = null;
if(r instanceof Meeting)
{
Meeting ms = (Meeting)r;
s = ms.getDate();
}
System.out.println(s);
}
}
===================================================================
- 11
- change defaultsHi,
How do you change the default font for all components ( frame, label, etc )
in swing ?
regards
Johan
- 14
- debrisW a t c h o u t!
ALLIACNE ENTERPRSIE (A ETR)
Currnet Prcie: 0.80
Add this g e m to your w atch list, and w atch it tard closely!
Nwes Releaes!
Taeocrp announces breackrough in removing deadly l andmines.
Mill Valley, California August 25, 2006 - The Alliance Etnerprise Corpoartion announced today a breakthrough in developing an Areial Lnadmine Sysetm aimed at locating, detecting and mapping deadly landm ines.
TeaCorp's mission is to reclaim lands around the globe embedded with l andmines that victimize countries and their stakeholders.
More than 100 m i l l i o n landm ines in 83 countries are holding international communities and industries hostage, preventing the inv estment in and development of product ive lands and the re-building of infrastructure. A broad variety of landmine s have been scattered over pro ductive areas effectively crippling the eco nomy and disabling thousands of children and adults. There are no reliable records that accurately show where these d e v a s t a t i n g landmine s lie in wait for their v ictims.
With the present day c osts to clear a single land mine ranging between $1,000 to $1,500, solving the problem of de-mining lands will reach billions of dol lars. TaeCorp has developed a technology based, cos t effective solution to this problem using its three tiered approach to scanning, mapping and removing la ndmines. TaeCorp's System will provide many social and eco nomic benef its to countries and their industries including oil and gas, mining, agriculture, roads and infrastructure development.
About TaeCorp.
TaeCorp's vision is to be the recognized leader in providing Aeiral Deteciton Systmes including global de-mining, clearing a path to a safer planet for all humankind.
Here comes the big one!
All signs show that AET R is going to Explode!
Concl usion:
The examples above show the awesome, earning potential of little known companies that explode onto invesotr's radar screens; Many of you are already familiar with this. Is A ETR poised and positioned to do that for you? Then you may feel the time has come to act... And please watch this one trdae tomorrow! Go AE TR.
Pen ny sotcks are considered highly speculative and may be unsuitable for all but very aggressive investros. This prof ile is not in any way affil iated with the featured company. This report is for entertainment and advertising purposes only and should not be used as invesmtent advice. If you wish to stop future m a i lings, or if you feel you have been wrongfully placed in our membership, send a blank e m a i l with No Thanks in the subject to
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 14
- 16
- java.util.logging for Java 1.3.1Being stuck in Java 1.3 becuase of application vendors, I would love to
have a backwards port of java.util.logging libraries to 1.3.
Has anybody out there have such a port?
Thanks,
Tim
- 16
- JProgressBar Flickering!Hi everyone! I just have a little question here!
I have a Swing GUI in which I put a JProgressBar.
I also have a static class where I put a static variable JProgressBar.
In my main program, because the static methods are time consuming, I
start a new thread, where I initialize the static JProgressBar with the
one in main gui.
So I'm able to update the text, value, etc in the GUI without locking
my main program.
The problem is:
I put progression report [ progressBar.setValue(int) ] in my loops to
see the change. It works perfectly BUT!!!
Every time it sets a new value, the progress bar show a lot of
flickering! I enabled double buffering on it, but no effect!
How can I remove this bad effect??? If some knows please tell me quick
:)
Thanks,
Ad
- 16
- Circular linked listHi
I'm looking for a circular linked list implementation.
Any references appreciated.
Cheers
Sharp
- 16
- Proposal. Sort should return a boolean.Here is an idea. I would like it if Collections. sort and Arrays.sort
would return a boolean. true means something actually changed. false
means the array was already in order.
Further there would be an additional boolean parameter to the sort to
say "items probably already in order". The sort would then do a quick
check to make sure the items were in order, and if so, bypass the full
sort.
This would be useful when you have to avoid needlessly calling
fireTableDataChanged after a sort.
It would also allow you to use sorts in an assert to ASSURE the data
are already sorted, and explode if they are not already sorted.
Since the sort is void now, all existing code would still work. You
would just have an additional method call with the optional boolean
parameter, or perhaps only in would get the boolean return.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
|
| Author |
Message |
Roedy Green

|
Posted: 2007-10-25 22:27:00 |
Top |
java-programmer, Something a bit goofy about Generics
Iterable<? extends JavaFileObject>
You'd think a JavaFileObject[] or a JavaFileObject... would fullfil
that requirement, but it doesn't. It fills it sufficiently to do a
for:each but not to satisfy this parameter.
That is like a piece of purple lint on a white sweater.
People say arrays and generics don't mix, but they damn well SHOULD.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
|
| |
|
| |
 |
The Ghost In The Machine

|
Posted: 2007-10-26 2:12:00 |
Top |
java-programmer >> Something a bit goofy about Generics
In comp.lang.java.advocacy, Roedy Green
<email***@***.com>
wrote
on Thu, 25 Oct 2007 14:27:03 GMT
<email***@***.com>:
>
> Iterable<? extends JavaFileObject>
>
> You'd think a JavaFileObject[] or a JavaFileObject... would fullfil
> that requirement, but it doesn't. It fills it sufficiently to do a
> for:each but not to satisfy this parameter.
>
> That is like a piece of purple lint on a white sweater.
>
> People say arrays and generics don't mix, but they damn well SHOULD.
A workaround, of course, is passing in
Arrays.asList(p)
where p is JavaFileObject[].
I agree that it's a blemish, though.
--
#191, email***@***.com
GNU and improved.
--
Posted via a free Usenet account from http://www.teranews.com
|
| |
|
| |
 |
Daniel Pitts

|
Posted: 2007-12-20 4:19:00 |
Top |
java-programmer >> Something a bit goofy about Generics
Roedy Green wrote:
> Iterable<? extends JavaFileObject>
>
> You'd think a JavaFileObject[] or a JavaFileObject... would fullfil
> that requirement, but it doesn't. It fills it sufficiently to do a
> for:each but not to satisfy this parameter.
>
> That is like a piece of purple lint on a white sweater.
>
> People say arrays and generics don't mix, but they damn well SHOULD.
The truth is that the for:each construct takes *either* an array or an
Iterable.
I agree, Generics and Arrays should mix. Although, Arrays are
"primitives", and should not be "obsessed" over.
--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Printing EPS (embedded postscript) from Java.
Hello all,
I need to print .eps (also called .epsf, .epi, .epsi) from inside a
java program. My target platforms are windows and mac-- although
windows is first.
The new 1.4 printing API has aupport for printing normal postscript
but does not have .eps support.
I've been looking around the internet to see what solutions people
have come up with and unfortonately I didn't get what I would call a
solid answer by doing this....
I looked at the source of two open source programs the support .eps.
They both have origianal source but esstenially did it almost exactly
the same way. They took the .ps file the the standard Java classes
generated and just stuck an .eps header on it. They then stick the .ps
inside a box as required. They then searched the .ps file for commands
that are illegal in the .eps and if they are there they just die.
I've got some serious problems with this:
(1) It assumes that the Sun classes are going to generate a .ps that
is easily converted to an eps. Maybe they do now but what about future
versions of Java?
(2) It makes big assumptions about future .ps and .eps formats.
(3) It stinks of just being a hack. Does anyone really know this is
going to work all the time and on all platforms?
Does anyone have any experience with making .eps from Java that has
any sugestions? I want to translate my Garphics2D objects to .eps. I
want the .eps to be accepted by major publishing programs on windows and
mac.
Thanks
Glen Pepicelli,
http://www.glenp.net
(reply to group)
- 2
- Check class file for annotationDoes anyone know of a simple way to determine whether a marker
annotation is present in a given class file?
TIA
--
========================================================================
Ian Pilcher email***@***.com
========================================================================
- 3
- Swing Worker Pause/ResumeHello all,
I am dealing with a class that extends SwingWorker and Inside that
class there is another class defined. I'll refer to the inside define
class as the "helper class" for sake of clarity.
What i am try to do is to pause/resume the class that extends
SwingWorker, when i used flags to do that it outputed errors from the
"helper class". These errors came from a method that fires Custom
Events and they were NullPointerExceptions. After the errors were
printed the classes continued executing.
How can i pause/resume successfully ?
Thanx in advance for any help :D
Ahmed Ashmawy
- 4
- sentmail problemhi
i am doing a project using JavaMail API with JSP and James server
i have implemented sendmail,compose. but i wanna know how can i
implement sentmail as it is seen in the real application.
I wanna know what can i should do to retrieve the mails sent from an
account using James
- 5
- [ANN] SwingEmpire FormBuilder - New Preview 0.9.4
SwingEmpire FormBuilder helps in quickly building GUIs with JGoodies
Forms.
The new/updated features include:
* pluggable custom layout styles for grid elements and borders
* enhanced support of custom component factories
The preview is available at
http://www.swingempire.de/palace/FormBuilder
For your convenience a summary of "old" features
* rapid visual design of form-oriented GUIs
* targeted on JGoodies Forms
* re-usable layout data
* immediate preview in choosable LookAndFeels
* persisting layout data separated from application code
* persisting via standard XMLEncoder
* pluggable custom components
* pluggable persistence format
Test and (hopefully :-) enjoy - I'm eagerly awaiting your feedback.
Regards
Jeanette Winzenburg, Berlin
- 6
- Java Training QuestionI am an unemployed web developer with php, perl, and asp programming
experience and in order to be able to widen my job search I am considering
getting some formal training in Java. I am looking for training
recommendations in order to be able to do Java web development. Also will
this training be appealing to prospective employers or just a waste of my
time and money. Any feedback I get will be greatly appreciated.
- 7
- JTable(A few more queries )I had a couple of more queries -
1) how to prevent swapping of the columns as in, by default the columns
in the JTable are not fixed in terms of their placement. They can be
very well swapped with one another. I want to prevent this.
2) Also after feeding the JTable with the data in database, i want to
be keep one row always empty so that a row can be inserted. It's like
we have in MS-Access.
hope i was clear in explaining the query properly.
Thanx,
Ankur
- 8
- Clients are bad ?Hello John Bailo , You say :
" Open source is just about old style client software
catching of to the Web economy "
You obviously don't believe that yourself ,
otherwise you'd be using Google ... Not Moz .
- 9
- Applet using jdbc (ms sqlserver)Hi,
After reading lots of docs, a got the impression that it is possible to
write an Java Applet, that uses jdbc to connect to MS SQLServer (Without
flushing all security permissions down to drain).
Here is what I've done:
1. Downloaded the Microsoft JDBC driver for SQL Server 2000 SP 3.
2. Downloaded the app from Microsoft's site:
http://support.microsoft.com/default.aspx?scid=kb;en-us;313100
3. Tried to compile.
I get the java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC]Error establishing socket.
I have tested every possible error that I can find in MS's site. I have
tried to alter policies granting "permission java.net.SocketPermission",
with no luck. I think that before granting this permission, I also got
some security exceptions..
So here's my question: is it possible to create an applet (UnTrusted)
that uses SQL server, that can be run in browser, that doesn't need any
security alternations?
Best Regards,
Mika
- 10
- looking for a Java decompilerHello!
Is there a good byte-code de-compiler in the ports? It does not
need to be fancy/GUI -- just a straghtforward .class->.java utility.
Thanks for any pointers. Thanks!
-mi
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 11
- Update of JProgressBarHi,
in my program i use a JProgressBar. I know, that i have to use another
Thread for updating the progressbar.
But with the following code it isn't working. What's wrong?
public class Parser1CheckVisitor{
int iCount = 0;
JFrameJRespCheck m_JFrameJRespCheck;
ResponseFile m_ResponseFile;
public Object visit(ASTrecord node, Object data) {
if (data != null) {
m_JFrameJRespCheck.jProgressBarPanelStatus.setMinimum(0);
m_JFrameJRespCheck.jProgressBarPanelStatus.setMaximum(m_ResponseFile.
m_iCount);
makeProgressThread().start();
for (iCount = 0; iCount < m_ResponseFile.m_iCount; iCount++) {
m_ChipFile.readRecord(iCount + 1);
data = node.childrenAccept(this, data);
}
}
return "OK";
}
Thread makeProgressThread() {
return new Thread() {
public void run() {
while (iCount != m_ResponseFile.m_iCount) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {}
m_JFrameJRespCheck.jProgressBarPanelStatus.setValue iCount);
//System.out.println(iCount);
}
}
};
}
}
- 12
- Little ProblemI have three numbers - 1, 2 & 3.
A randomly selected one of the three are stored in 'var1', and another
randomly selected one is in 'var2'.
How do I find out the number that is left over?
I tried a while loop but I couldn't get it to work...
TIA
- 13
- 14
- how to do synchronization profiling and RepaintManager and performance issuesSome day ago I've posted about a problem with
javax.swing.SystemEventQueueUtilities.queueComponentWorkRequest
and some performance problem.
(http://groups.google.com/group/comp.lang.java.programmer/browse_frm/thread/afcd152d02c4d4cb/#)
My doubt is that the system spend too much time in symchronization
problems.
Someone suggested that it can be all the repaint stuff, but I've tried
to reduce it...(the paint component method in the reduced version is
something like
{ super.paintComponent..
draw an oval}
while in the complex versions is {
{ super.paintComponent..
draw 400 lines
draw 400 oval
}
and the first one takes the 20% of resources while the last the 40%
Moreover the time spent in the paint method is less and the repaint
manager should be decoubled from the component...
so how can I do a better profiling of the system?
I was thinking to override the repaint method and using directly the
invoke later paint..
but I'd like that the new method would be able to merge more call to
repaint in only one paint.. if the last paint hasnt stopped...
I hope that this info will sufficent, otherway askme
Thanks to all
Dimitri
- 15
- Programatically deducing VARCHAR2 length?Hi,
I'm using WebLogic 5.1 sp12 and Oracle 8.1.7 with JDBC 1.2 drivers.
I was wondering, if I know that a column is a vARCHAR2 column, how
could i deduce the maximum length of that column, short of repeatedly
inserting larger and larger strings until I genertae an exception. I
know with SQL*Plus I can describe the table and find out lengths that
way, but I was hoping for a more general automated method.
Thanks for any help anyone can provide - Dave
|
|
|