This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mkdir out | |
pdf2ps $1 - | ps2pdf - $1.tmp | |
mv $1.tmp out/$1 | |
# References: | |
## https://unix.stackexchange.com/a/162925 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# That's commands.txt file | |
echo Hello world | |
echo How are you? | |
echo EleNaum | |
echo Almost finished... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python code to parse a (sub)tree starting from a node nid to the horizontal format. | |
# Returns a python list with node IDs. None elements indicates backtracking | |
def tree_to_hformat(tree, nid = 0, list_hformat=None): | |
if list_hformat is None: | |
list_hformat = [] | |
list_hformat.append(nid) | |
for child in tree.successors(nid): | |
tree_to_hformat(tree, child, list_hformat) | |
list_hformat.append(None) | |
return(list_hformat) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
from z3 import * | |
# we have that | |
s = Solver() | |
## mu0_px is the initial marking for place px; | |
mu_p1, mu_p2, mu_p3 = 0, 0, 1 | |
## pi_tj is the pre-condition from place pi to transition tj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
from z3 import * | |
# we have that | |
s = Solver() | |
## mu0_px is the initial marking for place px; | |
mu_p1, mu_p2, mu_p3 = 0, 0, 1 | |
## pi_tj is the pre-condition from place pi to transition tj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
damasceno@princeton-lnx:~/git/fault-identification-in-petri-nets$ ./find_fault.sh | |
[f_p1 >= 0, | |
f_p2 >= 0, | |
f_p3 >= 0, | |
p1_f >= 0, | |
p2_f >= 0, | |
p3_f >= 0, | |
l0 >= 0, | |
Exists(l0, | |
And(0 + l0*(f_p1 - p1_f) >= 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | finalScore | finalScore_sort | scenario | timeElapsed | routeCompleted | collisions | wrongLane | offRoute | redLights | |
---|---|---|---|---|---|---|---|---|---|---|
1 | 1608110491599 | 1608110491599 | In | 79 | 11 | 8 | 501 | 703 | 1 | |
2 | 1659092618299 | 1659092618299 | tincidunt | 43 | 41 | 5 | 609 | 447 | 10 | |
3 | 1685071296499 | 1685071296499 | velit | 64 | 2 | 6 | 263 | 302 | 9 | |
4 | 1684051589699 | 1684051589699 | nec | 47 | 98 | 2 | 69 | 899 | 1 | |
5 | 1644052309799 | 1644052309799 | tempor, | 84 | 98 | 5 | 229 | 379 | 9 | |
6 | 1656050688199 | 1656050688199 | nascetur | 22 | 83 | 7 | 272 | 610 | 10 | |
7 | 1604040618199 | 1604040618199 | ac | 30 | 42 | 9 | 613 | 940 | 9 | |
8 | 1665040816299 | 1665040816299 | sit | 3 | 31 | 10 | 422 | 312 | 7 | |
9 | 1603070413999 | 1603070413999 | Nunc | 81 | 87 | 5 | 425 | 42 | 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from escposprinter import printer | |
import qrcode | |
import math | |
from PIL import Image | |
def make_custom_qr(data): | |
# Create qr code instance | |
qr = qrcode.QRCode( | |
version=1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
import os | |
import pyautogui | |
# Capture video data from screen in Python | |
# https://stackoverflow.com/questions/35097837/capture-video-data-from-screen-in-python | |
output = "video.avi" | |
img = pyautogui.screenshot() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
import pygame.camera | |
from pygame.locals import * | |
DEVICE = '/dev/video0' | |
SIZE = (640, 480) | |
FILENAME = 'capture.png' | |
def camstream(): | |
pygame.init() |
NewerOlder