[email protected]:~$

  • Implementing C-Style For-Loops In Kotlin

    Kotlin does not have C-style for-loops. This is fine because I prefer using the idiomatic for-loops (built to use iterators) anyway. But there is a big problem: Kotlin does not allow dynamic limiting conditions in its for-loops (See this thread). This can sometimes get very annoying. To achieve the same...

  • Extending An Object's API With Delegation In Kotlin

    Task: Expose extra API methods for an object. Methods: Derive a new class from the class of that object, implement the extra functionality, make a new object from that new class. This method is suitable in cases where the new class has an “is-a” relationship with the actual class. In...

  • Making Suspend Work On Lenovo Z510

    Suspend never worked with Linux on my Lenovo Z510. Recently I came across this issue while looking for a fix (I use NVIDIA Prime, not Bumbleebee). Suspend now works on my laptop by doing: sudo vim /etc/default/grub Replace GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" with GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=\"!Windows 2013\" acpi_osi=Linux" sudo update-grub Reboot.