Connect4 Minimax AI

There is already a ton of material on the internet about how to write connect 4 ai. I have tried to use that information to create my own command line connect 4 game. Also I have open sourced the code to invite collaboration or just have some fun playing the game. https://github.com/saltperfect/connect4-ai Leave a start you had fun playing it.

Docker Experiments

Mapping current directory to container directory for realtime updates. It’s a Sunday afternoon and you decided to hack something up but when you started to install those creepy deps, you get ERRORS!!. To solve this you spend a lot of time on stackoverflow. Maybe you find some resolutions they want you to run some unknown commands you don’t want to mess up you computer. This happens with the best of us and instead of hacking away you end up in dependency hell.
Read more

Context

The context package in go provides a path to cancel and propagate cancelling information around the methods and even across http servers. Consider you request your server with some information but want to cancel that request halfway, or maybe somehow the connection get drops. The ability to propagate that information to server and trigger cancellation of that request will save you lot of computations. The below code is in example implementation of exactly this.
Read more

TCP echo server

Let go through and try to understand how easy it can be to send and receive messages on tcp socket. Lets first talk about the server and how to build one. package main import ( "fmt" "net" ) func main() { listener, err := net.Listen("tcp", ":8080") if err != nil { panic(err) } defer listener.Close() for { conn, err := listener.Accept() fmt.Println("request received") if err != nil { panic(err) } go handleConnection(conn) } } func handleConnection(conn net.
Read more

Memory Management done right!

This post is in continuation to compiler 101 post. These points came out while discussing language and compiler What do you mean when you say this language has good memory management? There are two aspects to memory management in perspective of any language. a. Is the program able to release the unused memory. If a program is unable to do so, it causes memory leaks b. When trying to allocate some memory for the program is the program able to get memory that is not being used by any other programs
Read more

Compiler101

It is very easy in the hustle and bustle to keep up with all the cloud technologies, to forget about the basic principles of writing instructions for computers. Yesterday, I sat down with @aditya1304jain and asked him to tell me all about it. Here are few of the points that you might benefit from. Compiler and Languages Every compiler has a frontend and a backend. Frontend is platform independent and backend is dependent.
Read more