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 cv2 | |
| # Load the reference and target images | |
| reference_image = cv2.imread('reference_image.jpg') | |
| target_image = cv2.imread('target_image.jpg') | |
| # Convert to LAB color space (preserves color information) | |
| reference_image_lab = cv2.cvtColor(reference_image, cv2.COLOR_BGR2LAB) | |
| target_image_lab = cv2.cvtColor(target_image, cv2.COLOR_BGR2LAB) |
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 | |
| if [ "$1" == "" ]; then | |
| echo "Missing $component name" | |
| exit 0 | |
| fi | |
| for comp in "$@" | |
| do | |
| if [ ! -d ./$comp ]; then |
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
| varying vec2 vUv; | |
| void main() { | |
| gl_FragColor = vec4(vUv, 0.0, 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
| initImageHoverListeners = (image: HTMLImageElement): void => { | |
| const imageButtonId = 'bai-image-btn-container' | |
| const imageLink = this.getImageContainer(image) | |
| const buttonContainer = this.getButtonContainer('image') | |
| if (imageLink) { | |
| const wrapper = imageLink.parentNode | |
| wrapper?.addEventListener('mouseover', (e) => { | |
| if (e.target === image) { | |
| document.getElementById(imageButtonId)?.remove() |
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
| const blackListedRouterError = | |
| Number( | |
| [...document.querySelectorAll("th")] | |
| .filter(a => a.textContent.includes("[FILTERED] blacklisted")) | |
| [0] | |
| .nextSibling | |
| .innerText | |
| ) > 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
| @{% | |
| const filter = d => d.filter(dp => dp) | |
| %} | |
| main -> | |
| _ add_sub _ {% filter %} | |
| | _ add_sub _ "=" _ add_sub _ {% filter %} | |
| exp -> | |
| add_sub _ "^" _ exp |
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
| number -> | |
| int {% id %} | |
| | float {% id %} | |
| | "-" int {% function(d) { return(d[0] + d[1]) } %} | |
| | "-" float {% function(d) { return(d[0] + d[1]) } %} | |
| float -> | |
| int "." [0-9]:+ {% function(d) { return(d[0] + d[1] + d[2].join("")) } %} | |
| | "." [0-9]:+ {% function(d) { return(d[0] + d[1].join("")) } %} | |
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
| main -> | |
| polynom | |
| polynom -> | |
| _ add_sub _ | |
| | _ add_sub _ "=" _ add_sub _ | |
| parens -> | |
| "(" _ add_sub _ ")" | |
| | term |
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
| # coding: utf-8 | |
| # In[30]: | |
| import os | |
| import json | |
| from contextlib import closing | |
| from bs4 import BeautifulSoup | |
| import csv |
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
| // down | |
| const nextIndex = ( currIdx - 1 + elems.length ) % elems.length | |
| // up | |
| const nextIndex = ( currIdx + 1) % elems.length |
NewerOlder