Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python3
import rtmidi
import mido
outport=mido.open_output('UM-1:UM-1 MIDI 1 24:0')
# I/O Menu
msg=mido.Message('sysex',data=[0x00,0x20,0x32,0x00,0x12,0x22,0x7f,0x01,0x00,0x01,0x05])
outport.send(msg)
# I/O Page 1
require 'gtk2'
require 'lifx'
si = Gtk::StatusIcon.new
si.stock = Gtk::Stock::DIALOG_INFO
menu = Gtk::Menu.new
quit = Gtk::ImageMenuItem.new(Gtk::Stock::QUIT)
pink = Gtk::MenuItem.new "Pink"
white = Gtk::MenuItem.new "White"
* Assignment Q1c3
* Student Number: 139193170
V1 in 0 DC 10
R1 in 1 17
L1 1 2 1
C1 2 0 30u
.control
tran 0.1ms 1 UIC
plot V(2)
! xscreensaver ---------------------------------------------------------------
!font settings
xscreensaver.Dialog.headingFont: -*-dina-bold-r-*-*-12-*-*-*-*-*-*-*
xscreensaver.Dialog.bodyFont: -*-dina-medium-r-*-*-12-*-*-*-*-*-*-*
xscreensaver.Dialog.labelFont: -*-dina-medium-r-*-*-12-*-*-*-*-*-*-*
xscreensaver.Dialog.unameFont: -*-dina-medium-r-*-*-12-*-*-*-*-*-*-*
xscreensaver.Dialog.buttonFont: -*-dina-bold-r-*-*-12-*-*-*-*-*-*-*
xscreensaver.Dialog.dateFont: -*-dina-medium-r-*-*-12-*-*-*-*-*-*-*
xscreensaver.passwd.passwdFont: -*-dina-bold-r-*-*-12-*-*-*-*-*-*-*
Section "InputClass"
Identifier "evdev keyboard catchall"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "XbkModel" "thinkpad60"
Option "XkbLayout" "gb"
Option "XkbOptions" "ctrl:nocaps"
EndSection
Section "InputClass"
Identifier "evdev keyboard catchall"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "XbkModel" "thinkpad60"
Option "XkbLayout" "gb"
Option "XkbOptions" "ctrl:nocaps"
EndSection
*Maths Assignment
V1 in 0 ac 240V sin(0 1 50Hz)
R1 in 1 12
L1 1 2 0.1
C1 2 0 160u
.control
ac lin 1 50 50
print ph(-I(V1)) mag(I(v1))
.endc
.END
*Maths Assignment
V1 in 0 ac 240V sin(0 1 50Hz)
R1 in 1 12
L1 1 2 0.1
C1 2 0 160u
.control
ac lin 1 50 50
print ph(-I(V1)) mag(I(v1))
.endc
.END
Case #1: 1657
Case #2: 5495
Case #3: 2254
Case #4: 5982
Case #5: 3958
Case #6: 3897
Case #7: 4877
Case #8: 348
Case #9: 2962
Case #10: 2138
#!/bin/sh
sleep 1
DOCKED=$(cat /sys/devices/platform/dock.0/docked)
case "$DOCKED" in
"0")
XAUTHORITY=/home/duncan/.Xauthority /usr/bin/xrandr -d :0 --output DVI-D-0 --off
;;
"1")
#do nothing
;;