Friday, 12 September 2014

Windows Script Host script to convert delimited file

As you all probably know, currently I’m writing some scripts in Jscript. Those can be runned using Script Host built in Windows. I prefer JScript more than Visual Basic. I hate Visual Basic at all.

So the script, I can just share with you is very simple and just converts one delimited file format to another. In my case it changes tab-separated to semicolon-separated fields.

Measuring command-line program execution time in Windows

As I’ve said in my previous post, I’ve written a script to work with text files and measured its execution time. Time of execution is very relative, but it is good enough to compare two tools on the same computer. So how to measure the script execution time? Maybe getting your stopwatch and trying to figure out when program starts and when it finis its work is not the best idea.

JavaScript inside the Windows Script Host performance

Some days ago my boss asked me to write a script to process some text files to another format. Just a little bit of regular expressions. Nothing serious. Normally I would do this probably in Perl, but he expected me to do it all in JavaScript to run inside a Windows Script Host.

Friday, 5 September 2014

Creating matrix of any size in Microsoft Equation Editor

I sometimes have to work with Microsoft Word Equation Editor. I cannot see very well from the peace of paper, so it’s easier for me to write equations using computer. There are a lot of shorthands that can accelerate work in the editor, but today I’m going to show you how to do something, which is hard to do with mouse. We are going to build a custom matrix.

Wednesday, 30 July 2014

Gethering full hierarchy from SQL Server table

Some time ago I’ve had to make some part of system, that uses hierarchical data stored in the database. Let’s imagine that we have an online store, which have products. That products points to one of categories. Our categories are organized as tree – creates hierarchy. The problem is, how to get all the products from category and all the subcategories in our hierarchy.