This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.9.17-slim-bullseye as base | |
RUN set -x; apt-get update && apt-get upgrade -y --no-install-recommends | |
FROM base as compile-image | |
RUN apt-get install -y build-essential --no-install-recommends && \ | |
apt-get install -y libgl1 libqt5gui5 libusb-dev libusb-1.0-0-dev libhidapi-dev python3-hidapi python3-hid \ | |
libudev-dev libgudev-1.0-0 libudev1 python3-pyudev \ | |
git \ | |
&& pip install --upgrade pip \ | |
&& apt-get autoremove && apt-get autoclean && rm -rf /var/lib/apt/lists/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## improved version of the script at https://askubuntu.com/a/1068932 | |
## | |
## Disables the Evolution mail program's services by moving the services files | |
## to another directory. | |
## | |
## This must be run as root. | |
## |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Copyright (C) 2016 The Linux Containers Project | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// extracted from https://github.com/shendykurnia/ajaib/blob/master/index.html | |
// runnable on nodejs | |
// should be able to optimize more, because slower than php version | |
var zero_pad = function(n,N) { | |
var string = n + ''; | |
var num_zeros = N - (string).length; | |
for(var j = 0;j < num_zeros;j++) { | |
string = '0' + string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
There are 299 numbers that contain 14 between 1 to 10,000 (not 300, because 1414 will be counted as 1) | |
How many numbers contain 14 between 1 to 10,000,000 ? | |
How many numbers contain 14 between 1 to 10,000,000,000 ? | |
ref: | |
https://www.mathsisfun.com/combinatorics/combinations-permutations.html | |
http://stackoverflow.com/questions/28182960/counting-same-containt-number-from-range-number-without-loop-in-ruby | |
http://math.stackexchange.com/questions/924399/how-many-integers-between-1-and-10n-contain-14au-cs244b/ |