Skip to content

Instantly share code, notes, and snippets.

View bhachauk's full-sized avatar
🎮
https://bhachauk.github.io

Bhanuchander Udhayakumar bhachauk

🎮
https://bhachauk.github.io
View GitHub Profile
String getreponame(String url)
{
String gitname = ("basename $url").execute().getText().trim()
return gitname.take(gitname.lastIndexOf('.'))
}
tags$head(
tags$style('
body{background-color: #DAE3F9 !important}
.nodetext{fill: #000000}
.legend text{fill: #FF0000}
')
)
output$metrics <- renderTable ({
inFile <- input$file1
if (is.null(inFile))
return(NULL)
df <- read.csv(inFile$datapath, header =TRUE)[ ,c(input$aend,input$zend,input$linklab)]
net <- graph_from_data_frame(d=df, vertices=NULL, directed=T)
data.frame(
@bhachauk
bhachauk / git_merge_dry-run
Last active July 24, 2018 09:12
git merge with no fast forward and no commit :octocat:
git merge --no-commit --no-ff newbranch
git diff --cached
git merge --abort
git log --graph --full-history --all --pretty=format:"%h%x09%d%x20%s"
@bhachauk
bhachauk / spherical-cart.py
Created September 15, 2018 04:43
spherical <--> cart
def sph2cart1(r, th, phi):
x = r * cos(phi) * sin(th)
y = r * sin(phi) * sin(th)
z = r * cos(th)
return x, y, z
def cart2sph1(x, y, z):
r = sqrt(x**2 + y**2 + z**2) + 1e-15
th = acos(z / r)
@bhachauk
bhachauk / cipynb.py
Created October 6, 2018 11:14 — forked from iamaziz/cipynb.py
Convert all ipython notebook(s) in a given directory into the selected format and place output in a separate folder. Using: ipython nbconvert and find command (Unix-like OS).
#!/usr/bin/env python
__author__ = 'Aziz'
"""
Convert all ipython notebook(s) in a given directory into the selected format and place output in a separate folder.
usages: python cipynb.py `directory` [-to FORMAT]
Using: ipython nbconvert and find command (Unix-like OS).
@bhachauk
bhachauk / Millis_Date_Oracle_Query.sql
Last active January 14, 2019 07:27
Accessing the Unix time in Oracle database with specific date format in SQL query
DEFINE cnv_time = "24 * 60 * 60 * 1000";
select TIMESTAMP '1970-01-01 00:00:00.000' + NUMTODSINTERVAL(TIME / 1000, 'SECOND') as dat FROM FM_ALARM_11_12_2018 where
to_number(to_date('01-JAN-2019 10:00:00','DD-MON-YYYY HH24:MI:SS') - to_date('01-JAN-1970','DD-MON-YYYY')) * &cnv_time > TIME;
@bhachauk
bhachauk / CollectMap
Created June 15, 2019 12:03
Using Map in Better Way
groovy -e 'a=["a": ["b",1], "c": ["d",2]]; println a.collectEntries{k,v -> ["$k":v[0]]}'
@bhachauk
bhachauk / Visited_Places.geojson
Created September 4, 2019 05:22
Visited Places ... !
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.