It was done on the following environment:
- Raspberry Pi 3 Model B
- OS: Ubuntu Core
- Pi is connected to internet via Ethernet
Here are the overview of the steps:
[package] | |
name = "testcontainers-sample" | |
version = "0.1.0" | |
edition = "2021" | |
[dev-dependencies] | |
async_once = "0.2.6" | |
aws-sdk-s3 = "0.28.0" | |
ctor = "0.2.4" | |
lazy_static = "1.4.0" |
const { shuffle, map } = require('lodash') | |
const { sendMessages } = require('./send-email') | |
const input = shuffle(require('./input.json')) | |
function assign (array) { | |
return map(array, (person, index, array) => { | |
const friend = array[index + 1] || array[0] | |
return { | |
person, |
<template> | |
<div> | |
<slot/> | |
</div> | |
</template> | |
<script> | |
// @ts-check | |
/** |
// https://github.com/lodash/lodash/issues/1696 | |
import {clone, setWith, curry} from 'lodash/fp'; | |
// export const setIn = curry((path, value, obj) => | |
// setWith(clone, path, value, clone(obj)), | |
// ); | |
export const setIn = curry((obj, path, value) => | |
setWith(clone, path, value, clone(obj)), | |
); |
Given a number of people N and an array of integers, each one representing the amount of people a type of umbrella can handle, output the minimum number of umbrellas needed to handle N people.
No umbrella could have left spaces. Which means if a umbrella can handle 2 people, there should be 2 people under it.
If there's no solution, return -1
.
const reduce = (reducer, initial, [head, ...tail]) => | |
head // condition to go or stop | |
? reduce(reducer, reducer(initial, head), tail) // recursion | |
: initial // stop | |
const map = (mapper, [head, ...tail]) => | |
head // condition to go or stop | |
? [ mapper(head), ...map(mapper, tail) ] //recursion | |
: [] // stop |
private void doSwitchToAP() { | |
final WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); | |
final WifiApControl wifiApControl = WifiApControl.getInstance(this); | |
if (wifiApControl.isEnabled()) { | |
WifiConfiguration config = wifiApControl.getConfiguration(); | |
if (config.SSID.equals(HOTSPOT_SSID) && config.preSharedKey.equals(HOTSPOT_PWD)) { | |
Utilities.longToast("Already configured as hotspot!"); | |
} | |
} | |
final WifiConfiguration apConfig = new WifiConfiguration(); |
str.split(',') | |
.map(section => section.split(';')) | |
.map(([page, rel]) => [ | |
Number(rxPage.exec(page)[1]), | |
rxRel.exec(rel)[1] | |
]).reduce((acc, [ page, rel ]) => ( | |
{...acc, [rel]: page}), {} | |
) |
<script> | |
function $_GET(name, url) { | |
if (!url) { | |
url = window.location.href; | |
} | |
name = name.replace(/[\[\]]/g, "\\$&"); | |
const regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"); | |
const results = regex.exec(url); | |
if (!results) { | |
return null; |