tag:blogger.com,1999:blog-23376057204756012572024-03-05T22:20:55.814-08:00Zlatko Michailovsoftware developer, soccer coach, dadZlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.comBlogger50125tag:blogger.com,1999:blog-2337605720475601257.post-26763002538166411932016-03-20T16:13:00.001-07:002016-03-20T16:38:09.978-07:00How to Reset a Comcast Cable Box<p><u><b>Disclaimer</b></u>: Do the following procedure at your own risk. I'm not a Comcast insider. I'm just good at debugging.</p> <h4>Symptoms</h4> <p>Your cable box has lost signal without being able to recover. Comcast’s customer support has sent a reset signal, but the box is not responding to it.</p> <h4>Problem </h4> <p>What I believe has happened is the box has lost trust in Comcast. Now it refuses to accept any signal from the remote port including a reset signal.</p> <h4>Solution </h4> <p>The solution that has worked for me is to deactivate the box, and then to reactivate it.</p> <h4>Procedure</h4> <p><font style="font-weight: normal">1. <strong>Reset/deactivate the cable box</strong>:</font></p> <ul> <li>Press and hold "0" on the remote control for about 5 seconds until the diagnostics menu comes up. <li>Quickly press "1", "3", "7", "9". This will reset/deactivate the box. </li></ul> <p>2. Wait until any visual activity stops. <b>Reboot the cable box</b>.</p> <p>3. <b>Verify the box appears as "not activated"</b>:</p> <ul> <li>Press and hold "0" on the remote control for about 5 seconds until the diagnostics menu comes up. <li>Switch to the item that looks like "DTA status" and click on it. <li>You should see something like "Activated: No". </li></ul> <p>4. <strong>Call Comcast </strong>(or do it over an online chat - it's much faster)<strong> to ACTIVATE your box</strong>. You'll need the serial number of the box which is printed on a label on the bottom of the box.</p> <p>Within a couple of minutes, TV signal should come in. </p>Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-11718655204537905702016-03-17T22:22:00.001-07:002016-03-17T22:22:47.618-07:00Systems of Linear Equations - Free for AllSome of my friends are familiar with the Windows Store app I wrote a couple of years ago that teaches kids how to solve systems of linear equations. The app generates problems with up to 5 unknowns, describes full step-by-step solutions, or shows just answers.<br />
<br />
The news is that I've ditched the Windows Store, and I've made the app freely available as a web service. It is available for all smart devices from all geographical regions:<br />
<br />
<div style="text-align: center;">
<b><a href="http://xyz.michailov.org/">http://xyz.michailov.org</a></b></div>
<br />
The app is designed for small form factor devices. So please try it from your phone.<br />
<br />
This was made possible by the free web hosting at <a href="https://pages.github.com/">GitHub Pages</a>.Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-62066380501505377102015-06-02T22:39:00.001-07:002015-06-02T22:39:38.500-07:00Introducing Java Async I/O<p>I’ve been playing with Java recently. It turns out Java has two archaic I/O stacks neither of which is adequate for modern days. That’s why I developed an <em>async I/O</em> package.</p> <p>My package doesn’t replace the existing I/O stacks. It’s an upgrade on top of the old InputStream and OutputStream that enables async interaction to optimize CPU usage and responsiveness of the consuming app.</p> <p>The entire source code is available on <a href="https://github.com/zlatko-michailov">GitHub</a>:</p> <blockquote> <p><a title="https://github.com/zlatko-michailov/async-io" href="https://github.com/zlatko-michailov/async-io"><strong>https://github.com/zlatko-michailov/async-io</strong></a></p></blockquote> <p>Start with the <a href="https://github.com/zlatko-michailov/async-io/blob/master/README.md">README</a> file, and you’ll find links to the <a href="http://zlatko-michailov.github.io/async-io/repo/maven/michailov/async-io/0.1/async-io-0.1.jar">binaries</a> as well as to the <a href="https://github.com/zlatko-michailov/async-io/blob/master/docs/README.md">documentation</a>. Go through the <a href="https://github.com/zlatko-michailov/async-io/blob/master/docs/README.md">doc articles</a> and the <a href="http://zlatko-michailov.github.io/async-io/docs/javadoc/">API reference</a>, and if this paradigm makes sense to you, try it in an app. I’ll be glad to hear your feedback.</p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-8292773461695735512015-04-13T21:52:00.001-07:002015-04-13T21:52:12.348-07:00Nuances of Command Piping in the Windows Command Shell<p> </p> <p>A key concept in command piping is the success/failure of the execution which is determined by the status code the command returns. <strong>0</strong> (zero) means “success” while any other value means “failure”.</p> <p>Throughout this article, I’ll be using this successful command:</p> <blockquote> <p>> cmd /c “exit <strong>0</strong>”</p></blockquote> <p>as well as this failing command:</p> <blockquote> <p>> cmd /c “exit <strong>42</strong>”</p></blockquote> <p><strong>Note</strong>: If you want to copy and paste some of these examples, make sure you fix the quotes, dashes, and other characters to their standard ASCII representations.</p> <h4>Execute on Failure ( || )</h4> <p>Executes the command on the right side if and only if the command on the left side has failed. This piped statement:</p> <blockquote> <p><font color="#0000ff">> cmd /c “echo left & exit <strong>0</strong>”</font> || <font color="#ff0000">echo right</font></p></blockquote> <p>prints “<font color="#0000ff">left</font>” while this piped statement:</p> <blockquote> <p><font color="#0000ff">> cmd /c “echo left & exit <strong>42</strong>”</font> || <font color="#ff0000">echo right</font></p></blockquote> <p>prints “<font color="#0000ff">left</font>” then “<font color="#ff0000">right</font>”. </p> <p>You can remember this syntax and behavior as the logical OR operation from the C language or its derivates – C++, Java, C#, etc.</p> <h4>Execute on Success ( && )</h4> <p>Executes the command on the right side if and only if the command on the left side has succeeded. This piped statement:</p> <blockquote> <p><font color="#0000ff">> cmd /c “echo left & exit <strong>0</strong>”</font> && <font color="#ff0000">echo right</font></p></blockquote> <p>prints “<font color="#0000ff">left</font>” then “<font color="#ff0000">right</font>” while this piped statement:</p> <blockquote> <p><font color="#0000ff">> cmd /c “echo left & exit <strong>42</strong>”</font> && <font color="#ff0000">echo right</font></p></blockquote> <p>prints only “<font color="#0000ff">left</font>”. </p> <p>Similarly to the previous one, you can remember this syntax and behavior as the logical AND operation from the C language family.</p> <h4>Execute in Parallel ( | )</h4> <p>You may be familiar with this one – this is the true pipe. The shell connects the stdout of the left command to the stdin of the right command. </p> <p>What you may have not paid attention to is that the shell launches both of them in parallel. That is necessary for the pipe to have a live process on each end.</p> <p>To demonstrate the parallelism, we’ll need to enhance/complicate our left command a little bit:</p> <blockquote> <p>cmd /c "<font color="#0000ff">echo left begin >&2</font> & <font color="#ffc000">timeout /t 5</font> & <font color="#9b00d3">echo left end >&2</font> & exit 0" </p></blockquote> <p>First it prints “left begin” (to stderr to avoid the piping, so we can see the output), then it sleeps for 5 seconds to simulate work, and then it prints “left end” right before exiting.</p> <p>Success and failure don’t matter. Both of these piped statements:</p> <blockquote> <p><font color="#0000ff">> cmd /c "echo left begin >&2 & timeout /t 5 & echo left end >&2 & exit <strong>0</strong>"</font> | <font color="#ff0000">echo right</font></p></blockquote> <p>and</p> <blockquote> <p><font color="#0000ff">> cmd /c "echo left begin >&2 & timeout /t 5 & echo left end >&2 & exit <strong>42</strong>"</font> | <font color="#ff0000">echo right</font></p></blockquote> <p>print “<font color="#0000ff">left begin</font>” and “<font color="#ff0000">right</font>”, then sleep for 5 seconds, and then it prints “<font color="#0000ff">left end</font>”. </p> <h4>Execute Sequentially ( & )</h4> <p>This is the simplest yet least popular of all variations – it executed the right command after the left command has finished regardless of success/failure.</p> <p>Using the same commands from the previous section:</p> <blockquote> <p><font color="#0000ff">> cmd /c "echo left begin >&2 & timeout /t 5 & echo left end >&2 & exit <strong>0</strong>"</font> & <font color="#ff0000">echo right</font></p></blockquote> <p>and</p> <blockquote> <p><font color="#0000ff">> cmd /c "echo left begin >&2 & timeout /t 5 & echo left end >&2 & exit <strong>42</strong>"</font> & <font color="#ff0000">echo right</font></p></blockquote> <p>both of them print “<font color="#0000ff">left begin</font>”, sleep for 5 seconds, then print “<font color="#0000ff">left end</font>” and “<font color="#ff0000">right</font>”. </p> <h4>Relationship to POSIX</h4> <p>The first 3 syntaxes are identical between Windows cmd and bash. What is ‘<strong>&</strong>’ in Windows is ‘<strong>;</strong>’ (semicolon) in bash. Otherwise the behavior is the same.</p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-7496971914888640642015-02-26T09:46:00.001-08:002015-02-26T09:46:00.620-08:00My US Patents<p>The following patent applications have been approved in the United States. To find out more about each of them, click on the patent number:</p> <p><strong><a href="http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&p=1&u=%2Fnetahtml%2FPTO%2Fsearch-bool.html&r=1&f=G&l=50&co1=AND&d=PTXT&s1=7,818,311.PN.&OS=PN/7,818,311&RS=PN/7,818,311">7,818,311</a></strong> (2010-10-19) <br>Complex regular expression construction</p> <p><strong><a href="http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&p=1&u=%2Fnetahtml%2FPTO%2Fsearch-bool.html&r=1&f=G&l=50&co1=AND&d=PTXT&s1=8,856,792.PN.&OS=PN/8,856,792&RS=PN/8,856,792">8,856,792</a></strong> (2014-10-07)<br>Cancelable and faultable dataflow nodes </p> <p><strong><a href="http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&p=1&u=%2Fnetahtml%2FPTO%2Fsearch-bool.html&r=1&f=G&l=50&co1=AND&d=PTXT&s1=8,909,863.PN.&OS=PN/8,909,863&RS=PN/8,909,863">8,909,863</a></strong> (2014-12-09)<br>Cache for storage and/or retrieval of application information </p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-55593284813518219732015-02-26T09:27:00.001-08:002015-02-26T09:27:20.263-08:00About Me @ Microsoft (part III continued)<p>After multiple reorgs, my team continues owning the programmability and public API for SharePoint and now of the entire Office. </p> <p>I, personally, have been focused on implementing Office cloud functionality to public app developers through the Office365 and Azure clouds: </p> <ul> <li>I designed and implemented the service behind <a href="https://api.office.com/discovery">https://api.office.com/discovery</a>. You can read more about it at: <a title="https://msdn.microsoft.com/office/office365/APi/discovery-service-rest-operations" href="https://msdn.microsoft.com/office/office365/APi/discovery-service-rest-operations">https://msdn.microsoft.com/office/office365/APi/discovery-service-rest-operations</a>. <li>I’m currently working on lighting up various aspects of Office cloud functionality through the Microsoft Graph API.</li></ul> <p>I remain the primary reviewer and approver of public API changes in SharePoint.</p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-45835409272110888632014-12-20T21:44:00.001-08:002014-12-20T21:44:59.357-08:00Introducing OneSql Client ADO.NET 0.1 (alpha)<p>I’ve made two releases this week. The important one is <a href="https://www.nuget.org/packages/OneSql.Client.AdoNet/">OneSql.Client.AdoNet 0.1 (alpha)</a>. That is an ADO.NET adapter on top of OneSql.Client. There are a few important things to keep in mind when you try to adopt it:</p> <h5>Dependencies</h5> <p>The OneSql.Client.AdoNet package needs these two other packages:</p> <ul> <li><a href="https://www.nuget.org/packages/System.Data.Common/">System.Data.Common</a> <li><a href="https://www.nuget.org/packages/OneSql.Client">OneSql.Client</a></li></ul> <h5>Supported API</h5> <p>Unless you stick exclusively to -Async methods, you are likely to get a NotSupportedExecption. There are two messages – one for each of the reasons:</p> <ul> <li>“<em>Synchronous operations are not supported.</em>”<br>This message means that this call may require a roundtrip to the server which cannot be done synchronously. If there is an –Async version of this method, use that. Otherwise, try to find a workaround that doesn’t utilize this method. <li>“<em>This feature is not supported.</em>”<br>This message means that OneSql Client hasn’t implemented the necessary part of the TDS protocol to enable this feature. You may search this blog to find out what is supported and what is not. For this kind of exceptions, you should be able to find a workaround.<br>If you feel strongly about a missing feature, feel free to send me an email at <a href="mailto:zlatko+onesql@michailov.org">zlatko+onesql@michailov.org</a>. That doesn’t mean I’ll agree to implement it right away, but if I hear from a good number of people, I may do so.</li></ul> <h5>Entity Framework</h5> <p>Enabling Entity Framework is the ultimate test for an ADO.NET provider. I will really appreciate your effort to migrate an EF-based app to Windows Store/Phone using OneSql Client ADO.NET. I’m sure you’ll get NotSupportedException’s please send me those call stacks. I’ll truly appreciate that.</p> <p> </p> <p>The second release is an update on OneSql Client itself. It contains 2 bug fixes plus retargeting both Windows Store and Windows Phone. I expect more such updates as testing on the ADO.NET adapter continues. </p> <p>I’ll continue posting notifications about new releases on <a title="https://twitter.com/OneSql" href="https://twitter.com/OneSql">https://twitter.com/OneSql</a>. Follow it if you want to stay informed. </p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-41588116606010905672014-10-17T21:04:00.001-07:002014-10-17T22:29:27.568-07:00OneSql Client 1.0<p>OneSql Client is no longer a beta!</p> <p>There’ve been 50 downloads of the beta version. I wish there were 100, but 50 is also a good number.</p> <p>I didn’t receive any feedback, so I assumed the product was rock solid and no key features were missing.</p> <p>OneSql Client 1.0 is a product now. You’ll find it at the same NuGet location - <a href="http://www.nuget.org/packages/OneSql.Client/"><strong>http://www.nuget.org/packages/OneSql.Client/</strong></a>. </p> <p>The license also remains the same – <strong>BSD-2-Clause</strong>.</p> <p>Questions and comments are still welcome at: <a href="mailto:zlatko+onesql@michailov.org"><strong>zlatko+onesql@michailov.org</strong></a>. </p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-34845030999944055422014-04-27T14:53:00.001-07:002014-04-27T14:53:53.676-07:00OneSql Client 0.3 (beta) Is Available<p>OneSql Client 0.3 (beta) is now available! </p> <p>Same locations:</p> <ul> <li>NuGet package - <a href="http://www.nuget.org/packages/OneSql.Client/"><strong>http://www.nuget.org/packages/OneSql.Client/</strong></a>. <li>Raw files and additional content - <a href="http://onesql.michailov.org/"><strong>http://onesql.michailov.org/</strong></a>. </li></ul> <h5>New in 0.3</h5> <p>The most significant addition to the OnceSql Client project is the test suite. The entire source code of the test project has been released. I may be used as samples.</p> <p>There are no new features in this release. Various bugs were discovered and fixed during the course of adding test automation.</p> <p>There are two breaking changes:</p> <ul> <li><a href="http://zlatko.michailov.org/2014/04/onesql-client-breaking-change-timeout.html">The timeout options have been removed</a>. This is an API change that may require changing existing app code. Otherwise it may not compile. And of course, tasks that used to time out, no longer do so.</li> <li>Service DONE sections are no longer exposed to apps. This is a behavior change. It will not prevent existing app code from compilation, but you may have to remove any <font face="Courier New">SqlClient.MoveToNextResultAsync()</font> calls you have added to skip over those “unwanted” results.</li></ul> <h5>Next</h5> <p>The “beta” label will be removed when all of the following conditions are met:</p> <ul> <li>The beta release has been available for at least 1 month, i.e. no earlier than May 27, 2014.</li> <li>There are at least 100 downloads of a single beta package on NuGet.</li> <li>All customer-reported issues for which there is no viable workaround have been fixed.</li></ul> <h5>Support</h5> <p>All support content will continue to be published at this blog. This link <a title="http://bit.ly/1khQm90" href="http://bit.ly/1khQm90"><strong>http://bit.ly/1khQm90</strong></a> queries OneSql Client content.</p> <p>The recommended source, however, is <a title="https://twitter.com/OneSql" href="https://twitter.com/@OneSql"><strong>https://twitter.com/@OneSql</strong></a> where along with references to blog posts, you’ll also find short status updates and news. </p> <h5>Feedback</h5> <p>To report an issue, to request a feature, or to provide feedback, please send an email to <a href="mailto:zlatko+onesql@michailov.org"><strong>zlatko+onesql@michailov.org</strong></a>. </p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-63870673621985110562014-04-18T17:27:00.001-07:002014-04-18T17:27:37.963-07:00OneSql Client – Breaking Change: Timeout Options Removed <p>This is an advance notice of an upcoming breaking change.</p> <h4>Summary</h4> <p>The following properties of type <font size="2" face="Courier New">OneSql.Client.Options</font> have been removed:</p> <ul> <li><font size="2" face="Courier New">ConnectTimeout</font> <li><font size="2" face="Courier New">CommandTimeout</font> <li><font size="2" face="Courier New">DefaultConnectTimeout</font> <li><font size="2" face="Courier New">DefaultCommandTimeout</font></li></ul> <p>OneSql Client operations will complete only based on <a href="http://msdn.microsoft.com/en-us/library/dd304523.aspx">[MS-TDS]</a> protocol flows, not based on any timeout.</p> <h4>Version</h4> <p><strong><font face="Courier New">0.3</font></strong> and above.</p> <h4>Details</h4> <p>The purpose of timeouts is to give control back to the app when an operation takes too long to complete. This is mainly useful in synchronous API where the client thread is blocked on the operation.</p> <p>In asynchronous API, like OneSql Client, the calling thread is never blocked. It is a developer’s choice whether to await the completion of the operation or to perform some other action. </p> <p>The purpose of the timeout options was to provide a “timed await” mechanism that is common for all languages.However, the current implementation is incorrect – it leaves the SqlClient (and its underlying TdsClient) in a state that prevents further usage. </p> <p>The cost of cleaning up SqlClient’s state exceeds the value of the feature by far. Moreover, that cleanup (which involves a new request to the server as well as receiving its response) may take a time that is long enough to defeat the purpose of the timeout. Therefore, timeouts have been discontinued. </p> <h4>Action Needed</h4> <p>Remove code that is setting (or getting) the above properties explicitly. Otherwise, when you upgrade your copy of OneSql Client, your app won’t compile.</p> <p>If you want to get control after a certain time before the operation has finished, use standard Windows RT mechanisms specific to the language of your app: </p> <p><strong>C#</strong></p> <p><font face="Courier New">var cts = new CancellationTokenSource(secs * 1000);<br>await sqlClient.XxxAsync(…).AsTask(cts);<br>…</font></p> <p><strong>JavaScript</strong></p> <p><font face="Courier New">var sqlPromise = sqlClient.XxxAsync();<br>WinJS.Promise.timeout(secs * 1000, sqlPromise).then(…, …);<br>…</font></p> <p>When you get control before the operation has finished, <strong>the SqlClient will be in a dirty state. You won’t be able to continue using it. Dispose of it. Any uncommitted transactions will be rolled back.</strong> Create a new SqlClient, connect it to the SQL Server, and decide how to continue.</p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-44776823450667146032014-03-29T22:44:00.001-07:002014-03-29T22:54:29.003-07:00OneSql Client is Back On Track!<p>Long story short - the problem I was hitting with C# was neither in Windows RT, nor in OneSql.Client. So I’m back on my way to implement the necessary test automation.</p> <p>Meanwhile, I discovered a <u>product bug</u> – OneSql Client misses the end of the result set when multiple rows are read at a time. While I’ve fixed this bug already, I’ll hold off a bits update. The workaround for this bug is to read rows one by one. If this is a problem for any of the current adopters, please let me know via email at <a href="mailto:zlatko+onesql@michailov.org">zlatko+onesql@michailov.org</a>.</p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-2536966024874563532014-03-21T23:22:00.001-07:002014-03-29T22:53:32.292-07:00OneSql.Client in C# Apps<p><font color="#0000ff"><strong>Update (Mar 29)</strong>: </font><em><font color="#0000ff">This issue is now resolved. See:</font> </em><a title="OneSql Client is Back On Track!" href="http://zlatko.michailov.org/2014/03/onesql-client-is-back-on-track.html"><em><strong>OneSql Client is Back On Track!</strong></em></a>.</p> <p>I’ve been testing OneSql.Client using a JavaScript app assuming that if it works for JavaScript, it should work for C# as well since OneSql.Client is written in C#. I’ve been wrong.</p> <p>I recently discovered that OneSql.Client doesn’t function properly when it’s hosted by C# apps. I’ve narrowed the problem down to the platform’s StreamSocket. I posted a <a href="http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/3da6ac41-f2f6-4f8e-9f3b-eef36728a9d3/#1a224ebf-0d00-486e-83b5-003f48de878e">question on the C# Apps forum</a>, but nobody from the product team has responded yet. I have little hope anybody will ever respond.</p> <p>This is very unfortunate, because C# represents a large portion of the Windows Store apps. Also, I still plan to implement the necessary test automation using C# in order to gain sufficient confidence in the quality of the product.</p> <p>I first apologize to all of the adopters who can’t use my product in their C# apps. I should have tried C# before announcing the alpha releases.</p> <p>I’m asking you for clues how I should be initializing/using StreamSocket to make it behave like it does in JavaScript apps. I admit I’m not certain whether the platform classes are exactly the same for JavaScript apps and for C# apps. I also suspect there might be differences in the threading models that I haven’t seen documented. Any other clues are also welcome. </p> <p>Please email your suggestions to: <a href="mailto:zlatko+onesql@michailov.org">zlatko+onesql@michailov.org</a>.</p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-82914136719398124712014-03-09T00:00:00.001-08:002014-03-09T00:04:46.413-08:00OneSql Client 0.2 (alpha)OneSql Client 0.2 (alpha) is now available. Same locations as before:<br />
<ul>
<li>NuGet package - <a href="http://www.nuget.org/packages/OneSql.Client/"><strong>http://www.nuget.org/packages/OneSql.Client/</strong></a>.</li>
<li>Raw .winmd and .chm files as well as a sample WinJS app - <a href="http://onesql.michailov.org/"><strong>http://onesql.michailov.org/</strong></a>.</li>
</ul>
<h5>
New in 0.2</h5>
This release fixes the error reporting model. I had noticed the WinJS app was not getting errors when I released 0.1. I thought I was doing something wrong that could be easily fixed. It turns out the WinRT interop layer can only surface a single HRESULT value from a component to a WInJS app, i.e. the exception instance – its type, message, stack, etc. is lost.<br />
To fix that WinRT deficiency, I had to replace throwing exceptions with raising custom errors. That is now done through a special Error object that is exposed on both SqlClient and TdsClient. An app has to examine that Error property upon a promise error. The Error object contains a Code and a Message properties.<br />
<h5>
Next</h5>
Notice that this release is still “alpha”. It will remain like that until I have a sufficient coverage through test automation. That is the next thing on my list.<br />
I will appreciate feedback. Please send email to <a href="mailto:zlatko+onesql@michailov.org"><strong>zlatko+onesql@michailov.org</strong></a>.Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-6628370838741779502014-02-26T15:30:00.001-08:002014-02-26T15:36:20.364-08:00Systems of Linear Equations 1.4 – Free Edition with Full FunctionalitySystems of Linear Equations v1.4 is now available. The big news is that <strong><u>Free Edition has full functionality</u></strong>! Yes, you get complete, detailed, solutions for free.<br />
Now that the only advantage of the paid edition is that you don’t get to see ads, <strong><u>I’ve reduced the price of Standard Edition to the minimum possible – $1.49</u></strong>.<br />
Notice that these new releases are <strong>only available for Windows 8.1</strong>.<br />
Start by installing the <a href="http://bit.ly/1jBjl3R"><strong>Free Edition</strong></a>. <br />
If you want to get rid of the ads, try the <a href="http://bit.ly/1bMWamM"><strong>Standard Edition</strong></a>.Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-22692970955301673392014-02-11T21:56:00.001-08:002014-02-11T22:03:02.237-08:00Devices and Services<p>The term “<em>devices and services</em>” has become very popular recently. However, a lot of people including software engineers wonder what it means in terms of technology as well as how it will generate revenues for software companies.</p> <p><font color="#ff0000">This article represents my personal opinion and only my personal opinion. It may or may not match Microsoft’s opinion. Either way, this article MUST NOT be taken as official or sanctioned by Microsoft</font>.</p> <h4>Devices</h4> <h5>Price Wars</h5> <p>It is naïve to think that any company [except Apple] can generate considerable revenues from hardware devices. The reason for that is that devices are made of mass market components. If one company can design a device with certain capabilities and a certain form factor, then other companies can do the same at the same or lower cost. Thus a device pioneer won’t enjoy glory for too long. (The only exception could be Apple that has uniquely loyal customers who are willing to pay extra for the brand.)</p> <p>Look at this offer – <a href="http://www.microsoftstore.com/store/msusa/en_US/pdp/Nokia-Lumia-521-No-Contract-for-T-Mobile/productID.279982200"><strong>Nokia Lumia 521 without contract for $69</strong></a>! This is a great device that runs the exact same Windows and apps that run on any expensive Windows phone, and the best of all features - no blood sucking contract! I don’t think Nokia/Microsoft will make a ton of money out of this device at this price. </p> <p>Or, how about <a href="http://www.microsoftstore.com/store/msusa/en_US/html/pbPage.PDP/Dell-Venue-8-Pro-Tablet-32GB/productID.289455200"><strong>this Dell Venue 8 Pro</strong></a> for $279? This device is a full blown computer that runs the real Windows, not RT.Will Dell make billions from it? I doubt it. </p> <h5>Open Platform</h5> <p>The PC platform was designed to be open from the very beginning. No one has ever owned it – neither chip makers, nor operating system vendors, nor PC manufacturers. Apps have had full access to the hardware capabilities of the PC. Users have been able to install apps from anywhere. Very democratic. </p> <p>Democracy, however, is not easy to consume. It requires knowledge and responsibility. For instance, when a user needs some functionality, she has the freedom to choose any app. Great! But where to find apps? How can she be certain the app will not do something bad either intentionally or unintentionally?</p> <p>The open platform works fine for computer/software savvy people. As long as you know where to search for apps, and you accept the risk of eventually installing a bad app, you will enjoy the open platform. Although there were hundreds of millions of PCs sold worldwide, it was a tiny fraction of the human population that was using them effectively.</p> <h5>Closed Platform</h5> <p>It is possible to create a platform that restricts what apps and users can do, but that platform can only enforce such restrictions over the layers built on top of itself. If the lower layers of the stack are open, an alternative platform could be installed that would not respect those restrictions, and thus no guarantees could be made. Therefore, in order for a platform to preserve integrity, it must include all the lower layers of the stack down to the very bottom – <em>the hardware device</em>. </p> <blockquote> <p>That’s where devices come to play a major role. Devices themselves won’t be generating revenues. They will be part of a closed platform that is expected to be more profitable than its open predecessor.</p></blockquote> <p>Why will the closed platform be more successful than the open platform? Because, although we are crazy about freedom, we are too lazy to sustain it. We want simple, constrained, experiences. We want someone else to guarantee the safety of our own device. And that’s exactly what the closed platform offers – when you need certain functionality, there is a single app store where you can possibly find an app. All apps have been tested by the platform vendor before they’ve been made available for you to download. When an app runs on your device, the platform won’t let it use any device capability that it hasn’t declared. When you want to remove an app, the platform will wipe it out like it has never been there. That perfectly fits the needs of our modern spoiled civilization.</p> <p>But how would a close platform generate a revenue? Here is the model that Apple pioneered in modern days: the platform vendor takes a percentage from every single app sale. Let’s say 4 developers have made app sales for $1M each. If the platform vendor takes a 25% cut from each app sale, it will make $1M while each of the developers will make $750K. Now imagine 4 million developers selling apps. You can do the math. Not every developer will be successful? No problem. The platform vendor requires an upfront license fee from every developer whether he will become successful or not. And yes, that license has to be renewed every year. Clever, isn’t it?</p> <h4>Devices and Services</h4> <p>The key factor that contributes to the success of a closed platform is the <em>user experience</em>. A good user experience attracts users who are potential app buyers. A large number of potential app buyers attracts app developers who make more apps available on the platform. More apps make the platform even more attractive to users which closes the loop and so does the process continue. </p> <h5>Emerging User Experience</h5> <p>Of course, each platform vendor will put its signature on the user experience, and will provide a different set of free apps to make its platform unique, but that’s not the interesting part. The important thing is the emerging user experience that is the same across all device platforms, and that will change the software industry.</p> <p>To understand this new experience, let’s take a look at the evolution of doing business: In-person –> The Web –> Devices and Services.</p> <h6>In-Person</h6> <ol> <li>Get your butt off the couch to sit in your car. <li>Drive to the point of business. <li>Stand in line. <li>Do your business. <li>Drive back. <li>Place your butt where it belongs – on the couch.</li></ol> <p>5 out of those 6 steps are plain overhead. Not only does that waste time, but it’s often dangerous.</p> <h6>The Web</h6> <p>The Web significantly simplified the experience by replacing physical driving with cyber navigation: </p> <ol> <li>Get your butt off the couch to sit by the PC or to fetch the laptop. <li><strike><font color="#a5a5a5">Sit in the car and drive to the place of business</font></strike>.<br>Navigate to the target web site. <li><strike><font color="#a5a5a5">Stand in line</font></strike>. <li>Do your business. <li><strike><font color="#a5a5a5">Drive back</font></strike>. <li>Place your butt where it belongs – on the couch.</li></ol> <p>The Web made it safer and faster. But one big problem still remains – we are lazy, and we want to sit on the couch doing nothing. </p> <p>That’s where devices and services comes to help.</p> <h6>Devices and Services</h6> <ol> <li><strike><font color="#a5a5a5">Get your butt off the couch to sit by the PC or to fetch the laptop</font></strike>.<br>Suspend the Facebook app. <li><strike><font color="#a5a5a5">Sit in the car and drive to the place of business</font></strike>.<br><strike><font color="#a5a5a5">Navigate to the target web site</font></strike>.<br>Bring up the app for the job. <li><strike><font color="#a5a5a5">Stand in line</font></strike>. <li>Do your business. <li><strike><font color="#a5a5a5">Drive back</font></strike>. <li><strike><font color="#a5a5a5">Place your butt where it belongs – on the couch</font></strike>.<br>Resume the Facebook app.</li></ol> <p>Your butt remains planted on the couch the whole time. Halleluiah! This experience can only be successful. </p> <h4>Impact on the Web Site Industry</h4> <p>I’m not writing out of excitement about how our society will get fat faster. I’m writing because I foresee a disruptive change coming up triggered by devices and services.</p> <h5>From *SP to Plain HTML</h5> <p>The vast majority of web sites is implemented using a server page technology - ASP.NET, JSP, PHP, etc. An HTTP request comes to the server and gets dispatched to the web site’s handler. The handler loads and executes a custom module that does some computation and ultimately sends back HTML that a browser visualizes in front of the end user.</p> <p>Since the user experience is what sells a web site, the UI dictates how code is written and structured. You may see projects where all the code is packaged in server page modules, though most commonly developers try to extract <em>business logic</em> into separate modules. That’s the funny part. Since all code paths are driven by UI experiences, it’s hard to draw a clear line where UI-specific code ends and where business logic starts. Thus what typically ends up in the so called business logic can be classified in two buckets:</p> <ul> <li>Unrelated utility functions. <li>An object model that represents the persistence schema.</li></ul> <p>This is funny because despite of the developers’ best intents, such a separation has no value with regard to reusability or scalability. It might as well live with the rest of the server page code because that’s the only purpose it serves.</p> <p>Now the important part - that code doesn’t belong to the server side at all! Its place is on the client side just like any other app. That’s the first architectural change that devices and services introduces:</p> <blockquote> <p>Devices and services kicks web UI out of the server, and converts it to plain HTML. The web site becomes yet another client app for the given service.</p></blockquote> <p>This is a very important change because it deeply affects the COGS of running a web site. Instead of the service vendor paying for the resources (CPU, memory, bandwidth, etc.) needed to generate a web page, each user will run that code in their own browser. And those utility libraries and object models? They’ll have to be rewritten in JavaScript - as I already explained, they only serve the UI.</p> <h5>Scale Out and the Current Lack of It</h5> <p>The removal of the UI from the server will reveal an unspoken truth:</p> <blockquote> <p>Most web sites never really scaled out.</p></blockquote> <p>(<font color="#666666">There is a tiny portion of modern web sites, mainly in the search or social space, that are designed to scale out and that I don’t include in the above statement.</font>)</p> <p>Most development teams actually believe their web sites scales out. And their scale out is done by replicating front end boxes where those teams believe the most compute-intense code, the business logic, runs. First, we now know that all that front end code doesn’t belong on the server side to begin with. Second, the assumption that the most compute-intense code is outside of the data layer is wrong, because the relevance of a web site is proportional to the data it processes. If there was no giant volume of data around which the whole experience gravitates, you’d be running that functionality on your local box! </p> <p>(<font color="#666666">In all fairness, there are some web sites that offer a poor man’s backend scale out by creating <em>static partitions</em>. A user session statically belongs to exactly one partition based either on the host name or on the user account. While this approach does offer some scalability, the scalability is uneven and the approach requires constant monitoring and a manual migration of data among partitions to maintain a relatively even distribution. Thus the cost of this approach is too high to accept as long-term solution.</font>)</p> <p>That defines a problem for the whole web site industry:</p> <blockquote> <p>Follow the search and social leaders and design your data stores to scale out.</p></blockquote> <p>A lot has been written about Big Data, and I won’t repeat it. My point is that Big Data stores will become the primary choice of data stores for web-facing systems. The sooner development teams accept this idea, the better position they will get in the new world of devices and services.</p> <h5>Thin Client No More</h5> <p>Lastly, I’d like to point out that our perception of the client experiences will change. So far we’ve been categorizing clients as “<em>thin</em>” (web pages) and “<em>rich</em>” (standalone apps.) The web interface was viewed as lass capable than standalone apps. That perception is about to change – device apps will provide limited UI for limited functionality suitable for the lower resolution and the smaller form factor of the device while the web pages will provide full functionality leveraging high definition screens. For instance, we’ll be using our phones to read our Facebook feeds most of the time, and we’ll use a browser when we want to do a more sophisticated operation like managing settings. </p> <h5></h5> <h4>Conclusion</h4> <p>Devices and services launches a new era in software history. The trend is irreversible. We, software developers, will have to accept the constraints and the requirements of the new platform. </p> <p>I am truly excited about the disruption to web-facing systems. As a backend developer, I’ve been waiting for the demand to build up, and now that the moment has come, and I can’t hide my excitement.</p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-67377605400287426222014-01-14T22:40:00.001-08:002014-03-09T00:03:32.162-08:00OneSql Client – World’s First SQL Server Provider for Windows Store AppsIf you work on a SQL Server client apps, you may have noticed that it’s not possible to connect directly to SQL Server from a Windows Store app. Instead, you have to develop a web service, you have to deploy it somewhere in the cloud, you (or your customers) have to pay for running it, and lastly, you have to support it. And all that is because there is no SQL Server provider for Windows Store apps.<br />
<strong>Today, I am excited to announce OneSql Client – world’s first SQL Server provider for Windows Store apps</strong>!<br />
<h5>
Overview</h5>
OneSql Client is a Windows Runtime component that can be used from any Windows Store app regardless of its language. I wrote a demo app in JavaScript to prove that concept (see link below.)<br />
OneSql Client is freely available as a NuGet package at <a href="http://www.nuget.org/packages/OneSql.Client/" title="https://www.nuget.org/packages/OneSql.Client/"><strong>http://www.nuget.org/packages/OneSql.Client/</strong></a> or in a raw form from its home location <a href="http://onesql.michailov.org/" title="http://onesql.michailov.org/"><strong>http://onesql.michailov.org/</strong></a>. <br />
<u>Please be advised that this is an early alpha release and it may not behave correctly in many cases. At this point, it is only intended for experimental and learning purposes.</u><br />
OneSql Client implements the <a href="http://msdn.microsoft.com/en-us/library/dd304523.aspx">[MS-TDS]</a> protocol from scratch. Well, it doesn’t implement the whole protocol yet. The purpose of this alpha release is to prioritize the remaining work. <br />
<h5>
API</h5>
OneSql exposes API from two namespaces:<br />
<ul>
<li><strong>OneSql.Client.Sql</strong> – this namespace contains the actual SQL Server provider, <strong>SqlClient</strong>, that is ready for consumption by apps. It returns rows as JSON arrays. </li>
<li><strong>OneSql.Client.Tds</strong> – this namespace contains low-level primitives that could be used to implement your own provider. However, if you need a feature that SqlClient doesn’t offer, I strongly recommend that you first request that feature from SqlClient before trying to implement your own provider.</li>
</ul>
<h5>
Limitations</h5>
<ul>
<li>Supports SQL Server 2012 or higher. It might be possible to work against SQL Server 2008 and 2008 R2, but that hasn’t been tested. </li>
<li>Doesn’t support the following data types: <ul>
<li>image, text, ntext – these types have been superseded by varbinary(max), varchar(max), and nvarchar(max) respectively. </li>
<li>decimal/numeric – these types are too big for JavaScript. </li>
<li>UDT – I don’t think there is a base support for these in Windows Runtime. </li>
<li>sql_variant – I’ve never needed this type. Hopefully not too many people will be crying for it.</li>
</ul>
The above types can still be used in the storage schema or in server-side code. They just can’t be retrieved directly. You’ll have to CONVERT/CAST the respective column to a supported type. </li>
<li>Only SQL batches are supported, i.e. parameterized queries are not yet supported. They are on the plan, just not yet.</li>
</ul>
<h5>
Getting Started</h5>
Download and open the <a href="http://sdrv.ms/1d5id1X">SampleWindowsStoreApp</a> project. Play with it. You’ll most certainly find bugs. Please describe your repro clearly, zip any prerequisite SQL and send it to <a href="mailto:zlatko+onesql@michailov.org"><strong>zlatko+onesql@michailov.org</strong></a>. <br />
You may also see how connections are established, how rows are being fetched, and how to move to the next result set. The documentation is very Spartan at the moment. It is on my plan to provide samples. <br />
<h5>
Known Issues</h5>
Errors encountered by OneSql get lost somewhere among the awaits and the JavaScript promises. I know it is annoying. I’m working on that too.<br />
<h5>
Support</h5>
The best place to get the latest news, updates, and references to resources is <a href="https://twitter.com/@OneSql" title="https://twitter.com/@OneSql"><strong>https://twitter.com/@OneSql</strong></a>. <br />
Articles will continue being published at <a href="http://zlatko.michailov.org/" title="http://zlatko.michailov.org/"><strong>http://zlatko.michailov.org/</strong></a>.<br />
New releases and other executable artifacts will be published at <a href="https://onesql.michailov.org/" title="http://onesql.michailov.org/"><strong>https://onesql.michailov.org/</strong></a>.<br />
For everything else, send me an email at <a href="mailto:zlatko+onesql@michailov.org"><strong>zlatko+onesql@michailov.org</strong></a>.Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-29884670635342925372013-08-23T09:28:00.001-07:002014-02-26T15:11:27.241-08:00Systems of Linear Equations<strong>Systems of Linear Equations</strong> is an app that teaches kids how to solve systems of linear equations that also generates practice problems. The app comes in two editions – <strong>Free</strong> and <strong>Standard</strong>.<br />
<h4>
Features</h4>
<h5>
Free Edition</h5>
<ul>
<li>Unlimited number of problems with 2 and 3 unknowns. </li>
<li>Answers. </li>
<li>A description of the Gaussian Elimination method. </li>
<li><strong>Free of charge</strong>.</li>
</ul>
<h5>
Standard Edition</h5>
<ul>
<li>Unlimited number of problems with 2, 3, <strong>4, and 5</strong> unknowns. </li>
<li>Answers. </li>
<li><strong>Complete solutions</strong>. </li>
<li>A description of the Gaussian Elimination method. </li>
<li><strong>Costs $2.49</strong>.</li>
</ul>
<h4>
Screenshots</h4>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMF27aMk-qmdz25ZlpQZu2YyqXB5WJemoBUIVVhv4ZEDUFziough30haxHGRmMJgmMHBOBwZgMc-U00kXoyK9yYseu3UoZ3awDOdpuyOJvZntB_47xephFQOtyabK5yKAStUdRUdrlvZjD/s1600-h/Standard_1_Navigation3.png"><img alt="Standard_1_Navigation" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcaskTLgND2xC-xYKWRPuOEl5e7EN9K0zevPVMXhlphnUa3KQ9VJM-vSVRjQ6XMT_k_ZYEyaqbjZYmrOAlLO6VI8z3bCbXNDNPG8O6S_Qu7V2RLwoEkJWHTcBd5DXGig7NWO1XqTu0Wbdv/?imgmax=800" height="274" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Standard_1_Navigation" width="484" /></a><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDaYKuGzLh4S7c_q6JIk3lU95l1ByvQ86QvsO2Iu0u7XJlMWbzVrbgSGV8sNdEia0r3Zpn5tUr35zgbPm68crixRDAJ8RUTSLCZ0MneMpRu0HPYn_rrTlVAHZDhsBCK3a6ndSumyid-rO4/s1600-h/Standard_2_Problem3.png"><img alt="Standard_2_Problem" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKAbjQGvcf4bAB7JyuSu13GKsq4sCQsrZXvbYdMfE5rO-Y_Lx08QmUTfLEr1omWxkVsOYPm8082Icm2hndkDXhmT0kcoRdERzsJUU2ke1o51ncfywQxAcSbe9JBi10QhGcq_-5hZxJjAEW/?imgmax=800" height="274" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Standard_2_Problem" width="484" /></a><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgghKPPSkkMqF3xpWfVpd69i6tqU1nlDnWW8cDrmIyBJrO5SUhFtZDlw5ArDyxMlzJBnV6FwFRrCHl6hnAWVEMotMQHkoNcHQIf2KguJp5KH-k7wwSeq9Qixb8ewyqHp7VvUrd9E45faJSk/s1600-h/Standard_3_Answer4.png"><img alt="Standard_3_Answer" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivozqba_DxfwVD-pwyU10K60gTfVGLWRmmWTVMzHaQAFuzaYb7rOan_d31nzpimeCJN-_Wy9HdQJhXzCFOQwDCqtWiXivbmB95m1j74ObLtAfHSzVS_HOLyDChMsxo2o4GyojclxeGghWE/?imgmax=800" height="274" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Standard_3_Answer" width="484" /></a><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS5uAxl3LW5mzS_hS2Ozk1x1W4RdVms6o_ociVsrIFliO-frYO4un2uYTaTMEc4_yw_hAa7ADpM6pTjO6ro3rWEoXhuABy_tjmApRygur22xIlKeIfxr1jEmX8WMYQtA8giVgmh-CBPgGn/s1600-h/Standard_4_Solution3.png"><img alt="Standard_4_Solution" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnrmrCcEtlG-kCdJMx_cZoXwsM8W6FpwdOoFuC-GiFxkAEq-vtagcZ3PdP76_InyzpVfx06KnEYo7FD3Dqm1ahoJ2dM-VtT8ZUzNJ-b34icHGRfocKNNSxDrfoCHDlB3xNA3iLMTPjzCFt/?imgmax=800" height="274" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Standard_4_Solution" width="484" /></a><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4COARyBcx3wHdoyRb3U9TrYqqn2hWWjuGAQEh-WTl-P828P-u9uue-p3rs3MHvFsTQP5imNy8w94I603_woijR_cNtusvfFsmruVBtLaDGcglE6V6MW_nndqn96RAKBb7vpwWA6r7mOtx/s1600-h/All_Method4.png"><img alt="All_Method" border="0" src="http://lh3.ggpht.com/-VlCjG5oiQAs/UheNyP3rW6I/AAAAAAAAIwQ/b9I5ZvCje88/All_Method_thumb1.png?imgmax=800" height="274" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="All_Method" width="484" /></a><br />
<h4>
How to Obtain</h4>
The app is available for Windows 8 and Windows RT from the Windows App Store. It is in the <strong>Education</strong> category. <br />
(Tip: To search the Windows App Store, launch the Store app, then sweep the screen from the right and tap on the Search icon.) <br />
The Free edition is available worldwide while the Standard edition is only available in the United States.<br />
<h4>
Support</h4>
Go to <a href="http://zlatko.michailov.org/?Label=Equations">http://zlatko.michailov.org?Label=Equations</a>. <br />
If you don’t find the answer you are looking for, post your question under an appropriate article.Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-33696946847369369652012-10-20T23:21:00.001-07:002012-10-20T23:38:42.091-07:00Heroes, Time Bombs, and Refactoring<p>When an organization embarks on the development of a new software product, it has two questions to answer: </p> <ol> <li>What base technologies should the new product use/depend on?</li> <li>How the new product will grow over time?</li> </ol> <p>The first question is <i>religious</i> which makes it easy to answer – an organization is either a “Microsoft shop”, or an “OpenSource shop”, or “Some-other-religion shop”. Within that shop, developers may have to choose between managed or native in case that is not part of the religion, and that’s it for question #1. </p> <p>Question #2 is a business question. In all fairness managers and architects typically spend the necessary time and effort to come up with a solid vision for future growth. Only after upper management is satisfied with that vision, will it let development commence. </p> <p>So far so good – that is the correct process. Um, there must be a caveat, right? Right. The caveat is that the base technologies the organization has religiously chosen also have similar growth plans. That means there is a chance that a base technology may offer the same functionality as this product. That chance is low by default, but it can jump significantly if developers try to be...<i>smart</i>. This is religion, remember? Religion demands faith, not smartness. Every platform’s goal is to make common use cases simple. As long as application developers stick to such simple patterns, their product will leverage the platform’s enhancements. However, often times the platform is lacking certain features, and developers plug those wholes rather than wait for the platform to improve. </p> <p>A very typical example of such a fix is implementing a data cache to save hard disk hits, or network roundtrips. While such a fix works perfectly short term, it is a time bomb in the long run, because performance is a fundamental problem, and sooner or later the platform will address it. Furthermore different technologies develop at different paces. For instance, 10-15 years ago the main problems were slow network communications and slow disk access. So it was tempting to bake a data cache right into the frontend box. Today, however, the main problem is to scale out the frontends in order to serve the necessary number of hits, which further trails the requirement of driving the cost of those frontends low. Now a data cache on each frontend box would consume unnecessary memory as well as CPU cycles for cache entry lookups while a single dedicated cache box per rack or per farm would be cheaper and more effective . </p> <p>That is how a big win can expire over time. It becomes<i> cancer</i> – it is an extra code that has both a development/maintenance cost as well as production cost. And it can only get worse, because it falls into an area where the platform is obviously making improvements. </p> <p>The only treatment I can think of is to surgically remove the tumorous code, i.e. to <i>refactor</i>. Unfortunately, refactoring has been over-promoted by the Agile community to the point where saying the R-word in front of management is politically incorrect which makes the disease really difficult to cure once it has developed. </p> <p>That leads to the question: Is this disease preventable? Theoretically speaking – yes. Since time bombs are explicitly checked in by developers, if developers don’t do it, there won’t be a problem, right? Well, that’s easier said than done. Whenever a performance benchmark misses its target, a hero will jump in to fix it, for which he/she will be properly rewarded. What makes such a time bomb difficult to remove is that one it has been proclaimed successful, no one will be willing to admit that its value has expired (sometimes even too quickly.) In general, we don’t understand that success in the software industry is something very temporary. </p> <p>There is a way, however, to be a hero now and to remain a hero even when a heroic fix turns bad. What’s even better is that you can be a hero (twice!) without infecting your product. When you do your original heroic fix, start with asking yourself: Is this part of my product’s value, or am I compensating for a platform’s deficiency? If you end up on the latter part, then code it in a way that makes it easily removable – avoid introducing public API at any cost; make the source file easily removable from the build; don’t let other code take dependencies on your fix that you haven’t envisioned; and most importantly - encode a switch that bypasses the new functionality. </p> <p>If you stop here, there will still be a problem when your fix becomes obsolete, but then you’ll be able to either flip the switch or remove the whole thing. Either way you’ll be a hero for a second time on the same problem! </p> <p>If you further make that switch a configuration setting so that flipping it doesn’t require a product change, a problem with your heroic fix may never occur. The only down side is you’ll miss being a hero for a second time on the same problem.</p> <p>In conclusion, I continue to promote “timeless” development among developers as well as necessary refactoring among management. Hopefully this article has made my points clear.</p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-41054580080240911422012-02-03T22:37:00.001-08:002012-03-13T23:22:50.113-07:00Free Chess Clock 0.4<p>This update introduces support for extra time per move – typically 5 seconds for recording the opponent’s move.</p> <p><strong><a href="https://docs.google.com/open?id=0B292DMDQEeWzYjY4MmM3ODktMjJjOC00NWIzLWE5NTctNmVhMjE3YmVhNDFk">DOWNLOAD</a></strong> the new version, and run it locally for best experience. Alternatively, you may use it <strong><a href="http://zlatko.michailov.org/p/freechessclock.html">online</a></strong>. </p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-50372452629044938172012-01-17T23:44:00.001-08:002012-01-19T13:03:04.685-08:00Interview about TPL Dataflow<p>When <a href="http://www.infoq.com/author/Jonathan-Allen">Jonathan Allen</a> of <a href="http://www.infoq.com">InfoQ</a> contacted me for an e-interview about <a href="http://msdn.microsoft.com/en-us/library/system.threading.tasks.dataflow(v=vs.110).aspx">TPL Dataflow</a>, I immediately searched InfoQ to see what content it had about <a href="http://www.infoq.com/tpl">TPL</a> and <a href="http://www.infoq.com/tpl-dataflow">TPL Dataflow</a>. Not only did I find content, but I found an <a href="http://www.infoq.com/news/2012/01/Custom-TPL-Blocks">article</a> Jonathan had written about my <a href="http://download.microsoft.com/download/1/6/1/1615555D-287C-4159-8491-8E5644C43CBA/Guide%20to%20Implementing%20Custom%20TPL%20Dataflow%20Blocks.pdf"><strong>Guide to Implementing Custom TPL Dataflow Blocks</strong></a>. </p> <p>So I did the <a href="http://www.infoq.com/news/2012/01/Zlatko-TPL"><strong>THE INTERVIEW</strong></a>. Hopefully you find my insights on TPL Dataflow useful.</p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-40247332320695799432011-12-30T22:05:00.001-08:002011-12-30T22:05:09.311-08:00About Me @ Microsoft (part III)<p>At the beginning of this month, December 2011, I joined <strong>SharePoint</strong> and more specifically its <strong>Developer Platform</strong> team. Our charter is the third-party application model in SharePoint. This is a very interesting domain. I am trying to get up-to-speed as fast as possible.</p> <p>I admit I was plain lucky to get this job. It happened after a series of accidents and involved several great managers to whom I am deeply indebted.</p> <p>I am eager to start contributing to SharePoint as a modern web development platform.  I am also planning to engage with the SharePoint developer community. I am already getting some rough ideas. Hopefully they will start taking shape soon [and I will not be embarrassed to  share them].</p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-62442484639021308252011-12-18T22:15:00.001-08:002011-12-18T22:15:48.978-08:00Free Chess Clock 0.3<p>This update adds mouse support to my HTML-based Free Chess Clock to make it suitable for keyboard-less devices like phones and tablets.</p> <p>You can try the new version <a href="/p/freechessclock.html"><strong>online</strong></a>, but you’ll have a better experience if you <a href="https://docs.google.com/open?id=0B292DMDQEeWzNDA5MmViNTgtYjlhNi00YmQ0LWJhYWYtNjI1M2Y0ZTQ1NGNl"><strong>DOWNLOAD</strong></a> the HTML page and run it locally.</p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-37414159206783548642011-11-26T23:52:00.001-08:002011-11-29T22:16:20.755-08:00My Bets on Scalable Databases<p>For those who don’t follow the database industry closely, here is the problem: Relational database servers clearly dominated the market for the last 15-20 years, but today they render inadequate for  <a href="http://en.wikipedia.org/wiki/Big_data">Big Data</a>. There are sectors of the industry where relational databases have never been able to perform - web indexing, bio research, etc. <a href="http://en.wikipedia.org/wiki/Mapreduce">MapReduce</a> has emerged to serve those sectors. While the MapReduce pattern is no match for SQL in terms of functionality, the distributed storage architecture on which MapReduce is based has a great potential for scalable processing. </p> <p>Now the question is: <strong>Which approach will produce a rich, yet scalable, data processing engine first?</strong> </p> <ul> <li>a) Enabling relational databases to operate over distributed storage, or </li> <li>b) Expanding the processing functionality over distributed storage? </li> </ul> <p>I bet on the latter approach:</p> <blockquote> <p>Scalable databases will emerge from distributed storage.</p> </blockquote> <p>It may seem that I am betting against the odds, because relational database vendors already have both the code and the people for the job. However, those codebases are about 20 years old and thus they are  barely modifiable. The assumption that data is locally, yet exclusively, available is spread out everywhere. So I don’t believe those codebases will be of much help. Even if database vendors abandon their existing codebases, and try to solely leverage their people to build a new data processing technology from scratch, there are ecosystems grown around those legacy database engines that will keep randomizing the development process and will hold back progress. So those developers will be much less efficient then developers who don’t have to deal with such a legacy baggage.</p> <p>If the above bet comes true, it will trail the following consequence:</p> <blockquote> <p>There will be new companies who will play significant roles in the database industry.</p></blockquote> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-61680872219719759312011-11-23T16:13:00.001-08:002011-11-23T22:07:01.047-08:00Rest in Peace, PFX<p>This is a milestone in my career at Microsoft that marks the end of <a href="http:/2010/02/about-me-microsoft-part-ii.html">About Me @ Microsoft (part II)</a>, but it doesn’t yet mark the beginning of “Part III”. Part III is unclear at this moment. (I hope there will be such a part). I should know more in about a week or two.</p> <p>Briefly, without disclosing any details: </p> <blockquote> <p>The PFX team (Parallel .NET Framework Extensions) no longer exists. </p> </blockquote> <p>By “the PFX team” I mean the people, not the products. The codebase still exists. There is another team that is chartered to maintain it, but no PFX developer is on that team. I don’t know what the future of those products will be, and I doubt there is anybody who knows that at this point. So please don’t ask me. I can only hope innovation in .NET parallelism will continue.</p> <p>Looking back, I feel lucky that I’ve had the rare chance to be part of the PFX team. The knowledge I’ve gained during these two years is priceless. I came with a few ideas I wanted to explore, and now I’m leaving with a lot more. </p> <p>While I’m sad about how abruptly things ended, I’m looking at it positively – it’s the trigger I needed to take the next step in my career. I am looking ahead empowered for new adventures. </p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0tag:blogger.com,1999:blog-2337605720475601257.post-47638712435788651032011-09-28T21:07:00.001-07:002011-09-28T21:12:05.481-07:00SQL# - First Draft<p>I recently drafted a specification of a new database language - SQL# (pronounced "es-kju-el sharp"). It is available on <a href="http://sqlsharp.zlatko.michailov.org">http://sqlsharp.zlatko.michailov.org</a> where I plan to publish future updates as well as samples and tools.</p> <p>As far as the name is concerned - I really like it despite of the problems the # sign creates for file names and URLs. This name doesn't seem to be used yet - neither <a href="http://www.google.com/#sclient=psy-ab&hl=en&source=hp&q=sql%23&pbx=1&oq=sql%23&aq=f&aqi=g4&aql=1&gs_sm=e&gs_upl=0l0l1l2290l0l0l0l0l0l0l0l0ll0l0&bav=on.2,or.r_gc.r_pw.&fp=8b39c7b95b72b1c1&biw=1553&bih=948">Google</a> nor <a href="http://www.bing.com/search?q=sql%23&go=&qs=n&sk=&sc=8-4&form=QBLH">Bing</a> find any literal matches. So until someone claims ownership of the name, SQL# it is.</p> <p>Where did this come from? The programmability of Transact-SQL has been a pin in my eye for more than 10 years. My previous creature, <a href="http://sourceforge.net/projects/zsql/">Z-SQL</a>, was a modest attempt to make T-SQL look and feel more like PL/SQL, but at the end of the day it was still SQL. I've grown to realize that the SQL legacy, in whatever flavor it comes, is what repells application developers. Even I started catching myself staring at seemingly valid SQL code that SQL Server was rejecting. When I realized I was writing in C# inside SQL Server Management Studio, I decided to take a more radical approach - to replace all the awkward SQL constructs with something that comes naturally - C#.</p> <p>Of course, there are constructs like the data manipulation statements, SELECT/INSERT/UPDATE/DELETE, that only exist in SQL and cannot be replaced. We'll have to live with those for now, but for a large set of commonly used constructs like object definitions, variable declarations, loops, cursor traversals, etc. there is no reason why we should continue suffering. On top of this I add one of my favorite C/C++ features that is unfortunately missing in C# - preprocessor directives. While I only provision a limited preprocessor functionality, I believe I have captured the key use cases.</p> <p>The most common question people have asked me is: Why SQL# when there is already LINQ? LINQ and SQL target two completely different classes of applications. I don't want to spark yet another discussion on which one is better. I would only say one doesn't exclude the other - LINQ did not (and will not) obsolete SQL especially in these times when the volumes of data organizations deal with grow faster than ever. Just like SQL made its way up to C# in the form of LINQ, I push C# down to SQL. I hope to find a similar reception from the SQL developer community.</p> <p>What are the next steps? At this point I am seeking feedback on the overall usefulness of SQL# as well as on individual features - either proposed or missing. I am in no rush to start implementing any tooling that translates SQL# to Transact-SQL at least not until I am confident I've captured the right feature set. Even then, I will be looking for volunteers to write a compiler, a language service, and other tools. My goal is to continue driving the specification forward and to create an ecosystem of tool vendors.</p> <p>So, if you are a SQL developer and you are interested in shifting your development experience in this direction, please read the spec and log your feedback here. It will be greatly appreciated.</p> Zlatko Michailovhttp://www.blogger.com/profile/03852147331967264725noreply@blogger.com0