| JMF, FrameAccess, sound, faster processing |
|
 |
Index ‹ java-programmer
|
- Previous
- 3
- Action or Subclass method?I need to know which is the PROPER way of handling this situation:
I would like to be able to cascade all the JInternalFrames in a
JDesktopPane.
Should I create a
1) cascade() method in a subclass of JDesktopPane? or
2) create a CascadeAction (a subclass of AbstractAction) and pass a
reference of the JDesktopPane?
Both ways work. HOWEVER, which is the PROPER Object Oriented solution?
- 3
- How to listen out for a stream of data coming from (web)serverHello
I have an applet that connects to a server (same location as web server) and
connects to a server on a socket. This all works fine for sending commands
to this server. But the server can send data to the client at any moment in
time. So how do I listen out for the activity? do I launch a separate thread
that sits listening for incoming data?
What is the way to do it?
Angus
- 4
- for wanids: very enticing tunes - gudri wonhe - (1/1)On Tue, 06 Sep 2005 23:52:20 +0200, bone wrote:
> Hello all?
Oh, ..you too?
This sh*t is commonly known as SPAM. Stop it, before I
have to send the boys around.
--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"Who gave you the power? WE DID!!"
Alice Cooper 'Department of Youth'
- 4
- How to Fail at Software DevelopmentHello,
The book "How to Fail at Software Develoopment" is about all the
strange and funny things people do in the name of developing software.
I worked in software development for over 20 years and found silly
things that were being done in the name of software development were
being repeated again and again. As a matter of fact, most things that
cause software projects to fail are forever being repeated. And you
can spot the symptoms if you know what to look for.
Most people running software projects don't have much software
experience, so their inventions are usually not new. They rediscover
the same mistakes over and over again. It turned out to be a book of
very funny scenarios--some I lived through, and some were lived
through by others.
Those who don't know the history of software failure are doomed to
repeat it. You can find the book on Amazon or wherever.
Arthur Griffith
"How to Fail at Software Development"
http://www.anchorpointbooks.com
- 7
- Printing using CUPS in Linux and Java 1.5According to the blurb one of the upgrades in 1.5 is the ability to
print using CUPS in Linux. Does anyone have this working? I cannot get
my Jva application to communicate with CUPS.
Thanks,
Alan
- 7
- openGL java and X - server: a crashHy folks,
I didn't know exactly where to post, in the end I decided for this
forum, since we are talking about java, GL4java on linux environment.
We are developing a java interface for the GIS GRASS
(http://grass.itc.it) using GL4java calls for raster visualization.
I'm not the developer that works on the GL part. On his computer
everything compiles and works alright.
When I run the application, when the first GL call comes (i assume
so), the X server shuts down and restarts. In the /var/log/message the
only line that defines what happened, is:
kdm[2232]: Server for display :0 terminated unexpectedly
Nothing else!
I use Suse 9 (I upgraded from 8.2 hoping to solve that problem, but no
way) which a Toshiba Satellite 5200-801 which loads an NVIDIA GeForce4
460 Go.
I downloaded and installed the drivers supplied by Nvidia and they
work perfect for everything but this.
I know NVIDIA to be unstable with linux nowadays, but I can't work
this way!
Has anyone encountered the same or similar problem?
Regards,
Andrea
- 7
- Extract all dates from text documentHi,
1) I have a bunch of documents, some of which may contain dates.
2) For each document, I would like to identify all existing dates.
3) The dates exist in multiple formats.
Example: (May 5, 1932), (5,5,1932), (5/5/1932), (5-5-1942) etc.
4) I would like to process a single document very quickly. In other
words, i'm looking for a time efficient solution.
Are there any existing parsers that take in a generic text string and
return a collection of dates found in the text string?
Are there any existing flex/cup files that perform this task?
Thanks.
- 9
- Oracle JDBC and AppletHello
I have an applet which download files to local computer from database
(files are saved as BLOB fileds).
Applet is signed bud when I want to get connection to Oracle (method
getConnection from OracleDataSource) i have following error:
java.security.AccessControlException: access denied
(java.util.PropertyPermission oracle.jserver.version read)
Applet working only when I running it from JBuilder. Otherwise the
error comes.
I can't see other posibility than using applets because number of
files is very big. For example 20 000 to take at once, so the normal
download method via http is not good here. Also the size of one
download may be up to 1GB.
Thanks for help
Bartek
- 11
- applet is not initiallising.what's wrong with this source code.
it is showing the message applet is not initiallising.
--------------------------------------------------------------------------------------------------------------------------------------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class LinearSearch extends JApplet implements ActionListener
{
JLabel enterLabel;
JTextField enter;
JTextArea outputArea1, outputArea2;
JButton search;
String output;
int a[];
public void init()
{
a=new int[Integer.parseInt(JOptionPane.showInputDialog("how many
numbers, you want to input:"))];
for(int i=0; i<a.length; ++i)
a[i]=Integer.parseInt(JOptionPane.showInputDialog("enter the
integer number."));
output="numbers are:\n";
for(int i=0; i<a.length; ++i)
output += " "+a[i];
for(int i=1; i<a.length; ++i)
for(int j=0; j<=a.length-1; ++j)
if(a[j]>a[j+1])
{
int t=a[j];
a[j]=a[j+1];
a[j+1]=t;
}
output += "\n\nnow numbers are in ascending order.\n";
for(int i=0; i<a.length; ++i)
output += " "+a[i];
Container c=getContentPane();
c.setLayout(new FlowLayout());
outputArea1=new JTextArea();
c.add(outputArea1);
outputArea1.setText(output);
enterLabel=new JLabel("enter the number, you want to search.");
c.add(enterLabel);
enter=new JTextField(10);
enter.addActionListener(this);
c.add(enter);
outputArea2=new JTextArea();
c.add(outputArea2);
search=new JButton("new search");
search.addActionListener(this);
c.add(search);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource() == enter)
{
int subscript=linearSearch(a,
Integer.parseInt(e.getActionCommand()));
if(subscript != -1)
outputArea2.setText("number found at position no. "+subscript+"
in the sorted list.");
else
outputArea2.setText("Sorry!!! number not found. \n\nhave a look
on new search");
}
else
JOptionPane.showMessageDialog(null, "Please click on the Applet
menu on the menu Bar.\n"+"click on the clone option.\n"+"Repeat the
search process again.");
}
public int linearSearch(int b[], int k)
{
for(int i=0; i<b.length; ++i)
if(b[i] == k)
return i;
return -1;
}
}
---------------------------------------------------------------------------------------------------------------------------------------
it is asking for no. of elements. and input the numbers. but after then
applet is not able to initialise.
- 11
- tridimensional view in B&WI made a program with java3d and I can print views from it.
I want to print only the lines like the wireframe but without hide lines
Have you same Ideas??
zeno
- 12
- Windows styleHI! I'm developing an application that is going tu run on windows XP
Professinal, and I want that the buttons, combo boxes etc every
component that I use, looks like a windows component, not like a swing
button for example. I don`t know if anyone understands me.
I'm using NetBeans IDE, (using jdk 1-4-2).
When I am designing my form and I drag and drop a button for example,
it has a rounded shape, like a normal windows button, but when I
compile and run my project, the button is not rounded anymore, and
doesn't looks like a Windows Button.
What can I do??
Thaks a lot!!
- 13
- OLAP & OLTP schemas and Java App ServerHi,
(I hope this is the right group to post this. If not I apologize and
would appreciate pointers.)
We have a Websphere Applicaiton server for our application. We plan to
have a database that is part relational and part star on DB2 UDB. We
will need an OLAP tool and may use BRIO.
Some questions on this approach:
1. What is the best way to access the OLAP schema from Java (we plan
to use hibernate but are concerned about its suitability for star
schemas).
Some things that I could think of are:
- Use hibernate on the star schema (not sure if this is the best)
- Create as many materialized views as necessary and use hibernate
- Use java objects running on the DBs JVM (db optimized jvm implying
better performance?)
2. Is Brio the right tool to use for this scenario?
I ask because we can't have direct integration with the J2EE
applicaiton server (We have to give the user a different login page to
brio to see the reports. But they may take hours to produce.)
3. What are your experiences in combining star and relational tables
in the same database?
4. Any thoughts on using DB2 OLAP server? Apparently it has reporting
capabilities and Java support, but unsure if it has any advantages
over Brio.
Thanks in advance,
Naga
- 14
- JNI QuestionOn Mar 2, 2:17 pm, Gordon Beaton <email***@***.com> wrote:
> On 2 Mar 2007 08:05:22 -0800, Edsoncv wrote:
>
> > If I have only the C part, I would cast the "native1" object, pass
> > to "setup" and cast back the object, but since the setup function is
> > called from java, I don't know how to access native1 object from
> > "setup". Is it possible?
>
> Of course.
>
> Either store it someplace in the native code where it's visible to
> both methods (i.e. not as a local variable in solve() like your
> example).
>
> Or, remembering that even native methods have return values, return it
> to the caller (cast to jlong) so that it can be passed back to the
> next method, where you cast it back to the appropriate pointer type
> before attempting to use it.
>
> /gordon
>
> --
> [ don't email me support questions or followups ]
> g o r d o n + n e w s @ b a l d e r 1 3 . s e
Thanks Gordon, I think I'll pick the second option.
- 16
- reading Mouse MOVE events without moving pointerHi,
Does anyone know of way of setting up a java app so that a instead of
mouse movements being used to update the pointer, the mouse move could
be used to update, say, the viewport of a document?
An example in more detail;
what I want to do is use the mouse MOVE event that is caused by the
movement of the mouse, but not update the pointer position (I would
like the pointer to remain still or be invisble) but to allow me to
update the viewport on a document. ie, user presses a 'trigger' key
to put the code into a receptive mode, then all subsequent mouse
movements (triggering mouse MOVE events) can be captured and used to
update the viewport location- ie, mouse moves left, pointer remains
still, viewport moves left.
I don't know if this is possible due to the OS independance that java
has. Maybe a solution involves the glass-pane in some (I am not
familiar with the glass- yet. It is one of my avenues to search...)
Thanks for any ideas... mucho thanks for any code examples....
M.
- 16
- about static variableViv,
Viv wrote:
>I mean to say that the objects will get garbage collected but not the
>static variables. Class will remain in memory till the JVM shutdown.
>
>Roedy wrote :
>The only way you can recover the ram from a static class object is to
>load it with a custom classloader, then drop even the reference to the
>class loader.
>
>You can try what Roedy said.
What means "recover the ram from a static class object"? What do you mean
"recover"? I think there is not static class object -- only static class
members.
Do you know where can I find a sample dealing with how to write a customized
ClassLoader with the functions as you mentioned?
regards,
George
--
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-setup/200511/1
|
| Author |
Message |
Boris Gorjan

|
Posted: 2006-2-21 18:29:00 |
Top |
java-programmer, JMF, FrameAccess, sound, faster processing
I used JMF's example class FrameAccess to process audio/video files. The
Processor processes data according to the frame rate specified in the file.
1. Is there a way to do this processing faster? I don't want to view (and listen
to) those vids, just process them. I'm ready to use 100% of the CPU if need be.
2. As the file is processed, a sound is generated and can be listened to through
a sound card's output. Is this entirely necessary? I'm asking because I want to
process files simultaneously and that would result in a cacophony. Besides, say
I want to listen to my own music while the processing takes place.
3. How does one extract sound from a video file? Can it be extracted as a whole?
Can it be broken down into chunks according to extracted image frames? How? In
which formats? I'm stuck in an implementation of Codec interface, much like
JMF's example PreProcessCodec.java, but with AudioFormat (supported ins and
outs), so I can access a sound frame through a Buffer, but I don't know how to
proceed.
Thanks for any insight.
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Sun's OpenJDK in Debian?Hi,
I'm surprised that this wasn't discussed already in the past on this list
(or in the BTS of some important java packages), but what is the status
of Sun's Java architecture in Debian?
It is licensed under GPL2 and should be compatible with DFSG.
As far as I know only a few components are not yet freely available,
especially all which are subject to the Assembly Exception
(http://openjdk.java.net/legal/exception-modules-2007-05-08.html,
http://www.sun.com/software/opensource/java/faq.jsp).
Is this the main blocker for accepting OpenJDK in Debian? Would it be
possible to just omit the binary modules or to replace these with free
implementations from other free projects?
Please CC: me.
Jens
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 2
- RSA ciphered streams problemHi. I've got a problem with the RSA ciphered streams. Here is a piece of
code that generates an exception :
KeyPairGenerator gen = KeyPairGenerator.getInstance("RSA");
System.out.print("Generating the RSA key pair...");
KeyPair kp = gen.generateKeyPair();
System.out.println("done.");
Cipher ci = Cipher.getInstance("RSA");
ci.init(Cipher.ENCRYPT_MODE,kp.getPublic());
Cipher cid = Cipher.getInstance("RSA");
cid.init(Cipher.DECRYPT_MODE,kp.getPrivate());
CipherOutputStream cout = new CipherOutputStream(new
FileOutputStream("rsa.dat"),ci);
ObjectOutputStream oout = new ObjectOutputStream(cout);
oout.writeObject(kp.getPrivate().toString());
oout.flush();
oout.close();
CipherInputStream cin = new CipherInputStream(new
FileInputStream("rsa.dat"),cid);
ObjectInputStream oin = new ObjectInputStream(cin); // Exception here
System.out.println(oin.readObject());
oin.close();
The exception is EOFException and it's not very weird because the file
"rsa.dat" is empty after writing to it!! It happens only if object is "big"
( when I try to write some short String, for example, everything's ok ).
When I tried to write an unciphered output ( without using
CipheredOutputStream ) it went well of course.
My question is : can anybody tell me why it happens? What should I do to
write "big" objects to ciphered output stream using ObjectOutputStream
properly?
Thanks for any requests.
Kuba
- 3
- Loop != LoopStephen Riehm schreef:
>
> don't those two loops have different semantics, ie: the scope of myvalue?
> My understanding would be that myvalue in the first loop would be
> overwritten 9 times and then the last value would be available to code
> appearing after the loop. The myvalue in the second loop basically has
> no effect because it falls out of scope (and into the garbage
> collector's hands) as soon as you leave the loop.
>
Oh, it was just a quick example, there supposed to be done something
with myvalue later in the loop. The point was, myvalue is only needed
inside the loop and not outsite.
int myvalue=0;
for (int i=0;i<10;i++) {
myvalue=calculate(i);
.. do something with myvalue
}
.. myvalue no longer needed
for (int i=0;i<10;i++) {
int myvalue=calculate(i);
.. do something with myvalue
}
..my value not needed anymore
I believe this example is somewhere on the web too, but I forgot where
(probably javasoft.com or javaworld.com).
- 4
- Putting certificates in ldapI have openldap running, and I was able to put java objects there like
so:
Integer i = new Integer( 28420 );
ctx.bind( "cn=myRandomInt", i );
Suppose I already have the cert inside java.security.cert.Certificate
. What would be the correct syntax to add this cert with ctx.bind ? Do
I need to explicitly add this userCertificate;binary to slapd.conf? My
schema is:
database ldbm
#suffix "dc=my-domain,dc=com"
suffix "o=certStore"
#rootdn "cn=Manager,dc=my-domain,dc=com"
rootdn "cn=certManager,o=certStore"
# Cleartext passwords, especially for the rootdn, should
# be avoid. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw secret
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd/tools. Mode 700 recommended.
directory /var/lib/ldap_magna
schemacheck off
# Indices to maintain
index objectClass eq
Please help,
iksrazal
- 5
- [Update] FreeQueryBuilder 2005.05FreeQueryBuilder.2005.05
http://querybuilder.sourceforge.net
FreeQueryBuilder is a GUI SQL client written in 100% Java.
You can create SQL queries without directly writing SQL.
Works with any JDBC compliant database, including
ORACLE, MySQL, HSQLDB, Firebird, SQLServer.
This release includes FreeReportBuilder, a visual report designer.
- 6
- Passing large C buffers to Java (via JNI) without copying?I'm trying to determine whether this is even possible... I have a
_very_ large buffer malloc'd on my C heap that I would like to hand
over to Java, preferably as a Byte[]. So far, every example of this
that I have come across involves _copying_ the data from my C buffer
into java storage. Is there any way to avoid this expensive (very
expensive in my case) operation?
- 7
- Things That People Buy .Hi Antonio ,
Of Sun's press release , You scratch out :
" Makes me not want to buy a new PC just yet . "
Oh God ... Don't hold your breath .
While Sun produces these fantastical press releases ,
Asians are actually shipping things that people buy .
- 8
- GeronimoIs there anyone who has successfully run this
application server under freebsd? I have problems
with rmi, but since nobody answered my other post
I suppose nobody else came across the same problem?
- 9
- Question regarding Java's OOP implementation.According to Wikipedia, one of the core concepts of OOP is
Encapsulation; being defined as follows: "ensuring that users of an
object cannot change the internal state of the object in unexpected
ways; only the object's own internal methods are allowed to access its
state. Each object exposes an interface that specifies how other
objects may interact with it. Other objects will rely exclusively on
the object's external interface to interact with it." Not that I
regard Wikipedia's definition of OOP as the leading authority, it just
happens to be handy and provides a definition that fits my own ideas.
On to the question; If I create a class called AClass and inside
declare a class level variable with the private modifier and some other
methods, e.g.
public class AClass {
private int number;
public AClass(int num) {
number = num;
}
public void setAnotherAClass(AClass anotherAClass, int num) {
anotherAClass.number = num;
}
public int getAnotherAClass(AClass anotherAClass) {
return anotherAClass.number;
}
public void display() {
System.out.println("Number: " + number);
}
}
And a class to test AClass:
public class Test {
public static void main(String[] args) {
AClass one = new AClass(1);
AClass two = new AClass(2);
one.display();
two.display();
one.setAnotherAClass(two, 3);
two.display();
}
}
I would expect the compiler first to complain that number has private
access in AClass... Barring that I'm not sure what I'd expect it to
complain about, but something doesn't seem right. Child classes
derived from AClass were not able to make changes to objects of type
AClass which is what I would expect. But because one and two are
distinct objects the fact that they belong to the same class shouldn't
mean they can change each other's private instance variables. I
wasn't able to find anything directly relating to the question in an
hour or so of Googling. I also read through Java's tutorials on OOP to
see if they had anything specific to say, which they did not.
Thank you for your time and ideas.
Carl Summers
- 10
- \n troublesOK, again I have troubles dealing with String. I have a field of the type
String which contains some text that is separated into lines at random
places, or in other words, the text contains \n\r (or \n in the case of
linux). I write this field into a file and there it looks ok, but when I
read it back I get the whole string in one line. So I figured I'd add a
separator at the end of each line. However, then I get an empty line after
each line! I'm using GZIP to pack the data, so perhaps that is causing this?
Btw. after each block of text I write an end-of-block string to know that
it's the end of that block.
Here's the explanation in code:
String notes = ""; // the result
String lin = ""; // used to read one line from the file
final String eob = "---$#-||-"; // end of block
lin = filein.readLine(); // I'm reading the 1st line
while (lin.compareTo(eob) != 0) {
notes += lin + System.getProperty("line.separator");
lin = filein.readLine();
if (lin == null) { break; } // this will never occur, but just in case
}
return notes;
//-------------
// filein is a BufferedReader
// I can't change that, don't ask why, and
// because of that this is how I read a file
filein = new BufferedReader(
new InputStreamReader(
new BufferedInputStream(
new GZIPInputStream(
new FileInputStream("testFile.gz"))))));
I figured I could erase one empty line after the reading-in is done, but I'm
not sure if this will happen in every case, on every computer. I'm thinking
it could be an anomaly for Windows files.
Anyway, I'm waiting for some suggestions ;)
Gajo
- 11
- commons-logging: runtime change of propertiesHi,
I try to use commons-logging with the logs methods of J2SE 1.4.2 to
generalize the logging in my appl.
Doesn't exists a method to upload the defaul file properties of J2SE
at run time and not usig the -D option at startup?
Exists e method to change the propeties of the logger at runtime? for
example the output file path...
Thanks Cristian
- 12
- Opening Image files with IE as default always ( using Browser Launcher)Hi,
I have downloaded some image files by connecting to a URL and I am
trying open that image file using BrowserLauncher.
I am using windows xp and the default one to open image files is
windows picture and Fax Viewer.
I could not see the image in Internet Explorer when I am trying to
open the image files. But when I set in the properties of image files
from "windows picture and Fax Viewer" to "Open with internet
Explorer", I could see the image.
Some trasfer details..
File Type : .jpg
HTTP/1.0 200 Ok
MIME-version: 1.0
Content-Length: 297362
Content-type: application/jpg
I tried to change in http headers , but could not succeed in opening
the image.
can anybody suggest me that,
I change the properties of the image file ( or http headers) such that
it should be open with internet explorer by default,after the image
downloaded.
Any suggestions or help is appreciated.
Regards,
Hari.
- 13
- Database insert taking a long time and causing 500 errorHi,
My requirement is as follows:
Server: Websphere
Framework: Struts
A user will upload excel file. Excel file will have several rows. For
each row, I need to insert one row in oracle database table. And
finally success message is to be shown to the user.
I read the excel file in action class and call a oracle procedure to
insert the records to database.
The issue is that when the size of excel file is large (containing
several records), it is taking a long time to complete insertion and
it shows Internal Server 500 error on the browser. Passing small set
of records to procedure is also not helping.
I think since there is no response from the app server to the client,
this error is coming. Can anybody suggest how to solve this problem?
Thanks in advance,
Palak
- 14
- Date problem"Simon" <email***@***.com> wrote in message
news:email***@***.com...
> Ingo R. Homann wrote:
>> You could design a programming language whose array-indices start with
>> -3, that would make as much sense.
>
> So you want array-indices to start with 1? I don't see the analogy.
It's the princple of least surprise. When you design something, you want
to surprise your users as little as possible. To me, it's quite surprising
that 5 refers to June and not May, for example. For array-indices, starting
at 1 or 0 is okay (both makes sense), but -3 or 42 or anything else would be
quite surprising as well.
- Oliver
- 15
- What IDE for Java do you use?nospam wrote:
> Hi...All,
>
> I recently downloaded eclipse IDE with myeclipse web editor
> (myeclipseide.com) . I did not see any views on it in this thread. So,
> would be interested to what your thought are on
> eclipse+myeclipse(struts, EJB....)
The views in Eclipse aren't initially as elaborate as those under WSAD,
but you can change that;
http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse.platform.doc.user/gettingStarted/qs-02e.htm
and
http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse.platform.doc.user/gettingStarted/qs-02e.htm
are a good start. Look on sourceforge.net for a variety of plug-ins so
you can enhance your IDE even more. Eclipse Colorer may be of help:
http://eclipsecolorer.sourceforge.net/index_profiler.html and
http://sourceforge.net/projects/eclipsecolorer.
|
|
|