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
| ;;; Emacs Config | |
| ;; by Dieter Brehm | |
| ;; place custom lisp code here | |
| (add-to-list 'load-path "~/.emacs.d/custom-lisp") | |
| ;; improve startup time | |
| (setq-default file-name-handler-alist nil | |
| gc-cons-threshold 402653184 | |
| gc-cons-percentage 0.6) |
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
| struct Speeds { | |
| // struct | |
| int left; | |
| int right; | |
| }; | |
| Speeds new_speed; | |
| Speeds last_speed; | |
| Speeds PID(int leftSensor, int rightSensor) { |
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 UIKit | |
| import Foundation | |
| import PlaygroundSupport | |
| var str = "Hello, playground" | |
| var fileName = "thisisatest.txt" | |
| let fileUrl = playgroundSharedDataDirectory.appendingPathComponent(fileName) | |
| let listOfTasks = [["Hi", "Hello", "12:00"], ["Hey there", "What's up?", "3:17"], [1,2,3,4]] |
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
| ;; append string from my-agend-indent-string to the agenda itself | |
| (defun my-agenda-prefix () | |
| (format "%s" (my-agenda-indent-string (org-current-level)))) | |
| ;; generate a string that contains correct hierarchy for a task | |
| ;; given it's level, i.e. "──►" | |
| (defun my-agenda-indent-string (level) | |
| (if (= level 1) | |
| "" | |
| (let ((str "")) |
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
| #!/bin/bash | |
| # This script allows for the quick creation of project directories for quick c++ practicing | |
| #create directory structure | |
| if [ ! -d practice-$1 ]; then | |
| git init practice-$1 | |
| mkdir practice-$1/src practice-$1/build practice-$1/includes | |
| cd practice-$1 | |
| else |
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
| aTrain = [1, 0, 1, 0, 0, 0] | |
| # list as input | |
| # return tuple or length 2 with two lists of resultant trains | |
| def splitTrain(train): | |
| inputTrain = train | |
| inputLength = len(inputTrain) | |
| inputMiddleIndex = inputLength // 2 |
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
| var a = [34, 203, 3, 746, 200, 984, 198, 764, 9]; | |
| function bubbleSort(a) | |
| { | |
| var swapped; | |
| do { | |
| swapped = false; | |
| for (var i=0; i < a.length-1; i++) { | |
| if (a[i] > a[i+1]) { | |
| var temp = a[i]; |
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 73 columns, instead of 61 in line 1.
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
| "W","h","e","n"," ","P","i","c","k","i","n","g"," ","A","p","p","l","e","s"," ","o","n"," ","a"," ","F","a","r","m"," ","W","i","t","h"," ","5",",","0","0","0"," ","R","u","l","e","s",","," ","W","a","t","c","h"," ","O","u","t"," ","f","o","r"," ","t","h","e"," ","L","a","d","d","e","r","s" | |
| "A"," ","C","a","m","p","a","i","g","n"," ","M","e","m","o","i","r"," ","T","h","a","t"," ","S","h","o","w","s"," ","T","r","u","m","p",","," ","a","t"," ","L","e","a","s","t"," ","P","a","r","t","l","y",","," ","a","s"," ","H","e"," ","I","s" | |
| "O","n"," ","N","e","w"," ","I","n","d","i","a","n"," ","C","o","n","d","o","s",","," ","t","h","e"," ","N","a","m","e"," ","I","s"," ","T","r","u","m","p",","," ","a","n","d"," ","t","h","e"," ","L","u","r","e"," ","I","s"," ","M","e","e","t","i","n","g"," ","O","n","e" | |
| "‘","T","r","u","m","p"," ","P","l","a","c","e","’"," ","A","s","k","s"," ","i","f"," ","I","t"," ","C","a","n"," ","B","e"," ","C","a","l","l","e","d"," ","b","y"," ","A","n","y"," ","O","t","h","e","r"," ","N","a", |
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 math | |
| while(1): | |
| robotLeft = 0 | |
| robotRight = 0 | |
| x = float(input("Input x \n")) | |
| y = float(input("Input y \n")) | |
| z = float(input("Input z \n")) |
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
| ;;; Emacs Config | |
| ;;;; indentation | |
| (setq c-default-style "linux" | |
| c-basic-offset 4 | |
| sgml-basic-offset 4) | |
| (c-set-offset `inline-open 0) | |
| (setq-default tab-width 4) | |
| ;;;; misc | |
| (setq-default show-trailing-whitespace t) |
NewerOlder