Click here to Skip to main content
15,900,461 members
Home / Discussions / C#
   

C#

 
GeneralRe: Need help with Expression Trees... Pin
SledgeHammer014-Sep-14 10:19
SledgeHammer014-Sep-14 10:19 
AnswerRe: Need help with Expression Trees... Pin
Eddy Vluggen4-Sep-14 5:14
professionalEddy Vluggen4-Sep-14 5:14 
GeneralRe: Need help with Expression Trees... Pin
SledgeHammer014-Sep-14 7:29
SledgeHammer014-Sep-14 7:29 
QuestionFramework Update On a Soution Pin
wonder-FOOL3-Sep-14 10:21
wonder-FOOL3-Sep-14 10:21 
AnswerRe: Framework Update On a Soution Pin
Kornfeld Eliyahu Peter3-Sep-14 10:56
professionalKornfeld Eliyahu Peter3-Sep-14 10:56 
Questionwcf object serialization without datacontract/datamemember attributes strange behavior Pin
impeham3-Sep-14 2:35
impeham3-Sep-14 2:35 
AnswerRe: wcf object serialization without datacontract/datamemember attributes strange behavior Pin
Gerry Schmitz3-Sep-14 10:24
mveGerry Schmitz3-Sep-14 10:24 
Questionviewing photo from MySQL Pin
Jassim Rahma3-Sep-14 0:58
Jassim Rahma3-Sep-14 0:58 
QuestionRe: viewing photo from MySQL Pin
Richard MacCutchan3-Sep-14 1:30
mveRichard MacCutchan3-Sep-14 1:30 
AnswerRe: viewing photo from MySQL Pin
Jassim Rahma3-Sep-14 1:41
Jassim Rahma3-Sep-14 1:41 
GeneralRe: viewing photo from MySQL Pin
Richard Deeming3-Sep-14 1:42
mveRichard Deeming3-Sep-14 1:42 
GeneralRe: viewing photo from MySQL Pin
Jassim Rahma3-Sep-14 1:46
Jassim Rahma3-Sep-14 1:46 
GeneralRe: viewing photo from MySQL Pin
Jassim Rahma3-Sep-14 1:48
Jassim Rahma3-Sep-14 1:48 
GeneralRe: viewing photo from MySQL Pin
Richard Deeming3-Sep-14 1:54
mveRichard Deeming3-Sep-14 1:54 
GeneralRe: viewing photo from MySQL Pin
Jassim Rahma3-Sep-14 2:26
Jassim Rahma3-Sep-14 2:26 
GeneralRe: viewing photo from MySQL Pin
Jassim Rahma3-Sep-14 2:36
Jassim Rahma3-Sep-14 2:36 
GeneralRe: viewing photo from MySQL Pin
Richard Deeming3-Sep-14 2:43
mveRichard Deeming3-Sep-14 2:43 
GeneralRe: viewing photo from MySQL Pin
Dave Kreskowiak3-Sep-14 3:45
mveDave Kreskowiak3-Sep-14 3:45 
GeneralRe: viewing photo from MySQL Pin
Richard Deeming3-Sep-14 3:52
mveRichard Deeming3-Sep-14 3:52 
GeneralRe: viewing photo from MySQL Pin
Jassim Rahma3-Sep-14 4:12
Jassim Rahma3-Sep-14 4:12 
Questioncalculating total time betweem time ranges Pin
devil54e3-Sep-14 0:28
devil54e3-Sep-14 0:28 
AnswerRe: calculating total time betweem time ranges Pin
Richard MacCutchan3-Sep-14 0:55
mveRichard MacCutchan3-Sep-14 0:55 
GeneralRe: calculating total time betweem time ranges Pin
devil54e3-Sep-14 1:12
devil54e3-Sep-14 1:12 
GeneralRe: calculating total time betweem time ranges Pin
Richard MacCutchan3-Sep-14 1:28
mveRichard MacCutchan3-Sep-14 1:28 
It is just a matter of reading all the values one by one.

  • Read the first time value, that is the starting time of work.
  • Read the next time, that is the ending time of work.
  • The difference between those two is added to the total work time.
  • Set the end time as the new start time, that is the starting time of idle.
  • Read the next time, that is the ending time of idle (and the next starting time of work).
  • The difference between start and end should be added to idle time.
  • Set the end time as the new start time (of work).
  • Repeat the process until all times have been dealt with.


In cases such as this you should forget about programming and coding issues, and think about the logical steps needed to get your answer. Write down those steps and go through them a few times to ensure they make sense. Then when you are happy that your algorithm is correct you can write and test the actual code needed for your application.
GeneralRe: calculating total time betweem time ranges Pin
devil54e3-Sep-14 2:13
devil54e3-Sep-14 2:13 

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.