Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View khatchad's full-sized avatar

Raffi Khatchadourian khatchad

View GitHub Profile
#include <iostream>
#include <climits>
using namespace std;
int main() {
int i;
int j;
int result;
cout << "Enter i: ";
#include <iostream>
#include <climits>
using namespace std;
int main() {
int i;
int j;
int result;
cout << "Enter i: ";
@khatchad
khatchad / mann-whitney.r
Created November 13, 2017 15:40
R script to generate the Mann-Whitney statistical analysis for our pull request study
changed_files_non_merged <- c(1, 5, 6, 16, 16, 22, 23, 29, 51, 135)
changed_files_merged <- c(2, 4, 4, 21)
changed_lines_non_merged <- c(22,27,62,729,681,283,161,413,922,2528)
changed_lines_merged <- c(23,53,441,526)
concrete_non_merged <- c(1,1,0,0,0,0,1,0,0,0)
concrete_merged <- c(0,1,0,0)
KLOC_non_merged <- c(25,7,20,309,244,136,154,329,1266,506)
@khatchad
khatchad / Util.java
Created February 23, 2017 18:40
Find out if a object creation instruction produces an instance with the given instance key in WALA
/**
* True iff the given {@link InstanceKey} corresponds with the given
* {@link SSAInvokeInstruction} in the given {@link CallGraph}. In other
* words, the result is true iff the instruction is used to create the
* instance.
*
* @param instanceKey
* An instance in question.
* @param instruction
* An instruction in question. Should be corresponding to a ctor
public class IntStack {
/**
* The maximum size of this stack.
*/
private static final int MAX_SIZE = 100;
/**
* The values stored in this stack. It should be initially empty.
*/
private int[] values;
package p;
import raffi.java.util.Collection;
class A {
void m() {
Collection c = null;
for (Object obj : c) //should fail because C is not a java.util.Collection.
;
}
}
@khatchad
khatchad / A.java
Last active August 29, 2015 14:26
package p;
class C implements java.lang.Iterable {
//...
}
class A {
void m() {
C c = null; //this class implements java.lang.Iterable.
//should fail precondition
class SingleBooleanReturnStatement {
boolean m() {
List<Integer> list = Arrays.asList(2);
for (Integer i : list)
return true;
}
return false;
}
public class Enum_test {
public static final int a = 4;
public static final double b = 5.5;
public void compare(){
boolean check = b > a;
System.out.println(check);
}