I am implementing DFS on a weighted directed graph in the following way:
public class DFSonWeightedDirectedGraph {
private static final String START = "A";
private static final String END = "C";
private int pathLength = 0;
private int stops = 0;
public static void main(String[] args) {
//this is a direc...
Hello,
I do not manage to get the latitude, longitude from the following json (hold in json variable) I get from a http request:
{
"name": "rue de la paix, paris, france",
"Status": {
"code": 200,
"request": "geocode"
},
"Placemark": [ {
"id": "p1",
"address": "Rue de la Paix, 75002 Paris, France",
"AddressD...
do all java mvc based frameworks require you to wire up each and every file in a config file?
like in .net you can create generic routes that map to things like:
controller/action/parameter
I'm currently reading up on spring, but haven't reach the MVC part yet.
...
Hello everyone,
I have a ArrayList containing Attributes
class Attribute{
private int id;
public string getID(){
return this.id;
}
private string value;
public string getValue(){
return this.value;
}
//... more properties here...
}
Well I filled the ArrayList with like hundreds of those attributes. And I want ...
I've got a few classes that implement Parcelable and some of these classes contain each other as properties. I'm marshalling the classes into a Parcel to pass them between activities. Marshalling them TO the Parcel works fine, but when I try to unmarshall them I get the following error:
...
AndroidRuntime E Caused by: android.os.BadPa...
How to multiply two very large numbers greater than 32 characters for example multiplication of 100! with 122! or 22^122 with 11^200 by the help of divide and conquer, do any body have java code or C# code?
...
I am currently using java and have read a lot about Erlang on the net and I have 2 big questions:
How much slower (if any) will Erlang be over simple Java. I'm assuming here that Java is going to be faster from the shootout benchmarks on the net (Erlang doesn't do that well). i.e. How many more cpus am I going to need to make the Erl...
Say you have an application in either .net or java (web application).
How long did it take you to port the application to the other platform? (I am assuming they general design was the same, just a straight port i.e. not changing the general design pattern radically).
What I am interested in:
It took me 4 months to code it in .net, an...
With spring security, could you add permissions for a user like:
canEditPage
canViewPage
canLogin
etc?
if yes, Are these stored at a byte array interally?
...
As I was advised by PMD, I want to reduce coopling by using interfaces instead of implementation ...
In this case, knowing that I need a cloneable param, can I overcome the clone Dilemma (no clone() method in the Cloneable interface) ??
public MyConstructor(ArrayList<E> myParam) {
this.myAttribute = (ArrayList<E>) myParam.clone();
...
I use NetBeans 6.7.1 and I'm more used to C and php than Java.
I have a .class file containing "public class myclass". And in that class I have a private array and a public function getArr returning that array.
In the main class I have this
Object mcl = new myclass();
myclass is found by NetBeans and the above is accepted. But
Stri...
Extraneous logging can be expensive. Therefore, I could turn off logging or heighten the logging threshold level to reduce logging during production mode (everybody knows that!)
However, what about the routines that are called to supply parameters to the logger statement?
Consider the logger statement.
logger.info("number of windows="...
As a java guru, what would you suggest to abstract random access so that a code can be agnostic to whether the data its accessing is in memory or in a file on the harddrive?
(The files in question could be several gigabytes in size. Having random access is the most important feature.)
...
I'm working on a JMD (Java MarkDown) (a Java port of MarkDownSharp) but I'm having an issue with one regex in particular. For the file Markdown_Documentation_Syntax.text this regular expression dies:
private static final String BLOCK_TAGS_1 = "p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del";...
Hi,
Are servlets the only way one can write web applications in Java ?
...
In Java you can create an instance of Some using the constructor, i.e. 'new Some( value)', but None has no partner class. How do you pass None to a Scala function from Java?
...
I intend questions not to be a child since I had to manipulate it independently, and I don't want to persist the questions field, I would to fill it up by retrieving the questions manually. Here is the code.
Questionnaire.java
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Questionnaire{
//supposedly ...
Hi,
I have a simple m-file
function [fRate,Height,Width] = media(filename)
obj = mmreader(filename);
fRate = obj.FrameRate;
Width = obj.Width;
Height = obj.Height;
end
Which I have successfully compiled using MATLAB Builder JA into a .jar file.
I have tested the .jar file in a single threaded application and it work with ...
How can I create a navigation based app using the android sdk? Not navigating as in using maps, but like how the settings app works. You click on item, and it goes to a new page of items to click.
I can't find any good samples or documentation. Yes, I've looked through the Android developers website.
...
recently I noted that some applications are running on javaw(not in java). What is the difference between them and how can run my swing application on javaw?
...