TypeError: (0 , _styledEngine.internal_processStyles) is not a function

Node.js packages are constantly updated, and the developers usually test those against the latest versions of other packages. When our application uses older packages, a single package update can cause errors and the application will stop with an error, like

TypeError: (0 , _styledEngine.internal_processStyles) is not a function

Usually a global update of all Node.js packages can bring those to the latest allowed version and solve the incompatibility error.

  • Open a terminal in the application root directory
  • Execute
    npm update

Electric Car Owner’s Thoughts

Electric cars are awesome. We still have an older gasoline car for road trips, the EV is for a long daily commute to save money on gasoline, and maintenance. To protect the environment, we have selected 100% renewable energy source at our local electric company, and the plan which is available for EV owners (and electric heat pump air conditioner users) to purchase electricity at discounted rate outside of prime usage hours.

Range

As it is better for the battery to operate it between 10% and 80%, the everyday usable range of an electric car is around 70% of the advertised one. With a 290 mile advertised range car, you can reasonably expect a 200 mile range, which will bring down the battery to 10% without any safety margin.

If you charge the car to 100% before a long trip, the maximum range is still around 260 miles, as you don’t want to deplete the battery below 10%. This calculation does not even account for any extra miles in case the planned charging station is occupied or does not work. For peace of mind, even with 100% charge, I would plan to charge the car every 200 miles to make sure no tow truck is necessary to continue the trip. If the battery is dead, you need to have the car towed to the nearest charging station, as currently, there are no mobile charging trucks on the road.

You also need to know, that fast charging considerably slows down above 80% battery charge level to protect the battery from overheating, so on the road, do not expect to have enough time to charge above 80%. This will only give you a maximum 200 mile, and a 140-160 mile safe range for your second leg of the day. So electric cars are great for commute, and driving around town, but not yet practical for longer trips.

Charging

Home charger

Plan in advance

When we had to wait three weeks for the charger installation, we had to find a way to charge the car. As there are no Level 2 public chargers in walking distance, we need to use the EVgo fast chargers during this period. The daytime fast charging cost is $0.66/kWh, plus a $0.99 transaction fee which is comparable to $6.00/gallon gasoline price. At the time of writing, in our area we can buy gasoline at around $4.05/gallon, so this can only be temporary. At home we can expect $0.26/kWh during night time charging, which will be comparable to $2.40/gallon gasoline.

If you are really sure you want to buy an electric car, it is a good idea to at least have the electrical connection installed, so you only need to install the charger when you buy the car. We have received a free Level 2 changer in the mail two weeks after the car purchase from the car manufacturer.

As the Level 2 changers only need 240V, it is enough to install only two hot and one ground lines and a three prong 6-50 50A outlet. There is no real need for the neutral line and the 14-50 four prong outlet.

CHECK THE REQUIREMENTS OF THE CHARGER, THE PLUG TYPE, AND CONSULT WITH AN HONEST ELECTRICIAN TO CONFIRM THIS.
Many electricians charge for the fourth (neutral) wire installation, and never connect it to anything.

If the charger is not hot wired, and comes with an already installed plug, it only takes a few minutes to mount it on the wall under the already installed 240V 50A outlet, anyone with a power drill can do that. Make sure the outlet is compatible with the plug of the charger. In the worst case, an electrician can replace the plug at the end of the charger’s power cable if a new changer comes with a different plug.

Installation cost

As the electric panel of our building is at the opposite end, it will cost us $3,200 to bring the electricity to our parking spot from 130 feet away, and install the charger. For very short distances, the installation cost is around $250 – $500. When you buy the car, calculate with the charger installation cost. Preferably get an estimate from a few electricians to see if it is even possible to install the home changer, and how much it will cost.

Charging schedule

Most likely your can is smart enough to wait for the best time to start charging. In our area between 9:00 pm and 4:00 pm the next day is the least expensive to use electricity at $0.26/kWh. I have programmed my car to start charging during these hours to save as much as possible.

Charging at public Level 2 changers

Some businesses, like Wholefoods, have free Level 2 charging spots around the store. You can get approximately 30 miles of charge in an hour, if you are one of the lucky ones to find an available charger. This is obviously not sufficient on longer road trips, but helps to put some free electric charge into your battery while shopping for groceries.

Charging on the go

For longer road trips check the location and the number of working fast chargers along your route.

Things to consider
Available changers

Expect occupied and broken chargers.

If the app you use, shows a few available chargers at a location, it can be occupied in the next minute, just before you arrive there, or it is not working, that is why it is always available. When you encounter a broken charger, please call the customer service number posted on the charger and report it, as most people think someone else already did that. You will be surprised how many times you are the first one to report a non-working charger.

Charging times

Real charging times can be more than twice as long as advertised.

Our car is capable of 150kW fast charging between 10-80%. Even on 350kW EVgo CCS fast chargers at 65-70ºF (18-21ºC) comfortable air temperature, it only charges at the maximum of 60-70kW rate. We have not yet tried to charge above 80%, that will be even slower to protect the battery. As you can expect more than twice the charging time of the advertised one, it may adds considerable time to your trip.

Driving

One pedal driving

To fully take advantage of the regenerative breaking, enable one pedal driving. When you lift your foot off the accelerator, the car starts to slow down, many cars even stop, while recharging the battery. On a steep enough downhill road you can recover most of the extra energy you used to climb up. We usually regain 4-5 miles on a longer downhill slope. In city traffic you don’t have to worry about stop and go traffic anymore, you regain most of the extra energy spent during acceleration. Of course nothing has 100% efficiency, so you never gain all spent energy back.

Watch your speed

Stay within the speed limits.

At highway speeds most of the energy is spent on countering wind resistance. As we remember from our physics studies, there is an exponential relation between speed and wind resistance. When you double the speed, the wind resistance and energy usage quadruples. If you feel you are scraping the bottom of the battery to get home, it is not the time for speeding, stay within the speed limits.

HOV lane access

In our state, zero emission car owners can request a decal from the DMV once the permanent license plate arrives. It allows the car to use the high occupancy vehicle, HOV lanes (carpool lanes) even with one person in it. During rush hours this can save considerable time.

Free parking

Some cities allow zero emission vehicles with the HOV decal attached, to park for free at parking meters.

Convenience

As mornings can be chilly or hot, our car can automatically start the climate system based on a schedule. We programmed it to heat or cool the car to 72ºF (22ºC) every weekday a few minutes before the driver leaves the house.

The Apply button is disabled in CKAN

If you use CKAN, the Comprehensive Kerbal Archive Network to manage your Kerbal Space Program 2 (KSP2) mods, you may select the new version of a mod,

but the Apply button stays disabled.

This happens, when the “max game version” of the mod is lower, than the version of the installed game.

As the development of Kerbal Space Program 2 has been cancelled no new game versions are released, and also many mod developers stopped updating their mods.

If we have not installed the latest versions of all mods while the game development was still in its active phase, on version 0.2.1, CKAN prevents further installation, as the game version has been upgraded to 0.2.2, but some mods only show compatibility with game version 0.2.1.

The only way to install the latest versions of mods where the max game version is lower than the installed game version is to

  1. Change the Compatible game versions settings in CKAN
  2. Install the latest versions of all mods

To change the compatible game versions in CKAN

  • Start CKAN
  • In the Settings menu select Compatible game versions
  • Set the Additionally install mods compatible with following game versions to 0.2

    This will allow the installation of mods with max game version of 0.2.0 – 0.2.2

macOS Login Items

To access the list of applications that automatically start at login

  • Open Settings
  • Enter login into the search box and select Login items

The following table contains the owner of some of the items found in the Allow in background list.

ItemUsed byRequired?
Adobe Acrobat Reader DCAdobe Acrobat Readeroff
Chef Software, Inc.Chefoff
Corsair Memory, IncElgado Stream Deck driverEnable it to be able to autodetect the Elgado Stream Deck insertion
CVP365off
CyberArk EPMon
DisplayLink ManagerDisplayLink docking station driveron
DockerDocker Desktop applicationoff
Docker IncDocker Desktop applicationoff
EnterpriseDB CorporationPostgreSQL serverRequired to be able to access the local server
Google LLCoff
Google Updateroff
GoToMeetingoff
HP Inc.off
Microsoft AutoUpdateoff
Microsoft Office LicensingMicrosoft OfficeMost likely needed to check the license
Microsoft OneDriveOneDriveon
Microsoft Teamsoff
OnedriveOnedriveon
Palo Alto NetworksRequired to be able to use GlobalProtect
RectangleRectangle window managerRequired to be able to use hotkeys to arrange windows
Rogue Amoeba Software, IncAudio softwares for macOSwas on, turned off to see what uses it
SnagitSnagitRequired to be able to use hotkeys to capture the screen
Supportoff
Tenable, IncNessus agentoff
Zachary EliaZachary Elia’s applications.
bclm: macOS command-line utility to limit max battery charge
Required to be able to monitor the battery charge percentage.
ZoomZoomon

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed – JavaScript heap out of memory

When executing Node.js code on the workstation, the process can stop with the PAUSED BEFORE OUT OF MEMORY EXCEPTION.

When we stop the execution, the following message appears in the terminal:

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed – JavaScript heap out of memory

This can happen for two reasons:

  1. There is a memory leak in the application which fills up the memory and the Garbage Collector is not able to clear it. It can be caused by an infinite loop, when we eventually call the same function from itself, or repeatedly appending data to an array without ever clearing it. Please see Debugging Memory Leaks in Node.js Applications by Vlad Miller for an excellent article on the topic.
  2. Our application is too large to fit in the default JavaScript heap, the memory where the application code and data is stored in the memory.

Altough Node.js 12 and later versions use more efficient memory management, if our application is too big to fit in the default heap size, we may need to allocate larger heap memory size.

To set the JavaScript heap memory size, we need to specify the amount in an environment variable. The value is in MB, so use the following table for the most common values. The value does not have to be the product of 1024, these are just examples.

Requested memoryValue
5 GB5120
6 GB6144
7 GB7168
8 GB8192

There are multiple ways to set this depending on the operating system we use:

macOS and Linux

To get the current JavaScript heap size execute the command in the terminal

node -e 'console.log(v8.getHeapStatistics().heap_size_limit/(1024*1024))'

On Macintosh and Linux operating systems the most convenient way to specify the heap size is in the ~/.bashrc file, which is executed every time a Bash terminal window is opened. Add the following line to the file to set the value to 8 GB and restart the terminal for the change to take effect:

export NODE_OPTIONS="--max-old-space-size=8192"

Windows

On Windows set the the NODE_OPTIONS value to --max-old-space-size=8192 (or to the preferred size).

To set system level environment variable values

  • Open the Settings panel
  • Type “environment variables” into the search field
  • On the Advanced tab click the Environment Variables button
  • On the Environment Variables panel under System variable click the New button
  • Set the variable name to NODE_OPTIONS, and the value to
    --max-old-space-size=8192 (it starts with two dashes)
  • Click the OK button to save the value and restart all terminals for the change to take effect.

SnowRunner tips and tricks

Force game save

When you are at a point in the game you want to save, exit to the Main Menu. This saves the current state of the game, and when you force quit the game in case of an accident (see Accident below), the game will start at least from that location.

Accident

When an accident happens and you know the truck cannot recover, like flipping on its side, quickly press Alt-F4 to immediately exit the game. When you restart the game, you can continue from the last automatic save point.

Time of day

It is very challenging to drive hard terrain in the dark. To set the time of day

  • Open the map view with the “M” key on the keyboard,
  • Press the “T” key on the keyboard to cycle through 0:00, 6:00, 13:00, 20:30.

Selecting the truck

This table contains my findings on the most appropriate truck for the job. As you progress in the game more upgrade options become available, so make sure to try the customization time to time. Mount mud tires when those become available.

TruckPurposeComments
Azov 64131Everything
Tayga 6436Long logs
ANK MK38 CivilianLow saddle
High saddle
Towing trailers
Use the mud tires

Trailer delivery in tasks and contracts

When a trailer is requested, usually only a specific trailer satisfies the requirements. It can be on a different map, so in that case you have to tow it across the tunnels.

Find the trailer

The correct trailer is marked with the magnifier icon.

  • On the Global Map navigate to the map which has the trailer. If not stated, check all unlocked maps to find it.
  • On the Objects tab in the Trucks and Trailers section the trailer is marked with a magnifier icon.
  • Select it to show it on the map (ouch!)


You need to have the trailer attached or winched to the truck with both the truck and trailer inside the zone for it to count.

Maintenance Trailer

A Maintenance Trailer cannot be empty to be accepted, it needs to have at least 201 liters fuel in it.

Truck customization in Snowrunner

Eventually there will be many options when you customize your trucks in the garage. These are some recommendations.

Winch

When you get stuck in the mud, the length of the rope is usually more important than the power of the winch motor. Pick the longest rope possible to be able to reach more trees and power poles.

The Extended and Advanced winches have the longest rope. Pick the Advanced if it is available, as it has a stronger motor.

Upgrade the PostgreSQL database cluster

Newer PostgreSQL versions introduce useful functionalities, so it is a great idea to keep our database engines up-to date. In addition if the version of the database engine stays very old, in the future it can be difficult to “catch up” and upgrade the data to the new version.

This is the official documentation of the pg_upgrade process: https://www.postgresql.org/docs/current/pgupgrade.html

To upgrade the PostgreSQL database engine version

Check the version of the PostgreSQL server

  • In pgAdmin4 open a Query Tool window
  • Execute:
    SELECT version();

Create a backup of the old server

  • Open pgAdmin4 and right-click the local database server
  • Click the folder icon to select the backup file location
  • Select the postgres role, and click the Backup button
  • The confirmation appears in the lower right corner
  • Wait until the process completes

Get the PostgreSQL data directory

To get the name of the current PostgreSQL data directory

On macOS

On macOS the location of the server installation is /Library/PostgreSQL/MY_SERVER_VERSION/
The binary (executable) files are in the “bin” directory, the data files are in the “data” directory

Remove deprecated libraries

Some old versions of the PostgreSQL server contain deprecated libraries. As those are not part of the new installation anymore, pg_upgrade will stop with an error message.

Upgrading from version 15

Version 15 of the PostgreSQL server contained the adminpack library which is not part of later versions. Before we shut down the old server we will need to remove the library:

  • In pgAdmin4 right-click the postgres database and select Query Tool
  • Execute the following command
    DROP EXTENSION adminpack CASCADE;

Stop the old PostgreSQL server

  • Find the the PostgreSQL command line utility
    locate pg_ctl
  • If the message appears “WARNING: The locate database (/var/db/locate.database) does not exist.”, execute the following command:
    sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
    • There is no indication when the “locate” database build completes, so try to execute the “locate” command after a few minutes to see if the database is available.
  • Switch to the root directory to avoid directory access issues, and execute the found pg_ctl command to shut down the PostgreSQL server.
    The -D option specifies the location of the data directory:
cd /

sudo -u postgres /Library/PostgreSQL/15/bin/pg_ctl -D /Library/PostgreSQL/15/data stop
  • After a few seconds the server stops

Install the new version of the server

  • Download the latest version of the PostgreSQL installer from https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
  • Start the installer,
  • Follow the prompts
  • IMPORTANT, use the recommended, version specific installation directory names

  • Create a password for the database superuser called “postgres”
    • If the old version of the PostgresSQL server is running, a new port number will be recommended
    • If no PostgreSQL instance is running, the standard 5432 port number is populated:
  • Keep the Default locale setting
  • The summary page shows the location of the components
  • Click Next to start the installation
  • If you don’t want to install other components, uncheck the Stack Builder launch.

Configure the environment

As the upgrade process will connect to the old and new instance multiple times, save the access credentials in the PostgreSQL password file in the user’s root directory at ~/.pgpass

Create the password file

Official documentation is at https://www.postgresql.org/docs/current/libpq-pgpass.html

  • Open or create the password file from the command line with
    code ~/.pgpass
  • Specify the database admin credentials in the file:
# EXAMPLE: hostname:port:database:username:password
localhost:*:*:postgres:MY_ADMIN_PASSWORD 
  • Set the file access permissions to disallow access by world, otherwise the file will be ignored by the process:
    chmod 0600 ~/.pgpass

If the error message during upgrade is

connection to server on socket “/private/tmp/.s.PGSQL.50432” failed: fe_sendauth: no password supplied
could not connect to source postmaster started with the command:

Enable connection to local servers without a password. Update the config files for the old and new version to trust the local connection.

  • Edit the old server’s config file
    vi /Library/PostgreSQL/15/data/pg_hba.conf
  • In the line of the local connection change the method from “scram-sha-256” to “trust”
local   all             all                                     trust
  • Edit the new server’s config file
    vi /Library/PostgreSQL/17/data/pg_hba.conf
  • In the line of the local connection change the method from “scram-sha-256” to “trust”
local   all             all                                     trust

Stop both PostgreSQL servers

Even though we have stopped the old server, the installation of the new version started the new.

  • Stop the new server with
    sudo -u postgres /Library/PostgreSQL/17/bin/pg_ctl -D /Library/PostgreSQL/17/data stop

Start the upgrade

pg_upgrade needs write access to the current directory, so let’s create a working directory for the process, othrewise we get the error message:

You must have read and write access in the current directory.

Also, as we will run the pg_upgrade comamnd as the user “postgres” we need to start the process in a directory it has access to, otherwise we get the error message:

could not determine current directory

To satisfy both requirements, we need to be in a directory where the postgres user can be and have write access. We will use the temp directory:

cd /tmp
  • To upgrade the PosgreSQL server from version 15 to 17 execute the command as the postgres user:
sudo -su postgres
  • When asked, enter your macOS password to allow the user switching:
  • Switch to the /tmp directory and start the upgrade process
cd /tmp

/Library/PostgreSQL/17/bin/pg_upgrade --old-datadir /Library/PostgreSQL/15/data --new-datadir /Library/PostgreSQL/17/data --old-bindir /Library/PostgreSQL/15/bin --new-bindir /Library/PostgreSQL/17/bin

After successful upgrade

Start the new server

Open the terminal and execute the command below. Use the new server’s version number in the command

sudo -u postgres /Library/PostgreSQL/17/bin/pg_ctl -D /Library/PostgreSQL/17/data start

Check the version of the new PostgreSQL server

  • In pgAdmin4 open a Query Tool window
  • Execute:
    SELECT version();

Rebuild the optimizer statistics

As the optimizer statistics were not transferred to the new server environment, after starting the new server execte the command from the terminal

sudo -su postgres /Library/PostgreSQL/17/bin/vacuumdb --all --analyze-in-stages

To delete the old cluster

Once you have validated the new cluster, you can delete the data files of the old cluster. In the /tmp directory, where we have executed the pg_upgrade comand, the process created a customized script. Execute from the command line

cd /tmp

./delete_old_cluster.sh

Troubleshooting

If the old version of the PostgreSQL server used extra libraries, we need to install those for the new version too:

Checking for presence of required libraries fatal

Your installation references loadable libraries that are missing from the
new installation. You can add these libraries to the new installation,
or remove the functions using them from the old installation. A list of
problem libraries is in the file:
/Library/PostgreSQL/17/data/pg_upgrade_output.d/20241002T161901.823/loadable_libraries.txt

Open the text file and install the referenced libraries. In my case the message was:

could not load library “$libdir/adminpack”: ERROR: could not access file “$libdir/adminpack”: No such file or directory
In database: postgres

If the missing library is the adminpack, see Remove deprecated libraries above.

To install the missing libraries

  • Start the Application Stack Builder utility from the Launchpad
  • Select the new PostgreSQL server version
  • Select the missing library

How to disable image switching by the mouse scroll wheel in IrfanView

IrfanView is a great, free image editing program. One feature can destroy all your work if you keep it enabled.

When you rotate the scroll wheel of your mouse and the vertical scroll bar is not visible, the application loads the next image file from the directory. With this, you lose all changes you made to the image.

To disable image switching by the scroll wheel:

  • In the Options menu select Properties/Settings…
  • On the Properties/Settings page under Load next/previous file on Mouse wheel scroll select Never,
  • Click the Save button.