Skip to content

Instantly share code, notes, and snippets.

View hygull's full-sized avatar
😃
Enjoying work at AIPALETTE & in home. Programming is there as my best friend.

Rishikesh Agrawani hygull

😃
Enjoying work at AIPALETTE & in home. Programming is there as my best friend.
View GitHub Profile
@hygull
hygull / To print power set of a set of characters..go
Last active January 9, 2017 05:39
To print power set of a set of characters. created by hygull - https://repl.it/FDa4/5
/*
#Date of creation : 9 Jan 2016.
#Aim of program : To print power set of a set of characters.
#Coded by : Rishikesh Agrawani.
*/
package main
import "fmt"
func main() {
@hygull
hygull / Hackerearth (sum of numbers problem).py
Created January 9, 2017 06:50
Hackerearth (sum of numbers problem) created by hygull - https://repl.it/FDbh/2
"""
coded_on : 9 Jan 2017.
coded_by : Rishikesh Agrawani.
problem link : https://www.hackerearth.com/practice/basic-programming/bit-manipulation/basics-of-bit-manipulation/practice-problems/algorithm/sum-of-numbers-9/
aim_of_script: Sum of numbers problem on Hackerearth.
"""
testcases = int(raw_input()) #testcases
for t in xrange(testcases):
n = int(raw_input()) #No. of elements in an array/list
nums_set = [int(num) for num in raw_input().split() ]#eg. [2,3,4,0,1]
@hygull
hygull / Write a recursive code to print the number of occurrences of substring "hi" that is not preceded by substring "x".go
Created January 10, 2017 10:49
Write a recursive code to print the number of occurrences of substring "hi" that is not preceded by substring "x" created by hygull - https://repl.it/FEx4/0
"""
coded_on : 10 January 2017.
aim : Write a recursive code to print the number of occurrences of substring "hi" that is not preceded by substring "x"
coded_by : Rishikesh Agrawani.
"""
def abcd(s):
try:
index=s.index("hi")
if index==0:
return 1+abcd(s[index+1:])
@hygull
hygull / list comprehesion.py
Created January 10, 2017 17:03
list comprehesion created by hygull - https://repl.it/FFTh/5
"""
Coded on : 10 January 2017.
Aim : Short hand notation for creating list in Python (3 examples)
Python version : 2.7.10
"""
#To create a list of lists each list denoting a table of numbers in range [1...10] one after one
tables=[[i*j for j in range(1,11)] for i in range(1,11)]
for lst in tables:
for num in lst:
@hygull
hygull / index.css
Last active January 12, 2017 13:11
AutoHide Navbar Example created by hygull - https://repl.it/FHVc/0
/*Currently no css for the index.html*/
@hygull
hygull / F6co-1.py
Last active February 3, 2017 20:25
null created by hygull - https://repl.it/F6co/1
"""
* Date of creation : 1 Feb 2017 - 4 Feb 2017
* Aim of script : To work with date & time in Python.
* Python version : 2.7.12 .
* Coded by : Rishikesh Agrawani.
* Installation : pytz library (If it is not installed)
"""
import datetime
#Current date & time
@hygull
hygull / bootstrap related css js files dowload.go
Last active February 14, 2017 09:00
bootstrap related css js files dowload created by hygull - https://repl.it/FjBp/0
@hygull
hygull / creating our own python iterator.py
Created February 14, 2017 13:03
creating our own python iterator created by hygull - https://repl.it/FjID/0
"""
Coded On : 14 Feb 2014.
Aim : To create our own iterator in Python.
Reference link : http://stackoverflow.com/questions/19151/build-a-basic-python-iterator
"""
class Range:
def __init__(self,start,end): #constructor
self.start = start
self.end = end
@hygull
hygull / index.css
Last active March 25, 2017 18:22
charjs creation created by hygull - https://repl.it/GNhh/2
.container {
width: 80%;
margin: 15px auto;
}
h2{
color:green;
font-family: tahoma;
font-weight: bold;
}
.span_lw{
@hygull
hygull / To add dynamic anchor elements to draw dynamic google map & line chart.js
Created March 17, 2017 07:44
To add dynamic anchor elements to draw dynamic google map & line chart created by hygull - https://repl.it/G0Gn/1
/*To dynamically draw chart based on the result of call at http://filtron.pythonanywhere.com/api-view/lora-evk-sensors/, use the proper url, commented lines are also important*/
$.ajax({
url:"http://filtron.pythonanywhere.com/api-view/lora-evk-sensors/",
//url:"http://127.0.0.1:8000/lora-evk-sensors/",
dataType:"json",
}).done(function(result){
console.log(result);
var ctx = document.getElementById("myChart").getContext("2d");