Friday, March 16, 2012

Dartium for Windows Download : Chrome browser with native Dart-Language VM for Windows Released

Dartium for Windows Released : Initial Version Available

Chromium (Chrome) Browser with Native Dart-Language Virtual Machine (VM)

I have been anxiously awaiting Google's new Dartium for Windows browser, their version of Chrome that includes support for their new Dart Language — a very enticing alternative to JavaScript that is under heavy development now. Although you could previously run Dart-based scripts through the Dart-to-JavaScript interpreter/converter/compiler, there are obvious substantial benefits to having a Dart-language VM built right into the browser.

Downloading and Installing Dartium Browser

Note: I have done the following on Microsoft Windows-7 x64.

The first publicly available version was posted online today in this Dartium continuous-build directory. You will see a file named: "dartium-win.zip"; download that and make sure you have 7-Zip (file archiver) available to open the archive and extract the files.

When you open the .ZIP archive, you will see it contains another archive named "chrome.7z" which you will open. This file contains a single directory named "Chrome-bin". Open that directory in 7-zip to reveal the following files/directories:

Now, I suggest creating a directory on your computer where you want to run this from, perhaps something like "C:\Dart\Dartium". From 7-Zip, grab the contents (the files/dirs) shown in the image above, and drag them into your new Dartium directory. You should be done with 7-zip now.
Before you get too excited about running Dartium, you will probably find that it has issues (unless they have been resolved since I wrote this)...

Dartium Windows Installation Bug / Errors (as of 3-16-2012)

One of the first things I encountered when trying to run Dartium, by clicking on the Chrome.exe file in my new Dartium directory, is that nothing happens! There is no sign that the program even attempted to run. But, if you look at the debug.log file it creates in that directory, you may find errors like this:

[0316/124628:ERROR:client_util.cc(397)] Could not get Chrome DLL version.
[0316/124628:ERROR:client_util.cc(434)] Could not find exported function RelaunchChromeBrowserWithNewCommandLineIfNeeded

So, what is causing this? Well, I got sorta lucky in my first guess. Fixing this turns out to be rather easy. Just copy the chrome.exe file to the C:\Dart\Dartium\19.0.1071.0 subdirectory, and launch chrome.exe (aka, "Dartium") from there! That should fix the problem and you should see Dartium launch as expected.

Next, you may experience the same thing I did whereby Dartium crashed within moments of running the first time. But, re-launching Dartium resulted in a stable browsing experience so far, and I was able to test out some HTML Pages that used Dart-language scripts (instead of JavaScript!) just fine. You include such scripts like this:

<script type="application/dart" src="Clock.dart">

Which brings me to the most exciting part...

Dart, the programming Language

Although I use JavaScript quite a bit, I have felt constrained by the language and perpetually frustrated by the lack of solid OOP (object-oriented programming) features and robust libraries. And, before anyone corrects me, yes, I realize I can accomplish all sorts of OOP (or OOP-like) stuff in JavaScript using prototypal inheritance, closures, etc, but it still simply sucks compared to a real OOP language like Delphi or C#. Well, Dart is here to finally give me a real in-browser OOP scripting language with strong typing and much more, and available NOW.

I am so utterly sick of waiting for the JavaScript purists and boffins to quit arguing what is the best way to implement "syntactic sugar" for things like classes, and having to read spaghetti-code JavaScript with piles of prototype-based "inheritance", and now Dart may deliver me from this evil! Of course these same JS boffins are already trying to discredit any attempt to replace JavaScript with anything that they did not invent, even as the participants from Microsoft, Mozilla, Safari, and Webkit camps make barely a snail's pace march toward "JavaScript.next" or "JS Harmony" or whatever other half-baked next-generation Javascript standard is to be.

Well, such is... if I have to write applications that ONLY run in Chrome/Chromium/Dartium, so be it. I am rather sure I can convince any of my business-software users to install whatever browser is needed, especially when I tell them how I can build the same functionality in less time, and for less money, than it would otherwise cost to develop in JavaScript. Oh, and let's talk about how much easier this code is going to be to maintain — a lot! (based on experience working with other real OOP languages as compared to JScript). This is what is going to make Dart a success. when businesses figure out there is money to be saved by using Dart vs. Javascript, the rest will take care of itself as developers start migrating to Dart. And, I expect that server-side Dart will make a lot of sense too!

Note: I am not saying that Dart is the end of JavaScript. I guarantee JS will be around for a LONG time, as there is a huge installed based of JS code out there, and a lot of developers that work with it. But, that fact alone is not going to keep Dart from becoming an accepted language for web-development. Browser vendors that ultimately refuse to adopt a common Dart-VM may find themselves in the same position Microsoft does now as people migrate from Windows desktop applications to HTML5/CSS3 web-based alternatives running on many devices (and not just those running their proprietary Windows OS).

Now, it is time for me to get back to writing some Dart-based code for some web-applications I am working on. I will be following the Dart-language and Dartium progress closely, and I hope to post some additional articles on here with Dart-programming examples in the future.

Monday, March 12, 2012

SQL-Server 2012 New Features of Interest : Newest Microsoft RDMS

Microsoft SQL-Server 2012 New Features

SQL-Server 2012 Upgrades and Enhancements of Note

As any of my tech-blog readers know, I am a huge fan of Microsoft SQL-Server for my own database applications as well as for software I develop for others.  And, it is that time again: a major update of SQL-Server is available and I am busy upgrading my existing databases while also experimenting with the latest features that SQL 2012 has to offer.

Microsoft SQL-Server 2012 continues the SQL-Server line of enterprise-class databases by extending the SQL Server 2008 & 2008R2 through additional modern features and functionality, including the following items that I considered noteworthy enough to mention here (*Note: keep in mind that some features may not be available in all versions of the product):

  • New and enhanced spatial features — this is a significant evolution of spatial data support in SQL Server including support for full globe spatial objects and for circular arcs on the ellipsoid.
  • FileTables — extends FILESTREAM technology and allows you to now store files and documents in special tables in SQL Server, but access them from Windows applications as if they were stored in the file system, without making any changes to the Windows applications. File and directory data is exposed through a Windows share.
  • Sequences — these should be familiar (in concept) to anyone that has worked with Oracle. A sequence object is a user-defined schema-bound object that generates a sequence of numeric values according to the specification with which the sequence was created. It operates similar to an identity column, but sequence numbers are not restricted to use in a single table.
  • Statistical Semantic Search — provides deep insight into unstructured documents stored in SQL Server databases by extracting statistically relevant key phrases (allowing you to query the meaning of a document);
  • Full-Text Search has new abilities for property-scoped searching and customized proximity searches;
  • Availability Enhancements including AlwaysOn SQL Server Failover Cluster Instances, AlwaysOn Availability Groups and enhancements to Online Operations for online index builds (where index columns contain LOB data);
  • Scalability and Performance Enhancements including a new data warehouse query acceleration feature based on a new type of index called the columnstore;
  • SQL Server Express LocalDB — a new lightweight edition of Express that has all its programmability features
  • New built-in T-SQL functions: Conversion functions now include PARSE, TRY_PARSE, TRY_CONVERT; Date and time functions now include DATEFROMPARTS, DATETIME2FROMPARTS, DATETIMEFROMPARTS, DATETIMEOFFSETFROMPARTS, EOMONTH, SMALLDATETIMEFROMPARTS, TIMEFROMPARTS; Logical functions now include CHOOSE (gets item at the specified index from a list of values), IIF (a shorthand if-then construct already common in other languages); and String functions now include CONCAT and FORMAT;
  • ORDER BY clause improvements using OFFSET and FETCH (limit result set rows to a range) — this feature should come in very handy for all sorts of ad-hoc queries and/or web-applications that implement "paging" through data! Finally, less custom-code for this!
  • THROW statement can be used to raise an exception and transfer execution to a CATCH block of a TRY…CATCH construct;
  • OVER clause has been extended to support window functions which will reduce the need for custom code to compute things like moving averages or cummulative totals;
  • additional analytic functions like: FIRST_VALUE, LAST_VALUE, , LAG (previous rows access without self-JOIN), LEAD (subsequent rows access without self-JOIN), CUME_DIST, PERCENTILE_CONT, PERCENTILE_DISC, PERCENT_RANK
  • EXECUTE statement can now specify the metadata returned from the statement by using the WITH RESULT SETS argument;
  • New and Enhanced Query Optimizer Hints: FORCESEEK includes further options and a new FORCESCAN hint;
  • ...and more.
I really look forward to putting some of the new programming features to use! The windowing enhancements to the OVER clause are very interesting to me, since I have previously written custom code to perform moving-averages, running subtotals, and other interesting algorithms that should now be MUCH easier to implement using the new abilities of the OVER clause.

If you happen to need "windowing" functions but are unable to upgrade to SQL-Server 2012, search this blog for my source code for SQL-Server for moving-averages, running-subtotals, and so on: implemented as pure SET-BASED algorithms too!!

I have not yet tried the LocalDB version of SQL-Server 2012, but I definitely can think up some uses for it.  And, it's free, which is always a good thing, though it does have somewhat low limits for memory and total database size.

Breaking Changes in SQL-Server 2012

As with any major version upgrade, there is the potential for "breaking changes" that will affect your existing SQL-Server code base (Transact-SQL) and/or your database designs, options, and the like. Obsolete features are the most critical, but you should also consider deprecated features, since it is much easier to get ahead of the curve with regards to planning for future releases.

  • Native XML Web Services (SOAP/HTTP endpoints) is Removed;
  • Finally! ANSI JOIN syntax is required! No more "*= and =*" join syntax, which hopefully you migrated away from years ago;
  • FASTFIRSTROW (query hint) is replaced with OPTION (FAST n);
  • COMPUTE / COMPUTE BY (T-SQL) — use ROLLUP instead;
  • SET ROWCOUNT for INSERT, UPDATE, and DELETE statements are deprecated and will not be supported in the next version of SQL-Server. Use the TOP keyword instead;
  • And a host of other changes — See the Microsoft SQL-Server 2012 Backward Compatibility site for details;

Enjoy the new SQL-Server 2012 features! Download the free trial editions and/or consider the Developer version once it is available.

Microsoft Windows 7 Will Not Enter Sleep Mode : Find out Why

Windows 7 Not Going to Sleep when Idle

Determining What Applications are the Cause

I recently ran into a situation where my Windows 7 Ultimate x64 desktop computer appeared to be randomly not going into sleep mode when there was no activity. Normally, my system would enter sleep mode when idle for 30 minutes per the power settings I had specified through Control Panel / Power Options / Edit Plan Settings / Put the Computer to Sleep : 30 minutes.

But, somewhere along the line, something had apparently changed on my computer in a way that prevented the computer from going to sleep. Windows 7 had always entered sleep mode predictably before, so what happened? Luckily, this is pretty easy to figure out thanks to a command-line tool called powercfg.

Running the powercfg tool

You will want to open up a command prompt as an administrator. From the Windows Start menu, you can select "All Programs" and navigate to Accessories from within which you can choose "Command Prompt" and right-click and select "Run as Administrator". Once the command line interface / terminal-window appears, just type: powercfg /requests.

You should see output like the following, with various categories (DISPLAY, SYSTEM, AWAYMODE) under which any offending items will appear.


c:\>powercfg /requests
DISPLAY:
None.

SYSTEM:

[DRIVER] \FileSystem\rdbss
A file has been opened across the network. File name: [\NASDEVICE\VSS\data\loggedin\usernamehere.log] Process ID: [4388]

AWAYMODE:
None.


It turned out that my Windows 7 system was not going to sleep because of the fact "A file has been opened across the network". Instantly I knew what the issue was: the output of the powercfg command clearly identified the offending file(s), which I recognized as belonging to my VSS (Visual SourceSafe) version-control application.

Simple enough, right?

The funny thing was that I had been using VSS for ages on this particular Windows7 desktop, but I must not have left it running in the evening before, and thus never noticed that it prevented Windows from entering sleep mode.  Now I know, and now I make sure to close the VSS UI every evening if I plan to leave my computer turned on with the intention of it going to sleep properly and as expected.