Posts
 
Reputation
Joined
Last Seen
Strength to Increase Rep
+4
Strength to Decrease Rep
-1
60% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
0 Endorsements
~16.8K People Reached
Favorite Tags
Member Avatar for sciprog1

Hello Members, I want to write a C program which creates two threads and uses a semaphore (as a critical section) to sleep for 1 second and then terminate. I am having a hard time with some of the C Syntax for semaphores. Is it possible to post an example …

Member Avatar for charlottegracie
0
4K
Member Avatar for sciprog1

Hello Members, I am looking into using Java to be able to model/simulate (MODSIM) discrete and continuous systems in the areas of traffic modeling, birth/death process, spread of disease etc. I have a working knowledge of Java. I have a good grasp of calculus and differential equations. I am looking …

Member Avatar for hfx642
0
159
Member Avatar for sciprog1

Hello, I have a JPanel (inside of a JFrame). I have a picture(.jpg), a JTextArea (with scroller) and a JTextField. On the JPanel, I want the picture left justified , the JTextArea right justified and the JTextField just below the JTextArea. What kind of layout would be appropriate? Thank you! …

Member Avatar for sciprog1
0
76
Member Avatar for sciprog1

Hello Members, Given an undirected Graph, G, is there any standard algorithm to find the value of k, where (k-1) represents the number of vertices whose removal results in a graph that is still connected and the removal of the kth vertex makes the graph disconnected? Thank you! sciprog1

Member Avatar for sciprog1
0
68
Member Avatar for sciprog1

Hello Members, Is there any Permutation API in Java? I found the following: [url]http://www.jsc.nildram.co.uk/api/jsc/combinatorics/Permutations.html[/url] I am unable to figure out what should be the import statement for the above API. I would be grateful for any help. Thank you! sciprog1

Member Avatar for sciprog1
0
116
Member Avatar for sciprog1

I am testing a program in C++ Templates (from the Deitel Textook) and I have the typical three files: Array.h: [CODE]// Exercise 14.7 Solution: Array.h // Class template Array definition. #ifndef ARRAY1_H #define ARRAY1_H #include <iostream> using namespace std; template < typename elementType, int numberOfElements > class Array { public: …

Member Avatar for sciprog1
0
143
Member Avatar for sciprog1

Hello Members, I am beginning to work with the JGrapht library. The following is described as the syntax for creating a weighted, directed graph: [CODE]SimpleDirectedWeightedGraph<String, DefaultWeightedEdge> graph = new SimpleDirectedWeightedGraph<String, DefaultWeightedEdge>(DefaultWeightedEdge.class); [/CODE] What is the meaning of including " DefaultWeightedEdge.class" in the above line? I will be grateful for any …

Member Avatar for sciprog1
0
213
Member Avatar for sciprog1

Hello Members, The following code compiles and runs accurately, but gives the following message: [CODE]Note: List.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.[/CODE] [CODE]import java.util.*; public class List { private final static int[] array = {1,2,3,4,5,6,7,8,9,10,11,12,56}; public static void main(String args []) { ArrayList x = …

Member Avatar for sciprog1
0
127
Member Avatar for sciprog1

Hello Members, How do you color a range of cells in a WritableWorkBook (in Jxl)? Thank you!

Member Avatar for sciprog1
0
54
Member Avatar for sciprog1

Hello Members, I am trying to add weights to a Graph that is implemented using JGrapht. I keep getting a NullPointerException, which I am unable to understand as all other edges seems to be added fine. I would be grateful for any help. The code so far: [CODE]import org.jgrapht.*; import …

Member Avatar for sciprog1
0
2K
Member Avatar for sciprog1

Hello Members, Can anyone recommend any easy-to-use and free JavaScript IDEs? Thank you!! sciprog1

Member Avatar for ivatanako
0
228
Member Avatar for sciprog1

Hello Members, I have a program with a lot of MouseListeners. The issue I am having is the program is ending even before I click. I tried using sleep and flags to pause the program without much success. Just wondering if there is way to get the program to pause, …

Member Avatar for sciprog1
0
149
Member Avatar for sciprog1

Hello, The following custom class has compiler errors where it is not recognizing KeyListener. Any idea on why I am getting this error? [CODE]import java.util.concurrent.*; import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class worker1 extends Thread { private SynchronousQueue<Object> q; private int i; public worker1(SynchronousQueue<Object> q) { super("Worker …

Member Avatar for sciprog1
0
217
Member Avatar for sciprog1

Hello Members, I am trying to solve the following problem using threads: Thread_1 outputs values from 1 to 1000. Thread_1 waits. Thread_2 outputs values from 1 to 1000. Thread_2 now waits. Thread_1 outputs values from 1000 to 2000. Thread_1 is done. Thread_2 outputs values from 1000 to 2000. Thread_1 exits …

Member Avatar for sciprog1
0
94
Member Avatar for sciprog1

Hello, I have a JFrame, inside which is a JPanel, in which I am drawing lines in the paintComponent() function at an interval of 1 second. The screen always freezes. How can I change the program below such that I can see the lines being drawn after every second? Thank …

Member Avatar for Ezzaral
0
346
Member Avatar for sciprog1

Hello Members, Can anyone point me to a web link which has the java code for a simple game that uses the keyword synchronized and the thread synchronization functions, wait() and notify()? Thank you!

Member Avatar for sciprog1
0
50
Member Avatar for sciprog1

Hello, The following program has a JButton and a JLabel in a JFrame. I am using Flow Layout. How do I get the JLabel to show directly below the JButton before clicking the JButton and after clicking the JButton? Thank you! [CODE]import java.awt.event.*; import javax.swing.*; import java.awt.*; public class checks …

Member Avatar for sciprog1
0
94
Member Avatar for sciprog1

Hello, I have a program where if I click anywhere in a JFrame, a ball appears(using fillOval).If I happen to click on the ball once it has appeared, how do I make it disappear? Thank you!

Member Avatar for sciprog1
0
118
Member Avatar for sciprog1

Hello, I have a 800 x 800 board where I post several pictures by using the Image class and the drawImage() method. Each image is 100 x 100 in size. If I click at any location of this board, I can easily identify the top left coordinates(x,y) and the length …

Member Avatar for sciprog1
0
89
Member Avatar for sciprog1

Hello Members, I have a Class_A which extends a JPanel. This JPanel is inside of a JFrame. In Class_A, I have a series of images (stored in an ImageIcon array) and another image, let's call it Image_A, which is also a ImageIcon type. How do I make Image_A a background …

Member Avatar for sciprog1
0
177
Member Avatar for sciprog1
Member Avatar for sciprog1
0
73
Member Avatar for sciprog1

Hello, On the UNIX system that I am current working, to open a file in the pico editor ,I need to do the following: [CODE]>./pico filename.c [/CODE] Is there a script/command that I can execute which will remove the dot/slash and change that to: [CODE]> pico filename.c [/CODE] Thank you!

Member Avatar for sciprog1
0
73
Member Avatar for sciprog1

Hello Members, I have the following question about the pipe() system call. Say, Process A (my main()) forks a Process B which then forks a Process C. How can I open a pipe between Process C and Process A? I would like to write a sentence in Process C and …

Member Avatar for sciprog1
0
123
Member Avatar for sciprog1

Hello Members, I am trying to understand the pipe() system call. I found this program online: [CODE] #include <unistd.h> #include <stdio.h> #define MSGSIZE 16 char msg1[] = "hello #1"; char msg2[] = "hello #2"; char msg3[] = "hello #3"; main() { char inbuf[MSGSIZE]; int p[2], j; /* open pipe */ …

Member Avatar for sciprog1
0
169
Member Avatar for sciprog1

Hello Members, The wait() system call is illustrated to be used as follows: [CODE] int status, pid; /*fork a child process*/ /*parent is waiting for the child to terminate*/ pid = wait(*status) [/CODE] What exactly does the pointer to the "status" variable do when "status" has not even been assigned …

Member Avatar for sciprog1
0
132
Member Avatar for sciprog1

Hello, How do I send a class (that extends from JFrame) back and forth between Client and Server? I would grateful for any pseudocode. Thank you!

Member Avatar for sciprog1
0
276
Member Avatar for sciprog1

Hello, I have a Client/Server program. The Server is BlackJackServer.java. I am having the following exception when I run the program. Can anyone explain me what the error below is saying? [CODE]java.net.SocketException: Software caused connection abort: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at java.io.DataOutputStream.write(DataOutputStream.java:90) at java.io.DataOutputStream.writeUTF(DataOutputStream.java:384) …

Member Avatar for Ezzaral
0
165
Member Avatar for sciprog1

Hello Members, The following problem has troubled me for sometime now: I have an applet called FileA.java. It has two classes both of which are JPanels. Both these JPanels are then added to the applet in the public class of FileA.java. I use BlueJ. The program works well offline on …

Member Avatar for sciprog1
0
95
Member Avatar for sciprog1

Hello Members, The following Client/Server does a simple chat where I am able to send and receive one line at a time. How should I proceed if I were to send at aleast 4-5 lines at a time. Any help (with some sample pseudocode) would be of immense help. Thank …

Member Avatar for sciprog1
0
226
Member Avatar for sciprog1

Hello Members, How do I change the code below sothat I can have the JLabel at the center of the JFrame and the two JButtons directly below the JLabel? Thank you! [CODE]import java.awt.*; import javax.swing.*; public class Layout { public static void main (String args[]) { JFrame m = new …

Member Avatar for sciprog1
0
184