Apr 13, 2017

SQLite: showing a random record from a table

Random record

If many occasion developer want to get a random record(s) from a table, because they are programming a quizz, or a game - it turns out there is no native instructions for that in SQLite
but you can use this workaround:

*, random() as R
FROM Table

Why it works

It insert a random number (R) for each record and then using the order by there is going to be a selection of the smaller number (R)  - you can even change the LIMIT to get more than one record - let say 3

SELECT *, random() as R FROM Table ORDER BY R LIMIT 3 ;

Mar 30, 2017

Seamonkey: How to watch Youtube video the old fashion way

Youtube is now using html5

This is great obviously, because it means by default the internet browser doesn't need any plugin.
But let say you want to read your video the old fashion way using adobe Flash
well you actually can ... just by adding the url &nohtml5=1

for example:

This will open the video and use adobe flash (instead of html5)
if you are not sure - just right click on the video and you should see this:

Seamonkey: Enabling full-screen for Youtube video

Seamonkey default settings

For some reasons the internet browser Seamonkey decided to prevent people to open full screen YouTube video - maybe they were tired of complaints of user who couldn't not exit the video (by simply pressing Escape?!)

Anyway now by default the full-screen button on the lower-right is disabled.

Overriding the setting

in the url path type: about:config then confirm that you know what you are doing
then look for full-screen-api.enabled and set this to true

That is it


Related Posts Plugin for WordPress, Blogger...