1. Jan 2021 |

3/100 – js, php

Improved my products API to make it accessible through js fetch (got cors issue earlier).

Tomorrow I will start preparing for web technologies (mainly php) exam that takes place on Monday.

1. Jan 2021 |

2/100 – js

Finalized pwd generator and studied fetching. Today plan to learn working with the promise I get as a fetch return.

With my own json I got stuck here with CORS. Really need to build proper API at some point.

Recommend: JSONPlaceholder is a free REST API with a set of 6 common resources that you can use whenever you need some fake data.

30. Dec 2020 |

1/100 – js

Found #100DaysOfCode challenge on Tekkie‘s Twitter where he is currently learning Rust. I will try. Today is the first day.

Started with M. Kalmos JS course from 2018 🙂 I will try to do it as much as possible before it vanishes. Then it will turn into Distributed Systems (js and dotnet course).

I wanted to rebuild this in JS with some improved functionality but stuck into async-await and promises issue 😀 Classic. Need to continue tomorrow. At least I have something to do for an hour.

Update: It was simpler. For some (esthetic?) reason I executed the script before DOM was build. Rookie mistake.

15. Dec 2020 |

NETSDK1005 – update dotnet aspnet-codegenerator

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 running into it 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 --info

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)

5. Dec 2020 |

C# – cannot resolve symbol ‘UseIdentityColumns’

Getting build errors in DAL after InitialMigrate due to missing nuget package.

If you get such an error from Rider after initial migration dotnet ef migrations add InitialMigration --project DAL --startup-project WebApp that cannot resolve symbol ‘UseIdentityColumns’ then please check that you have nuget package Microsoft.EntityFrameworkCore.SqlServer v5.0.0 installed in DAL (data access layer) class library. I had it missing and could not figure out for some time and Stack Overflow did not have any threads available for it at this point.

I use C# 9, dotnet 5.0 and Rider EAP 2020.3 at the moment. If you use any of the earlier versions of dotnet or C# then please pay attention to getting the correct version of the package.

28. Nov 2020 |

Tähelepanek – tahvel

Kuna Echo360 loengute järelvaatamine on üsna… nagu ta on, siis ma ripin kõik videod (mis on omaette väike tööke*) ja panen endale Youtube’i, kus kiiruse kontroll, timestamping, kõigis seadmetes töötamine jne on palju parem.

Aga sellel on üks nõrk koht – kui õppejõud kasutab tahvlit 🙂 Sellisel juhul ma pean rippima 2 videot ja vaatamisel kuidagi navigeerima nende vahel.

Aga ma saan aru, et mingit head tehnilist lahendust ei ole hetkel olemas, kuidas arvutisse asju “tahvliliku kogemusega” saaks joonistada. Ago joonistab hiirega. Vahepeal Excalidraw‘s, enamasti Paintis, vahepeal Microsoft Whiteboardis. Põhimõtteliselt graafikalauaga see isegi toimiks aga graafika laua kasutamine (nii et see mugav tunduks) võtab päris kaua aega ja eeldada, et kõik õppejõud ennast klassis graafikalauaga hästi tunneks on ebamõistlik oodata. Mul endalgi vedeleb põhimõtteliselt kasutamata Wacom Intuos kapi otsas ja ei leia head kasutust.

Jalutamas käisin, siis kuulasin Stack Overflow Podcasti, kus räägiti IT-haridusest. Oli huvitav ja vast sobib siia ka.

Nt see koht, kus räägiti, et nr 1 oskus on AWSi hästi tunda, mis on “the new cool programming language“.

*Kuna TalTechi Echo360 seadistus hetkel annab välja heliriba ja 2 (ilma helita) videoriba, siis tuleb need ise kokku kleepida pärast brauseri Network tab’i kaudu allalaadimist. Ametlikku allalaadimise võimalust ei ole enamasti sisse lülitatud. Vanemate videote (nt 2018) seadistuses on heliriba pandud videote külge.

21. Nov 2020 |

Let the Spotify play your favourite songs by 30 seconds

Inspired by this article and the economic situation for musicians I wrote this little script. This lets Spotify to play your favourite artists on rotation and automatically presses “next” after every 33 (+ littlebit of random) seconds. 30 seconds is the minimum amount of time a song must be listened to before Spotify registers a single “play”.

Loading the song also takes little bit of time so you can not maximize the play count by making the loop take exactly 30 seconds long.

function getRandomInt(min, max) {
    min = Math.ceil(min);
    max = Math.floor(max);
    return Math.floor(Math.random() * (max - min) + min);
}

function doSomething() {
    var button = document.querySelector('[aria-label="Next"]');
    button.click();
}

(function loop() {
    var rand = getRandomInt(33000, 37000);
    console.log(rand);
    setTimeout(function() {
        doSomething();
        loop();
    }, rand);
}());

If you are using Spotify in your browser the press ctrl+shift+k or just F12, open console tab, paste this code there and press enter. This code does nothing but pressing the button with title attribute “Next” after every 33-37 seconds (random between these times).

Example of how it works in browser.

It is one option to support your favourite artists 🙂

5. Nov 2020 |

Kui kaua see aega võtab

Mind natukene rõhub see määramatus, et ma ei tea, kui kaua mingi asi aega võtab. Näiteks hetkel on 2 ainet – algoritmid ja C#. Mõlemad meeldivad aga kui mõlemal on tähtajad lähenemas, siis ma ei oska hinnata, kui kaua mul töö tegemiseks aega läheb. Ja see skaala on üsna raju selles mõttes, et ma ei tea, kas läheb 2 päeva mingi algoritmi harutamiseks või läheb 2 tundi 🙂

C# semestritöö on põhimõtteliselt selline, et kogu aeg on võimalik ka ainult sellele ära kulutada. Ja samas ei tea, kas puruneb töö käigus Git, mida on vaja remontima hakata või laguneb Rider ära vms. Määramatust on päris palju, millest siis omakorda tekib hirm ja ärevus.

21. Oct 2020 |

Python OOP – objektorienteeritud programmeerimine

Kuna ma ise sellega olin aasta tagasi üsna hädas, sest pea lihtsalt ei võtnud seda abstraktsiooni nii lennult, siis laia pintsliga kirjutasin siia (võimete piires) natuke selgitustega töötavat objektorienteeritud Pythoni koodi:

github.com/robineero/my-python-jam/tree/master/oop-jam

Mõni objekt, mõni meetod ja natuke funktsionaalsust. Ehk on kellelegi veel abiks, kes aru ei saa, kuidas objektid töötavad. See võib sisaldada vigu igal pool aga noh, see ongi jam.