Java is a popular programming language and runtime environment which allows programs to run unchanged on most platforms.
2
votes
0answers
8 views
OpenCV Mat processing time
I'd like to know whether having different variables for the src (source) and dst (destination) of an OpenCV function will have an effect on the processing time. I have two functions below
that does ...
3
votes
0answers
26 views
Beginner self studying Java: exercise TopCoder SRM 144 DIV 1 (constructive critique?)
I am trying to learn some Java on my own, in the breaks of my tollbooth night job, and I am tackling some "programming challenge" problems to practice the little I have learnt so far.
Could anybody ...
4
votes
2answers
35 views
Vector-based flood-fill algorithm queue class
I want to implement the flood-fill algorithm for http://stackoverflow.com/questions/12995378/is-there-a-proper-algorithm-for-detecting-the-background-color-of-a-figure. I did it recursively, but I had ...
5
votes
2answers
43 views
In Java, how to operate the sublists efficiently?
In my Java program, I need to operate on the sublists a of ArrayList or LinkedList often, like removing a sublist, comparing two sublists.
For ArrayList or LinkedList, I didn't find any good APIs to ...
3
votes
1answer
68 views
how do I optimize my java code?
I'm new to JAVA. I've been through some tutorials and I'm in the next step of checking how I'm doing now.
Please feel free to criticize the code block below. Any feedback is appreciated. Thanks!
...
5
votes
3answers
104 views
Removing duplicates from an unsorted linked list
Does the code below look correct and efficient for removing duplicates from an unsorted linked list without using extra memory?
An object of type Node denotes a LL node.
void removeDuplicates()
{
...
1
vote
2answers
34 views
Reading a Bitmap from disk on a separate thread on Android
I want to defer the reading of a bitmap to another thread. I'm mainly concerned about concurrency issues since I'm kind of green on that subject, so I would like to know if this code has any potential ...
5
votes
1answer
64 views
Please review following code
Please review the following code. Methods getFirsts and getSeconds return a list of objects which implement CommonInterface and both of them are private. Is it a good or bad design.
@Override
public ...
2
votes
1answer
11 views
Any problems in using hibernate's session.connection() to run native sql
In my project, they use Hibernate's session the below mentioned way and then save entity objects with in a transaction.
Session session = HibernateUtil.getCurrentSession();
...
1
vote
1answer
45 views
Scala: tail-recursive factorial
Is there anything what could be improved on this code?
def factorial(n: Int, offset: Int = 1): Int = {
if(n == 0) offset else factorial(n - 1, (offset * n))
}
The idea is to have tail-recursive ...
6
votes
3answers
105 views
Not sure how to check my solution
This is a assignment question from school: Write a method called licencePlate that takes an array of objectionable words and returns a random licence plate that does not have any of those words in it. ...
2
votes
1answer
33 views
File to String Pattern for uploading to a server
I need to upload some images to a server. This is done with a json object. The json object has 2 values, a timestamp and a Base64 encoded string of the image. I am using the jackson library and was ...
-1
votes
0answers
18 views
Java Servlets extend other Servlet [closed]
The init method in most (all) of my servlets is similar. Mostly initializing a Datasource
I am thinking of creating a BaseServlet having a protected Datasource and the init method implemented and all ...
1
vote
1answer
75 views
need a review for a finished code [closed]
package homework2;
public class Homework2 {
public static void main(String[] args){
int num1 = (int) (Math.random()*(10-3+1)+3);
int num2 = (int) (Math.random()*(10-3+1)+3);
...
-1
votes
0answers
31 views
Issue with Car Physics implementation [closed]
I ported the car physics found here to java/android:
http://www.gamedev.net/topic/470497-2d-car-physics-tutorial/
The problem is that when I steer it does not steer, but when I throttle it steers ...