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 os | |
import re | |
with open("makefile", "r") as file: | |
data = file.read().split('\n') | |
i, error = 1, 0 | |
for argument in data: | |
pattern = re.compile(r'(?:as\s)(python)(\sdna.py\sdatabases/[a-zA-Z]+\.csv\ssequences/[0-9]+\.txt)') | |
command = pattern.finditer(argument) | |
namept = re.compile(r'(No\s)?[a-zA-Z]+\.$') |
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
<div id="pop-up" class="pop-up hidden"> | |
<div class="pop-up-window" id="pop-up-window"> | |
<div id="pop-up-close" class="pop-up-close">✕</div> | |
<div id="pop-up-content" class="pop-up-content"> | |
</div> | |
</div> | |
</div> | |
<div class="pop-up-call" data-content="(some HTML)"></div> |
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
<div class="flex"> | |
<div class="show-gallery-item-on-hover"></div> | |
<div class="gallery-item" id="gallery-item-first"> | |
<img src="https://via.placeholder.com/350x250/0000FF/808080%20" alt="placeholder"> | |
</div> | |
<div class="gallery-item" id="gallery-item-second"> | |
<img src="https://via.placeholder.com/350x250" alt="placeholder"> | |
</div> | |
<div class="gallery-item" id="gallery-item-third"> | |
<img src="https://via.placeholder.com/350x250/FF10A8/202020%20"> |
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 re | |
def dictwriter(dict_list, delimiter=",", end="\n"): | |
return re.sub(",,", "", end.join([delimiter.join(items) for items in [list([str(v) for (k,v) in list_item.items()]) for list_item in dict_list]])) |
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
// TESTING PURPOSES: converts an array as a string for printing | |
// e.g., show_arr({1, 2, 3}, 3, char[10], 10) (psuedo-code) | |
void show_arr(int arr[], int len_a, char* p, int len_p) { | |
// The function begins by testing whether the passed string container has | |
// sufficient space to store the string-casted array. It accounts for the | |
// opening and closing curly braces, each digit, and a separating comma | |
// between values. Thus, character_count starts at 2 for curly braces. | |
// Then it is incremented by 1 for each value in the array and | |
// incremented by the number of digits in each value as well. |
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
const binary_search = (arr, q) => { | |
const halfway = (l, h) => { return Math.floor((l + h) / 2) } | |
const strcmp = ( str1, str2 ) => { | |
// http://kevin.vanzonneveld.net | |
// + original by: Waldo Malqui Silva | |
// + input by: Steve Hilder | |
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) | |
// + revised by: gorthaur |
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 display(int val) { | |
for(int i = 0, s = sizeof(val) * 8; i < s; i++) { | |
if (!(i % 8) && i != 0) { | |
printf(" "); | |
} | |
printf("%d", (val >> (s - 1 - i)) & 0x01); | |
} | |
printf("\n"); | |
} |
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 { useEffect, useState } from "react"; | |
import Image from 'next/image'; | |
function Gallery({images, viewerHandler}) { | |
const [active, setActive] = useState(""); | |
const [scaleUpAnimation, setScaleUpAnimation] = useState(""); | |
const root = images.root; | |
images = images.paths; |
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 {useState} from 'react'; | |
import Select from 'select'; | |
export default function index() { | |
const options = ['Option A', 'Option B', 'Option C']; | |
const [activeOption, setActiveOption] = useState('Option A'); | |
return ( | |
<> | |
<Select options={options} setSelected={setActiveOption} /> |
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 numpy as np | |
class Trial(object): | |
def __init__(self, mass, data, height): | |
self.mass = mass | |
self.data = data | |
self.energy = self.mass * 9.8 * height | |
self.average = np.average(self.data) | |
self.std = np.std(self.data) | |
self.error = self.std / np.sqrt(len(self.data)) |
OlderNewer