18. Dec 2019 |

Last day at school this year and… I am confused

TL;DR In order to create some buffer that allows me to study useful things (computer sciences) at a feasible pace I need to study… other things. And it is only my fault.

I am writing it only to clear my thoughts

All my life I have liked going to school and I still do. Initially, my idea was to come to TalTech and to study things that I need. I have written about the need here and everything in the study programme seemed to fit. And NOT to study things that I already have learnt.

I have a master’s degree in business administration and have worked 7 years in an international company. So there is no actual need (at least I feel this way) to study English (12 EAP!!!), basic economics (6EAP!!!), business communication (3EAP), entrepreneurship (3EAP) etc. It is simply a waste of my time without any benefit.

There is a VÕTA solution, that would allow me to get previously mentioned subjects “done”. The snag is that VÕTA does not help meeting the semester’s EAP requirement. And my problem is that I am not simply capable of learning ONLY computer-subjects at the pace that is needed (30EAP worth of “something from the programme” every semester) if I decide not to create a buffer with unnecessary subjects.

So, from next semester I will start learning English to create some buffer. Because otherwise, I would have to pay 40€ every semester for every EAP that I am missing from cumulative EAP requirement.

Curious

I prepared such overview of IADB17/17 subjects. Maybe I am getting it wrong but there are two illustrative KPIs for subjects:

  • The average grade
  • Positive results / declarations ratio

I am curious who suggested that Logic is the only recommended elective course on the 2nd semester’s standard study plan? Nothing else is not even mentioned there 😀 By forementioned KPIs it seems to be the hardest subject on the programme. And for spring semester there are plenty of other things to choose from.

4. Dec 2019 |

Quick school update

Not much time to post, therefore just some quick notes.

I admire my Russian coursemates. It must be so much more difficult for them with this language barrier. I did no see it at Tartu University that much.

I tend to be amused by people’s ability to listen to (for example) set theory lecture (which is quite intensive) and solve OOP puzzles on Python at the same time in early morning lectures 😀 What a brain must it be.

Kakk is a real influencer. To get Django to work with all the pip installations I finally installed Linux (Ubuntu, dual boot next to Win10). Pip and Django installation was just ~20 characters of command lines to the terminal. Compared to the mess on Win10 and its Ubuntu terminal 😀 So now all my coding takes place on Linux part of my computer.

I just did my first AOC task and got the first points. So being a nerd is now official I assume.

Algorütm (in Estonian) is a really good podcast. I got shivers listening to Alvar Lumberg and Sergei Anikin on fire talking about Transferwise’s architecture.

21. Nov 2019 |

Audience of Testlio CEOs’ lecture in 2015

Audience of Kristel Kruustük and Marko Kruustük
Audience for the lecture by Kristel Kruustük and Marko Kruustük – founders of Testlio.

Kakk mentioned the importance of alt tags so this is the first picture I added those. This is just a funny picture from 4 years ago. Audience for the lecture by Kristel Kruustük and Marko Kruustük – founders of Testlio. I belive they now would have this classroom packed (like Python Code Clubs are on Wednesdays).

16. Nov 2019 |

Pentabonacci and other N-bonacci numbers

I had Python test on friday and one of the tasks was related to calculating pentabonacci numbers. I was not able to solve it because I did not know the meaning of the word. But it is actually really simple task that can be solved with a list and sum of list elements. You can find some information here and on GeeksForGeeks (by the way, it is really good explanation!)

14. Nov 2019 |

Järjehoidja endale – IT-ametite päev

Hea video IT õppimisest neile, kes veel mõtlevad. Ago juhib hästi tähelepanu sellele, kuidas natuke eksitavalt kommunikeeritakse IT õppimise “lihtsust”. Samas, minu arust natuke liiga palju räägib “suurtest palkadest” ja “lahedatest kontoritest”, mis kumbki väga ei päästa, kui töö ikka üldse ei meeldi 🙂 Väljalangemiste asi on minu jaoks muidugi ikka müstika (23-24% juures paistab graafikul olevat). Et kas või kuidas saavad mingid asjad mingil hetkel osutuda ületamatult raskeks VÕI kas tegelikult ka inimesed lähevalt lihtsalt tööle poole õpingu pealt. Samas ma ei taju hästi ka enda puhul hetkel, kui realistlik selle õppekava läbimine üldse on. Aga noh, mõtlen, et kui asjadega tegeleda, siis ju peaks olema küll.

Inimeste lugusid oli küll huvitav kuulata selles videos. Lauri Greenbaum SEBst meeldis sellise suurkorporatsiooni protsesside vaatega ning tegelikult ka näiteks Marek Õunpuu – kuidas kuu ajaga saad Omniva Java junior arendajaks (ja samal ajal see 23-24% väljalangemine IT õppes). Ühtlasi soovitan Algorütm podcasti, mis natuke annab veel IT töö ja hariduse teemale vaatenurga kolme tippjuhi poolelt.

9. Nov 2019 |

Bulk delete WooCommerce products by category using WP-CLI

If you would like to know how to bulk delete posts from a specific category using the WP-CLI then here it is.

WP-CLI is command line interface for maintenance of WordPress. This is something I try to figure out.

Deleting one product

This deletes 1 product. 1157 is product ID. Without –force it does not work, because posts of type ‘product’ do not support being sent to trash.
So you need to use –force flag to skip trash and delete them permanently.

wp post delete 1157 --force

Deleting 100 products

Now I try to figure out how can I delete all products within category. This allows to delete 100 products at a time.

wp post delete $(wp wc product list --user=1 --format=ids --category=64) --force

Deleting specific number of products

wp post delete $(wp wc product list --user=1 --format=ids --category=64 --per_page=10) --force

By specifying –per_page you can limit how many products will be deleted with one execution. But it only works between 1 and 100 products.

Reason is that WooCommerce commands are implement as REST API requests and they are limited to a maximum of 100 results per request. This is a limitation that comes from WooCommerce, not WP-CLI. It’s unfortunate they have limited it that way, as it seriously lessens the benefits of having CLI commands in the first place.

Final solution that works (tested with 5000+ products)

for run in {1..2}; do wp post delete $(wp wc product list --user=1 --format=ids --category=64 --per_page=10) --force; done

This line does the job. Loops I found here and here. This sample deletes 20 products by using two runs, 10 products each. And this deletes products with status as “draft” (reference):

for run in {1..2}; do wp post delete $(wp wc product list --user=1 --format=ids --status=draft --per_page=10) --force; done

Delete products by product tag

Another one is here. tag is product tag ID.

wp post delete $(wp wc product list --user=1 --format=ids --tag=82 --per_page=2) --force

Deleting revisions

It is not uncommon sites to have multiple revisions on their pages. This is simply due editing and updating content. Let’s say for example a site has 700 pages or posts with 150 revisions on each, this would be over 100,000 entries in the database. To delete unnecessary revisions you can use the following command line:

wp post delete $(wp post list --post_type='revision' --format=ids) --force

I have posted the question also to WordPress.org forum here for discussion and #cli channel. Hopefully someone comes up with the answer 🙂 Also sent it to Eric. Maybe he knows.

Bonus:
WP-allimport faster finder: [wc_get_product_id_by_sku({sku[1]})]
Delete all images in media library: wp post delete --force $(wp post list --post_type='attachment' --format=ids)

1. Nov 2019 |

How to remember

When I do coding tasks for school I find really cool solutions and wonderful workarounds from time to time. I wonder how should I remember all this. How should I archive and structure all this knowledge. Should it be like learning a language where I should prepare learing cards (for vocabulary) to remember basic things by heart. Like what goes where when I need to append something to a list.

 

18. Oct 2019 |

Finding descriptive statistics about IT studies in TalTech

Good statistics about school and subjects are really difficult to find even though we are quite often talked about the importance of high-quality data. But I found some here: ÕIS – Üldinfo – Statistika – Õppekavad – Õppeainete statistika. Quite… huh.

This is the picture of autumn semester results in the year 2018/2019 on my curriculum IADB17/17. These all are not the first-year subjects! I highlighted the subjects that I study in this first year’s first semester. I wonder what is going on with the basics of programming (ITI0102) where there are 441 students in the beginning but only 271 in the end (out of which 95% get a positive result). Our teacher Ago commented that the drop-out is ~30% and it is significant among session students (which is something I understand).

Also, an interesting finding for me is that the subject named “Sets, relations, systems” (of which I have already written here) seems to be the real gourmet subject. Out of hundreds of students, only 26 have decided to study it. And it also has the second-lowest average grade out of this selection of subjects.

I still have not found anything to use for the graduation rate.

Random things that need sharing

The canteen of IT College has its own Spotify playlist. Because why not. And I like these soundproof phone booths in TalTech Library. I like that doors open themselves. Very effective solution for minimizing the spread of viral infections though minimizing the contact with highly likely contaminated surfaces (like door handles).

12. Oct 2019 |

10,000-Hour Rule – key to success in coding?

Practice will make you better. Don’t expect it to make you perfect.

Malcolm Gladwell, the author of “Outliers” explains the key to success in any field is simply a matter of practicing a specific task that can be accomplished with 20 hours of work a week for 10 years (which makes 10 000 hours).

I started using Toggl to track the time that I spend on different tasks. It is a very good tool for this. For better reporting, I used TalTech as a client and subjects as projects. My tasks mainly include maintaining my online stores and doing work for school. So for reporting it is good to use TalTech as a client filter. This week I see that have spent 12 hours and 46 minutes on Python after school. It is Saturday at the moment so I expect it to reach 15+ hours coding weekly. At some point this week it made 10x what I have spent on a second subject in school.

Week 6 at school – most of the time it is coding after school only.

If we say, that I started coding this week, then 12.75 hours would make 0.13% of my learning path (10 000 hours). So I say, doing it feels like a lot. Like I am always in PyCharm. But thinking that professionals do it 8 hours a day which makes 40 hours a week – it is more than 3 times what I have done this week 😀

Toggl is far from… or not

Toggl is not the one to blame. Update from week 7 is that I very often forget to turn Toggl on or off. But I think, despite the gaps in tracking I got around 35 hours of independent after school work. Most of it for “Sets, relations, systems” (all Thurdsay and Friday) because I had the test on Friday evening. Python got its 14 hours this week.

Read more:

Vox, Wikipedia