Skip to content

Instantly share code, notes, and snippets.

View Sumith1896's full-sized avatar
🎉

Sumith Kulal Sumith1896

🎉
View GitHub Profile
@Sumith1896
Sumith1896 / keybindings.json
Created February 14, 2022 21:59
vscode keybindings
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+i",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": "import ipdb; ipdb.set_trace()"
}
}
@Sumith1896
Sumith1896 / weightgen-build.log
Created September 27, 2017 14:33
weightgen build log
sumith1896@yoda:~/github/weightgen/src/build$ make
make all-recursive
make[1]: Entering directory `/home/sumith1896/github/weightgen/src/build'
Making all in cmsat
make[2]: Entering directory `/home/sumith1896/github/weightgen/src/build/cmsat'
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../cmsat -I.. -Wall -I../../cmsat/../ -fopenmp -g -O3 -Wall -pedantic -std=c++11 -lrt -MT ClauseCleaner.lo -MD -MP -MF .deps/ClauseCleaner.Tpo -c -o ClauseCleaner.lo ../../cmsat/ClauseCleaner.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../cmsat -I.. -Wall -I../../cmsat/../ -fopenmp -g -O3 -Wall -pedantic -std=c++11 -lrt -MT ClauseCleaner.lo -MD -MP -MF .deps/ClauseCleaner.Tpo -c ../../cmsat/ClauseCleaner.cpp -fPIC -DPIC -o .libs/ClauseCleaner.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../cmsat -I.. -Wall -I../../cmsat/../ -fopenmp -g -O3 -Wall -pedantic -std=c++11 -lrt -MT ClauseCleaner.lo -MD -MP -MF .deps/ClauseCleaner.Tpo -c ../../cmsat/ClauseCleaner.cpp -o ClauseClean
@Sumith1896
Sumith1896 / calculateweight.cpp
Last active September 27, 2017 14:27
weightgen calculate weight
float Main::CalculateSolutionWeightNonFactored(Solver &solver){
double weightTotal = 0;
for (int i = 0;i<conf.weightVariables;i++){
Var var = weightVariables.at(i);
//printf("%d %d\n",var, solver.model[var]);
if (solver.model[var] == l_True){
weightTotal = weightTotal*2+1;
}
else{
weightTotal *= 2;
(remove-child!
(lambda (parent child)
(if (enum-set-contains?
(apply enum-set-union
(map (curry vertex-parents graph)
(vertex-children graph child)))
parent)
(void)
(begin
(enum-set-remove! (vector-ref mb parent) child)
(define num-asserts (length (asserts)))
(printf "Number of asserts made ~a~%" num-asserts)
; (define old-asserts (asserts))
; (clear-asserts!)
; (displayln "Printing time for filtering out clauses")
; (for ([asrt old-asserts])
; (when (! (sat? (solve (assert (not asrt)))))
; (displayln asrt)))
; (define new-asserts
@Sumith1896
Sumith1896 / print.sh
Created May 25, 2017 00:16
Print @ UW
echo "Starting printing job";
file="$1";
fullpath=$(readlink -f "$file");
filename=$(basename "$fullpath");
scp "$fullpath" kulal@barb:;
ssh kulal@barb "lpr -Ppsc441 $filename";
ssh kulal@barb "rm -f $filename";
echo "Successfully printed $filename";
@Sumith1896
Sumith1896 / orderedFill.scala
Last active May 13, 2016 15:19
Filling DP table in order
package wihtOrb
import leon._
import mem._
import lang._
import annotation._
import com.sun.xml.internal.bind.v2.runtime.reflect.Lister.Pack
import instrumentation._
import invariant._
Setting up xz-utils (5.1.1alpha+20120614-2+b3) ...
update-alternatives: using /usr/bin/xz to provide /usr/bin/lzma (lzma) in auto mode
Setting up binutils (2.25-5) ...
Setting up cpp-4.9 (4.9.2-10) ...
Setting up cpp (4:4.9.2-2) ...
Setting up libgcc-4.9-dev:amd64 (4.9.2-10) ...
Setting up gcc-4.9 (4.9.2-10) ...
Setting up gcc (4:4.9.2-2) ...
Setting up libstdc++-4.9-dev:amd64 (4.9.2-10) ...
Setting up g++-4.9 (4.9.2-10) ...
sumith1896@yoda:~$ dig google.com
; <<>> DiG 9.9.5-3ubuntu0.8-Ubuntu <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45897
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;google.com. IN A
root@0dbd42a5f00a:/# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 172.17.0.1 0.0.0.0 UG 0 0 0 eth0
172.17.0.0 * 255.255.0.0 U 0 0 0 eth0
root@0dbd42a5f00a:/#