Click here to Skip to main content
15,396,950 members

Comments by Pete O'Hanlon (Top 200 by date)

Pete O'Hanlon 1-Jul-22 3:15am View
   
It would help if you could explain, further, what you were trying to accomplish. Are you trying to intercept mouse clicks on the clock widget?
Pete O'Hanlon 13-Jun-22 3:54am View
   
Okay, so the problem you have here is with having a version of Excel registered that cannot open .xslx format files.
Pete O'Hanlon 10-Jun-22 6:46am View
   
Put a breakpoint at the start of your code and step through it line by line to see which one throws the exception. I have a suspicion you're going to hit it on ReleaseComObject but you need to verify this. If you are just trying to close your application there, you just need to call application.Quit(); rather than ReleaseComObject.
Pete O'Hanlon 23-May-22 9:43am View
   
This, as far as I'm concerned, is the correct answer.
Pete O'Hanlon 23-May-22 4:59am View
   
You are most welcome.
Pete O'Hanlon 14-Apr-22 4:24am View
   
What link are you trying to download? Remember, while you know what you are talking about, without providing clear and detailed thought processes, we have no context to help you here.
Pete O'Hanlon 5-Jan-22 9:16am View
   
You're most welcome. I'm glad you're up and running.
Pete O'Hanlon 3-Nov-21 9:54am View
   
Your onclick is doing return false.
Pete O'Hanlon 31-Oct-21 14:49pm View
   
How much data are you trying to load?
Pete O'Hanlon 5-Oct-21 15:11pm View
   
Are you trying to show the status result of a request here?
Pete O'Hanlon 29-Sep-21 6:43am View
   
How can we help you? We have no sight of your code. We don't know what errors you are getting?
Pete O'Hanlon 27-Sep-21 11:15am View
   
Are you trying to prevent it from being moved again? So, once it's dropped, that's it - it can't be moved ever again.
Pete O'Hanlon 29-Aug-21 10:25am View
   
There are plenty of examples here. https://www.google.com/search?q=datetime+tryparse&oq=datetim.tr&aqs=chrome.2.69i58j69i57j0i10i30.7243j0j7&client=ms-android-samsung-gs-rev1&sourceid=chrome-mobile&ie=UTF-8
Pete O'Hanlon 6-Aug-21 6:49am View
   
I guess I was the last report. He's outta here now.
Pete O'Hanlon 12-Apr-21 4:21am View
   
You can do that as well. I'd be tempted to host a RESTful API on the server and interact with the database that way, if I were writing this.
Pete O'Hanlon 22-Jan-21 17:51pm View
   
My 5
Pete O'Hanlon 28-Nov-20 17:29pm View
   
What is your actual question? You have just dumped code.
Pete O'Hanlon 13-Nov-20 6:04am View
   
Got my 5.
Pete O'Hanlon 13-Nov-20 5:25am View
   
Richard's answer below shows what you need to do. The problem you had in your code is the process expects d:\GIT\proj1\GIT to be a runnable command whereas what you are actually trying to do is run GIT (which is in another directory) inside the d:\GIT\proj1 folder.
Pete O'Hanlon 13-Nov-20 4:48am View
   
You said you the code doesn't work but that doesn't really tell us anything. Are you getting errors? If so, what errors are you seeing?

The beauty about process commands is that you can try them out without having to run the application. What do you get when you run the d:\GIT\proj1\git pull master command?
Pete O'Hanlon 13-Nov-20 4:43am View
   
Thanks
Pete O'Hanlon 30-Sep-20 8:50am View
   
There are a few paid for components that can do this for you. I've not seen any open source versions that would allow you to do this.
Pete O'Hanlon 30-Sep-20 8:34am View
   
You're not an idiot. Sometimes it just takes explaining a problem to someone else to see it.
Pete O'Hanlon 30-Sep-20 8:11am View
   
What do you mean when you say it doesn't work? What are you expecting to see when you run it?
Pete O'Hanlon 29-Sep-20 9:11am View
   
Your API would look something like this:
[HttpPost]
public IActionResult Post([FromBody]EmailMessage email)
{
// the email message here should match the email you posted in your console
return Ok();
}
Pete O'Hanlon 30-Aug-20 17:48pm View
   
Why are you doing async with GetClient? That doesn't need to be awaited.
Pete O'Hanlon 28-May-20 3:22am View
   
My 5
Pete O'Hanlon 24-May-20 16:45pm View
   
Nice.
Pete O'Hanlon 21-May-20 17:36pm View
   
I have indeed. It's pretty straightforward.
Pete O'Hanlon 20-May-20 3:02am View
   
This works equally well on Linux solutions (I do this myself). When you publish, just set Linux ARM64 as your target.
Pete O'Hanlon 19-May-20 9:16am View
   
Thanks
Pete O'Hanlon 19-May-20 7:39am View
   
I just mocked this up and it works perfectly for me. Perhaps you should share your code as to how you added the forms to each other.
Pete O'Hanlon 19-May-20 7:34am View
   
What code do you use to close Form3?
Pete O'Hanlon 19-May-20 7:24am View
   
So many answers, so many of them unsuitable.... :wink:
Pete O'Hanlon 29-Apr-20 5:53am View
   
Sorry I haven't had a chance to respond before; IHttpClientFactory is normally injected into your code if you are using .NET Core and uses the DefaultHttpClientFactory. If you aren't using dependency injection, you can remove the constructor and replace the first using statement with (using HttpClient client = new HttpClient())

By the way, the using statement format you saw in my example was the new way of adding using blocks (introduced in C# 8). You can find details here: https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8#using-declarations
Pete O'Hanlon 24-Apr-20 6:38am View
   
5ed
Pete O'Hanlon 17-Feb-20 2:49am View
   
You know what I'm going to say. This is the correct way to do this. My 5.
Pete O'Hanlon 12-Feb-20 3:00am View
   
I like it. 5.
Pete O'Hanlon 12-Feb-20 3:00am View
   
Thanks.
Pete O'Hanlon 11-Feb-20 15:43pm View
   
Thanks.
Pete O'Hanlon 6-Feb-20 9:40am View
   
And that's the way to solve it. My 5.
Pete O'Hanlon 6-Feb-20 3:17am View
   
It had popped to the top of the queue due to it just being updated.
Pete O'Hanlon 5-Feb-20 7:17am View
   
Are you subscribing to the SelectionChanged event? If you are, just disconnect from the event handler before you associate Data with your ItemsSource. Resubscribe to SelectionChange immediately after DataGrid.ItemsSource = Data;.
Pete O'Hanlon 21-Jan-20 8:34am View
   
When you get null back here, it's indicating that you have no matching elements being returned.
Pete O'Hanlon 21-Jan-20 8:06am View
   
If you are talking about the processing that happens after SingleOrDefault, it will. You need to check to see whether text_block is null before you attempt to do anything with it.
Pete O'Hanlon 21-Jan-20 6:18am View
   
You keep restating this and you have posted some code above. How do the two bits tie together? What problems are you actually having with that code? Are you seeing errors? What application infrastructure do you have?
Pete O'Hanlon 14-Jan-20 10:24am View
   
That's just restating your requirement. It doesn't tell us what is going wrong with your code (if anything).
Pete O'Hanlon 13-Jan-20 6:24am View
   
Do you not think it would be a good idea to find out what problem the poster actually has first?
Pete O'Hanlon 13-Jan-20 6:19am View
   
What problem are you having? What is not happening that you think should be happening?
Pete O'Hanlon 25-Nov-19 9:28am View
   
Sorry Mike, I missed this. If I were starting off now, I'd read the WPF articles here by Josh Smith, Karl Shifflett, Daniel Vaughan and Sacha Barber. They have everything pretty much covered.
Pete O'Hanlon 22-Nov-19 11:47am View
   
So, which of those two optimisations do you think the OP should discount when they write their brute force solution. This is why I said that you stop thinking about how you write the program, and why you would think about how you would do it yourself. Would you ignore the first optimisation if you were doing it yourself? Would you ignore the second one I put in if you were doing it yourself, or would you not agree that these are things you would do instinctively up-front?
Pete O'Hanlon 22-Nov-19 10:54am View
   
I really should have looked closer at your code, that's not the way you should be loading your RD's. You're trying to load them from the xaml file, which you aren't going to be shipping. What you need to do is load them using a Pack URI like this:

Window.Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("pack://application:,,,/MikeSample;component/Brushes.xaml", UriKind.RelativeOrAbsolute) });
Pete O'Hanlon 22-Nov-19 9:06am View
   
Something else to look at is whether or not the UriKind is correct. Try changing it to UriKind.RelativeOrAbsolute.
Pete O'Hanlon 22-Nov-19 8:56am View
   
Mike, in this section:
ResourceDictionary rd = GetActualResourceDictionary();
if (rd != null)
Application.Current.Resources.MergedDictionaries.Remove(rd);

You're only removing one dictionary. Are you sure that's what you should be doing?
Pete O'Hanlon 22-Nov-19 7:43am View
   
What does ExportEstimateWindowLogic look like? Could you add that code to the question please?
Pete O'Hanlon 20-Feb-19 7:25am View
   
I wish I could award a vote here but have a virtual 5 for that.
Pete O'Hanlon 18-Feb-19 15:06pm View
   
What code do you have? What are you stuck on?
Pete O'Hanlon 14-Feb-19 3:35am View
   
Through JavaScript.
Pete O'Hanlon 13-Feb-19 9:53am View
   
What technology is this for? WinForms? WPF? XAMARIN? ASP.NET? MVC?
Pete O'Hanlon 13-Feb-19 8:29am View
   
These are just standard form groups. You'd get them in the same way you'd get from a form group if it was a single control with multiple fields. There's nothing special about this.
Pete O'Hanlon 24-Jan-19 5:51am View
   
Thanks
Pete O'Hanlon 7-Aug-18 3:28am View
   
Search Google for FileSystemWatcher.
Pete O'Hanlon 29-Jul-18 11:24am View
   
My 5
Pete O'Hanlon 27-Jul-18 6:10am View
   
I have given you the solution. Only you can do the work here. I don't have access to your codebase and it's highly unlikely that anyone else here has either. There is no easy fix that someone else can give you - you are going to have to trace the performance yourself and see what the bottlenecks are.
Pete O'Hanlon 4-Jul-18 3:10am View
   
You have missed out the most important part. What the inner exception is reporting as the error. You need to supply this information.
Pete O'Hanlon 4-Jul-18 3:09am View
   
What data do you want representing? How is it formatted in the file? Is it a CSV? Is it json/XML? Is it structured data? What do you want to display in the UI?

As it stands, your question cannot possibly be solved.
Pete O'Hanlon 29-Jun-18 10:55am View
   
What's a planning poker website?
Pete O'Hanlon 20-Jun-18 5:05am View
   
Can you start Visual Studio on its own with no selected project?
Pete O'Hanlon 24-May-18 12:18pm View
   
You'll have to call it.
Pete O'Hanlon 28-Apr-18 11:41am View
   
You could always go with something like Wix.
Pete O'Hanlon 28-Apr-18 5:24am View
   
This is the Visual Studio install creator? Unfortunately, it is very limited in how you can enhance it.
Pete O'Hanlon 28-Apr-18 4:24am View
   
Without telling us what you are using to create the installer with, we have no idea.
Pete O'Hanlon 3-Apr-18 7:31am View
   
Seriously? You're doing WPF and you don't know about PropertyChanged? Your MyPicture class needs to implement INotifyPropertyChanged; this has a PropertyChanged event. In the setter for your title, you are going to have to raise the event. Have a search around the web for ViewModelBase implementations to get an idea about how to structure this.
Pete O'Hanlon 3-Apr-18 7:24am View
   
Did you step over each line and check what it was doing? Did you ensure that the conversion of SelectedItem to MyPicture actually worked?

Oh, one more thing, if you are expecting to see the value updated back in the UI, you are going to have to raise a PropertyChanged event in the Title when you change it.
Pete O'Hanlon 3-Apr-18 7:03am View
   
In your code, did you add a breakpoint on the point that you are testing that SelectedItem is not null and then step over each line, looking to see what the values are? You do know how to debug don't you?
Pete O'Hanlon 3-Apr-18 6:54am View
   
Did you put any breakpoints in your code and debug it to see what's happening?
Pete O'Hanlon 12-Feb-18 8:20am View
   
If I were doing this (sorry, but this is C#), it would look something like this:
private void IterateOverControl(ControlCollection controls)
{
  if (controls == null) return;
  foreach (Control control in controls)
  {
    IterateOverControl(control.Controls);
    if (control.ContextMenu != null)
    {
      // Do something here because I know I have a context menu.
    }
  }
}
You can then call this by:
IterateOverControls(this.Controls);
It should be a simple matter for you to translate that to VB.NET.
Pete O'Hanlon 22-Jan-18 5:03am View
   
So, replace if (Zero_Cross == 1) with if (u8PowerLoss_old == 1) in my example above.
Pete O'Hanlon 13-Jan-18 5:09am View
   
You are going to have to look at writing something like a behaviour then, that is going to put Runs in place.
Pete O'Hanlon 10-Jan-18 15:50pm View
   
That's true, missed it out altogether but as I just typed the code out in the CP editor I'm pleased I got what I wrote correct.
Pete O'Hanlon 10-Jan-18 3:30am View
   
Been there, wearing the t-shirt.
Pete O'Hanlon 10-Jan-18 3:10am View
   
Errm, why can't he use C++ at the server side? Is this a brand new rule? I've used C++ successfully on the server side in a number of projects.
Pete O'Hanlon 9-Jan-18 3:03am View
   
Indeed - and I called this out to highlight this to the user.
Pete O'Hanlon 9-Jan-18 2:49am View
   
You are making assumptions that this is for a DateTime. Similarly, you shouldn't use Convert.ToDateTime if you can't guarantee that inputs are in suitable formats. Finally, if this is indeed a DateTime, there's so much that needs to be taken into account with regards to cultures that your code is overlooking. At best, your solution is a simplistic case that might solve for a narrow range of inputs.
Pete O'Hanlon 3-Jan-18 9:41am View
   
Have you profiled your query to see what the SQL profiler thinks it needs to do? You're asking us to guess what your query does and whether it is the problem; without any further information we aren't going to be able to help you any more.
Pete O'Hanlon 20-Dec-17 11:54am View
   
What facial recognition software are you using?
Pete O'Hanlon 20-Dec-17 4:25am View
   
Asked and answered here. https://www.codeproject.com/Questions/1221740/How-to-deploy-Csharp-windows-application-on-mac-OS
Pete O'Hanlon 22-Nov-17 6:09am View
   
They are exactly the same (due to interning), but I prefer to use string.Empty over "" to reinforce that testing for empty strings shouldn't assume or rely on it being "".
Pete O'Hanlon 22-Nov-17 5:32am View
   
A minor correction, use string.Empty, not "".
Pete O'Hanlon 22-Nov-17 3:09am View
   
That means you have the wrong table to look up against. I talked about adding a lookup table that contains all the conditions that you need to satisfy getting the right shift code.
Pete O'Hanlon 20-Nov-17 4:32am View
   
No idea whatsoever, and do you know why I have no idea? It's because I have no idea what your sub reports are doing. If they are performing expensive lookups using techniques such as table scans, they are going to take a long time to load - that's inevitable.
Pete O'Hanlon 15-Nov-17 7:35am View
   
Without reading your links, he's not going to get the shortcut from this; this is far from a working sample.
Pete O'Hanlon 13-Oct-17 10:04am View
   
If the user was only looking to replace the string, then Replace would be enough; as they also wanted to return the list of records that they changed, the list has to be filtered first - hence the Where clause using StartsWith.
Pete O'Hanlon 10-Oct-17 13:34pm View
   
If you're new to this, then this is way above your ability. People write PhD's on this type of subject.
Pete O'Hanlon 4-Oct-17 4:42am View
   
Hmmm. This had appeared at the top of the latest questions in my watch list on the front screen. Looks like the user edited the post which bumped it up.
Pete O'Hanlon 3-Oct-17 1:54am View
   
I would suggest that you take a step back and start learning the basics of C++. We aren't going to solve your homework for you; it's set so that you can show what you know, and identify any gaps in your knowledge so that you and your tutor know what you need to concentrate on. As you're doing C++, you should be looking to use classes here; if I were doing this I would break my code down into a minimum of a Menu and a Maths class, with each part being responsible for ALL of the functionality for that area.
Pete O'Hanlon 2-Oct-17 3:18am View
   
And what, exactly, is your question? You've just put a sentence in there. You haven't told us what code you already have, where you are stuck, what type of application it is; in fact, you've missed out pretty much everything.
Pete O'Hanlon 22-Sep-17 5:48am View
   
You're welcome
Pete O'Hanlon 22-Sep-17 3:57am View
   
Where does that contain your reference to lstLignes? That's your collection as it's the one you're binding to. All you need to do is something like this:
foreach (var item in lstLignes)
{
item.IsChecked = true;
}
Pete O'Hanlon 22-Sep-17 3:22am View
   
Well, you've missed out pretty much every important detail here. Is the browser hosted in your application? What type of application is it (WPF, WinForms, etc)? How have you hosted it? Which browser is it (IE, Chromium, other)?
Pete O'Hanlon 21-Sep-17 11:53am View
   
I would suggest that you read one of the many articles that covers how to use INotifyPropertyChanged in WPF. There are many available good articles that cover this. They will show you what you need to do to raise the INPC call (as a hint, you have to set the property, not the variable, and you have to raise the PropertyChanged event in there - if you set the variable, you'll need to trigger PropertyChanged with the property name afterwards).
Pete O'Hanlon 21-Sep-17 10:42am View
   
Replace your ObservableCollection with this RangeObservableCollection and then you can call AddRange. It's simple inheritance.
Pete O'Hanlon 21-Sep-17 10:27am View
   
The link, which is plain in there, takes you to this. https://peteohanlon.wordpress.com/2008/10/22/bulk-loading-in-observablecollection/
Pete O'Hanlon 21-Sep-17 10:21am View
   
Read the whole reply and follow the link in it. When you get an answer, it pays not to ignore any part of it.
Pete O'Hanlon 6-Sep-17 8:28am View
   
Look in your csproj file for the unit test. Is it exactly the same reference in there as for your main code?
Pete O'Hanlon 6-Sep-17 6:49am View
   
This is just a code dump. What's your actual question?
Pete O'Hanlon 5-Sep-17 7:42am View
   
:D True, true.
Pete O'Hanlon 5-Sep-17 6:49am View
   
No one is going to write this software for you. You're either going to have to contact the author of the Youtube video, or write this yourself.
Pete O'Hanlon 17-Jul-17 9:12am View
   
Not a problem. Glad to help.
Pete O'Hanlon 17-Jul-17 7:58am View
   
No, he's right. There should be two. There are three a's together in that, so there should be two together. In the word, caaab, the first aa starts at index 1 and the second aa starts at index 2.
Pete O'Hanlon 14-Jul-17 10:05am View
   
It's in there, but only if you can read subatomic :)
Pete O'Hanlon 13-Jul-17 9:08am View
   
Thanks.
Pete O'Hanlon 12-Jul-17 16:05pm View
   
Thank you.
Pete O'Hanlon 11-Jul-17 10:16am View
   
Just because they are quick to look up against, so if you had a really, really big range of numbers, the lookup to see if the number is present would be quicker than searching an ordinary list.
Pete O'Hanlon 11-Jul-17 5:53am View
   
Every time you run your user application, it will be assigned a process id - the allocation of this number is outside your control, so if you are googling for this exact issue, you're not going to find much relevant information.
Pete O'Hanlon 29-Jun-17 8:49am View
   
Before anyone asks - my update was approving this from the moderation queue :)
Pete O'Hanlon 29-Jun-17 6:00am View
   
https://help.yahoo.com/kb/SLN4724.html
Pete O'Hanlon 29-Jun-17 3:51am View
   
You're welcome.
Pete O'Hanlon 29-Jun-17 3:30am View
   
Ah, I see. In that case, simply use a List<KeyValuePair<string, string>>
Pete O'Hanlon 29-Jun-17 3:20am View
   
A dictionary doesn't accept duplicate keys. Where did you get that idea?
Pete O'Hanlon 1-Jun-17 10:21am View
   
If you're asking if it's okay to share view models between multiple views, the answer is yes it is. It's not a common scenario but there's nothing that precludes you from doing that. In most cases, when opening a dialog, you would want to use an abstraction layer to decouple the view from the VM that is creating it.
Pete O'Hanlon 25-May-17 8:07am View
   
My 5.
Pete O'Hanlon 25-May-17 8:03am View
   
Doh! I was thinking of DWORD_PTR. Thanks.
Pete O'Hanlon 23-Mar-17 6:46am View
   
No problem.
Pete O'Hanlon 23-Mar-17 6:31am View
   
It's being read as YY/MM/DD so that's 22nd March 2017.
Pete O'Hanlon 1-Mar-17 7:40am View
   
Thanks - I have a similar solution for Dispatcher.Invoke :)
Pete O'Hanlon 1-Mar-17 7:40am View
   
My 5.
Pete O'Hanlon 28-Feb-17 5:37am View
   
Is this a WPF application? Windows Forms? ASP MVC? ASP.NET? Other? When you ask a question, you have to remember that we don't have the background in your project so we need as much relevant information as possible.
Pete O'Hanlon 7-Feb-17 9:06am View
   
This sounds like homework to me.
Pete O'Hanlon 3-Feb-17 9:00am View
   
This sounds suspiciously like homework to me.
Pete O'Hanlon 3-Feb-17 8:59am View
   
Nobody is going to write the JavaScript you need out for you. This isn't rentacoder. If you take a little bit of time with it you'll learn the basics of a new language and you'll have a better idea as to how to work on the client side.
Pete O'Hanlon 2-Feb-17 10:11am View
   
That's because you're missing a (); off the end. I just put the call you'd need - I didn't think I'd have to spell it out exactly.
Pete O'Hanlon 2-Feb-17 3:14am View
   
What type of application are you wanting to generate the sine wave as? WPF? Windows Forms?
Pete O'Hanlon 1-Feb-17 10:30am View
   
You have a checkbox with the value "One" behind it? Is the checkbox being controlled by another cell in the same row?
Pete O'Hanlon 1-Feb-17 9:52am View
   
What do you mean by disabled? Are you trying to disable a TextBox in your DataGrid?
Pete O'Hanlon 31-Jan-17 8:04am View
   
So, according to "What I have tried", you haven't actually tried anything. What you have to understand is that we don't know what code you currently have, so we can't offer you advice about what the best approach for you is. We don't know what application infrastructure you are dealing with, for instance are you using Entity Framework? You can see from this that your question does you no favours because you will probably get answers that don't really apply to you.
Pete O'Hanlon 18-Jan-17 5:33am View
   
What bit of what I typed was unclear? You're going to have to debug this one yourself as you have access to the full source and we don't - look at the stack trace to see where the problem is, then open the files indicated in the trace and go to the line numbers indicated there.
Pete O'Hanlon 17-Jan-17 5:50am View
   
The forums at the end of articles are the best place to ask questions about the contents of the article. If you post your question there, you stand more of a chance of the author giving you an answer. It's highly unlikely that they will wander by QA and recognise that the question is about their content.
Pete O'Hanlon 10-Jan-17 8:31am View
   
Help with which part? Determining whether an incoming connection is SSL? Writing the whole browser?
Pete O'Hanlon 6-Jan-17 9:20am View
   
You're welcome. Glad to be of service.
Pete O'Hanlon 6-Jan-17 9:09am View
   
You need to look at this https://msdn.microsoft.com/en-us/library/ff527268.aspx
Pete O'Hanlon 6-Jan-17 3:35am View
   
How have you merged the videos? They shouldn't have inflated to that size.
Pete O'Hanlon 5-Jan-17 9:16am View
   
You would hope so - except I have seen companies still running XP.
Pete O'Hanlon 5-Jan-17 6:55am View
   
You're welcome.
Pete O'Hanlon 5-Jan-17 6:49am View
   
5 from me.
Pete O'Hanlon 5-Jan-17 5:24am View
   
Ah it looked from your question like it was a single image of each size. Hmmm, if you're getting multiple images coming in, you've got some serious work ahead of you I'm afraid. It sounds like you're trying to push WPF beyond the limits of its graphics rendering - saying that, you can work around this by hosting DirectX windows inside WPF windows using this project: https://github.com/Microsoft/WPFDXInterop
Pete O'Hanlon 5-Jan-17 5:15am View
   
It's no faster in XAML over C# (I just tend to work heavily in XAML). Have you cached your image as well?

For performance tuning, I tend to use JetBrains rather than the inbuilt VS tooling.
Pete O'Hanlon 4-Jan-17 4:50am View
   
+5 from me.
Pete O'Hanlon 3-Jan-17 4:42am View
   
This has nothing to do with the question. As such, I have marked it as "Off-topic".
Pete O'Hanlon 8-Dec-16 6:49am View
   
I don't see how it's that difficult to use. If I were you, I would look to use a trick similar to the one that I describe here: https://www.codeproject.com/Tips/211113/MVVM-Friendly-DataTemplate-switching
Pete O'Hanlon 29-Sep-16 4:47am View
   
Your what I have tried section doesn't match your question. Are you storing "06/01/16" as a DateTime, or is it a string? What does your code look like.
Pete O'Hanlon 24-May-16 4:11am View
   
I have had a look at what's associated with that article - there's no source content left. It's all images and articles, and I've told him this. Hopefully he'll now stop posting the same question and get on and "urgently" find another solution.
Pete O'Hanlon 24-May-16 2:55am View
   
I'm sorry but your question doesn't really tell us anything about what you are trying to do. Read what you have written and ask yourself if someone who isn't sitting next to you would know what it is that you have tried, or what you currently know. Guessing what your problem is, I would suggest that before you start worrying about responsive layouts, you make yourself comfortable with pagination. Google some examples. Search the articles here on CodeProject.
Pete O'Hanlon 5-May-16 3:43am View
   
My 5.
Pete O'Hanlon 5-May-16 3:38am View
   
I have to admit, I've rarely seen a worthwhile entry in this section.
Pete O'Hanlon 5-May-16 3:12am View
   
As a general rule, just restating your question in the What I have tried section is a bad idea. That doesn't tell us what you've tried, it tells us the opposite - it says you haven't tried anything.
Pete O'Hanlon 14-Mar-16 6:26am View
   
Restating your question isn't telling us what you have tried. What reading have you done about this and what do you already know about it?
Pete O'Hanlon 8-Mar-16 5:11am View
   
Much better. It's easy to see what the problem you face is now, with no assumptions.
Pete O'Hanlon 8-Mar-16 4:50am View
   
No, they can't see what you've tried. They can only see a question. For instance, you haven't shown if you have written a stored procedure already and got stuck on the parameters. That's why you add the second part - it shows what you've done.
Pete O'Hanlon 8-Mar-16 4:22am View
   
So, you've tried nothing then. The whole point of the What I have tried part is to tell us what you have tried and ruled out; what errors you encountered, etc. Without any basic effort, this question will be deleted.
Pete O'Hanlon 3-Mar-16 11:02am View
   
As Richard said, the What I have tried section simply restates the problem. That doesn't tell anyone what you have tried. Have you checked that you have the privileges to send emails, for instance? As it stands, the code you show here has nothing to do with sending an email - instead it shows how you would write it to the browser, so we cannot help.
Pete O'Hanlon 7-Feb-16 3:12am View
   
What about it? You don't need it with T4.
Pete O'Hanlon 5-Feb-16 7:06am View
   
Thanks - I am the saddest of the sad for knowing things like this exist :)
Pete O'Hanlon 7-Jan-16 5:13am View
   
Just to let you know that my downvote was at the time of my comment, rather than the one you received before. Do you agree that not informing the user he/she has left code open to SQL Injection is not educating them that this is a dangerous practice? Do you agree that, if this code is left as is, it will leave the code vulnerable to SQL Injection attacks? If the answer to either of these is yes, that's a 1 vote. If your answer had shown how to solve it with command parameters, I would have voted higher.
Pete O'Hanlon 7-Jan-16 4:17am View
   
This is a dangerous thing to say as you are effectively reinforcing with the OP that they should use string concatenation. KEP gives the correct solution when he indicates that this is susceptible to SQL Injection. That's why I voted 1 - you have reinforced a hazardous practice.
Pete O'Hanlon 19-Dec-15 10:44am View
   
If you look, you'll see that this answer has been edited. His or her first answer included a spam link pointing to some completely unrelated item. If you look here you can see the original answer: http://www.codeproject.com/script/Answers/EntryVersion.aspx?aid=376438&av=550454
Pete O'Hanlon 3-Sep-15 6:33am View
   
Err no - it's just convention that you have one instance, but there actually aren't any rules that you can't have multiple VM's in the XAML - the key thing to understand is that every item has it's own DataContext (that's inherited), so if you need to use a different DataContext then you just bind to the appropriate VM at that point. Of course, there are many different ways to solve this particular problem. If you use VM first resolution, then you would let WPF render in the appropriate Grid based off supplying a different VM. Alternatively, you would separate out the Grids into separate Views with their own VMs and compose them together into one master View. As I said, there are many, many ways to solve this - WPF provides a lot of flexibility here.
Pete O'Hanlon 17-Apr-15 5:41am View
   
Thanks.
Pete O'Hanlon 16-Apr-15 9:21am View
   
What problem are you facing? All I see here is a code dump.
Pete O'Hanlon 16-Apr-15 9:17am View
   
My 5
Pete O'Hanlon 3-Dec-14 5:25am View
   
You haven't included any details as to what your code is actually doing. That's kind of important.
Pete O'Hanlon 28-Nov-14 6:26am View
   
There is no way to know who down-voted your answer. What benefit would knowing who did it bring you?
Pete O'Hanlon 31-Oct-14 10:01am View
   
Well, I'm lucky enough to have formal guitar training under my belt, so I spent a lot of time learning music theory. The reason I mentioned the Emin to Aeolian is that the root of the Emin is the 6th note in the G-Major scale, so it corresponds to the 6th mode in the sequence. Basically, this means that every chord in the sequence corresponds to a mode. Now, as to why I mentioned all of this - when you are improvising a sequence, it helps to be able to understand the chord relationship to the notes that are appropriate to it. Modes open the sequences up for you.

This understanding of modes was largely what helped composers such as Rodriguez, Bach, Paganini and so on, produce pieces that were aesthetically pleasing because they knew how to tie sequences together so that tonics produced harmonically interesting lines. Indeed, it's based on the understanding of how the scales work that we can build tension and release through V to IV and VI to V resolution.

Over the years, I have been lucky enough to learn and play styles ranging from classical, through blues, rock, jazz, fusion and so on. Indeed, recently, I have been contemplating starting a blog on music theory and training. At one point, I even considered writing an article and posting it here on CP.
Pete O'Hanlon 30-Oct-14 19:02pm View
   
Sorry it's taken so long to reply. Okay, I'm fairly active giving advice right now on a couple of Facebook forums, "Guitar addiction" and "Jazz & Fusion guitarists in Facebook". I've also occasionally been known to help out on Guitarforums.com as well as the paid-for GuitarControl.com.

So, right now, what advice would I give? Well, if you're looking to expand your theory - especially with regards to extending your improvisational skills - you really need to understand how modes fit into your playing. Okay, what are modes? Well, a mode is merely the pitch structure in scales. By this, we tend to mean that a mode reflects a part of the scale starting at a note offset from the tonic. What does this mean exactly? Well, consider the C-Major scale. We know that we have 7 notes make up the scale starting at the tonic, so we have C, D, and so on through to B. If we play each note in that scale, we have the major.

Now, this is where things get interesting. When we look at the scale, we see that we don't have equal intervalic differences in there, so C to D is two intervals (C# then D), D to E is two intervals (D# then E), E to F is one interval (F#), and so on. You know all this, but this has a major relevance to what we call modes.

So, let's start with the Ionian. This is the first mode in the sequence, and corresponds to playing all the white notes from C through to B. Now, I mentioned the sequence of intervals because this is incredibly important. Ionian (or the major scale) has the intervals as W, W, H, W, W, W, H.

Now, let's imagine that we've decided to play from the D. The intervalic sequence has changed to W, H, W, W, W, H, W. This mode is known as the Dorian. So, if we are to play over the II of the C-Major, (it's a D-min), we can play the Dorian. What this actually means is that whenever we have a D-min, we can actually play C-Dorian over it.

As you can see, moving up to the next note in the sequence (the E) changes the sequence to H, W, W, W, H, W, W. This is the Phrygian mode - it's a very middle-eastern sounding mode.

Continuing up the modes, we have Lydian, Mixolydian, Aeolian and Locrian. These correspond to moving up each white note on the piano. Again, they correspond to the chord in the sequence that you can play them over. So, for the guitar, in standard open tuning, playing the E Aeolian scale (i.e., starting with open E), you would have

E Aeolian,
F# Locrian,
G Ionian,
A Dorian
B Phrygian
C Lydian
D Mixolydian

(Note, that what we have just described here is the modes of the G-Major scale).

How I got started with this is I sat down and drew out a load of fretboards and then, for each mode, I drew out what they would look like for each key. I would then record the chord that corresponded (e.g. E-Minor for the E-Aeolian in C-Maj), and I played the notes over the top, corresponding to that sequence of Whole-tone/Half-tone, until I had drilled the sound into my head. It's a great way to learn the notes on the neck, and also to learn what fits over what chords.
Pete O'Hanlon 30-Oct-14 11:40am View
   
Interesting, except for the fact that exploring the use of that chord in alternative sequences is not what the person who came along has asked. They have asked how to use a chord in relation to that particular track. Sometimes all someone needs is to know how to play that chord - the rest comes later; and I speak here as someone who's helped out on a lot of guitar forums as well as teaching it.

I appreciate it may be a cultural thing, but sometimes negativity comes off as just being plain rude. It may not be what's intended. It might be a genuine offer, but the newbie generally doesn't have the necessary armour. People can be as negative to me as they like - I've been in this game long enough, and have enough experience to fight back, but for someone who's just starting out it's intimidating. That's something we all need to remember, and I speak as someone who used to have a bit of a reputation on this site for being sarcastic to the newcomers if they didn't meet some ever changing hypocritical criteria of mine. I learned to moderate my tone, and to remember that cultural mores differ, so while I thought I was being witty, I was really just being a jerk.
Pete O'Hanlon 30-Oct-14 5:43am View
   
It is patently obvious that he is asking for someone who has written this kind of thing before to offer some pointers. As for the requirement, it's actually common for banks to ask for this type of verification - the Verified By Visa system, for instance, uses exactly this approach: https://www.3dsecure.icicibank.com/ACSWeb/EnrollWeb/ICICIBank/main/vbv.jsp

Rather than spending all this time berating the user, you could have expended far less energy actually offering some constructive advice. Just because you don't like the requirements of his assignment doesn't mean that he shouldn't be able to ask for help on it. You could have guided him into crafting a better question or you could have just ignored it - instead, you chose to take a negative stance.

Imagine this scenario. You're learning the guitar. You've only been playing it for a couple of weeks but you decide to reach out on a forum and say that you're learning a simple song, has anyone ever played it because there's one chord you cannot finger correctly. Then along comes the resident site bully and has a go at you and says that you can't learn like that. Where's your understanding of scales? What evidence do you have to show that you have correctly mastered modes and harmonic devices? Now, imagine that you're that beginner. Would you thank this big bad bully, or would you leave, never play the instrument again because of the abuse, and even if you did continue playing, would you ever visit that site again?

Just something for you to consider.
Pete O'Hanlon 13-Apr-14 12:06pm View
   
My answer to you is to tell you that your answer does not cater for a lot of cases. Your answer won't cope wit floats, for instance. I gave an answer, above, that shows one way of doing this.
Pete O'Hanlon 24-Feb-14 16:33pm View
   
Reason for my vote of 1 \n Despite being told earlier on that this was not the fastest way to calculate a prime in all but the most trivial of cases, you still insist this is the fastest way. It's not.

Also, it's not sensible to use a double. You should, realistically, be using a long.
Pete O'Hanlon 18-Feb-14 16:29pm View
   
Why do you think it's off topic and not an answer? This answer has explained that value types cannot contain null, and it has shown how to write the code so that a value type can be null. You do know that a double is a value type don't you? So, I'm sorry, but you are wrong and you need to learn more about .NET before you start downvoting people.
Pete O'Hanlon 18-Feb-14 6:18am View
   
You are only guessing that this is the problem, and reading through the code, the DataAdapter will be a worse solution as the user is trying to find a user based on their user name and password.
Pete O'Hanlon 18-Feb-14 6:14am View
   
And what's the problem in this code, other than obvious things such as not closing the connection unless you get an exception?
Pete O'Hanlon 18-Feb-14 6:13am View
   
You're welcome.
Pete O'Hanlon 18-Feb-14 5:49am View
   
Typically, yes, you would be referring to marshalling between a background thread and the UI. The language used is fairly immaterial, as long as the operation can be marshalled - think about consuming COM events in .NET.
Pete O'Hanlon 17-Feb-14 14:18pm View
   
How is commenting that the text is plagiarised insulting? When an answer is given that directly quotes something else, it is good manners to indicate that the answer was taken from another source (and to provide a link to it). And thank you.
Pete O'Hanlon 17-Feb-14 12:43pm View
   
As I said, expose the queries as SOAP (i.e a webservice), or through REST. These would be run on the server, and your code would connect to either the REST service or SOAP service. There are many examples of how to do this online.
Pete O'Hanlon 17-Feb-14 11:56am View
   
Okay, the first part is just plagiarised text. If you're going to quote someone verbatim, please take time to link to the source. And Marshalling had absolutely nothing to do with Edward Marshall - that's another of those computer urban myths.
Pete O'Hanlon 17-Feb-14 11:15am View
   
Well, you might want to consider using a GridView and setting an asp:ImageField as displayed in this article: http://msdn.microsoft.com/en-us/magazine/cc163933.aspx. Note that you can download the source so you should be able to work out how it all hangs together.
Pete O'Hanlon 17-Feb-14 9:48am View
   
ASP.NET? WPF? Silverlight? Windows Forms?
Pete O'Hanlon 17-Feb-14 9:48am View
   
Either I've just read a different question to the one you read, or you have a deeper understanding of the problem than I do. As far as I can tell, the OP has asked how to display images and/or text on a web page from a database, not how to upload the data.
Pete O'Hanlon 17-Feb-14 9:03am View
   
All you need to do is retemplate a Tooltip. See http://msdn.microsoft.com/en-us/library/dd334410(v=vs.95).aspx for details.
Pete O'Hanlon 14-Feb-14 2:13am View
   
What do you mean by namestyles here? Which particular TryParse are you thinking of?
Pete O'Hanlon 13-Feb-14 11:25am View
   
No, WHICH ribbon are you using? Telerik? Syncfusion? Microsoft WPF Futures? MindElements?
Pete O'Hanlon 13-Feb-14 11:18am View
   
Which ribbon control are you using?
Pete O'Hanlon 13-Feb-14 7:13am View
   
Yes there is. I linked to it in my answer. As long as you are working with Linq to SQL (which she obviously is if she wants to use GETDATE) then you can get the date from the server.
Pete O'Hanlon 13-Feb-14 6:42am View
   
And what happens if the server time doesn't match the client time? Suppose the server is situated halfway round the world and is operating on a local time?
Pete O'Hanlon 13-Feb-14 6:36am View
   
Check that the configuration file has copied to your output directory - it will have been renamed as exename.exe.config where exename is the name of your executable.
Pete O'Hanlon 12-Feb-14 14:18pm View
   
You're welcome. I'm glad to be able to help.
Pete O'Hanlon 12-Feb-14 12:50pm View
   
I updated my answer to explain what's really going on - basically yield doesn't behave in the way you are expecting it to.
Pete O'Hanlon 12-Feb-14 8:31am View
   
Why? Sorting post where condition will still put the data into the correct order.
Pete O'Hanlon 12-Feb-14 8:22am View
   
Why?