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 svgwrite | |
import re | |
import sys | |
''' | |
A little script to convert Altera waveform (.vwf) to SVG image | |
Make sure you have pip package svgwrite installed by 'pip install svgwrite' | |
Usage 'python vwf2svg.py file_name.vwf' | |
By the way, python 3 please | |
''' |
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
""" | |
Usage: python convtran.py input_name.md output_name.csv/.md | |
Now supports markdown and csv only | |
Python 3 please | |
""" | |
import sys | |
import re | |
re_line = re.compile(r'^\s*-\s*(.+?)\s*[::]\s*(.+?)\s*$') |
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
''' | |
This script helps to convert hex instructions to Quartus .mif files. | |
To run it, use "python hex2mif.py input.txt output.mif" | |
For input file, assuming you are using Mars as assember, | |
you need to export the binary instruction as hexadecimal text file. | |
But for any kind of input files, it should work fine as long as | |
it uses the following format: | |
DEADBEEF | |
BAADF00D | |
''' |
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 PyQt5 import QtGui, QtCore | |
from PyQt5.QtWidgets import QMainWindow, QApplication, QLCDNumber, QWidget, QGridLayout, QPushButton, \ | |
QGraphicsOpacityEffect | |
from PyQt5.QtCore import QTimer, QRect | |
from PyQt5.QtGui import QPainter, QPen, QRegion | |
from datetime import datetime, timedelta | |
import sys | |
''' | |
This short program might provide help to those with neck or waist problems |
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 java.util.Arrays; | |
/** | |
* Author: Towdium | |
* Date: 22/04/19 | |
*/ | |
public class PosNegMergeSort { | |
public static void main(String[] args) { | |
int[] is = new int[]{1, 2, 3, -2, -4, 5, 3, -2, 4, 1, -5, 3}; | |
sort(is); |
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 sys | |
import codecs | |
usage = ''' | |
Usage: python lang2json.py some.lang | |
Python 3 please | |
''' | |
def convert(file): |
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
package me.towdium.pinin; | |
import it.unimi.dsi.fastutil.chars.*; | |
import it.unimi.dsi.fastutil.ints.IntArrayList; | |
import it.unimi.dsi.fastutil.ints.IntList; | |
import it.unimi.dsi.fastutil.ints.IntOpenHashSet; | |
import it.unimi.dsi.fastutil.ints.IntSet; | |
import it.unimi.dsi.fastutil.objects.Object2IntMap; | |
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; | |
import me.towdium.pinin.elements.Element; |
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/bash | |
if [ $# -eq 0 ]; then | |
echo "Usage: global [enable|disable]" | |
exit 1 | |
fi | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 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 collections import defaultdict | |
duration = 0.5 | |
selections = { | |
'HEB-248': 2, | |
'LECm-243': 6, | |
'LEP-239': 24, | |
'LEU-233': 12, | |
'HEU-235': 12 | |
} |
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 asyncio | |
import socket | |
from asyncio.exceptions import IncompleteReadError | |
from enum import Enum | |
from queue import Queue | |
class Type(Enum): | |
PACKET = 1 | |
SETUP = 2 |