Hi all,
I am tyring to merge an .mov file with a .wav file using java media framework, thus I need to know their duration. How can I do this? Any ideas would be appreciated..
For example:
a) int [x][y][z]
vs
b) int[x*y*z]
Initially thought i'd go with a) for simplicity
I know that Java doesn't store arrays linearly in memory like C does. But what implications does this have for my program?
I need a Java code that takes tab delimited info from a file to a displayed table. The user should be able to click a row and update it, this is followed by updating the file. The code should use Swing objects.
I have no experience with MongoDB and we are trying to port a JPA application to be based on MongoDB. There are 3 drivers mentioned for porting java here. Which driver would be the easiest to use for converting my existing JPA application? Would it be morphia, mungbean or daybreak. Would prefer some practical experiences with users who have gone through this path before.
Is there a "best" or more popular database for standalone Java app?
I'm currently writing by hand, but I would like to know what is commonly done, if there is something that is commonly done.
If I have the following table schema to log an exception (in standard SQL schema):
Table: ExceptionLog
Columns: ID (Long),
ExceptionClass (String),
ExceptionMessage (String),
Host (String),
Port (Integer),
HttpHeader (String),
HttpPostBody (String),
HttpMethod (String)
How would I design the same thing in HyperTable (specifically, what is the best approach for efficiency)? And, how would I code it using the HyperTable Java client?
Hi all,
Most google results for sample questions/problems for java, results in a link directing to mock certification questions. Does anyone know where can i find sample problems for practice ?
Thanks
I'm trying to figure out how to enforce a 5 minute per post/action rule.
I'm developing a web application with Wicket in Java and I've got a session class which I was planning on using to keep track of these timers on a per-user basis. I wasn't planning on storing the timestamp in a database.
public boolean isAllowedToPost() {
if(null OR has 5 minutes passed since last post) {
// set the new timestamp
return true;
}
else
{
return false;
}
}
I am scrapping data from web site using my java application and want to display the result after parsing code of html page in a Text Area made in Swing.
Text like: hello <b>every</b>one should be displayed as: 'hello everyone' in text area.
Thanks!!
I have a small Java Swing application that I want to rewrite in WPF .NET.
The application uses a JTable with an AbstractTableModel and a custom TableCellRenderer. I use my custom cell renderer to display the objects in two rows.
What is the corresponding WPF .NET component to JTable?
Maybe the title might be better, if someone knows a better one, please edit.
I've seen in many Java code notation that after a method we call another, here is an example.
Toast.makeText(text).setGravity(Gravity.TOP, 0, 0).setView(layout).show();
As you see after calling makeText on the return we call setGravity and so far.
How can I do this with my own classes? Do I have to do anything special?
I'm relatively new to Java coding, and was looking for some help. I have a capital letter defined in a variable string, and I want to output the next and previous letters in the alphabet. For example, if the variable was equal to C, I would want to output B and D.
Thanks in advance for any help.
Sorry I dont know the correct terminology to use but I have a 3x3 matrix like this
1 3 4
5 4 5
2 2 5
and I want get the highest score by picking a value from each row/column but I cant pick the same row or column more than once , so the answer in this case is
3 + 5 + 5 = 13 (row0,col1 + row1,col0 + row2,col2)
4 + 5 + 5 = 14 is not allowed because would have picked two values from col2
I'm using Java, and typically the matrix would be 15 by 15 in size.
Is there a name for what Im trying to do, and whats the algorithm
thanks Paul
What are the best practices for using Java's @Override annotation and why?
It seems like it would be overkill to mark every single overridden method with the @Override annotation. Are there certain programming situations that call for using the @Override and others that should never use the @Override?
Why are the methods contains() and indexOf() in the Java collections framework defined using o.equals(e) and not e.equals(o) (where o is the argument of the methods and e is the element in the collection)?
Anyone know the reasons of that?
When indenting java code with annotations, vim insists on indenting like this:
@Test
public void ...
I want the annotation to be in the same column as the method definition but I can't seem to find a way to tell vim to do that, except maybe using an indent expression but I'm not sure if I can use that together with regular cindent.
edit: The filetype plugin was already turned on I just got a bit confused about indenting plugins. The accepted answer may be a bit hackish but works for me as well.
Hi,
I am doing a project in which i require btree or b+tree data structure. but its not an important part of project. it would take my time to write a code for it. I googled it but didn't get anything....
So, can anyone provide java code for btree or b+tree implementation (with insert, delete, search algorithms)??????
it should accept string as input and form btree or b+tree of these string.
Well, I'm planning on releasing a Jar into the world but would prefer if the code was not readably available to anyone with a Java Decompiler as I want to control access to the program with usernames / auth codes etc.
After some Googling I haven't found any software to do this for me, so I was wondering what steps to take from here; if anyone can point me at any software or information on methodologies of obscurification I would be grateful.
Cheers again Stack Overflow.
Is there a method in JDK or apache commons to "pop" a list of elements from a java.util.List? I mean, remove the list of elements and return it, like this method:
public Collection pop(Collection elementsToPop, Collection elements) {
Collection popped = new ArrayList();
for (Object object : elementsToPop) {
if (elements.contains(object)) {
elements.remove(object);
popped.add(object);
}
}
return popped;
}
I'm having trouble with a JVM running an app, whose heap memory looks like a comb. It's constantly jumping from 1.5 GB to 3 GB and slowly deteriorating to higher values. I'm using G1 GC algorithm, but have no idea how to configure it.
I do not have access to the code of the app I'm running and, needless to say, it's a rather large app.
So, bottom line, does anyone know of a good guide to configure GC in Java?
Java Servlets - How do I detect if a user is from a mobile device?
I'm using the TinyMCE javascript editor, and it doesn't work on the iphone. How can I detect if the user is coming from a mobile device?
Do any exist? Ideally it would also come with a library of basic PHP functions.
I have a bunch of simple PHP scripts (no extensions, no fancy dynamic hacks, etc) I'd like to convert to Java... It would be great if a tool could do 80% of the work while I do the other 20%.
in java what is the syntax for commenting out multiple lines?
i want to do something like:
(comment)
LINES I WANT COMMENTED
LINES I WANT COMMENTED
LINES I WANT COMMENTED
(/comment)
Hi,
I need a Java way to find a running Win process from which I know to name of the executable. I want to look whether it is running right now and I need a way to kill the process if I found it.
Thank you! Greetz, GHad