Siv Scripts

Solving Problems Using Code

Sat 20 October 2018

Transfer Files with rsync

Posted by Aly Sivji in Quick Hits   

I recently purchased a new computer and needed to transfer files from the old computer to the new one. Tried a USB drive, no luck. Tried copying files over the network via the macOS Finder, but the sheer number of files (~500,000) made this an exercise in futility.

Googling …

Read more...







Mon 26 February 2018

PHP + MySQL using Docker Compose

Posted by Aly Sivji in Quick Hits   

Being a Software Engineer isn't just about being effective in a specific programming language, it's about being able to solve any given problem using the tools at hand.

This week at work I have to extend the functionality of a WordPress plug-in so it can fit into our microservices-based backend …

Read more...


Fri 05 January 2018

@ Python's Matrix Multiplication Operator

Posted by Aly Sivji in Quick Hits   

2017 will forever be etched in our memories as the year Python overtook R to become the leading language for Data Science. There are many factors that play into this: Python's simple syntax, the fantastic PyData ecosystem, and of course buy-in from Python's BDFL.

PEP 465 introduced the @ infix operator that is designated to be used for matrix multiplication. The acceptance and implementation of this proposal in Python 3.5 was a signal to the scientific community that Python is taking its role as a numerical computation language very seriously.

Read more...



Mon 01 January 2018

Increasing namedtuple Readability with Type Hints

Posted by Aly Sivji in Quick Hits   

Dynamic typing refers to programs checking variable types at runtime versus compile time. By not having to define the variable type as we write code, we can work faster and take advantage of duck typing.

On the other hand, we do miss out on some benefits that types bring. Similiar to how the principles of test-driven development force us to write smaller, more testable functions, thinking about types improves software design by making us cognizant of the values our variables hold as well as the values our functions can return.

Read more...




Sat 07 October 2017

Terminal Tricks: Directory Bookmarks

Posted by Aly Sivji in Quick Hits   

Even though my development folders are well organized, I still have to feel my way around the filesystem when I'm looking for a project directory. It's like trying to find a lightswitch in a dark room: a cd here, an ls there, maybe a find when I'm stuck.

I always …

Read more...



Sat 09 September 2017

Visualizing Stacks

Posted by Aly Sivji in Quick Hits   

A stack is a linear data structure that holds a collection of items. We can define operations performed in a stack from the point of view of a user:

  • .push() - add item to top
  • .pop() - remove and return item from top
  • .peek() - return top most element
  • .is_empty() - True if stack …

Read more...