- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 3
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
49 Posted Topics
Hello, I am (still) writing a server+client application. I start the server. After a connection is accept()-ed, I start a thread to handle that connection. On the handler thread, I add the client nickname(String) and Socket to a Hashtable. [code=java] private Hashtable<String, Socket> clients = new Hashtable<String, Socket>(); clients.put(nickname, socket); … | |
Hi, I'm trying to create a thread for running some tasks. I copied the code from an old console application (which compiles fine), but can't figure out why it's not working now. I have searched for the error code and came across this suggestion: "Are you passing the name of … ![]() | |
Hello, I need to customize my [B]select[/B] control to allow the user to enter something manually. Let's say I have this: [code=html] <select> <option value="volvo">Volvo</option> <option value="saab">Saab</option> </select> [/code] I want to have another item in the select (first one), which, if selected, will allow the user to type in … | |
Hello and Merry Christmas to all! Can anyone explain the correct behavior of a web application: what PHP is used for, what JavaScript is used for? For now, I want to make a simple page with radio buttons, drop down lists and text areas. Some will have data from the … ![]() | |
Hello, I need to create ER + relational models. I've came across Embarcadero Studio Data architect, but I'm having some trouble using it. What's the problem? I want the bottom table (PunctLucruActivitate) IDFirma to be in a relationship with IDFirma from the left table (PunctLucru). It won't let me do … | |
Hi, What's the best way of integrating a Paypal button in a WinForms application? I can make a tiny WebBrowser and render the form html in it, but when clicking it, processing should be done by the default browser, not the WebBrowser in my application. LEdit: Or I could just … | |
Hello, I have a window's handle; with that, I want to restore the window = bring it to front, on top of any other windows I have, and set focus on it. The only way I can do that (using shortcuts, atm) is by minimizing the currently active window and … | |
Re: Could you post the XML ? | |
Re: You can determine a's length using: [code=java] a.length(); [/code] | |
Re: You need to move the return statement inside the try/catch block. | |
Hello, In case anyone has used the JADE multi-agent framework: Is it possible to run a Main container on a PC and a regular container on another PC over the Internet, rather than just LAN? | |
Re: Hey, I had the exact same problem. I found an answer here: [url]http://download.oracle.com/javase/tutorial/uiswing/components/table.html[/url] - Listening for Data Changes: [code=java] public class SimpleTableDemo ... implements TableModelListener { ... public SimpleTableDemo() { ... table.getModel().addTableModelListener(this); ... } public void tableChanged(TableModelEvent e) { int row = e.getFirstRow(); int column = e.getColumn(); TableModel model = … | |
Hello, After completing my application, my teacher told me I can't use serialization. I currently send objects using the writeObject / readObject methods. What's the easiest way of transitioning from this to something else? I'm thinking: [code=java] in = new BufferedReader(new InputStreamReader(socket.getInputStream())); out = new PrintWriter(new BufferedWriter( new OutputStreamWriter( socket.getOutputStream())),true); … | |
Re: Hello, I believe the algorithm you're looking for is Kruskal's Algorithm. Google minimum spanning tree. | |
Hello, let's say I have these classes: [code=java] public class ClassA extends JFrame{ private JButton btn1; private JPanel panel; public JPanel getPanel(){ return this.panel; } ClassA(){ this.setSize(500,500); this.setVisible(true); panel=new JPanel(new FlowLayout()); btn1=new JButton("LALALA"); this.add(panel); panel.add(btn1); } } public class ClassB { ClassA a; ClassB(ClassA a){ this.a = a; JButton button2 … | |
Hello, I'm making an application that supports sending text/files. It will use a server and 2+ clients. The clients won't communicate directly with each other, their messages will be forwarded by the server. My problem is this: in C++, after starting a client, I'd have 1 thread stuck on RECEIVE … | |
Hello, I want to code an application that calculates a program's complexity. I may have put this the wrong way: I want to count the operators, variables, function calls etc. in a C/C++ program. At first I thought about reading the .C file as a .txt file, looping through each … | |
Re: You traverse the first list. Let's say you're at element 0. You check your second list until you find an element = element 0 from the first list. Two elements (nodes) are equal if all their fields are equal. If you don't find an element from list2 = element 0 … | |
Hello, This is an extension of this thread: [url]http://www.daniweb.com/software-development/c/threads/357681/1525001#post1525001[/url] My purpose is to create a class that handles a network message. Irrelevant, anyway. CMyMessage: [code=C] #include "stdafx.h" #pragma once #include <conio.h> #include <stdio.h> #include <iostream> #pragma once using namespace std; typedef unsigned char byte; class CMyMessage { protected: byte type; … | |
Re: C++: [url]http://www.daniweb.com/software-development/cpp/threads/134017[/url] | |
Hello, I have a function that looks like this: [code=C] CMyMessage(char type, char *name, char namelen, char *text, char textlen){ ... ?! } ... void main() { char name[50]="JOHN"; char text[200]="testing123"; CMyMessage(1, name, strlen(name), text, strlen(text)); } [/code] The ranges are: Type = 0/1; namelen = 0..50; textlen = 0..200 … | |
Hello, My program looks something like this: [code=C] char *name= (char *)malloc(200); unsigned char type=1; unsigned char GetType(){ return type; } char* GetName(){ return name; }; void function(unsigned char* message, int* intPtr){ message[0]= GetType(); // works correctly // CODE HERE } void main(){ unsigned char *message= (unsigned char *) malloc(256); … | |
Re: Use the "%x" descriptor. [code] int a=0x1c2a; //hex format int b=10; //decimal format int c; c=a+b; printf("HEX sum: %x\n",c); printf("DEC sum: %d\n",c); [/code] This will display the Hex sum: 1c34 and the Dec sum: 7220. | |
Hello, I'm trying to understand a very simple example of using html + servlets using Eclipse EE. I have an [B]index.html [/B]: [code=html] <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Ze title!</title> </head> <body> <form action="MyServlet" method = post> <input type= text name … | |
Hello, I need to bypass the administrator password on a Vista PC: disable it/reset it. Additional problems: This must be done in the same session, as the machines have Deep Freeze. This also means I can't boot other OS. What could work is booting off a cd/dvd/usb, getting the password … | |
Hello, I'm trying to write a simple Clicker program to automate room-joining on GArena: 2 clicks to attempt to join, 1 attempt per 5 seconds. That means I have to simulate 2 x mouseButton1 clicks every 5 seconds - easy. The problem with my clicker, as well as with other … | |
Re: It seems inefficient to write 99 lines to a file each time you delete the 100th. Is that the only way to go? But then again, by the time you get to complex applications, you'll be using databases instead of .txt files. | |
Re: The answer above me (mKorbel at the time I was replying) is the definition of awesome. However, I'll have a pretty guessish go. I pulled this off oracle's site: [quote]The code result++; and ++result; will both end in result being incremented by one. The only difference is that the prefix … | |
Re: Each time you read an element from the txt file, you start a loop and compare it to all the elements read until that point. You probably also have to check the location where you dump the duplicates to be free of duplicates. If your data.txt is like this: AAA … | |
Re: The application exists when you enter -1 for gallons. What do you want to change? | |
Hey guys, I'm trying to code a testing app which will display questions on a JForm for a period of time. I need a way of keeping track of time so I know when the user's time is up. What should I use? So far, I've found these: [B]javax.swing.Timer[/B] [B]java.util.Timer … | |
Hello, I'm trying to change the look of java apps to something native. In my first JFrame, I'm using: [code=java] try { //org.fife.plaf.VisualStudio2005.VisualStudio2005LookAndFeel //de.javasoft.plaf.synthetica.SyntheticaStandardLookAndFeel //com.jgoodies.looks.plastic.Plastic3DLookAndFeel //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { … | |
I'm using a JTable with a DefaultTableModel. I use the Load Button for populating the JTable. Anyway, the problem I have is with the Delete row button. (defaulttablemodel.removeRow). This is the whole project: [code=java] package proiect1; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableColumn; import java.io.*; import javax.swing.event.*; import javax.swing.table.TableModel; import java.util.ArrayList; import javax.swing.table.AbstractTableModel; … | |
Re: You could get a String and add one line at a time to it, instead of individual integers. [code=java] String str="",output=""; try{ BufferedReader in = new BufferedReader(new FileReader("input.txt")); while ( (str=in.readLine()) != null){ output+=str; } in.close(); } [/code] After this, you could split the [B]output[/B] string into individual characters (numbers) … | |
Re: Sorry to barge in after it's been solved, but with the number being an integer to begin with, you could have written: [code=java] if (number<10) number*=10; [/code] Also, nest your if/else; they way you wrote it: it will test all your conditions. If Number isn't < 10 it most certainly … | |
I want to set up a connection to a Microsoft SQL Server 2005 express on my PC. [code=java] try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection( "jdbc:mysql://localhost/db1","xxxx","yyyy"); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT nume FROM tabel1"); while (rs.next()) { String s = rs.getString("name"); textArea.append(s); } } // Catches any … | |
Re: What exactly are you trying to do? can you post screenshots? | |
Re: "Perfect" could be referring to a prime number or to a number with an integer root, I guess. Most likely he's trying to print something when he gets to his predesignated n number. | |
Re: There's a link under the last post: [quote]Has this thread been answered? If this thread has been successfully resolved, please [U]Mark this Thread as Solved[/U] so that it can be added to our Knowledge Base and help others. Also, posters who replied appreciate knowing that they were helpful.[/quote] | |
Re: Why does this happen: I want the first window (one.jpg) to look like the second (two.jpg). What's wrong? | |
Hello, I want to use a JTable for displaying data loaded from a .txt file. The problem is that I don't see any methods for inserting a row. The code NetBeans generates is this: [code=java] jScrollPane1 = new javax.swing.JScrollPane(); tabel = new javax.swing.JTable(); label1 = new javax.swing.JLabel(); jButton1 = new … | |
I'm trying to read one line at a time from a .txt using FileInputStream. [code=Java] FileInputStream in = null; // Open an input stream in = new FileInputStream("out.txt"); int c; while ( (c = in.read() )!= -1 ) textArea2.append(new DataInputStream(in).readLine() ); in.close(); [/code] For this out.txt: [code=java] abc abc lalala … | |
Hello, I have a jTextArea I want to use as an accounts panel by an administrator. The admin can append user + " " + password + " \n" to the jTextArea (one line per user + password). When someone tries to log in, the idea is to iterate through … | |
Hello, I'm learning CSS and I've ran into a bit of a problem while trying to get a fixed footer to stick to the bottom of my page. I've searched the web and tried to adapt existing code to my page, getting everything inside a "wrapper" that's 100% height - … | |
Hello, everyone. I'm trying to learn MFC so I can create GUI's for a few projects I have in mind. I could really use your help with a few basic problems. I'm attaching a screenshot of my appointment book main window and the other dialog that shows after the ADD … | |
Re: What about [code=c] { a=new_value; b=a+x; } [/code] :/ | |
| |
Re: Hello everyone, Sorry for digging up this thread, but I have the exact problem. I tried all those 3 fixes and none worked. Is there any hope left? | |
Hello, I'm having problems passing an array of structures to a function by reference. Is this a) needed b) achievable? My assignment's requirements aren't very thorough, but it is however in the "Reference parameters" section. [CODE]struct x{ int a; // this is irrelevant float b; }stud[10]; void mod( ??? ){ … |
The End.