raspberry touch 7 inch rotate 90

if you want to rotate the display of your raspberry 7 inch touchscreen (with latest raspian) you need to do the following

  • install xinput sudo apt-get install xinput
  • get the name of your display xinput --list
  • flip your display xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 -1 1 1 0 0 0 0 1
  • add flipping to /boot/config.txt display_rotate=1 (for 90 degrees)
  • reboot

done!

mysql not problem

if you query a mysql database and ask for all rows that do not have a specific value in a specific field, you might expect to also get those rows where the field is null.
but this is not the case.
so if you want to get all rows you have to query all rows that do not have the specific value in this field or where this is field is null.

or in code

wrong:
select * from database where field not like '%value%'
right:
select * from database where field not like '%value%' or field is null

iframe cross browser communication

If you want the iframe of a site not of the same domain to transfer data to your parent site this is normally prohibited because of the potential security risk of cross domain access. So if you want to communicate you can send messages via javascript.
in iframe
$('.button').click(function(){window.top.postMessage('hello', '*');})
on parent site
window.onmessage = function(e){if (e.data == "hello") {alert('hello')}
this works the other way also.