15,667,231 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 Python questions
View Javascript questions
View C++ questions
View Java 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 Henry.Ayoola (Top 23 by date)
Henry.Ayoola
8-Nov-11 5:25am
View
Deleted
Reason for my vote of 3
What does this add beyond a reference for alternatives 3 and 6?
Henry.Ayoola
3-Nov-11 10:15am
View
Deleted
Or you could turn validation off and do your own validation on the inputs.
Henry.Ayoola
28-Oct-11 5:11am
View
Deleted
Reason for my vote of 4
Definitely an improvement to tie into Linq. I'd have gone a bit further: rather than having methods with different names I'd have an overload with an extra argument (probably a flag enum).
Henry.Ayoola
13-Oct-11 6:14am
View
Deleted
It improves the uniformity of the probabilities.
Henry.Ayoola
13-Oct-11 6:12am
View
Deleted
Yes, but it would be algorithmically better. You're essentially doing the original O(n^2) Fisher-Yates, whereas you could easily be doing the modern O(n) version.
Henry.Ayoola
13-Oct-11 6:11am
View
Deleted
The OP's code is O(n^2) unless List has some really sophisticated RemoveAt logic.
Henry.Ayoola
11-Oct-11 6:05am
View
Deleted
They could add it as an extension to IEnumerable<t> without breaking List<t>. I just tested that it compiles, so unless there's a bug in the compiler the language spec allows disambiguation of the most specific method.
Henry.Ayoola
10-Oct-11 9:03am
View
Deleted
http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm
Henry.Ayoola
23-Sep-11 9:28am
View
Deleted
This really should have been an extension method for IEnumerable<T>. One of a few things which aren't in the right places in .Net's collection libraries.
Henry.Ayoola
19-Sep-11 6:55am
View
Deleted
If I call RandomNumber(1024), what's the probability that it returns 1? (Hint: what value must r[0] take for that to happen?)
Henry.Ayoola
13-Sep-11 9:03am
View
Deleted
Reason for my vote of 1
It restricts to 256 possible return values, which no reasonable person would anticipate. It should be able to give any return value from 0 to maxvalue-1 with equal probability.
Henry.Ayoola
7-Sep-11 8:43am
View
Deleted
In what way is this about multi-cast?
Henry.Ayoola
5-Sep-11 10:03am
View
Deleted
Never mind. I must have written that comment before drinking my coffee.
Henry.Ayoola
2-Sep-11 10:31am
View
Deleted
However, it doesn't give a uniform distribution.
Henry.Ayoola
2-Sep-11 10:31am
View
Deleted
Because it gives you a uniform distribution (which your method doesn't) and has better algorithmic complexity and minimal consumption of random bits.
Henry.Ayoola
1-Sep-11 3:46am
View
Deleted
Reason for my vote of 1
A better way of doing this has been known for a very long time: http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
Henry.Ayoola
12-Aug-11 3:30am
View
Short answer: because the inputs are different. numeric(18,2) isn't the same type as double.
Henry.Ayoola
9-Aug-11 6:16am
View
Deleted
The second one does have compile-time errors, but it's easier to fix them than to install IKVM. BouncyCastle distribute dlls, so you don't need to compile anything if you take that route.
Henry.Ayoola
9-Aug-11 6:14am
View
Deleted
Reason for my vote of 5
Spot on.
Henry.Ayoola
2-Aug-11 8:37am
View
What are you actually trying to do? Ensure that both "0.21" and "0,21" are parsed as 21/100 regardless of current culture?
Henry.Ayoola
24-Jun-11 3:34am
View
Deleted
You need to think about escaping as well as (pointed out already by @AspDotNetDev) not doing naïve string composition in a loop.
Henry.Ayoola
8-Mar-11 8:17am
View
Deleted
You seem to have modified my code without fully understanding it (although I admit that I messed up the bracketing). The point of the check (foo == 0xdf || ch > 0xff) was to avoid calling char.IsLetter on characters which were already known not to be letters. If you're going to pull that check out then you can ditch the inner check and just have a plain else clause.
Henry.Ayoola
25-Oct-10 9:58am
View
Deleted
StringBuilder isn't magic. If it has to expand its internal buffer then you still have garbage to collect. The real benefit of string.Format is the ability to use FormatInfo objects.
Show More