Reactjs Fixed Data Table callback function onRowDoubleClick function

The callback function for onRowDoubleClick for Fixed data table.


rowClicked: function(event, rowIndex, rowData){
//code here
}
..

setting up nfs in debian stretch

On nfs server

#aptitude install nfs-kernel-server

Edit /etc/exports configuration file

/home/me/public 192.168.1.2(rw,no_root_squash,subtree_check)

Restart nfs

#exportfs -a
#/etc/init.d/nfs-kernel-server start

On nfs client

#aptitude install nfs-common
#/etc/init.d/nfs-common start

To list available nfs

#showmount -e 192.168.1.2

To mount nfs

#mount -t nfs /home/me/public /mnt/public

more info

Calculate distance between two point on earth in PostgreSQL

Come across nice function by Merlin Moncure posted on grokbase

CREATE OR REPLACE FUNCTION calculate_distance(lat1 float8, lon1 float8, lat2 float8, lon2 float8)
RETURNS float8 AS
$$
SELECT ACOS(SIN(RADIANS($1)) * SIN(RADIANS($3)) + COS(RADIANS($1)) * COS(RADIANS($3)) * COS(RADIANS($4) - RADIANS($2))) * 6371;
$$ LANGUAGE 'sql' IMMUTABLE;

More details

http://grokbase.com/t/postgresql/pgsql-general/1069rn3ca0/calculating-distance-between-longitude-and-latitude
http://www.movable-type.co.uk/scripts/latlong.html

Migrating from MySQL to PostgreSQL

Encounter some issue along the way

1.MySQL DATE_SUB & DATE_ADD

(DATE_ADD(NOW(), INTERVAL 30 MINUTES)

(DATE_SUB(NOW(), INTERVAL 30 MINUTES)

(NOW() – INTERVAL ’30’ MINUTE)

(NOW() – INTERVAL ’30’ MINUTE) or

(NOW() – INTERVAL ’30 MINUTES’) or

(NOW() – ’30 MINUTES’::INTERVAL)

2. MySQL RADIANS

Need to cast to real

SELECT RADIANS(lat::real);

3. DISTINCT on json field (v9.4.5)


SELECT DISTINCT id, json_field FROM driver;

Throw could not identify an equality operator for type json error.
Converting the json field to jsonb solve the problem

Install mysql 5.6 in debian 8 jessie

The replication performance leap from MySQL 5.5 to MySQL 5.6 is more than 4x.

https://blogs.oracle.com/MySQL/entry/mysql_5_6_replication_performance

#wget http://dev.mysql.com/get/mysql-apt-config_0.3.5-1debian8_all.deb
#dpkg -i mysql-apt-config_0.3.5-1debian7_all.deb
#apt-get update
#apt-get install mysql-community-server

More info