Regex and NFA

Regex and NFA

It has been a while for me, to come to the myth of Regular Expression. As your daily work, I think It’s rarely being used. Cause we have many tools to extract the information needed from a file/page/database … But If you start getting doing some server-side tasks, the concepts: grep, awk, cat, vi … starts come to your tool belt. And in order to use those efficiently and really gain power from the answer “I know it matches”. the…

Read More Read More

DFA and substring search

DFA and substring search

I) Tricky question from bankers In the world of “A”, “B”, and “C”. *Story a) I have a credit card with the characters: A B A B A C The banker asks: Does your credit card contains: A B A C ? I look up the card, and for a few seconds I know, my card does contain it. and it matches my last 4 characters. *Story b) My friend has a credit card at another bank with the characters:…

Read More Read More

Least significant digit(LSD)

Least significant digit(LSD)

I) Why do I need to care about LSD while we have: Selection/Quick/Merge … sort already? Sorting elements is somewhat interesting and confusing (for me), cause It’s not intuitive, after exchange/switch some elements we immediately lose focus (where am I now, after that) but it’s interesting because it will make you think of a list a bit different and I mean quite different. Along with some elementary sorting algorithms like Bubble sort/Merge sort/ Quicksort, the shiny one could be LSD…

Read More Read More

Try (tries)

Try (tries)

We’ll meet a Try, a trie like data structure, consuming big space but when doing a search, it provides a really high score which hard to beat. Spell checking in Words, search suggestion in your Google address bar, fast text input… those are where tries become a good candidate. Let take a look at the overview of this data structure. I) Story context Suppose we have 3 people: “David”, “Tom”, and “Dan”. And we want to associate each one with…

Read More Read More

A day

A day

Nay là ngày đầu tiên của tuần cuối mình đi làm tại công ty, sáng hơi mệt mặc dù qua mình không ngủ muộn. Công việc thì vẫn vậy, mình đã complete khá ổn việc từ những tuần trước nên tuần cuối này, chủ yếu vọc vạch xem có gì cần help không, và trước khi mình off, ngày mốt mình sẽ hold thêm một buổi talk để transfer phần còn lại của cái project. Mình nghĩ về công việc,…

Read More Read More

Mông lung

Mông lung

Mình có thói quen, sáng thức dậy nếu không có gì gấp gáp, sẽ mở Facebook lên check tin xem có gì mới. Hai tuần nay rồi, cái đầu tiên ập vào mắt mình hầu hết là : Corona, bao nhiêu người nhiễm, ở Đồng Nai đã có ca đầu tiên, nhiều tin khác. Mình cũng biết là Corora nên rất hạn chế đi ra chỗ public, đặc biệt là Cafe Coffee House, mình hay ngồi ở đây để học…

Read More Read More