Posts

  • 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
  • Magic Cauldron: Harry Potter Themed Gender Reveal Party - #Aurdino

    Earlier this year, we had a very fun filled Harry Potter themed gender reveal party. For the reveal, I built a Magic Cauldron which would reveal the gender. Check it out for yourself! For this I needed: A Cauldron. WS2812B LED array. Aurdino UNO. Bread board and jumper wires. Dry ice. Kasa Smart bulbs I will go over in the following sections The Mist.

  • Kakashi: The Copycat Robot - #Aurdino #image processing

    In this post, I want to share about "Kakashi: The Copycat Robot"—a fun side project I built a few years ago. The name is inspired by the famous character from Naruto, Kakashi Hatake, also known as the Copycat Ninja.The goal of this robot was to mimic Kakashi's ability to copy movements—though, of course, in a more limited way. Check it out for yourself!Here are the things I used to build this:

  • Neural network inference pipeline for videos in Tensorflow - #Deeplearning #Tensorflow

    Just as we saw a huge influx of images in the past decade or so, we are now seeing a lot of videos being produced on social media. The need to understand and moderate videos using machine learning has never been greater. In this post, I will show you how to build an efficient pipeline to processes videos in Tensorflow.  For simplicity, let us consider a Resnet50 model pre-trained on

  • Finding Where's Waldo using Mask R-CNN - #Deeplearning #ML

    When I was a kid, I really loved solving Where's Waldo. There were few books (it used to be called Where's Wally) in our school library on which I spent hours finding Waldo. For people who do not know what it is, basically Waldo - a unique character is hidden among hundreds of other characters and you have to find him in all the chaos in the image. Now that I am too old to be solving it and

  • Higher level ops for building neural network layers with deeplearn.js - #Deeplearning #javascript #ML

    I have been meddling with google's deeplearn.js lately for fun. It is surprisingly good given how new the project is and it seems to have a sold roadmap. However it still lacks something like tf.layers and tf.contrib.layers which have many higher level functions that has made using tensorflow so easy. It looks like they will be added to Graphlayers in future but their priorities as of now is to

Saturday, 7 September 2013

Automatic log manager for Game of Thrones series.

I watch a lot of anime. When I started watching One Piece which had 500+ episodes, it was very hard for me to keep track of how many episodes I have seen already. So I used to keep a log file which always had the next episode's number and I used to manually update it whenever I watch an episode.

That was a good idea but not good enough :P. At least for awesome people like me doing work manually is too mainstream xD.
If you do all the work what is your computer there for???
So I wrote a script which automatically manages the log. And next time when I run the script it will continue from the place I stopped last time \m/. Now I am planning to start Game of Thrones TV series. People tell I'll like it because I am a big fan of Age of Empires and I love wars :D.

So now what I am planning to do is to automate viewing it just like I did for One piece. In the version of Game of Thrones which I have, each episode name has SxxExx in it. For example S02E09 is there in the file name of episode 9 in season 2. So using this I can iterate over series and inside that i can iterate over episodes.

Setup

Download the gist from here or copy it from here:
#!/bin/bash
# log is 1:2
echo -n "how many episodes u wanna see: "
read count
while [ $count -ne 0 ]
do
log=`cat log`
expr "$log" : "\(.*\):.*"
series=`expr "$log" : "\(.*\):.*"`
episode=`expr "$log" : ".*:\(.*\)"`
if [ `echo "$series<10"|bc` -ne 0 ]
then
series=0$series
fi
if [ `echo "$episode<10"|bc` -ne 0 ]
then
episode=0$episode
fi
file=S"$series"E"$episode"
file=`find . -name "*$file*"`
#if file exists then play else go to next series
if [ "$file" ]
then
# vlc is run in full screen. If u r not using vlc change this line
vlc -f "$file"
count=`expr $count - 1`
series=`expr "$log" : "\(.*\):.*"`
episode=`expr "$log" : ".*:\(.*\)"`
episode=`expr $episode + 1`
echo "$series:$episode">log
echo "none">error.log
else
error_log=`cat error.log`
if [ "$error_log" == "error" ]
then
# this will just print a fancy message :P change it if u want
figlet end of episodes
exit
fi
echo "error">error.log
series=`expr "$log" : "\(.*\):.*"`
series=`expr $series + 1`
echo "$series:1">log
fi
done
view raw script.sh hosted with ❤ by GitHub

Step1

Place the script in the base folder which has folders of all the series. Make it executable:
$ chmod +x script.sh

Step2

create a file called "log" in the same folder. The log file contains current series number and episode number. For example if you are watching third episode of season 1, put 1:3 in that file and save it.

Running:

Just go that folder in terminal and do this:
$ ./script.sh

Now just enter the  number of episodes you want to watch in a stretch and enjoy!