Skip to content

Instantly share code, notes, and snippets.

View kedarmhaswade's full-sized avatar
💭
Just trying to catch up with my calendar

Kedar Mhaswade kedarmhaswade

💭
Just trying to catch up with my calendar
  • JyMob
  • Sunnyvale, USA
View GitHub Profile
@kedarmhaswade
kedarmhaswade / n12800
Created September 25, 2014 21:22
n12800
➜ combinatorial-algorithms git:(master) ✗ java RandomSubsetSimulation 4 12800
Frequencies of chosen subsets ....
[1, 2, 3] : 1011, -211, 7.90
[1] : 344, 456, 2.69
[1, 2, 4] : 2214, -1414, 17.30
[1, 3] : 2178, -1378, 17.02
[1, 2] : 1568, -768, 12.25
[1, 4] : 2064, -1264, 16.13
[1, 2, 3, 4] : 2531, -1731, 19.77
[1, 3, 4] : 890, -90, 6.95
@kedarmhaswade
kedarmhaswade / n12800000
Created September 25, 2014 21:28
n128000000
Frequencies of chosen subsets ....
[3] : 792085, 7915, 6.19
[4] : 781218, 18782, 6.10
[] : 899949, -99949, 7.03
[1] : 879742, -79742, 6.87
[2] : 775863, 24137, 6.06
[3, 4] : 681955, 118045, 5.33
[2, 3] : 706396, 93604, 5.52
[2, 4] : 723973, 76027, 5.66
[1, 2, 3] : 851952, -51952, 6.66
@kedarmhaswade
kedarmhaswade / n128000
Created September 25, 2014 21:30
n128000
➜ combinatorial-algorithms git:(master) ✗ java RandomSubsetSimulation 4 128000
Frequencies of chosen subsets ....
[1, 2, 3] : 12834, -4834, 10.03
[1] : 17179, -9179, 13.42
[1, 2, 4] : 15348, -7348, 11.99
[1, 3] : 22262, -14262, 17.39
[1, 2] : 13894, -5894, 10.85
[1, 4] : 20546, -12546, 16.05
[1, 2, 3, 4] : 16307, -8307, 12.74
[1, 3, 4] : 9630, -1630, 7.52
@kedarmhaswade
kedarmhaswade / n1280000000
Created September 25, 2014 21:32
n1280000000
➜ combinatorial-algorithms git:(master) ✗ java RandomSubsetSimulation 4 128000000
Frequencies of chosen subsets ....
[3] : 8917285, -917285, 6.97
[] : 10765317, -2765317, 8.41
[4] : 9015332, -1015332, 7.04
[1] : 8605043, -605043, 6.72
[2] : 9261979, -1261979, 7.24
[3, 4] : 8277852, -277852, 6.47
[2, 3] : 8270102, -270102, 6.46
[2, 4] : 7998797, 1203, 6.25
@kedarmhaswade
kedarmhaswade / Java-Disassembly.txt
Created September 25, 2014 21:50
Disassembly of Stringy.java
Stringy.java
-------------
class Stringy {
public static void main(String[] args) {
String s = new StringBuilder().append("a").append("b").append("c").toString();
}
}
javap -c -all Stringy:
----------------------
@kedarmhaswade
kedarmhaswade / hgt-questions.md
Last active August 29, 2015 14:07
Handbook of Graph Theory 2nd Edition -- Questions

Questions on the Brilliant Handbook of Graph Theory by Gross/Yellen/Ping

  1. In Algorithm 1.1.2 page 20, the while loop checks if T spans G. Shouldn't it check if T spans C_G(V) -- the component of the graph G, just like in Algorithm 1.1.1?
  2. E3: Page 23 -- For k = 0,1,2,3, there is exactly one k-regular simple graph with 4 vertices. (There are three 1-regular graphs with 4-vertices, though all of them are isomorphic -- does this need to be clarified?)
  3. Algorithm 2.1.2 Breadth-First Search (page 61) --
    1. change if mark[w] = visited then to if mark[w] != visited then
    2. change distance[w] := distance[v] + 1 (not distance[w] + 1)
@kedarmhaswade
kedarmhaswade / ubuntu-linux-toolbox-errata.md
Last active August 29, 2015 14:07
Errata -- Ubuntu Linux Toolbox 2nd Edition ...

Here's the list of items that I think need update:

  1. Ubuntu Unity Desktop -- based on Waylan or Wayland? Consider providing a link to that project.
  2. Print version information of installed APT utilities with this command: (it's not apt-config -V, but apt-config -v)
  3. Sometimes while doing sudo apt-get install, I get:
  • /var/lib/dpkg/info/bzflag-server.postinst: 6: /var/lib/dpkg/info/bzflag-server.postinst: update-rc.d: not found dpkg: error processing package bzflag-server (--configure): subprocess installed post-installation script returned error exit status 127
@kedarmhaswade
kedarmhaswade / KnightsTour.java
Created November 4, 2014 21:36
A rudimentary Knight's Tour using Backtracking algorithm ...
/**
Compile and run as java KnightsTour a1
*/
import java.util.*;
class KnightsTour {
public static void main(String[] args) {
String start = args[0];
Board.setStart(start);
if(solve(start))
Board.draw();
@kedarmhaswade
kedarmhaswade / Nearby.java
Last active August 29, 2015 14:09
Nearby
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.*;
/**
* A class to implement http://www.quora.com/challenges#nearby
* @author Kedar Mhaswade
*/
public class Nearby {
@kedarmhaswade
kedarmhaswade / NearbyDataset.java
Created November 15, 2014 19:04
NearbyDataset
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.Random;
/** A class to generate somewhat larger test dataset for http://www.quora.com/challenges#nearby
* @author Kedar Mhaswade
*/
public class NearbyDataset {
static final Random r = new Random();
public static void main(String[] args) {