- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
35 Posted Topics
All, For the life of me I cannot get this program to compile. The error message "error: non-static variable this cannot be referenced from a static context" occurs on lines 23 and 24. Here is the entire program: [CODE]public class ThreadTest { public static int x = 0; public class … | |
All, I am somewhat confused by the way modern dbms handle timestamps. It seems as though date and time can be together in one field yet still be queried as if they were in different fields. Say I wanted to do a SELECT where time is between 1AM and 2AM. … | |
All, I'm trying to decide if I should use an auto-increment field or GUID field in a database. Either way I get a unique number identifying the record, so I'm not sure what way is best. Any thoughts? Thanks, -Bill | |
All, I want to insert data into 6 tables. One of those tables has a primary key field that auto-increments (let's call it ID). The other tables use that ID number as a foriegn key. My question is, how do I know what the newly generated value of ID is … | |
All, Anyone have any suggestions for completing the last line below: public/private define a variable's scope. int/char/double define a variable's type. static/non-static define a variable's ____________. I know what static variables are, I just can't think of a word or even 2 words to fill in the blank. (I'm building … | |
Re: I'll take a shot at this, and this may be a very naive idea since I've only been using SQL Server for a short time, but I think I'd put the database behind a master application and have the clients communicate with the master app instead of directly with the … | |
All, I don't understand namespaces. Yes, I read the msdn and some online tutorials and although they explain what namespaces are, they don't explain clearly what the benefit of using them is, why I need them, when I need them, and why they're generated automatically. I have 10 classes in … | |
All, How do I convert a DataTable double from a row object to a normal double? I'm creating the DataTable like this (note that Temp and Hum are doubles): private void readDummyData(DataTable dt) { string fileName = "dummydata.csv"; string[] lineCSV = new string[5]; StreamReader myReader = new StreamReader(fileName); // Define … | |
Re: I found the information and animations on this site quite useful: [sorting-algorithms.com](http://www.sorting-algorithms.com/) Of course, you should have a pretty good understanding of how each algorithm works before trying to figure out which one is which in your .jar file. Good luck, -Bill | |
All, I wonder if anyone has an opinion on this. What's better, this: // Diagonal checks if (board[0][0] == turn) { if (board[1][1] == turn) { if (board[2][2] == turn) { System.out.println(); System.out.println(turn + " IS THE WINNER!!!"); writeBoard(); return true; } } } Or this: // Diagonal checks if … | |
All, If you've ever visited the L.L. Bean website or some of the furniture manufacture websites you may have seen how you can pick a color and frabic and see how it's going to look on a particlular piece of cothing or furniture. Car manufucturers do it too on their … | |
All, Is this adeqaute to close all resources associated with clientSocket? public void readAll(String[] s) { using (TcpClient clientSocket = new TcpClient(host, port)) { NetworkStream clientStream = clientSocket.GetStream(); StreamWriter toOmega = new StreamWriter(clientStream); StreamReader fromOmega = new StreamReader(clientStream); toOmega.Write(readTemp); toOmega.Flush(); //Command is not sent until buffer is flushed s[0] = … | |
All, I am using lock() to try and sync threads writing to the same file, but my threads are still stepping on one another. Can anyone tell me why this doesn't work and how to fix it? Here is some sample code. In the real program the writes are very … | |
All, How do I get the `readSensor()` method to run in threads? Thread location1Thread; Thread location2Thread; Logger location1 = new Logger("187.20.150.20", 2000); Logger location2 = new Logger("187.20.150.21", 2000); // The next 2 lines lines result in the following error message: // "An object reference is required for the non-static field, … | |
All, I am pulling my hair out with this. I need to make a constant String avaiable to all classes in my program and I can't figure out how to do it. This is a simple console app... I've tried the obvious, `public static const myString = "whatever";` but I … | |
All, I'm trying to use a RichTextBox to display the revsion history of my program, and I can't figure out how to format the text (bold, italic, etc.). I'm using the String Collection Editor in the Lines Property. Anyone know how to do this, or if I should be using … | |
All, I am working on a project in C# with Visual studio 10 (on WinXP 32bit with .NET 4.0) and I need to use SQLite. I am totally confused by the SQLite installation process. [This FAQ](http://system.data.sqlite.org/index.html/doc/trunk/www/faq.wiki#q8) says that there is no need to install SQLite, but the [instructions given here](http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki) … | |
All, I am collaborating by email on a project with 2 other programmers. We're all pretty new to Visual Studio and C#. One of us is designing and bulding all the GUI forms, I'm doing the database work, and the third guy is doing the main app code. What files … | |
All, I am working on a simple program that reads temperature, humidity, and dew point from a sensor and logs the result to a .csv file. I am using netbeans and using alt-enter to surround code with try-catch whenever netbeans suggests. The result is pretty ugly and I can't imagine … | |
All, I am using Netbeans 7.2 to build a form. I added a Swing JTextArea to my form and all is well. I'd like to add a titled border to my JtextArea (or the JScrollPane in which it lives) but can't figure out how. I tried Right Click > Properties … | |
All, I am working on my first forms app (using NetBeans). I don't like to mix GUI code with app code, so I have my main class, GUI class and core code class nicely seperated. When the user clicks a button on the GUI form it calls a method in … | |
All, I usually write console apps, but now I have to do a forms app. Hopefully that will explain the sillyness of the following question: I created my project in NetBeans and NetBeans automatically generated a class with the project name, and this class has a main() method. Then I … | |
Re: I'm not sure what exactly you're looking for, but does this help? -Bill import javax.swing.JOptionPane; import java.text.DecimalFormat; import java.util.Scanner; /** * CIS-151, Input Validation Loop */ public class Checkpoint4_6 // Name the file. { public static void main(String[] args) { DecimalFormat formatter = new DecimalFormat("#0.00"); // Create decimal format object. … | |
This seems like a pretty basic question, but I'm still learning Java and all the nuances of OOP. I have several classes in my program and they all need access to the same ArrayList (the one with all the data in it.) What's the best way to share that list? … | |
All, I can't seem to find a good example of how to work with databases in C#. I'm using sqlserver and I can do simple things like insert and retrieve data, but when I am retrieving data I have to refer to the ordinal index values of the columns (reader[0], … | |
Re: I use [Audacity](http://audacity.sourceforge.net/) for editing .mp3 files. You posted in the C# forum--if you're asking about how to do this in C#, I have no idea. | |
Hi Folks, I just got a new 64 bit Windows 7 system and I'd like to install the 64 bit versions of Java and Netbeans. I found the 64 bit Java download here: http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u3-download-1501626.html But I can't find the 64 bit Netbeans. I'm pretty sure it exists because I see … | |
Re: That's exactly what is going to happen. You forgot to update numValue inside the while loop. It's stuck at the first value that entered before the loop. Also, the while loop is going to run as long as numValue is between 10 and 50. You need a NOT (!) before … | |
All, How do you specify a target framework version for the csc.exe c# compiler via command-line? I need to force csc.exe to compile for .NET Framework 2.0. I can target .NET 2.0 from VS, but VS is not an option in this case. I must work from the command line. … | |
All, I can't seem to find anything on the web about how to connect to a LibreOffice database. I am currently using the following code to connect to a MS Access database and would like to know how to change it to work with LibreOffice. [CODE]String strConnect = "jdbc:odbc:DRIVER=Microsoft Access … | |
All, This is driving me crazy. How come only the last thing I send to a textbox is displayed? In the following example I would expect 'abcdefghi' to be displayed then, 1 second later, '123456789' should be displayed. But the only thing I see is 123456789. What is going on … ![]() | |
All, I am using VB.NET in VS10. After I add items to a list box I'd like it to scroll down so that the most recent items are visible. I tried this with no luck: [CODE]StatusListBox.SelectedItem = StatusListBox.Items.Count - 1[/CODE] Can anyone tell me how to make the box always … | |
All, I am trying to build a simple event driven program to monitor a com port until there is data and then respond. The basic serial IO is working, but I can't figure out how to make it event driven. Specifically, how do detect when there is data ready to … | |
Hi All, I'm doing some serial I/O in VB.NET for a project at work. I'm new to VB.NET so I'm not sure if I'm doing this correctly. I need to determine what ports are free and which ones are in use. Presently, I try to open the port and if … | |
Greetings everyone, This is my first post, so I hope I don't break any rules by mistake... I am an experienced programmer trying to learn VB.NET. The problem I'm having is that it seems like strings have to be initialized differently than other types and I don't know what I'm … |
The End.