Skip to content

Instantly share code, notes, and snippets.

@moonblade
moonblade / cycle.cpp
Last active April 10, 2017 10:45
Graphics lab
#include <iostream>
#include <GL/glut.h>
#include <vector>
#include <math.h>
using namespace std;
#define center 0
// Point class with x and y
class Point{
public:
int x,y;
@moonblade
moonblade / installInstructions.txt
Last active October 9, 2018 03:26
install instructions after pac install
commands
--------
wifi-menu #connect to net
ext4 home, root
fat32 boot
swap swap
mount /dev/sdxY /mnt
mkdir -p /mnt/boot
mount /dev/sdxY /mnt/boot
// polygon Clipping using Sutherland-Hodgeman Algorithm
#include <GL/glut.h>
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <list>
using namespace std;
float xmin=220;
float ymin=220;
float xmax=420;
# In google chrome, install cookies.txt addon, download browser cookies with it to download folder
activity="Motorcycling"
# create csv file if not exist
if [ ! -f ~/mileage.csv ]; then
/usr/bin/echo "date,distance,=sum(b:b)/1000" > ~/mileage.csv
startDate=`date +%Y-%m-%d -d "1 day ago"`
else
startDate=$(/usr/bin/cat ~/mileage.csv | /usr/bin/tail -n1 | /usr/bin/cut -f1 -d,)
startDate=$(date -I -d "$startDate +1 day")
; Read the two 16bit numbers
; x=r3r2
; y=r1r0
movx a,@dptr
mov r3,a
inc dptr
movx a,@dptr
mov r2,a
inc dptr
movx a,@dptr
; 8051 serial communication
; -------------------------
; Serial Controller, SCON register
; 7 SM0 9Fh Serial port mode bit 0
; 6 SM1 9Eh Serial port mode bit 1.
; 5 SM2 9Dh Mutliprocessor Communications Enable (explained later)
; 4 REN 9Ch Receiver Enable. This bit must be set in order to receive characters.
; 3 TB8 9Bh Transmit bit 8. The 9th bit to transmit in mode 2 and 3.
#include <iostream>
/*Socket obviously required*/
#include <sys/socket.h>
/*Any shit ending with _t is prolly from this library*/
#include <sys/types.h>
#include <string>
#include "string.h"
#include "unistd.h"
#include "netinet/in.h"
#define defPort 142536
;read size of first matrix into r0,r1
movx a,@dptr
mov r0,a
inc dptr
movx a,@dptr
mov r1,a
inc dptr
;move start of matrix to r2
mov r2,dpl
;bsearch
;read num to search into r1
movx a,@dptr
inc dptr
mov r1,a
;read final element pos into r2
movx a,@dptr
subb a,#1
mov r2,a
mov r3,#0
@moonblade
moonblade / 0_Instructions
Last active July 19, 2016 18:03
speedLogger
Copy and paste to relevant files in the same path as speed.json
run ./view.sh