A new bot again, so what?
I'm creating a bot for the 100,500th time, this time to process regular expressions. Now I will try to briefly explain what it is and why it is needed.
Regexp (Regular Expression) exists only for one thing, text search. We make simple text queries all the time when we surf Google or search for something on a page using ctrl + f. But to make the search more universal, for use in programming languages, we write templates, which are then processed using Regexp, here is an example of a template for searching emails:
And in order to check their functionality, since it is very easy to make mistakes when writing templates, I created a bot to process them.
And one more piece of news, my server has gone to rest, which means that not a single bot is working right now, so you won’t be able to test it, but here’s a link to GitHub (https://github.com/lixelv/regex_bot), you can do it yourself download, deploy (I know that no one will do this, but still))
I'm creating a bot for the 100,500th time, this time to process regular expressions. Now I will try to briefly explain what it is and why it is needed.
Regexp (Regular Expression) exists only for one thing, text search. We make simple text queries all the time when we surf Google or search for something on a page using ctrl + f. But to make the search more universal, for use in programming languages, we write templates, which are then processed using Regexp, here is an example of a template for searching emails:
\w+@\w+\.\w+
And in order to check their functionality, since it is very easy to make mistakes when writing templates, I created a bot to process them.
And one more piece of news, my server has gone to rest, which means that not a single bot is working right now, so you won’t be able to test it, but here’s a link to GitHub (https://github.com/lixelv/regex_bot), you can do it yourself download, deploy (I know that no one will do this, but still))
And another post about bots
My bot development process has changed a lot recently. If earlier I indicated messages directly, that is,
And I am limited by nothing, I can add languages until I run out, since translators are there to help me. It is very convenient that they can be used directly in python, which greatly speeds up the process.
In addition to creating a separate dictionary for different phrases and languages, I began to split my project into many files, about 10 in total, whereas previously all this was literally in 2-3 files. To summarize, I began to use a more convenient and correct bot architecture.
I also started using FSM, a skill that I had long wanted to learn, but never got around to. And now using this technology is a real thrill. In 6 words, this is a technology that allows you to remember user actions.
Let's move on, I switched to the new version of aiogram 3. Last summer I just started writing bots, and studied on the aiogram library version 2.25.2, but when this library was updated to version 3, I, like an old grandfather, said, why do I need this 3rd version of yours? , I'm fine with 2. This position was due to the fact that when the latest version was released, the developers literally said, show me OOP or... And the problem is that OOP was previously incomprehensible to me. And now, having returned to writing bots, I realized that the developers were great for creating version 3. To be honest, it feels like switching from a push-button to a touchscreen phone, very convenient.
I also started using Middleware, typing, Magic Filter (F), and I can go on and on. But for the most part, I did not develop bots, I did this 20% of my free time at most, the remaining time I spent solving problems in leetcode, and I have a message to the infomat. If you have heard about arrays, linked lists, queues, sets, cache tables, sets, trees and graphs, then rest assured, you may come across this at the interview, since there are simply a lot of such problems in leetcode, and you can start solving these problems after the interview in Yandex, I noticed that those 2 tasks were taken from there.
My bot development process has changed a lot recently. If earlier I indicated messages directly, that is,
await message.answer("Some_text"), now I make special dictionaries, for this here is an example:{
"en": {
"not_found": "Nothing found :(",
"start": "Hello, this bot was created for processing regular expressions, more details in /help.",
...
},
"ja": {
"not_found": "何も見つかりませんでした :(",
"start": "こんにちは、このボットは正規表現を処理するために作成されました。詳細は/helpで確認してください。",
...
},
"ru": {
"not_found": "Ничего не найдено :(",
"start": "Привет, этот бот был создан для обработки регулярных выражений, подробнее в /help.",
...
}
}And I am limited by nothing, I can add languages until I run out, since translators are there to help me. It is very convenient that they can be used directly in python, which greatly speeds up the process.
In addition to creating a separate dictionary for different phrases and languages, I began to split my project into many files, about 10 in total, whereas previously all this was literally in 2-3 files. To summarize, I began to use a more convenient and correct bot architecture.
I also started using FSM, a skill that I had long wanted to learn, but never got around to. And now using this technology is a real thrill. In 6 words, this is a technology that allows you to remember user actions.
Let's move on, I switched to the new version of aiogram 3. Last summer I just started writing bots, and studied on the aiogram library version 2.25.2, but when this library was updated to version 3, I, like an old grandfather, said, why do I need this 3rd version of yours? , I'm fine with 2. This position was due to the fact that when the latest version was released, the developers literally said, show me OOP or... And the problem is that OOP was previously incomprehensible to me. And now, having returned to writing bots, I realized that the developers were great for creating version 3. To be honest, it feels like switching from a push-button to a touchscreen phone, very convenient.
I also started using Middleware, typing, Magic Filter (F), and I can go on and on. But for the most part, I did not develop bots, I did this 20% of my free time at most, the remaining time I spent solving problems in leetcode, and I have a message to the infomat. If you have heard about arrays, linked lists, queues, sets, cache tables, sets, trees and graphs, then rest assured, you may come across this at the interview, since there are simply a lot of such problems in leetcode, and you can start solving these problems after the interview in Yandex, I noticed that those 2 tasks were taken from there.
Almost everything was perfect, but the raspberry, the traitor, was all moldy. This was a very unpleasant discovery for me.
Created site
In general, I wrote a mini-site to interact with cookies (it was necessary for work), and decided to deploy it on Vercel (a platform for free website hosting), and everything worked out. By default, who needs GitHub keep.
You also need a mini instruction for the site, so here it is. Write certain values in key and value, then click Add. Next, to get the value that you entered, simply write the key that you wrote down in key, press Get and your value appears in the required window.
In general, I wrote a mini-site to interact with cookies (it was necessary for work), and decided to deploy it on Vercel (a platform for free website hosting), and everything worked out. By default, who needs GitHub keep.
You also need a mini instruction for the site, so here it is. Write certain values in key and value, then click Add. Next, to get the value that you entered, simply write the key that you wrote down in key, press Get and your value appears in the required window.
Website - calculator
Lately I’ve wanted to get involved in frontend development, because firstly, it’s a very useful skill, and secondly, it’s quite meditative.
And today at home I finished the calculator. If anyone has a question why? Then to fill your hand. You won’t get GitHub), but the link to the site itself is fine: https://web-calculator-rho-seven.vercel.app/
Lately I’ve wanted to get involved in frontend development, because firstly, it’s a very useful skill, and secondly, it’s quite meditative.
And today at home I finished the calculator. If anyone has a question why? Then to fill your hand. You won’t get GitHub), but the link to the site itself is fine: https://web-calculator-rho-seven.vercel.app/
The server is resurrected
Today I reinstalled Linux on the Raspberry Pi server. Now it's finally running and I can deploy my bots again.
I uninstalled the previous Linux because over the years I had accumulated a lot of unnecessary modules that were loading the memory and processor.
Today I also slightly improved the site with the calculator. Added key press animation and support for keyboard input.
Today I reinstalled Linux on the Raspberry Pi server. Now it's finally running and I can deploy my bots again.
I uninstalled the previous Linux because over the years I had accumulated a lot of unnecessary modules that were loading the memory and processor.
Today I also slightly improved the site with the calculator. Added key press animation and support for keyboard input.
Calculator x2
If before it was just a website, now it is a whole separate application on the PC! For this I spent more than one thousand neuron cells. It was absolute hell. Errors and misunderstandings of what was happening haunted me throughout the entire development. Electron is the worst framework I've ever dealt with!
But still, I was able to create a program. Oh, and if you suddenly want to change the size of the window, then click on ^, and then on + or -. There is also GitHub. And a site for previewing the calculator. Oh, and also grab the installation file if you want to try it.
If before it was just a website, now it is a whole separate application on the PC! For this I spent more than one thousand neuron cells. It was absolute hell. Errors and misunderstandings of what was happening haunted me throughout the entire development. Electron is the worst framework I've ever dealt with!
But still, I was able to create a program. Oh, and if you suddenly want to change the size of the window, then click on ^, and then on + or -. There is also GitHub. And a site for previewing the calculator. Oh, and also grab the installation file if you want to try it.
I bought a laptop stand
I ordered a laptop stand from ozone, because after hours of sessions at the computer my neck doesn’t feel good, so by raising the computer higher I’ll stop constantly looking down, which I hope will help.
So now I’m busy with a calculator, but as an application on a PC, because electron (a thing for creating applications based on websites, written in JavaScript) is such garbage. I suffered with him for a very long time, you would know how much he infuriates me. Now I want to blame him on tauri, which is what I will do.
I'll let you know when everything is ready.
I ordered a laptop stand from ozone, because after hours of sessions at the computer my neck doesn’t feel good, so by raising the computer higher I’ll stop constantly looking down, which I hope will help.
So now I’m busy with a calculator, but as an application on a PC, because electron (a thing for creating applications based on websites, written in JavaScript) is such garbage. I suffered with him for a very long time, you would know how much he infuriates me. Now I want to blame him on tauri, which is what I will do.
I'll let you know when everything is ready.
Calculator x3
I've been working on the calculator for the last week. I fixed its web version for phones, added new customization options, in general, a lot has been done.
Here's a link to the web version of the app, those who are on phones, don't worry, the previous bug with cut buttons has been fixed. And another joke with the fact that you couldn't log in because of Vercel's jokes. Here's a link to the site: https://web-calculator-tau.vercel.app/
And a little about customization. When you press ^ for the keys 0123456+-*/, the functionality changes, so here's what they are responsible for.
0 - change key transparency
123 - change theme
456 - change key rounding
+- - change window size (only in the application on a PC)
*/ - change font size
That's all, basically. I'll be very happy if you visit the site at least once, or, incredibly, download the .exe program. Oh, and according to the classic GitHub.
I've been working on the calculator for the last week. I fixed its web version for phones, added new customization options, in general, a lot has been done.
Here's a link to the web version of the app, those who are on phones, don't worry, the previous bug with cut buttons has been fixed. And another joke with the fact that you couldn't log in because of Vercel's jokes. Here's a link to the site: https://web-calculator-tau.vercel.app/
And a little about customization. When you press ^ for the keys 0123456+-*/, the functionality changes, so here's what they are responsible for.
0 - change key transparency
123 - change theme
456 - change key rounding
+- - change window size (only in the application on a PC)
*/ - change font size
That's all, basically. I'll be very happy if you visit the site at least once, or, incredibly, download the .exe program. Oh, and according to the classic GitHub.
This is my current list of things to do in the calculator. What I crossed out, I did.
Calculator x4
Added new functionality to the site. 1 now there are 4 themes, place 2 before (the transparent theme for the site has been removed). 2 The control interface has been changed, now to change the theme just press ^1, to change the rounding ^2, and to change the font size ^3 (now */ do not work).
In general, that's all for today. And it is important to clarify that these changes have so far affected only the website and application for mobile phones. I will finalize the PC version later.
Oh, and one more correction. Because of my favorite sw.js, the site works according to the logic that it first takes the downloaded data, and if there is none, then it contacts the server. In other words, unless you delete your browser history before you visited the site, you will not receive a new version(. It shouldn’t work like that, I’ll fix it.
Added new functionality to the site. 1 now there are 4 themes, place 2 before (the transparent theme for the site has been removed). 2 The control interface has been changed, now to change the theme just press ^1, to change the rounding ^2, and to change the font size ^3 (now */ do not work).
In general, that's all for today. And it is important to clarify that these changes have so far affected only the website and application for mobile phones. I will finalize the PC version later.
Oh, and one more correction. Because of my favorite sw.js, the site works according to the logic that it first takes the downloaded data, and if there is none, then it contacts the server. In other words, unless you delete your browser history before you visited the site, you will not receive a new version(. It shouldn’t work like that, I’ll fix it.