Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
4
Posts with Upvotes
4
Upvoting Members
4
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
Ranked #2K
~40.3K People Reached
About Me

math and computer science teacher.

Interests
METAL MUSIC , travels , gymnastic , reading books , newspapers .
PC Specs
Intel Core i7 3770K , 1T sata2 disk , 4GB Ram
Favorite Forums
Favorite Tags
Member Avatar for nikolaos

I am trying to understand the structure of .class file in Java. Wrote a very simple program : package javautilities; public class Class_File_Structure { public static void main(String[] args) { int a = 10; int b = 20; int c = a + b; } } used the command javap …

Member Avatar for nikolaos
0
378
Member Avatar for nikolaos

/* PointOne type objects has three members. Two of type Integer and one of type ThreeD a custom class. PointOneClone method takes an argument of PointOne type and copy every value from his members to arguments members. So the result is a PointOne instance with the exact same values but …

Member Avatar for JamesCherrill
0
204
Member Avatar for nikolaos

Testing the following code from a book public class RunTime { public static void main(String[] args) { Runtime r = Runtime.getRuntime(); //MEMORY MANAGEMENT long mem1, mem2; Integer intmatrix[] = new Integer[1000]; System.out.println("Total memory is :" + r.totalMemory()); mem1 = r.freeMemory(); System.out.println("Initial free memory is :" + mem1); r.gc(); mem1 = …

Member Avatar for mKorbel
0
768
Member Avatar for nikolaos

ProducerConsumer_Using_ExecutorService class in a for loop initiate producer consumer threads using worker threads from ExecutorServiceThreadPool class. consumer thread takes an element from queue adding it to ArrayList consumerdata. Seems that consumerdata has no elements. why is that; Both producer - consumer threads seem to work. import java.util.ArrayList; import java.util.Iterator; public …

Member Avatar for nikolaos
0
4K
Member Avatar for nikolaos

In the following example two threads share int counter. The increment_thread thread increases counter by one . The decrement_thread thread decreases counter by one . I use semaphore to control access to counter instead of making the two methods synchronized. Is this the proper way of using semaphore? When should …

Member Avatar for nikolaos
0
382
Member Avatar for somjit{}

I saw a tutorial from a site where it showed the use of `ArrayBlockingQueue` as a thread-safe concurrent data-structure . Just for learning purposes , i tried to build something similar using synchronized and wait-notify methods in java. I'm hoping someone could guide me to some improvements and point out …

Member Avatar for ~s.o.s~
0
206
Member Avatar for nikolaos

One thread increases an integer named "counter" , and another decreases the same integer. Using synchronized statement on LockObject to control access to counter. If i understand correctly i have to use an Object reference. Can i use synchronized statement on counter somehow? public class Synchronized_Block_Demo { public static int …

Member Avatar for nikolaos
0
340
Member Avatar for mikewyatt

I am trying to change my database(s) from network to embedded. I believe that the driver is working and has found the database requested with the following code: try { // connect method - embedded driver String dbURL1 = "jdbc:derby:Databases/Armor"; Connection conn1 = DriverManager.getConnection(dbURL1); if (conn1 != null) { System.out.println("Connected …

Member Avatar for mikewyatt
0
4K
Member Avatar for reincom

` import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.net.URL; import javax.swing.JDesktopPane; import javax.swing.JFrame; import javax.swing.JInternalFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; public class Main1 extends JFrame{ JDesktopPane jdpDesktop; public Main1() { JFrame frame = new JFrame("MainForm"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jdpDesktop = new JDesktopPane() { @Override public Dimension getPreferredSize() …

Member Avatar for JamesCherrill
0
182
Member Avatar for wallet123

Hello guys, i created a method that would set the value of my string so that when i pass it to another class, it would still contain the needed value: This is the first class: public Student getSelectedStudent(){ Student selectedStudent = new Student(); DefaultTableModel dtm = (DefaultTableModel) tblListOfStudents.getModel(); String studentNum …

Member Avatar for nikolaos
0
159
Member Avatar for sasikrishnasamy

Hi, I have a problem while reading a jsp file. I have a jsp file called scan.jsp. It is a very big file having 9000 lines. It has java script codes, some imported files etc. Unable to read all lines of data when I try the following code. public static …

Member Avatar for sasikrishnasamy
0
256
Member Avatar for nikolaos

Using NetBeans 7.3.1 i have created a JFrame. A JLabel fills the bottom of the JFrame . The JLabel displays an ImageIcon. I want the ImageIcon automatically resize itself when JLabel resizes. Generated Code from IDE : jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Number_theory/resources/primes_ulam_spiral.gif"))); // NOI18N jLabel1.setDoubleBuffered(true); jLabel1.setOpaque(true); jLabel1.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(java.awt.event.ComponentEvent …

Member Avatar for JamesCherrill
0
643
Member Avatar for MichaelCJ10

I have a lottery program nearly completed, thought i had the last of the problems sorted but it seems i did not!! The program has a couple of issues. 1: Everytime i click a button it stores what i clicked, for example 10, and also creates a random number. Problem …

Member Avatar for nikolaos
0
246
Member Avatar for nikolaos

I am making a project in Number Theory and i want to display some formatting text in a textArea in my Gui. I have a method named padding which takes an integer as an argument and return a String consisitng of a number of spaces. This number is 12 - …

Member Avatar for nikolaos
0
927
Member Avatar for nikolaos

I want to list all files and directories from a start point using recursion. Here is my code. import java.io.File; import java.io.IOException; public class RecursiveWalk { void recursive (File[] allfiles) throws IOException{ for (File file : allfiles) { if (file.isDirectory()) { System.out.print("directory:"); System.out.println(file.getCanonicalPath()); recursive (file.listFiles()); } else { System.out.print(" file:"); …

Member Avatar for JamesCherrill
0
3K
Member Avatar for nikolaos

In a previous thread i had described a problem i had to transfer a frame or panel and all it's components as an image into a buffered image. I thought i had found the solution but it seems i am doing something wrong. In line 162 i call the method …

Member Avatar for NormR1
0
436
Member Avatar for nikolaos

I want to write a version of the SAND GAME. I want to examine the color of every pixel in a Jframe window. I use something like this. Toolkit toolkit = Toolkit.getDefaultToolkit (); Dimension dim = toolkit.getScreenSize(); int height = dim.height; int width = dim.width; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice …

Member Avatar for nikolaos
0
228
Member Avatar for karthikprs

Actually i'm planning to make a user registration page over swings and i decided that there should be a constraint that people with age below 21 cannot register. I want to make a validation of the date input of the user by calcualting the age and checking with if loop. …

Member Avatar for karthikprs
0
2K
Member Avatar for london-G

Hello, I would like to retrieve the data from one of my database table. I have read many stuff about it and found out that I need to create a table model which is quite confusing to me. Basically my table consists of customer information. What is the best way …

Member Avatar for nikolaos
0
1K
Member Avatar for nikolaos

How can i add some space between these four components and the JFrame window? ![jframe_view](/attachments/large/0/jframe_view.jpg "jframe_view")

Member Avatar for nikolaos
1
18K
Member Avatar for nikolaos

After login (if succeed) a user will see the result of statement "select test_column from table_test " execution. table_test is the only table of database 'test' which i have created in NetBeans 7.0.1. test_column is the only column. class '[B]MySQLTest[/B]' creates the gui for login , connects with the database …

Member Avatar for nikolaos
0
2K
Member Avatar for nikolaos

FROM Cisco Systems, Inc. Catalyst 2950 Desktop Switch Software Configuration Guide, 12.1(9)EA1 [URL="http://www.cisco.com/en/US/docs/switches/lan/catalyst2950/software/release/12.1_9_ea1/configuration/guide/swmstp.html#wp1031378"]http://www.cisco.com/en/US/docs/switches/lan/catalyst2950/software/release/12.1_9_ea1/configuration/guide/swmstp.html#wp1031378[/URL] [B]Synchronization of Port Roles[/B] When the switch receives a proposal message on one of its ports and that port is selected as the new root port, the RSTP forces all other ports to synchronize with the new …

0
71
Member Avatar for nikolaos

I have a public class change which holds the private static int [B]commonresource[/B] and the methods : public synchronized void [B]increment[/B](int inc) public synchronized void [B]decrement[/B](int inc) to handle the variable commonresource I have a main class which starts 2 new threads "nikos" , "fosses" with a constructor that takes …

Member Avatar for JamesCherrill
0
108
Member Avatar for scream2ice

Hi all The program i'm trying to write is meant to take a series of HTML codes as input and check to see if the all the tags in that code are matched or not (it should basically check all the opening tags and see if they have been closed) …

Member Avatar for verruckt24
0
853
Member Avatar for nikolaos

This is a poor implementation of quicksort in pascal. I will use it in the classroom for a demonstration in sorting algorithms (divide and conquer). I would appreciate if someone could help me a little with some improvements. [code=pascal] program quicksort; uses wincrt; const max = 10; type table = …

Member Avatar for LizR
0
252
Member Avatar for nikolaos

i am trying to make an autorun cd with a digital book in java. 1) How can i find out the cd or dvd drive letter in which has entered my cd? in the code section below i use this very ugly way to achieve this. 2)which is the best …

Member Avatar for Ezzaral
0
134
Member Avatar for nikolaos

i have the following struct [code] typedef char * typos_stoixeiou; typedef int metritis; typedef struct korifi *kdiktis ; struct korifi { typos_stoixeiou dedomena; metritis counter; int kleidi; int arithmospaidiwn ; korifi *a[100]; }; [/code] if i try this [code] for(int s=0;s<size;s++) { root->a[s] = (kdiktis)malloc(sizeof(struct korifi)); root->a[s] = NULL; }[/code] …

Member Avatar for Duoas
0
156