- Strength to Increase Rep
- +15
- Strength to Decrease Rep
- -3
- Upvotes Received
- 305
- Posts with Upvotes
- 291
- Upvoting Members
- 185
- Downvotes Received
- 29
- Posts with Downvotes
- 24
- Downvoting Members
- 16
I am a (mostly) self-taught programmer with a love for what is "best".I started out in 1982 on a Commodore Vic 20 programming in BASIC.I moved on to Fortran, Turbo Pascal, AWK, 80x86 ASM, C/C++, Visual C++, Java, Ruby, Python and finally…
- Interests
- Coding; especially with anything that let's me use LINQ!
- PC Specs
- MS Windows XP, Windows Server, Windows 7
1,443 Posted Topics
Re: You could start out with getting the user input of the word and then figure out the word length based on the left-over terminators. Start with something like this: [url]http://www.daniweb.com/software-development/assembly/code/270832[/url] ...then count the characters based on the start position until you run into a terminator. After that, you can copy … | |
Re: Here is a good resource on the switch/case/default statement( s ) [url]http://msdn.microsoft.com/en-us/library/66k51h7a(VS.80).aspx[/url] So, in your situation, you should treat the choices as characters. [CODE] int main(void) { char chrChoice = 'h'; double pay = 0; double rate = 35.0; double hours = 8; switch(chrChoice) { case 'h' : pay = … | |
Re: Certain collections are naturally suited to a DataGridView -- like a List<T^>. If I use a List<KeyValuePair<String^, String^>>^, I can store data in the DataGridView without additional manipulation: [CODE] System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) { List<KeyValuePair<String^, String^>>^ lst_kvp_s2s = gcnew List<KeyValuePair<String^, String^>>(); // lst_kvp_s2s->Add(KeyValuePair<String^, String^>("President", "Dave")); lst_kvp_s2s->Add(KeyValuePair<String^, String^>("Vice President", "Robert")); … | |
Re: Does this make a difference? (PKCS7 vs PKCS5Padding): [CODE=C#]rijndaelCipher.Padding = PaddingMode.PKCS7;[/CODE] and... [CODE=Java]Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");[/CODE] | |
Re: After I corrected the XML (like some of the others), I wrote this piece of brutal overkill :) I know if I had just passed the XDoc, I could use some of the built-in search functions. using System; using System.Collections.Generic; using System.Linq; using System.Xml.Linq; namespace DW_509677 { public class CAmazonTrackingObj … | |
Re: Does the "Job_active" value actually equate to a string that is "checked" or "unchecked"? Is the string check in your SQL code always case >>insensitive<<? "checked" does not equal "Checked" | |
Re: I'm still a little confused. What is an exact example of the output you expect? input = 1886.25 What do you want the program to show? | |
Re: Seemingly, the number has to be between 1 and 9, right? ...but if this is on a quiz, why would you want someone else to answer it? | |
Re: Without additional clarification (if you are using MFC, ATL, or .NET), here is a sample piece of code that reads a text file from a web server and extracts only the subtitles from what looks like story descriptions. The text is on [TextFiles.com](http://textfiles.com/adventure/221baker.txt). I use a WebClient with the method … | |
Re: How much do you have set up as "static" from your main module? How much is initialized before main runs? | |
Re: This looks like fun. Since it can be done in your language of choice, would you prefer it in C or some other language? Are you supposed to explain it when it's finished? | |
Re: If you have any of the MS Office products installed (especially Excel), you could experiment with VBA (Visual Basic for Applications) immediately. It's a fairly safe environment where you can understand how code flows and the use of functions and classes without needing to understand operating system quirks. Python is … ![]() | |
![]() | Re: Make an array of 21 integers (default the values to -1). When a number is entered, go to the offset representing that number and add 1 to it. Of course, the final value of each will need an additional 1 added to report true hit-count. It seems as if you … |
Re: Your student array would not be a char pointer array. Student is now a new type. | |
Re: You have lots of opportunity to create functions out of this and, eventually, a class. One option might be to take the code that determines the price for the game and separate into another function. Above main(), you could have a function that returns the float (price) based on numGame: … | |
Re: In addition to what rproffitt mentioned, what processor are you targeting? | |
Re: I would sincerely cut the program into functions. One function would do nothing but count lines in a file (using any technique you wish). One function would copy from source to destination based on the number of lines counted. Avoid printing (or screen writes) inside of the functions. Please forgive … | |
Re: Are you trying to GENERATE one or PRINT one or DISPLAY one? Have you reverse-engineered something like this?: https://www.codeproject.com/articles/20574/open-source-qrcode-library | |
Re: Can you isolate the login process to a single method so it's testable? | |
| |
Re: If you search this forum, you will find someone working on practically the same thing. | |
Re: 1) It would be nice to have a do-loop around your login function so the user will be forced to login or quit 2) Inside "mainMenu()" the test for the option should be shortend to JUST ensure a correct choice is made. Once made, the program can drop down to … | |
Re: This can be tricky depending on the cleanliness of the CSV. Was it created manually, or with Excel? Will there be commas in quoted fields? What compiler are you using? What techniques are you not allowed to use? | |
Re: Is this going to be a GUI or a console app? Will you use a database to keep the inventory and purchase history? I would imagine needing a database to determine the rebate (unless it's done immediately). BTW -- is the rebate on the original price or the price after … | |
Re: What compiler are you using and what is considered "off-limits"? You need to "group" your records by the ID. If your grouping container does not keep the same order as the file, you will need to index the records when they are selected. 1) Test for the presence of quotes … | |
Re: This sounds like fun. How are you going to start the program? What technique will you use to determine if a number is a prime? | |
Re: A single question in the question-key file could have its own class. You can then put all of the questions into a collection. I would imagine a structure of (QUESTION_NUM, QUESTION_VALUE, ANSWER) ...maybe tab-delimited The student's answer file would have a simpler structure (QUESTION_NUM, ANSWER) -- with the student ID … | |
Re: How do you know the default directory? It could be trying to save the file in an area where you don't have write-access. Simply using "test.txt" without specifying the directory/folder leaves you at the mercy of the last file-pointer. | |
Re: Can you write the program to run normally and then schedule it with the System task scheduler? | |
Re: What version of Visual Studio are you using? Can you use the built-in test-suite? | |
Re: One way to do this is to attempt a SELECT on the desired record. If it does not exist, you can perform the INSERT. | |
Re: For a project of this magnitude, you should probably try a site like [URL="http://www.codeproject.com/"]CodeProject[/URL]. But... If you have a specific question about some code you've written or that you are going to write, please ask it here. | |
Re: The first one would work in MS DOS with a Microsoft compiler using __asm{}, but that's stretching the "C or C++" concept a bit. Later versions of windows throw an error using this. I guess you could also do a direct memory write to screen memory. [CODE] // DW_380503.cpp : … | |
![]() | Re: Easier: public List<string> StageManagementList {get;set;} With the method you're showing, you would need a private stageManagementList declared right above that to support it. ...but, yes, that would eventually work. |
Re: First, start without syntax errors: [CODE]int[] array = new int[] { 3, 2, 1, 5, 4 };[/CODE] Then you can use something like the LINQ OrderBy or OrderByDescending methods. | |
Re: Making it web-only also creates some distance between the user/hacker and the source code. | |
Re: This really depends on how much [URL="http://www.example-code.com/csharp/encryption.asp"]encryption[/URL] you want: Depending on the video: A cheap trick could be to capture the first 100 bytes (or so) and store them elsewhere and zero-out the bytes in the original file (and of course, change the extension to something uncommon). ...then, to play … | |
Re: Since your function is called round2Int, you could have it just "return" an int and print it from main(). [CODE] int round2int(float test, float number) { return floor(test+.5); } [/CODE] | |
Re: Yes, you can modify that code for your purposes. Keep in mind, however, your function prototypes suggest there will be NO return values (void) for your functions. | |
Re: This only works when text is in the textbox. First create a KeyDown event handler: [CODE] private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode.Equals(Keys.Right)) { e.Handled = true; SendKeys.Send("{END}"); } if (e.KeyCode.Equals(Keys.Left)) { e.Handled = true; SendKeys.Send("{HOME}"); } } [/CODE] Then add the handler to the "Designer.cs" code: [CODE]this.textBox1.KeyDown … | |
Re: On the original question, I would say ASP.NET. You can learn one language (let's say C#) and use it all around. Web Services and WCF... You can leverage the power of ONE language (let's say C#) and use THE SAME CODE in both Web and non-web stuff. | |
Re: Dictionary<int, string> map_i2sData = new Dictionary<int, string> { {156, "fred"}, {176, "joe"}, {196, "bill"}, {106, "sam"}, }; Do you mean like this (above)? | |
Re: C# does not use header files. Everything is contained in the class itself. The framework reads the "assembly" to determine what is available to other classes that call it. You can put your classes in separate files or in separate projects. Even if you are calling them from c++, you … | |
Re: The #define group would have the least amount of memory impact, but don't understand why you're using the typedef in the same area. Speed is not (really) an issue, since they are evaluated at compile time. | |
Re: You won't be able to insert an actual NULL/Nothing into the database. You will need to use either the word " NULL " in your SQL or use DBNull.Value in your parameters (if you're using a parameterized query). | |
Re: 1. Have you printed the string to see what it looks like filled with values? 2. Does any of the data contain apostrophes? 3. Have you considered SQL parameters? | |
![]() | |
Re: Which part is confusing? a) Getting the data from the website b) Writing data in an excel file? | |
Re: The size of a string will depend on the language used to store it. Some languages use a terminator (like NULL or '$'), so the string will be the number of characters + the terminator. Some languages use a size indicator byte (like Pascal) where the first byte is the … |
The End.