obs.:
- o guia é baseado nas minhas configurações pessoais do Github
C-c
significa pressionar a teclaControl
e em seguida a teclac
Prefixo + w
significa digitar o comando dePrefixo
e em seguida apertarw
/* FUNÇÕES PARA DERIVADA */ | |
/* regras básicas */ | |
deriva(U+V,X,DU+DV):- deriva(U,X,DU), deriva(V,X,DV). | |
deriva(U-V,X,DU-DV):- deriva(U,X,DU), deriva(V,X,DV). | |
deriva(U*V,X,DU*V+U*DV):- deriva(U,X,DU), deriva(V,X,DV). | |
deriva(U/V,X,(DU*V+U*DV)/V^2):- deriva(U,X,DU), deriva(V,X,DV). | |
/* regra do polinômio */ | |
deriva(U^N,X,N*U^(N-1)*DU):- |
hanoi :: Int -> a -> a -> a -> [(a,a)] | |
hanoi 1 x y z = [(x,y)] | |
hanoi n x y z = hanoi (n-1) x y z ++ hanoi 1 x z y ++ hanoi (n-1) y z x | |
tamhanoi :: Int -> Int | |
tamhanoi n = 2^n - 1 |
obs.:
C-c
significa pressionar a tecla Control
e em seguida a tecla c
Prefixo + w
significa digitar o comando de Prefixo
e em seguida apertar w
import cProfile | |
def fibonacci(n): | |
if n < 0: | |
raise ValueError("Negative arguments not implemented") | |
print _fib(n)[0] | |
def _fib(n): |
#!/usr/bin/env bash | |
DATE=$(date +%s) | |
DEFAULT_KEYSTORE_STOREPASS=vmware | |
KEYSTORE_STOREPASS=`grep keystorePass /usr/lib/loginsight/application/etc/3rd_config/server.xml 2>/dev/null | gawk -F'"' '{print $4}' || echo ${DEFAULT_KEYSTORE_STOREPASS}` | |
TOMCAT=$(ls /usr/lib/loginsight/application/3rd_party 2>/dev/null | grep tomcat) | |
[ ! -d "/usr/lib/loginsight/application/3rd_party/${TOMCAT}" ] && \ | |
echo >/dev/stderr "ERROR: Unable to locate Tomcat directory, you must run this on the Log Insight virtual appliance...exiting" && \ | |
exit 255 |
Producer | |
Setup | |
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1 | |
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3 | |
Single thread, no replication | |
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196 |
I hereby claim:
To claim this, I am signing this object:
PMS = 6 x [gastos mensais]
PMR = 12 x [gastos mensais] caso sua empregabilidade seja alta 20 x [gastos mensais] caso sua empregabilidade seja baixa
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
import re | |
import random | |
import time | |
WORD_LIST = [ | |
'glibc-x86_64.tar.gz', | |
'rock_pesado.mp3', | |
'spotify_64bits.tar.gz', | |
'firefox-x86-64.tar.gz', |