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
""" | |
Format all XMLs from directory. | |
*.xml becomes *.pretty.xml | |
Usage: | |
xml_pretty_print.py <the_directory> | |
xml_pretty_print.py <the_file.xml> | |
""" | |
import xml.dom.minidom |
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
""" | |
Please consider to visit https://bank.codes/ | |
""" | |
import requests | |
import re | |
import string | |
import random | |
URL_IBAN_GENERATOR = "https://bank.codes/iban/generate/ireland/" |
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
Below are the Big O performance of common functions of different Java Collections. | |
List | Add | Remove | Get | Contains | Next | Data Structure | |
---------------------|------|--------|------|----------|------|--------------- | |
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array | |
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List | |
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array |
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 br.com.atentatecnologia.mercado; | |
import java.util.*; | |
import java.util.stream.Collectors; | |
public class MercadoEficiente implements Mercado { | |
private Map<String, PosicaoVendedor> mapaFonte = new HashMap<>(); | |
private Set<PosicaoVendedor> melhoresTaxas = new TreeSet<>((o1, o2) -> Double.compare(o2.getTaxa(), o1.getTaxa())); |
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 df.tablespace_name AS "Tablespace", | |
totalusedspace AS "Used MB", | |
(df.totalspace - tu.totalusedspace) AS "Free MB", | |
df.totalspace AS "Total MB", | |
ROUND(100 * ( (df.totalspace - tu.totalusedspace)/ df.totalspace)) AS "% Free" | |
FROM (SELECT tablespace_name, | |
ROUND(SUM(bytes) / 1048576) totalspace | |
FROM dba_data_files | |
GROUP BY tablespace_name) df, | |
(SELECT ROUND(SUM(bytes) / 1048576) totalusedspace, |