Skip to content

Instantly share code, notes, and snippets.

View RakshithNM's full-sized avatar
:octocat:

Rakshith Bellare RakshithNM

:octocat:
View GitHub Profile
/*
Indian States
Adapted from: https://en.wikipedia.org/wiki/States_and_union_territories_of_India
Collected by: Rakshith Bellare
*/
CREATE TABLE states
(`id` INTEGER,`name` VARCHAR(64), `capital` VARCHAR(64), `population` INTEGER, `total_area` INTEGER, `Official_language` VARCHAR(64))
;
while 1:
x, y = raw_input().split()
x = float(x)
y = float(y)
if x % 5 != 0 :
print y
break
elif x > y:
print y
break
@RakshithNM
RakshithNM / LU&E.py
Created October 8, 2016 08:10
LIFE, UNIVERSE AND EVERYTHING - https://www.codechef.com/problems/TEST
while 1:
a = int(raw_input())
if a == 42:
break
print(a)
x, y = raw_input().split()
x = int(x)
y = int(y)
ins = []
while x > 0:
ins.append(int(raw_input()))
x -= 1
count = 0
for a in ins:
if a % y == 0:
a = int(raw_input())
nums = []
while a > 0:
nums.append(int(raw_input()))
a -= 1
def factorial(i):
if i == 0:
return 1
else:
return i * factorial(i-1)
# sort specific number of inputs in non decreasing order
x = int(raw_input())
nums = []
while x > 0:
nums.append(int(raw_input()))
x -= 1
nums.sort()
for sortednum in nums:
print sortednum
function rot13(str)
{
var charNumbers = [];
for(var i = 0; i < str.length; i++)
{
if(str[i].match(/[.,\/#!$%\^&\*;:{}=\?\s\-_`~()]/g,""))
{
charNumbers.push(str.charCodeAt(i));
continue;
}
@RakshithNM
RakshithNM / arraydiff.js
Last active June 21, 2017 17:56
Finding the diff of two arrays
function diffArray(arr1, arr2) {
var newArr = [];
newArr = arr1.concat(arr2);
var filteredArray = newArr.filter(function(val) {
return (arr1.indexOf(val) < 0 || arr2.indexOf(val) < 0);
});
return filteredArray;
}
diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);

Keybase proof

I hereby claim:

  • I am RakshithNM on github.
  • I am fluffystub (https://keybase.io/fluffystub) on keybase.
  • I have a public key whose fingerprint is 31D2 CDDB 0B47 A62B 3741 3275 D79A C0CF 6913 A311

To claim this, I am signing this object:

/* Phaser v2.6.1 - http://phaser.io - @photonstorm - (c) 2016 Photon Storm Ltd. */
!function(a){if("object"==typeof exports)module.exports=a();else if("function"==typeof define,1){var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.p2=a()}else define(a)}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){function d(){}var e=a("./Scalar");b.exports=d,d.lineInt=function(a,b,c){c=c||0;var d,f,g,h,i,j,k,l=[0,0];return d=a[1][1]-a[0][1],f=a[0][0]-a[1][0],g=d*a[0][0]+f*a[0][1],h=b[1][1]-b[0][1],i=b[0][0]-b[1][0],j=h*b[0][0]+i*b[0][1],k=d*i-h*f,e.eq(k,0,c)||(l[0]=(i*g-f*