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
apply plugin: 'java' | |
apply plugin: 'eclipse' | |
apply plugin: 'idea' | |
subprojects { | |
apply plugin: 'java' | |
apply plugin: 'eclipse' | |
apply plugin: 'idea' | |
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
private Cache<String, String> cache = CacheBuilder.newBuilder() | |
.concurrencyLevel(4) | |
.weakKeys() // check this | |
.maximumSize(10000) | |
.expireAfterWrite(10, TimeUnit.MINUTES) | |
.build(); |
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
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
Read 4K randomly from SSD* 150,000 ns 0.15 ms |
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 | |
#first argument - process number (from 0 to N) | |
#second argument - number of parallel processed (N) | |
#./script.sh 0 6 | |
#./script.sh 1 6 | |
#... | |
#./script.sh 5 6 |
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
select regexp_replace(name, '[[:punct:]]', '', 'g') from company where type = 'LIST' |
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
apt-get install python-software-properties | |
add-apt-repository ppa:pitti/postgresql | |
apt-get update | |
apt-get install postgresql-9.2 | |
/etc/postgresql/9.2/main | |
postgresql.conf: | |
data_directory = '/var/lib/postgresql/9.2/main' | |
listen_addresses = '*' |
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
/etc/apache2/httpd.conf | |
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so | |
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so | |
LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so | |
ServerName example.com | |
<VirtualHost *:443> | |
ProxyPreserveHost On | |
ServerName example.com |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<code_scheme name="Itransition"> | |
<option name="LINE_SEPARATOR" value=" " /> | |
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="1000" /> | |
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="1000" /> | |
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND"> | |
<value /> | |
</option> | |
<option name="WRAP_COMMENTS" value="true" /> | |
<XML> |
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
@Qualifier @Target({ ElementType.TYPE, ElementType.METHOD, ElementType.FIELD }) @Retention(RetentionPolicy.RUNTIME) | |
public @interface Active { | |
} | |
@Active | |
public class SomeBeanA implements SomeInterface { | |
} | |
@Active | |
public class SomeBeanB implements SomeInterface { | |
} |
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
-- select * from pg_locks | |
-- select * from pg_stat_activity | |
select distinct on (locktype,datname,mode,relname,query) locktype,datname,relation,tuple,mode,relname,query from pg_locks as l | |
join pg_stat_activity as a on (a.datid=l.database and a.pid=l.pid) | |
join pg_class as c on (c.oid=relation) | |
where query not like '%pg_stat_activity%' |