parent
8cc52628d9
commit
7eae065b61
@ -0,0 +1,2 @@
|
|||||||
|
java temurin-21.0.3+9.0.LTS
|
||||||
|
maven 3.9.6
|
@ -0,0 +1,5 @@
|
|||||||
|
Copyright (C) 2021 by IO42630 <ivan@olexyn.com>
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
@ -0,0 +1,24 @@
|
|||||||
|
### Field Kit
|
||||||
|
|
||||||
|
Meant as a collection of easy-to-use tools that cover common use cases.
|
||||||
|
WIP.
|
||||||
|
|
||||||
|
#### List of Use Cases
|
||||||
|
|
||||||
|
* Parsing
|
||||||
|
** PDF
|
||||||
|
** CSV
|
||||||
|
* Processing
|
||||||
|
** Elastic (?)
|
||||||
|
* Deployment
|
||||||
|
** Host (?)
|
||||||
|
** Servlet Container
|
||||||
|
** Frontend (?)
|
||||||
|
** Data Visualization (?)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Setup
|
||||||
|
|
||||||
|
* WIN
|
||||||
|
** pyenv win
|
@ -0,0 +1,38 @@
|
|||||||
|
# Run this app with `python app.py` and
|
||||||
|
# visit http://127.0.0.1:8050/ in your web browser.
|
||||||
|
import json
|
||||||
|
|
||||||
|
import pandas as pd
|
||||||
|
import plotly.express as px
|
||||||
|
from dash import Dash, html, dcc
|
||||||
|
|
||||||
|
app = Dash(__name__)
|
||||||
|
|
||||||
|
f = open('./data/test.json')
|
||||||
|
data = json.load(f)
|
||||||
|
|
||||||
|
# assume you have a "long-form" data frame
|
||||||
|
# see https://plotly.com/python/px-arguments/ for more options
|
||||||
|
df = pd.DataFrame({
|
||||||
|
"Fruit": ["Apples", "Oranges", "Bananas", "Apples", "Oranges", "Bananas"],
|
||||||
|
"Amount": [4, 1, 2, 2, 4, 5],
|
||||||
|
"City": ["SF", "SF", "SF", "Montreal", "Montreal", "Montreal"]
|
||||||
|
})
|
||||||
|
|
||||||
|
fig = px.bar(df, x="Fruit", y="Amount", color="City", barmode="group")
|
||||||
|
|
||||||
|
app.layout = html.Div(children=[
|
||||||
|
html.H1(children='Hello Dash'),
|
||||||
|
|
||||||
|
html.Div(children='''
|
||||||
|
Dash: A web application framework for your data.
|
||||||
|
'''),
|
||||||
|
|
||||||
|
dcc.Graph(
|
||||||
|
id='example-graph',
|
||||||
|
figure=fig
|
||||||
|
)
|
||||||
|
])
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app.run_server(debug=True)
|
@ -0,0 +1,6 @@
|
|||||||
|
= DATA
|
||||||
|
:toc:
|
||||||
|
|
||||||
|
|
||||||
|
=== API
|
||||||
|
* https://pokeapi.co/docs/v2
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"helo": [
|
||||||
|
"world"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
metabase:
|
||||||
|
image: metabase/metabase
|
||||||
|
ports:
|
||||||
|
- "3500:3000"
|
||||||
|
mongodb:
|
||||||
|
image: mongo
|
||||||
|
ports:
|
||||||
|
- "27017:27017"
|
||||||
|
environment: # see docs for var names: https://hub.docker.com/_/mongo/
|
||||||
|
- MONGO_INITDB_ROOT_USERNAME=admin # usually better to define env vars in compose, not in dockerfile
|
||||||
|
- MONGO_INITDB_ROOT_PASSWORD=password
|
||||||
|
volumes:
|
||||||
|
- mongo-data:/data/db
|
||||||
|
# - mysql:var/lib/mysql
|
||||||
|
# - postgres:var/lib/postgresql/data
|
||||||
|
mongo-express:
|
||||||
|
image: mongo-express
|
||||||
|
ports:
|
||||||
|
- "8080:8081"
|
||||||
|
environment:
|
||||||
|
- ME_CONFIG_MONGODB_ADMINUSERNAME=admin
|
||||||
|
- ME_CONFIG_MONGODB_ADMINPASSWORD=password
|
||||||
|
- ME_CONFIG_MONGODB_SERVER=mongodb
|
||||||
|
volumes:
|
||||||
|
mongo-data:
|
||||||
|
driver: local
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.olexyn.field.kit.hacker.rank.problems;
|
||||||
|
|
||||||
|
public class Valleys {
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
countingValleys(
|
||||||
|
8,
|
||||||
|
"UDDDUDUU"
|
||||||
|
);
|
||||||
|
System.out.println("hi");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static int countingValleys(int steps, String path) {
|
||||||
|
// Write your code here
|
||||||
|
int level = 0;
|
||||||
|
int valleys = 0;
|
||||||
|
String[] paths = path.split("");
|
||||||
|
for (int i = 0; i < paths.length; i++) {
|
||||||
|
if (paths[i].equals("U")) {
|
||||||
|
level++;
|
||||||
|
} else {
|
||||||
|
level--;
|
||||||
|
}
|
||||||
|
if (i != 0 && level == 0 && paths[i - 1].equals("U")) {
|
||||||
|
valleys++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return valleys;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue