Skip to content

Instantly share code, notes, and snippets.

Avatar

Tomek Łasica tlasica

View GitHub Profile
View fibonnaci.py
# fib(0) = 0
# fib(1) = 1
# fib(n) = fib(n-1) + fib(n-2)
fib_numbers = [0, 1] # dwie pierwsze liczby fib, czyli fib(0) i fib(1)
def fast_fib(n):
# jesli n jest mniejsze od liczby numerow w liscie
# to znaczy, ze znamy juz fib(n) bo mamy je w liscie
View 7a-funkcje.py
def wypisz_sume(a, b, c):
suma = a + b + c
print("suma liczb", a, "+", b, "+", c, "wynosi", suma)
wypisz_sume(5, 6, 7)
wypisz_sume(1, 7, 9)
def policz_sume(liczby):
print("dodajemy liczby:", liczby)
@tlasica
tlasica / cpuinfo.sh
Created Mar 30, 2017
script to show cpu info
View cpuinfo.sh
#!/bin/sh
#http://unix.stackexchange.com/questions/33450/checking-if-hyperthreading-is-enabled-or-not/33509#33509
CPUFILE=/proc/cpuinfo
test -f $CPUFILE || exit 1
NUMPHY=`grep "physical id" $CPUFILE | sort -u | wc -l`
NUMLOG=`grep "processor" $CPUFILE | wc -l`
if [ $NUMPHY -eq 1 ]
then
echo This system has one physical CPU,
else
@tlasica
tlasica / terrible_design.py
Created Mar 21, 2017
Terrible Multi TestBase Ingeritance
View terrible_design.py
class Base(object):
@classmethod
def start(cls):
cls.init_suite()
@classmethod
def init_suite(cls):
print "Base::init_suite()"
View query_all_limit_10.txt
SEQUENTIAL
CQL(1000)|SELECT * FROM demo.geo WHERE solr_query='*:*' LIMIT 10;
View solrconfig-filtercache-4096.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!--
=======
Copyright DataStax, Inc.
Please see the included license file for details.
-->
<!--
View solrconfig_rt_5_1_no_bloom.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
=======
Copyright DataStax, Inc.
Please see the included license file for details.
-->
<!--
For more details about configurations options that may appear in
View solrconfig-fast-lru.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!--
=======
Copyright DataStax, Inc.
Please see the included license file for details.
-->
<!--
View http_facet_field_country_by_letter_docvalues_false.txt
SEQUENTIAL
HTTPREAD|wt=json&rows=0&useFieldCache=true&q=*:*&facet=true&facet.field=country&facet.limit=100&fq=country:A*
HTTPREAD|wt=json&rows=0&useFieldCache=true&q=*:*&facet=true&facet.field=country&facet.limit=100&fq=country:B*
HTTPREAD|wt=json&rows=0&useFieldCache=true&q=*:*&facet=true&facet.field=country&facet.limit=100&fq=country:C*
HTTPREAD|wt=json&rows=0&useFieldCache=true&q=*:*&facet=true&facet.field=country&facet.limit=100&fq=country:D*
HTTPREAD|wt=json&rows=0&useFieldCache=true&q=*:*&facet=true&facet.field=country&facet.limit=100&fq=country:E*
HTTPREAD|wt=json&rows=0&useFieldCache=true&q=*:*&facet=true&facet.field=country&facet.limit=100&fq=country:F*
HTTPREAD|wt=json&rows=0&useFieldCache=true&q=*:*&facet=true&facet.field=country&facet.limit=100&fq=country:G*
HTTPREAD|wt=json&rows=0&useFieldCache=true&q=*:*&facet=true&facet.field=country&facet.limit=100&fq=country:H*
HTTPREAD|wt=json&rows=0&useFieldCache=true&q=*:*&facet=true&facet.field=country&facet.limit=100&fq=country:I*
View solrconfig-filtercache-256.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!--
=======
Copyright DataStax, Inc.
Please see the included license file for details.
-->
<!--