var text = 'Привет, мир!';
var u8a = new TextEncoder().encode(text);
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
var bytes = u8a, i, len = bytes.length, base64 = '';
for (i = 0; i < len; i += 3) {
base64 += chars[bytes[i] >> 2];
base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
base64 += chars[bytes[i + 2] & 63];
}
if (len % 3 === 2) {
base64 = base64.substring(0, base64.length - 1) + '=';
}
else if (len % 3 === 1) {
base64 = base64.substring(0, base64.length - 2) + '==';
}
console.log(base64);var text = 'Привет, мир!';
var blob = new Blob([ text ]);
var reader = new FileReader();
reader.readAsDataURL(blob);
reader.onload = function() {
var base64 = reader.result.split(',')[1];
console.log(base64);
};
const result = arr2.map(function(n) {
return Object.fromEntries(this.map(m => [ m[1], n[m[0]] ]));
}, arr1.flatMap(Object.entries));const keys = Object.entries(Object.assign({}, ...arr1));
const result = arr2.map(n => keys.reduce((acc, m) => (acc[m[1]] = n[m[0]], acc), {}));
const result = arr1.filter(function(n) {
return !this.has(n[0]);
}, new Set(arr2.map(n => n[0])));function diff(data1, data2, compare = (a, b) => a === b) {
const arr = Array.isArray(data2) ? data2 : [...data2];
const result = [];
for (const n of data1) {
if (!arr.some(m => compare(m, n))) {
result.push(n);
}
}
return result;
}
const result = diff(
arr1,
arr2,
(a, b) => a.length === b.length && a.every((n, i) => Object.is(n, b[i]))
);const diff = function*(data1, data2, keys = n => n) {
const tree = new Map;
for (const n of data2) []
.concat(keys(n))
.reduce((p, c) => p.set(c, p.get(c) ?? new Map).get(c), tree)
.set(this, true);
for (const n of data1) {
if (![].concat(keys(n)).reduce((p, c) => p?.get(c), tree)?.get(this)) {
yield n;
}
}
}.bind(Symbol());
const result = [...diff(arr1, arr2)]; просто хотел узнать, что делали вы, после того как вы закончили основы
curl -L -o "go1.19.2.linux-amd64.tar.gz" "https://dl.google.com/go/go1.19.2.linux-amd64.tar.gz"
sudo tar xvf "go1.19.2.linux-amd64.tar.gz" -C /usr/local
echo 'export GOROOT=/usr/local/go' >> ~/.bashrc
echo 'export PATH=$GOROOT/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
Знание или гугление?
return (
<div>
{countryNames && countryNames.filter((item, index, array) => {
return index > 0 ? item.COUNTRY_NAME !== array[index - 1].COUNTRY_NAME : true
}).map((vyvod) => {
let country = vyvod.COUNTRY_NAME
return <div> {country}</div> // НЕ ЗАБЫВАЕМ ПРО KEY!!!
})}
</div>
);.then((res) => {
setCountryNames(() => {
return res.DATA.filter((item, index, array) => {
return index > 0 ? item.COUNTRY_NAME !== array[index - 1].COUNTRY_NAME : true
})
})
}) Т.е. не получится это сделать с помощью wget в командной строке, т.к. куков не будет
wget --no-check-certificate --quiet \
--method GET \
--timeout=0 \
--header 'Cookie: PHPSESSID=ocqfdbv0kv6qs5jv4at6uk36pf' \
'https://test-mis.ru/api/****************************************' SELECT * from 'Клиенты'
WHERE (surname Like '%Ива%' or name Like '%Ива%' or secondname Like '%Ива%')
AND (surname Like '%Никол%' or name Like '%Никол%' or secondname Like '%Никол%')SELECT * from 'Клиенты'
WHERE CONCAT_WS(',' surname, name, secondname) LIKE '%Ива%'
AND CONCAT_WS(',' surname, name, secondname) LIKE'%Никол%' 9007199254740991 // максимальное безопасное целое
17848907461544179 // ваш ID больше – происходят округленияpost_id в кавычках, как строки.