Skip to content

Instantly share code, notes, and snippets.

View VijayKrishna's full-sized avatar
🍊
Working from home

Vijay Krishna Palepu VijayKrishna

🍊
Working from home
View GitHub Profile
@VijayKrishna
VijayKrishna / ArrayTest.bytecode
Last active December 18, 2015 19:39
Finding out the semantic differences between different parts of the code can be too easy. Check out the README.md for this Gist to find out the back story behind this Gist and "How are array object created when using a bracketed list" :)
public class ArrayTest extends java.lang.Object{
public ArrayTest();
Code:
0: aload_0
1: invokespecial #1; //Method java/lang/Object."<init>":()V
4: return
public static void main1();
Code:
0: iconst_3
@VijayKrishna
VijayKrishna / index.html
Last active December 15, 2015 02:38
Keys n Bars - 2
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.chart rect {
stroke: white;
fill: steelblue;
}
.paddle rect {
@VijayKrishna
VijayKrishna / index.html
Created March 18, 2013 03:26
Keys n Bars
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.chart rect {
stroke: white;
fill: steelblue;
}
</style>
@VijayKrishna
VijayKrishna / README.md
Last active December 15, 2015 01:49
Twinkling Stars

This d3js visualization tries to capture the twinkling of stars or node of a force directed graph with a simple animation to change the color and size of the nodes or stars.

@VijayKrishna
VijayKrishna / lambda.ss
Last active December 15, 2015 01:29
Simple Lambda Interpreter
;;UCI Class Project - INF212 Analysis of Programming Languages
;;Nicholas DiGiuseppe and Vijay Krishna Palepu
;;1.interpreter is not case sensitive.
;;2.interpreter lives in the world of symbols and lists.
;;3.interpreter requires proper parenthesis.
;;4.does not work with numbers such as 1 2 3...
;;reference: http://matt.might.net/articles/implementing-a-programming-language/
;;original 7 lines
; eval takes an expression and an environment to a value
@VijayKrishna
VijayKrishna / Multicolor_Grouped_Boxplot.m
Created March 17, 2013 05:34
Plotting Box-plots in Groups for Vectors of Varying Lengths
x = [1,2,3,4,5,1,2,3,4,6];
group = [1,1,2,2,2,3,3,3,4,4];
positions = [1 1.25 2 2.25];
boxplot(x,group, 'positions', positions);
color = ['y', 'y', 'c', 'c'];
h = findobj(gca,'Tag','Box');
for j=1:length(h)
patch(get(h(j),'XData'),get(h(j),'YData'),color(j),'FaceAlpha',.5);
end
@VijayKrishna
VijayKrishna / JavaC.sublime-build
Created March 17, 2013 05:32
Sublime Text 2 Java Build file
{
"cmd": ["javac", "-Xlint", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.java",
"variants": [
{ "cmd": ["javac", "-Xlint", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.java",
@VijayKrishna
VijayKrishna / DescSplitter.java
Created March 17, 2013 05:31
Method descriptor parser
public class DescSplitter {
public static void main(String[] args) {
splitMethodDesc(desc);
//simple test cases.
splitMethodDesc("([IFB[[[[[Ljava/lang/String;Ljava/lang/String;[I[S[BBLjava/lang/BLtring;)");
splitMethodDesc("Ljava/lang/String;BBBBLjava/lang/String;");
splitMethodDesc("ZBCSIFDJ[Z[B[C[S[I[F[D[JLZBCSIFDJ;LZBCSIFDJ;[LZBCSIFDJ;LZBCSIFDJ;[LZBCSIFDJ;");
}
public static void splitMethodDesc(String desc) {
@VijayKrishna
VijayKrishna / Driver.java
Created March 17, 2013 05:29
Frames Stack information
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.commons.AnalyzerAdapter;