This file contains hidden or 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
| #include <cmath> | |
| #include <iostream> | |
| const class Complex operator+(const class Complex &a, const class Complex &b); | |
| const class Complex operator-(const class Complex &a, const class Complex &b); | |
| const class Complex operator-(const class Complex &a); | |
| const class Complex operator*(const class Complex &a, const double b); | |
| const class Complex operator*(const class Complex &a, const class Complex &b); | |
| const class Complex operator/(const class Complex &a, const double b); | |
| const class Complex operator/(const class Complex &a, const class Complex &b); |
This file contains hidden or 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
| class HalfAdder : public LogicComponent<2, 2> { | |
| public: | |
| enum Outputs { SUM, CARRY_OUT }; | |
| HalfAdder(LogicGate *A, LogicGate *B) | |
| : A_(A), B_(B), sum(A_, B_), carry(A_, B_){}; | |
| bool read(int output) { | |
| switch (output) { | |
| case SUM: | |
| return sum.read(); |
This file contains hidden or 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
| 0: mdr = {`STORE, 5'd30}; // disp | |
| 1: mdr = {`LOAD, 5'd12}; // bottom - label: :start: | |
| 2: mdr = {`STORE, 5'd16}; // i | |
| 3: mdr = {`LOAD, 5'd16}; // i - label: :loop: | |
| 4: mdr = {`STORE, 5'd30}; // disp | |
| 5: mdr = {`ADD, 5'd12}; // bottom - add bottom (instead of inc) to keep within the ROM | |
| 6: mdr = {`STORE, 5'd16}; // i | |
| 7: mdr = {`LOAD, 5'd13}; // top | |
| 8: mdr = {`SUB, 5'd16}; // i | |
| 9: mdr = {`BNE, 5'd15}; // :loop: |
This file contains hidden or 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
| void voltage_update(property_t *prop) { | |
| //draw_pval(prop); | |
| UG_ConsolePutString("voltage\n"); | |
| } | |
| int main(void) { | |
| init_property_timer(5); | |
| sei(); | |
| property_t voltage = {.x = 0, |
This file contains hidden or 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
| #ifndef GAME_H | |
| #define GAME_H | |
| #include <avr/io.h> | |
| #include <avr/interrupt.h> | |
| #include <util/delay.h> | |
| #include <math.h> | |
| #include "gamestates.h" | |
| #include "debug.h" |
This file contains hidden or 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
| typedef struct { | |
| rectangle rect, oldRect; | |
| // signed ints | |
| int direction, theta, intercept, | |
| width, height, | |
| // fixed is whether it moves on collision | |
| // hittable is whether it collides | |
| // collision is a flag, if it is high then there is a | |
| // collision and it doesn't check the collision again | |
| fixed, hittable, collision; |
This file contains hidden or 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
| $drawings = Get-ChildItem -recurse -Filter "*.vsd" | |
| Write-Host "Converting Visio documents to PDF..." -ForegroundColor Cyan | |
| try { | |
| $visio = New-Object -ComObject Visio.Application | |
| $visio.Visible = $true | |
| foreach ($drawing in $drawings) { | |
| try { | |
| $pdfname = [IO.Path]::ChangeExtension($drawing.FullName, '.pdf') |
This file contains hidden or 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
| ● wat.service - lol | |
| Loaded: loaded (/etc/systemd/system/wat.service; disabled) | |
| Active: active (running) since Sun 2016-09-25 19:15:52 UTC; 1s ago | |
| Main PID: 7453 (node) | |
| CGroup: /system.slice/wat.service | |
| └─7453 node /usr/bin/lounge start | |
| Sep 25 19:15:52 raspberrypi systemd[1]: Started lol. |
This file contains hidden or 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 re | |
| import argparse | |
| parser = argparse.ArgumentParser(description='Parse diff file out xml') | |
| parser.add_argument('--target', metavar='-I', type=str, required=True, | |
| help='relative path to the input diff file') | |
| parser.add_argument('--out', metavar='-O', type=str, default='out.xml', | |
| help='relative path to the output file') | |
| args = parser.parse_args() |
This file contains hidden or 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 math import sqrt | |
| class Board(): | |
| def __init__(self, size): | |
| self.size = size | |
| self.squareSize = sqrt(self.size) | |
| self.board = self.generateBoard(size) | |
| def generateBoard(self, size): |