Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Samir55's full-sized avatar
💭
I may be slow to respond.

Ahmed Samir Abdelreheem Samir55

💭
I may be slow to respond.
View GitHub Profile
import numpy as np
def run(input_file, step=0.1, iterations=1):
n = 0 # Number of nodes.
m = 0 # Number of voltage sources.
components = [] # List of all components found in the netlist.
node_res_dic = {} # Dictionary of resistances where key is the node number and the resistance is the value.
res_node_dic = {} # Dictionary of resistances where key is the resistance and the node number is the value.
import ast
def encode(input_file, output_file):
payloads = [x.rstrip() for x in open(input_file)]
# Append char count
payloads_with_char_count = []
for pl in payloads:
payload_with_char_count = str(len(pl) + 2) + pl
payloads_with_char_count.append(payload_with_char_count)
@Samir55
Samir55 / textmass.py
Created July 28, 2018 04:09 — forked from kanzure/textmass.py
hplusroadmap irc log visualization
"""
Render an image of the "text mass" per minute per day of logs. Horizontal
minutes against vertical days. The color of each pixel represents the relative
text mass for that time slice (that minute).
http://gnusha.org/logs/graphs/300-days-anycolor-heatmap-cropped-sorted.png
1440 minutes/day
2555 days
1440 * 2555
package main
import (
"bufio"
"fmt"
"log"
"os"
"strings"
)