Click here to Skip to main content
12,508,491 members (55,113 online)

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

I haven't done anything. I suspect the last time I visited the question was 5 years ago. I suspect the hamsters are on drugs. Again.
It's there, the cut/paste is screwed up on this system (DoD computer on a clown-based network) - I can't paste at all into some sites, and on some sites, it doesn't always paste all the copied text.
The connection string is not the problem.

<add name="DevConnection" connectionString="SERVER=[servername];Initial Catalog=[databasename];Integrated Security=SSPI" providerName="System.Data.SqlClient" />

Actual server/db names aren't necessary, and both the server and database in that sql instance exist (I'm sitting here looking at the database in SqlManager right now).

SqlServer 2008 R2.

Like I said, all other database access performed with that connection string work fine.
The connection string IS NOT the problem. It works elsewhere in the code, and is not mangled in any way before I use it.
Wow. I see the f*cktards are still using the site. Both my question and this solution were down-voted. F*ckin amazing... Don't get me wrong, I don't give a f*ck about the points, but some people really need to grow the f*ck up.
And no search engines are displaying - at all - so I can't even continue my search for a solution... I hate having to work on DoD networks...
Well, the listboxitem and treeview item styles are in the same file, and they're working. I just added comboboxitem and it ain't workin either...
Yeah I know. My problem is that the style override is being ignored (I even tried changing it to the way you have it on the off chance that it would make a diff).
I said I'm new to MVC, not a complete f*ckin idiot. I have an existing MVC web site (or app or whatever you feel like calling it). I don't want to lose that site. Can I add something like smartstore to it without overwriting the existing folders/files?
I actually came back to say I was missing the css for the various jQuery controls. Added a new bundle for it, and everything is fine (relative term of course, as well as being subject to change).
Yes, it's in a {} block. I fingered out what i was doing wrong - I forgot to put , new { @class = "date-picker" } in my TextBoxFor method call. I now have a new problem. The calendar is displayed, but there appears to be no containing div/border.
That didn't fix it. :(
Changed it to the following, and it still appears to work:

<pre lang="csharp">
static void Main(string[] args)
Task[] tasks = new Task[]{CreateTask("Task1", 1), CreateTask("Task2", 5)};
// wait for them

private static Task CreateTask(string name, int interval)
Task task = null;
TaskCreationOptions taskOptions = TaskCreationOptions.LongRunning;
CancellationTokenSource tokenSource = new CancellationTokenSource();
CancellationToken cancelToken = tokenSource.Token;

task = Task.Factory.StartNew((Object stateObj)=>DoWork(name, interval, cancelToken), taskOptions, cancelToken);
catch (AggregateException aggEx)
catch(Exception ex)
return task;
0) Each task has to be run on a different thread.

1) I might need to know when each thread is canceled. Having a single cancel token for each task won't allow that, will it?

2) I thought that I should specify longrunning on threads that run for more than a second or so. Each thread will be running until cancelled by an external source (for days/weeks/months/years).

3) I honestly don't see how this is easier than the classic threading model (something everyone seems to say). Like I said, I haven't been able to find a decent article on TPL (one that explains it in a way I can understand).

I updated my question (after the code block).
A task isn't necessarily a thread, and I need them to run at the same time. They don't have to interact, but they do need to run side-by-side.
WTF are you talking about?
Erp - found it - I had an extra parenthesis
It's been modified to fit my table/column names, but when I copy paste direct from your answer, it works...
i did, and now i'm getting "incorrect syntax near T"

(I wanted to make sure I hadn't missed anything before posting this)
yeah - colons for eveyone :)
Yeah - it's the typical useless "problem by xyz" error
sql server 2008R2 - i don't think it supports partition_fragment_id
works great for old dates that have no values for some names, but if I use 12 and 2014, if should give me the next earliest value (11 2014).
Honestly, I don't know how to approach it. I'm not even sure how to ask the freakin question (makes it real hard to google). My brain is completely failing to engage... :)

Yes on the year for Don. Not all names will have a changed value in a given year, and I wanted to return a valid row for each name regardless of stupid user tricks.
Further, new names might be added in the future which of course won't have past values.
I already solved the problem. Read the first soltuion.
Not in this case, no.

I suppose that kinda makes sense...
I took out the code I thought might be the culprit, and no change...
I also tried it, and it almost matches. I have an intranet site up, and the innermost child window in the client area (it's a Internet Explorer_Server class) isn't being enumerated, but I think getting the parent TabWindowClass window will be sufficient.
I tried putting a Thread.Sleep(5000) after the process was started and went into InputIdle, and BEFORE calling EnumChildWindows. It didn't change the behavior.
EnumChildWindows is *supposed* to enumerate all child windows and their children - if you recurse, you'll get all the windows more than once. My problem is that it's not even getting all of the main IE window's child windows. I don't know if this has anything to do with it, but it only found child windows that don't have their own child windows. These child windows are also the first two I see with Spy++.

If you open IE and then inspect the window with Spy++, you'll see what I mean.
If you're not going to answer the question, STFU.
Nope, spent the last couple of days putting together screen shot code. Gonna try it on Monday. :/
I can't install any new software (I'm on a DoD system), so even if it worked, I can't use it.
I'm on Win7 running IE9 on a DoD system. I can't upgrade, and my end user(s) are in the same boat.

It's starting to look like I have to take screen shots and compare them for differences... Not happy about that...

Have I mentioned yet that I hate flash?
Fiddler doesn't show *any* traffic once I get to the site. I hate flash...

I just checked DevTools and all it shows on the page is a clsid...
0) I have a project originally started in VS2012

1) I added a User Control to the app project

2) I compiled the solution

3) I added the new user control to the mainwindow xaml

4) I added the namespace definition ( xmlns:local="clr-namespace:myproject" )

5) I get the "error" stating the name can't be found in the namespace

6) App compiles and runs despite that "error" (WTF #1)

7) I changed the namespace declaration to include the assembly name

8) The "name doesn't exist" error went away, only to be replaced by "the tag "controlname" doesn't exist in the XML namespace" (WTF #2)

9) The app will now not compile.

10) I'm pissed off.

WTF are you talking about? Why would you think even for a second that I didn't "make a selection"? Intellisense sees it - I select it - code doesn't f*ckin compile (or I get an error and it compiles any way). Where's the logic in that?
No, I don't get it - not at all. If intellisense can find it when I actually add it to the XAML, why doesn't it compile? We're talking about controls here that are nothing more than the template code provided by VS, and I'm not getting errors regarding those controls. Further, they are in the same assembly AND namespace as the main window whch is actually hosting the control. The entire soution is essentially a flat hierarchy with no additional projects or folders (yet).

I had to remove the xaml that uses the controls so I could code other parts of the app.
Well, that solved the initial problem, but now it won't compile at all.

The tag 'CtrlTabGallery' does not exist in XML namespace 'clr-namespace:ContentManager;assembly=ContentManager'.

I hate WPF...
If only it were that simple - that's the first thing I tried. I fixed it though, and posted my solution.
Reason for my vote of 1 \n Not an article.
You replied to a four-year old comment. I no longer really care.
No, I simply want to retrieve the data in the selected table.
I have no idea what WebAPI or ServiceStack is or why I should consider either. I'm REAL new to MVC.
Nop.web has to be calling nop admin somehow. I just want to make my app the startup app and call nop.web from it via a menu item click (or something similar).
It's not on a docked panel. Setting the X/Y properties on the transform in XML puts the control in the desired location, so animating those properties should work fine.
I am of the lightly considered opinion that the 3D stuff in WPF is buggy as hell. I was showing a coworker some of the weirdness associated with this effort. One of the weird things was that if I specified a transparent background for the text, the text would simply disappear in the designer. That was before I enclosed the textbox in its own border. So I had alreadty commented out the border, and changed the background to transparent, and the text angle became "correct". On the off chance this would generate a proper image, I ran the code, and waddayaknow? It came out the way the designer was showing it. I closed the ticket and told the customer that's as good as it gets. :)
I updated the code in the origianl question to give you an idea of what I'm after (you can get the specified font (Roboto Thin) from, but that shouldn't really matter.
I want the angle to be such that the numbers are at less of an angle. Here's a new wrinkle. After posting the original question, I tried putting the textblock into another border so that the 3d stuff was being applied to the border instead of the text in it. The image in the designer changed, but the rendered image did not.

I'm afraid I don't know what the "look-at target" is or where to set it, but my next stop is google (again). When I change the position of the camera, it merely moves closer/further, or moves the image within the bounding container.
We create what we call middleware that performs a task. In this case, the task is to get the current time, and position it so that it looks like the output of a flat time display being viewed at an angle.
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 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?

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