Skip to content

Instantly share code, notes, and snippets.

Avatar
🎧

Dinesh Vaithyalingam Gangatharan dineshvg

🎧
View GitHub Profile
@dineshvg
dineshvg / JSON Example
Created May 11, 2020 — forked from 13protons/JSON Example
Very simple JSON example
View JSON Example
{
questions: [{
text: "What does 'API' stand for?",
answer: "API stands for Application Programming Interface."
},{
text: "What's so good about pragmatic REST?",
answer: "It's focused on the api consumer, so it makes it easier for developers to contribute to your app library!"
}]
}
@dineshvg
dineshvg / check_circle_shape.xml
Created Jun 29, 2018
A circle shape with a check mark in it. A layerlist of shapes.
View check_circle_shape.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">
<!-- border circle -->
<item
android:width="50dp"
android:height="50dp"
tools:ignore="UnusedAttribute">
<shape android:shape="rectangle">
@dineshvg
dineshvg / train_test_split.py
Created Apr 8, 2017
Code picks every letter in the list and puts it in test and the rest in train. It does this for the entire list till the end.
View train_test_split.py
## Code picks every letter in the list and puts it in test and the rest in train. It does this for the entire list till the end.
from collections import Counter
# a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
# Code for splitting training and testing
test = []
train = []
for i in range(0, len(a)):
if bool(test) is False:
@dineshvg
dineshvg / PCA.java
Created Mar 12, 2017
Principal Component analysis on Java
View PCA.java
/*
* Application: PCA_Analysis
*
* USAGE: An application performing a basic Principal Component Analysis.
* This application illustrates the class, PCA.
*
* WRITTEN BY: Dr Michael Thomas Flanagan
*
* DATE: December 2010
*
@dineshvg
dineshvg / gnuplot-py-example.py
Created Mar 4, 2017 — forked from drmalex07/gnuplot-py-example.py
A simple example for Gnuplot.py. #python #gnuplot
View gnuplot-py-example.py
import numpy
import Gnuplot
def rainfall_intensity_t10(t):
return 11.23 * (t**(-0.713))
def rainfall_intensity_t50(t):
return 18.06 * (t**(-0.713))
g = Gnuplot.Gnuplot()
@dineshvg
dineshvg / Uselful Git commands
Created Dec 26, 2016
Git commands that can come in handy during developement
View Uselful Git commands
Get all remote branches
git fetch --all
git checkout -b <ur_new_local_branch_name> remotes/origin/<Remote_Branch_Name>
Check which local branch of yours track which remote branch in Git
git branch -vv