안드로이드 개발에서 많은 비중을 차지하는 UI패턴은 ListView에서 여러 이미지를 보여주는 Activity입니다. 전형적인 흐름을 정리하면 아래와 같습니다.
1. 목록조회 API호출
2. API를 파싱하고 ListView에 데이터를 보여 줌.
3. 각 아이템마다의 이미지 주소로 다시 서버를 호출
4. 이미지를 디코딩하고 ImageView에서 보여줌.
#!/usr/bin/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" |
// modules | |
var redis = require('redis'); | |
var Step = require('step'); | |
// config file | |
var config = require('config'); | |
// mysql client connect | |
var mysql = require('mysql'); | |
var connection = mysql.createConnection({ |
안드로이드 개발에서 많은 비중을 차지하는 UI패턴은 ListView에서 여러 이미지를 보여주는 Activity입니다. 전형적인 흐름을 정리하면 아래와 같습니다.
1. 목록조회 API호출
2. API를 파싱하고 ListView에 데이터를 보여 줌.
3. 각 아이템마다의 이미지 주소로 다시 서버를 호출
4. 이미지를 디코딩하고 ImageView에서 보여줌.
# encrypt ~/.netrc with gpg agent | |
gpg -e -r [your_gpg_id] ~/.netrc | |
# clean removed .netrc file | |
shred ~/.netrc | |
rm -f ~/.netrc | |
# enable credential helper | |
# this would search files in your home directory | |
# .authinfo.gpg |
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) === | |
# | |
# by Fotis Evangelou, developer of Engintron (engintron.com) | |
# | |
# ~ Updated September 2024 ~ | |
# | |
# | |
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores. | |
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage. | |
# |
#!/bin/bash | |
adb shell am start -c android.intent.category.HOME -a android.intent.action.MAIN |
Redis is Database whereas RabbitMQ was designed as a message router or message-orientated-middleware (mom), so I'm sure if you look for benchmarks, you'll find that RabbitMQ will outperform Redis when it comes to message routing.
RabbitMQ is written in Erlang which was specifically designed by the telecom industry to route messages, you get clustering out of the box due to it being written in Erlang which means in a clustered environment, RabbitMQ will outperform Redis even further.
Furthermore, you get guaranteed delivery of messages due to the AMQP protocol, in other words, if the network drops while consuming the message, the consumer won't be able to say thanks for the message, so the consumer will drop the message and Rabbit will requeue the message, if you publish a message and the queue didn't say thanks to the publisher due to network problems or timeouts, Rabbit will drop the message and the publisher will keep on trying to publish the message. You can have publish retries with backoff policies, so
import { createCipheriv, createDecipheriv, randomBytes } from "crypto"; | |
const ENCRYPTION_KEY: string = process.env.ENCRYPTION_KEY || ""; // Must be 256 bits (32 characters) | |
const IV_LENGTH: number = 16; // For AES, this is always 16 | |
/** | |
* Will generate valid encryption keys for use | |
* Not used in the code below, but generate one and store it in ENV for your own purposes | |
*/ | |
export function keyGen() { |
You have a repository, call it alice/repo
. You would like to transfer it to the user bob
, so it will become bob/repo
.
However, you make heavy use of the GitHub Pages feature, so that people are often accessing https://alice.github.io/repo/
. GitHub will helpfully redirect all of your repository stuff hosted on github.com after the move, but will not redirect the GitHub Pages hosted on github.io.
import requests | |
base_url = 'https://api.github.com' | |
def get_all_commits_count(owner, repo, sha): | |
first_commit = get_first_commit(owner, repo) | |
compare_url = '{}/repos/{}/{}/compare/{}...{}'.format(base_url, owner, repo, first_commit, sha) | |
commit_req = requests.get(compare_url) |