|
|
i dont know any programming language but im intrested so help me i like java . java basics and programing how to no help me
kickan
|
|
|
|
|
i dont know any programming language but im intrested so help me i like java . java basics and programing how to no help me
|
|
|
|
|
The first thing you need to do is to learn how to use Google to help you in your research. A quick search for "Java tutorials" would have found you The Java Tutorials[^]; clear, concise and useful for anyone new to programming.
|
|
|
|
|
JAVA is Free: Unlike programming languages like Dot Net where you need to pay Microsoft to get license copy software for application development, JAVA is FREE to download. Due to this JAVA is very popular over other paid programming languages.
Java easy to learn: JAVA programming is easy to learn was compared to C or C++. JAVA has a similar syntax like C++.
JAVA is Platform independent: JAVA stands true to its tagline "Write once and run anywhere". You create JAVA applications in Windows and run it in Linux or other operating systems and vice versa.
JAVA Open source Libraries: JAVA has a rich set of API and Documentation, which helps in developing your applications faster. Java has global talent pool to help.
Garbage Collection: JAVA has a powerful memory management technique i.e. called garbage collector, so Programmers do not have to worry about memory issues in application.
|
|
|
|
|
let,
upper bound = 100
lower bound = 60
starting seed = 62
program prints random number starting from 62 at regular time intervals within this limit.
How can i implement this program in java?
|
|
|
|
|
|
I noticed in one of my professor's MVC Java programming projects he put a Controller class inside a model package.
Is it true that in MVC often people use just MV and don't bother with the C because they don't think it's worth creating another layer just for a couple of extra classes?
It seemed illogical to me to put a controller inside a model package.
|
|
|
|
|
Why are you asking here, and not discussing this with your professor?
|
|
|
|
|
You can split Control and View by doing that.
It has several advantages: one of the biggest to me is, that I can change the view without touching the behavior of the UI.
I can also use one Controller for several Views, which gives me more control about what's happening.
But I also use just MV, addressing anonymous event listeners in the view's code. Mostly on dialogs or when "quick&dirty" is required.
regards Torsten
I never finish anyth...
|
|
|
|
|
is java is pure object oriented langage
|
|
|
|
|
Obviously java is pure object oriented programming language because even if we take example of simple stars printing program then by default classes are being inherited and objects are being created!
|
|
|
|
|
|
Except 8 primitives, Yes it is.
|
|
|
|
|
Yes java is pure object oriented language
|
|
|
|
|
How do i call the report design page from another page through the button click event in java swings?
Arjun Yk
|
|
|
|
|
how to create veda soap web service in java
|
|
|
|
|
Probably by writing some code. Please read the forum guidelines at the top of this page.
|
|
|
|
|
I tried to implement as following in java. But the code is not working.
Someone help to complete this code in java or any other language.
This is the algorithm - https://onedrive.live.com/?cid=9a23cd9d216bc283&id=9A23CD9D216BC283!192&sff=1&v=3[^]
and code is below-
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.*;
public class Code {
private static int N = 100,C = 5;
private static double[][] S = new double[N][N], P = new double[C][N], l = new double[C][N],PR = new double[N][C];
private static double[] PI = new double[C];
private static double[][][] w = new double[C][N][N];
final static double d = 0.85;
public Code() {
System.out.println("Code Class");
}
public double SumOfWkjm(int m,int j){
double ans = 0.0;
for(int k=0;k<N;k++) ans+=w[m][j][k];
System.out.println("SumOfWkjm: "+ans);
return ans;
}
public double SumOfWjim(int m,int i){
double ans = 0.0;
for(int j=0;j<N;j++){
ans+=w[m][j][i]*( PR[m][j]/SumOfWkjm(m, j) );
}
System.out.println("SumOfWjim: "+ans);
return ans;
}
public void initialize() throws FileNotFoundException{
System.out.println("Initialize:");
Similarity obj = new Similarity();
obj.Similaritymain();
N = obj.sentenceCount;
S = new double[N][N];
S = obj.Similaritymain();
for(int i=0;i<N;i++){
for(int j=0;j<N;j++){
System.out.print(S[i][j]+" ");
}
System.out.println();
}
Random randomGenerator = new Random();
for (int i = 0; i < N; ++i){
double sumP = 0.0;
for(int m=0;m<C;m++) {
int randomInt = randomGenerator.nextInt(100);
P[m][i] = (double)randomInt/100.0;
sumP+=P[m][i];
}
for(int m=0;m<C;m++) {
P[m][i] = P[m][i]/sumP;
}
}
for(int m=0;m<C;++m){
PI[m] = 1.0/C;
}
PrintStream out = new PrintStream(new FileOutputStream("output.txt"));
System.setOut(out);
}
public void convergence(){
int cc = 0;
while(cc<10){
for(int m=0;m<C;++m){
for(int i=0;i<N;++i){
for(int j=0;j<N;++j){
w[m][i][j] = S[i][j]*P[m][i]*P[m][j];
System.out.println("wmij =" + w[m][i][j]);
}
}
for(int I=0;I<N;I++){
PR[m][I] = (1-d)+d*SumOfWjim(m,I);
}
for(int I=0;I<N;++I)
l[m][I] = PR[m][I];
}
for(int i=0;i<N;++i){
double sumPIl = 0.0;
for(int j=0;j<C;++j){
sumPIl += PI[j]*l[i][j];
}
for(int m=0;m<C;++m) {
P[i][m] = (PI[m]*l[i][m])/sumPIl;
}
}
for(int m=0;m<C;m++){
double sums = 0.0;
for(int i=0;i<N;i++){
sums+=P[m][i];
}
PI[m] = sums/N;
}
cc++;
for(int m=0;m<C;m++){
for(int i=0;i<N;i++){
System.out.print(P[m][i]+" ");
}
System.out.println();
}
}
}
}
|
|
|
|
|
What does "not working" mean?
|
|
|
|
|
|
hai guys,
i am developing webservice with JAX-WS RI implementation.i need multiple service tags in single wsdl.how?. is it possible?.if yes then please give me the sample example
-- modified 1-Jul-14 3:14am.
|
|
|
|
|
A service groups a set of related ports together:
<wsdl:definitions .... >
<wsdl:service name="nmtoken"> *
<wsdl:port .... />*
</wsdl:service>
</wsdl:definitions>
The name attribute provides a unique name among all services defined within in the enclosing WSDL document.
Ports within a service have the following relationship:
None of the ports communicate with each other (e.g. the output of one port is not the input of another).
If a service has several ports that share a port type, but employ different bindings or addresses, the ports are alternatives. Each port provides semantically equivalent behavior (within the transport and message format limitations imposed by each binding). This allows a consumer of a WSDL document to choose particular port(s) to communicate with based on some criteria (protocol, distance, etc.).
By examining it's ports, we can determine a service's port types. This allows a consumer of a WSDL document to determine if it wishes to communicate to a particular service based whether or not it supports several port types. This is useful if there is some implied relationship between the operations of the port types, and that the entire set of port types must be present in order to accomplish a particular task.
|
|
|
|
|
I am writing to a file coordinates of texts using PathIteratorsaved as SVG format i defined the Font attributes using AttributedString and TextLayout. It is saving to the file and working properly, but it is just writing as a single line of text where is my target is multiple lines of text, i began using LineBreakMeasurer, but some text is removed plus i got single line of text only, where i face the problem that , How to determine the width to get multiple lines of text ? i tried to figure out from this example where is drawing multiple lines of text but i am using getBounds().getWidth() of TextLayout object the code i tried
public class writeFontPathsToFileAsSVG {
private AttributedString text;
private LineBreakMeasurer lineMeasurer;
private int paragraphStart;
private int paragraphEnd;
private static final Hashtable map = new Hashtable();
static {
map.put(TextAttribute.FAMILY, "Arial");
map.put(TextAttribute.SIZE, new Float(25.0));
}
public writeFontPathsToFileAsSVG(){
this.text = new AttributedString( "Salam Marhaba Ahlan Wa Sahlan "
+"Salam Marhaba Ahlan Wa Sahlan"
+"Salam Marhaba Ahlan Wa Sahlan",map);
}
public static void main(String[] args) throws Exception {
writeFontPathsToFileAsSVG getFiel=new writeFontPathsToFileAsSVG();
getFiel.getFontFileAsSVG(new FileWriter(C:\\saveTo.svg"));
}
Shape shape ;
public void getFontFileAsSVG(FileWriter f) throws IOException{
AttributedCharacterIterator attributedChar = text.getIterator() ;
paragraphStart = attributedChar.getBeginIndex();
paragraphEnd = attributedChar.getEndIndex();
FontRenderContext fontRenderContext = new FontRenderContext(null, false, false);
lineMeasurer = new LineBreakMeasurer(attributedChar,fontRenderContext);
TextLayout layout = new TextLayout(text.getIterator(), fontRenderContext);
//To get the Text fits the art-board
double w=layout.getBounds().getWidth();
double h=layout.getBounds().getHeight();
double x=layout.getBounds().getX();
double y=layout.getBounds().getY();
//To get a specific width to go to next line
float formatWidth = (float) w + 250 ;
float drawPosY = 0;
lineMeasurer.setPosition(paragraphEnd);
float drawPosX = 0;
while (lineMeasurer.getPosition() < paragraphEnd) {
layout = lineMeasurer.nextLayout((float) w);
y += layout.getAscent();
if (layout.isLeftToRight()) {
x = 0;
} else {
x = w - layout.getAdvance();
}
y += layout.getDescent() + layout.getLeading();
}
shape = layout.getOutline(null);
PathIterator pi = shape.getPathIterator(null);
PrintWriter out = new PrintWriter(f);
out.println("<?xml version=\"1.0\" standalone=\"no\"?>\n"
+ "<svg xmlns=\"http://www.w3.org/2000/svg\" preserveAspectRatio=\"none\" " +"\n"
+ " width=\""+w+"\" height=\""+h+"\""
+ " viewBox=\""+x+" "+y+" "+w+" "+h+ "\" >" );
out.println("<path d=\"");
String temp=new String();
while (pi.isDone() == false) {
temp+=getCoordinates(pi);
pi.next();
}
out.println(temp);
out.format("\"/>"+"\n"+"</svg>");
out.close();
f.close();
System.out.println("Data added to the File successfully");
}
public String getCoordinates(PathIterator pi) {
String temp=new String();
double[] coor = new double[6];
int type = pi.currentSegment(coor);
switch (type) {
case PathIterator.SEG_MOVETO:
temp="\n\n"+" M " + coor[0] + ", " + coor[1];
break;
case PathIterator.SEG_LINETO:
temp+="\n\n"+" L " + coor[0] + ", " + coor[1];
break;
case PathIterator.SEG_QUADTO:
temp+=" Q " + coor[0] + ", " + coor[1] + " "
+ coor[2] + ", " + coor[3];
break;
case PathIterator.SEG_CUBICTO:
temp+=" C " + coor[0] + ", " + coor[1] + " "
+ coor[2] + ", " + coor[3] + " " + coor[4] + ", " + coor[5];
break;
case PathIterator.SEG_CLOSE:
temp+=" Z";
break;
default:
break;
}
return temp;
}
}
|
|
|
|
|
Hi guys,
I'm working on inventory management system. I'm using java and MySQL database.
The requirement is that user should be able to view the past records of the inventory.
eq. how many products are there at a previous date or a month before.
In short I want to get the state of the inventory at the previous date.
Can you please provide me some guidelines to achieve this.
Your response is highly valuable for me.
Thanks!
|
|
|
|