Skip to content

Instantly share code, notes, and snippets.

View perara's full-sized avatar
🎯
Focusing

Per-Arne Andersen perara

🎯
Focusing
View GitHub Profile
@perara
perara / gpu.py
Created October 6, 2023 10:51
GPU Costs Calculator - Suggestion
from enum import Enum
class GPU(Enum):
# NVIDIA A100 Tensor Core GPU: 19.5 TFLOPS
A100 = 19.5e12
# NVIDIA K80 GPU (from the Tesla series): 2.91 TFLOPS
K80 = 2.91e12
# NVIDIA V100 Tensor Core GPU: 14 TFLOPS
V100 = 14e12
# NVIDIA TITAN RTX GPU: 16.3 TFLOPS
@perara
perara / rle.lua
Created October 29, 2020 20:40 — forked from Yonaba/rle.lua
Run-Length Encoding Algorithm
-- RLE Encryption Algorithm Implementation
-- Used for data compression
-- Assuming original file is 'test.txt'
local file = io.open("test.txt","rb")
local Ssize = file:seek("end")
file:seek("set",0)
--RLEncodes a single string
function encode(std,flag)
@perara
perara / rsa-crypt.lua
Created October 29, 2020 20:37 — forked from 1lann/rsa-crypt.lua
RSA encryption and decryption library in pure Lua for ComputerCraft
--
-- RSA Encryption/Decryption Library
-- By 1lann
--
-- Refer to license: http://pastebin.com/9gWSyqQt
--
-- See gists comment at the bottom of the page for FAQ and updates!
--
--
local function _W(f) local e=setmetatable({}, {__index = _ENV or getfenv()}) if setfenv then setfenv(f, e) end return f(e) or e end
local bit=_W(function(_ENV, ...)
--[[
This bit API is designed to cope with unsigned integers instead of normal integers
To do this we add checks for overflows: (x > 2^31 ? x - 2 ^ 32 : x)
These are written in long form because no constant folding.
]]
local floor = math.floor
{"main_user_mode":"1","digital_input_tacho_eaf_value":3060,"function_active_secondary_air":false,"components_filter_time_left":6527128,"function_active_heat_recovery":false,"function_active_moisture_transfer":false,"pdm_input_temp_value":246,"function_active_cooling":false,"function_active_heater_cooldown":false,"function_active_free_cooling":false,"supply_air_temp":185,"digital_input_tacho_saf_value":3120,"function_active_cooling_recovery":false,"function_active_service_user_lock":false,"outdoor_air_temp":169,"function_active_heating":false,"function_active_defrosting":false,"function_active_vacuum_cleaner":false,"pdm_input_rh_value":46,"function_active_cooker_hood":false}}', rsv1=False, rsv2=False, rsv3=False)
DEBUG:components.systemair.systemair.systemair:readValues: {'type': 'READ', 'readValues': {'main_user_mode': '1', 'digital_input_tacho_eaf_value': 3060, 'function_active_secondary_air': False, 'components_filter_time_left': 6527128, 'function_active_heat_recovery': False, 'function_active_moisture_tra
import errno
import os
import re
import subprocess
import sys
import urllib3
def prompt_sudo():
ret = 0
@perara
perara / keras_test.py
Last active June 8, 2017 06:36
Keras-Test
# Create first network with Keras
from keras.models import Sequential
from keras.layers import Dense
import numpy
# fix random seed for reproducibility
seed = 7
numpy.random.seed(seed)
# load pima indians dataset
dataset = numpy.loadtxt("pima-indians-diabetes.csv", delimiter=",")
# split into input (X) and output (Y) variables
�PNG

IHDR ` `�/�9IDATx���w|S����I:�-�e�=eC��"*��!�F��-z�[Q\���^ѫׁ8p �8*��L�{h����Ǔ�'i�f6i�y���[N�sN�4���}�ϣ!@DDDDDDDDDDDDD�AM� Q�a��������������(��@HDDDDDDDDDDDD�AX $""""""""""""� ,e�������������2 �DDDDDDDDDDDDD�B""""""""""""� �!Qa��������������(��@HDDDDDDDDDDDD�AX $""""""""""""� ,e�������������2 �DDDDDDDDDDDDD�B""""""""""""� �!Qa��������������(��@HDDDDDDDDDDDD�AX $""""""""""""� ,e�������������2 �DDDDDDDDDDDDD�B""""""""""""� �!Qa��������������(��@HDDDDDDDDDDDD�AX $""""""""""""� ,e�������������2 �DDDDDDDDDDDDD�B""""""""""""� �!Qa��������������(��@HDDDDDDDDDDDD�AX $""""""""""""� ,e�������������2 �DDDDDDDDDDDDD�B""""""""""""� �!Qa��������������(��@HDDDDDDDDDDDD�AX $""""""""""""� ,e�������������2 �DDDDDDDDDDDDD�B""""""""""""� �!Qa��������������(��@HDDDDDDDDDDDD�AҤ@x���;���Ol
package tidi;
import no.uia.tflip.gnult.TestFramework;
import org.testng.annotations.Test;
public class Oblig4Test extends TestFramework {
@Test(timeout=10000)
public void testOppgave1() {
package no.uia.tflip.dependencies.Tools;
import javax.swing.*;
import java.awt.*;
/**
* Created by perar on 03.12.2015.
*/
public class JOptionPane extends javax.swing.JOptionPane {