Posts

Confusing caching at web hosting provider

Image
 I kept on adding debugging code to a webpage, but nothing showed up. I thought maybe the browser was not working. But it was my hosting provider caching the little JavaScript file. When I clicked the 'Clear cache' button, everything worked. Chrome's Lighthouse does complain about the response times from my cheap hosting plan with Hostinger. So caching is probably a good idea. This problem always seems to happen to small CSS and JavaScript files.

Programming helps me with anxiety and grief

Image
 I find programming stops me ruminating about my problems.  Also programming, with breaks listening to music, helped me cope with grief. I find popular classical music calming. I listen to the ClassicFM radio station.

Problem adding large source to 'github'

Image
 I had trouble putting the latest changes to my game into 'github.com' using the web form My game is a 16 megabyte web page. It worked when I went to 'github.com' immediately after starting Windows. I recently noticed that I can add a new version of my game without going into the web form. But I cannot view it. I go to the web form by pressing '.'

Changing 'indexed' PNG's to 'rgb'

Image
 I change PNG images generated from Gnuplot from 'indexed' to 'rgb' to hopefully make it easier for browsers to scale the images.  I use the 'Mode' option on the 'Image' menu of my old copy of GIMP.  Gnuplot probably generates 'indexed' PNG's because they are smaller. They have a list of the colors used.

Missing font for Gnuplot

Image
 Gnuplot gave an error about being unable to open the 'arial' font, causing Gnuplot to use a 'blocky' internal non-scaleable font. I used 'strace' to find where it was looking for fonts. I saw there was a 'UTRG____.pfa' file in an X Windows directory. I now add 'font "UTRG____,12"' after the 'set terminal', 'title' or 'label' commands. I get the 'Utopia' font at a 12 point size.

Big text on charts and graphs on webpage

Image
 I now make the text on charts and graphs really big. This is because mobiles shrink the charts because the mobiles have 2 or 3 times pixel density. Their browsers choose a large size of a chart and scale it back. Also mobile browsers may be set to a 'desktop view' which again shrinks down a large size chart. The idea of a 'desktop view' is stop the browser showing a 'cut-down' view of a website coded for mobiles. I check for 'desktop view' with:     'window.innerWidth > screen.availWidth' The text includes chart titles, axis titles, numbers on tics and legends. I am trying using JavaScript to set the 'src' of images to force the browser to choose more readable smaller-sized charts. But this makes the browser load all the charts when the page loads - no more easy 'lazy loading'. Also there needs to be a bit of code to handle resizing the page.

Saving screenshots into a file on Windows 11

Image
 I use the 'jspaint.app' website to get screenshots into a file. There is no Windows Paint program on Windows 11. I have to choose 'edit | paste' to enter the screenshot. Just pressing 'Ctrl V' gives an error. I have to remove a light grey border that 'jspaint' adds. Some other online paint program have limits on how many images you can save. I take a screenshot by pressing the 'Ctrl' and 'PrintScreen' keys together on Windows.