Skip to content

Instantly share code, notes, and snippets.

View phaniram's full-sized avatar

Maturu Srinivas Phani Ram phaniram

View GitHub Profile
@phaniram
phaniram / killProcess.bat
Created April 17, 2014 06:41
Check every 30 secs and Kill a process
@echo off
:killSapience
echo|set /p=.
timeout /t 30 /nobreak >nul
taskkill /im Sapience* /f >nul 2>&1 & goto killSapience
exit
@phaniram
phaniram / UFG.java
Created August 14, 2013 16:52
Simple java class downloading a S3 .zip file and extract to local directory
package ufg;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.net.MalformedURLException;
@phaniram
phaniram / Cssify.java
Created March 24, 2013 07:16
Convert XPath to CSS selector
// Java function for converting simple XPath to CSS Selector.
// Used cssify.js from [cssify.js](https://gist.github.com/Dither/1909679)
// Removed log statements (as window objects aren't supported in ScriptEngine)
import java.io.FileNotFoundException;
import java.io.FileReader;
import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
@phaniram
phaniram / CHEFLUCK.java
Created May 2, 2012 21:38
Codechef-May12-SPOON-Accepted
import java.util.Scanner;
class CHEFLUCK {
/**
* @author Cypronmaya-May12-CHEFLUCK-Accepted
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
@phaniram
phaniram / TWSTR.java
Created May 2, 2012 00:28
Codechef-MayChallenge-TWSTR -Accepted
package com.cyp.codechef;
/**
* @author Cypronmaya -Codechef- Accepted
*/
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;
@phaniram
phaniram / JewelsAndStones.java
Created May 1, 2012 23:10
Codechef-MayChallenge-STONES-Accepted
package com.cyp.codechef;
/**
* @author Cypronmaya -Codechef- Accepted
*/
import java.util.HashSet;
import java.util.Scanner;
class JewelsAndStones {
@phaniram
phaniram / spoon.java
Created March 2, 2012 19:02
Codechef-MarchContest-SPOON-(Accepted)
package com.cyp.codechef.marcontest;
import java.io.IOException;
import java.util.Scanner;
/*
* Cypronmaya - Codechef March 2012 Contest - Problem Code : SPOON
*/
class SPOON {
@phaniram
phaniram / Solution.java
Created February 15, 2012 17:59
Interview Street Challenges - Changing Bits
package com.interviewstreet.puzzles;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;
public class Solution {
int bit;
@phaniram
phaniram / WCOUNT.java
Created February 1, 2012 20:50
Codechef-FebContest-Word Counting
package com.cyp.codechef.febcontest;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.Scanner;
class WCOUNT {
int len;
BigInteger mod;
HashMap<Character,Integer> hm=new HashMap<Character,Integer>();
@phaniram
phaniram / Solution1.java
Created January 26, 2012 11:47
Interview Street Challenges - Lucky Numbers
/**
*
* @author cypronmaya
*/
import java.util.Scanner;
class Solution {
boolean[] check;