I was using Pyrebase
to manage firebase with python
Was getting key is not a JWK object
when calling
import pyrebase
firebase = pyrebase.initialize_app(FIREBASE_CONFIG)
auth = firebase.auth()
-> token = auth.create_custom_token(...)
def flatten(input, result: dict, parent_key: str): | |
if type(input) is list: | |
i = 0 | |
for d in input: | |
key = f"{i}" | |
if parent_key is not None: | |
key = f"{parent_key}.{i}" | |
flatten(d, result, f"{key}") | |
i += 1 |
// Problem 1 | |
private Integer[] problem1(Integer[] arr) { | |
Integer[] result = new Integer[arr.length]; | |
int j=0; | |
for (int i=0;i<arr.length;i++) { | |
if (arr[i] != 0) { | |
result[j] = arr[i]; | |
j++; | |
} | |
} |
import requests | |
import datetime | |
import time | |
import csv | |
def get_data_from_yahoo(): | |
url = "https://query1.finance.yahoo.com/v8/finance/chart/%5EDJI?region=US&lang=en-US&includePrePost=false&interval=2m&useYfid=true&range=1d&corsDomain=finance.yahoo.com&.tsrc=finance" | |
headers = { | |
"User-Agent": "PostmanRuntime/7.28.4" |
const $x = xp => { | |
const snapshot = document.evaluate( | |
xp, document, null, | |
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null | |
); | |
return [...Array(snapshot.snapshotLength)] | |
.map((_, i) => snapshot.snapshotItem(i)) | |
; | |
}; | |
function sleep(ms) { |
firstly sudo apt-get install libmysqlclient-dev
then it will show
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
To fix that
sudo apt-get install python3-dev
sudo apt update
sudo apt install linux-modules-extra-$(uname -r)
sudo echo "snd-aloop" >> /etc/modules
sudo modprobe snd-aloop
sudo lsmod | grep snd_aloop
If the output shows the snd-aloop module loaded, then the ALSA loopback configuration step is complete.
brew install openssl
then please start mysql server (if not started yet)
then
export LDFLAGS="-L/usr/local/homebrew/opt/openssl@1.1/lib"
if you don't know the location of LDFLags then
brew info openssl
# pip install requests | |
# use python3 | |
import requests | |
def check_date(year="2019", month="11"): | |
for i in range(1,31): | |
data = year+"-"+month+"-" | |
d = str(i) | |
if int(i/10)==0: | |
d = "0"+str(i) |
package uk.org.codebox.mosaic; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.Collection; | |
import java.util.Collections; | |
import java.util.HashSet; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; |