woensdag 23 november 2022

Text to Speech in de webbrowser

let dutchVoice;

function talk() {
    var msg = new SpeechSynthesisUtterance();
    msg.text = "Een tekst laten uitspreken door de webbrowser, lijkt veel vriendelijker.";
    msg.lang = "nl-NL";
    msg.voice = dutchVoice;
    window.speechSynthesis.speak(msg);
}

function checkDutchVoices() {
  if (dutchVoice) {
     return;
  }

    const voices = window.speechSynthesis.getVoices();
    let ned = [];
        for (let voice of voices) {
      if (voice.lang === 'nl-NL') {
          ned.push(voice);
      }
        //console.log(voice);
    }
    if (ned.length > 0) {
        dutchVoice = ned[ned.length-1];
      talk();
    }
}

window.speechSynthesis.onvoiceschanged = checkDutchVoices;

Demo in JSFiddle. Voer uit met Microsoft Edge.

 

dinsdag 22 november 2022

CSS containers!

Heel mooi dat je nu een max-size kunt zetten op een "container".

Zie deze youtube.

vrijdag 11 november 2022

Windows 11: Unblock multiple files

On Windows 11, I unpacked a zipfile and alle the file were "blocked". Visual studio could not handle some of them.

Solution: go to a parent node. Shift-rightclick on folder and "Open Powershell Window here".

Then: dir -Recurse | Unblock-File

donderdag 13 oktober 2022

Multirow bij mat-table

Het is standaard niet mogelijk om meerdere TR elementen in een mat-table te definieeren. Dat kan wel als je het attribuut multiTemplateDataRows definieert op het mat-table.

vrijdag 12 augustus 2022

C/C++ header-only libraries

 Libraries die alleen een header nodig hebben zijn altijd makkelijk te gebruiken, daarom populair in C/C++.

https://github.com/slembcke/awesome-hpp

De ontwikkelaar die de lijst samenstelde heeft ook een 2D rigid body library gemaakt. https://github.com/slembcke/Chipmunk2D

zaterdag 25 juni 2022

Undeprecated: OleDb

Vandaag kwam ik erachter dat Microsoft een undeprecate gedaan heeft na 6 jaar. In 2011 besloot Microsoft om OleDb uit te faseren en dus deprecated te maken. Toendertijd vond ik dat vervelend omdat ik OleDb gebruikte om informatie over tabellen en kolommen op te halen. Dat heb ik toen omgeschreven naar de native SQLServer driver.

Nu blijkt dat Microsoft in 2018 weer een release gedaan heeft van OleDb en ook regelmatig daarna een update heeft uitgebracht. De uitfasering van OleDb was een vergissing volgens hen. Grappig.

vrijdag 17 juni 2022

Event Viewer Windows Logs Application receives old APPCRASH messages

Problem

Are there a lot of APPCRASH messages in the Windows Logs / Application section of the Event Viewer?

And the same messages keep coming back and reappearing? Then you have error messages that are "stuck" in de windows log system.

Solution

It is not enough to just "clear" the messages in the Event Viewer application itself. You must run Disk Cleanup.

In Disk Cleanup, there is a option "Clean up system files", choose that. After that you will see the entry "System created Windows Error Reporting" (and also select System error memory dump files). That will clean up the log messages that are stuck in de Windows Event Viewer. Now the old messages will not reappear again.

vrijdag 18 maart 2022

Angular: local fonts

 > npm install --save roboto-fontface material-icons

> put the below stuff into src/styles.scss

// for npm roboto-fontface package (to load local files)
$roboto-font-path: "~roboto-fontface/fonts" !default;
@import "~roboto-fontface/css/roboto/sass/roboto-fontface";

// for npm material-icons package (to load local files)
$material-icons-font-path: '~material-icons/iconfont/';
@import '~material-icons/iconfont/material-icons.scss';

 

dinsdag 22 februari 2022

ARP

Quizvraag: Hoe heet het protocol dat uitzoekt welk MAC-adres bij een IP-adres hoort?
ARP: Address Resolution Protocol.

The DNS name is the job title - the Duty Manager
The IP address is where to find the Duty Manager - Office 2B
The Mac address is the guy who is currently Duty Manager - Joe Soap.

Een ARP antwoord wordt normaal gesproken 300 seconden in cache gehouden. Ook switches en routers hebben vaak een ARP cache. Daarom sturen switches en routers ook geen packages naar alle netwerkkaarten. Alleen hubs sturen alle aangesloten netwerkkaarten alle packages door. Daarom kun je niet sniffen op een netwerk dat opgebouwd is uit switches.

MACAddress = Media Access Control Address.
IP Address = Internet Protocol Address.

Media Access Control bepaalt de manier waarop gegevens over de lijn worden verstuurd. Standaard Ethernet maakt gebruik van CSMA/CD. Carrier Sense Multiple Access / Collision Detection.

zondag 23 januari 2022

Node updaten

Voor de gebruikers van node package manager: https://github.com/coreybutler/nvm-windows/releases

Update Nvm naar 1.1.10
Nodejs naar 18.13.0 -> nvm install 18.13.0
(doe eventueel een nvm list available   om te kijken welke versies er zijn)

En vervolgens de angular cli updaten: ->  npm install -g @angular/cli@14

Lokaal updaten: ng update @angular/cli