Wednesday, April 22, 2009

Oracle buys Sun !!

OK, I think you already know this. But it's not the news I'm talking about. I'm talking about the implications.

I did not use Java technology a lot, I admire it, but I cannot consider myself as a Java developer. However, having Java technology in our world and it's competition with Microsoft's .net framework is a healthy thing. It gives us options.
Some Java developers were worried after news about the deal has spread. I think that Oracle + Java has been and will stay a good choice to build enterprise applications. Maybe the future will carry news about better and better RIA applications built with Java platform.

What I really care about and made me worried is the future of MySQL, which is the most popular open source database that has a free community edition.
How is this related to MySQL? Here is the story:

MySQL has a pluggable database engine architecture. So it has many database engines to choose from, and you deal with them all using the same SQL dialect.
One famous engine is the InnoDB engine, which is transactional and high performance database engine that was widely used by MySQL users. InnoDB was developed by Innobase, a Finnish company.
Oracle acquired Innobase, which caused worries about the future of the transactional engine. Sun bought MySQL. And MySQL released the Falcon storage engine.

Now, what is the future of MySQL under the control of Oracle, the database giant? The problem is not only that Oracle may kill MySQL gradually (I think it won't do it directly). But is that MySQL engineers started to leave Sun after Oracle's deal. (more about this in this article).

So. Big fishes eat small fishes. It's the turn of open source advocates and MySQL users to have their word.

Saturday, April 18, 2009

Calling a PowerShell script in a path with a white space from command line

I stuck in this problem once, so here is a solution in case you face it.
First, how to call a script from PowerShell console when the script file path contains white space? because executing this:
PS C:\> c:\new folder\myscript.ps1 param1
will give this error:
The term 'c:\new' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.

Putting the path between quotations like this:
PS C:\> "c:\new folder\myscript.ps1" param1
Will lead to:
Unexpected token 'param1' in expression or statement.

And the solution is to use the Invoke Operator "&", which is used to run script blocks
PS C:\> & 'c:\new folder\myscript.ps1' param1

So farm so good. Now coming to the next part which is calling this from command line.
Executing a PowerShell script from command line is as easy as:
C:\Documents and Settings\Hesham>powershell c:\MyScript.ps1 param1

This is fine as long as the script path has no spaces. For example, executing:
C:\Documents and Settings\Hesham>powershell c:\new folder\MyScript.ps1 param1
Again gives:
The term 'c:\new' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.

With the help of PowerShell -?, here is a solution:
C:\Documents and Settings\Hesham>powershell -command "& {&'c:\new folder\MyScript.ps1' param1}"