# Dockerfile-flask
# We simply inherit the Python 3 image. This image does
# not particularly care what OS runs underneath
FROM python:3
# Set an environment variable with the directory
# where we'll be running the app
| # https://stackoverflow.com/questions/18394147/recursive-sub-folder-search-and-return-files-in-a-list-python | |
| import os | |
| def scandir(dir, ext = []): # dir: str, ext: list | |
| subfolders, files = [], [] | |
| for f in os.scandir(dir): | |
| if f.is_dir(): | |
| subfolders.append(f.path) | 
| **Tipo**: Dúvida | |
| ---------- | |
| xxx | |
| --- | |
| **Tipo**: Melhoria | |
| **Impacto**: Baixo | |
| **Valor**: Manutenibilidade do código | |
| ---------- | 
Certificates, IDs & Profiles > Identifiers > App IDs
We now need to fill out the followings:
- 
App ID Description — Name. Here, you should put your app’s name (e.g. Firebase Notification Demo)
 - 
App ID Suffix — Explicit App ID — Bundle ID. Here, you need to select a unique bundle identifier for your app (e.g. com.possible.firebasenotificationsdemo). Please make sure you use your own bundle ID instead of using mine.
 
For issuing SSL certificates, we need to submit CSR(Certificate Signing Request) which is a block of encoded information required by CA (Certificate Authority) to issue SSL certificate.
For more information please look into the following link: https://www.sslshopper.com/what-is-a-csr-certificate-signing-request.html
Earlier this week I was helping a colleague write some vanilla JavaScript to prevent a form from being submitted multiple times by an overzealous button clicker. The solution needed to be some framework-free JavaScript code. Thankfully this is pretty simple to do, so I thought I’d share some of the options here.
The example code included below is aimed at modern browsers (a minimum of IE10), but I’ve included comments for those needing IE9 support or lower. It’s depressing that in 2017 we’re still having to consider browsers from over five years ago, but sometimes this is necessary. If in doubt about browser support I’d recommend consulting the MDN website.
The simplest thing to do is disable the submit button the first time the form is submitted so the button cannot be clicked again. We do this by listening for the form being submitte
Now that you know when to use a Keytool self signed certificate, let's create one using a simple Java Keytool command:
- 
Open the command console on whatever operating system you are using and navigate to the directory where keytool.exe is located (usually where the JRE is located, e.g. c:\Program Files\Java\jre6\bin on Windows machines).
 - 
Run the following command (where validity is the number of days before the certificate will expire):
 
 $ keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 360 -keysize 2048 
| public class Levenshtein { | |
| static int calculate(String lhs, String rhs) { | |
| int len0 = lhs.length() + 1; | |
| int len1 = rhs.length() + 1; | |
| // the array of distances | |
| int[] cost = new int[len0]; | |
| int[] newcost = new int[len0]; |