Can the power of a human swarm find the missing plane flight MH370?

Can the human swarm find this plane?
This is not meant to be politically incorrect and something I put together in a short timeframe using Google Cloud (never used it before).

S16.03.28

The familiar map shown on the news channels

The human swarm is a powerful thing but this exercise is limited due to the amount of information and the not really knowing whay goes on in the head of the person(s) who manually took charge of the plane. Anyway, who knows.

Where do the public think this plane is?

Where do the public think this plane is?

Maybe put your mark on the map. Just captures the Longitude and lattitude of where you think the plane may be (oh and your IP address to avoid attacks).

Please though, if you have a go, think about all you have read and heard so far, weigh it up in your head and click where you think it will be.

The results page will get updated when I get round to it. (I was using new tech and had little time for this exercise so please bear with me).

Find MH370

Code

index.html

This is the landing page. Note the array (waypoints) which are easily updatable. I included the last known transmission point, the aircraft range (before it could run out of fuel) and the debris – a small white spot outside the range circle. So if the plane was high up and cruised down on no fuel it is conceivable the debris is where it is.

<html lang="en">
<head>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
</head>
<body>
  <div class='main'>
  <style type="text/css">
  .eventtext {width:600px; margin-top:20px; font:10pt Arial; text-align:left; line-height:25px; background-color:#EDF4F8;
   padding:5px; border:1px dashed #C2DAE7;}
  #coodiv {width:600px; margin-left:5px;height:800px; border:5px solid #DEEBF2;}
  #mapdiv {width:600px; height:800px; border:5px solid #DEEBF2;}
  ul {font:10pt arial; margin-left:0px; padding:5px;}
  li {margin-left:0px; padding:5px; list-style-type:decimal;}
  .small {font:9pt arial; color:gray; padding:2px; }
  #latlongclicked {width:600px; border:1px inset gray;}
  </style>
<div>
  <h2>Missing plane MH370 - please click where you think it is   - So far:<A href="http://23.251.144.208/sofar.html">Results</A></h2>
<div style="float:left; position:relative;" id="mapdiv"></div>
<div style="float:left; position:relative;" id="coodiv">ddd</div>
<div class="eventtext">
<div>Latitude: <span id="latspan"></span></div>
<div>Longitude: <span id="lngspan"></span></div>
<div>Lat Lng on click:
  <input type="text" id="latlongclicked"></span></div>
</div>
</div>
<script>
var map
var waypoints = {};
waypoints['lasttransmission'] = {center: new google.maps.LatLng(5.536277,102.19834),sz:5000000,clr:'#ff0000'};
waypoints['range'] = {center: new google.maps.LatLng(5.536277,102.19834),sz:40000,clr:'#00FF00'};
waypoints['debris'] = {center: new google.maps.LatLng(-43.942778,90.959444),sz:60000,clr:'#FFFFF0'};

function mapa()
{
    var opts = {'center': new google.maps.LatLng(5.536277,102.19834),
    'zoom':3, 'mapTypeId': google.maps.MapTypeId.HYBRID }
    map = new google.maps.Map(document.getElementById('mapdiv'),opts);
    google.maps.event.addListener(map,'click',function(event) {
      document.getElementById('latlongclicked').value = event.latLng.lat() + ', ' + event.latLng.lng()
      var objData = {};
      objData.lg=event.latLng.lng()
      objData.lt=event.latLng.lat();
      $.ajax({
        url: 'plane.php',
        type: 'POST',
        data: objData,
        dataType: 'json',
        success: function(data,status){}, 
        error: function(response){}
      })
        window.location.href = "sofar.html";
    });

    for (var wp in waypoints) {
        var wpOptions = {strokeColor: waypoints[wp].clr,strokeOpacity: 0.5,strokeWeight: 2,fillColor: waypoints[wp].clr,
        fillOpacity: 0.1,map: map,center: waypoints[wp].center,radius:waypoints[wp].sz,clickable: false
        };
        wpCircle = new google.maps.Circle(wpOptions);
    }
    google.maps.event.addListener(map,'mousemove',function(event) {
       document.getElementById('latspan').innerHTML = event.latLng.lat()
       document.getElementById('lngspan').innerHTML = event.latLng.lng()
    });
}
window.onload = mapa
$( "#coodiv" ).load( "thedetails.html" );
</script>
</body></html>

results.html

Would not recommend making this a public file as it could kill the database if loads of results come in and they are shown to each user each time they click the map. This is used to generate an image that can be updated hourly. Actually, it didn’t really matter as people didn’t really take up the swarm phenomena in this case and there was only about 30 hits in 24 hours.

<html lang="en">
<head>
<script  src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
</head>
<body>
<div class='main'>
<style type="text/css">
.eventtext {width:100%; margin-top:20px; font:10pt Arial; text-align:left; line-height:25px; background-color:#EDF4F8;
padding:5px; border:1px dashed #C2DAE7;}
#mapdiv {width:600px; height:800px; border:5px solid #DEEBF2;}
ul {font:10pt arial; margin-left:0px; padding:5px;}
li {margin-left:0px; padding:5px; list-style-type:decimal;}
.small {font:9pt arial; color:gray; padding:2px; }
#latlongclicked {width:600px; border:1px inset gray;}
</style>
 <div id="mapdiv"></div>
<script>
var map
function mapa()
{
   var opts = {'center': new google.maps.LatLng(5.536277,102.19834),
   'zoom':3, 'mapTypeId': google.maps.MapTypeId.HYBRID }
   map = new google.maps.Map(document.getElementById('mapdiv'),opts);
   $.getJSON('mapdata.php', function(data) {
     $.each(data, function(index, element) {
        new google.maps.Marker({
          map: map,
          position: new google.maps.LatLng(element.lat,element.lon)
        });
      });
   });
}
window.onload = mapa
</script>
</body>
</html>

sofar.html

This page displays a graphic of the preloaded markers as a png. This way the database is not beaten to death. sofar.html gets loaded as the result of the user clicking the map. Note in the configuration of the markers, clickable=false was set. By default the marker would be responsive to a mouse click. Since the big aircraft range marker spanned a diameter if thousands of miles, it would mean the mousemove event would not fire due to being obscured by the giant opaque marker.

<html lang="en">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<div class='main'>
<style type="text/css">
.eventtext {width:600px; margin-top:20px; font:10pt Arial; text-align:left; line-height:25px; background-color:#EDF4F8;
padding:5px; border:1px dashed #C2DAE7;}
#coodiv {width:600px; margin-left:5px;height:600px; border:5px solid #DEEBF2;}
#mapdiv {width:600px; height:600px; border:5px solid #DEEBF2;}
ul {font:10pt arial; margin-left:0px; padding:5px;}
li {margin-left:0px; padding:5px; list-style-type:decimal;}
.small {font:9pt arial; color:gray; padding:2px; }
#latlongclicked {width:600px; border:1px inset gray;}
</style>
<div>
<h2>Missing plane MH370 - where the public thinks it is</h2>
<div style="float:left; position:relative;"   id="mapdiv">
<img src="sc.png" >
</div>
<div style="float:left; position:relative;"  id="coodiv">At 2014-03-20 09:40 GMT</br>If you just added a location then thanks for your input. If you did not yet do it please go here <a href="http://23.251.144.208/index.php">Here</a> and click on the map.</br>Please come back to http://23.251.144.208/sofar.php for updates</div>
<script>
$( "#coodiv" ).load( "thankyou.html" );
</script>
</body></html>

Database schema

CREATE TABLE `swarm` (
  `ipaddr_r` char(45) NOT NULL,
  `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `lon` double NOT NULL,
  `lat` double NOT NULL,
  `ipaddr_p` char(45) NOT NULL,
  UNIQUE KEY `ipaddr` (`ipaddr_r`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

plane.php

We catch the ip address of the person who clicked and this is stored as a unique key.
When the code is executed it deletes any previous record of the click from that IP, if it exists.
A new row is added with unique IP. Doing it this way helps prevent someone spamming the database (unless they spoof a different IP each time) and also gives the user a chance to change their mind and replace their existing thought.

<?php
include 'connectinfo.php';
$lg = $mysqli -> real_escape_string($_POST['lg']);
$lt = $mysqli -> real_escape_string($_POST['lt']);
$ipp=$_SERVER['HTTP_X_FORWARDED_FOR'];
$ipr=$_SERVER['REMOTE_ADDR'];
if (strlen($ipp) == 0)$ipp="--"; // not always going to get this but db constraint is not blank
//record all in a temp file - not for production!
 file_put_contents("/tmp/allplane.txt", "planedata: IPP=$ipp IPR=$ipr $lg $lt",FILE_APPEND);

 if ($delete_stmt = $mysqli -> prepare("DELETE FROM swarm WHERE ipaddr_r = ?")){
   $delete_stmt -> bind_param('s',$ipr);
 if ($delete_stmt -> execute()) ; // handle good
   else ; // handle bad. No handlers were put in this code
}	       
	       
if ($insert_stmt = $mysqli -> prepare("INSERT INTO swarm(ipaddr_r,ipaddr_p,lon,lat) VALUES (?,?,?,?)")){
		$insert_stmt -> bind_param('ssss',$ipr, $ipp, $lg,$lt);
 		if ($insert_stmt -> execute()) ; // good				   
        else ;// do something with $insert_stmt -> error maybe
} else 
    ; // do something with $insert_stmt -> error;
echo "OK"; // as it stands the form does not get back valid data so the POST will raise an error but you don't see that
?>

mapdata.php

This tiny php file gets a json array of longitude and latitude points from the map.

<?php
include 'connectinfo.php';
$query = "SELECT lon,lat FROM swarm"; 
$result = $mysqli -> query($query);
for ($set = array (); $row = $result->fetch_assoc(); $set[] = $row);

  echo json_encode($set);
/* free result set */
$result -> free();

/* close connection */
$mysqli -> close();
?>

Notes

Not going to go into details about whats in connectinfo.php because how to connect to a mysql db is all over the internet.

Disclaimer

This is not production quality and was done in lightening speed on a small google vm instance and a separate SQL server in google’s cloud.
I’d never used google before for cloud stuff so had to learn a few things. I’ve used Amazon AWS before which is also good but I think google is my platform of choice and learned a lot from this exercise.

Leave a Comment

Ford Insure – a cycle of negligence and risk

November 2011:

I insured my brand new Kuga with Ford Insure.

19th January 2012:

Stopped by police on M6 for “having no insurance”. The car was to be taken by the police unless I can get an insurance policy set up there and then. Ford Insure denied to the police officer any claim that I made previous insurance arrangements with them but agreed with me to set up a policy road-side which the officer verified before I could leave. I was handed a ticket for having no insurance!

On completion of my journey I contacted Ford Insure who continued to deny me ever taking up a policy but agreeing that I had spoken to them but not followed through with the insurance on the phone. I knew I had and so requested under the terms of the Data Protection Act for them to provide me a copy of every conversation with their staff in relation to the insurance of the named vehicle. 

23rd January 2012: 

A letter arrived.

Reference: RSAP6719753200 from Tom Bailey, Technical Customer Manager “To whom it may concern” to quote, “we would have honoured our obligations“. This was sent to the Magistrates Court and the matter was closed and I did not receive 6 points on my license and a heavy fine.

Nearly two years later I decided to sell the car privately (because the Ford Dealership wanted to offer me £2,400 less than what the vehicle was worth). I wanted to sell the Ford Kuga because it, despite the sales propaganda, there was no way to achieve the urban or motorway MPG at the published figures unless the vehicle was driven in a vacuum so I felt cheated by Ford and wanted to indefinitely cut ties with the company.

I called Ford Insure in November 2013 and formally cancelled the policy and gave my reasons for doing so – which was because I had sold the car. A letter arrived over the Christmas period from Premium Credit stating that I had to sign an agreement for them to continue taking payments from my account. I ignored this putting it down to the fact that clearly Ford continues to be in a muddle but will no doubt come to its senses. Without my authority, without the required signature, money started to be taken out of my account by Premium Credit so a visit to the bank resulted in the refund on £70+ of the stolen money and I was to begin a process of resolving the matter. I got beaten to it because today, by recorded delivery, I received this letter threatening me with legal action to recover their losses.

 

 

I look forward no to a visit from the bailiffs courtesy of the grossly negligent Ford Insure people.

Leave a Comment

Protected: Network post-clone activites (MAC-ADDRESS, 70-*) VirtualBox Centos 6.4

This content is password protected. To view it please enter your password below:

Enter your password to view comments.

Protected: Oracle Client 32bit on Centos 6.4 install-issue resolution and firewall provisioning

This content is password protected. To view it please enter your password below:

Enter your password to view comments.

Protected: http local yum local mirror, cron job, repo

This content is password protected. To view it please enter your password below:

Enter your password to view comments.

Protected: CloudStack 4.2 Documentum 7 on AWS

This content is password protected. To view it please enter your password below:

Enter your password to view comments.

Cloud – access to ‘discovery’ via “semantic” technology

Cancer in the cloud – do ethics go out the window?

If my employer deliberately sat on the ‘secret cure’, cancer victims would continue to die from this hideous disease unnecessarily.  If it were the case, I’d have to discuss the matter with my boss (to say the least).
The first question asked: why we are ‘keeping secret’ something worth $ trillions? Perhaps it wouldn’t be “the companies place” to legitimately claim discovery – but would they anyway if out of reach of the law? Seems a bit weird….

To increase the chance of discovering an earth-shattering $ trillion healthcare solution we should use exactly the platform being provided by the cloud infrastructure operating offshore on which pharma tenants are actively taking up residency in a plight to save money!
The easy part is merging the “crown jewels” (research data) of each pharma into a semantic database to run queries from which results yields could turn up vital clues that would otherwise not be available to each individual pharmaceutical client. The information has (at minimum) potential to challenge the field of ethics in this application.

The following technological key ingredients to solving some of life’s biggest issues, like curing cancer, may include:

  • Access to data – big BIG data
  • Massive compute power
  • Semantic technology
  • The know-how to use it
  • Good knowledge of a domain – such as the Life Sciences

The cure – a collective success?

It must be unanimous that a new cure is something welcomed by all and that must be kept in mind.
Developing a new treatment for e.g. cancer, Alzheimer’s etc. will achieve a number of things:

  • Cure a hideous illness and improve the quality of life of millions
  • Taking every pharmaceutical companies IP investment in a therapy area rendering it valueless. Possibly break the back of some pharmaceuticals and wiping their stocks off the market.
  • Make the company ‘patenting’ the cure suddenly worth $ trillions

Does your hosting company boast semantic technology and have a life sciences programme?

Key decision makers at pharmaceutical companies are not naive and assess risks before putting company core assets in common pot with all their rivals. But are they underestimating the power of the semantic web? Do the lawyers even know what it is? Is it a case of living in denial like a Jimmy Saville victim?

Enter the Twilight Zone – a question of ‘moral duty’

If you could get away with ‘running a script’ that could reveal THE ULTIMATE answer, one more than worthy of a Nobel Peace Prize and infinite wealth, would you do it?
What moral dilemma would you experience knowing you cheated your clients, whose stocks crash having used their information reveal a cure for cancer? Would you comfort yourself in the knowledge that you have saved millions of lives?

It would be ridiculous to have all that BIG, BIG data at hand and not exploit it for humanitarian reasons.
It is therefore obvious there must be a contractual agreement between offshore hosted pharma tenants and their landlord (having their own life sciences programme) as to how the $ trillion yields will be split otherwise the landlord would (could):

  • claim their own life-sciences project made the discovery independently
  • name their price when licensing the medicine
  • sink the pharmaceutical clients whose stupidity allowed them to be robbed of the intellectual property without them receiving a penny
  • not worry too much about loosing their custom when they fold

Since these operators exist out of reach of “local laws”, nobody can do a thing about it or prove it otherwise.
If I held shares in a life sciences company that was offshoring, I would sell them and buy into that cloud provider.

Leave a Comment

Older Posts »
Follow

Get every new post delivered to your Inbox.