|
small... xD 
|
|
|
|
|
We do not do the homeworks, because you have to do that yourself.
However, if you also include the problem that you are encountering then we can guide you, if that is a technical problem. Mostly, the problems are basic such as NullPointerException etc. and others. So, try to add the error messages and what you were expecting, so that we can guide.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
package cs520.hw6.part1;
public class LongTask extends Thread {
// instances of sharedData start and end
@SuppressWarnings("unused")
private static SharedResults sharedData = new SharedResults();
public int start;
public int end;
// Constructor with three arguments
public LongTask(SharedResults sd, int start1, int end1) {
Thread t = Thread.currentThread();
t.setName("Thread_"+start1+"_"+end1); // creating name for thread
start = start1;
end = end1;
System.out.print(t.getName() + "is Adding:- ");
//run(start, end);
}
public void run(){
try{
int sum = 0;
// adding integers from start to end
for(int i = start; i <= end; i++)
{
try {
Thread.sleep(10);// sleep for 10 milliseconds
} catch (InterruptedException e) {
e.printStackTrace();
}
sum += i;
}
System.out.println(sum);
SharedResults.addToResults(sum); // invoking addtoresults method
}catch(NullPointerException e) {
e.printStackTrace();
}
}
}
package cs520.hw6.part1;
import java.util.ArrayList;
public class SharedResults {
// arraylist results instance
private static ArrayList<integer> results = new ArrayList<>();
// default constructor
public SharedResults()
{
}
// void method that takes in integer and adds it to results
public static void addToResults( int values){
//printing values
results.add(values);
results.size();
System.out.println("Cumulative Results are: " + results);
}
// get result method
public static int getResult(){
int sum = 0;
for(int i = 0; i < results.size(); i++)
{
sum += results.get(i);
}
System.out.println("Final Result = " + sum);
return sum;
}
}
package cs520.hw6.part1;
public class Test {
public static void main(String[] args) {
// creating shared results object
SharedResults sr = new SharedResults();
// creating five long task objects
LongTask lt1 = new LongTask(sr,1,100);
lt1.run(); // starting object as it is created
LongTask lt2 = new LongTask(sr,101,200);
lt2.run();
LongTask lt3 = new LongTask(sr,201,300);
lt3.run();
LongTask lt4 = new LongTask(sr,301,400);
lt4.run();
LongTask lt5 = new LongTask(sr,401,500);
lt5.run();
// printing results
SharedResults.getResult();
}
}
|
|
|
|
|
this is the one which i wrote but something is wrong
|
|
|
|
|
Member 12486776 wrote: but something is wrong It would help if you provided full details of what that something is.
|
|
|
|
|
Why is this in the Javascript forum, this is clearly Java code?
|
|
|
|
|
While you can answer the most absurd questions, you did not even care about my question. I thought that the question oversteped your limits. I am so sorry for that to put a pressure on you.
|
|
|
|
|
I assume you are referring to How I do work gridview in javascript[^]. The question has been closed as it was impossible to understand. Try posting again, but next time make sure you add more detail about what the problem is and where any errors occur.
|
|
|
|
|
No thanks.
I do not want to bring me down.
I'm looking for other sites.
|
|
|
|
|
I asked you several follow up questions but you were never able to explain the problem. All you could say is "how do I work with gridview." I asked for more detail but never got any.
I understand you are new and you also need to understand that we can't see what you are doing and you need to be very specific. For example, instead of "how do I work with gridview" perhaps something like "I'm not sure how to access the header row in javascript. Here is what I have tried."
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I plotted a graph/chart using JavaScript library d3.js but that chart appears fine in some browsers while some browsers shows it as half covered with a black box which hides half of my chart . Kindly guide what should I do.........
PS. I am unable to post the screen shot of my chart here.. 
|
|
|
|
|
You need to fix your code.
Since you haven't shown us your code, we can't tell you how to do that.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
i have mdb file having structure code ,name,schc etc., in fc edit box (in input screen) i want to attach the field name of file bsfmmast. all financial names should have to appear in combo box and after selecting name the relevant code should appear in edit box from bsfmmast. how can i do this?
|
|
|
|
|
Member 12155135 wrote: how can i do this? By writing a lot of code. Where are you stuck?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hello Everyone, I would be very happy if u guys help me to make a small program based on the following details. I just need u to help me only the part specially how to write the first condition. cheers
If a car driver speeds no more than 20 km/h over the speed limit, the driver will avoid the income-based unit fines , and gets just the infraction fine . Make a program that tells how much the infraction fine is. It’s based on the speed limit and the excess speed. The program asks for the driving speed and the speed limit. If there is speeding the ticket will be decided upon based on the following rules:
If the speed limit is 10-60 kilometers an hour, and the excess speed is no more than 15 km/h, the speeding leads into a 85-euro infraction fine . More than 15 but no more than 20 km/h leads into an infraction fine of 115 euros.
If the speed limit is 70-120 kilometers an hour, a max 15 km/h speeding will be penalizes with 70-euro infraction fine. The infraction fine is 100 euros when the excess speed is more than 15 km/h, but no more than 20 km/h.
(If the driver drives more than 20 km/h over the limit => he will get unit fines,.
modified 16-Apr-16 6:31am.
|
|
|
|
|
1. This is not a Javascript question.
2. Sorry, but we do not do other people's homework.
|
|
|
|
|
I am really sorry. I have been trying to solve this for long but still can't. I know the conditions and operators but i could not come up with the right one. you mention its not javascript question? why its not a javascript question? thanks
|
|
|
|
|
Start by writing the rules in natural language (from your question), something like:
Display a message
Read Speed value
If speed is greater than [ speed value 1 ]
Then
check values and issue fine
ElseIf speed is greater than [ speed value 2 ]
Then
check values and issue fine
...
Endif
Once you have that logic written down you can convert it to your programming language.
|
|
|
|
|
Refer to your JS lesson notes, especially those concern JS operators and conditions, and you should be able to complete your homework.
If for whatever reason, you do not have those notes, fret not. Check out some online tutorials, such as
JavaScript Operators[^] and JavaScript If...Else Statements[^]
Peter Leow
https://www.amazon.com/author/peterleow
|
|
|
|
|
I know those operators and condition but i can not use them in the right way would be happy if just give me a hints to write the first condition .. thanks
|
|
|
|
|
Where are you stuck?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I am adding html templates to actionmethods in views.and i have added JS folder,CSS folder.in route config file i have set index as main page.only for mainpage Jquery and css is applying but remaining pages it is not applying.if i changed route config file with another index2 css is applying on Index2.can you please tell me what are ways to solve this?
|
|
|
|
|
|
|
Hi All,
I have been trying to have file upload control in my portal using extJS, but failing.
I am using EXT JS version 2.2.
Below is the code I am using for file upload control.
{
xtype: 'fileuploadfield',
id: 'form-file',
fieldLabel: Text.MainAttachAttach,
labelSeparator: '',
name: 'uploadfile',
allowBlank: true
}
This is throwing error as this code is from EXT JS 3.2.1
How do I write same If I am using EXT JS 2.2
Please Help me if anybody has idea.
thanks,
Hemant
By:
Hemant Thaker
|
|
|
|