Posts

Batch script stops after the FOR loop

Code snippet: set zu_kopierende_files[0]="config.ini" set zu_kopierende_files[1]="Anleitung.txt" set zu_kopierende_files[2]="README.md" set zu_kopierende_files[3]="galaxis.exe" set zu_kopierende_files[4]="updater.bat" setlocal enabledelayedexpansion for /l %%n in (0,1,4) do ( echo !zu_kopierende_files[%%n]! move "!SrcFolder!!zu_kopierende_files[%%n]!" "!DstFolder!" ) The files are moved correctly. However, the script then stops. Anyone have any advice?

Are any web features not available in browsers when using self-signed certificates instead of mkcert for local development?

So I know mkcert to generate certificates when one needs HTTPS for local development (e.g., HTTP2). But would a self signed and temporary accepted certificate be enough? Is there any difference once it is accepted? Are all web features available in both cases in all browsers? I.e., is security context the same? I noticed around some hints that this is not so but I could not found any details what exactly would not be the same.

Encountered two children with the same key when requesting a data from fireabase with onChildAdded

Intro I'm creating a chat application and was trying to get rid of useless messages rerenders in a messages list when requesting them with onValue from firebase (snapshot from onValue was overwriting whole messages list state which caused to a rerender of all messages) . Solution i came up with is to use onChildAdded which is triggered once for each existing child and then again every time a new child is added I created a useList hook which supposed to return a list of messages on every change of chatId (when switching between chats) export function useList(chatId) { const [list, setList] = useState([]); const database = getDatabase(); useEffect(() => { setList([]) const chatQuery = query( ref(database, "/messages/" + chatId), orderByValue("timestamp") ); onChildAdded(chatQuery, (data) => { setList((prev) => [...prev, { key: data.key, message: data.val() }]); }); }, [chatId]); return [list]; }...

Hide coordinates in matplotlib

I am currently trying to hide the coordinates in a grid in matplotlib (see code below). Unfortunately no matter which way I try it only the bottom right position gets hidden. All other coordinates/axes are still being displayed. Would be wonderful if someone could help me with that since I do not know what else to try right now. import matplotlib.pyplot as plt from PIL import Image fig,ax = plt.subplots(6,7) plt.axis('off') filenames=['gelb.png'.format(i) for i in range(42)] for i in range(42): #plt.axis('off') with open(filenames[i],'rb') as f: image=Image.open(f) ax[i%6][i//6].imshow(image) fig.show()

Microsoft Access - Group By Condition

I have a column in one of my tables called revenue. The revenue values can be positive or negative. Say there are revenue values such as +100 and -100. Is there a way I can group by revenue, such that it does not read the sign? Meaning it reads -100 and +100 the same?

destructuring a generic type in order to return an objects property

say i have a function which takes a lambda function as a parameter to access/return properties of an object, is there a way for the generic to be destructured (perhaps recursively?) so i know if that property exists? i would prefer not to extend T to any existing type as i would like to keep this functions input types as general as possible heres an example for clarification: const binarySearch = <T, U>(array:T[], value:(T|U), getProperty?:(item:T, index?:number) => U):number => {} where "U" could be any one of "T"s properties and which is called either by acessing a property using a lambda if it is an object array const index = binarySearch(objectArray, objectProperty, (obj) => obj.property) or by using the array value if it isnt const index = binarySearch(primitiveArray, primitive) im expecting the function to behave as a normal binary search method with more versatility as to not have to make several similar functions to access different pr...

Using Powershell to add to XML file

First of all, my coding/scripting skills are 30 years old... So total newbie here. But being forced to deal with some XML. Everything I have done so far I have found on here, but its not quite 100% yet. (The below is made up, of course, I hope there arent any typos...) Here is the situation. I have multiple files: library1.xml library2.xml etc Each file has inventory of each library and looks like this: library1.xml <books> <book> <title>Tale of Two Cities</title> <author>Charles Dickens</author> </book> <book> <title>Lord of the Flies</title> <author>William Golding</author> </book> </books> library2.xml <books> <book> <title>The Red Badge of Courage</title> <author>Stephen Crane</author> </book> <book> <title>The Grapes of Wrath</title> <author>John Steinbeck</author> ...