Skip to content

Instantly share code, notes, and snippets.

View nsdevaraj's full-sized avatar
🎯
Focusing

N.S.Devaraj nsdevaraj

🎯
Focusing
View GitHub Profile
1. Remove JDK 1.7 from the directory and place it somewhere you can find it later (Desktop)
sudo mv /Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk ~/Desktop/jdk1.7.0_06.jdk
2. Copy the Java 1.6 JDK to the old JDK 1.7 directory
sudo cp -R /System/Library/Java/JavaVirtualMachines/1.6.0.jdk /Library/Java/JavaVirtualMachines/1.6.0.jdk
3. Close the terminal and re-open it and type ‘java -version’. You should see that the Java version 1.6 is now enabled.
#include <jni.h>
#include "opencv2/opencv.hpp"
#include <android/log.h>
#include "../stasm/stasm_lib.h"
extern "C" {
JNIEXPORT jintArray JNICALL Java_org_androidhat_stasmandroiddemo_DrHuDemoActivity_FindFaceLandmarks(
JNIEnv* env, jobject, jfloat ratioW, jfloat ratioH)
{
clock_t StartTime = clock();
@nsdevaraj
nsdevaraj / gist:10231629
Created April 9, 2014 06:25
" Sorry, an error has occured. Adobe AIR could not be installed. Install either Gnome Keyring or KDE KWallet before installing Adobe AIR."
This can be fixed:
Terminal, Ctrl+Alt+T - locate libgnome-keyring.so - (locate libgnome-keyring.so)
This is my result (yours might be different):
/usr/lib/x86_64-linux-gnu/libgnome-keyring.so.0
/usr/lib/x86_64-linux-gnu/libgnome-keyring.so.0.2.0
Create a symbolic link to your location strings that you found with the previous commands:
sudo ln -s /usr/lib/x86_64-linux-gnu/libgnome-keyring.so.0 /usr/lib/libgnome-keyring.so.0
sudo ln -s /usr/lib/x86_64-linux-gnu/libgnome-keyring.so.0.2.0 /usr/lib/libgnome-keyring.so.0.2.0
Use following commands for 32-bit systems:
@nsdevaraj
nsdevaraj / restart.sh
Last active August 29, 2015 14:00
restart a service at startup ubuntu
sudo cp server.sh /etc/init.d/
sudo chmod +x /etc/init.d/server.sh
sudo update-rc.d server.sh defaults
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000
sudo nano /etc/init/glitz.conf
http://kvz.io/blog/2009/12/15/run-nodejs-as-a-service-on-ubuntu-karmic/
http://blog.nodejitsu.com/keep-a-nodejs-server-up-with-forever/
/etc/rc.local sudo /server.sh
<?xml version="1.0" encoding="utf-16"?>
<VideoData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<lastSlideId>35</lastSlideId>
<videoName>Theme01</videoName>
<Slides>
<Slide>
<id>16</id>
<secondsDuration>3</secondsDuration>
<backgroundImage>
<slideid>16</slideid>
@nsdevaraj
nsdevaraj / Triangulation.m
Created July 4, 2014 08:44
Triangulate with 3 beacon points - y with division by zero to be rectified
- (CGPoint)getCoordinateWithBeaconA:(CGPoint)a beaconB:(CGPoint)b beaconC:(CGPoint)c distanceA:(CGFloat)dA distanceB:(CGFloat)dB distanceC:(CGFloat)dC {
CGFloat W, Z, x, y, y2;
W = dA*dA - dB*dB - a.x*a.x - a.y*a.y + b.x*b.x + b.y*b.y;
Z = dB*dB - dC*dC - b.x*b.x - b.y*b.y + c.x*c.x + c.y*c.y;
x = (W*(c.y-b.y) - Z*(b.y-a.y)) / (2 * ((b.x-a.x)*(c.y-b.y) - (c.x-b.x)*(b.y-a.y)));
y = (W - 2*x*(b.x-a.x)) / (2*(b.y-a.y));
//y2 is a second measure of y to mitigate errors
y2 = (Z - 2*x*(c.x-b.x)) / (2*(c.y-b.y));
@nsdevaraj
nsdevaraj / Spring.cs
Created July 8, 2014 08:04
Move or Scale
using UnityEngine;
using System.Collections;
public class Spring : MonoBehaviour {
private bool _isScaling = false;
private bool _isMoving = false;
private Vector3 scaleTo;
private Vector3 moveTo;
// Use this for initialization
@nsdevaraj
nsdevaraj / url.js
Created December 16, 2014 11:55
use the current url where js is present
var jsonUrl;
var sc = document.getElementsByTagName("script");
for(idx = 0; idx < sc.length; idx++)
{
s = sc.item(idx);
if(s.src && s.src.match(/render\.js$/))
{
var currentLoc = 'http://127.0.0.1:60373/sap/bi/bundles/vbi/viz/ext/solidgauge/vbi_viz_ext_solidgauge-src/js/render.js'
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
copy /b *.txt newfile.txt