Codility And Candiate Testing: Still Sucks

September 15th, 2016

Previously: Codility And Candiate Testing

I recently applied to another position which involved Codility testing. This time around, the questions were some sort of array split, a binary positive to negative number flip, and a knight position move algorithm.

Since my last write-up, Codility has made some good improvements to their UI. The code editor is much better than it was.

The rest of my beef still remains though.

Codility is not a good measure of a programmer, and it’s a great way to filter out good candidates such as myself. (I have 15 years using PHP. Hire me? )

99% of the work I do doesn’t involve anything even close to an algorithm, so the only reason for me to learn them would be to pass screening tests. That doesn’t really seem like something useful, does it?

Read a CSV file into columns

May 6th, 2016

This command will read a CSV file, and display it as columns. This also works on Windows if you have Cygwin installed.

column -t -s"," test.csv

Example CSV columns

MySQL Dump And Restore Database Table With Compression

August 30th, 2014

mysqldump --no-create-info -uxxxx -pxxxx Database ATable | gzip -9 > xxxx.sql.gz

zcat xxxx.sql.gz | mysql -uxxxx -pxxxx Database

Setting Up Zend Framework 2 Autoloader

May 13th, 2014

If you’re like me, you like to dig into the belly of things and twist them to your own uses. Tonight, I’ve been monkeying around with ZF2 autoloaders, and working out how they function.

I store my ZF install in a dir (Zend/) in my include path, so I don’t have to maintain copies for each site on my server.

Some useful notes on this:

The stock ZF2 download does not include a pre-generated classmap file. To generate this, go into the default unpacked archive folder, into bin/ and run this command:

php classmap_generator.php -l "/usr/share/php/Zend/"

[code language=”php”]
// How to get an absolute path to the generated classmap file (return: /usr/share/php/Zend/autoload_classmap.php)
$classmapPath = stream_resolve_include_path(‘Zend/autoload_classmap.php’);

// How to get the autoload up and running
require_once ‘Zend/Loader/ClassMapAutoloader.php’;
$autoloader = new Zend\Loader\ClassMapAutoloader();
$autoloader->registerAutoloadMap($classmapPath);
$autoloader->register();
[/code]

That’s all for tonight folks!

Find MySQL Foreign Keys

January 9th, 2014

Sometimes you need a quick way to find out what foreign key is blocking your action.

[code]SELECT
CONCAT(table_name, ‘.’, column_name) AS ‘foreign key’,
CONCAT(referenced_table_name, ‘.’, referenced_column_name) AS ‘references’
FROM information_schema.key_column_usage
WHERE referenced_table_name IS NOT NULL;[/code]

http://www.conandalton.net/2008/09/list-foreign-key-constraints-in-oracle.html

WordPress - Entries (RSS) and Comments (RSS) - © 2011 Ben Dauphinee