<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SergeyS's blog</title><link>http://weblogs.asp.net/sergeys/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>New freestyle swimming technique.</title><link>http://weblogs.asp.net/sergeys/archive/2009/09/10/new-freestyle-swimming-technique.aspx</link><pubDate>Thu, 10 Sep 2009 14:49:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7199378</guid><dc:creator>SergeyS</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/sergeys/rsscomments.aspx?PostID=7199378</wfw:commentRss><comments>http://weblogs.asp.net/sergeys/archive/2009/09/10/new-freestyle-swimming-technique.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;Interesting, what phase of arm motion contributes the most to a swimmer speed?&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A href="http://weblogs.asp.net/blogs/sergeys/1.jpg" mce_href="http://weblogs.asp.net/blogs/sergeys/1.jpg"&gt;&lt;IMG border=0 src="http://weblogs.asp.net/blogs/sergeys/1.jpg" width=100 height=170 mce_src="http://weblogs.asp.net/blogs/sergeys/1.jpg"&gt;&lt;/A&gt;&lt;A href="http://weblogs.asp.net/blogs/sergeys/2.jpg" mce_href="http://weblogs.asp.net/blogs/sergeys/2.jpg"&gt;&lt;IMG border=0 src="http://weblogs.asp.net/blogs/sergeys/2.jpg" width=100 height=170 mce_src="http://weblogs.asp.net/blogs/sergeys/2.jpg"&gt;&lt;/A&gt;&lt;A href="http://weblogs.asp.net/blogs/sergeys/3.jpg" mce_href="http://weblogs.asp.net/blogs/sergeys/3.jpg"&gt;&lt;IMG border=0 src="http://weblogs.asp.net/blogs/sergeys/3.jpg" width=100 height=170 mce_src="http://weblogs.asp.net/blogs/sergeys/3.jpg"&gt;&lt;/A&gt;&lt;A href="http://weblogs.asp.net/blogs/sergeys/4.jpg"&gt;&lt;IMG border=0 src="http://weblogs.asp.net/blogs/sergeys/4.jpg" width=100 height=170&gt;&lt;/A&gt;&lt;A href="http://weblogs.asp.net/blogs/sergeys/5.jpg"&gt;&lt;IMG border=0 src="http://weblogs.asp.net/blogs/sergeys/5.jpg" width=100 height=170&gt;&lt;/A&gt;&lt;A href="http://weblogs.asp.net/blogs/sergeys/6.jpg"&gt;&lt;IMG border=0 src="http://weblogs.asp.net/blogs/sergeys/6.jpg" width=100 height=170&gt;&lt;/A&gt;&lt;A href="http://weblogs.asp.net/blogs/sergeys/7.jpg"&gt;&lt;IMG border=0 src="http://weblogs.asp.net/blogs/sergeys/7.jpg" width=100 height=170&gt;&lt;/A&gt;&lt;A href="http://weblogs.asp.net/blogs/sergeys/8.jpg"&gt;&lt;IMG border=0 src="http://weblogs.asp.net/blogs/sergeys/8.jpg" width=100 height=170&gt;&lt;/A&gt;&lt;A href="http://weblogs.asp.net/blogs/sergeys/9.jpg"&gt;&lt;IMG border=0 src="http://weblogs.asp.net/blogs/sergeys/9.jpg" width=100 height=170&gt;&lt;/A&gt;&lt;A href="http://weblogs.asp.net/blogs/sergeys/10.jpg"&gt;&lt;IMG border=0 src="http://weblogs.asp.net/blogs/sergeys/10.jpg" width=100 height=170&gt;&lt;/A&gt;&lt;A href="http://weblogs.asp.net/blogs/sergeys/11.jpg"&gt;&lt;IMG border=0 src="http://weblogs.asp.net/blogs/sergeys/11.jpg" width=100 height=170&gt;&lt;/A&gt;&lt;A href="http://weblogs.asp.net/blogs/sergeys/12.jpg"&gt;&lt;IMG border=0 src="http://weblogs.asp.net/blogs/sergeys/12.jpg" width=100 height=170&gt;&lt;/A&gt;&lt;A href="http://weblogs.asp.net/blogs/sergeys/13.jpg"&gt;&lt;IMG border=0 src="http://weblogs.asp.net/blogs/sergeys/13.jpg" width=100 height=170&gt;&lt;/A&gt;&lt;A href="http://weblogs.asp.net/blogs/sergeys/14.jpg"&gt;&lt;IMG border=0 src="http://weblogs.asp.net/blogs/sergeys/14.jpg" width=100 height=170&gt;&lt;/A&gt;&lt;A href="http://weblogs.asp.net/blogs/sergeys/15.jpg"&gt;&lt;IMG border=0 src="http://weblogs.asp.net/blogs/sergeys/15.jpg" width=100 height=170&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Many would say, from 10 to 15 on the above pictures if we are talking about right swimmer’s arm (on the left on the pictures). But I think in general the correct answer would be, it depends on a swimmer’s speed. And in our particular case, since the speed is high (see the wave ahead the swimmer), the most to contribute to speed is the phase from 1 to 10.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;Yes the phase when the straight arm is just getting from surface to about 45 degrees slope. The rest of the arm motion from 11 to 15, as for me, is just a waste of time at the high speed swimming. That horizontal push spiral movement of arm has no much effect at the high speed. The amount of water it pushes back is very limited, and a swimmer needs to waste a lot of energy to move the arm very fast relative to his body.&lt;/P&gt;
&lt;P mce_keep="true"&gt;The reason why “1 to 10” phase is effective at high speed is that the arm is moving forward and when it presses down, it affects a lot of water staying still under the arm, the greater speed – the more water is affected. A swimmer is almost literarily sliding down the slope of the water, - a minimal relative motion and great effect. &lt;/P&gt;
&lt;P mce_keep="true"&gt;And now here is the question:&amp;nbsp; Is there a way to arrange a technique to let a swimmer not to push-back the water energetically ineffectively, but rather to rebound from the swift and firm streams of water?&lt;/P&gt;
&lt;P mce_keep="true"&gt;I think we could invent it right now. Let’s see:&lt;/P&gt;
&lt;P mce_keep="true"&gt;- An arm should affect as much water as possible. Thus it should not be just straight arm movement down.&lt;/P&gt;
&lt;P mce_keep="true"&gt;- A human possesses 2 arms, and water is not just beneath a swimmer, it’s also on the left and on the right. Thus the left arm should rebound from the bottom-left water and the right arm from the bottom-right water, - did you hear of skate-skiing, this should be somewhat similar, arms should not propagate much back relative to the swimmer’s body, they should perform sort of circular motion, the active phase being almost the whole circle.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;- Once the arm's trajectory found, a swimmer could master the downward force to be as big as his half-weight. It could be doable, as, though, the force is big, the arm’s motion relative to the body is not big. Thus the swimmer should be able to keep his body above the water surface (other half of his weight would be lifted up by legs).&lt;/P&gt;
&lt;P mce_keep="true"&gt;- Legs, they are not much different than arms. On a swimmer entering full-speed mode they should make motions almost above the surface horizontally. They should act on a stream of water like skates on ice.&lt;/P&gt;
&lt;P mce_keep="true"&gt;- Thus a swimmer should work in 4 phases: arm, leg, arm, leg. The phases should overlap; there should not be dead moments to let a swimmer sink below the surface. &lt;/P&gt;
&lt;P mce_keep="true"&gt;- As the body is above the surface, the water resistance is much less compared to the classic freestyle water resistance.&lt;/P&gt;
&lt;P mce_keep="true"&gt;- The border effect of water surface dictates that a swimmer should be lightweight, current heavy-weights probably won’t be able to master the technique. Entirely different set of muscles is envolved compared to classic swimmers, that's another reason why new swimmers woull emerge.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Detailed descriptions of the particular motions are beyond the scope of this posting. Well, the descriptions have not been expressed in written form yet, but I do have some virtual model in my mind. It would take me 6 weeks of hard training to show the idea live (hey, just to show the idea, not to beat Phelps :-) Perhaps in the future I'll find the time to start it.&lt;/P&gt;
&lt;P mce_keep="true"&gt;About me: I am not a swimmer at all, I am not even a sportsman at all, and I even did not touch water suitable for swimming for many years. Some bathing in Black and Mediterranean seas – that’s all my swim-related experience, keep that in mind, please. &lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7199378" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/sergeys/archive/tags/Off-Topic/default.aspx">Off-Topic</category></item><item><title>PC Hardware Architecture Perspective.</title><link>http://weblogs.asp.net/sergeys/archive/2009/09/02/pc-hardware-perspective.aspx</link><pubDate>Wed, 02 Sep 2009 11:49:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7189102</guid><dc:creator>SergeyS</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/sergeys/rsscomments.aspx?PostID=7189102</wfw:commentRss><comments>http://weblogs.asp.net/sergeys/archive/2009/09/02/pc-hardware-perspective.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;It looks like the current concept of PC Motherboard should start getting re-thought.&lt;/P&gt;
&lt;P mce_keep="true"&gt;These 3 items:&amp;nbsp;CPU, RAM, Videocard are logically pretty much decoupled from the rest of the PC System Unit.&amp;nbsp;And when&amp;nbsp;the RAM&amp;nbsp;will be&amp;nbsp;getting nonvolatile,&amp;nbsp;- I don't see why this "brain" should not get physically decoupled from the&amp;nbsp;rest of hardware&amp;nbsp;on the Mother Board. I'd call the&amp;nbsp;rest of hardware - the&amp;nbsp;"spinal column".&lt;/P&gt;
&lt;P mce_keep="true"&gt;That logical "spinal column" would actually be a small PCB, say of nano ITX format with&amp;nbsp;the single&amp;nbsp;(or so) chip&amp;nbsp;to control all the peripherals and provide very basic video and very basic CPU power. So, that without the "brain" it would be equal to "Celeron"-based PC just to be able of doing some office work or so.&lt;/P&gt;
&lt;P mce_keep="true"&gt;This block should feature some fast backbone to get connected to "brain". The "brain"&amp;nbsp;- a set of one&amp;nbsp;or more PCBs to hold powerful integrated circuits - FPGA or CPLD with their RAM.&amp;nbsp;These "brain"&amp;nbsp;blocks should be universal in the future&amp;nbsp;and may or may not contain video connector. The running application would reconfigure FPGA/CPLD "on the fly" to address its current needs - max performance or whatever like it was described in my previous post "Blank-Powerful-Client Architecture" &lt;A title=http://weblogs.asp.net/sergeys/archive/2009/08/25/blank-powerful-client-architecture.aspx href="http://weblogs.asp.net/sergeys/archive/2009/08/25/blank-powerful-client-architecture.aspx" mce_href="http://weblogs.asp.net/sergeys/archive/2009/08/25/blank-powerful-client-architecture.aspx"&gt;http://weblogs.asp.net/sergeys/archive/2009/08/25/blank-powerful-client-architecture.aspx&lt;/A&gt;.&lt;/P&gt;
&lt;P mce_keep="true"&gt;What I'd like to (humbly:-)&amp;nbsp;expect from Microsoft in the reasonable future is to cooperate with some FPGA/CPLD provider to produce a Dev Kit with FPGA/CPLD on-board. And MS .NET platform would contain libraries to create the configuration for FPGA/CPLD, load it, run it, and communicate to running FPGA/CPLD.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7189102" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/sergeys/archive/tags/General+Software+Development/default.aspx">General Software Development</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Blank-Powerful-Client Architecture </title><link>http://weblogs.asp.net/sergeys/archive/2009/08/25/blank-powerful-client-architecture.aspx</link><pubDate>Tue, 25 Aug 2009 17:28:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7181159</guid><dc:creator>SergeyS</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/sergeys/rsscomments.aspx?PostID=7181159</wfw:commentRss><comments>http://weblogs.asp.net/sergeys/archive/2009/08/25/blank-powerful-client-architecture.aspx#comments</comments><description>&lt;P&gt;I'd rather to publish it on some Microsoft site, like this one.&lt;/P&gt;
&lt;P&gt;Imagine&amp;nbsp;a client is&amp;nbsp;based&amp;nbsp;not on&amp;nbsp;a CPU like Intel Core, and not even on a GPU like the one built in a video card by NVIDIA or AMD/ATI. Imagine a client's main brain were some CPLD or FPGA, that could be configured dynamically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;In other words it would be&amp;nbsp;sort of GPU, that is devided not into 250 "hard-wired" processor units, but rather into 100 000 elementary parts of that 250 units. And you can download the cofiguration into the CPLD/FPGA to force it to be 250 graphic processors, or&amp;nbsp; force it to be&amp;nbsp;1000 of just 16 bit general purpose processors, or whatever configuration the current running task is demanding.&lt;/P&gt;
&lt;P&gt;Such CPLD/FPGA&amp;nbsp; hardware is universal, so they could be mass produces (much more than GPUs) and thus be cheap. And also, since the CPLD/FPGA&amp;nbsp; technology evolves, the number of elements will be getting virtually unlimited. So, why should we "hardwire" CPU architecture? Just download the architecture "On-Demand" to target the current task.&lt;/P&gt;
&lt;P&gt;The concept resembles somewhat Visual WebGui "Empty Client Architecture". The client also can be very lite on software initially. The point is that the client is very poweful in terms of hardware&amp;nbsp;and&amp;nbsp;the hardware is very cheap and universal. Microsoft, in my opinion, should rethink the&amp;nbsp;concept of Operating System&amp;nbsp;to address the hardware revolution.&lt;/P&gt;
&lt;P&gt;The lowest level of Op System in the future would be not operating a "hard-wired" CPU, but rather to&amp;nbsp;gather the Processor Matrix from a huge set of available elementary blocks and then to&amp;nbsp;build from some repository the most&amp;nbsp;appropriate higher level Software System. The repository could be local, of course, and the client could be autonomous, but, in the future, the communication&amp;nbsp;to some&amp;nbsp;"Cofiguration Knowledge Center" would become more and more vital. And, some day, we may expect Android to become David to&amp;nbsp;win The Goliath. But that's a different story.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7181159" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/sergeys/archive/tags/General+Software+Development/default.aspx">General Software Development</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/Software+Architecture/default.aspx">Software Architecture</category></item><item><title>Windows Mobile 6.1 Browser - ASP.NET Script Callbacks.</title><link>http://weblogs.asp.net/sergeys/archive/2008/12/02/windows-mobile-6-1-browser-asp-net-script-callbacks.aspx</link><pubDate>Tue, 02 Dec 2008 19:55:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6763109</guid><dc:creator>SergeyS</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/sergeys/rsscomments.aspx?PostID=6763109</wfw:commentRss><comments>http://weblogs.asp.net/sergeys/archive/2008/12/02/windows-mobile-6-1-browser-asp-net-script-callbacks.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;Just checked out my HTC Diamond to communicate to an ASP.NET app using ASP.NET Script Callbacks (that is without postbacks).&amp;nbsp;The Diamond does do ASP.NET Script Callbacks under Opera&amp;nbsp;web-browser and, most probably, will do it under future IE mobile.&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;It would be nice if&amp;nbsp;ZigBee host (or any other&amp;nbsp;low power low speed&amp;nbsp;wireless host)&amp;nbsp;were added to&amp;nbsp;a mobile,&amp;nbsp;and&amp;nbsp;were&amp;nbsp;found&amp;nbsp;the way to make&amp;nbsp;the wireless host be&amp;nbsp;accessible for a web page's Javascript (mission almost&amp;nbsp;impossible, I know).&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6763109" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/sergeys/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/Mobile/default.aspx">Mobile</category></item><item><title>To T-SQL? That's not the question!</title><link>http://weblogs.asp.net/sergeys/archive/2008/08/04/to-t-sql-that-s-not-the-question.aspx</link><pubDate>Mon, 04 Aug 2008 16:02:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6481747</guid><dc:creator>SergeyS</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/sergeys/rsscomments.aspx?PostID=6481747</wfw:commentRss><comments>http://weblogs.asp.net/sergeys/archive/2008/08/04/to-t-sql-that-s-not-the-question.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;That ASP.NET Forums&amp;nbsp;/ SQL Server, SQL Server Express / is getting rather interesting sometimes. Last time it was the puzzle "Not so obvious SELECT"&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A href="http://forums.asp.net/p/1299660/2535207.aspx#2535207" mce_href="http://forums.asp.net/p/1299660/2535207.aspx#2535207"&gt;http://forums.asp.net/p/1299660/2535207.aspx#2535207&lt;/A&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&lt;EM&gt;Lets say that I've got two tables:&lt;BR&gt;&lt;BR&gt;ROOM:&lt;BR&gt;ID_ROOM : int&lt;BR&gt;Name: Nvarchar(50)&lt;BR&gt;&lt;BR&gt;RESERVATION&lt;BR&gt;ID_RESERVATION : int // unique ID of reservation&lt;BR&gt;ID_ROOM : int // which room is reserved&lt;BR&gt;DATE: SmallDateTime // date of reservation&lt;BR&gt;HOUR_BEGINNING : int // hour in which reservation begin&lt;BR&gt;HOUR_END : int // hour in which reservation end&lt;BR&gt;&lt;BR&gt;And now I want to find ALL rooms which can be reserved for at least DURATION(int) hours between HOUR_SEEK_START(int) and HOUR_SEEK_END(int) in day DAY(SmallDateTime). For example: I want to find all rooms which can be reserved for at least 2 hours between 10 and 16 on 16.05.2008. I hope I set the record straight. &lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;My reply was:&lt;/P&gt;
&lt;P mce_keep="true"&gt;---&lt;/P&gt;
&lt;P&gt;First, let's cast the phrase&amp;nbsp;"&lt;EM&gt;for at least DURATION(int) hours between HOUR_SEEK_START(int) and HOUR_SEEK_END(int)&lt;/EM&gt;" into something set oriented. Why not create a temp table to keep potentially good time intervals, those&amp;nbsp;of &lt;EM&gt;DURATION(int)&amp;nbsp;&lt;/EM&gt;length that could fit between HOUR_SEEK_START(int) and HOUR_SEEK_END(int). Later for each room we'll just check out if among these intervals there will be one not spoiled by related&amp;nbsp;reservation records.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;PRE class=coloredcode&gt;  &lt;FONT face="courier new,courier"&gt;&lt;SPAN class=sqlkwd&gt;CREATE TABLE&lt;/SPAN&gt; #Hours(
    IndexId &lt;SPAN class=sqlkwd&gt;int IDENTITY&lt;/SPAN&gt; (0, 1) &lt;SPAN class=sqlkwd3&gt;NOT NULL&lt;/SPAN&gt;, 
    hr &lt;SPAN class=sqlkwd&gt;nchar&lt;/SPAN&gt;(8))
    
  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'0'&lt;/SPAN&gt;);  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'1'&lt;/SPAN&gt;);
  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'2'&lt;/SPAN&gt;);  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'3'&lt;/SPAN&gt;);
  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'4'&lt;/SPAN&gt;);  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'5'&lt;/SPAN&gt;);
  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'6'&lt;/SPAN&gt;);  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'7'&lt;/SPAN&gt;);
  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'8'&lt;/SPAN&gt;);  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'9'&lt;/SPAN&gt;);
  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'10'&lt;/SPAN&gt;);  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'11'&lt;/SPAN&gt;);
  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'12'&lt;/SPAN&gt;);  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'13'&lt;/SPAN&gt;);
  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'14'&lt;/SPAN&gt;);  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'15'&lt;/SPAN&gt;);
  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'16'&lt;/SPAN&gt;);  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'17'&lt;/SPAN&gt;);
  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'18'&lt;/SPAN&gt;);  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'19'&lt;/SPAN&gt;);
  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'20'&lt;/SPAN&gt;);  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'21'&lt;/SPAN&gt;);
  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'22'&lt;/SPAN&gt;);  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #Hours(hr) &lt;SPAN class=sqlkwd&gt;VALUES&lt;/SPAN&gt; (&lt;SPAN class=st&gt;'23'&lt;/SPAN&gt;);
  
  &lt;SPAN class=sqlkwd&gt;CREATE TABLE&lt;/SPAN&gt; #TimeSpansRequested(hr1 &lt;SPAN class=sqlkwd&gt;int&lt;/SPAN&gt;, hr2 &lt;SPAN class=sqlkwd&gt;int&lt;/SPAN&gt;)
  
  &lt;SPAN class=sqlkwd&gt;INSERT INTO&lt;/SPAN&gt; #TimeSpansRequested(hr1, hr2) 
  &lt;SPAN class=sqlkwd&gt;SELECT&lt;/SPAN&gt; h1.IndexId, h2.IndexId  
  &lt;SPAN class=sqlkwd&gt;FROM&lt;/SPAN&gt; #Hours h1, #Hours h2
  &lt;SPAN class=sqlkwd&gt;WHERE&lt;/SPAN&gt; (h2.IndexId - h1.IndexId = @DURATION) 
        &lt;SPAN class=sqlkwd3&gt;AND&lt;/SPAN&gt; (h1.IndexId &lt;SPAN class=sqlkwd3&gt;BETWEEN&lt;/SPAN&gt; @HOUR_SEEK_START &lt;SPAN class=sqlkwd3&gt;AND&lt;/SPAN&gt; (@HOUR_SEEK_END - @DURATION))&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above T-SQL code is self explaining. We self joined #Hours temp table to get a set of time intervals, and then restricted the intervals to those of @DURATION length that are between @HOUR_SEEK_START&amp;nbsp;&lt;SPAN class=sqlkwd3&gt;and&lt;/SPAN&gt; @HOUR_SEEK_END hours. The result is getting into #TimeSpansRequested temp table. Its records are just pairs of (hr1, hr2) hours - borders of pottentially good intervals. And finally:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;PRE class=coloredcode&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class=sqlkwd&gt;&lt;FONT face=Arial&gt; &lt;/FONT&gt;SELECT&lt;/SPAN&gt; * 
 &lt;SPAN class=sqlkwd&gt;FROM&lt;/SPAN&gt; ROOM           
 &lt;SPAN class=sqlkwd&gt;WHERE&lt;/SPAN&gt; &lt;SPAN class=sqlkwd3&gt;EXISTS&lt;/SPAN&gt;(&lt;SPAN class=sqlkwd&gt;SELECT&lt;/SPAN&gt; hr1
              &lt;SPAN class=sqlkwd&gt;FROM&lt;/SPAN&gt; #TimeSpansRequested
              &lt;SPAN class=sqlkwd&gt;WHERE&lt;/SPAN&gt; &lt;SPAN class=sqlkwd3&gt;NOT EXISTS&lt;/SPAN&gt;(&lt;SPAN class=sqlkwd&gt;SELECT&lt;/SPAN&gt; ID_TIMESPAN 
                               &lt;SPAN class=sqlkwd&gt;FROM&lt;/SPAN&gt; RESERVATION  
                               &lt;SPAN class=sqlkwd&gt;WHERE&lt;/SPAN&gt; (RESERVATION.ID_OBJ = ROOM.ID_OBJ)
                                      &lt;SPAN class=sqlkwd3&gt;AND&lt;/SPAN&gt; ([DATE] = @&lt;SPAN class=sqlkwd&gt;DAY&lt;/SPAN&gt;)
                                      &lt;SPAN class=sqlkwd3&gt;AND&lt;/SPAN&gt; ((hr1 &lt;SPAN class=sqlkwd3&gt;BETWEEN&lt;/SPAN&gt; HOUR_BEGINNING &lt;SPAN class=sqlkwd3&gt;AND&lt;/SPAN&gt; HOUR_END)
                                      &lt;SPAN class=sqlkwd3&gt;OR&lt;/SPAN&gt; (hr2 &lt;SPAN class=sqlkwd3&gt;BETWEEN&lt;/SPAN&gt; HOUR_BEGINNING &lt;SPAN class=sqlkwd3&gt;AND&lt;/SPAN&gt; HOUR_END))
                                     )
              )&lt;/FONT&gt;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;In the code above we&amp;nbsp;are checking out for each door&amp;nbsp;if exists some potentially good interval that is not spoiled by any of&amp;nbsp;reservation timespan.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps. &lt;/P&gt;
&lt;P&gt;Thanks for the good puzzle.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;BR&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6481747" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/sergeys/archive/tags/General+Software+Development/default.aspx">General Software Development</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/T-SQL/default.aspx">T-SQL</category></item><item><title>Public web-services to populate SQL server database under MS Office Live documents. (The request for)</title><link>http://weblogs.asp.net/sergeys/archive/2008/07/18/public-web-services-to-populate-sql-server-database-under-ms-officelive-documents-the-request-for.aspx</link><pubDate>Fri, 18 Jul 2008 14:56:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6415924</guid><dc:creator>SergeyS</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/sergeys/rsscomments.aspx?PostID=6415924</wfw:commentRss><comments>http://weblogs.asp.net/sergeys/archive/2008/07/18/public-web-services-to-populate-sql-server-database-under-ms-officelive-documents-the-request-for.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;Sorry, I did not work with MS OfficeLive documents yet. But, nevertheless, I think the idea could be of some interest.&lt;/P&gt;
&lt;P mce_keep="true"&gt;All these billions of ubiquitous sensors around us doing their routine everyday work. Why not let them log their data directly to SQL server database that backs up MS OfficeLive documents?&lt;/P&gt;
&lt;P mce_keep="true"&gt;For example if I had a number of temperature and other types of sensors around my home, I’d like to store it somehow and process and represent&amp;nbsp;the result in convenient way. Normally I should buy some hardware to connect the sensors to PC, develop some software to acquire the data and store it into MS Access or Excel, then somehow process it and show the result. Too much hassle.&lt;BR&gt;Why not buy some hub that would talk to SQL server database under MS OfficeLive and then simply connect standard sensors to the hub?&lt;/P&gt;
&lt;P mce_keep="true"&gt;For home use the hub could be &lt;BR&gt;- a cheap microcontroller (US$3) should be&amp;nbsp;powerful enough to consume web services. &lt;BR&gt;- a GPRS or CDMA module (US$15) with internet plan (US$10/month)&lt;BR&gt;- some interface logic (US$1)&lt;BR&gt;&amp;nbsp;&lt;BR&gt;The MS OfficeLive documents should be real live. The incoming data should get processed and displayed real-time.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Professional usage also is interesting. A lot of applications are not starting because of initial or pilot phase costs much time and money. If you have a distributed system to acquire data, the cost of hardware (and knowledge how to choose right one) to gather the data together would cost good money and time. With the proposed approach you just buy cheap hub, connect sensors to it and all you data are getting to the database automatically, hundreds of thousands bucks are saved. Of course you could optimize hardware later; the good thing is that you can start developing business software right now over live data. &lt;/P&gt;
&lt;P mce_keep="true"&gt;The range of applications that could talk to MS OfficeLive web-hosts/datacenters through web-services is big, from small home projects to large corporate. The next step would be to sell basic business software on datacenters over the proposed scheme; and also to let developers to customize the functionality using .NET.&amp;nbsp; Definitely I’d prefer the live docs to Google docs.&lt;/P&gt;
&lt;P mce_keep="true"&gt;---&lt;/P&gt;
&lt;P mce_keep="true"&gt;Published under the relevent terms.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6415924" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/sergeys/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/Web+Services/default.aspx">Web Services</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/Content+Management+Server/default.aspx">Content Management Server</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/Mobile/default.aspx">Mobile</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/SQL+Server/default.aspx">SQL Server</category></item><item><title>Microsoft should take over CPU architecture.</title><link>http://weblogs.asp.net/sergeys/archive/2008/03/27/microsoft-should-take-over-cpu-architecture.aspx</link><pubDate>Thu, 27 Mar 2008 06:18:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6036050</guid><dc:creator>SergeyS</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/sergeys/rsscomments.aspx?PostID=6036050</wfw:commentRss><comments>http://weblogs.asp.net/sergeys/archive/2008/03/27/microsoft-should-take-over-cpu-architecture.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;CPU, such as Intel's or AMD's CPUs are complex "hard-wired" systems. CPU structure is very loosely coupled with the .NET structure. This kind of abstraction is becoming a fundamental bottleneck in evolution of computer systems since silicon is getting cheaper and more capacious.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Currently software code could be served by 1 to 8 hardware servers named CPU cores. This is like if, say, all the FedEx customers would be served not by thousands trucks, but rather 4 super-fast trains.&lt;/P&gt;
&lt;P mce_keep="true"&gt;What needed is NOT a few fast pipes (CPU cores) a code could reach the hardware through, but rather a marketplace where software objects could bid for job being done, described in their contracts; and hardware items be dynamically organized into units to perform the job. That is, when an object instance (in C# or VB.NET) is initialized; it would be assigned some hardware to run on asynchronously. The assignment would be conducted under some “market” policy.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Such hardware organization is not Intel's, or AMD's, or Xilinx's area of activity. They should mass product cheap chips with the huge number of universal items. That’s the job of Microsoft to find a way to get all the units fit the .NET model without bottlenecks. Good luck Microsoft!&lt;BR&gt;---&lt;BR&gt;This message is posted under the related Microsoft’s Terms of Use ("TOU").&lt;/P&gt;
&lt;P mce_keep="true"&gt;---&lt;BR&gt;Vy hochete pesen - ih est' u menya.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6036050" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/sergeys/archive/tags/.NET+Micro+Framework/default.aspx">.NET Micro Framework</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/CLR/default.aspx">CLR</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/VB.NET/default.aspx">VB.NET</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/General+Software+Development/default.aspx">General Software Development</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://weblogs.asp.net/sergeys/archive/tags/.NET/default.aspx">.NET</category></item></channel></rss>