Click here to Skip to main content
12,762,098 members (39,273 online)

Comments by PIEBALDconsult (Top 200 by date)

PIEBALDconsult 9hrs 10mins ago View
Python. Definitely Python.
PIEBALDconsult 14hrs ago View
What file system? FAT-12? FAT-16? FAT-32? NTFS? Something else?
PIEBALDconsult 21hrs ago View
Why would you need to? I see no need for involving time.
Why not simply use Textbox_TextChange to toggle the state of the Label's Visible property?
PIEBALDconsult 2 days ago View
PIEBALDconsult 2 days ago View
Definitely avoid Interop.
I prefer to use the ACE Engine and the OleDb classes.
PIEBALDconsult 19-Feb-17 11:13am View
Maybe you want a switch/case statement?
Or Reflection?
PIEBALDconsult 18-Feb-17 13:44pm View
Among other things, you need to learn about separation of concerns.
PIEBALDconsult 17-Feb-17 15:26pm View
For what purpose?
PIEBALDconsult 17-Feb-17 14:50pm View
Responding to ancient questions, particularly with a link to some site, is questionable behaviour and may be abusive. Please don't do that.
PIEBALDconsult 13-Feb-17 20:25pm View
By using your brain, and maybe a notepad.
PIEBALDconsult 13-Feb-17 19:31pm View
Which base?
PIEBALDconsult 11-Feb-17 0:18am View
Don't care.
The spec says "collection of items" -- a NULL _should_ result in an Exception.
PIEBALDconsult 10-Feb-17 19:33pm View
It ought to. Depends on how the type is defined. I leave all the heavy lifting up to the Dictionary, so blame Microsoft if it doesn't work. :shrug:
PIEBALDconsult 10-Feb-17 11:58am View
I find that a Dictionary works better.
PIEBALDconsult 10-Feb-17 10:56am View
Surely, you're maintaining only _references_ to the items.
And I expect that two Hashsets is overkill.
PIEBALDconsult 6-Feb-17 8:56am View
Does that return only the maximum sum? Not the subarray?
PIEBALDconsult 5-Feb-17 20:17pm View
PIEBALDconsult 5-Feb-17 18:59pm View
If you seek the _longest_ subarray with the greatest sum, it's [ 1 , -1 , 2 ]
PIEBALDconsult 5-Feb-17 15:45pm View
I can only suspect that it involves the oddities of integer mathematics.
PIEBALDconsult 5-Feb-17 1:11am View
But there are two congruent yet distinct solutions.
PIEBALDconsult 4-Feb-17 23:03pm View
I think that part of the spec is total BS.
PIEBALDconsult 4-Feb-17 23:02pm View
I agree. Unclear and weird spec.
PIEBALDconsult 4-Feb-17 22:53pm View
Pedants. The word is pedants. (He said pedantically.)
PIEBALDconsult 4-Feb-17 20:58pm View
Right on. (Both of you.)
In my opinion (though not in my implementation), there may be multiple result sets.
The question from 2015-07 asked for the longest subarray, but there may yet be more than one suitable result set.
PIEBALDconsult 4-Feb-17 19:24pm View
But there are more subarrays that sum to 5 in there.
PIEBALDconsult 4-Feb-17 19:18pm View
No, it's asking for an array, not the sum.
PIEBALDconsult 4-Feb-17 19:17pm View
PIEBALDconsult 4-Feb-17 19:05pm View
How about building a Dictionary<int,HashSet<int[]>> ?
Then enumerate each array, putting elements in the Dictionary.
Then, given an element from array X, you can look whether or not the set of arrays that contain that element contains array Y.
PIEBALDconsult 4-Feb-17 14:35pm View
Does that satisfy the specification "find the set of consecutive numbers ... the answer is an ... array" ?
PIEBALDconsult 4-Feb-17 14:30pm View
No "solution" should be provided for such a noobish question.
PIEBALDconsult 4-Feb-17 11:44am View
What should be the result of
5 -5 5 -10 5 -5 5

Or even:
5 -5 5 -5 5
PIEBALDconsult 4-Feb-17 11:35am View
Which compiler are you using?
PIEBALDconsult 4-Feb-17 11:25am View
I see only
Statement missing ; in function main
because you left the semi-colon off one of your statements -- you should be able to figure it out.
PIEBALDconsult 4-Feb-17 10:58am View
I disagree with an empty array summing to zero.
PIEBALDconsult 4-Feb-17 10:50am View
I did, but in C#. I guess I can post it anyway.
PIEBALDconsult 3-Feb-17 23:23pm View
Pffft. Arrays are sooo last millenium.
Yet this sounds familar. As if it has been asked here before...

PIEBALDconsult 3-Feb-17 23:23pm View
I agree. Maybe he meant "positive"?
PIEBALDconsult 31-Jan-17 14:54pm View
Please stop doing that, or you will likely be kicked out.
PIEBALDconsult 31-Jan-17 14:53pm View
Posting links as solutions to ancient questions smells of SPAM. Please don't do that.
PIEBALDconsult 31-Jan-17 8:25am View
That doesn't help. Please put the relevant parts (not the whole thing) in your question -- Improve question.
PIEBALDconsult 31-Jan-17 8:25am View
You should not have the communication code within your GUI code. It should be in its own class. Instantiate one object of that class and allow each Form to use that one instance.
PIEBALDconsult 31-Jan-17 8:22am View
Ummm, the classes in System.Data.OracleClient are _not_ recommended.
PIEBALDconsult 30-Jan-17 0:01am View
You'll never get anywhere in life like that.
PIEBALDconsult 29-Jan-17 23:55pm View
Well, if I knew how to access .net from Pascal... :cool:
PIEBALDconsult 29-Jan-17 23:54pm View
My algorithm uses it. If I could be assured of 64 or fewer strings, I'd use bitwise operators on an Int64 instead.
PIEBALDconsult 29-Jan-17 20:52pm View
On the other hand...
Turbo Pascal (5.5+) has OOP, and HP Pascal probably doesn't -- I learned "data structures" on VAX/DEC/HP Pascal back in the 80s.
I have a working implementation in C# to prove an algorithm I devised.
But I would have to implement HashSet and Dictionary myself and I don't think I'm up to that at this time.
PIEBALDconsult 29-Jan-17 17:32pm View
I might have an XP disc around here somewhere, but I wouldn't send you my key.
PIEBALDconsult 29-Jan-17 12:36pm View
I did, both are OK in my opinion. I have no problem with these questions. His attitude lacks a bit though.
PIEBALDconsult 29-Jan-17 12:34pm View
I don't really understand question.
The Sieve algorithm requires that you start at the start, not in the middle.
It is possible to _extend_ a sieve -- if, say, you have a Sieve from 1 to 100 and want to extend it to 200, you can use the Primes you already found and then start from 101.
But I see no way to simply start at 101 and go to 200 without having the set of Primes that precede that range.
You could even have a database of Primes if you like.
PIEBALDconsult 29-Jan-17 12:21pm View
This is not an answer, please delete it.
PIEBALDconsult 29-Jan-17 12:21pm View
This is not an answer, please delete it.
PIEBALDconsult 29-Jan-17 12:20pm View
Ahem, I, too, enjoy doing Sieves as exercises.
PIEBALDconsult 29-Jan-17 12:18pm View
I don't recommend starting at 1 at all.
I don't even start mine with 2, I always start at 3.
PIEBALDconsult 28-Jan-17 20:29pm View
Yeah, I loved Pascal back in the day, particularly Turbo, but once I became comfortable with C I stopped using it. I can't even read my Pascal programs from college anymore.
PIEBALDconsult 28-Jan-17 12:59pm View
If I wanted it I'd have it already. I used to use Turbo Pascal (and Turbo C), but I don't anymore.
PIEBALDconsult 28-Jan-17 10:04am View
I suppose you're correct.
PIEBALDconsult 28-Jan-17 10:04am View
:cough: Win 7 :cough:
PIEBALDconsult 27-Jan-17 22:44pm View
How about the wrongest substring...
PIEBALDconsult 27-Jan-17 18:45pm View
Well, how are BCPL and B considered C-like? They came first! (And second.)
PIEBALDconsult 27-Jan-17 18:42pm View
VB is not allowed, real BASIC is.
I have VAX BASIC, HP BASIC, and Turbo BASIC...
PIEBALDconsult 27-Jan-17 18:19pm View
I think I have Pascal on one of my AlphaServers. I have a license. I also have a license for COBOL...
PIEBALDconsult 24-Jan-17 18:37pm View
I would just handle it in reporting, report only the final vote by each user. I don't like systems that don't allow users to correct their votes.
PIEBALDconsult 23-Jan-17 23:35pm View
What tools are you using? The ACE engine?
PIEBALDconsult 23-Jan-17 9:03am View
Right, no string _manipulation_ -- such as concatention and substring, I don't even want to use string compares. I have the one IndexOf per value to determines integerness, and I'd like to eliminate that.
You can _have_ strings, but not manipulate them.
PIEBALDconsult 22-Jan-17 21:56pm View
Names of parameters may not begin with a digit maybe?
PIEBALDconsult 22-Jan-17 20:12pm View
"Property" is the better answer. But it may still be a bad question
PIEBALDconsult 22-Jan-17 20:10pm View
No, I do want to use strings, you _have_ to use strings, but string _manipulation_ should be avoided.
PIEBALDconsult 22-Jan-17 20:00pm View
Well, you need only "pad" once you determine that the two values are identical up to the length of the shorter -- no need to "pad" prior to that.
PIEBALDconsult 22-Jan-17 13:12pm View
Just posted another comparer that shows another technique -- though I am still seeking a non-string-manipulating technique.
PIEBALDconsult 22-Jan-17 12:58pm View
Ah, now that would simplify things (for they who want to do use string manipulation); rather than "padding" the shorter value, simply compare the two candidate concatenations. :D That's much more straight-forward.

I just posted a new comparer that does that. It seems to work, but I want to avoid string manipulation. I have something whacky in mind...
PIEBALDconsult 22-Jan-17 12:49pm View
Aha... hmm...
Sooo... use the leading characters from the longer value to "pad" the shorter value maybe...
PIEBALDconsult 22-Jan-17 12:31pm View
Mine does not pad at all, I think you replied to the wrong poster.
_If_ padding is done (and that will kill performance), then when comparing 24 with 242, the 24 should pad to 244 -- the last digit of the shorter value should be repeated enough times to make the strings equal in length.
PIEBALDconsult 22-Jan-17 12:26pm View
"but then it's no longer a one liner. Where is the fun in that"
You can have either one-line or performance; you can't have both.
PIEBALDconsult 22-Jan-17 12:13pm View
Mine produces:
242 24 ==> 24 242
PIEBALDconsult 22-Jan-17 11:56am View
And it's homework, but that's beside the point, it does not need to go to moderation a dozen times.
PIEBALDconsult 22-Jan-17 11:49am View
2 and 222 are equal, but 20 and 200 are not, which is why I give the shorter value precedence whenever my first compare says they're equal.
PIEBALDconsult 22-Jan-17 11:31am View
Ah, OK.
PIEBALDconsult 22-Jan-17 11:27am View
Yes, and mine does
94 9 1 112 ==> 9 94 112 1
PIEBALDconsult 22-Jan-17 11:25am View
Mine produces:
26 254 250 248 246 245 241 235 232 227 224 2 222
PIEBALDconsult 22-Jan-17 11:22am View
I see a problem here:
discopr = int(origpr * .2) #answer to the property sells when reduced by 20%
PIEBALDconsult 22-Jan-17 11:00am View
2 precedes 222
PIEBALDconsult 22-Jan-17 10:45am View
As per my second comparer. No padding or other string manipulation required. Just character compares and integer compares to break ties.
PIEBALDconsult 22-Jan-17 2:43am View
Not sure, but
cmd.Parameters.AddWithValue("@Pic", SqlDbType.Image).Value = ms.ToArray
looks wrong. Start there.
PIEBALDconsult 22-Jan-17 2:41am View
Ah, OK.
PIEBALDconsult 22-Jan-17 2:38am View
Padding should be avoided.
PIEBALDconsult 22-Jan-17 2:27am View
And how do you figure 51 elements?
PIEBALDconsult 22-Jan-17 2:12am View
New comparer produces:
9 99 98 91 90 84 81 70 67 61 53 52 51 43 42 41 40 31 248 246 245 24 234 233 229 228 223 220 215 203 200 193 191 186 180 179 169 156 151 150 145 142 139 135 123 122 120 115 109 106
PIEBALDconsult 22-Jan-17 2:03am View
I'm on it, just testing now...
PIEBALDconsult 22-Jan-17 1:17am View
I don't; why would I?
Hmmm... I think I see the problem...
PIEBALDconsult 21-Jan-17 17:44pm View
A Set in the mathematical sense.

And no two marbles are actually the same.
PIEBALDconsult 21-Jan-17 14:24pm View
Oh shoot, a Set doesn't allow duplicates, my solution (so far) allows duplicates, but I can easily change that or make it configurable...
PIEBALDconsult 21-Jan-17 13:47pm View
Just told mine to accept "6.7E+1" as an integer... :D
PIEBALDconsult 21-Jan-17 1:42am View
Did you see my comment on the challenge?
PIEBALDconsult 21-Jan-17 1:05am View
"To keep the problems suitably ambiguous."

I would not be so restrictive; he did _not_ ask for Int[]/List<int> .
PIEBALDconsult 21-Jan-17 0:30am View
Strings are easier...
PIEBALDconsult 20-Jan-17 18:48pm View
"To keep the problems suitably ambiguous."

1 == 1
5 == 101
9 == 1001
67 == 1000011

PIEBALDconsult 16-Jan-17 16:56pm View
Except languages (e.g. German) that use four-and-twenty (vier-und-zwanzig) -- mine can't do that.
PIEBALDconsult 16-Jan-17 16:53pm View
I use BigInteger in mine. Muhahaha...
PIEBALDconsult 16-Jan-17 16:52pm View
Right. It seems this problem inherently lends itself to an iterative solution and SQL isn't really suited to that. A Recursive Common Table Expression might be required.
PIEBALDconsult 14-Jan-17 10:46am View
I have reviewed the code I wrote in the fall of 2013 and it lacks only the ability to put in commas and "and" ; I'll add that feature, but the code is already ten pages long and unsuited as a QA Solution, so I think a Tip is in order...

System.Console.WriteLine ( 1203.ToString<piebald.types.shortscale>() ) ;
One Thousand Two Hundred Three
PIEBALDconsult 13-Jan-17 21:49pm View
This is one of the topics I love to hate.
PIEBALDconsult 13-Jan-17 21:31pm View
Seriously. And multiple languages and stuff. Seems I wrote it more than three years ago and haven't touched it since. It needs work.
PIEBALDconsult 13-Jan-17 20:12pm View
He wants a T-shirt...
PIEBALDconsult 13-Jan-17 16:29pm View
I'll take three of each.
PIEBALDconsult 13-Jan-17 16:29pm View
"You didn't specify the range of ints to be tested or the Scale Mode[^]. "

If'n I recall correctly, my version supports both scales, but I'll have to review it when I get home.
PIEBALDconsult 10-Jan-17 22:04pm View
That's because I didn't try very hard. This is outside my comfort zone.
PIEBALDconsult 10-Jan-17 21:58pm View
Yes, just not an optimal one, and I know it.
PIEBALDconsult 10-Jan-17 19:23pm View
You reeeally don't want to be posting your email address on a public forum.
PIEBALDconsult 10-Jan-17 16:06pm View
There is never one correct solution to anything.
PIEBALDconsult 10-Jan-17 8:31am View
I said "non-optimal", are any of the points outside the circle?
PIEBALDconsult 9-Jan-17 8:39am View
Right, you don't choose between using the head or the handle of a hammer, you use the whole hammer.
PIEBALDconsult 8-Jan-17 16:42pm View
PIEBALDconsult 6-Jan-17 15:31pm View
Got sample data and test results?
PIEBALDconsult 3-Jan-17 17:56pm View
PIEBALDconsult 22-Dec-16 14:42pm View
Nope. Any reason not to use SSMS or SSIS?
If the two databases are in the same instance, SELECT INTO might work if your needs are simple.
Just this week I started using SMO; there are a few Articles here on CP.
PIEBALDconsult 16-Dec-16 18:08pm View
Kinda... don't?
Better to supply the definition of a method and have the user provide only the filling.
PIEBALDconsult 16-Dec-16 15:22pm View
PIEBALDconsult 14-Dec-16 18:25pm View
Regular Expressions maybe?
PIEBALDconsult 11-Dec-16 11:06am View
I try not to vote for or against myself.
PIEBALDconsult 10-Dec-16 12:50pm View
As for caching, why not add numbers and their prime factors only as they're encountered in the input?
PIEBALDconsult 10-Dec-16 11:32am View
Exactly; 1 is a reasonable value for GCD.
PIEBALDconsult 10-Dec-16 11:02am View
Don't you need the primes only up to the square root of Nmax (or half)?
PIEBALDconsult 9-Dec-16 17:42pm View
Homey don't play dat.
PIEBALDconsult 9-Dec-16 16:19pm View
I thank you. Elvis thanks you. Elvis thanks you very much.
PIEBALDconsult 9-Dec-16 15:42pm View
I have not yet. My code is not very interesting; very workman-like. I'll likely post it later as an anti-example.
PIEBALDconsult 9-Dec-16 15:23pm View
Why would all numbers need to be positive? Mine works for negatives as well as zero.
And what about a single-item list?
PIEBALDconsult 9-Dec-16 14:54pm View
Surely you can perform the tasks of index_of_min and remove_zeroes within reminders.
No need to enumerate the list three times per iteration.
As you calculate the reminders (remainders), keep track of the index of the min, and also swap out zeroes.
PIEBALDconsult 9-Dec-16 13:45pm View
"Points for the most unexpected code"

I might need to create a language named "Spanish Inquisition".
PIEBALDconsult 9-Dec-16 13:14pm View
You might want to try using only prime numbers as divisors.
PIEBALDconsult 9-Dec-16 13:13pm View
Did he have to handle 500 items at once?
PIEBALDconsult 7-Dec-16 19:17pm View
0) Please learn to use parameters -- never use string concatenation to provide values.
1) If you want only one value from the database; please look into ExecuteScalar.
PIEBALDconsult 7-Dec-16 19:01pm View
Replace each newline with a SPACE. Done.
PIEBALDconsult 7-Dec-16 18:59pm View
A DataAdapter will Open and Close the Connection for you automatically. But please don't use DataAdapters; they suck.
PIEBALDconsult 4-Dec-16 16:20pm View
Try String.Split
PIEBALDconsult 4-Dec-16 10:00am View
I agree. And mine should do that.
PIEBALDconsult 3-Dec-16 17:43pm View
And what do you think is correct?
PIEBALDconsult 2-Dec-16 8:49am View
Been there, done that. I'll resurrect some ancient code.

And don't forget this little beauty...

PIEBALDconsult 1-Dec-16 19:35pm View
Please do not ever add anything to a database that does not belong to you.
PIEBALDconsult 1-Dec-16 19:01pm View
Maybe call the Garbage Collector between tests as well so bloat in one solution doesn't adversely affect the others.
PIEBALDconsult 1-Dec-16 18:49pm View
But with different configurations.
PIEBALDconsult 1-Dec-16 18:30pm View
Some unbalanced tests as well. Such as having only the "bonus" test for mine (3) compared to the "basic" tests for the others.
I'm about to make a basicReplacer and see how it goes.

static PIEBALD.Type.ReplaceOmatic replacerBasic = new PIEBALD.Type.ReplaceOmatic
new Tuple<string, string="">("PHB", "boss"),
new Tuple<string, string="">("gotten", "become"),
new Tuple<string, string="">("poophead", "p**phead")
PIEBALDconsult 1-Dec-16 8:41am View
Was up until 00:30 trying things. Will get back on it tonight.
PIEBALDconsult 1-Dec-16 2:10am View
Not if it doesn't replace "gotten" with "become".
PIEBALDconsult 1-Dec-16 1:52am View
I don't remember.
It's _all_ free with MSDN from my employer. :cool:
I have downloaded and installed VS 2015 on a junker system and now I'm trying to validate your tests.
I note that solution 10 doesn't meet the requirements.
PIEBALDconsult 1-Dec-16 0:51am View
I wrote a Set class in C# years ago. It's basically obsolete now that .net has HashSet.
PIEBALDconsult 1-Dec-16 0:33am View
I don't see how a simple wrapper around an existing class will satisfy the assignment.
PIEBALDconsult 1-Dec-16 0:25am View
No. The whole point is to keep people from doing that.
PIEBALDconsult 30-Nov-16 22:33pm View
We won't do your homework.
PIEBALDconsult 30-Nov-16 22:31pm View
Yes, and VS 2010 can't open it. :D Then I edited the Solution and Project files so VS 2010 can open it and it doesn't understand the nonsense code.

I also had trouble posting earlier. I have updated my code and Article.
PIEBALDconsult 30-Nov-16 17:47pm View
Cool. If you used the code I have attached to mine (3?), then it's probably not the latest because I forgot to update the attached code file.
And, if multiple runs are made I hope you didn't throw out the instance between runs.
I have updated my code and Article.
PIEBALDconsult 29-Nov-16 20:14pm View
Yes. You can.
How would you do it with a deck of cards?
PIEBALDconsult 29-Nov-16 18:52pm View
Does the filter indicate whether or not anything was replaced?
PIEBALDconsult 29-Nov-16 18:51pm View
Oh, the humanity! Wasteful wasteful. You throw away perfectly good information that can be used later.
You don't even allow for multiple keys to match a word.
PIEBALDconsult 28-Nov-16 20:33pm View
Unclear. That's what you asked for.
I recommend you get something like Expresso to develop and test your Regular Expressions.
PIEBALDconsult 28-Nov-16 19:14pm View
How does that handle p00p and cr@p?
PIEBALDconsult 27-Nov-16 17:26pm View
Are your replacements hard-coded?
PIEBALDconsult 27-Nov-16 14:22pm View
Why not

I would add
if ( !characterCount.ContainsKey(character) ) characterCount [ character ] = 0

And I never use var, which is needless here.
PIEBALDconsult 26-Nov-16 19:42pm View
The only rule is "no profanity". :cool:
PIEBALDconsult 26-Nov-16 16:37pm View
Python is never the answer.
PIEBALDconsult 26-Nov-16 16:10pm View
Please study up on parameterized statements. Do not use string concatenation to form an SQL statement.
PIEBALDconsult 26-Nov-16 16:09pm View
Without more detail I recommend simply using the DOS FIND command rather than writing something.
PIEBALDconsult 26-Nov-16 15:09pm View
Maybe you should have made it another "Code Lean and Mean" contest.
PIEBALDconsult 26-Nov-16 15:02pm View
We will not do your homework.
PIEBALDconsult 26-Nov-16 10:10am View
We will not do your homework.
PIEBALDconsult 26-Nov-16 10:08am View
We will not do your homework.
PIEBALDconsult 26-Nov-16 1:07am View
Console.WriteLine("What have you been smoking?");
PIEBALDconsult 26-Nov-16 0:14am View
Console.WriteLine("The time is {0:HH\\:mm}" , myTime);
PIEBALDconsult 25-Nov-16 20:49pm View
There's no such thing as "military time".
PIEBALDconsult 25-Nov-16 19:49pm View
Did someone say "poop"?
PIEBALDconsult 25-Nov-16 13:38pm View
I call bullpoop.
PIEBALDconsult 25-Nov-16 12:56pm View
I'm sure he just hasn't gotten around to correcting his bad habit.
PIEBALDconsult 25-Nov-16 12:09pm View
"For Christmas I had gotten a sugar plum fairy."
PIEBALDconsult 25-Nov-16 11:55am View
It's easier if you program to the Interfaces rather than specific classes.
I strongly advise against Access, but if you use it, use the ACE engine, not the JET engine.
Have you considered SQL Server CE?
PIEBALDconsult 25-Nov-16 11:26am View
Pffft. It's not like I asked about the First Unresolved Character Kernel.
PIEBALDconsult 25-Nov-16 11:15am View
Sooo... if I have a local variable to point to the The Word and I name it tw, that's OK, but I can't have another local variable pointing to The Word After That named twat?
PIEBALDconsult 25-Nov-16 10:36am View
"My PHB is such a POOPHEAD!" should become "My PHB boss is such a P**PHEAD!"
PIEBALDconsult 20-Nov-16 14:40pm View
I did; he's bitten off too much methinks.
But learning array-based linked lists might be a worthwhile precursor to learning pointers.
PIEBALDconsult 20-Nov-16 14:27pm View
Removing an item from an array-based linked list is simple.
PIEBALDconsult 20-Nov-16 13:54pm View
Shuffling is also required only in the real world; a computer is able to simply select a card at random.
PIEBALDconsult 20-Nov-16 13:52pm View
I wouldn't bother. A computer simulation is not bound by the same constraints as the physical reality it simulates.
In the real world most of us can't simply take X number of cards off a deck, but the computer can.
PIEBALDconsult 8-Nov-16 21:22pm View
That sounds unusual; I would expect it in bin\debug. Is the file created when compiling? Or when running?
PIEBALDconsult 8-Nov-16 0:47am View
Better yet, use the using statement for connections, commands, and readers.
And possibly provide the CommandBehavior.CloseConnection to the Reader.
PIEBALDconsult 7-Nov-16 19:59pm View
Best to have an abort feature in MethodB. If possible.
PIEBALDconsult 7-Nov-16 16:24pm View
Sure you INSERT into table 1 before table 2?
PIEBALDconsult 7-Nov-16 14:35pm View
And modulo (%) is a form of division.
PIEBALDconsult 7-Nov-16 0:11am View
Move that to main, after the call to SpacesRemoval(Str)
PIEBALDconsult 7-Nov-16 0:08am View
But what is the goal?
PIEBALDconsult 7-Nov-16 0:05am View
In main, after the call to SpacesRemoval(Str) , display Str.
PIEBALDconsult 6-Nov-16 23:55pm View
Well, it looks like you're pretty much there, you just need to display the aletered string.
PIEBALDconsult 6-Nov-16 23:15pm View
Well, I must assume that this is a homework assignment, so maybe you should show us the assignment so at least we can see where you went astray.
(We won't actually do your homework of course, but you're pretty close.

Simply display the revised string after calling SpacesRemoval(Str)

0) Why do you use toupper?
1) You don't need to use strlen.
2) You don't need two loops; one will suffice.
PIEBALDconsult 6-Nov-16 14:03pm View
Answering two-year-old questions with a link smells of SPAM. Please don't do that.
PIEBALDconsult 1-Nov-16 0:48am View
public TestForm()
is not a constructor, so it requires a return type (probably void).
PIEBALDconsult 24-Oct-16 22:34pm View
We won't do your homework.
PIEBALDconsult 17-Oct-16 0:58am View
Not Lung; Luhn!
You're trying too hard. It's really very simple. And you should be able to do it without any ifs.
PIEBALDconsult 17-Oct-16 0:55am View
I'd use a HashSet.
PIEBALDconsult 9-Oct-16 13:20pm View
And please do not attempt to have SQL Server (or any other application) automatically install with your application.
You do not know what the user's system/environment is like -- the user may have SQL Server available on a separate server and he may want to attach the database there.
Do be sure that the user can configure the system as needed -- e.g. do not hard-code "localhost" as the server.
PIEBALDconsult 8-Oct-16 16:28pm View
Auto-incrementing is a cry for help; please use a better technique.
PIEBALDconsult 1-Sep-16 13:51pm View
I don't know what tools you are using, but you'll want to learn how to instantiate and place UI objects on a Form dynamically -- using a Designer will actually be more difficult.
I did something similar a while back to create a Sudoku (or whatever) solver -- 27 buttons square with complex Event linkage. But I used C# and .net; not C and the Windows API.
PIEBALDconsult 1-Sep-16 13:46pm View
I avoid subqueries whenever possible -- historically they have performed very poorly (though I expect things have improved in the last twenty years). These days I prefer Common Table Expressions and JOINs.
PIEBALDconsult 18-Aug-16 0:00am View
Looks OK, but your intent isn't clear.

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid