This file contains 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 pg_stat_all_indexes.*, pg_size_pretty(pg_relation_size(indexrelname::regclass)) | |
FROM pg_stat_all_indexes | |
WHERE schemaname = 'public' | |
and indexrelname not in ( | |
select distinct tc.constraint_name | |
from | |
information_schema.table_constraints tc, | |
information_schema.key_column_usage kc | |
where | |
tc.constraint_type in ('PRIMARY KEY', 'UNIQUE') |
This file contains 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
package com.test.example2; | |
public class MainOperation { | |
public static void main(String[] args) throws Exception { | |
{ | |
long startMillis = System.currentTimeMillis(); | |
System.out.println("START OP 1"); | |
Operation1.runOp1(500); | |
System.out.println("END OP 1"); |
This file contains 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
import java.util.stream.*; | |
public class c_12_Deadlock { | |
public static void main(String[] args) { | |
Sync sync1 = new Sync(); // S1 | |
Sync sync2 = new Sync(); // S2 | |
Thread thread1 = new Thread(() -> { // T1 | |
sync1.perform(sync2); |
This file contains 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
public static void saveToXml(Clovek clovek) { | |
try { | |
JAXBContext jaxbContext = JAXBContext.newInstance(Clovek.class); | |
Marshaller marshaller = jaxbContext.createMarshaller(); | |
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); | |
marshaller.marshal(clovek, new File("clovek.xml")); | |
} catch (Exception e) { | |
throw new RuntimeException(e); | |
} | |
} |
This file contains 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
public class ThreadSafeNot { | |
private static int counter = 0; | |
public static void main(String[] args) throws InterruptedException { | |
Thread thread1 = new Thread(() -> { | |
for(int i = 0; i < 1_000_000; i++) { | |
counter++; | |
} | |
}); |
This file contains 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
# How to use it: | |
# https://support.google.com/webmasters/answer/2648487 | |
domain:o-2.info | |
domain:cacompany.trade | |
domain:lookupbear.trade | |
domain:uscompanies.info | |
domain:how-old-am-i-today.info | |
domain:l2lh.info | |
domain:1tr.info | |
domain:floridareg.trade |
This file contains 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
<authentication-manager> | |
<!-- BASIC INSPIRATION: --> | |
<!-- http://krams915.blogspot.cz/2012/01/spring-security-31-implement_3065.html --> | |
<authentication-provider user-service-ref="myUserDetailsService"> | |
<password-encoder hash="bcrypt" /> | |
</authentication-provider> | |
</authentication-manager> | |
This file contains 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 translate('žluťoučký kůň pěl ódy', 'žťčýůěóňěščřžýáíé', 'ztcyueonescrzyaie') from dual; |
This file contains 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
import java.util.ArrayList; | |
import java.util.List; | |
public class MainThreadStarvation { | |
private static List<Integer> list = new ArrayList<>(); | |
private static final Object mutex = new Object(); | |
public static void main(String[] args) throws InterruptedException { |
This file contains 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
import java.util.*; | |
import java.util.concurrent.*; | |
import java.util.stream.*; | |
public class WeighAnimalAction extends RecursiveAction { | |
private int start; | |
private int end; | |
private Double[] weights; |
OlderNewer