Gustavo Siqueira

Ranch Hand
+ Follow
since Jun 15, 2011
Gustavo likes ...
C++ Java Linux
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Gustavo Siqueira

I'm getting a ClassNotFoundException to try read object from socket. In Eclipse, I send an object that belongs the package com.messenger.client.User to the Socket. So, I build a jar file to that package.
Now, I going to Terminal Linux e run my server socket with the command javac -cp User.jar, then java Server

However, appears the following error:


After several attempts, problem was resolved. I compiled the Server with javac then java -cp User.jar Server.
10 years ago
Researching the title "Sun Certified Programmer for Java 6", I found the pdf available through from I would like if is legal or illegal.
In order to learn better regards between protocols TCP/IP and Socket, I solved make a simple web chat (desktop). I need to knows how many users are connected to socket, so I thought in store objects sockets in a ArrayList<Socket> in then return object socket for RMI. That's the better idea to that ? Other issue: How do I send the message to particular socket connected ?
Can someone me give advice ? Thank you!
Sure. We will return again. I have three class named: "Initial", "DisplayDocument" and "OpenFile"

Initial Class - That class have all functions to display a frame and menus to call another class. In other words, she extends JFrame.

DisplayDocument Class - That class is accountable for display the contents that the user opened in menu that contains in the "Initial" class, call "OpenFile".

OpenFile Class - That class implements ActionListener to listen the button "Open File" called by the user.

The issue is: I want display the contents of the file in the "DisplayDocument" class, just that.

In class "Initial" I already add the class DisplayDocuments. Therefore, when I run the program, that class already called.

Do you is with problem to understand my issue ?
11 years ago
I'm sorry. Do you can me give an example to fix it the problem ?
O code is compiling, however, is not displayed the componentes within of classe "DisplayDocument".
11 years ago
Sure: See an example:

The "Initial" class, add the "DisplayDocument" to your JFrame, once "Initial" extends JFrame. Therefore we will add:

In this same class, I have a button that will request to user to open file:

Thus, the "OpenFile" class, does all your functions to open the file required by the user:

Now, to have a good concept of OO, I though in display the file in the "DisplayDocument" class:

Thereby, I tryed created a instance from "DisplayDocument" or extends the "DisplayDocument" class to add components to it. However, not it worked!
11 years ago
In order, to a good concept of OO, I though in display contents of the class ''OpenFile" once called by the class "Initial" with "ActionListener" to open a file. Thus, "OpenFile" implements 'ActionListener' to open the file called by the class "Initial" that contains JFrame. Now, to display the contents of the file open by the user, I want display it in separate class. So, I created the class "ShowDocument" that extends JPanel to display the file open in the class "OpenFile". However, not is working creating a instance of 'ShowDocument'.

Thanks you in advance!
11 years ago
Thanks for your explanation!
I'm comprising. So, once that this algorithm is called divide-and-conquer, is a ways for to solve a given problem. Alright. But, because it is considered like worst-case in (theta of n-squared) ?
In terms of running time, this delay algorithm for run. In addition of algorithm to solve a problem, it has that run in time fast. There is a algorithm called Insertion sort, that in little lines make sorted of numbers.
For example, see the following exercise from book "Introduction to Algorithms":

We can express insertion sort as a recursive procedure as follows. In order to sort A[1..n], we recursively sort A[1..n-1] and then insert A[n] into the sorted array A[1..n-1]. Write a recurrence for the worst-case running time of this recursive version of insertion sort.

If possible, do you can me say exactly what means that such of 'worst-case' ? I really can not understand it.

11 years ago
I'm reading the book "Introduction to Algorithms". So, I caught this algorithm in this book. You no response my question: Why the method is executed three times for after to go to other method following ?
11 years ago
Hi, everyone!
I'm studying a algorithm called merge sort, in which i did in Java. But, I'm having problems to understand it.

So, when I run the program, is called the method mergeSort for to make the sorting of numbers. After , make the 'if', then is executed the method mergeSort(A, p, q); three times, and just after is executed the method mergeSort(A, q+1, r). Why that happens ?

Thanks you!
11 years ago
Yes.. The data not are being sent through from request.getParameter.
11 years ago

I'm trying develop a Newsletter with Javamail. So I thought in to use the ckeditor for the user send emails. However, I can't get values with servlet (request.getParameter("message");). The value is as blank.
How can to fix problem ?

Thanks you!
11 years ago