Thread pools on the JVM should usually be divided into the following three categories:
- CPU-bound
- Blocking IO
- Non-blocking IO polling
Each of these categories has a different optimal configuration and usage pattern.
from django.core.cache import cache | |
from django.core.cache.backends.base import DEFAULT_TIMEOUT | |
from django.db import connection , transaction | |
from hashlib import md5 | |
def cache_chained_calculation(characteristic_str, calculate_function, timeout=DEFAULT_TIMEOUT, force_update=False): | |
""" | |
Attempt to obtain result of @calculate_function, represented by @characteristic_str, through cache or calling the | |
function. Should only allow one caller to be calculating the value at once (enforced using postgres advisory locks), |
NPR,Fresh Air,http://www.npr.org/rss/podcast.php?id=381444908 | |
,Wait Wait... Don't Tell Me,http://www.npr.org/rss/podcast.php?id=344098539 | |
,Bullseye with Jesse Thorn,http://npr.org/rss/podcast.php?id=510309 | |
,On Point With Tom Ashbrook,http://www.npr.org/rss/podcast.php?id=510053 | |
,Only A Game,http://www.npr.org/rss/podcast.php?id=510052 | |
,Here & Now,http://www.npr.org/rss/podcast.php?id=510051 | |
,Latino USA,http://www.npr.org/rss/podcast.php?id=510016 | |
,Car Talk,http://www.npr.org/rss/podcast.php?id=510208 | |
,Piano Jazz Shorts,http://www.npr.org/rss/podcast.php?id=510056 | |
,From The Top,http://www.npr.org/rss/podcast.php?id=510026 |
extern crate zip; | |
extern crate quick_xml; | |
extern crate html_entities; | |
use std::io::BufReader; | |
use std::fs::File; | |
use std::io::Read; | |
use std::ops::Deref; | |
use std::collections::BTreeMap; | |
use zip::read::ZipArchive; |
/* | |
* Copyright (C) 2017 The Android Open Source 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 |
I was talking to a coworker recently about general techniques that almost always form the core of any effort to write very fast, down-to-the-metal hot path code on the JVM, and they pointed out that there really isn't a particularly good place to go for this information. It occurred to me that, really, I had more or less picked up all of it by word of mouth and experience, and there just aren't any good reference sources on the topic. So… here's my word of mouth.
This is by no means a comprehensive gist. It's also important to understand that the techniques that I outline in here are not 100% absolute either. Performance on the JVM is an incredibly complicated subject, and while there are rules that almost always hold true, the "almost" remains very salient. Also, for many or even most applications, there will be other techniques that I'm not mentioning which will have a greater impact. JMH, Java Flight Recorder, and a good profiler are your very best friend! Mea
Batch converter for Windows using Inkscape with the command line
InkscapeBatchConvert is an easy to use solution to quickly convert all files of a folder to another type without the need to open Inkscape. The program uses Windows Batch scripting and will only work on Windows.
Tested with Inkscape 1.0.x - 1.3.x ✅ (The last version that supports Inkscape 0.9.x can be found here)
_InkscapeBatchConvert.bat
version: '2' | |
services: | |
db: | |
image: mysql:5.7 | |
volumes: | |
- "./.data/db:/var/lib/mysql" | |
ports: | |
- "[YOUR_DESIRED_SQL_PORT]:3306" | |
environment: | |
MYSQL_ROOT_PASSWORD: wordpress |