Skip to content

Instantly share code, notes, and snippets.

Avatar

Mushfekur Rahman mushfek

View GitHub Profile
View vertex_cover.py
from ortools.linear_solver import pywraplp
# A simple program that uses a SCIP solver to solve a Vertex Cover instance
def main():
# Create the mip solver with the SCIP backend.
solver = pywraplp.Solver.CreateSolver('SCIP')
# Variables (Nodes)
x1 = solver.IntVar(0, 1, 'x1')
x2 = solver.IntVar(0, 1, 'x2')
View cheat_sheet.txt
GDB commands by function - simple guide
---------------------------------------
More important commands have a (*) by them.
Startup
% gdb -help print startup help, show switches
*% gdb object normal debug
*% gdb object core core debug (must specify core file)
%% gdb object pid attach to running process
% gdb use file command to load object
View gzclp.md
View Building Git from source (Ubuntu 16.04)
sudo apt-get install \
build-essential flex bison \
libreadline6-dev zlib1g-dev \
libnl1 libssl-dev libnl-dev \
libssl-dev \
libcurl4-gnutls-dev \
libexpat1-dev \
tcl tk \
tcl-dev gettext \
asciidoc \
@mushfek
mushfek / introrx.md
Created Jan 2, 2017 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md
@mushfek
mushfek / AverageFileSize.java
Created Nov 10, 2016
JSP Tag Pooling Memory Leak
View AverageFileSize.java
public class AverageFileSize extends SimpleTagSupport {
private boolean humanReadable;
private List<AttachedFile> fileList;
public AverageFileSize(List<AttachedFile> fileList) {
this.humanReadable = false;
this.fileList = fileList;
}
View JSP Tag Pooling Memory Leak
public class AverageFileSize extends SimpleTagSupport {
private boolean humanReadable;
private List<AttachedFile> fileList;
public AverageFileSize(List<AttachedFile> fileList) {
this.humanReadable = false;
this.fileList = fileList;
}
View bootstrap-accordion-panel.html
<!DOCTYPE html>
<html>
<head>
<title>Compose&nbsp;::&nbsp;SComm</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="libs/jquery-1.11.3/jquery-1.11.3.js"></script>
@mushfek
mushfek / workspace.sh
Created Jan 6, 2016 — forked from dixson3/workspace.sh
Create and manage a case-sensitive disk-image on OSX. This is great when you have a need to work with case-sensitive repos on a mac.
View workspace.sh
#!/bin/bash
# where to store the sparse-image
WORKSPACE=~/Documents/workspace.dmg.sparseimage
create() {
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 60g -volname workspace ${WORKSPACE}
}
detach() {
@mushfek
mushfek / set_jdk.sh
Created Dec 13, 2015
Set JDK in bash profile in OS X
View set_jdk.sh
function setjdk() {
if [ $# -ne 0 ]; then
removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'
if [ -n "${JAVA_HOME+x}" ]; then
removeFromPath $JAVA_HOME
fi
export JAVA_HOME=`/usr/libexec/java_home -v $@`
export PATH=$JAVA_HOME/bin:$PATH
fi
}