Click here to Skip to main content

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

Pete O'Hanlon at yesterday View
Pete O'Hanlon at 2 days ago View
What problem are you facing? All I see here is a code dump.
Pete O'Hanlon at 2 days ago View
My 5
Pete O'Hanlon at 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 at 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 at 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 at 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 as well as the paid-for

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

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 at 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 at 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 at 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 at 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 at 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 at 18-Feb-14 6:13am View
You're welcome.
Pete O'Hanlon at 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 at 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 at 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 at 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 at 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: Note that you can download the source so you should be able to work out how it all hangs together.
Pete O'Hanlon at 17-Feb-14 9:48am View
ASP.NET? WPF? Silverlight? Windows Forms?
Pete O'Hanlon at 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 at 17-Feb-14 9:03am View
All you need to do is retemplate a Tooltip. See for details.
Pete O'Hanlon at 14-Feb-14 2:13am View
What do you mean by namestyles here? Which particular TryParse are you thinking of?
Pete O'Hanlon at 13-Feb-14 11:25am View
No, WHICH ribbon are you using? Telerik? Syncfusion? Microsoft WPF Futures? MindElements?
Pete O'Hanlon at 13-Feb-14 11:18am View
Which ribbon control are you using?
Pete O'Hanlon at 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 at 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 at 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 at 12-Feb-14 14:18pm View
You're welcome. I'm glad to be able to help.
Pete O'Hanlon at 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 at 12-Feb-14 8:31am View
Why? Sorting post where condition will still put the data into the correct order.
Pete O'Hanlon at 12-Feb-14 8:22am View
Pete O'Hanlon at 11-Feb-14 9:10am View
Not bad, but that is going to be slow processing. GDI iteration using GetPixel and SetPixel is notoriously slow.
Pete O'Hanlon at 11-Feb-14 7:36am View
So follow the links from the search and start reading. Unfortunately no one here is going to be able to write this functionality for you.
Pete O'Hanlon at 11-Feb-14 7:04am View
As this doesn't have anything to do with the question you originally asked, could you please start a new question?
Pete O'Hanlon at 11-Feb-14 6:42am View
Are you talking about getting the value of this variable and putting it into a TextBox so that it can be read at the server side? If so, (assuming you're using jQuery), use something like this: $('#textbox').val(javaScriptVariable); Don't forget that ASP.NET mangles control IDs so you'll have to give the mangled client id (you can get this from the ClientID property on the TextBox).
Pete O'Hanlon at 11-Feb-14 6:34am View
The session should come from the web server - you shouldn't try to create it at the client side because the server will have no understanding of it.
Pete O'Hanlon at 11-Feb-14 6:22am View
Well, I did tell you the search terms to plug into Google. As you said please, however, here's a Google search to start you off: If you include the database that you are using as part of the search term, you should be able to narrow this down even further.
Pete O'Hanlon at 6-Feb-14 11:43am View
Excellent. As long as it's working now.
Pete O'Hanlon at 6-Feb-14 11:02am View
You don't actually need to load the sample - he's posted all the code on his page. You can build it from that.
Pete O'Hanlon at 6-Feb-14 10:59am View
No. In your code - so GetIntConfig will become GetShortConfig (and return a short). The alternative is to cast the int to short in your for loop - so you would do something like GoTo[0].degrees[0] = (short)AlleCoordinaten[a,0];
Pete O'Hanlon at 6-Feb-14 10:48am View
Okay, so you would have to change the GetInt into GetShort and the corresponding ints to shorts.
Pete O'Hanlon at 6-Feb-14 10:41am View
So, look at the second article then. It details it pretty thoroughly.
Pete O'Hanlon at 6-Feb-14 10:37am View
What is the needful? You have the direct links to these articles.
Pete O'Hanlon at 6-Feb-14 10:36am View
Whatever you store in GoTo[...].degrees[...] has to be an int as well.
Pete O'Hanlon at 6-Feb-14 10:26am View
Excellent answer Bill.
Pete O'Hanlon at 6-Feb-14 10:26am View
Oops, that's right. Change the data type of the array from short to int.
Pete O'Hanlon at 6-Feb-14 10:25am View
I have amended my answer to show you how to call InitializeComponent.
Pete O'Hanlon at 6-Feb-14 10:02am View
I don't see anywhere in your code that you call InitializeComponent. You need to call this in your constructor before you can get access to the controls on the UserControl.
Pete O'Hanlon at 6-Feb-14 9:52am View
You're wanting to stream the data from the client back to the server?
Pete O'Hanlon at 6-Feb-14 6:24am View
This is just a code dump. It doesn't tell us what is wrong with the code. Is it causing an exception? If so, where? Is the page doing something you don't expect?

I appreciate that the issue is obvious to you, but we don't have access to your machine or your requirements so we cannot see what's going on.
Pete O'Hanlon at 6-Feb-14 6:15am View
You are welcome. I'm glad that I could help.
Pete O'Hanlon at 6-Feb-14 5:59am View
What datatype is this value in SQL? Is it a Date or DateTime - or is it a string?
Pete O'Hanlon at 5-Feb-14 9:10am View
This could be tricky. The ability to do this would reside in your application having high enough admin rights to amend group policies - that's far greater trust than most applications should have.
Pete O'Hanlon at 5-Feb-14 8:52am View
Pete O'Hanlon at 5-Feb-14 6:00am View
Errm, you got your percentage vote wrong. The total number of votes are 8.
Pete O'Hanlon at 5-Feb-14 5:31am View
What anchor text? You need to encode your HTML when you submit it so that HTML tags are properly represented.
Pete O'Hanlon at 4-Feb-14 11:00am View
Pete O'Hanlon at 4-Feb-14 10:49am View
You're welcome. I'm glad I could help.
Pete O'Hanlon at 4-Feb-14 6:47am View
Those aren't references. Right click on the project references in Solution Explorer and choose "Add reference..." from the context menu.
Pete O'Hanlon at 4-Feb-14 6:46am View
The syntax of creating or amending a stored procedure takes care of this for you - you don't actually have to do much beyond add CREATE or ALTER PROC at the start to let SQL Server know what to do with the procedure.
Pete O'Hanlon at 3-Feb-14 11:26am View
You might be able to add the constraints via VS. I normally use SQL Server Management Studio though.
Pete O'Hanlon at 3-Feb-14 10:56am View
No. I mean add foreign key constraints to them in the database.
Pete O'Hanlon at 3-Feb-14 10:11am View
I'm not sure how many ways I can say the same thing. You have a field with an identity column. This field will get its value inserted via SQL Server. Your FoodID and ItemID fields SHOULD NOT be identity columns. What they should be is foreign keys to the Food and Item tables. I repeat, they SHOULD NOT be identity columns. If you need an identity column, make that a separate column - possibly called InventoryID.
Pete O'Hanlon at 3-Feb-14 10:07am View
Then either FoodID or ItemID is an identity column. You shouldn't be attempting to insert that - you let the database handle that itself.
Pete O'Hanlon at 3-Feb-14 10:04am View
It doesn't matter - you are still just supplying literal values - you have no WHERE clause in there.
Pete O'Hanlon at 3-Feb-14 6:54am View
That's entirely possible.
Pete O'Hanlon at 3-Feb-14 6:44am View
So, your IsValidEmail doesn't look like it's being called anywhere here. I assume you want to be putting this method in your RxReminderEmail method to determine whether or not you can send the email.
Pete O'Hanlon at 3-Feb-14 6:24am View
No there isn't. This is entirely in the control of the page that's being rendered.
Pete O'Hanlon at 31-Jan-14 6:06am View
Please stop raising the same question over and over again. Engage in a discussion with the people who have already answered your questions in other threads if you have a problem. As it stands, people will soon start deleting your duplicate questions.
Pete O'Hanlon at 31-Jan-14 5:08am View
There's no guarantee that the date has been stored as a string here. DateTime.ParseExact expects strings, so that would be why he's parsing it to a string first.
Pete O'Hanlon at 31-Jan-14 2:11am View
Why are you trying to decompile a DLL? The fact you don't know whether or not it's a .NET assembly suggests it's not your work that you are trying to recover.
Pete O'Hanlon at 30-Jan-14 5:23am View
I'm glad it helped.
Pete O'Hanlon at 30-Jan-14 1:37am View
Which problem? If you read my answer, you would have seen that these are different problems - you have to give us a clue and tell us which one we are trying to solve.
Pete O'Hanlon at 29-Jan-14 16:54pm View
It works now. I fixed the download.
Pete O'Hanlon at 29-Jan-14 13:32pm View
Pete O'Hanlon at 29-Jan-14 12:38pm View
Thanks, I was a bit zealous in my comma(ing). :D
Pete O'Hanlon at 29-Jan-14 12:34pm View
Snap! My 5.
Pete O'Hanlon at 29-Jan-14 11:50am View
I know they do - my point is that you can't rely on int.TryParse if it can be any numeric type - you would potentially need to try all the different TryParse methods to find the relevant one that works so you will fall through the different ones when isNumber is false.
Pete O'Hanlon at 29-Jan-14 11:24am View
The only way to do this is by immersing yourself in code. Get yourself a copy of a book like .NET book Zero (it's free) and read that.
Pete O'Hanlon at 29-Jan-14 11:10am View
Pete O'Hanlon at 29-Jan-14 11:05am View
You start by downloading it. Then you install it and run it to get a feel for it. Run it inside Visual Studio (or Visual C# Express) and step through the code seeing what happens where.
Pete O'Hanlon at 29-Jan-14 10:29am View
You're welcome. It was a great question - you clearly showed the code that was causing a problem and explained what issue you were seeing. Honestly, it was a pleasure helping. Keep posting questions of this standard and I will be your friend for life.
Pete O'Hanlon at 29-Jan-14 10:23am View
I'm glad that's sorted. Good job and thanks for letting me know.
Pete O'Hanlon at 29-Jan-14 10:21am View
Thanks. One of my big problems with the Convert class is it doesn't have a TryChangeType method - that's what this is for.
Pete O'Hanlon at 29-Jan-14 10:17am View
The OP's requirement is to detect a number; not an integer. What happens if myString contains "1.2"?
Pete O'Hanlon at 29-Jan-14 10:12am View
My guess is that the Size is your problem. This parameter is the minimum scale of the face to search for - most people who use the none default size tend to use a fractional value of their overall image size, so you could set it to something like: new Size(orignalImage.Width / 2, orignalImage.Height / 2)
Pete O'Hanlon at 29-Jan-14 9:53am View
Well, that was the answer I was going to give. Great job. +5.
Pete O'Hanlon at 29-Jan-14 9:33am View
Easiest solution ever? Okay, what about if I pass in 1.2 as myString? Is that an int? Or how about if I use long.MaxValue?
Pete O'Hanlon at 29-Jan-14 9:32am View
What if it's a long? Or a double?
Pete O'Hanlon at 28-Jan-14 11:16am View
Indeed. I couldn't have put it better. My 5.
Pete O'Hanlon at 28-Jan-14 8:27am View
Thanks. I'm taking a different approach to helping people now - if I can teach just one person how to solve a problem then my time on CodeProject is time that I have spent well.
Pete O'Hanlon at 28-Jan-14 5:50am View
Err no. I can see what you are trying to say here, but you've not said what you think you said. I assume what you were trying to say was that an interface contains only the contract about what must be implemented, and provides no actual implementation.
Pete O'Hanlon at 27-Jan-14 12:40pm View
Ah, I see. I think the biggest issue with your explanation is the bit where you say "A callback means, when an operation is over you call a method." While I can see what you are trying to say here, the explanation doesn't read quite right. What would improve this explanation would be to detail how the call is back to the calling object. Apart from that, your explanation wasn't too bad.
Pete O'Hanlon at 27-Jan-14 11:45am View
I'm confused as to what changes you're expecting me to make. Perhaps you could enlighten me.
Pete O'Hanlon at 27-Jan-14 11:12am View
Thanks. I don't want to discourage.
Pete O'Hanlon at 27-Jan-14 10:45am View
Thank you. Much appreciated.
Pete O'Hanlon at 27-Jan-14 10:23am View
You're welcome. If, during your thesis, you have problems, please come back and ask questions of us. We are here to help after all.
Pete O'Hanlon at 27-Jan-14 10:03am View
Thanks Bill. I didn't really want to squash his/her enthusiasm at a time when he/she should be really excited about coding. There's nothing worse at the start of a project.
Pete O'Hanlon at 27-Jan-14 10:02am View
You can think of "value" as being a magic variable - it's automatically applied to the set part of a property to pass in the value. I have updated my pseudo-logic to show you where it appears.
Pete O'Hanlon at 27-Jan-14 8:10am View
No problem. I'm glad to help.
Pete O'Hanlon at 27-Jan-14 5:58am View
You state that your code is: start.FileName= @"c:\Users\rahuls1\Desktop\DEmo\Temp\demo.exe"; That does not point to the Python executable. That points to an application called demo.exe.
Pete O'Hanlon at 27-Jan-14 5:42am View
I have made it clear. It couldn't be ANY clearer. You are trying to run a python code. This will only work if PYTHON.EXE invokes it - which is the reason why you have to provide a path to the PYTHON executable to run it.
Pete O'Hanlon at 27-Jan-14 5:36am View
start.FileName isn't pointing to PYTHON though. I thought I was clear in telling you that it had to point to the python executable.
Pete O'Hanlon at 27-Jan-14 5:23am View
Have you added the right path to the python executable?
Pete O'Hanlon at 27-Jan-14 5:16am View
This only works if the machine that the application ends up on has Corel Draw installed.
Pete O'Hanlon at 27-Jan-14 4:38am View
You're talking about pivoting your data here, not grouping data. Doing this inside your DataTable would not be practical as you can end up with varying numbers of columns. If I were you, and I were doing this using an RDBMS, I would look to see if I could get the data back pivoted.
Pete O'Hanlon at 23-Jan-14 9:41am View
It's still going to run server side. There's no way around the file having to be transferred over to the server to test it. And yes, your code will put out an alert, but that alert will have been written back from the server.
Pete O'Hanlon at 23-Jan-14 9:29am View
That requires a post to the server before it can determine whether or not the image matches the dimensions.
Pete O'Hanlon at 23-Jan-14 5:43am View
Your document.write code is missing a load of stuff. What's happening in there?
Pete O'Hanlon at 22-Jan-14 12:06pm View
Are you using Windows Forms or WPF? The solution is different depending on what framework you are coding your app for.
Pete O'Hanlon at 22-Jan-14 12:04pm View
Thanks Bill. I didn't really want to squash his/her enthusiasm at a time when he/she should be really excited about coding. There's nothing worse at the start of a project.
Pete O'Hanlon at 22-Jan-14 11:24am View
So what you're after is having the session keep itself alive as long as the user still has your page open in the browser? What you need to do is create a heartbeat that fires back to your site just to inform it that the site is open. I will sketch one out for you as a separate answer.
Pete O'Hanlon at 22-Jan-14 9:21am View
How can you have accepted your own answer? It makes no sense when you are asking another question. If you want to reply to someone, click on the Have a Question or Comment? button below their answer. You're lucky I decided to revisit this question.
Pete O'Hanlon at 22-Jan-14 7:42am View
Thanks my friend.
Pete O'Hanlon at 17-Jan-14 6:37am View
It's still wrong as he's modifying file in his inner loop.
Pete O'Hanlon at 16-Jan-14 3:05am View
You would use navigator.geolocation.getCurrentPosition to get your current position. The docs for this are here:
Pete O'Hanlon at 16-Jan-14 2:29am View
There's an example here: that shows you exactly how to do this. You need to supply your current lat/long to it, the radius of the search and the type you're interested in from the listview.
Pete O'Hanlon at 15-Jan-14 10:39am View
You need to describe your problem a whole lot more. Right now all I see there is a sentence that doesn't make much sense. You might understand what you mean, but if you can't explain it you aren't going to get any help from others. Oh, and people are unlikely to give you step by step examples - we aren't here to do your research for you.
Pete O'Hanlon at 15-Jan-14 8:40am View
Depending on how much buy in you can get from management, you could go with this book: The big thing with release management is that it requires buy-in from all levels. It's worth pushing to get it done though. Managing it is a full time job which is why I have a release manager.
Pete O'Hanlon at 15-Jan-14 3:13am View
The problem you're seeing is that it didn't actually compile successfully. You have put MessageBox.Show in there, but compiled code doesn't have any references to Windows Forms. When you compile your project it's always worth looking to see if there are any errors. Use this to diagnose your issues:
public static class CodeDomHelpers
public static void CheckForErrors(this CompilerResults results)
if (results.Errors != null)
System.Diagnostics.Debug.WriteLine("Encountered the following compilation errors.");
CompilerErrorCollection es = results.Errors;
foreach (CompilerError s in es)
Pete O'Hanlon at 9-Jan-14 10:32am View
Have you put a breakpoint in yet? Use the debugger; to trip this.
Pete O'Hanlon at 9-Jan-14 10:32am View
Have you put a breakpoint in yet? Use the debugger; to trip this.
Pete O'Hanlon at 9-Jan-14 10:11am View
Change your URL to SOEDefault.aspx/GetData, and put a breakpoint in the JavaScript to see if any items are undefined.
Pete O'Hanlon at 9-Jan-14 10:01am View
Well, one that that stands out is that you should be using POST rather than GET and remove the brackets from the method name in your URL.
Pete O'Hanlon at 9-Jan-14 9:59am View
Then you might want to put this comment on the OP's question so that he's informed of it.
Pete O'Hanlon at 9-Jan-14 9:48am View
Is there a reason you've addressed this to me rather than to the OP?
Pete O'Hanlon at 9-Jan-14 9:47am View
You can reference the JSON script, which you can download from
Pete O'Hanlon at 8-Jan-14 18:47pm View
What error do you get?
Pete O'Hanlon at 8-Jan-14 13:36pm View
If you edit your original post (click the green Improve Question link), you can add the code there. As it is, the comment has been truncated so your code is lost.
Pete O'Hanlon at 8-Jan-14 9:47am View
Are you talking about throttling the concurrent number of users who access the service? What do you want to happen if you have a long running operation at the service side?
Pete O'Hanlon at 8-Jan-14 9:35am View
Could you copy in what you really have, rather than typing it in from memory? What you have there will not work as these are not valid config settings (for instance, you have add name=""X-UA-Compatible""... with double quotes.
Pete O'Hanlon at 8-Jan-14 6:58am View
If I were you, I would follow this link and start reading up about SQL Server and IIS best practices. There's no easy answer for you here, I'm afraid, because the answer really depends on your company security policies - you might want to talk to your system administrators about this.
Pete O'Hanlon at 7-Jan-14 3:18am View
Reason for my vote of 5 \n Simple, yet elegant. I like it.
Pete O'Hanlon at 17-Dec-13 7:06am View
You will be notified that I am deleting your answer. Personal abuse like this is not welcome on CodeProject. If you do not learn to modulate your behaviour, you will be removed from CodeProject.
Pete O'Hanlon at 13-Dec-13 6:55am View
Err no. That's not the way to handle this. What about if I were to paste AAA-AAAA-AAAAAAA into the textbox?
Pete O'Hanlon at 11-Dec-13 12:19pm View
My 5 for giving him good advice.
Pete O'Hanlon at 4-Dec-13 11:10am View
As a note, putting that it's urgent in your question isn't going to get your question answered any faster. People volunteer their time freely, and will answer when they are able. Remember, just because it's urgent for you doesn't mean that it's urgent for anyone else.
Pete O'Hanlon at 20-Nov-13 15:36pm View
Add this declaration into your XAML (usually you'd put this in the UserControl bit: xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero". Make sure you add a reference to PresentationFramework.Aero into your project as well.
Pete O'Hanlon at 20-Nov-13 12:41pm View
I'm not johannesnestler. As far as editing a copy of an existing one, you don't have to - I've taken care of this for you already. All you need do is put your ComboBox on the view and this template will automatically be applied (complete with the nested ProgressBar). All you need to do is hook up the ProgressBar values and, optionally, its Visibility.
Pete O'Hanlon at 20-Nov-13 11:26am View
What, exactly, are you trying to accomplish by pulling out road information? As the image is going to be 2D, then you will be missing the fact that roads are actually 3D - this is a common mistake. What happens, for instance, if a road goes under a flyover (a common case). If you're trying, for instance, to roll your own routing algorithms, you need access to the underlying road data - this contains information such as road segments, speeds, etc...
Pete O'Hanlon at 20-Nov-13 11:06am View
I'm sorry, I have no idea what you're asking. Could you rephrase your question so that I can understand it? When you talk about wave, what's the wave? What frame? These are things you need to let people know about when you post a question like this. One warning, though, is that people are likely to tag this question as wanting someone else to do the work for you. If that's not your intent, then you need to let us know exactly what you have done so far.
Pete O'Hanlon at 20-Nov-13 11:01am View
Indeed. Hopefully, the fact I've given him a one to have a look at might help.
Pete O'Hanlon at 7-Oct-13 14:23pm View
To answer your question here - there are many reasons that someone asks a question here rather than go via google. They may not know how to phrase their google search. They may be lazy. They may already have gone to Google, but gone to an incorrect page.
Pete O'Hanlon at 3-Oct-13 9:51am View
:) - No, I followed a link to this question from an answer that was posted today.
Pete O'Hanlon at 3-Oct-13 5:45am View
Sorry to reopen an old answer Griff, but your answer is not correct. It is perfectly possible to run a C# application without the .NET framework installed. It's not a trivial endeavour to roll your own, but there used to be a product called thinstall that did this for you (it's now been acquired by VMware and is packaged as VMWare ThinApp).
Pete O'Hanlon at 1-Oct-13 10:23am View
What technology are you using here? ASP.NET? ASP MVC? WinForms? Silverlight? WPF? The answer you get will depend largely on the technology - plus, choose whether it's a textbox or grid view - the solution is different depending on which one.
Pete O'Hanlon at 18-Sep-13 10:25am View
I edited your question and changed the syntax from VB to SQL. As if by magic, the VB colouring disappeared.
Pete O'Hanlon at 16-Sep-13 6:22am View
"And its clear from the question it self that its non question as there is nothing to solve." I disagree. The OP asked a question that had a definite answer - how can you think there was nothing to solve there? Yes, the OP could have found this out for himself, but the simple fact is, a question was asked and an answer was given. Looking at your history, you have a message history of being quick to judge others and to pop over to the Suggestions and Spam forums when people bite back at you. If you didn't like the fact that TheUltimateDebugger gave an answer, then you could simply have ignored it - why does it bother you that he answered?
Pete O'Hanlon at 16-Sep-13 6:04am View
I'm curious. Why do you think this is a none question? What authority do you have to decide whether or not a question is worth someone answering? As far as the question goes, while it's not brilliant, a courteous reply is still in order.
Pete O'Hanlon at 11-Sep-13 15:16pm View
If you can post a link to one of these PNG files, I'll take a look. This code works fine for me.
Pete O'Hanlon at 8-Jul-13 8:18am View
Please ignore the answer here as this is completely wrong.
Pete O'Hanlon at 8-Jul-13 8:18am View
This is just plain wrong. You don't inherit interfaces, you implement them. This means you still need to add them into the classes.
Pete O'Hanlon at 5-Jul-13 5:17am View
Reason for my vote of 1 \n There is nothing here. This is simply a link to a Codeplex project and a picture. Until you expand this to actually provide some implementation detail, my vote will remain as 1.
Your project may be good, but this doesn't even qualify as a tip (I honestly don't know how it got approved).
Pete O'Hanlon at 2-Jul-13 11:09am View
And how would this satisfy his question? You've just created a select without a where clause.
Pete O'Hanlon at 1-Jul-13 10:50am View
I have to agree with Sergey. You haven't actually asked a question here. There's no code to look at, and this would be better off being answered here:
Pete O'Hanlon at 25-Jun-13 5:44am View
Did you read the documentation page I linked to? The reason you are seeing odd sizes is because it's preserving the aspect ratio. In order to ignore the aspect ratio, put ! at the end of the size (e.g. 450x450!).
Pete O'Hanlon at 21-May-13 11:35am View
It looks edited to me.
Pete O'Hanlon at 21-May-13 10:48am View
You can edit your question to remove any sensitive parts.
Pete O'Hanlon at 21-May-13 10:46am View
Why do you need it deleting?
Pete O'Hanlon at 21-May-13 10:45am View
Have a look at Eventvwr and see what exceptions are being written there.
Pete O'Hanlon at 16-May-13 7:24am View
I am removing your answers as you are a spammer. This account will be removed as well.
Pete O'Hanlon at 1-May-13 17:37pm View
If it's not getting trimmed, then it's not a space character.
Pete O'Hanlon at 1-May-13 10:32am View
There's not a lot we can do to help you here. You need to make changes at the server end to see what's going on there.
Pete O'Hanlon at 17-Apr-13 2:51am View
Do you not think that this is completely unnecessary? While it's great that you voted someone a 5, you don't need to tell them afterwards. They already know they've been voted a 5. Telling them that you voted them a 5 is not needed unless you think they feel they need your seal of approval. Granted, we've all been guilty of saying this at one time or another, as you are such a prolific poster here, is it not time for you to take the lead?
Pete O'Hanlon at 21-Mar-13 12:18pm View
Does your SetBusy and UnSetBusy method actually raise the property change notification though? I assume that you are binding to the IsBusy property and using the BooleanToVisibilityConverter to control whether or not the indicator is displaying.
Pete O'Hanlon at 21-Mar-13 11:24am View
I'm not here to debug your project for you. I don't have Telerik installed on my machines, so it would not be ethical for me to install one of their controls just to look at this. And seriously, from the code you posted, it can't possibly work. Check the scope of your CustList and then ask yourself how it can contain any data when you've just created it.

What you need to do is add a breakpoint into this method and step into it. Actually inspect things - that's what you're expecting us to do for you after all.
Pete O'Hanlon at 13-Mar-13 5:42am View
I would ignore this one. He's cross posted it.
Pete O'Hanlon at 25-Feb-13 14:12pm View
You were warned, before, about spamming the site attempting to get link backs to your site. Your account has been identified as a spammer, and will be removed. I am removing the linkbacks to your site because you are violating the spirit of Code Project.
Pete O'Hanlon at 12-Feb-13 15:26pm View
You're welcome Alex. I'm glad to have been able to help.
Pete O'Hanlon at 12-Feb-13 6:55am View
Anurag, there are many routes to cross platform development that support different devices. As I show in my answer, you can use something like PhoneGap, or you could use C# with Mono - take a look at
Pete O'Hanlon at 12-Feb-13 5:04am View
Thanks Edo.
Pete O'Hanlon at 11-Feb-13 8:53am View
It's not complicated at all - it's something called MVVM. Have a read of this article to get an idea:
Pete O'Hanlon at 11-Feb-13 7:08am View
Upload them to where? A web site? An FTP site? A server your application has access to?
Pete O'Hanlon at 11-Feb-13 7:05am View
No - the UrlManagerView is a UserControl - that's why I said user control.
Pete O'Hanlon at 8-Feb-13 6:33am View
No I can't, and I don't give out my details. Try running the code through a C# to VB.NET converter like the one on Telerik.
Pete O'Hanlon at 8-Feb-13 6:15am View
Adam Nathan's WPF Unleashed is a great book on WPF. Check out articles by Sacha Barber and Josh Smith here on Code Project.
Pete O'Hanlon at 8-Feb-13 5:59am View
That's correct.
Pete O'Hanlon at 7-Feb-13 8:53am View
Wow. There's so much wrong with this solution I don't know where to start. Ok, first of all, don't use Convert.ToInt32 - what happens if the user has typed 1.2 in the text box? Secondly, why cast to (int?) null when you could just have put 0 in there and removed the nullable int? Finally - and most importantly, TryParse sets the output to 0 if it's an invalid value in there.
Pete O'Hanlon at 7-Feb-13 8:50am View
Replace with 0 in your SELECT statement.
Pete O'Hanlon at 7-Feb-13 8:06am View
Pete O'Hanlon at 7-Feb-13 6:55am View
Good job. Well done.
Pete O'Hanlon at 7-Feb-13 6:54am View
The code that you updated after I answered this shows that you have a syntax error. "insert into User_Access(user_identity,Access_id,Active)select Access_id,active from access and user_identity=(select id from login_details where Login_id=@Login_id)" The error is because you have an and clause in there. It should be a where clause.
Pete O'Hanlon at 7-Feb-13 6:11am View
My 5.
Pete O'Hanlon at 7-Feb-13 5:50am View
My 5.
Pete O'Hanlon at 7-Feb-13 4:58am View
I wish you'd added that as a solution so I could 5 it.
Pete O'Hanlon at 7-Feb-13 4:39am View
I already have - the keywords you need are highlighted in there. I'm not doing your homework for you - 2 minutes with Google using those keywords will tell you everything you need to know.
Pete O'Hanlon at 6-Feb-13 17:43pm View
What can I say? When you're right, you're right. My 5.
Pete O'Hanlon at 6-Feb-13 11:58am View
No - never teach someone that a bad practice is acceptable. Once a bad practice is learned, it's very hard to unlearn. It's much better to show someone the right way to do it, rather than the wrong way.
Pete O'Hanlon at 6-Feb-13 11:32am View
Seriously? And what happens when he develops an application that has thousands of users, all connecting to the same database? What happens if the database crashes? Your code is extremely bad practice, and should be discouraged.
Pete O'Hanlon at 6-Feb-13 10:58am View
That's because you're creating a dialog. A dialog doesn't return to the calling code until it's closed, so it won't hit the Activate. I apologise because when I read your question, for some reason, I thought you'd called Show() and not ShowDialog().
Pete O'Hanlon at 6-Feb-13 8:24am View
Fair enough. This is generally the recommended approach, and makes heavy use of a pattern called MVVM. As you play with WPF, you really should read up on that.
Pete O'Hanlon at 6-Feb-13 8:16am View
That's pretty straightforward, and the reason I used an ObservableCollection. Basically, the way an ObservableCollection works is WPF watches for collection changes to this type (technically, it looks for changes raised from ICollectionChanged which ObservableCollection implements). When you add or remove an item, the user interface is updated to reflect this - so, in this case, all you'd need to do is clear the collection and then add the relevant number of HardwareState instances to the collection. The beauty of the approach I've shown is that all you are manipulating is the data - let WPF handle the rest for you, so you don't need to manage adding or removing controls yourself.
Pete O'Hanlon at 6-Feb-13 4:20am View
Not a problem. Good luck. We've used it to embed WebKit into a WPF project for a client of ours. I have to say that it was sweet.
Pete O'Hanlon at 6-Feb-13 4:15am View
I'd start with Alternatively, you could always build from the source that Google uses from Chrome:
Pete O'Hanlon at 5-Feb-13 15:25pm View
For a newcomer? Yes. Put it this way, I've been a professional programmer for the last 25+ years, and I found WPF to be hard when I got into it 5 years ago.
Pete O'Hanlon at 5-Feb-13 15:17pm View
I'm glad it worked, but if you're only starting to learn C#, I would start with something simpler than WPF.
Pete O'Hanlon at 5-Feb-13 15:00pm View
Right click on the project in the Solution Explorer, select Add Reference and choose Assemblies - then pick the relevant project. May I also suggest that you buy a book on programming .NET? Seriously, this is basic stuff.
Pete O'Hanlon at 5-Feb-13 14:51pm View
I'm fine thanks. Busy busy. Hope you're keeping well.

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