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 / 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 / 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 / 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 / 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 / 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 / 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