check diskspace ubuntu
sudo fdisk -l
check files and directories size in a directory in ubuntu
du -hc <directory-path> | sort -rh | head -20
clj.user.main=> ((-> "clojure.string/blank?" symbol resolve) "") true clj.user.main=> ((-> "clojure.string/blank?" symbol resolve) "ivermac") false
I used Clojure
1.8.0. The example above has been influenced by resolve clojure function
Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
A colleague and I were using Jedis and wanted to delete multiple keys at once
without using a loop. The version of Jedis we were using has 2
del functions and the one we wanted use is a java
vararg function and can be found here.
We understood a Java vararg function as a variadic function in Clojure which simply means a function with infinite arity.
a1 are keys in redis, the following is what we attempted initially:
(.del jedis "a1" "b1")
The above failed with the following error:
IllegalArgumentException No matching method found: del for class redis.clients.jedis.Jedis clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:80)