The White Rabbit

Dress for the job you want, not the job you have.

Tag: code

See the content related to code...

Thursday, 9 March 2023

Store/Update state object after asynchronous changing its value in ReactJS

State variables can be changed as soon as they change values. Here's how to do it using useCallback() function.

reactjs code

Monday, 6 March 2023

Sort Map Object in Javascript by values

A simple one-liner to convert a Javascript/Typescript Map Object to an array sorted according to the Map's value.

code typescript javascript

Saturday, 22 October 2022

Bellman-Ford algorithm [Python Code]

The Bellman-Ford algorithm finds the shortest path from a given source node to all other nodes allowing edges with negative weights. Here's a ready to use Python code implementing it.

python code algorithm

Wednesday, 23 March 2022

Calculate correlation coefficient between arrays of different length

Can the Pearson coefficient be computed between two numeric arrays, if these have different size? Let's what does it mean.

python code data

Sunday, 29 March 2020

Create a simple GUI in Python using Kivy

I'm going to introduce two very basic sample codes to give a simple overview on the Kivy library. It's assumed that you have already installed it.

code GUI kivy