Today I have to admit I did not open IDE somehow for more than just one line of code 😀 Got stuck into analyzing the logs and cleaning one of my website’s database.
All in One SEO plugin (do not recommend!) created around 3 million garbage entries into the WP+WooCommerce database with scheduled actions (mainly by aioseo_sitemap_ping). It is multiple times more than the whole site itself.
wp_actionscheduler_logs table had 1 973 366 entries
wp_actionscheduler_actions table had 912 058 entries
I emphasize that these entries are just unwanted garbage and do not create any value. In order to clear it you need to enter the database (through PMA or some other way) and run DELETE FROM table WHERE ...; SQL query. I can assure that deleting millions of entries takes some time from database engine 🙂
The only line I wrote today (except SQL queries) was add_filter( 'aioseo_sitemap_ping', '__return_false' ); to kill the unnecessary scheduled action.
Issues with guides. When installing twig then phpStorm cried that I have old version of composer. OK, sudo apt-get remove composer (because suggested composer self-updatedoes not work) and sudo apt-get composer and the result is that I still have old one 😂 Then I followed the composer installation guide and when trying to make it global it gives me wrong path in the guide. Correct one would be /usr/bin/composer and debugging it took me quite a while.
As you can see I have been messing around with the birthday reminder app.
Discovered: “Officials are investigating whether the company, founded by three Russian engineers in the Czech Republic with research labs in Russia…” is a way to describe JetBrains in The New York Times.
As I sometimes lock myself out from Facebook I have no idea if any of my friends is having a birthday any time soon. I also already have difficulty remembering ages and birthdays of all my relatives (especially new ones). Before solving my personal CRM needs with Monica I decided to build something myself.
Today I worked on building a small web app using sqlite and php to save/edit/delete birthdays of my friends and family, calculate ages etc.
Most difficult was to figure out how to sort recurring (yearly) events starting from “next upcoming” with single SQL query. But I think I figured it out by using one SQL query followed small php loop (which has worst case complexity of O(n)) to find the place to split an array 🙂
SELECT id, firstname, lastname, birthday, (current_date - birthday - 1) as age, substr(birthday, 9, 100) as day, substr(birthday, 6, 2) as month FROM Persons ORDER BY month, day;
Hopefully I can get it ready enough at some point for sharing on Github. Something cool for the end:OpenAI has trained a model that can create new images – you just describe them in English. Mindblowing.
Felt myself strong and very fit before the exam. Not that strong afterwards 😀 But was fun 1h 45min rally.
Main learnings from the exam:
If you have a tree with only two levels of depth and ~10 entities then you don’t need to invent a universal search algorithm. Just two loops is enough.
serialize() in php creates a string that includes special characters. Therefore, if you are using front-controller pattern, you also need to encode and later decode it. Otherwise, data gets lost.
Found hilarious Github repo. If you are asking what C# for beginners course is in TalTech then in a nutshell: EnterpriseQualityCoding (just imagine that it is written in C# instead of Java). It is a FizzBuzz (very simple game) EnterpriseEdition (written in a complicated way).
If you are getting this error NETSDK1005 when trying to scaffold the webpages that says “Assets file [..] doesn’t have a target for ‘net50′” then please check if you have updated dotnet aspnet-codegenerator. Documentation is behind this link.
I got stuck to this for some time before figuring it out. I had updated dotnet SDK and runtime but not aspnet-codegenerator (which I was not aware of).
Though, now I am running into another issue – “A file matching the name Create.cshtml was not found” 🙂 I have not yet figured out any solutions. But I see people runningintoit quite everywhere.
Update: I discussed it with the teacher and TAs and got to the conclusion that this is some kind on Linux specific aspnet-codegenerator issue. As it is used mainly for intoductory/demo purposes at this point then I simply proceed without demo content as there is no actual need for this.
Few useful commands for myself as a footnote:
dotnet tool list -g (List your dotnet tools, useful)
Updates dotnet tool update --global dotnet-ef (EF update to the latest, link) dotnet tool update -g dotnet-aspnet-codegenerator (Update codegenerator, link)