- Create a react app with typescript template
npx create-react-app . --template typescript
- Create .editorconfig on the root folder:
{ | |
"emmet.syntaxProfiles": { | |
"javascript": "jsx" | |
}, | |
"workbench.startupEditor": "newUntitledFile", | |
"editor.fontSize": 16, | |
"javascript.suggest.autoImports": true, | |
"javascript.updateImportsOnFileMove.enabled": "always", | |
"editor.rulers": [80, 120], | |
"extensions.ignoreRecommendations": true, |
import dash | |
from dash import dcc | |
from dash import html | |
from dash.dependencies import Input, Output | |
import dash_bootstrap_components as dbc | |
import plotly_express as px | |
import plotly.graph_objects as go | |
import numpy as np |
import sqlite3 | |
import csv | |
import pandas as pd | |
def main(): | |
database_file = "CNPJ_full.db" | |
conn = conn = sqlite3.connect(database_file) | |
df = pd.read_sql_query("SELECT * FROM empresas WHERE municipio='PELOTAS'", conn) |
import os | |
def split(filehandler, delimiter=',', row_limit=10000, | |
output_name_template='output_%s.csv', output_path='.', keep_headers=True): | |
""" | |
Splits a CSV file into multiple pieces. | |
A quick bastardization of the Python CSV library. | |
Arguments: | |
`row_limit`: The number of rows you want in each output file. 10,000 by default. |
# Silly code to generate all combinations of species, background and gods that spell english words (according to NLTK) | |
# for Dungeon Crawl Stone Soup (as of 0.23) | |
from nltk.corpus import words | |
species = [ | |
"Ba", | |
"Ce", | |
"DD", | |
"DE", |
# Calculates geometric distances between all given points | |
# coordinates are passed as arguments, as in the following sample: | |
# ruby geodistance.rb 62.425,52.424 42.0,90.5256 0.0,0.0 90.0,-180.0 | |
# returns the distance in kilometers | |
## | |
# Haversine Distance Calculation Function | |
# | |
# by https://gist.github.com/timols/5268103 | |
# Accepts two coordinates in the form |
# Solves the "Miojo with 2 hourglasses" problem | |
# cooking time and both hourglass times are passed as arguments, as in the following sample: | |
# ruby miojoproblem.rb 3 5 7 | |
# returns the minimum total time to cook the miojo accurately, or a fail message if not possible | |
# Solution is ad-hoc, can probably be optimized a lot | |
raise "Must specify 3 inputs: Miojo cooking time, hourglass 1 time, hourglass 2 time." if ARGV.length != 3 | |
cook_time = ARGV[0].to_i | |
hg_1 = ARGV[1].to_i |
var cheerio = require('cheerio'); | |
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; | |
function httpGet(theUrl) { | |
var xmlHttp = new XMLHttpRequest(); | |
xmlHttp.open("GET", theUrl, false); // false for synchronous request | |
xmlHttp.send(null); | |
return xmlHttp.responseText; | |
} |
1) Look up on the internet the simple code for generating the base html5 structure; | |
2) What would be the code for generating the following structure: | |
<div> | |
<ul> | |
<li></li> | |
<li></li> | |
<li></li> | |
</ul> | |
</div> |