<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Code on Srikanth Cherla</title><link>https://cherla.org/tags/code/</link><description>Recent content in Code on Srikanth Cherla</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Thu, 28 May 2026 11:22:57 +0200</lastBuildDate><atom:link href="https://cherla.org/tags/code/index.xml" rel="self" type="application/rss+xml"/><item><title>Migrating to Hugo</title><link>https://cherla.org/posts/2026/05/migrating-to-hugo/</link><pubDate>Thu, 28 May 2026 00:00:00 +0000</pubDate><guid>https://cherla.org/posts/2026/05/migrating-to-hugo/</guid><description>&lt;p&gt;This website has been running on &lt;a href="https://wordpress.org/"&gt;WordPress&lt;/a&gt; since I first set it up in 2013 — hosted on a shared cPanel server at Arvixe (and then Domain Racer). It has served me well, but over time the maintenance overhead started to feel disproportionate to what I actually needed: a simple personal site with a blog, a CV, a music section, and not much else. WordPress is a powerful platform, but for a use case like mine it brings a lot of complexity along with it — a database, PHP, plugins to keep updated, and a web-based admin interface that I rarely enjoyed using.&lt;/p&gt;</description></item><item><title>Completed Learn TypeScript Course on Codecademy</title><link>https://cherla.org/posts/2022/05/completed-learn-typescript-course-on-codecademy/</link><pubDate>Tue, 03 May 2022 00:00:00 +0000</pubDate><guid>https://cherla.org/posts/2022/05/completed-learn-typescript-course-on-codecademy/</guid><description>&lt;p&gt;I returned from paternity leave to find the team had shifted from Unity&amp;rsquo;s C# codebase to TypeScript. Having just finished the &lt;a href="https://cherla.org/posts/2022/01/completed-learn-c-sharp-on-codecademy/"&gt;C# course on Codecademy&lt;/a&gt; in December, I was glad to find they had a TypeScript course too.&lt;/p&gt;
&lt;p&gt;Prior experience with Python&amp;rsquo;s &lt;code&gt;mypy&lt;/code&gt; type-checker made TypeScript&amp;rsquo;s type system feel familiar — the conceptual leap was smaller than expected. I also found useful parallels in package management and scripting approaches between languages.&lt;/p&gt;</description></item><item><title>Completed Learn C# Course on Codecademy</title><link>https://cherla.org/posts/2022/01/completed-learn-c%23-course-on-codecademy/</link><pubDate>Sat, 08 Jan 2022 00:00:00 +0000</pubDate><guid>https://cherla.org/posts/2022/01/completed-learn-c%23-course-on-codecademy/</guid><description>&lt;p&gt;I&amp;rsquo;d been at Unity for over a year without ever properly learning C#. Advanced Unity tutorials weren&amp;rsquo;t the right entry point — too much assumed knowledge. During a month-long trip to India in December 2021 I went back to basics with Codecademy&amp;rsquo;s beginner C# course.&lt;/p&gt;
&lt;p&gt;The browser-based editor wasn&amp;rsquo;t enough for me. I set up a local environment with Mono, Dotnet, Omnisharp, and Vim, and made sure to type every piece of code myself — even the repetitive parts like imports and base classes. Repetition was the key.&lt;/p&gt;</description></item><item><title>Completed Programming Languages (Part B) on Coursera</title><link>https://cherla.org/posts/2020/06/completed-programming-languages-part-b-on-coursera/</link><pubDate>Sat, 06 Jun 2020 00:00:00 +0000</pubDate><guid>https://cherla.org/posts/2020/06/completed-programming-languages-part-b-on-coursera/</guid><description>&lt;p&gt;Completed the second of three parts of Dan Grossman&amp;rsquo;s &lt;em&gt;Programming Languages&lt;/em&gt; course from the University of Washington on Coursera. Where Part A used Standard ML, Part B uses Racket — exploring dynamically typed languages and culminating in implementing a simple language interpreter.&lt;/p&gt;
&lt;p&gt;Part A gave me a solid foundation in functional programming and formalised a lot of intuitions I&amp;rsquo;d built up informally. I&amp;rsquo;ll share fuller reflections once I&amp;rsquo;ve finished Part C and had a chance to look back at the whole series.&lt;/p&gt;</description></item><item><title>Completed Programming Languages (Part A) on Coursera</title><link>https://cherla.org/posts/2020/03/completed-programming-languages-part-a-on-coursera/</link><pubDate>Mon, 09 Mar 2020 00:00:00 +0000</pubDate><guid>https://cherla.org/posts/2020/03/completed-programming-languages-part-a-on-coursera/</guid><description>&lt;p&gt;Completed the first part of Dan Grossman&amp;rsquo;s &lt;em&gt;Programming Languages&lt;/em&gt; specialisation from the University of Washington on Coursera, scoring 98%. The course uses Standard ML to teach functional programming — pattern matching, function closures, partial application, currying, mutual recursion.&lt;/p&gt;
&lt;p&gt;Beyond the technical content, what stood out was the emphasis on programming style and code quality as part of the evaluation criteria. The assignments were rigorous and the handouts were thorough. An excellently designed course, even if challenging.&lt;/p&gt;</description></item><item><title>Getting Started with Python Pandas</title><link>https://cherla.org/posts/2019/06/getting-started-with-python-pandas/</link><pubDate>Sun, 09 Jun 2019 00:00:00 +0000</pubDate><guid>https://cherla.org/posts/2019/06/getting-started-with-python-pandas/</guid><description>&lt;p&gt;I resisted pandas for a long time, then found myself spending way too much time writing data processing routines from scratch on a recommender systems project. It reminded me of when I used to manually compute neural network gradients before discovering Theano.&lt;/p&gt;
&lt;p&gt;Two resources that worked well for getting up to speed quickly:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.kaggle.com/learn"&gt;Kaggle Learn micro-courses&lt;/a&gt;&lt;/strong&gt; — well-organised, beginner-friendly, and the pandas course pairs nicely with their visualisation and embedding courses.&lt;/p&gt;</description></item><item><title>TensorFlow Tip: Pretrain and Retrain</title><link>https://cherla.org/posts/2018/04/tensorflow-tip-pretrain-and-retrain/</link><pubDate>Sun, 22 Apr 2018 00:00:00 +0000</pubDate><guid>https://cherla.org/posts/2018/04/tensorflow-tip-pretrain-and-retrain/</guid><description>&lt;p&gt;I recently ran into a situation where I had to initially train a neural network first on one dataset, save it and then load it up later to train it on a different dataset (or using a different training procedure). I implemented this in Tensorflow and thought I&amp;rsquo;d share a stripped down version of the script here as it could serve as an instructive example on the use of Tensorflow sessions. Note that this is not necessarily the best way of doing this, and it might indeed be simpler to load the original graph and train that graph itself by making its parameters trainable, or something else like that. The script can be found &lt;a href="https://github.com/freakanth/tensorflow-tips/blob/master/pretrain_and_retrain.py"&gt;here&lt;/a&gt;. In the first stage of this script (the pre-training stage) there is only a single graph which contains the randomly initialised and trained model. One might as well avoid explicitly defining a graph as Tensorflow&amp;rsquo;s default graph will be used for this purpose. This model (together with its parameters) is saved to a file and then loaded for the second re-training stage. In this second stage, there are two graphs. The first graph is loaded from the saved file and contains the pre-trained model whose parameters are the ones whose values we wish to assign to those of the second model before training the latter on a different dataset. The parameters of the second model are randomly initialised prior to this assignment step. In order for the assignment to work, I found it necessary to assign parameters across graphs and this could be done by saving the parameters of the first model as &lt;code&gt;numpy&lt;/code&gt; tensors and assigning the values of these &lt;code&gt;numpy&lt;/code&gt; tensors to the right parameters of the second model.&lt;/p&gt;</description></item><item><title>Completed Big Data Integration and Processing on Coursera</title><link>https://cherla.org/posts/2018/02/completed-big-data-integration-and-processing-on-coursera/</link><pubDate>Sat, 17 Feb 2018 00:00:00 +0000</pubDate><guid>https://cherla.org/posts/2018/02/completed-big-data-integration-and-processing-on-coursera/</guid><description>&lt;p&gt;Completed UCSD&amp;rsquo;s &lt;em&gt;Big Data Integration and Processing&lt;/em&gt; on Coursera with 97.7%. Covered MongoDB for querying JSON data, Pandas for data analysis, and various Spark technologies — Spark SQL, Spark Streaming, Spark MLlib, Spark GraphX. A hands-on exercise involved analysing tweets using both MongoDB and Spark.&lt;/p&gt;
&lt;p&gt;The specialisation as a whole is fairly introductory — broad coverage rather than depth — but valuable for building awareness of the ecosystem and knowing where to start when you need to apply these tools.&lt;/p&gt;</description></item><item><title>The TensorFlow Datasets API for Sequence Data (Code Examples)</title><link>https://cherla.org/posts/2017/12/the-tensorflow-datasets-api-for-sequence-data-code-examples/</link><pubDate>Mon, 18 Dec 2017 00:00:00 +0000</pubDate><guid>https://cherla.org/posts/2017/12/the-tensorflow-datasets-api-for-sequence-data-code-examples/</guid><description>&lt;p&gt;When TensorFlow 1.4 was released there were very few fully working examples of the Datasets API for sequence data. Rather than a full tutorial, here are two scripts with explanatory notes.&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://github.com/freakanth"&gt;GitHub repository&lt;/a&gt; contains:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;placeholder_vs_iterators.py&lt;/code&gt;&lt;/strong&gt; — Three data input approaches:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Traditional placeholder method&lt;/li&gt;
&lt;li&gt;Iterators&lt;/li&gt;
&lt;li&gt;Feedable iterators&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;generator_vs_tfrecord.py&lt;/code&gt;&lt;/strong&gt; — Three methods for iterating through sequence data during training:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Generator function with preprocessing (zero-padding, batching)&lt;/li&gt;
&lt;li&gt;Pre-processed data via generator&lt;/li&gt;
&lt;li&gt;TFRecord files using SequenceExample Protocol Buffers (the most Datasets API-dependent approach)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;References: &lt;a href="https://www.tensorflow.org/guide/data"&gt;TF Datasets documentation&lt;/a&gt;, Google Developers blog post on the API.&lt;/p&gt;</description></item><item><title>Completed Big Data Modeling and Management Systems on Coursera</title><link>https://cherla.org/posts/2017/11/completed-big-data-modeling-and-management-systems-on-coursera/</link><pubDate>Mon, 27 Nov 2017 00:00:00 +0000</pubDate><guid>https://cherla.org/posts/2017/11/completed-big-data-modeling-and-management-systems-on-coursera/</guid><description>&lt;p&gt;Completed the first course in UCSD&amp;rsquo;s Big Data specialisation — &lt;em&gt;Big Data Modeling and Management Systems&lt;/em&gt; — with a perfect score. Broad coverage of relational databases, big data management systems, and various processing alternatives. The content was somewhat superficial on individual topics but useful for building a mental map of the ecosystem.&lt;/p&gt;
&lt;p&gt;The peer-graded capstone (a relational database design for a game) had poorly defined objectives and evaluation criteria — a weak ending to an otherwise reasonable course. Looking forward to the more hands-on exercises promised in later courses in the specialisation.&lt;/p&gt;</description></item><item><title>Completed Introduction to Big Data on Coursera</title><link>https://cherla.org/posts/2017/10/completed-introduction-to-big-data-on-coursera/</link><pubDate>Mon, 23 Oct 2017 00:00:00 +0000</pubDate><guid>https://cherla.org/posts/2017/10/completed-introduction-to-big-data-on-coursera/</guid><description>&lt;p&gt;Completed UCSD&amp;rsquo;s &lt;em&gt;Introduction to Big Data&lt;/em&gt; on Coursera with 98.9%. The course was light — definitions, history, big data jargon, and very basic principles. The section on the Hadoop ecosystem was new to me and included a hands-on Hadoop assignment which I found worthwhile.&lt;/p&gt;
&lt;p&gt;Easy course, but a necessary first step in the specialisation. Looking forward to the remaining courses.&lt;/p&gt;
&lt;p&gt;&lt;a href="../../../../files/introduction-to-big-data-certificate.pdf"&gt;introduction-to-big-data-certificate&lt;/a&gt;&lt;/p&gt;</description></item><item><title>D'oro</title><link>https://cherla.org/posts/2017/06/doro/</link><pubDate>Sat, 03 Jun 2017 00:00:00 +0000</pubDate><guid>https://cherla.org/posts/2017/06/doro/</guid><description>&lt;p&gt;I like using the Pomodoro Technique to remind me to take short breaks while I&amp;rsquo;m immersed in work. And I thought it would be nice to create a little command-line Pomodoro Timer for myself that will pop up desktop notifications telling me that it&amp;rsquo;s time to take a break. I call this very simple and minimal Pomodoro timer app &lt;em&gt;&lt;strong&gt;D&amp;rsquo;oro&lt;/strong&gt;&lt;/em&gt; and it can be invoked using a command called &lt;code&gt;doro&lt;/code&gt; once it has been installed. You can clone the repository from &lt;a href="https://gitlab.com/freakanth/doro"&gt;its Gitlab page &lt;/a&gt;. I intend to write an installation script and also create a Debian package for it in the future, but it works and I love using it everyday at work! &lt;img src="https://cherla.org/wp/wp-content/uploads/2017/06/tomato.png" alt=""&gt;&lt;/p&gt;</description></item><item><title>Let's Encrypt for Free!</title><link>https://cherla.org/posts/2016/12/lets-encrypt-for-free/</link><pubDate>Mon, 19 Dec 2016 00:00:00 +0000</pubDate><guid>https://cherla.org/posts/2016/12/lets-encrypt-for-free/</guid><description>&lt;p&gt;This is an account of how I went from no encryption, to almost getting a paid SSL certificate to finally making and installing a free one on &lt;a href="https://cherla.org"&gt;my domain&lt;/a&gt;. It started with me setting up an &lt;a href="https://owncloud.org/"&gt;ownCloud&lt;/a&gt; server on my hosting account to access and sync my data on the cloud after going from Dropbox, to Copy to Mega and finally to pCloud over a span of five or so years. &lt;strong&gt;Why ownCloud?&lt;/strong&gt; Mainly because I have a shared hosting account with &lt;a href="http://arvixe.com/"&gt;Arvixe&lt;/a&gt; (an excellent hosting service) with unlimited data storage, and I was curious as to how much of an effort it would be to set up my own cloud storage since hearing about ownCloud a couple of months ago. It turns out that it wasn&amp;rsquo;t much of an effort after all. I simply contacted the support team at Arvixe who made the ownCloud app available on my &lt;a href="https://en.wikipedia.org/wiki/CPanel"&gt;cPanel&lt;/a&gt; and then it was just a matter of filling a simple online form with little details such as where to store your data, which address to access the ownCloud web interface on, etc. The ownCloud project is fantastic! And from what I&amp;rsquo;ve seen, it has most (if not all) features that any other company like Dropbox or Mega has to offer. It took me 15 minutes to set things up, &lt;a href="https://owncloud.org/install/"&gt;install the (Linux) client&lt;/a&gt; and sync my cloud storage (a folder on my hosting account) with a local folder. So is that it? Turns out that there&amp;rsquo;s more. Since now I&amp;rsquo;m transferring data to and from my domain, it is preferred that the connection to the domain is secure. And the connection can be secured with SSL Encryption. &lt;strong&gt;SSL Encryption&lt;/strong&gt; I won&amp;rsquo;t go much into TLS/SSL encryption here as there are plenty of resources online that explain it. It would suffice to know that it is a way for a website to secure the connection between itself and a visitor so that any data exchanged between the two is encrypted and not visible to a (potentially malicious) third party that is eavesdropping on the connection. This is necessary to prevent what is known as a &lt;em&gt;man-in-the-middle attack&lt;/em&gt; where a hacker intercepts the connection between the website and its visitor and collects the data being transmitted between the two (which may sometimes be confidential, such as credit card numbers, personal identification numbers, etc.) without either the website or its visitor knowing about it. [caption id=&amp;ldquo;attachment_117&amp;rdquo; align=&amp;ldquo;aligncenter&amp;rdquo; width=&amp;ldquo;700&amp;rdquo;]&lt;img src="https://cherla.org/wp/wp-content/uploads/2016/12/cherla-org-http-300x6.png" alt=""&gt; The Chromium Browser address bar when the connection to the page is not secured (note the &amp;ldquo;http://&amp;rdquo;).[/caption] There has lately been a growing interest on the web to adopt SSL (or its successor TLS) to secure connections between them and their visitors. Google has even &lt;a href="http://www.zdnet.com/article/google-chrome-gets-ready-to-mark-all-http-sites-as-bad/"&gt;proposed to blacklist websites&lt;/a&gt; that don&amp;rsquo;t adopt the SSL protocol. At a first glance, one can know whether or not a website is secure by keeping an eye out for a green lock next to the address bar, and the fact that it says &lt;em&gt;https://&lt;/em&gt;(with the green lock symbol) in the addres bar instead of &lt;em&gt;http://&lt;/em&gt;. The &lt;em&gt;s&lt;/em&gt; here stands for secure. And if you click on the green lock, it pops up a little window that shows who the site has been secured by. [caption id=&amp;ldquo;attachment_116&amp;rdquo; align=&amp;ldquo;aligncenter&amp;rdquo; width=&amp;ldquo;700&amp;rdquo;]&lt;img src="https://cherla.org/wp/wp-content/uploads/2016/12/cherla-org-https-300x6.png" alt=""&gt; The Chromium Browser address bar when the connection to the page is secured (note the &amp;ldquo;https://&amp;rdquo;).[/caption] All this stress on security and privacy is, in my opinion, justified. So given that now I&amp;rsquo;m transmitting my data between my local machine and my domain I decided it would be a good idea to adopt SSL encryption on my domain. This can be realised by obtaining an SSL certificate from a Certification Authority. &lt;strong&gt;SSL Certificates and Certification Authorities&lt;/strong&gt; In order to obtain an SSL certificate for your domains, you should purchase it from a certification authority (CA) or a reseller who sells it at a cheaper rate sans some extra benefits of support that the CA would be able to offer for a higher price. Some of the most popular CAs around are Symantec, GeoTrust, GlobalSign, DigiCert and GoDaddy. Each of these CAs sells you a certificate for a fixed period of time - typically 1 to 3 years - and offers different packages such as Extended Validation, Wildcard domain certification, etc. For instance, have a look at what &lt;a href="https://www.symantec.com/page.jsp?id=compare-ssl-certificates&amp;amp;tid=ssl-sem"&gt;Symantec&lt;/a&gt;, &lt;a href="https://www.geotrust.com/ssl/"&gt;GeoTrust&lt;/a&gt; and &lt;a href="https://www.globalsign.com/en/ssl/"&gt;GlobalSign&lt;/a&gt; have to offer. These are very similar options but priced differently depending on the CA&amp;rsquo;s credibility (which apparently is a major factor in deciding whom to go with) and what is contained in the option. On the other hand, there are companies that purchase certificates from the CAs in bulk and re-sell them at a cheaper rate. These are websites such as &lt;a href="http://sslshopper.com/"&gt;SSL Shopper&lt;/a&gt;, or even your own hosting company. I know my hosting company &lt;a href="https://support.arvixe.com/index.php?/Knowledgebase/Article/View/153/17/want-to-buy-a-ssl-certificate"&gt;Arvixe re-sells certificates&lt;/a&gt; purchased from GlobalSign. Depending on whether you are purchasing your certificate from a re-seller or directly from a CA, the price varies between $17 (the lowest I could find for a RapidSSL certificate from SSL Shopper) to a few thousand dollars. A CA or a re-seller issues you a certificate following a verification procedure that confirms that you are indeed the owner of the domain and that your company is a legitimate one whose credentials have been verified by this issuing authority. And the verification process is either manual or fully automatic and depending on how thoroughly it is done, the issuance of a certificate can take anything between a few minutes to a few weeks. I did not complete this process myself (for reasons explained below) but I do recall abandoning a few applications midway because it seemed like a hassle to provide them with information I didn&amp;rsquo;t even know the meaning of. And although an expensive, time-consuming and thorough process might make sense for a big company that is dealing in a lot of financial transactions and exchange of information with its customers with a lot at stake, I felt like it was an overkill in my case when all I wanted to secure was my personal domain and communications with my ownCloud server (remember?). Now this all sounds good, and I was almost convinced that I should buy myself one of the cheaper certificates for a few dollars a year from SSL Shopper. And I gathered all this information over a week of looking things up in my free time. I was quite sure that I had covered all viable options but I couldn&amp;rsquo;t help wondering whether it&amp;rsquo;s possible to get an SSL certificate for my personal domain for free. One final DuckDuckGo search led me to &lt;a href="http://stackoverflow.com/a/30095725/1953384"&gt;a StackOverflow post&lt;/a&gt; that answered this question in affirmative! &lt;strong&gt;Let&amp;rsquo;s Encrypt&lt;/strong&gt; The StackOverflow post pointed me to the &lt;a href="http://letsencrypt.org/"&gt;Let&amp;rsquo;s Encrypt&lt;/a&gt; initiative which essentially offers means for one to generate SSL certificate oneself via a fully automated verification process. Not just that, it offers you with a host of ways in which this can be done depending on your level of comfort with using the command-line, cPanel or any other means through which verification can be carried out. I was skeptical that something like this is too good to be true, but it isn&amp;rsquo;t. Also, the project is sponsored by several well-known organisations such as the Linux Foundation, Mozilla, EFF and CISCO. And the certificate is accepted by all mainstream browsers. As a coincidence, I later found out that &lt;a href="https://www.thesitewizard.com/"&gt;The Site Wizard&lt;/a&gt;, which I had referred to several times in the past while choosing a hosting provider, website templates, etc. is also secured by a certificate from Let&amp;rsquo;s Encrypt! Now this was exactly what I wanted, i.e. to secure my personal domain so that I can transfer data between my location and my ownCloud server. It does not matter to me (at least for now) how much extra assurance a seal from a known CA such as DigiCert or Symantec gives a visitor to my website. Plus, it&amp;rsquo;s absolutely free. In my case, I &lt;strong&gt;had the certificate generated within minutes&lt;/strong&gt; through &lt;a href="http://zerossl.com/"&gt;ZeroSSL&lt;/a&gt; with an automated ACME verification process that involved me creating two files with specific content on my domain that were verified by this website. There are many alternatives to ZeroSSL, any of which can be used as per one&amp;rsquo;s convenience. One thing to note is that the certificate issued by ZeroSSL is valid only for three months, but I don&amp;rsquo;t mind repeating the very simple process again when my current certificate expires. &lt;strong&gt;Last Words&lt;/strong&gt; So to conclude, securing one&amp;rsquo;s website with a TLS/SSL certificate is not as hard or expensive as it may seem at first glance thanks to &lt;a href="https://letsencrypt.org/"&gt;Let&amp;rsquo;s Encrypt&lt;/a&gt;. I&amp;rsquo;m very impressed by this initiative, and found it to be a perfect alternative for my needs given all other options known to me. The Let&amp;rsquo;s Encrypt team is currently &lt;a href="https://www.generosity.com/community-fundraising/make-a-more-secure-web-with-let-s-encrypt"&gt;seeking funding&lt;/a&gt; for their operations and I&amp;rsquo;m about to donate to it as a token of my appreciation. So if you are in a similar situation as I was before my research that led me to Let&amp;rsquo;s Encrypt, I hope you benefit from reading this post!&lt;/p&gt;</description></item></channel></rss>