Skip to content

Instantly share code, notes, and snippets.

View srajappa's full-sized avatar
🐋
Cruising this space

Srinivasan Rajappa srajappa

🐋
Cruising this space
  • ISS Stoxx
  • Rockville, MD
  • 08:04 (UTC -04:00)
View GitHub Profile
@srajappa
srajappa / Berksfile.lock
Created April 13, 2017 00:39
Has the details of all the versions of dependencies for the cookbook scm_jenkins.
DEPENDENCIES
scm_jenkins
path: .
metadata: true
GRAPH
apt (6.0.1)
build-essential (8.0.0)
mingw (>= 1.1)
seven_zip (>= 0.0.0)
@srajappa
srajappa / kitchen_git_error.txt
Created April 13, 2017 00:23
Kitchen converge fail, syntax error in Git community cookbook.
$ kitchen converge
-----> Starting Kitchen (v1.15.0)
W, [2017-04-12T17:09:51.956502 #8552] WARN -- : You are setting a key that conflicts with a built-in method Hashie::Mash#frozen? defined in Kernel. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
W, [2017-04-12T17:09:51.956502 #8552] WARN -- : You are setting a key that conflicts with a built-in method Hashie::Mash#frozen? defined in Kernel. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
W, [2017-04-12T17:09:51.957005 #8552] WARN -- : You are setting a key that conflicts with a built-in method VariaModel::Attributes#frozen? defined in Kernel. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
W, [2017-04-12T17:09:51.957005 #8552] WARN -- : You are setting a key that conflicts with a built-in method VariaModel::Attributes#froz
import java.io.*;
import java.util.*;
/*
* To execute Java, please define "static void main" on a class
* named Solution.
*
* If you need more classes, simply define them inline.
*/
@srajappa
srajappa / ListOperations.java
Last active April 10, 2016 07:18
Finds all permutations of a list containing distinct integers.
public class ListOperations {
public void nextPermutation(int[] nums) {
int nonDecIdx=nums.length-1;
//int[] result;
if(nums.length==1)
return;
while(nonDecIdx > 0){
if(nums[nonDecIdx] > nums[nonDecIdx-1])
break;
nonDecIdx--;
@srajappa
srajappa / Hanoi.java
Last active April 10, 2016 05:20
Program that shows the steps to solve a problem of Tower of Hanoi.
import java.util.*;
public class Hanoi{
public static void towerOfHanoi(int numberOfRings){
//final int NUM_OF_PEGS=3;
List<Deque<Integer>> pegs = new ArrayList<>();
for(int i=0; i<NUM_OF_PEGS; i++){
pegs.add(new LinkedList());
}
//Initialize the first Peg