Today I learned some optimization techniques for algorithms. One of the most important techniques is use fastest lookups with HashTables, change the data structure in which the data is represented, use the right data structure for the problem, use greedy algorithms, etc. I am in the last part of the book.
Today I learned how to backup a production database in SQL using a SQL query. First I created a new empty table with the same columns of the database to be backed up, then I use the INSERT INTO
SQL statement to copy the data from the database to the new table. After that I use the SELECT * FROM
SQL statement to copy the data from the new table to a file. This is a simple way to backup a database, currently I don't know another ways to backup a database, I will go to investigate this topic.
Today I studied the Dijkstra's algorithm, this algorithm is used to find the shortest path between two nodes in a weighted graph. For the studied implementation we use Map and List to represent the list of visited nodes, etc in the algorithm. It's complex understand this algorithms the first time, you start thinking what I am doing here, really very hard. Well I am in the last chapters of my DSA book, after complete the book I will need to continue reinforcing these concepts with LeetCode problems and making some applications for learning purposes.
These days I have been studying about Graph data structure, I learned the basics of graphs, how a graph is represent by vertices and edges, some type of graphs and the most common algorithms to traverse a graph like DFS and BFS.
Today I have been working on implement autocomplete and autoCorrect functions in a Trie data structure, I am having some problems understanding how recursion works, Trie operations are based on recursion and backtracking. My assumption is if I can understand this two hard topics, I can upgrade my programming skill to the next level. Tomorrow I will need to continue working on this.
Today I continue my DSA study, this time I am learning how to implement a Trie with Java, also I learned that a Trie is a data structure designed to work on strings, and operations like find a word, insert a word, delete a word, etc. One of the most common usages of a Trie is to implement search operations and autocomplete features.
Today I have been working on a little application to solve mathematical problems. My son has a school vacation homework to solve some problems from a PDF document, so I think well I am a developer I can build an application to given a text file with the problems, the application ask these problems by the CLI and the application will show the result. I am using Golang to build the application. When I complete this application I will share the code in my GitHub account.
During these days I am having a lot of work out of normal hours, so I am feeling very tired. Sometimes in this professions we need to work on critical things for the company, and well you will need to work long time periods to make the things flow. I love these moments because remember to me the time when I had another non-programming works and working for more than 12 hours was normal. Sometimes non-good situations are good to remember the past and be grateful for the present.
I completed the Distributed File System tutorial. I had some problems finishing the tutorial because the application does not worked as expected, I needed to debug the application to understand the problem. The tutorial at the end suggest make the next functionalities to the application, so I am working into implement them in the project. It's hard really hard implement something without the tutorial, my experience with concurrency and distributed systems is very low.
Today I have been working and understand and issue related with golang and goroutine. It's interesting how building a distributed system you need to apply asynchronous programming to manage the connections and any block operation. This type of code thinking is new for me, is very different from building a basic HTTP services or web services.
These days I continue working on the Golang Distributed File system project. I continue learning interesting things about Network, Peers, Application nodes, distributed systems like this, etc.
Today I did a LeetCode problem in which I need to convert a Roman number into their integer value like XVII --> 57. The problem was an easy level, but I needed to review a YouTube video to understand how to solve the problem. The most important thing to solve this tricky problems is know the pattern to solve or the concepts to solve the problem.
Today I have been analyzing a legacy Java code, one of the reasons to start to learn Go is to work with more new software technologies. Sometimes you can feel tired to work with legacy code bases and Java is a popular election for this. The problem is the people write a lot of boilerplate code and uses Java as a procedural language not using the OOP features/style. At least with Golang and Python most of the times also you have procedural code but avoiding all the boilerplate, with any language you can write nasty code this is the real problem.
Today I did a little research about how works the batch operations specially in SQL databases, I am facing a problem in which the application make a batch operation to a database to save some data, the problem is the application requires minutes to perform the batch operation. due to this the application requires hours for the time execution, the application works as a cronjob.
Today I continued with my tutorial/project I am learning with Golang how to copy data from a peer and transmit this data to other peers connected to a network, is very interesting how these things work under the hood, I am learning about networking, File Systems and Golang. Also I learned what is a Monotonic Array solving a some LeetCode problems.
I have been doing the Distributed File System project, I am learning a lot of things about Go and Networking. Now I know why the people loves go, is very fast to write a code without boilerplate like Java, in the past I never attempted to create a low-level project like this, I don't know if with Java make this type of things is smoothly like in Go. I am exciting to finish this project to retake my own Message Broker project. This time I have the plan to write the Message Broker using Golang and reading the RabbitMQ and Kafka source code to understand how they work under the hood.
Today working on my Go tutorial project, I discovered that Go has a good standard library to manipulate files and directories, really some operations are very easy and fast rather than Java, we save a lot of code lines with Go. I am feeling good with writing low level code with Go, I know that Golang is not a low-level language but I feel good writing applications that are not web applications/REST APIs, ETL processes, etc.
Today I continued working on my Go distributed file system project, also I continue studying the Programming Skills LeetCode study plan. I started to solve the LeetCode problems with Go.
Watching some videos on YouTube and investigating more about how to create my own implementation of a Message Broker with Java, I discovered a good YouTube channel with a very good golang tutorial, the channel is Channel, I am following the tutorial to learn how to create a distributed file storage with Go. This tutorial is very extensive and is my first tutorial to create a low level application with Golang, most of my technical background comes from creating web applications with Java/Python/TypeScript. Also I started to practice on LeetCode solving the problems with Go.
During the weekend I have been studied the Message Brokers theory. I begin with a medium Go tutorial Article, on this tutorial I build a in memory basic implementation, after completing the tutorial I started my own implementation using Java. I used the Socket Java API to create the Socket server, a client can connect to the server, I used the nc linux tool to create the client. When the client connects to the Java server can send messages and the server needs to know how to understand the message. Really interesting how a message broker works under the hood. I have the plan to work on this learning project for some months. My idea is to become a expert on message brokers. I had bast experience working with Kafka and RabbitMQ.
Today I was debugging a problem with the Log42j Java library, for the project the library uses a configuration XML file to configure the logging properties, the problem was I don't know why the application was not showing info logs, I reviewed the library documentation and looks like fine. At the end of the day I replace all the info log statements to error, with this change the applications works with normal behavior. I don't want to learn about this library I prefer use the SE logging library.
Today I started to solve sorting problems, I discovered that I had problems understanding problems with a lot of words, problems that are tricky to understand and you will need first understand the problem, second discover the pattern and third solve the itself problem. Sorting problems for my are good candidates to practice this because most of the sorting problems contains a strange explanation.
Today I attempted to solve two medium LeetCode problems, after a few attempts and spend more than 40 minutes in each problem I couldn't solve them. I needed to view the solutions to understand how solve them and also understand the pattern problems.
Today I solved two medium problems on LeetCode related to arrays and math, also I reviewed the recursion topic again, working with trees I discovered that my recursion knowledge needs to be refreshed and I have a lack of knowledge about this topic.
These days I have been studying about binary search trees, I learned how to implement a BST with Python and the basic operation like inserting, deleting, update and searching for elements. I learned about pre-order and post-order traversals ways to traverse a BST.
Today I learned the concept of bitmasking, bitmasking is the concept of represent something in their binary form, I solved a leet code problem in which I represent an string into a bitmask represent the existence of a character with a number 1 in the bitmask, with this representation was easy found duplicates characters in the string.
Today I have been working on a problem, I solved the problem with a brute force solution, the problem was with the brute force the algorithm exceeded the time limit. So, I will need to investigate how can I improve the efficiency of the algorithm.
Today I studied these two sorting and selection algorithms. Quick sort is one of the most efficient algorithms to sort array elements in the average case, quick sort has a Big O notation of O(N log N)
. For the moment I don't understand how works the quick select algorithm, looks like magic how it's works.