Like us on Facebook and stand a chance to win pen drives!

Firefox Geolocation Spoofing

Geolocater

Firefox Geolocater is a great for playing with fake geolocations. You can add geolocations as you wish and check how your Firefox browser take each of those locations as your current location. The plugin is very useful for developers who are building  GIS web applications. You can download it here.

0 comments:

Google Map Multiple WayPoints

Google Map Multiple WayPoints
Google Map Multiple WayPoints


<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
    <script type="text/javascript">

        var myRouter = {
            map_: null,
            directionsHelper_: null,

            stores: [
                    {name: "Thalawa Station", location: new google.maps.LatLng(8.231796, 80.348333)},
                    {name: "Maho Station", location: new google.maps.LatLng(7.8228, 80.2778)},
                    {name: "Mirigama Station", location: new google.maps.LatLng(7.242555, 80.126472)},
                    {name: "Veyangoda Station", location: new google.maps.LatLng(7.153015, 80.058488)},
                    {name: "Gampaha Station", location: new google.maps.LatLng(7.093543, 79.993703)}
                ],

            calcRoute: function() {

                var waypts = [];

                for (var i in this.stores) {
                    waypts.push({
                        location: this.stores[i].location,
                        stopover:true
                    });
                }
                var request = {
                    //origin: new google.maps.LatLng(8.344216, 80.410917),
					origin: "Anuradhapura Railway Station",
                    destination: "Colombo Fort Railway Station",
                    waypoints: waypts,
                    optimizeWaypoints: true,
                    travelMode: google.maps.DirectionsTravelMode.DRIVING
                };

                var _SELF = this;
                this.directionsHelper_.route(request, function(response, status) {
                    if (status == google.maps.DirectionsStatus.OK) {
                        _SELF.directionsDisplay_.setDirections(response);
                        return;
                    }
                    console.log('Directions Status: ' + status);
                });
            },

            init: function(mapid) {

                this.directionsHelper_ = new google.maps.DirectionsService();
                this.directionsDisplay_ = new google.maps.DirectionsRenderer();

                var center = new google.maps.LatLng(8.344216, 80.410917);
                var myOptions = {
                    zoom:7,
                    mapTypeId: google.maps.MapTypeId.ROADMAP,
                    center: center
                }
                this.map_ = new google.maps.Map(document.getElementById(mapid), myOptions);
                this.directionsDisplay_.setMap(this.map_);

                this.calcRoute();
            }
        };

        $(document).ready(function() {
            myRouter.init('map');
        });

    </script>
    <style type="text/css">
        #map {
            height: 500px;
            width: 600px;
            border: 1px solid #000;
        }
    </style>
</head>
<body>
    <div id="map"></div>
</body>
</html>

0 comments:

MySQL Check Time Duration Passed?


MySQL  Time Duration
MySQL  Time Duration

You may want to check whether a particular date has passed using start date, time duration and current date  when the target date is not physically stored.

For clarity, consider a db table schema as follows.

+-----------+--------------------------+------------------+
| event_id | start_time               | duration_seconds |
+-----------+--------------------------+------------------+
| 005      |'2014-10-1 12:13:08'      | 86400            |
+-----------+--------------------------+------------------+

Here `duration_seconds` is stored using integers. If TIME is used, there 's a limit for 24 hrs.
If you want to get only adverts that have not expired, you will run a query like this.

SELECT * FROM  `events` WHERE TIME_TO_SEC(timediff(now(),start_time))<=`duration_seconds`;

0 comments:

Copyright © 2012 The Code Junction.