Click here to Skip to main content

Comments by John Simmons / outlaw programmer (Top 200 by date)

Go for it.
I'm back at this again, and I still can't figure out the problem. You suggested showing some code, but that's A LOT of code (at least 525 lines of C#, and then there's the associated xaml).
Reason for my vote of 5 Because I'm awesome.
The "condition" is regarded as the entire phrase, but nice try. :)
I'm not sure I can provide anything meaningful. I was more hoping for someone to ask me questions that I could research and answer that might lead to a solution.
Check my updated answer.
It's probably best to start from scratch with a new WinForms app, and move the code from the console app to the WinForms app by hand.
I've NEVER heard of anyone doing that. I think you're worrying about a non-issue. If you want another way to do it, you're free to use google...
If you can't analyze existing code, your career as a programmer will be quite brief. That goes for your other question asking us to analyze code for you.
In VS 1.51, an int was 16-bits. In a later version (I don't know which version this happened), it was made equivalent to an Int32 (but you could still use int as your type definition). At some point, int will be an Int64, probably when/if we ever see 128-bit operating systems.
You add it in the project (in the IDE), and the property setting automatically extracts it when the app is executed.
Why not, that's EXACTLY what Session is for - retaining data between page refreshes. You're wasting time fighting accepted practice. Use Session, and get on with your tasking.
You have to create new directories one at a time. There's no magic solution for you. I know this might traumatize you, but you're going to have to actually have to write code.
DAMMIT! That was a secret, locked away in the vast hidden information vaults at google!
VB syntax is (generally) case insensitive, but we're not talking about code, we're talking about the name of an index key ("firstName"). Those are always case-sensitive.
Being clearer wasn't the goal. Being FASTER was the goal. Besides, if you used enums to represent the numeric values, wouldn't it still be as clear?
But it will still be faster than using reflection, and it won't be tied to the database. You could also setup an in-memory map that allows you to index into an array to get the delegate method name.
But it will still be faster than using reflection, and it won't be tied to the database. You could also setup an in-memory map that allows you to index into an array to get the delegate method name.
Your setvalue method prototype doesn't have an argument defined for it.
Why aren't you using the stream classes?
We don't do people's homework for them because they won't learn anything if we do. If I'm going to be competing against these people for employment, I at least want them to know what they're doing when they accept the position for a fraction of a fraction of a fraction of my salary requirements.
So which item is null? da or comboBox1?
Impractical is in the eye of the beholder. The minimal sample matches the minimal question. :)
I'm a little dyslexic today. :)
Google is your friend. I don't post code that I can't presonally test.
What kind of application? Is the server on the LAN?
We need more info than what you've initially provided.
5 - proposed as answer
It's been seven years since I did any unmanaged code. Google is your friend.
Where EXACTLY are you seeing this exception? We're not inclined to wade through code trying to find the problem on our own. Further, the HTML portion appears to have absolutely NO BEARING on the question.
Why would you think it would be any different than what you did in VC6?
5 - proposed as answer
It doesn't matter - you cannot operate the control menu buttons inside the designer. You MUST compile the app and run it to see what's going to happen. If you know for a fact that the app is going to be used only on one computer, you can set the size of the form accordingly, but that's bad practice, even on a limited use application.
Seriously? You couldn't figure that out on your own? Answer updated.
Nope. You're pretty much screwed.
Windows probably still thinks the file handle is open. Try rebooting your system and run your program again.
Ummmm, what? What does your app do?
WHAT is the exact error, and WHERE is it happening. Show us the code for the object you're trying to serialize to/from.
Well, you add it to your project.
That's generally frowned upon because the data object shouldn't care about the control that presents it. However, if you insist on doing this (and you really should avoid it), you can just create a property in the class of the appropriate type, and set that property to the instance of the control in question.
I've already tried that - still the same error message.
I don't understand why it doesn't "just work".
Didn't know I had to There's a crap load of CAs on our machines. Crapload = 89.
The web service is on a server, the app is on my local box, on the same domain.
I'm not "back", I'm just asking a question at the best place I know of to ask a question. To answer your question, no, there's no reason I chose a non-wcf solution, and I was actually contemplating trying it just to see if it would work any better. What I don't understand is why it lets me see the web methods (meaning it found the service I was after), yet can't create a SSL channel.
WHERE do you see a nested if statement? Use "goto"? That's insane.
AND it's a repost. Deleted.
Holy crap! You have a WPF component that has more than 200 MEGABYTES of XAML?
But he wants to prompt the user to select an option (according to his question).
MDI is perfectly viable. Just because Microsoft isn't behind it anymore doesn't mean squat. Look at all the other stuff they've abandoned - Silverlight - WinForms - C++ - unmanaged development...
Then your app needs to be refactored. Do you even know how MDI is supposed to work?
Check my answer again.
I think this is a job for Liquid Nitrogen (or CListCtrl).
5 - Proposed as answer
These kinds of questions make my skin crawl.
This is a duplicate of a question asked earlier today by someone else (or by you with a different user ID). Why don't you monitor that question instead?
This is NOT an alternative to the originally posted tip.
When you get it to the point that if you flip it the bird, it automatically causes IE to block the current url, call me.
Do not post your email address - when someone responsds to this question, you'll be notified by CodeProject.
Only YOU can make taht decision. What *we* think of a given Java IDE won't really be applicable.
In what plane of existance does your comment have anything at all to do with the original tip/trick?
You STILL have to cast it to the correct type before you can use it.
That was my suggestion - draw to a bitmap and display the bitmap in the PictureBox. I also suggest that you refrain from voting 1 on people that are helping you. It doesn't promoite the desire to continue helping.
I've started reporting you for abuse.
Dude, stop answering questions that are more than a few days old.
You do realize that this question is almost two years old, right? Pay attention to what you're doing.
How is that even remotely useful? What if you the resulting date was the 19th? How do you determine what is a "work day"?
Your question makes no sense at all.
Do ou mean that you want this control do perform this task while you're in the designer?
Do you mean parsing the string *in* a sql server stored proc?
The various .Net classes don't do ANYTHING to improve the database itself. If you don't have the skills necessary to make the database perform at an acceptable level, hire a qualified DBA. I used to work in an Oracle database that contained several hundred tables with several million records, and our queries for ANYTHING took less than 3 seconds to perform. We had an Oracle DBA on staff.
Simple solution - ignore the warning.
You want to capture the Logon/Logoff WMI Win32_LogonSession events.
The method is recursive and accepts any control. When it encounters a container control (like a GroupBox, or a Panel), the method calls itself and the child controls within the container control are enumerated. This allows you to enumerate ALL controls on the form with a single method. Google "recursion" for more complete descriptions of the paradigm). By the way, if I provided the correct answer, make sure you "accept" the solution (and you can accept more than one if it's appropriate).
Yeah, but we're *paid* for our ideas.
For the last time - if the client does not have cookies enabled, there is NOTHING you can do about it.
Nope. I'm what the Department of Homeland Security refers to as a "lone wolf". :)
You apparently have no idea how software installers work. I recommend that you do some research.
Buh-bye retard.
But you can't do that *UNTIL* you're logged on.
It's now obvious that you know the url for bing. So go use it.
The clients don't have to poll constantly (every N milliseconds), and they would only pull down data that's been updated, and maybe even only data for other clients that are "visible" to them (or within a pre-defined visibility/audible interaction zone).
I already made a suggestion in the first version of this question that you asked. If you can't take EVERYTHING you've been told to date and come up with a workable design, maybe you shoudl consider hiring someone to write the code for you.
So open it and close it. What's so hard about that? using (StreamWriter writer = new StreamWriter(filename)) { // write your data } This will open the file, write the data, and close it for you.
You REALLY need to take a class and LEARN about what you're trying to do.
I was just bein' a smart-ass.
If you rectified it, and it's not running, then you didn't rectify it.
Clearly, you haven't sufficiently described your problem in such a way that enables us to give you anything resembling an answer.
What do you mean by "block the drive"? Do you want to prevent your app from reading from it, writing to it, or what?
A hashed password cannot be un-hashed, so password recovery becomes problematic, forcing the user to use a new password instead of using his old (forgotten) one.
If that's the case, see if the column chart has a property for setting the bar colors based on whether they're positive or negative. If you can;'t do that, then see if you can set individual bar colors in a given series (but I doubt you can). Failing all of that, create separate series that contains the negative values.
Are you just bragging, or is something wrong?
Nothing - obviously...
If it "isn't that hard", why did you feel compelled to ask how to do it? For what it's worth, you don't have to accept my advice. I've only been doing this stuff for 30 years, so it's entirely possible that I'm just blowin' smoke up your ass.
He completely changed his original question.
What EXACTLY do you expect to see, and what browser are you seeing the problem with?
What version control software are you using?
Your only recourse is with the Windows Task Scheduler. Google is your friend, but be aware that we tried this approach at work (running a batch file with the Task Scheduler), and it was WAY too problematic. If you want to fight that fight, be my guest.
He probably only has three days to finish it (that's an average time span based on years of handling questions like this).
No, I wasn't inspecting the file first. I think this is the first time I've ever used FileInfo this way (usually, I'm scanning a folder for files and if the FileInfo array isn't empty, then all of the files exist, so there's no need. Doesn't the SqlConnection constructor throw an exception if it doesn't get created (I don't recall). In any case, the tip is still valid.
All questions are "active" unless the've been deleted. It's up to you to pay attention.
The code you've posted makes no sense at all.
That's what I did in CamoPicker (custom control inherited from Control).
Whenever I use a background worker, that's the way I do it. It's standard C# (nothing fancy or obscure). I don't use the telerik converter, but if it can't handle standard .Net constructs, many everyone else should avoid it, too.
I would have just given him a link to the search results page and left him to do with it as he pleases. But then, I'm more of an anarchist than Griff. :)
Ohhhh, the most recent comment in that article really pissed me off...
Didn't you read my answer to to you?
Any library you use is going to be different from every other one. Pick a library, and start using it.
He wants an alternative to the original solution, so in other words, he wants a minimum of two solutions from each person that responds.
Show us the code and precisely what's wrong.
If he doesn't pose a question by lunch time, I'm gonna delete this "question".
Be a programmer and learn what you need to accomplish the specified task. I've been programming for over 30 years, and I have to learn something new pretty much every day. WPF has a steep learning curve if you're used to WinForms, but it's certainly not insurmountable.
A rrrrrrrrrrrrrrrrubber biscuit?
Deleted because it's a) a repost, and b) the original question has at least one answer.
Reason for my vote of 1 This is not an alternative to the original tip.
It's STILL a repost. Go back to your FIRST question, and modify it.
Deleted because a) it's a repost, b) you pasted WAY too much code into the question, and c) the code you posted isn't properly formatted.
You're a programmer, do it yourself. I pointed you in the right direction for god's sake.
You can't build your own notebook, that I know of. My suggestion was just regarding the processing capabilities of the computer - everyone knows they need the attaching and rotating bits. The import performance stuff are the cpu, memory, and video card.
We don't know what his ultimate goal is. I'm assuming it's a math thing. If it turns out to be a string thing, he can still use Math.Round and use string.Format to display it. In other words, po-tay-toe, po-tah-toe, and all that.
I think using Math.Round is probably much more efficient than performing string manipulation.
We want to help, but you've provided nothing to help us help you. If you know you're getting an index out of range error, then you should be able to determine how to fix it. It's probably caused by your "horse being at the edge of the board,a dn when you try to index beyond the edge, it;'s throwing the exception. Work the problem.
No. If you can't debug a simple application, how do you expect to succeed as a programmer?
The element names are case-sensitive. That's probably why it's not working for you.
You asked for possible ways to do what you want, and have been provided with two possible ways. And THEN, you down-voted both of the answers. I'm sure there are a couple of other ways youcan accomplish what you want, but the method I described is the way *I* would do it. I'm certainly not the end-all/be-all of programming talent, but I *have* been programming for over 30 years, and based on that experience, I recommended the best course of action as I see it. That's all I have for you.
We don't care how old people are. Everyone that posts a question is considered a programmer. Period. We laugh at everybody's code - even our own.
You gotta choose your battles. :)
Why is it cruel? "Cruel" would be telling the guy he's a dipshit...
so, which variable is null? FullName or File?
I was just trying to help him get as much benefit from using google as possible.
Your ADD (Attention Deficit Disorder) affliction is of no concern to us.
I think excpetions should be reserved for conditions that reflect errant coding, not user input.
I think a new college semester has just started. This is the 2nd or 3rd request for this in as many weeks
Why are you splitting on "|" when the original string doesn't contain that character? :)
Ummmmm.... what?
Posting a vb.net version of the same code is NOT an alternative to the code in the original tip.
We can't possibly help you without seeing the code in question.
I'm not real fond of people editing my stuff. Try to resist the urge in the future.
This is not a permission or privilege issue. He obviously has some bizarre reason for writing this kind of code. Since he's not sharing it with us, I don't see how you can suggest this.
He wanted a solution in C#. I'm assuming his query is properly formed and that he's done everything else he needs to do to make it work. I don't have the time to speculate as to whether he should do it this way or not, and I certainly wouldn't do it this way myself. That's no reason to vote my answer down.
What you're seeing is the article submission wizard. At the bottom of each page, there's a button that allows you to go to the next page in the process. You're right, you may not have editing privileges, but if you do (and I thought everyone was allowed to edit their own articles), my answer is the right answer.
I've posted 50+ articles here. I know what I'm talking about. In point of fact, I just went and edited the article, and changed it to be PRECISELY what you said it should be, and that was by clicking on the icon I told you to click. I suggest you change your 1-vote to a five, and mark this solution as accepted. It's the only right thing to do.
You're going to have to tell us which line is throwing the exception.
I would think that if this were the case, he'd get a completely different exception.
You must have cognitive issues - you selected C++ for your tag when it's CLEAR that you want C# info. Pay attention to what you're doing.
I fixed your tag (was "C++").
If you're not a programmer, why are you working on a programming homework assignment? Beyond that, a lot of people here (that think they're programmers, or are soon going to be) are not in fact programmers, or will make even mediocre ones when it comes down to getting that first programming job.
you didn't reply to the OP - you submitted a comment to me.
Your comments aren't in English, so we don't know what the hell you're doing.
Your question is puzzling. Apps don't "provide" security - they "enforce" it. Are we talking about a desktop app, a windows service, a web app?
We need to see how you're configuring the Process object to run Debug.exe.
No, he wants the apps controls to change size/position according to the size of the form.
DO NOT REPOST
I think this guy would. Oh, wait - you said *right* mind... :)
I think he means in intellisense.
WTF makes you think we want to wade through all that code?
I don't think any free 3rd party .Net charting library is available without a watermark of some kind. You're either going to have to pay for one, or write your own. Believe me when I say it will be MUCH cheaper in the long run to just buy one.
It's right there in my answer. READ IT.
Was it really necessary to post ALL of that code? No, it certainly wasn't.
Why does it matter to you? He's asking how to do it, not if you approve.
This is not an alternative to the toriginal tip. If you have a question use the message forum space at the bottom of the page, or use the "Have a Question or Comment button UNDER the original tip.
No, only one instance of the application is running.
You said you had a program that worked, and that you wanted to make it faster. That's ALL you said. My solution is totally appropriate. If you want to make it faster, you have to write better code. I can't go into details because we don't have your code, and even if we did, it would probably take us longer thatn it's worth *to us* to make it faster. You could always try running it on a faster computer (I hear there's some available time on the most recent Cray box you could lease). Finally, your "=.=" symbol means nothing to me...
But you don't need to. I suspect this is a one-off method in a single form. there's no point in not making it form-specific, which means you can safely use the names of the combo boxes in a switch statement. Even if you couldn't, you could just as easily create a list external of the method in question, and search that list from the recursive method.
You still need to setup the appropriate shares.
At least I admitted it, and even if I don't know anything about jquery, it should at least start him thinking about stuff.
Geeze Mark, who pissed in your Wheaties today?
You can say that with a straight face with all of the links you posted for the OP? A concerted google search would have revealed ALL of those if he had just put in a little effort. Besides that, without performing at least a cursory code review and requirements evaluation, there's NO WAY we could give him a definitive best practice recommendation.
So, would YOU want to open your firewalls? Would the remote site? I doubt it. Named pipes are intended for intranets and shouldn't be used across the internet.
It might help if you show us the query you're using...
I've worked in very few team environments, and I've written a great many apps on my own time at home using my own resources. My favorite project of all time is the one I did when I was just starting out, and earned me the user ID I use here. I wanted to change the colors used in the Turbo Pascal 2.0 IDE. Someone told me that it was impossible, so I went ahead and did it anyway, just to prove that it could be done. That was almost 30 years ago. BTW, I've been using C# for more than four years. Before that was 16 years of C/C++, and before that was 6 years of Pascal and about 4 years of assorted other languages. As far as subject matter knowledge, I've done radar tracking, asset tracking, estate planning, charitable giving, troop readiness tracking, real-time image acquisition/transmission, embedded programming, real-time video encryption/streaming, telecommunicaions billing, ACH transaction management, and currently, financial management. I've written commandline and UI apps for both DOS and Windows, TSR's (remeber those?), Windows services, web services, asp.net apps, legacy asp web sites, a couple of Silverlight modules, and a couple of WPF apps. I don't believe in specializing because each job has always required a different skill set, and usually meant I had to learn something I didn't already know. I guess I fall solidly into your "athlete" classification, but that only makes sense since I've been doing this for over 30 years (and no, I have no desire to be a manager - yet). I'm completely self-taught (ragarding everything I've done since 1981), and my least favorite part of an interview involves test questions. I hate 'em. I long ago stopped trying to remember everything I ever did or saw. Google is my reference and I use it - a lot. My fading memory has forced me to become a copious commentor in my code.
Well, tell us what the solution was.
My point is that to make your code "flexibility", you suggest modifying the code, which could possibly introduce errors into code that used to work before being made more flexible to suit a new use case.
I formatted your code and fixed the html tags. Beyond that (and like the other two solutions), your code is only flexuible regarding the length of the input string itself, allowing for no other character to be inserted, nor the number of characters between insertions.
What happens when the string gets longer (unintended results) or shorter (throws an exception)? Your solution only covers the sample input, and does not consider all of the use cases.
Not flexible at all.
Yeah, that should work.
Reason for my vote of 5 This alternate is the reason this post should never have been approved for publication.
Reason for my vote of 1 I'm at a complete loss as to why this tip got approved.
I don't understand what you're on about. The code I gave you will compile and run.
When you run under the debugger, variables are initialized automatically. You can turn this off in the compiler options. At that point, you'll find your issue.
That's not a reason to vote it a 1.
Right-click it and look at the properties. See where it thinks the file is, and then browse to that spot on your system to see if the file is really there.
What needs to be combined with my solution isn't something I can tell the OP. Only HE knows the specifics of his project, and only HE can implement the necessary code.
A lot of stuff you have to do in programming isn't comfortable. That doesn't make it "wrong". The solution i gave you is a GENERAL method for accomplishing what you orginally asked. Of course, requirements are going to dictate how you implement it in your own code, but that's not my concern.
Pushing the Reset button on your computer.
It's kinda obvious. UCase, Trim, and Str isn't in the .Net framework, and are old VB6 functions. As someone already pointed out, the old VB6 metrhods are still supported in .Net to ease the transition into .Net. In order to accurately answer your actual question, I'd need to run it under the debugger and watch what's happening. I'm not a VB guy, so my own interest in finding out the "why's" of what you're seeing is fairly limited. My advice is to run it under the debugger and what what the code does.
I know they are, but continuing to use the archaic crap from past versions is bad form.
That's the entire text of the message? Sounds to me like you haven't added the references to your project.
So what exactly is the error you're seeing?
But why use javascript when you can do the same thing in code-behind?
Never NEVER use textspeak in a computer UI. NEVER.
That's how you make a directory hidden. It's a file attribute that you apply to the folder. BTW, hiding/showing a folder has absolutely NOTHING to do with encryption.
Why do you insist on using pointers in C#? It's entirely unnecessary.
Then that tells me the flaw is somehow connected to the SendKeys class, wheich you haven't deigned to reveal to us.
I know - I said make a program that can act as EITHER a client OR a server. The first instance that runs is the server and acts ONLY as a server. The 2nd instance that runs acts as a client, and ONLY a client. By definition, each instance is running on its own thread (or thread pool). That was the entire point of what I said.
Why would you think performance would suffer? It's a chat application, and nothing more. If it were me, I'd make the program act as EITHER a server or a client. The first instance that fires up would be a server, and all other instances would be clients. Where is the performance degradation?
5 - proposed as answer.
Well, you changed the tip's content (and subject), so of course this alternative isn't totally applicable now.
Since this site is an English-language site, I think it's unreasonable to expect a number of people to not find some measure of offense to his ID.

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