Click here to Skip to main content
15,921,156 members
Home / Discussions / C#
   

C#

 
GeneralRe: Chat Application Pin
PIEBALDconsult9-Sep-14 15:58
mvePIEBALDconsult9-Sep-14 15:58 
AnswerRe: Chat Application Pin
raju melveetilpurayil9-Sep-14 12:46
professionalraju melveetilpurayil9-Sep-14 12:46 
GeneralRe: Chat Application Pin
Kevin Marois9-Sep-14 12:47
professionalKevin Marois9-Sep-14 12:47 
QuestionRe: Chat Application Pin
raju melveetilpurayil9-Sep-14 12:55
professionalraju melveetilpurayil9-Sep-14 12:55 
AnswerRe: Chat Application Pin
Kevin Marois9-Sep-14 12:56
professionalKevin Marois9-Sep-14 12:56 
GeneralRe: Chat Application Pin
raju melveetilpurayil9-Sep-14 13:02
professionalraju melveetilpurayil9-Sep-14 13:02 
QuestionThumbnailPhoto + DataTable + GridView Pin
Member 110296479-Sep-14 2:05
Member 110296479-Sep-14 2:05 
QuestionRe: ThumbnailPhoto + DataTable + GridView Pin
ZurdoDev9-Sep-14 2:22
professionalZurdoDev9-Sep-14 2:22 
AnswerRe: ThumbnailPhoto + DataTable + GridView Pin
Member 110296479-Sep-14 2:30
Member 110296479-Sep-14 2:30 
QuestionSend http request with Windows Mobile through VPN installed on PC Pin
Wakonda8-Sep-14 2:58
Wakonda8-Sep-14 2:58 
AnswerRe: Send http request with Windows Mobile through VPN installed on PC Pin
Eddy Vluggen8-Sep-14 8:08
professionalEddy Vluggen8-Sep-14 8:08 
AnswerRe: Send http request with Windows Mobile through VPN installed on PC Pin
Zain Ul Abidin8-Sep-14 21:05
Zain Ul Abidin8-Sep-14 21:05 
AnswerRe: Send http request with Windows Mobile through VPN installed on PC Pin
Bernhard Hiller8-Sep-14 21:34
Bernhard Hiller8-Sep-14 21:34 
QuestionSorting a generic list ? Pin
Member 105035147-Sep-14 23:51
Member 105035147-Sep-14 23:51 
SuggestionMessage Closed Pin
8-Sep-14 20:19
professionalGeorge Jonsson8-Sep-14 20:19 
GeneralRe: Sorting a generic list ? Pin
Richard MacCutchan8-Sep-14 20:36
mveRichard MacCutchan8-Sep-14 20:36 
GeneralRe: Sorting a generic list ? Pin
George Jonsson8-Sep-14 21:01
professionalGeorge Jonsson8-Sep-14 21:01 
GeneralRe: Sorting a generic list ? Pin
Richard MacCutchan8-Sep-14 21:22
mveRichard MacCutchan8-Sep-14 21:22 
SuggestionRe: Sorting a generic list ? Pin
Richard MacCutchan8-Sep-14 20:42
mveRichard MacCutchan8-Sep-14 20:42 
QuestionStumped - How do I code this loop... Pin
Andy_L_J6-Sep-14 18:00
Andy_L_J6-Sep-14 18:00 
AnswerRe: Stumped - How do I code this loop... Pin
Garth J Lancaster6-Sep-14 19:08
professionalGarth J Lancaster6-Sep-14 19:08 
AnswerRe: Stumped - How do I code this loop... Pin
CPallini6-Sep-14 19:25
mveCPallini6-Sep-14 19:25 
GeneralRe: Stumped - How do I code this loop... Pin
Andy_L_J6-Sep-14 20:04
Andy_L_J6-Sep-14 20:04 
GeneralRe: Stumped - How do I code this loop... Pin
CPallini6-Sep-14 20:22
mveCPallini6-Sep-14 20:22 
AnswerRe: Stumped - How do I code this loop... Pin
Andy_L_J13-Sep-14 11:02
Andy_L_J13-Sep-14 11:02 
Here what I ended up using:
public List<int> GetPositions(int n, int posCount)
{
  int pos1 = n % posCount;
  int pos2 = pos1 == 0 ? posCount - 1 : pos1 - 1;
  return new List<int>{pos1, pos2}; 
}
...
int n = 0;
List<int> positions = new List<int>{0,1,2,3,4};
while( n < 10)
{
  List<int> res = GetPositions(n, positions.Count)
  Console.WriteLine("Count{0}: Pos1 {1} - Pos2 {2}", n, res[0], res[1]);
  n++;
}


Thanks to you and G for your help clearing the fog!
I don't speak Idiot - please talk slowly and clearly

"I have sexdaily. I mean dyslexia. Fcuk!"

Driven to the arms of Heineken by the wife

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.