15,797,050 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Python questions
View PHP questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by KenBonny (Top 33 by date)
KenBonny
5-Nov-13 3:35am
View
You are right and I will update my question.
KenBonny
14-Aug-13 8:33am
View
I followed the instructions on a website (which I can't seem to find anymore). It basicly said to create a .cer and .pvk file and then use those to create a local certificate and sign the script with that.
But setting the policy to RemoteSigned will work for my company's security rules. Thanks for the information!
KenBonny
13-Aug-13 4:11am
View
No, no I have not. Didn't know I should do that. I'll look into it. Thanks.
Will editing the execution policy to RemoteSigend work? Because it was AllSigned. Or did you refer to something else?
KenBonny
12-Aug-13 1:45am
View
VS2012 has great support for debugging multi threaded apps. I found out that the code in AddStopwatch_OnClick keeps blocking the thread.
{
timer.Time = t;
await Task.Delay(1000);
}
This should be run async, but it's being run on the UI thread, thus blocking the whole UI. I'm looking into fixing this now.
KenBonny
9-Aug-13 3:30am
View
Thanks for the useful info, but I was wondering if I could solve this using the TPL (Task Parallel Library).
KenBonny
9-Aug-13 1:48am
View
Hahaha, awesome. :p
KenBonny
14-May-13 2:52am
View
Didn't you just write your own event handler? How is that better than using the build in C# constructs? Can you explain your reasoning?
KenBonny
21-Sep-12 5:20am
View
Tried both things, they both don't work.
Btw: "//Obj" should get all the Obj tags in the document. But none of it works. :(
The schema is there because this is an output of PowerShell's Export-CliXml cmdlet.
KenBonny
18-Oct-11 3:35am
View
Deleted
I gave it 5, my reason: mind = blown. The first algorithm was a little brain f***. But the example with the if then else cleared it right up. Very nice use of the shorthand method.
KenBonny
27-Sep-11 7:47am
View
Deleted
Then I dare you to run the next console application, written in C#:
using System;
using System.Security.Cryptography;
namespace Test
{
class Program
{
static void Main()
{
bool stop = true;
do
{
int i = RandomNumber(int.MaxValue);
if (i > 256)
{
stop = false;
Console.ForegroundColor = ConsoleColor.Yellow;
}
Console.WriteLine(i);
} while (stop);
Console.Read();
}
private static int RandomNumber(int maxvalue)
{
RandomNumberGenerator random = RandomNumberGenerator.Create();
var r = new byte[1];
random.GetBytes(r);
var val = (double)r[0] / byte.MaxValue;
return (int)Math.Round(val * maxvalue, 0);
}
}
}
KenBonny
15-Sep-11 3:53am
View
I don't see the problem from your code. Best solution I can give you is to add a watch to your DataSource on the combobox and see when it changes, then inspect where it changes and take it from there.
KenBonny
15-Sep-11 3:17am
View
This is where you databind the list items to the combobox, probably done in the constructor or when the form loads. Could you post the on selection changed function too, because I can't divine what happens from this example.
KenBonny
15-Sep-11 2:46am
View
I don't get the votes for 2. I think this is well structured, provides one example throughout the entire post so you know what we're talking about and it doesn't use that much advanced terminology.
The only reason I didn't give a 5 is because you didn't specify that you shouldn't use an abstract class as an instance, only as a type that is initialised with a sub class. Example:
abstract class Car {}
class Sedan : Car {}
class Program {
public static void Main() {
Car c = new Sedan();
}
}
KenBonny
14-Sep-11 6:05am
View
Deleted
I don't see it either, unless I'm missing something.
The val variable will contain a double between 0 and 1, depending on the value of the random byte that was generated. Then the maxvalue will be multiplied with a value between 0 and 1 and will thus act as if divided by the number behind the comma. Example: maxvalue = 6, val = 0.2 => return 3. This is 'random' depending on how random the byte is, that is generated by the random.GetBytes function.
KenBonny
14-Sep-11 5:25am
View
Deleted
Reason for my vote of 5
I knew I could alias a namespace, but I didn't know I could do it with a type. Thanks!
KenBonny
14-Sep-11 2:31am
View
Deleted
Reason for my vote of 5
Indeed, I prefer int.TryParse over a chunky and unreadable RegEx any day.
KenBonny
13-Sep-11 9:33am
View
Nice explanation. Personally I would use a class, because I like OOP, but a structure would be just as good in this case.
KenBonny
13-Sep-11 2:07am
View
Cheers. Didn't know I had to use those. It's been a looong time... since I've used those.
KenBonny
12-Sep-11 7:14am
View
Sorry mate, never worked with WPF before.
KenBonny
9-Sep-11 2:57am
View
I'm kind of confused. Have you made one form and are calling it twice and want to show different data in each call.
Code
{
Form1 frm = new Form1();
frm.ChangeDataSource(firstDataSource);
frm.Show(); // show first set of data
frm.ChangeDataSource(newDataSource); // change the data source
frm.Show(); // show second set of data
}
Or have you made two forms, which you call once each and you want to show different data in different forms.
Code
{
Form1 frm1 = new Form1();
Form2 frm2 = new Form2();
frm1.Show(); // show first set of data
frm2.Show(); // show second set of data
}
KenBonny
8-Sep-11 4:08am
View
Deleted
Your code will remove all the "Node" elements, while Kim's code will only remove the first "Node" element.
KenBonny
8-Sep-11 2:58am
View
Deleted
Aah, didn't know that. Thought any button would do. Thanks for sharing.
KenBonny
8-Sep-11 2:45am
View
Deleted
Reason for my vote of 5
Great link to a blowfish implementation.
KenBonny
7-Sep-11 9:39am
View
Deleted
Sorry for asking this then: isn't it easier to give each WebService function a distinct name instead of overloading one function and giving them specific names through attributes. With each function having it's own name, you can more easely find the right function when you are searching through the code base and only have the webmethod name (say, you're debugging and you got only the stacktrace from a remote call). Just my 2 cents.
KenBonny
7-Sep-11 2:54am
View
Deleted
Reason for my vote of 5
Very well described. But when I want to call the methods from remote code, wouldn't I have to use "OverloadingWebService.AddInt(1, 2)" instead of "OverloadingWebService.Add(1, 2)"?
KenBonny
7-Sep-11 2:29am
View
Deleted
Reason for my vote of 4
Great tips and I was just looking at RegEx in general, so thanks!
KenBonny
1-Sep-11 5:12am
View
I see now what I did wrong. And I learned something here, let me share that with you:
If you implement an interface, apparently you can implement it two ways.
The first is like Prerak wrote, this will give you the function as a publicly available method.
The other way is like my way. If you use it without the public but with a reference to ICollection, then it is implemented as a private method and is hidden from the outside world. This way you can implement a part of an interface without getting compiler errors.
I let ReSharper generate the method signatures for me, and it implemented them as I did in my question. My very attentive mind skipped the part of the signatures and left them as private implementations.
KenBonny
23-Aug-11 3:09am
View
Deleted
Reason for my vote of 3
Not bad for custom buttons, but there is a standard implementation for Accept and Cancel events on a Windows Form. See my alternative below.
KenBonny
23-Aug-11 2:59am
View
Deleted
Reason for my vote of 5
Thanks for the info. As a new programmer (school training about <1 year .NET dev, I know some stuff, but not much C ), I appreciate people writing articles about (basic) stuff like this. I learn a lot from it.
KenBonny
3-Aug-11 4:35am
View
Ok, thanks for the clarification.
KenBonny
3-Aug-11 2:08am
View
I'm confused by this reply. Why would I make a service that listens to something while I want an installer package that installs to network locations (like from my computer to my server)? Then I'll be writing installer software while me and my company doesn't do that.
KenBonny
14-Jun-11 2:04am
View
Deleted
I think this is an anonymous method, but I'm not entirely sure.
KenBonny
19-May-11 1:35am
View
I just started as a consultant, enough knowledge to understand that this boss knows what he's talking about. He knows a lot about VB.NET and his framework. Besides a few weird design choices, all the code is very well structured. He's just pro VB for some reason.
Show More