check https://github.com/KeithGalli/NumPy/blob/master/NumPy%20Tutorial.ipynb and https://www.youtube.com/watch?v=QUT1VHiLmmI&t=2134s
import numpy as np
x = np.array([[1,2,3],[3,4,5],[1,2,5]])
<script> | |
var contentDiv = document.querySelector(".et-pb-contact-message"); | |
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; | |
var observer = new MutationObserver(function(mutations) { | |
mutations.forEach(function(mutation) { | |
if(mutation.type==="childList"&& contentDiv.innerHTML.indexOf("Merci pour votre e-mail") !=-1) { | |
dataLayer.push({'event': 'contactFormSent'}); | |
observer.disconnect(); | |
} | |
}); |
window.addEventListener('message', function (e) { | |
console.log(e.data) | |
}); |
//Listen to datalaLayer.push calls (does not actually execute the push) | |
dataLayer.push = function(obj){ console.log('Something was pushed in the dataLayer');console.log(obj);} |
// Step 1. Add and initialize your third-party JavaScript pixel (make sure to exclude HTML) | |
(function(w, d, s, l, i) { | |
w[l] = w[l] || []; | |
w[l].push({ | |
'gtm.start': new Date().getTime(), | |
event: 'gtm.js' | |
}); | |
var f = d.getElementsByTagName(s)[0], | |
j = d.createElement(s), | |
dl = l != 'dataLayer' ? '&l=' + l : ''; |
def split(arr, size): | |
"""Splits an array to smaller arrays of size""" | |
arrays = [] | |
while len(arr) > size: | |
piece = arr[:size] | |
arrays.append(piece) | |
arr = arr[size:] | |
arrays.append(arr) | |
return arrays |
def take_out_elements(list_object, indices): | |
"""Removes elements from list in specified indices""" | |
removed_elements = [] | |
indices = sorted(indices, reverse=True) | |
for idx in indices: | |
if idx < len(list_object): | |
removed_elements.append(list_object.pop(idx)) | |
return removed_elements |
from PIL import Image | |
def add_border(input_image_path, output_image_path, border_size=100): | |
# Open an existing image | |
img = Image.open(input_image_path) | |
# Get the size of the original image | |
width, height = img.size | |
# Make the new image size as the original size plus the border |
check https://github.com/KeithGalli/NumPy/blob/master/NumPy%20Tutorial.ipynb and https://www.youtube.com/watch?v=QUT1VHiLmmI&t=2134s
import numpy as np
x = np.array([[1,2,3],[3,4,5],[1,2,5]])
""" | |
Script to Remove Duplicate Images from a Folder | |
This script identifies and removes duplicate images within a specified folder. | |
It uses perceptual hashing to generate a unique fingerprint for each image, | |
allowing it to detect duplicates even if the files have different names or formats. | |
What the Code Does: | |
------------------- | |
1. Scans the specified folder for image files (supports common formats such as |