Skip to content

Instantly share code, notes, and snippets.

View shivanker's full-sized avatar

Shivanker Goel shivanker

  • Google
  • London, UK
View GitHub Profile
@shivanker
shivanker / # et - 2018-11-21_13-13-51.txt
Created November 21, 2018 13:16
et (mistertea/et/et) on macOS 10.14.1 - Homebrew build logs
Homebrew build logs for mistertea/et/et on macOS 10.14.1
Build date: 2018-11-21 13:13:51
@shivanker
shivanker / iitdproxy
Created January 16, 2015 19:10
These are functions for configuring IITD proxy for most command-line apps in OSX and Linux. Usage: Add both these functions in "~/.bash_profile". Then from any terminal session in which you want to use proxy, call "setproxy 22" for BTech proxy, "setproxy 62" for Dual, and so on. Similarly call "unsetproxy" for direct access.
function unsetproxy() {
unset HTTP_PROXY
unset HTTPS_PROXY
unset http_proxy
unset https_proxy
perl -n -i -e 'if($_ =~ /^\s*proxy\s*=/) {} else {print $_;}' ~/.curlrc
}
function setproxy() {
@shivanker
shivanker / aStar - Java Snippet
Created December 7, 2012 14:14
A genral purpose A-Star implementation in Java. Encode your problem in the form of an implementation of the abstract class State. Then initiate an aStar<your class> object with the initial state and call search(). Suggestions invited.
import java.util.*;
abstract class State {
abstract boolean isGoal();
abstract Object[] successors();
abstract int heuristic(); // heuristic <= min. no. of steps needed to reach the goal; the closer, the better
abstract public String toString(); // for proper hashCode and equality check in HashMap
}
class aStar<S extends State> {