This file contains 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 sys | |
import collections | |
def extract_ids(filename): | |
with open(filename, "r") as file: | |
return [line.split()[2].split("#")[0] for line in file] | |
def count_ids(filename): |
This file contains 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
PROMPT="%(?:%{$fg_bold[green]%}%1{➜%} :%{$fg_bold[red]%}%1{➜%} ) %{$fg[cyan]%}%d%{$reset_color%}" | |
PROMPT+=' $(git_prompt_info)' | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}%1{*%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}" |
This file contains 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
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x700000035},{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000064}]}' |
This file contains 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
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x700000064},{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}]}' |
This file contains 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 <TroykaMQ.h> | |
#include "RTClib.h" | |
#include <SPI.h> | |
#include <SD.h> | |
#include <LiquidCrystal_PCF8574.h> | |
#include <Wire.h> | |
#define MAX_ACCEPTABLE_LPG_VALUE 1000 | |
#define MAX_ACCEPTABLE_METHANE_VALUE 1000 | |
#define MAX_ACCEPTABLE_SMOKE_VALUE 1500 |
This file contains 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
int findLinkedListSize(node<int>* ll) { | |
int size = 0; | |
while (ll != NULL) { | |
++size; | |
ll = ll->next; | |
} | |
return size; | |
} |
This file contains 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 fillgaps(node<int>* l) { | |
if(l == nullptr) { | |
return; | |
} | |
node<int>* current = l; | |
while (current->next != NULL) | |
{ | |
if (current->data != (current->next->data - 1)) | |
{ |
This file contains 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
/** | |
* Finds and returns an element by its index. | |
* | |
* @tparam T type | |
* @param index index of the required element. | |
* @return the element required | |
*/ | |
template<typename T> | |
T LinkedList<T>::get(const int index) const { | |
if (index < 0 || index >= _size) { |
This file contains 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
/** | |
* Remove an element from a specified index. | |
* | |
* @tparam T type | |
* @param index index of an element | |
*/ | |
template<typename T> | |
void LinkedList<T>::removeAt(const int index) { | |
if (index < 0 || index >= _size) { | |
// If the index is out of bounds, throw an exception. |
This file contains 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
/** | |
* Remove all elements from the data structure which match | |
* the item provided. | |
* | |
* @tparam T type | |
* @param item item to be removed | |
*/ | |
template<typename T> | |
void LinkedList<T>::remove(const T &item) { | |
// Initialize pointers to two consecutive elements |
NewerOlder