Skip to content

Instantly share code, notes, and snippets.

View mushfek's full-sized avatar

Mushfekur Rahman mushfek

View GitHub Profile
from ortools.algorithms import pywrapknapsack_solver
def main():
solver = pywrapknapsack_solver.KnapsackSolver(
pywrapknapsack_solver.KnapsackSolver.
KNAPSACK_MULTIDIMENSION_BRANCH_AND_BOUND_SOLVER, 'KnapsackExample')
values = [
360, 83, 59, 130, 431, 67, 230, 52, 93, 125, 670, 892, 600, 38, 48, 147,
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')
@mushfek
mushfek / cheat_sheet.txt
Created October 3, 2021 22:07
GDB cheat sheet
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
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 January 2, 2017 06:40 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@mushfek
mushfek / AverageFileSize.java
Created November 10, 2016 05:08
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;
}
public class AverageFileSize extends SimpleTagSupport {
private boolean humanReadable;
private List<AttachedFile> fileList;
public AverageFileSize(List<AttachedFile> fileList) {
this.humanReadable = false;
this.fileList = fileList;
}
<!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 January 6, 2016 15:22 — 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.
#!/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() {