Windows check battery usage history
powercfg /batteryreport /output “C:battery_report.html”
All the wonders in my mind, sparks in my life, too bad to just waste them 所有我脑海中的奇观, 生活中的那些火花, 浪费不是可惜了? Creations in My Mind, Sparks in My Life, Not Wasted
powercfg /batteryreport /output “C:battery_report.html”
when press back button, safari will navigate to the page that is same as when we leave, we don't want that, use this code!
window.onpageshow = function(event) {
if (event.persisted) {
window.location.reload()
}
};
use this css
.modal-open .container {
-webkit-filter: blur(5px) grayscale(90%);
filter: blur(5px) grayscale(90%);
}
from stackoverflow: https://stackoverflow.com/questions/54122806/how-to-make-background-blur-when-html-popup-modal-opens
git shortlog --no-merges >1.txt
windows run this ???? ????
_
the pygame redraw map in a while loop, so we just need calculate time and then using different image path.
so we use image sequence to simulate gif.
use
imgGif = Gif('./gif/talks/')
write your own image sequence folder in the code.
use function build_gif(screen, x, y, gif, million_seconds)
in the while loop of pygame.
for example:
build_gif(screen, x, y, imgGif, 500)
and this is the source file.
import time
import os
import pygame
class Gif:
def __init__(self, gif_path):
self.current_index = 0
self.sync_time = int(round(time.time() * 1000))
self.gif_path = gif_path
self.image_path_arr = os.listdir(gif_path)
imgGif = Gif('./gif/talks/')
# first input Gif folder path here
ux = 25
uy = 25
# use this funtion in 'creation_niveau' to build gif
def build_gif(screen, x, y, gif, million_seconds):
img = pygame.image.load(get_gif_sequence(gif, million_seconds))
img = pygame.transform.scale(img, (ux, uy))
screen.blit(img, (x * ux, y * uy))
def get_gif_sequence(gif, time_between_gifs):
current_index = gif.current_index
sync_time = gif.sync_time
gif_path = gif.gif_path
image_path_arr = gif.image_path_arr
all_length = len(image_path_arr)
img_path = gif_path + image_path_arr[current_index]
new_time = int(round(time.time() * 1000))
if new_time - sync_time > time_between_gifs:
gif.sync_time = new_time
if current_index < all_length - 1:
gif.current_index += 1
else:
gif.current_index = 0
else:
pass
return img_path