This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package svm_train; | |
import org.opencv.core.Core; | |
import org.opencv.core.CvType; | |
import org.opencv.core.Mat; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <opencv2/opencv.hpp> | |
#include <opencv2/ml.hpp> | |
#include <opencv2/imgcodecs.hpp> | |
#include <opencv2/core.hpp> | |
using namespace cv; | |
const std::string TRAINING_DATA_ROOT = "E:\\SVM_Training\\"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void OpenApp() { | |
string bundleId = "<App Package Name>"; // your target bundle id | |
AndroidJavaClass up = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); | |
AndroidJavaObject ca = up.GetStatic<AndroidJavaObject>("currentActivity"); | |
AndroidJavaObject packageManager = ca.Call<AndroidJavaObject>("getPackageManager"); | |
//if the app is installed, no errors. Else, doesn't get past next line | |
AndroidJavaObject launchIntent = packageManager.Call<AndroidJavaObject>("getLaunchIntentForPackage",bundleId); | |
ca.Call("startActivity",launchIntent); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = function(Agrirouter) { | |
Agrirouter.closestRouter = function(fieldid, lat, long, cb) { | |
var response; | |
Agrirouter.find({"where":{"fieldid":fieldid}},function (err, ret) { | |
for (var i = 0; i >= ret.length - 1; i++) { | |
var delPhi = ret[i]["lat"] - lat; | |
var delLambda = ret[i]["long"] - long; | |
var R = 6371000; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=geometry"></script> | |
<script> | |
var p1 = new google.maps.LatLng(12.851853, 77.664216); | |
var p2 = new google.maps.LatLng(12.851854, 77.664219); | |
alert(calcDistance(p1, p2)); | |
//calculates distance between two points in km's | |
function calcDistance(p1, p2) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace GreatCircleNavigation | |
{ | |
class Program | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void scrshtActionPerformed() { | |
/** | |
* this gist outline the process to grab the screenshot of a particular | |
* JFrame in Swing from which the method is invoked | |
* | |
* "this" is the particualr frame here | |
* */ | |
BufferedImage screenshotImage = new BufferedImage( | |
this.getBounds().width, this.getBounds().height, | |
BufferedImage.TYPE_INT_RGB); |
NewerOlder