Skip to content

Instantly share code, notes, and snippets.

@rohanraarora
rohanraarora / Dockerfile
Created January 22, 2019 17:45
isolate issue docker file
FROM continuumio/anaconda3:latest
RUN apt-get update && apt-get install -y \
git \
make \
libcap-dev \
software-properties-common \
wget
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
@rohanraarora
rohanraarora / strace.log
Created January 22, 2019 13:35
Strace Log for isolate
11 execve("/usr/local/bin/isolate", ["isolate", "--cg", "-b", "6", "-o", "out", "-r", "err", "-M", "meta", "-t", "10", "-p", "--cg-mem", "256000", "--share-net", "--full-env", "--dir=/etc/", "--dir=/opt/:rw", "--run", "/opt/conda/bin/python3", "a.py"], [/* 12 vars */]) = 0
11 brk(NULL) = 0x55a6bd57a000
11 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
11 mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fdc70f8b000
11 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
11 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
11 fstat(3, {st_mode=S_IFREG|0644, st_size=22689, ...}) = 0
11 mmap(NULL, 22689, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fdc70f85000
11 close(3) = 0
11 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
@rohanraarora
rohanraarora / ImageBadgeView
Created September 5, 2016 19:56
Image View with a badge on top right corner like notification count in facebook and other apps.
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.ImageView;
@rohanraarora
rohanraarora / PuzzleBoardPriorityQueue.java
Created November 29, 2015 17:30
Priority Queue implementation for PuzzeBoard in Puzzle8 game
package com.google.engedu.puzzle8;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.NoSuchElementException;
/**
* Created by Rohan on 11/27/2015.
*/
public class PuzzleBoardPriorityQueue {