/getAddressInfo/{address}
{
"address": "0x32be343b94f860124dc4fee278fdcbd38c102d88",
"ETH": {
"balance": 2.0542680760545484
},
"countTxs": 2446019,
"tokens": [
{
"tokenInfo": {
"address": "0x2bdc0d42996017fce214b21607a515da41a9e0c5",
"name": "SkinCoin",
"decimals": "6",
"symbol": "SKIN",
"totalSupply": "388183000000000",
"owner": "0x6f2010d0fbaf8b7dbc13ee7252ff8594a2be3c51",
"lastUpdated": 1566777665,
"issuancesCount": 0,
"holdersCount": 4167,
"image": "https://ethplorer.io/images/skincoin.png",
"description": "First Universal Cryptocurrency based on Ethereum for instant trading CS:GO, Dota 2 skins, and making bets on eSports events\n\nhttps://skincoin.org\nhttps://www.facebook.com/skincoin/\nhttps://twitter.com/skincoin_org",
"ethTransfersCount": 29,
"price": {
"rate": 0.000476030266457,
"diff": -11.51,
"diff7d": -0.26,
"ts": 1566827043,
"marketCapUsd": 41978.00690959633,
"availableSupply": 88183483,
"volume24h": 1571.26022094368,
"diff30d": -33.46333000860204,
"currency": "USD"
}
},
"balance": 186088535060,
"totalIn": 11474050000,
"totalOut": 0
},
{
"tokenInfo": {
"address": "0xa4ec83c8907888d006a37debf755ee39766f38ae",
"name": "Global Currency Unit",
"decimals": "18",
"symbol": "GCU",
"totalSupply": "88888888000000000000000000000",
"owner": "0x5d01bad722f5b6856c34851f16a22f7d967c39c5",
"lastUpdated": 1566825626,
"issuancesCount": 0,
"holdersCount": 27547,
"price": false
},
"balance": 2.5e+22,
"totalIn": 0,
"totalOut": 0
}
]
}
$search_text = 'лист';
array_filter($array, function($el) use ($search_text) {
return ( strpos($el['text'], $search_text) !== false );
});
<?php
require_once 'vendor/autoload.php';
$fuse = new \Fuse\Fuse([
[
"title" => "Old Man's War",
"author" => "John Scalzi"
],
[
"title" => "The Lock Artist",
"author" => "Steve Hamilton"
],
[
"title" => "HTML5",
"author" => "Remy Sharp"
],
[
"title" => "Right Ho Jeeves",
"author" => "P.D Woodhouse"
],
], [
"keys" => [ "title", "author" ],
]);
$fuse->search('hamil');
/*
Array
(
[0] => Array
(
[title] => The Lock Artist
[author] => Steve Hamilton
)
[1] => Array
(
[title] => HTML5
[author] => Remy Sharp
)
)
*/
document.querySelector(".button").addEventListener("click", (e) => { /* ... */ });
/* и т.д. в таком же духе */
<!-- Sign In Form -->
<form>
<button type='submit' name='submit' value='sign_in'></button>
</form>
<!-- Sign Up Form -->
<form>
<button type='submit' name='submit' value='sign_up'></button>
</form>
#views.py
def index(request):
if request.method == "POST":
if request.POST.get('submit') == 'sign_in':
# your sign in logic goes here
elif request.POST.get('submit') == 'sign_up':
# your sign up logic goes here
/*
No jQuery necessary.
Thanks to Dan's StackOverflow answer for this:
http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport
*/
function isElementInViewport(el) {
var rect = el.getBoundingClientRect();
return (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= (window.innerHeight || document. documentElement.clientHeight) &&
rect.right <= (window.innerWidth || document. documentElement.clientWidth)
);
}
Причем ошибка появляется что символов больше 50 а именно 51
max_length=50
CharField.max_length
The maximum length (in characters) of the field. The max_length is enforced at the database level and in Django’s validation using MaxLengthValidator.
models.CharField(max_length=50, db_index=True)
И можно решить эту проблему не убирая max_length или не делая max_length=None
Насчёт базы данных надо или нет но использую sqllite
class MyCustomForm(forms.ModelForm):
var1 = forms.CharField(
widget=forms.TextInput(attrs={
# override/add custom HTML attributes in this dictionary
'maxlength': '70',
})
)
{
"name": "egulias/email-validator",
"description": "A library for validating emails against several RFCs",
"homepage": "https://github.com/egulias/EmailValidator",
"type": "Library",
"keywords": ["email", "validation", "validator", "emailvalidation", "emailvalidator"],
"license": "MIT",
"authors": [
{"name": "Eduardo Gulias Davis"}
],
"extra": {
"branch-alias": {
"dev-master": "2.1.x-dev"
}
},
"repositories": [
{
"type": "git",
"url": "https://github.com/dominicsayers/isemail"
}
],
"require": {
"php": ">= 5.5",
"doctrine/lexer": "^1.0.1"
},
"require-dev" : {
"satooshi/php-coveralls": "^1.0.1",
"phpunit/phpunit": "^4.8.35||^5.7||^6.0",
"symfony/phpunit-bridge": "^4.4@dev",
"dominicsayers/isemail": "dev-master"
},
"suggest": {
"ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation"
},
"autoload": {
"psr-4": {
"Egulias\\EmailValidator\\": "EmailValidator"
}
},
"autoload-dev": {
"psr-4": {
"Egulias\\Tests\\": "test"
}
}
}
version: "3.5"
services:
db:
build:
context: ./docker
dockerfile: postgresql.Dockerfile
env_file:
- .env
restart: always
volumes:
- postgres:/var/lib/postgresql/data
ports:
- "127.0.0.1:5432:5432"
redis:
env_file:
- .env
restart: always
image: redis:3.0
expose:
- "6379"
echo 'APP_ENV=docker' > .env
Database credentials and other sensitive information should not be committed to the repository. Those required settings should be outlined in .env.example
Passing environment variables via Docker can be problematic in production. A phpinfo() call may leak secrets by outputting environment variables. Consider mounting a .env volume or copying it to the container directly.
мне не понятно, как сервер ищет значение по базе. Или куда он загружает все это?
То есть, что бы можно было, в любое место описания, вставить картинку, ссылку, список, и т. д. Как можно реализовать эту задачу?
Но как мне отловить данные "start"?
Deep linking
Telegram bots have a deep linking mechanism, that allows for passing additional parameters to the bot on startup. It could be a command that launches the bot — or an auth token to connect the user's Telegram account to their account on some external service.
Each bot has a link that opens a conversation with it in Telegram — https://telegram.me/. You can add the parameters start or startgroup to this link, with values up to 64 characters long. For example:https://telegram.me/triviabot?startgroup=test
Telegram отдает данные через WebHook, но в json ответе нет нужных данных.
Но я так и не могу понять где взять этот сервер, у меня есть на AWS машина на Linux, подойдёт ли она? Как вообще сделать этот сервер,
Как можно написать текст в определённом месте на фотографии?
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
img = Image.open("sample_in.jpg")
draw = ImageDraw.Draw(img)
# font = ImageFont.truetype(<font-file>, <font-size>)
font = ImageFont.truetype("sans-serif.ttf", 16)
draw.text((0, 0),"Sample Text",(255,255,255),font=font)
img.save('sample-out.jpg')
Возможно ли реализовать такое:
При включении ПК какая-то прога из трея отправляет письмо мне на почту, что "ваш пк включен" ?
Как узнать включался ли мой комп?
<шутка>Во внутрь блока питания установить накоротко перемычку
после кнопки включения и предохранителя. </шутка>