Index ¦ Archives ¦ Atom ¦ RSS > Category: linux, programming, python

Nose - TDD - Python

What, why

I’ve been reading up on TDD and it has struck me as particularly useful methodology to achieve “clean code that works”. TDD encourages writing unit tests to cover all the code (because by definition, you write a test before a line of code is written). Because all ...


Selecting a random row from a table in mysql

database

I have come across more than one instance when I had to select a random record from a table in a MySQL database. Here is how to do it.

The simple but slow method

SELECT * FROM mytable ORDER BY RAND() LIMIT 1;

Although simple, the above query can be very ...

© Prashanth Ellina. Built using Pelican. Theme by Giulio Fidente on github.