|
All good. That's a pretty quick and dirty construct which can be greatly (and easily) improved.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Alright, I fixed my iPhone issue so I will make an attempt now to implement your concept.
Thanks!, I'll up vote it when I'm done.
|
|
|
|
|
I am looking for an API that is similar to YouTube Help popup window.
The popup window can be seen on clicking the Help link on the footer of YouTube homepage. The screenshot of it is attached here
Basically I need the API for documentation that looks and works similar to this, having a search box on the top and a Markdown for writing/managing the content
Thanks
|
|
|
|
|
is there any way to know that web page has thrown any error.
i.e. i am using some api and it throws some error in background i.e. on console.
so i want to do like this. if on page myPage.html is there any error thrown by server or js or api or any other thing i want to show alert box.
i tried to add on error event on body of html element but it does not work.
|
|
|
|
|
rorschach217 wrote: but it does not work. Please do not expect people to understand what that is supposed to mean. If you have a problem then edit your question and add some proper details.
|
|
|
|
|
From your title , my understanding is that you want to handler browser error in javascript but when I read your description , you are contradicting yourself.
You need to understand that Javascript can only handle client scripting errors not server errors unless you pass something in a client script to talk to your javascript code.
There are lot of techniques you can find if you google it.
|
|
|
|
|
Hi Everyone.
I am trying to save multiple rows from angular UI grid to a database using for loop. I am calling controller action method using http.post. Could anyone help me out in guiding how to save multiple rows using http request.
Thanks
Syed
|
|
|
|
|
Just put your call into a loop. Sounds like you already have a loop so where is the problem?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Server call in a loop could lead to performance issue. Add them in to JSON Array in a loop and pass it to server call at the end.
|
|
|
|
|
help me writing a small program
|
|
|
|
|
Do not repost.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
main(){} small enough?
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
|
hi
i wrote a code for the 2nd part in the following.
but i dont know where am i going wrong. need help.
Create a new Java Project in Eclipse named HW6_lastName and complete the following requirements based on the Threads. Several threads will share a single object and contribute their individual result to the shared object. The shared object accumulates the partial results.
Create a package named cs520.hw6. Using this package, create the following classes.
Create a class named SharedResults as follows. The class keeps track of the shared result.
The instance (or member) private variable – result (int).
A void addToResultmethod which takes the given integer argument and adds it to the shared result. This method then prints to the console the name of the current thread, the value it added, and the cumulative result. Handle the synchronization issue with this method.
The getResult method with no arguments which returns the shared result. Handle the synchronization issue with this method.
2. Create a class named LongTask which extends the Thread class.
a.The instance (or member) private variables – sharedData (of type SharedResults), start (integer) and end (integer).
b.A single constructor which takes the above three arguments and stores them in the instance values. Also, create a name for this thread as Thread_<start>_<end>
c.In the run method, add the integer numbers from start to end (both inclusive) using a for loop. Also, sleep for a random time (up to 10 milliseconds) in each iteration of the loop. After the loop, invoke the addToResult method of the shared object and provide this accumulated sum.
Create a Test class to test the following functionality in its main method.
a.Create the SharedResults object and assign it to a variable.
b.Create five LongTask objects by passing the above shared object and the start and end values for each as (1, 100), (101, 200), (201, 300), (301, 400), and (401, 500) respectively.
c.Start each thread as it is created.
d.Wait for all the threads to complete using the join method.
e.Print the result from the shared object.
Sample Output:
Create an archive of your Eclipse project using the following steps. Select the HW6_lastName project in the Eclipse IDE’s Package Explorer or the Navigator window.
Click File->Export. Select the General->Archive File option. Click Next.
Specify the "To archive file:" entry as say, C:TempHW6_lastName.zip.
The zip file will be created and stored in the C:Temp folder.
Submit this zip file as an attachment in the Assignment Section of Vista.
|
|
|
|
|
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.. 
|
|
|
|