Sophomore && CSE Undergrad

Take a look at GC running visually

Image for post
Image for post
Photo by li hao on Unsplash

Quick Look at Garbage Collector

‌A simple program that creates a byte array of 100000000 elements and lets print the memory allocations.

package mainimport ("fmt""runtime""time")func printStats(mem runtime.MemStats) {runtime.ReadMemStats(&mem)fmt.Println("mem.Alloc:", mem.Alloc)fmt.Println("mem.TotalAlloc:", mem.TotalAlloc)fmt.Println("mem.HeapAlloc:", mem.HeapAlloc)fmt.Println("mem.NumGC:", mem.NumGC)fmt.Println("-----")}func main() {var mem runtime.MemStatsfor i := 0; i < 2; i++ {s := make([]byte, 100000000)if s == nil {fmt.Println("Operation failed!")}printStats(mem)}time.Sleep(time.Second)// adding time.Sleep so that GC finishes it works and print out the output to terminal}

‌Understanding the code

There is a package in Golang standard library called runtimewhich contains alot of useful function like…


Super Simple

Image for post
Image for post
Photo by Roman Synkevych on Unsplash

Code we will be testing :

package mainimport (    "fmt"    "log"    "net/http")func main() {  http.HandleFunc("/", helloWorldEndPoint)  fmt.Println("Server :  http://localhost:8080")  log.Fatal(http.ListenAndServe(":8080", nil))}func helloWorldEndPoint(
writer http.ResponseWriter,
request *http.Request) {
fmt.Fprintf(writer, "hello world")}

Testing web server in Golang

  • create a file with name <anything>_test.go, these files are ignore by compiler
  • write a func matching func TestXxx(*testing.T) where Xxx does not start with a lowercase letter. The function name serves to identify the test routine.
  • To run the test : go test

Writing Test‌

  • inorder to test the handler, we call it by passing http.ResponseWriter and *http.Request
  • to create a new…

Image for post
Image for post
Title Image By Uday Yadav

You can simply get started with my boilerplate on GitHub :

Or here is the procedure :

The Big Question: Why this article when there are hundreds of similar articles on this topic.

Answer: When I tried to create a typescript server with node, I faced issues that weren't addressed in procedures I followed.

So let’s get started

  1. Create a new project folder
  • Create a new project folder on your computer and open it in your terminal
  • Run the following command to initialize an npm project
npm init

2. Installing Dependencies :

Install the following dependencies that will get you started

npm install typescript express @types/express @types/node ts-node ts-node-dev

Add tsc in scripts inpackage.json

"scripts": {
...
"tsc":"tsc",
... …


Image for post
Image for post
Photo by Markus Spiske on Unsplash

It was amazing!

Disclaimer: I don’t claim to be an expert in any of them. This was just a thought experiment

Here’s how it all began :

In the last week of May, I was working on the front-end part of my personal project, which got me frustrated and bored to some extend. So I decided to take 1–2 days off to refresh myself. I decided to take a deeper look at the world of competitive coding (i do solve some questions, but not very seriously). So wandering on the internet I came to this website called code wars. While signing up, they asked to pick a language, but they had more than 50 languages, which got me thinking, why people make so many languages when we already have so many computer languages. …


Also an amazing programming language for mathematical modeling data science, statistics, and machine learning.

Image for post
Image for post

For those of you who don’t know what Julia is, here is a quick and short intro :

  • Julia is a high-level, high-performance, dynamic programming language, designed and developed by Jeff Bezanson, Alan Edelman, Stefan Karpinski, Viral B. Shah
  • While it is a general-purpose language and can be used to write any application, many of its features are well-suited for numerical analysis and computational science.
  • Julia proves to be faster than Python as it keeps reaching the speed of C, puts up a pretty impressive performance against python.


The hot new server-side high-performance language.

Image for post
Image for post

For those of you who don’t know what Golang is, here is a quick and short intro :

  • Go is a statically typed, compiled programming language designed at Google by Robert Griesemer, Rob Pike, and Ken Thompson. Go is syntactically similar to C.
  • It has memory safety ( uses a garbage collector ), structural typing, and CSP [communicating sequential processes]-style concurrency.
  • In simple words, Golang is like Java in terms of processing but written like C

Why Golang?

We live in a world where Java handles the majority of critical processes, but the thing is, java is old getting old, in the sense that writing concurrent programs is difficult, as more and more servers are UNIX based, shell scripts to manage servers is limit (that’s where python came in ), poorly implemented generics and no support for unsigned data-types, has hidden relationship between code and hardware. …


and it’s compiler is just mind-blowing

Image for post
Image for post
Original Artwork by Uday Yadav

For those of you who don’t know what Rust is, here is a quick and short intro

  1. Rust was originally designed by Graydon Hoare at Mozilla Research, yes the company that makes Mozilla web browser.
  2. Rust is a programming language focused on performance and safety, especially safe concurrency. Rust provides memory safety without using garbage collection (like Go).
  3. It’s a systems programming language, hence it can run as fast as C and sometimes even faster.

Why Rust

In the world where C/C++ powers everything we know, what brings us to Rust? …


It’s super easy !!!

Image for post
Image for post
  • Step 1: Install dependencies

You will be needing the following packages

npm i express dotenv
  • Step 2: Create a server file in Project Folder

Inside your project folder, create a file named “server.js” and copy the following contents inside it.

const path = require('path');const express = require('express');const app = express();const port = process.env.PORT || 3000;app.use(express.static(path.join(__dirname, 'build')));app.get('/*', (req, res) => {res.sendFile(path.join(__dirname, 'build', 'index.html'));});app.listen(port, () => {console.log('Server is up!');});
  • Step 3: Push to GitHub

Add git add all your files, commit them and push them to GitHub, we will deploy the automatically from…


When speed meets power !!!

Image for post
Image for post

From here, you have 2 options

  • Utilize Colab’s GPU
  • Just run on CPU

Just using CPU

Create a file with .ipynb extension and paste the following JSON in it

This article was written in June of 2020, please check for the newer version, if you can find it.

{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Julia on Colab.ipynb",
"version": "0.3.2",
"provenance": []
},
"kernelspec": {
"name": "julia-1.2",
"display_name": "Julia 1.2" …


You don’t have to(mostly), just click a button!

Vue.js is probably the best js front-end framework, and Heroku is probably the best PaaS.

Image for post
Image for post
vuejs — Heroku

Together they define synergy.

  1. Install the following npm dependencies
npm install express dotenv serve-static

2. Create a file named server.js in the project folder

Add the following code snippet in it

// Server fileconst express = require('express')const serveStatic = require('serve-static')const path = require('path')const dotenv = require('dotenv');dotenv.config();const app = express()// All urls goto to index.html in /dist folder [build folder]app.use("/", serveStatic(path.join(__dirname, '/dist')))app.get(/.*/, function (req, res) {res.sendFile(path.join(__dirname, '/dist/index.html'))})const port = process.env.PORT …

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store