<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Calculating Overlapping Hours for Labor Transactions</title>
	<atom:link href="http://hoopercharles.wordpress.com/2011/02/15/calculating-overlapping-hours-for-labor-transactions/feed/" rel="self" type="application/rss+xml" />
	<link>http://hoopercharles.wordpress.com/2011/02/15/calculating-overlapping-hours-for-labor-transactions/</link>
	<description>Miscellaneous Random Oracle Topics: Stop, Think, ... Understand</description>
	<lastBuildDate>Mon, 13 May 2013 14:10:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2011/02/15/calculating-overlapping-hours-for-labor-transactions/#comment-5292</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Tue, 05 Mar 2013 11:51:11 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=4400#comment-5292</guid>
		<description><![CDATA[Garrett,

Thank you for the C# example code.  I need to spend some time re-reading this article, and then take a closer look at your C# code to understand how your example works (it is early, maybe I just need a couple more cups of coffee to completely follow the code).]]></description>
		<content:encoded><![CDATA[<p>Garrett,</p>
<p>Thank you for the C# example code.  I need to spend some time re-reading this article, and then take a closer look at your C# code to understand how your example works (it is early, maybe I just need a couple more cups of coffee to completely follow the code).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garrett</title>
		<link>http://hoopercharles.wordpress.com/2011/02/15/calculating-overlapping-hours-for-labor-transactions/#comment-5291</link>
		<dc:creator><![CDATA[Garrett]]></dc:creator>
		<pubDate>Tue, 05 Mar 2013 06:23:41 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=4400#comment-5291</guid>
		<description><![CDATA[Ha spend the week figuring this out then I find this... Take a look at it in C#:

&lt;pre&gt;
public List real_time_list = new List();
public List time_diff = new List();
public List flag_list = new List();
public List all_time = new List();
public List end_time = new List();
public List start_time = new List();
&lt;/pre&gt;
 
&lt;pre&gt;
private void logic_method(object sender, EventArgs e)
{
    int blah = 0;
    flag_list[0] = true;
    int temp = 0;
    int d = 0;
    int counter = 1;
 
    //if there is only one job
    if (all_time.Count == 2)
    {
        real_time_list[0] = Convert.ToDouble(all_time[1].Subtract(all_time[0]));
    }
    if (all_time.Count &gt; 2)
    {
        bool c_end = false;
        all_time.ForEach(delegate(DateTime current)
        {
            //sets the correct time for the second to last time
            if (current == all_time[all_time.Count - 2])
            {
                time_diff[time_diff.Count - 1] = Convert.ToDouble(all_time[all_time.Count - 1].Subtract(current).TotalMinutes);
            }
            if (d &lt; (all_time.Count-1))
            {
                i = 0;
                foreach (DataRow row in table.Rows)
                {
                    if (all_time[d + 1] == Convert.ToDateTime(row[&quot;Transaction_Start&quot;].ToString()))
                    {
                        temp = start_time.IndexOf(all_time[d + 1]);
                        time_diff[i] = (Convert.ToDouble(all_time[d + 1].Subtract(current).TotalMinutes) / counter);
                        counter++;
                        c_end = false;
                        //MessageBox.Show(Convert.ToString(&quot;Current  &quot; + current + &quot;\ntemp = &quot; + temp + &quot;\ntime diff = &quot; + time_diff[i]));              //debug
                        break;
                    }
                    if (all_time[d + 1] == Convert.ToDateTime(row[&quot;Transaction_End&quot;].ToString()))
                    {
                        temp = end_time.IndexOf(all_time[d + 1]);
                        time_diff[i] = (Convert.ToDouble(all_time[d + 1].Subtract(current).TotalMinutes) / counter);
                        counter--;
                        c_end = true;
                        //MessageBox.Show(Convert.ToString(&quot;Current  &quot; + current + &quot;\ntemp = &quot; + temp + &quot;\ntime diff = &quot; + time_diff[i]));              //debug
                        break;
                   }
                   i++;       
                }
                assign_time_method(time_diff[i]);
                flag_list[temp] = c_end == true ? false : true;
            }
            d++;
        });
    }
}
&lt;/pre&gt;
 
&lt;pre&gt;
private void assign_time_method(double timeD)
{
    ii = 0;
    foreach (bool cur in flag_list)
    {
        if(cur == true)
        {
            real_time_list[ii] = real_time_list[ii] + timeD;
            //MessageBox.Show(Convert.ToString(&quot;ii=&quot; + ii + &quot;\ntimediff=&quot; + timeD + &quot;\nrealtime=&quot; + real_time_list[ii] + &quot;\nflag list: &quot;+flag_list[1]));                //debug
        }
        ii++;
    }
}
&lt;/pre&gt;

This is assuming a table populated with the same data that the article above works with.]]></description>
		<content:encoded><![CDATA[<p>Ha spend the week figuring this out then I find this&#8230; Take a look at it in C#:</p>
<pre>
public List real_time_list = new List();
public List time_diff = new List();
public List flag_list = new List();
public List all_time = new List();
public List end_time = new List();
public List start_time = new List();
</pre>
<pre>
private void logic_method(object sender, EventArgs e)
{
    int blah = 0;
    flag_list[0] = true;
    int temp = 0;
    int d = 0;
    int counter = 1;
 
    //if there is only one job
    if (all_time.Count == 2)
    {
        real_time_list[0] = Convert.ToDouble(all_time[1].Subtract(all_time[0]));
    }
    if (all_time.Count &gt; 2)
    {
        bool c_end = false;
        all_time.ForEach(delegate(DateTime current)
        {
            //sets the correct time for the second to last time
            if (current == all_time[all_time.Count - 2])
            {
                time_diff[time_diff.Count - 1] = Convert.ToDouble(all_time[all_time.Count - 1].Subtract(current).TotalMinutes);
            }
            if (d &lt; (all_time.Count-1))
            {
                i = 0;
                foreach (DataRow row in table.Rows)
                {
                    if (all_time[d + 1] == Convert.ToDateTime(row[&quot;Transaction_Start&quot;].ToString()))
                    {
                        temp = start_time.IndexOf(all_time[d + 1]);
                        time_diff[i] = (Convert.ToDouble(all_time[d + 1].Subtract(current).TotalMinutes) / counter);
                        counter++;
                        c_end = false;
                        //MessageBox.Show(Convert.ToString(&quot;Current  &quot; + current + &quot;\ntemp = &quot; + temp + &quot;\ntime diff = &quot; + time_diff[i]));              //debug
                        break;
                    }
                    if (all_time[d + 1] == Convert.ToDateTime(row[&quot;Transaction_End&quot;].ToString()))
                    {
                        temp = end_time.IndexOf(all_time[d + 1]);
                        time_diff[i] = (Convert.ToDouble(all_time[d + 1].Subtract(current).TotalMinutes) / counter);
                        counter--;
                        c_end = true;
                        //MessageBox.Show(Convert.ToString(&quot;Current  &quot; + current + &quot;\ntemp = &quot; + temp + &quot;\ntime diff = &quot; + time_diff[i]));              //debug
                        break;
                   }
                   i++;       
                }
                assign_time_method(time_diff[i]);
                flag_list[temp] = c_end == true ? false : true;
            }
            d++;
        });
    }
}
</pre>
<pre>
private void assign_time_method(double timeD)
{
    ii = 0;
    foreach (bool cur in flag_list)
    {
        if(cur == true)
        {
            real_time_list[ii] = real_time_list[ii] + timeD;
            //MessageBox.Show(Convert.ToString(&quot;ii=&quot; + ii + &quot;\ntimediff=&quot; + timeD + &quot;\nrealtime=&quot; + real_time_list[ii] + &quot;\nflag list: &quot;+flag_list[1]));                //debug
        }
        ii++;
    }
}
</pre>
<p>This is assuming a table populated with the same data that the article above works with.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: State of Data Last Week &#8211; #36 &#171; Dr Data&#039;s Blog</title>
		<link>http://hoopercharles.wordpress.com/2011/02/15/calculating-overlapping-hours-for-labor-transactions/#comment-2870</link>
		<dc:creator><![CDATA[State of Data Last Week &#8211; #36 &#171; Dr Data&#039;s Blog]]></dc:creator>
		<pubDate>Sat, 19 Feb 2011 07:30:58 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=4400#comment-2870</guid>
		<description><![CDATA[[...] – Some old-school, reliable fun to calculate overlapping hours for Labor Transactions – from defining the problem, design tables to write elegant [...]]]></description>
		<content:encoded><![CDATA[<p>[...] – Some old-school, reliable fun to calculate overlapping hours for Labor Transactions – from defining the problem, design tables to write elegant [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
