Rakudo Star is the first usable Perl 6 distribution

July 30th, 2010 Michael Stepanov No comments

Yesterday the first Perl 6 distribution was released. It’s named Rakudo Star:

Rakudo Star is aimed at “early adopters” of Perl 6. We know that it still has some bugs, it is far slower than it ought to be, and there are some advanced pieces of the Perl 6 language specification that aren’t implemented yet. But Rakudo Perl 6 in its current form is also proving to be viable (and fun) for developing applications and exploring a great new language. These “Star” releases are intended to make Perl 6 more widely available to programmers, grow the Perl 6 codebase, and gain additional end-user feedback about the Perl 6 language and Rakudo’s implementation of it.

If you’re interested to play with Perl 6 practically you may download the Rakudo Star here. Sure it isn’t stable and cannot be used in the real projects. But as the first step to Perl 6 it looks perfect.

Categories: Perl Stuff Tags: ,

Free nature sounds

July 28th, 2010 Michael Stepanov No comments

Image

If you like nature sound that service might be interesting for you. It offers a possibility mix four different tracks – sounds of beach, fire, rain or something else (not vuvusella, thanks God!) and save the result as a link to share with fiends or store it into file.

[via Unplggd]

Song about my favourite football club Zenit

July 13th, 2010 Michael Stepanov 2 comments

Today will be the St Petersburg derby for last 10 years. Zenit will play with Dinamo Spb in 1/16 stage of Russian Cup. Should amazing game!

Categories: Interesting, Personal Tags: , , ,

New Aston Villa shirts with FxPro logo on the front

July 13th, 2010 Michael Stepanov No comments

Aston Willa and FxPro

Aston Villa players started coaching in the new blackcurrant training kit with FxPro logo on the front. I like it as a FxPro employee and fan of English Premier League :) Waiting for the possibility to get a new Aston Villa shirt.

[via Aston Villa site]

Categories: Interesting Tags: , ,

World Cup 2010 is finished

July 13th, 2010 Michael Stepanov No comments

World Cup 2010

World Cup 2010 in the South Africa is finished. I watched and enjoyed almost all games. It was a great occasion for all football fans around the world! one month of hight quality football! I’ll miss it. At least till the middle of August when new European competitions will start – English Premier League, Bundesliga and Champions League.

If you’d like to refresh World Cup 2010 events in your memory have a look that fabulous photo set.

Categories: Interesting, Personal Tags: ,

Installation of Oracle client to Ubuntu 10.04 Lucid

June 2nd, 2010 Michael Stepanov 1 comment

Recently I moved from Fedora 13 to Ubuntu 10.04 on my work laptop. So, I faced again with problem to setup Oracle PHP interface. Oracle provides RPMs only and not DEBs. So, to install the client RPMs should be converted to the DEBs. It can be done easily using utility alien:

sudo alien oracle-instantclient11.1-basic-11.1.0.7.0-1.i386.rpm
sudo alien oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm
sudo alien oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.i386.rpm

They can be installed then with sudo dpkg -i.
Don’t forget to install PHP interface to Oracle:

sudo pear install pecl/oci8

That’s it. I spent no more 15 minutes to setup PHP Oracle interface under Ubuntu. Thanks to that post!

Categories: Linux, PHP Tags: , , ,

Export result of query from mysql console to CSV file

April 13th, 2010 Michael Stepanov 2 comments

Sure all GUI DB tools can do export of result of query into CSV file. But what if you have to do this from command line? There is a simple way perform that task. Here is an example:

SELECT *
INTO OUTFILE ‘/tmp/products.csv’
FIELDS TERMINATED BY ‘,’
ENCLOSED BY ‘”‘
ESCAPED BY ‘\’
LINES TERMINATED BY ‘\n’
FROM products

When you run that query all records from the table products will be dumped into file /tmp/products.csv. All fields of that dump will be delimited by comma, enclosed by double quotes and escaped by two slashes. Each row will be ended by end of the line character.

Sure you can change delimiter, enclose, escape symbols as well as add any others SQL statements such JOIN, WHERE, LIMIT ORDER etc. Enjoy!

UPDATED: Don’t forget to drop the export file before re-export data. Otherwise you’ll get the error:

ERROR 1086 (HY000): File ‘/tmp/products.csv’ already exists

[via Electrictoolbox]

Trick with variable name transformation in CakePHP

February 26th, 2010 Michael Stepanov No comments

CakePHP is a good PHP MVC framework. You can study it easily and start developing web sites very fast. But it has some disadvantages, of course. One of them is strange rules for transformation variable name when it set in the controller. Statement

$my_var = 'Hello world!';
$this->set('my_var', $my_var);

will make the variable $my_var accessible in your view:
<?php echo $my_var; ?>
The phrase ‘Hello world!’ should appear on the web page. But if the same operation is done using function compact, the result is not predictable:
$my_var = 'Hello world!';
$this->set(compact('my_var'));

Instead of ‘Hello world!’ you’ll see the warning about undefined variable on your web page. It happens because cakePHP removes underscore and makes letter, followed by it, capital. So, instead of $my_var you should use $myVar in the view:
<?php echo $myVar; ?>

Note that this bug appears in the cakePHP version 1.2. It’s already fixed in the 1.3.

Categories: PHP Tags: , , ,
Get Adobe Flash playerPlugin by wpburn.com wordpress themes