Hi..i wanted to develop a whiteboard application..i know the basics of java..but have no idea where to start from..so..i'd really appreciate if you could guide me..as in..where do i start from??..plz...i reallly need ths..
Hi..i wanted to develop a whiteboard application..i know the basics of java..but have no idea where to start from..so..i'd really appreciate if you could guide me..as in..where do i start from??
Is there a way to obtain the post data itself? I know spring handles binding post data to java objects. But if I had two fields that I want to process manually, how do I obtain that data?
Assuming I had two fields in my form
<input type="text" name="value1" id="value1"/>
<input type="text" name="value2" id="value2"/>
How would I go about retrieving those values in my controller?
I'm trying to send an email in Java but when I read the body of the email in Outlook, it's gotten rid of all my linebreaks. I'm putting \n at the ends of the lines but is there something special I need to do other than that? The receivers are always going to be using Outlook.
I found a page on microsoft.com that says there's a 'Remove line breaks' "feature" in Outlook so does this mean there's no solution to get around that other than un-checking that setting?
Thanks
how do you get source ip, username, password, etc... of the client machine that sends a soap request? is there any of these details that one can pull for logging purposes?
I am using Java to handle the incoming SOAP requests. The service simply adds 2 numbers and is working, but I just need to get some client details.
Thanks, Lavanya
I am new to web development, I have to create a web application in Java using GWT that connects to a database and download a file from it. Regardless of the type of database, what does the web application need in order to create a connection with the database? E.g. an API
Hi
I want to retrieve a set of records from a database, do a rs.next() and then assign the result of this to a variable to pass to a method that will use this record, in the same way that I would without assigning it to a variable and passing it to a method
is there any way to do this?
I'm using JAVA (1.5)
I have a mixed Java / C# project and use an ant script that contains a csc task to compile the dll. This works, but I get a warning
[csc] This task is deprecated and will be removed in a future version
[csc] of Ant. It is now part of the .NET Antlib:
[csc] http://ant.apache.org/antlibs/dotnet/index.html
How can I replace the csc task? I can surely create an exec task calling nant with a project.build file, but that feels completely wrong.
Programming challenge: Given a set of integers [1, 2, 3, 4, 5] I would like to generate all possible k-combinations in ascending size order in Java; e.g.
[1], [2], [3], [4], [5], [1, 2], [1, 3] ... [1, 2, 3, 4, 5]
It is fairly easy to produce a recursive solution that generates all combinations and then sort them afterwards but I imagine there's a more efficient way that removes the need for the additional sort.
Hi All,
I have decided to create my own Java's Robot class in android to take screen capture..i have written the source code of the robot class by my own but the problem is here, the following line in the code is throwing compilation error..saying "The method createRobot(Robot, GraphicsDevice) in the type ComponentFactory is not applicable for the arguments (Robot, GraphicsDevice)"
peer = ((ComponentFactory)toolkit).createRobot(this, screen);
Can anyone suggest me what would be the solution....
thanks..
I know I can find out if a variable is null in Java using these techniques:
if (var==null) - too much work
try { ... } catch (NullPointerException e) { ...} - it tells me what line is throwing the exception
using the debugger - by hand, too slow
Consider this line of code:
if (this.superSL.items.get(name).getSource().compareTo(VIsualShoppingList.Source_EXTRA)==0) {
I would like to know if there's a generic way to find out programatically what variable (not just the line) is throwing the NullPointerException in a certain area of code. In the example, knowing that
We have a very strange problem in out application, all of a sudden we started noticing upside down question marks being saved along with other text typed in to the fields on the screen. These upside down question marks were not originally entered by the users and it is unclear where they come from. We are using Oracle 10g with java.
And this is happening, even when no data is copied from Microsoft Word
I want to call ejb from servlet via remote interface. Maybe it is a RTFM question but i cannot find solution via Google or documentation
I use Jboss 4.2, Java 1.6
Thanks for your answer!
I have a quadcore processor and I would really like to take advantage of all those cores when I'm running quick simulations. The problem is I'm only familiar with the small Linux cluster we have in the lab and I'm using Vista at home.
What sort of things do I want to look into for multicore programming with C or Java? What is the lingo that I want to google?
Thanks for the help.
I am new to Java Script. I am using it, in combination with Java Server Faces.
I want to add some points to define a Polilyne using GoogleMaps Apiv3. My problem is that I can't add a FOR statement to the javascript, because it dumps. If I comment this FOR loop, it also dumps. The dump I am getting is: "javax.servlet.ServletException: null source".
Has anyone any suggestion to solve this? Thanks in advance, Emanuel
<script type="text/javascript">
function initialize()
{
var longit = "${dateRange.longitude}" ;
var lat = "${dateRange.latitude}" ;
var latlng = new google.maps.LatLng(lat, longit);
var myOptions =
{
zoom: 15,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var points = [];
var cadena1 = "${dateRange.latArray}" ;
var cadena2 = "${dateRange.longArray}" ;
var latArray = cadena1.split('?');
var longArray = cadena2.split('?');
/* The code Below is the one that fails */
for (var i=0; i < latArray.length; i++)
{
points.push(new google.maps.LatLng(latArray[i], longArray[i]));
}
/* Finish of the error code */
// The Polilyne is created
var mapPath = new google.maps.Polyline
({
path: points,
strokeColor: "#FF0000",
strokeOpacity: 1.0,
strokeWeight: 4
});
mapPath.setMap(map);
}
</script>
</head>
<body onload="initialize()">
<h:graphicImage url="http://localhost:8080/gps_tracking/faces/resources/images/logo.jpg">
</h:graphicImage>
<h1 align="center">Sol-Tech</h1><br />
<hr></hr>
<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
Hi,
is there a way to log the JdbcTemplate's DataSource connection URL in Java?
The field exists in the DataSource, but there ain't a getter to access it. Of course I could read the DataSource properties from the application context xml, but I'd like to do it the other way.
Will incrementing the instance variables of an object ever lead to a stack overflow error?
For example:
This method (java) will cause a stack overflow error:
class StackOverflow {
public static void StackOverflow (int x)
{
System.out.println (x) ;
StackOverflow(x+1) ;
}
public static void main (String[]arg) { StackOverflow (0) ;
}
but will this?: (..... is a gap that i've put in to shorten the code. its long enough as it is.)
import java.util.*;
class Dice
{
String name ;
int x ;
int[] sum ;
....
public Dice (String name)
{
this.name = name ;
this.x = 0 ;
this.sum = new int[7] ;
}
....
public static void main (String[] arg)
{
Dice a1 = new Dice ("a1") ;
for (int i = 0; i<6000000; i++)
{
a1.roll () ;
printDice(a1) ;
}
}
....
public void roll ()
{
this.x = randNum(1, this.sum.length) ;
this.sum[x] ++ ;
}
public static int randNum (int a, int b)
{
Random random = new Random() ;
int c = (b-a) ;
int randomNumber = ((random.nextInt(c)) + a) ;
return randomNumber ;
}
public static void printDice (Dice Dice)
{
System.out.println (Dice.name) ;
System.out.println ("value: "+Dice.x) ;
printValues (Dice) ;
}
public static void printValues (Dice Dice)
{
for (int i = 0; i<Dice.sum.length; i++)
System.out.println ("#of "+i+"'s: "+Dice.sum[i]) ;
}
}
The above doesn't currently cause a stack overflow error but could i get it too if i changed this line in main: for (int i = 0; i<6000000; i++) so that instead of 6 million something sufficiently high were there?
I'm working on a new Java project and therefore im reading the already existing code. On a very important part of the code if found the following regex expression and i can't really tell what they are doing. Anybody can explain in plain english what they do??
1)
[^,]*|.+(,).+
2)
(\()?\d+(?(1)\))
I saw this video, and I am really curious how it was performed. Does anyone have any ideas? My intuition is that he scraped pixels from the screen (one per 'box'), and then fed that into some program to determine the next move.
Is scraping pixel-by-pixel the way to do this, or is there a better way? I am looking to do something similar with either Java or Python.
Thanks
Hello Guys
i just want to create a simple application that will allow a user to input a url to a rss feed and display the contents to a user.
what would be a good java library to enable me to read rss feeds?
cheers
I heard that using shorts on 32bit system is just more inefficient than using ints. Is this the same for ints on a 64bit system?
Python recently(?) basically merged ints with long and has basically a single datatype long, right? If you are sure that your app. will only run on 64bit then, is it even conceivable (potentially a good idea) to use long for everything in Java?