624 Posted Topics
Re: I don't even know how to make a 'Hello World' app in java, and I make more money with a 2 year technologist diploma writing in C#, VB.Net and VB6 than a Mechanical Engineer with 7 years experience and a nearly complete masters degree that also works for my company. … | |
Re: It is explicitly casting an integer to a double datatype. Dividing 2 integers yields undesired results as an integer divided by an integer will have an integer result (decimals get truncated). Go ahead and try it without the cast with values whose quotient is not a whole number. | |
Re: This is a simple example of how to do this with events/delegates: In Form1: [code] //Declare the delegate that will point to the text-setting method public delegate void TextChangeHandler(object sender, string s); //Declare the event that is to be raised when the text changes public event TextChangeHandler TextChange; //This button … | |
Re: Calling GC.Collect() will force the garbage collector to 'catch up' with memory freeing. And like Momerath said, calling Dispose() on a class that implements the IDisposable interface will tell the GC to free up the memory associated with the reference. I don't think this is [B]required[/B] as he said though, … | |
Re: C would have C++ in an armbar, but unfortunately the C developer made a typo in the finish_armbar() routine so he can't break off C++'s arm. C# would be watching the whole thing from across the street behind a thick glass bubble, chuckling to himself. | |
| |
![]() | Re: This doesn't seem to have anything to do with interfaces. If you don't want to have an instance of a class while still accessing its members you should consider making it a static class. (Assuming you are using a newer version of C# that supports automatic properties) [code] namespace myProgram … ![]() |
Re: Have him write a chess AI. That will keep him busy for a few months. | |
Re: [code] mydoubles[0,1]=myInput [/code] Seems like you should google Readline() | |
Re: He meant to say puzzle[i, j] = m. He was probably tired. | |
Re: It would be a good idea to put some error handling around networking code. Fortunately, C# has a try/catch/finally construct for situations like this... [code] try { //put your network code here } catch (SocketException se) { //put code here to handle a socket error (message box or a log … | |
Re: [URL="http://forums.whirlpool.net.au/archive/391152"]Seems like[/URL] in MSSQL that if you just subract an integer from a datetime it defaults to subtracting days. Not sure about MySQL though. Let me know if you have any success with just using an integer. Also, apperantly if you use a decimal it defaults to represent a fraction … | |
Re: Google has taken me [URL="http://www.codeproject.com"]here [/URL]enough times to remember the uri | |
Re: [QUOTE=Momerath;1649362]Two things: 1) [I]return[/I] ends the execution of the current method and if that method has a return type, tells it what value to return. 2) Both of your parameters are integers, so the division in your return statement is integer division. It is then converted to a double (the … | |
Re: I used to get laid. For some reason most girls just don't see the beauty in polymorphism or lambda calculus.... | |
Re: VB.Net and C# are nearly identical (they use the same framework). There's mostly just a few syntactial differences between the two. Instead of posting entire code blocks and expecting us to kindly convert it for you, try and learn these syntax differences and post any specific problems you might be … | |
Re: I am not sure you need to nest all of those if statements together. I mean, it will definately do what you want, it's just hard to look at from another programmers perspective. [code] string errString = ""; if (double.TryParse(aConstantTextBox.Text, out aConstant)) { if (aConstant == 0) { errString += … | |
Re: Might be a good learning experience to write your own ;) | |
| |
Re: I can't believe someone replied to the OP. That's probably the worst post I've ever seen on Daniweb. | |
Re: This might be lending any help to your problem...but why is there a Thread.Sleep() in that loop? It seems quite literally like a waste of time. | |
Re: What kind of functionality are you trying to accomplish? Usually threads aren't passed around the way you are describing and suspending a thread is not really supported anymore. Suspending is deprecated and should not be used, but Join() might be what you are looking for. I haven't really used it … | |
Re: [QUOTE=Evenbit;1624883]Actually, Roman Numerals are quite common in industrial settings. For instance, "25L" would mean 25 stacks of 50 items. You probably run into them quite often on a daily basis without realising it because you are simply not looking for them or simply unaware that that is what the letter … | |
I work for an instrumentation company as an in-house software developer. We are thinking of restructuring our database that we use to record data. I am wondering what would be more efficient. Basically theres an array of sensor values Starting at Data0 and ending with data appended with the sensor … | |
I work for an instrumentation company as an in-house software developer. We are thinking of restructuring our database that we use to record data. I am wondering what would be more efficient. Basically theres an array of sensor values Starting at Data0 and ending with data appended with the sensor … | |
Re: When you start writing scripts that write other scripts to solve a problem that you can't even remember anymore. | |
Re: Yes. Parse through the file building a string (the file contents) then if the bookmark keyword is encountered insert the 'special' text into the string, and carry on with the file/string building. | |
Re: [QUOTE=Lightning03;1625448]hi there guys I need help how do I make my check box a single click one? I have to double click my checkbox in order to select a particular item but I want to just click once. Any ideas how?[/QUOTE] Why are male students charged more?! By the way, … | |
Re: Seems like you need to save this data somehow.... A simple text file would suffice, but for settings like this I (and many others) prefer to go with XML. Example XML: <Settings> <button_data buttonID="1">C:\MyPath\File.exe</button_data> <button_data buttonID="2">C:\MyPath\File2.exe</button_data> <button_data buttonID="3" specialoption="RunInBackground">C:\MyPath\File3.exe</button_data> </Settings> Millions of tutorials on file IO and XML are available … | |
Re: dr is the temporary reference to the current DataRow in dtPeople.Rows . In a foreach statement, since you are not necessarily accessing an array like you would with a regular for loop there needs to be some way to reference the current item. In this case 'dr' does just that. | |
Re: Could you not write a stored procedure to do the backing up? [URL="http://www.noupe.com/how-tos/10-ways-to-automatically-manually-backup-mysql-database.html"]This[/URL] might help. | |
Re: As soon as you have a class directly accessing a specific form you are asking for problems... It is probably safer to use a function that takes a reference to a form instead. [code=csharp] public class Vehicle { protected float m_mpg; protected float m_tankCapacity; protected float m_odometer; protected float m_gasRemaining; … | |
Re: .Net has a class for that. [code=csharp] Random ran = new Random(); int i = ran.Next(10); //This will make i an integer between 0 and 9 for (int x = 0; x < i; x++) //Do stuff [/code] Hope this helps! | |
Re: select * from tbl_student_courses where studentID = myID insert into tbl_student_courses values (@myID,@otherdata) update tbl_student_courses set (otherdata=@myOtherdata) where studentID = myID Hard to tell how to help you since you didn't give us your database schema. These are some standard, non-specific examples that hopefully you may learn from. | |
Re: It might be useful to post your code that you have so far so that we can sugguest modifications. | |
Re: Without context or definitions of some of these functions/classes, it's hard to tell what isn't being initialized. Have you tried stepping through the code to find out exactly which line the error is occuring on? There's a few functions that I am not sure what they are doing. For example, … | |
Re: Try posting the work that you have done so far. If you are looking to be spoon fed the exact sql command to query your database, we are at least going to need to know a bit more about the database... SELECT LastBalance FROM tablename WHERE condition_is_true The condition will … | |
Re: Well...maybe post what you have learned in school so we can judge more precisely what 'not very advanced level' means. Is this an AJAX project? ASP.NET with C#? | |
Re: Please use code tags. To do this, put [ c o d e ] [ / c o d e ] around your code. It makes it easier for us to read. Seems like you need to put that randomizing code into a loop... [code=csharp] int[] numOccurrence = new int[12]; … | |
Re: Instead of sending back the whole dataset, maybe send back a class that contains the [B]changes[/B] made. Eg. [code=csharp] [Serializable] public class ClientRequestDBChange { public enum ChangeType { AddRecord, EditRecord, DeleteRecord } public ChangeType _ChangeType {get; private set;} public string[] _data {get; private set;} public string _table {get; private set;} … | |
Re: Well this isn't really a sequence since it must all be happening at the same time. SOmething like this might work: [code=csharp] private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.Modifiers == Keys.Shift && e.KeyCode == Keys.ControlKey) bKeysDown = true; } private void Form1_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode … | |
Re: OP - Being rude, whiney and racist will get you nowhere in life. I was about to just flame you into the ground, but seeing as you seem genuinely interested I decided to tone my post down a bit. I don't think any one person on this forum (or anywhere … | |
Re: Looks like that will work. Instead of using hardcoded values, maybe consider using the sizeof(int/etc) keyword. It will give you the size of a datatype relative to the current system architecture. This got me to thinking...there must be a way to make a generic class serializer that isn't as bloated … | |
Re: I wrote a fragmented file class to handle this sort of thing. This is a simplified version of it: [code=csharp] using System; using System.Collections.Generic; using System.Text; using System.Net.Sockets; using System.IO; namespace fragfile { public class FragmentedFileSender { private string _sourcePath; private int _fileBytes; private int _PieceSize; public FragmentedFileSender(string filePath, int … | |
Re: OR just use tab indexes. It is a property of all editable controls in .Net . Remember to set TabStop = true. Also, remember that TAB will increment the currently selected tab index, and Shift-Tab will decrement it. No use in writing custom event code for something that is already … | |
Re: The [B]EASIEST[/B] method would be to share a folder on both machines where files can be saved (ie full access). This would work best with only 2 players. Example: \\COMPUTER1\GameData\data.txt Have some sort of timer checking this folder for data on Computer1. If it has a file, load its contents … | |
Re: Hard to tell without actually seeing the machine. Try removing the battery and powering it with [B]only[/B] the AC adapter. If this doesn't work try holding the power button in for about 15 seconds. This will flush any residual power being stored in capacitors on your motherboard. If neither of … | |
Re: Yeah that kind of seems like overkill. I am not sure how many CPU cycles all that would take, but if you are using the random numbers for something useful (like a statistical simulation) the less CPU the better. I would say seeding Random() once with that method should suffice. … | |
Re: This really depends on how hard you want it to be to crack your software. If you are fine with about 15% of your target market using your software for free, just using a file containing an encrypted key unique to each distribution should work. This way they must enter … | |
![]() | Re: Not the most efficient algorithm, but pretty simple and self explanatory: [code=csharp] public long GetLargestPrimeFactor(long lNum) { List<int> iFactors = new List<int>(); //Get all the prime factors for (int i = 1; i <= lNum / 2; i++) if (lNum % i == 0) { iFactors.Add(i); lNum /= i; } … ![]() |
The End.