Skip to content

Instantly share code, notes, and snippets.

View tlasica's full-sized avatar

Tomek Łasica tlasica

View GitHub Profile
# 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
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 March 30, 2017 15:09
script to show cpu info
#!/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 March 21, 2017 21:15
Terrible Multi TestBase Ingeritance
class Base(object):
@classmethod
def start(cls):
cls.init_suite()
@classmethod
def init_suite(cls):
print "Base::init_suite()"
SEQUENTIAL
CQL(1000)|SELECT * FROM demo.geo WHERE solr_query='*:*' LIMIT 10;
<?xml version="1.0" encoding="UTF-8" ?>
<!--
=======
Copyright DataStax, Inc.
Please see the included license file for details.
-->
<!--
<?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
<?xml version="1.0" encoding="UTF-8" ?>
<!--
=======
Copyright DataStax, Inc.
Please see the included license file for details.
-->
<!--
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*
<?xml version="1.0" encoding="UTF-8" ?>
<!--
=======
Copyright DataStax, Inc.
Please see the included license file for details.
-->
<!--