 |
 |
When posting your question please:- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-fou
|
|
|
|
 |
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?
|
|
|
|
 |
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.
|
|
|
|
 |
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.
|
|
|
|
 |
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!
|
|
|
|
 |
You will need to write some SQL commands to extract the records from the database.
|
|
|
|
 |
Dear all
First I am very happy to be a member in this java society.
I am a java programmer and master student. I will do research about code complexity and I need a help from java lovers :x;;).
I made a survey on this website: https://az1.qualtrics.com/SE/?SID=SV_cUv7h4go2sJ8HRz&Preview;=Survey&BrandID;=qtrial2014
and on this survey I need yours help to rank 15 programs written in java source code. The ranking will be from 1 to 15 where 1 is for the simplest code and 2 for the next simple code and so on until number 15 is the most complex code.
Many thanks in advance.
Regards@};-
|
|
|
|
|
 |