Sunday, August 2, 2020

Algorithms and data structures in rust - mergesort

Bets about rust are turning out to be right. Initially proposed as system programming language(read servo - rewrite of firefox browser) - numerous front end web frameworks are appearing and becoming ubiquitous. Rust has a steep learning curve - but that is a reasonable investment considering the low level power it gives to do system level things at the same time high level abstraction that comes without the price(zero cost). Borrow and ownership prevent memory issues, move semantics avoids data races, effort less C binding, avoidance of a runtime are some of the salient features of rust. Its implementation of Async & wait is also novel.

Its has been quite some time following the developments in rust - have been utilizing rust in one of my projects currently. I am going to be publishing some posts on rust and what better way than implementing algorithms and data structures to start with?

Following is an implementation of merge sort algorithm in rust. 

Rust allows defining local functions. Which is kind of neat & compact. Below is merge sort algorithm implemented using local functions. 




We make use of life times to return the sorted array. There does not seem to be an easy way to create arrays at runtime - the reason being arrays are allocated at the stack.

Thursday, July 30, 2020

Sunday, December 22, 2019

Install PySpark on windows


  1. Install java and expose JAVA_HOME
  2. Install spark and expose SPARK_HOME
  3. Install findspark:












Launch jupyter lab and use pyspark in notebook:























Tuesday, December 17, 2019

Kubernetes Secrets in plain English

Want to get a high level view of kubernetes secrets? Read on...


Back propagation in neural network training

Back propagation fundamental to neural network training. As always, Andrej Karpathy does a fantastic job explaining how it is calculated and applied during neural network training. Check this out!