Click here to Skip to main content
15,891,423 members
Home / Discussions / C#
   

C#

 
GeneralRe: HTTPListener with AuthenticationSchemes.IntegratedWindowsAuthentication Pin
Richard MacCutchan13-Apr-16 20:44
mveRichard MacCutchan13-Apr-16 20:44 
Questioncsharp creating algorithm Pin
Member 1245597512-Apr-16 21:24
Member 1245597512-Apr-16 21:24 
AnswerRe: csharp creating algorithm Pin
Peter_in_278012-Apr-16 22:13
professionalPeter_in_278012-Apr-16 22:13 
AnswerRe: csharp creating algorithm Pin
OriginalGriff12-Apr-16 22:19
mveOriginalGriff12-Apr-16 22:19 
AnswerRe: csharp creating algorithm PinPopular
BillWoodruff12-Apr-16 23:47
professionalBillWoodruff12-Apr-16 23:47 
GeneralRe: csharp creating algorithm Pin
OriginalGriff13-Apr-16 0:10
mveOriginalGriff13-Apr-16 0:10 
GeneralRe: csharp creating algorithm Pin
Richard MacCutchan13-Apr-16 0:44
mveRichard MacCutchan13-Apr-16 0:44 
GeneralRe: csharp creating algorithm Pin
BillWoodruff13-Apr-16 3:02
professionalBillWoodruff13-Apr-16 3:02 
Yes, I think that does look better, and read better. I remember (dimly) once using a 'const named 'DigitBase for this.

But, if I were doing code requiring decomposing ints to lists of digits, I'd be using something like this ... from code written several years ago:
C#
public const long TenBase = 10L;

// 12345678 => {8,7,6,5,4,3,2,1}
// note that IEnumerable Type must match parameter Type
// but you can pass Integers of any integer Type as the parameter value
// without error
public IEnumerable<long> IntToDigitList(long longint)
{
    while (longint > 0)
    {
        yield return (longint % TenBase);
        longint /= TenBase;
    }
}
To avoid mucking about with strings/chars. Code I probably got the idea from, if not the basis for this code, from StackOverFlow Smile | :)
«The truth is a snare: you cannot have it, without being caught. You cannot have the truth in such a way that you catch it, but only in such a way that it catches you.» Soren Kierkegaard

GeneralRe: csharp creating algorithm Pin
Sascha Lefèvre13-Apr-16 3:51
professionalSascha Lefèvre13-Apr-16 3:51 
GeneralRe: csharp creating algorithm Pin
BillWoodruff13-Apr-16 5:02
professionalBillWoodruff13-Apr-16 5:02 
AnswerRe: csharp creating algorithm Pin
Patrice T13-Apr-16 9:14
mvePatrice T13-Apr-16 9:14 
Questionpuzzle, sub string not working Pin
Member 1016760412-Apr-16 21:20
Member 1016760412-Apr-16 21:20 
AnswerRe: puzzle, sub string not working Pin
Richard MacCutchan12-Apr-16 21:25
mveRichard MacCutchan12-Apr-16 21:25 
QuestionCould not load file or assembly Pin
RAFish040412-Apr-16 8:26
RAFish040412-Apr-16 8:26 
AnswerRe: Could not load file or assembly Pin
Richard MacCutchan12-Apr-16 10:01
mveRichard MacCutchan12-Apr-16 10:01 
QuestionHow add a custom menu to Windows Explorer's tool bar Pin
srikrishnathanthri11-Apr-16 21:50
srikrishnathanthri11-Apr-16 21:50 
AnswerRe: How add a custom menu to Windows Explorer's tool bar Pin
Pete O'Hanlon11-Apr-16 22:22
mvePete O'Hanlon11-Apr-16 22:22 
GeneralRe: How add a custom menu to Windows Explorer's tool bar Pin
srikrishnathanthri12-Apr-16 3:51
srikrishnathanthri12-Apr-16 3:51 
QuestionRe: How add a custom menu to Windows Explorer's tool bar Pin
CHill6012-Apr-16 5:52
mveCHill6012-Apr-16 5:52 
GeneralRe: How add a custom menu to Windows Explorer's tool bar Pin
Eddy Vluggen12-Apr-16 5:59
professionalEddy Vluggen12-Apr-16 5:59 
GeneralRe: How add a custom menu to Windows Explorer's tool bar Pin
srikrishnathanthri12-Apr-16 23:40
srikrishnathanthri12-Apr-16 23:40 
GeneralRe: How add a custom menu to Windows Explorer's tool bar Pin
Eddy Vluggen13-Apr-16 0:05
professionalEddy Vluggen13-Apr-16 0:05 
GeneralRe: How add a custom menu to Windows Explorer's tool bar Pin
srikrishnathanthri13-Apr-16 1:14
srikrishnathanthri13-Apr-16 1:14 
QuestionRar and c# Pin
Sakeb11-Apr-16 20:24
Sakeb11-Apr-16 20:24 
SuggestionRe: Rar and c# Pin
Richard MacCutchan11-Apr-16 21:30
mveRichard MacCutchan11-Apr-16 21:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.