Posts
 
Reputation
Joined
Last Seen
Ranked #114
Strength to Increase Rep
+15
Strength to Decrease Rep
-3
93% Quality Score
Upvotes Received
305
Posts with Upvotes
291
Upvoting Members
185
Downvotes Received
29
Posts with Downvotes
24
Downvoting Members
16
79 Commented Posts
8 Endorsements
Ranked #233
Ranked #49
~785.53K People Reached
About Me

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
Favorite Tags
c++ x 754
vb.net x 314
c# x 283
c x 250
java x 216

1,443 Posted Topics

Member Avatar for Vongola_Takeshi

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 …

Member Avatar for Nivre
0
4K
Member Avatar for newtocplus432

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 = …

Member Avatar for mohannad_1
0
1K
Member Avatar for devfeel

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")); …

Member Avatar for k_8
0
2K
Member Avatar for abhijeet P

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]

Member Avatar for JamesCherrill
0
9K
Member Avatar for mldardy

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 …

Member Avatar for AssertNull
0
621
Member Avatar for berserk

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"

Member Avatar for berserk
0
476
Member Avatar for Joe_32

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?

Member Avatar for thines01
0
405
Member Avatar for rfrapp

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?

Member Avatar for pty
0
1K
Member Avatar for Mr.M

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 …

Member Avatar for thines01
0
3K
Member Avatar for JohnMcPherson

How much do you have set up as "static" from your main module? How much is initialized before main runs?

Member Avatar for JohnMcPherson
1
325
Member Avatar for kirtics34

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?

Member Avatar for happygeek
0
10K
Member Avatar for Plinth

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 …

Member Avatar for diafol
0
512
Member Avatar for Payge

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 …

Member Avatar for JamesCherrill
0
196
Member Avatar for jaelle

Your student array would not be a char pointer array. Student is now a new type.

Member Avatar for thines01
0
4K
Member Avatar for Faez_1

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: …

Member Avatar for thines01
0
218
Member Avatar for mohamed_91
Member Avatar for thines01
0
239
Member Avatar for Alex_65

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 …

Member Avatar for Joris Claassen
0
327
Member Avatar for _1_14

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

Member Avatar for tinstaafl
0
2K
Member Avatar for Stat_1
Member Avatar for thines01
0
334
Member Avatar for Mohamed_88
Member Avatar for azeez_2

If you search this forum, you will find someone working on practically the same thing.

Member Avatar for thines01
0
619
Member Avatar for zurena

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 …

Member Avatar for thines01
0
771
Member Avatar for Nantha_1

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?

Member Avatar for DeanMSands3
0
2K
Member Avatar for Leeroy_1

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 …

Member Avatar for rubberman
0
2K
Member Avatar for Josh_3

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 …

Member Avatar for tinstaafl
0
452
Member Avatar for Naeem_1

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?

Member Avatar for thines01
0
143
Member Avatar for Joe_29

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 …

Member Avatar for thines01
0
288
Member Avatar for lolici

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.

Member Avatar for thines01
0
399
Member Avatar for Abdelaziz_1
Member Avatar for thines01
0
118
Member Avatar for PulsarScript

What version of Visual Studio are you using? Can you use the built-in test-suite?

0
147
Member Avatar for Reymark_1

One way to do this is to attempt a SELECT on the desired record. If it does not exist, you can perform the INSERT.

Member Avatar for thines01
0
318
Member Avatar for jasminee

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.

Member Avatar for ddanbe
0
290
Member Avatar for arindam31
Member Avatar for keval_hack

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 : …

Member Avatar for Ahamed_1
-1
2K
Member Avatar for Falcon25

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.

Member Avatar for JOSheaIV
0
19K
Member Avatar for diya45

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.

Member Avatar for cronynaval
0
4K
Member Avatar for VIeditorlover
Member Avatar for JOSheaIV
1
1K
Member Avatar for skp03

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 …

Member Avatar for Mike_Gr
0
599
Member Avatar for terence193

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]

Member Avatar for panpwintphyu.loo
0
240
Member Avatar for ussra2

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.

Member Avatar for jwenting
0
9K
Member Avatar for kavi4u

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 …

Member Avatar for vaynenick
0
2K
Member Avatar for warlord902

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.

Member Avatar for brodiebyatt
0
1K
Member Avatar for 21334929

Dictionary<int, string> map_i2sData = new Dictionary<int, string> { {156, "fred"}, {176, "joe"}, {196, "bill"}, {106, "sam"}, }; Do you mean like this (above)?

Member Avatar for thines01
-1
66
Member Avatar for Andy90

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 …

Member Avatar for JMC31337
0
15K
Member Avatar for Labdabeta

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.

Member Avatar for Ancient Dragon
0
1K
Member Avatar for skran

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).

Member Avatar for Vinamra_1
0
355
Member Avatar for bhagawatshinde

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?

Member Avatar for deceptikon
0
5K
Member Avatar for roshan_iiita
Member Avatar for zeeshanmughal
Member Avatar for doaa.foudah
0
746
Member Avatar for supriya badam

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 …

Member Avatar for irum.nageen.3
0
2K

The End.