Skip to content

Instantly share code, notes, and snippets.

View dineshvg's full-sized avatar
🎧
Its over 9000

Dinesh Gangatharan dineshvg

🎧
Its over 9000
View GitHub Profile
@dineshvg
dineshvg / Uselful Git commands
Created December 26, 2016 17:32
Git commands that can come in handy during developement
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
@dineshvg
dineshvg / gnuplot-py-example.py
Created March 4, 2017 13:28 — forked from drmalex07/gnuplot-py-example.py
A simple example for Gnuplot.py. #python #gnuplot
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 / PCA.java
Created March 12, 2017 01:51
Principal Component analysis on 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 / train_test_split.py
Created April 8, 2017 00:57
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.
## 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 / check_circle_shape.xml
Created June 29, 2018 09:55
A circle shape with a check mark in it. A layerlist of shapes.
<?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 / JSON Example
Created May 11, 2020 08:46 — forked from 13protons/JSON Example
Very simple 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 / DrawBeforeDrawBehind.kt
Created September 22, 2023 07:33
DrawWithContent vs DrawBehind
@Preview
@Composable
fun DrawBefore() {
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
Card(
shape = RoundedCornerShape(8.dp)
,modifier = Modifier