https://www.gravatar.com/avatar/306d401b2a8c0efe0996fec60e0c90aa?s=240&d=mp

My coding journey

Hello!

My name is Kamila. Let me welcome you on my homepage kamilachyla.com


You will find here a handful of my notes.

I write mainly about programming (EN/PL) (Java, Python, Go, JavaScript), play with generative art using p5js and I'm an author and illustrator of my children's books.

Have fun!

Modern Java in Action 3 - collection API

New API (in Java 8) Collection classes got a few nice additions. Factory methods They create immutable collection (if you try to add/remove elements, you get UnsupportedOperationException. There is no varargs variant - this variant would require additional array allocation, which non-varargs variants don’t have. There are overloads from 1 to 10 elements. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 //static <E> List<E> of(E.

Modern Java in Action 2 - fork-join and spliterators

Second chapter shows how parallellization works with streams; explains what fork-join pool is (which is used by streams framework underneath), what data structures are decomposable, how to create your own spliterator for more effective splitting of source stream for parallel processing. Parallel streams created by a call to parallel() in a chain of stream operations fork/join pool uses Runtime.getRuntime().available-Processors() number of threads by default, but you can change it by specifying java.

Encrypted Directory With encfs

I would like to keep my secrets in encrypted directory. It seems that there already exists a nice solution to this problem and it is called encfs. For reference, I found online manual with examples after visiting baeldung linux article first. So, let’s do it. Create a pair of directories Here I’m creating two directories: ~/.crypt is the source directory - here encrypted data are stored ~/crypt directory which is the mountpoint - here I would see decrypted files to work with 1 [karma@tpd] mkdir ~/crypt ~/.

JavaScript Canvas Easter Eggs

It’s snowy and rainy, although it is April already according to the calendar. A few days ago I’ve seen little yellow flowers growing in the snow (snowdrops and aconite). It’s also very windy today (I can hear howling in ventilation chimneys) and it was raining all night long. I need some more colors to dissipate the unpeasant aura. I’ve decided to write a small graphics generator for easter eggs. The code is available at GitLab, in snowflake project and the generator itself is available on kamilachyla.