ashish@home:~$

  • Game Of Thrones Visualizations With Neo4j graph DB

    Dataset: game-of-thrones/characters.json at master · jeffreylancaster/game-of-thrones · GitHub. Source code: tocttou / got-visual Interesting finds Someone who does not know about the show can enjoy it too :D Right click on image and “View Image” or “Open Image In New Tab” to see the zoomed version. 1 People in the...

  • Smart Image Resizing Using Seam Carving

    Seam carving is a fascinating technique to scale up/down an image. Demo This was a web-service. [dead!] http://seam.ashishchaudhary.in:8080/ The code is available at: tocttou/smartresizing Overview of the application (kotlin): https://i.imgur.com/DJv24cT.png The algorithm implementation is available directly at: SeamCarver.kt Results Results are fascinating (mostly). Reduction Expansion Reduction and Expansion Implementation Calculate...

  • Better Error Handling In Kotlin With Either Type

    Here is a nice experiment (borrowed from FP languages). Define the Either type: 1 2 3 4 sealed class Either<out T> { data class Error(val message: String?, val e: Exception) : Either<Nothing>() data class Success<T>(val value: T) : Either<T>() } Any computation that has the potential of erroring out can...

  • 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 problem: Kotlin does not allow dynamic limiting conditions in its for-loops (discussion).You have to use a while loop to achieve the same functionality. It can...

  • 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...