Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath ‘./format/index.js’ is not defined by “exports” in …

The date-fns and date-fns-tz Node.js packages are being updated, and version 3 has some bugs. When you try to use them in TypeScript you get the error message

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './format/index.js' is not defined by "exports" in ...

Currently, the only solution is the restrict the version to 2.

In package.json add the lines

{
 "name": "MY_PROJECT_NAME",
  ...
  "overrides": {
    "date-fns": "^2.0.0"
  }
}

In the terminal run

npm install

Check the effect of the new settings in the terminal with

npm ls date-fns

The output should be something like

js-application@1.0.0 /Users/…
└─┬ date-fns-tz@2.0.0
└── date-fns@2.30.0 overridden

Kerbal Space Program 2 For Science! notes

KSP 2 version 0.2.0.0, “For Science!” opens an entirely new type of game play. Now we can complete missions, do science experiments, collect Science Points and unlock new parts in the Research and Development Center.

Recommended mods

The Science Arkive mod lists all available experiments by celestial body, so check it before you launch. It is available in the VAB and Map View.

The Orbital Survey mod displays information on the planet and moon scanning process.

Environment Survey

There are three kind of experiments in the game that award you science points:

  • Crew observations
  • Surface Survey
  • Environment Survey

The first two are performed by the crew by writing down their experiences and taking surface samples. The third experiment requires a Science Collector. Make sure all of your command modules and landers contain one, to be able to survey the orbit and surface of Kerbin and other celestial bodies after landing.

Scanning celestial bodies

There are two scanning modes: Visual and Region scan. The scanning mode depends on the antenna.

Hardware

The RA-15 Static Antenna performs visual scan

The Communotron DTS-M1 deployable antenna performs region scan.

Orbit inclination

To scan a celestial body, we need to place the space craft in a 90° inclination orbit. This way the planet or moon rotates under the space craft while orbiting it in the same plane.

To place a craft in a 90° inclination orbit around Kerbin, launch the vessel in the North or South direction. As the rotation’s angular velocity is zero, you need significantly more delta V (fuel) to reach the same orbital altitude.

Orbital altitude

The field of view of the antenna is 3°. The diameter of the planet or moon determines the ideal scanning altitude.

When the antenna is not extended, the displayed minimal, optimal and maximum scanning altitude values are not correct. To view the correct values:

  • Place the craft in an orbit around the celestial body,
  • Right-click the Communotron DTS-M1 antenna to open the Parts Manager,
  • Extend the antenna,
  • Read the minimum, ideal and maximum scanning altitudes.

    The scanning altitudes depend on the diameter of the celestial body. For simplicity, the bodies are grouped into three categories: small (max 150 km radius), medium (max 350 km radius), large (max 10,000 km radius)
BodyVisual Scan
Minimum
Visual Scan
Ideal
Visual Scan
Maximum
Region Scan
Minimum
Region Scan
Ideal
Region Scan
Maximum
Kerbin
(large)
500 km800 km1,100 km1,000 km1,500 km2,000 km
Mun
(medium)
100 km300 km500 km300 km500 km700 km
Minmus
(small)
Duna
(medium)
100 km300 km500 km300 km500 km700 km

Scanning progress

To see the progress of the scanning, open the Orbital Survey mod

Select the body

The dropdown lists the bodies which has scanning data

Vessels

The VES button displays the scanning vessel names around the body.

Overlay

The OVL button displays the scanned regions on the body surface.

Collecting Science Points

When 25%, 50%, 75% and 100% of the body has been scanned, science points are awarded. The full orbital region scan of a celestial body awards 180 Science Points.

  • Check the progress on the Orbital Survey display.
  • When the next threshold is reached, open the Research Inventory and transmit the results. To make sure all data is transmitted, you can click the Transmit All button instead.
  • To speed up the orbital scanning, set the time warp to 100% and have dinner. By the time you are done, the planet most likely has been scanned.
  • Click the TRANSMIT ALL button to send the data to Mission Control and collect the Science Points.

Sample Grabber

The RSCM-01 Sample Grabber has to be mounted with the drill facing up. Mounting it on the top surface will place it in the correct direction.

To save space, we can move the grabber arm inside the rover body, it is not that elegant, but still works:

Troubleshooting

If the RSCM-01 Sample Grabber is mounted on the side of the rover, we get a misleading error message when we try to run a survey:

Surface Survey Status:

Invalid Research Location

Revert to VAB takes away the progress during that flight

When you revert to VAB, the progress achieved during that flight disappears:

  • You lose the science points collected during the flight,
  • You lose the already unlocked parts during the mission.

ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: ‘…/certifi

During the building of a Docker container for a Python application we may get the following error message

ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: ‘/private/var/folders/sy/f16zz6x50xz3113nwtb9bvq00000gp/T/abs_477u68wvzm/croot/certifi_1671487773341/work/certifi

This is caused by an out of date path in the requirements file for “certifi”. To fix the issue

  • Uninstall and reinstall certifi
pip uninstall certifi
pip install certifi
  • Regenerate the requirements.txt file
pip freeze > requirements.txt

Scanning with Canon Maxify GX4020 all-in-one inkjet printer

To scan with the Canon Maxify GX4020 all-in-one inkjet printer

Install the IJ Scan Utility

  • In your browser navigate to MAXIFY GX4020 Software & Drivers
  • Select the operating system name and version
  • Download the Print Driver and Scan Utility Installer
  • Double-click the downloaded file to install the Scanner Utility
    • Select the printer and click the Next button

Scanning with the IJ Scan Utility

Start the IJ Scan Utility

The IJ Scan Utility is located in the Canon Utilities folder of the Start Menu

To use the preview function

  • Click the ScanGear button
  • On the Basic Mode tab click the Preview button
  • If you want to configure more settings, use the Advanced Mode tab

Troubleshooting

You are trying to scan an image exceeding 100 MB. If you want to scan this image, reduce image size or disable the thumbnails view mode.

To turn off the thumbnails mode

  • In the upper left corner of the ScanGear window click the Thumbnail view mode button.

Replacing the printer or changing the network connection

The installer saves the MAC address of the printer, so if you need to replace the already selected printer, or you are changing between Wi-Fi and wired network connection, you need to first uninstall and reinstall the Canon IJ Scan Utility. Even if you run the Scanner Selector application, it does not replace the scanner information in the scanner application. The Wi-Fi and wired network adapters have different MAC addresses.

  • Uninstall the Canon IJ Scan Utility
  • Reinstall the Canon IJ Scanner Utility (see above)

Debugging with Visual Studio Code

Visual Studio Code is the preferred text editor for most developers on Mac and Windows workstations.

To debug code in Visual Studio Code

Create the Debug Configuration

  • Open a folder using File -> Open Folder…. The configuration will be tied to his folder, to use it again we need to open the same folder.
  • On the left side select the Debug button and click the down arrow next to the RUN AND DEBUG drop down
  • Select the Add Configuration option
  • Add a configuration to the launch.json file

For Node.js React Remix web site

    "configurations": [
        {
            "name": "Run MY_WEB_APP with npm run dev",
            "command": "npm run dev",
            "request": "launch",
            "type": "node-terminal",
            "cwd": "/THE_WEB_APP_DIRECTORY_PATH"
        },
        ...
    ]

Start debugging

To run a configured application in debug mode

  • Open the same folder you used to create the Debug Configuration
  • On the Debug tab click the down arrow next to the RUN AND DEBUG drop down
  • Select the Debug Configuration
  • Click the Start Debugging arrow

Stop debugging

To stop the debugging process

  • On the Terminal tab hover above the running Debug Configuration item and click the trash can icon

Tram lines in Cities: Skylines II

Cities: Skylines II (also known as Cities: Skylines 2) makes tram line creation much easier.

To add a new stop to an existing tram line

  • Place a new stop
  • Select the Tram Line Tool and drag the existing tram line to the stop
  • The bent line shows, the tram will stop there

To move a tram stop to the correct side of the road

If the tram stop is not at the desired side of the road

  • Delete the tram stop with the bulldozer
  • Create a tram stop at the correct location
  • Select the Tram Line Tool and drag the existing tram line to the stop
  • The bent line shows, the tram will stop there

To delete a tram stop

To delete an existing tram stop

  • Select the bulldozer and click the stop

How to return multiple values from a TypeScript function

TypeScript (and JavaScript) functions can only return one value, but that value can be an object. To return multiple values from a function, we can return those in an object.

There are two ways of returning an object from a TypeScript function:

Create an object in the function, set the property values and return it

Create an array inline in the return statement. (An array is an object.)

In this example the first element is a string, the second is a number.

function myFunction(): [string, number] {
    return ['Monday', 1];
}

let [a, b] = myFunction();

Async functions

Async functions return promises, so we need to add it to the return type declaration.

async function myFunction(): Promise<[string, number]> {
    return ['Monday', 1];
}

let [a, b] = await myFunction();

Use curly braces

We can use curly braces to enclose the return values, but don’t forget to surround the entire expression with parentheses.

function myFunction(): [string, number] {
    return {'Monday', 1};
}

let ( {a, b} = myFunction() );

Async functions

When an async function returns multiple values in curly braces, we don’t need the parentheses around the entire call expression.

async function myFunction(): [string, number] {
    return {'Monday', 1};
}

let {a, b} = await myFunction();

Create an open pit stone and coal mine in Cities: Skylines II

In Cities: Skylines II (also known as Cities: Skylines 2) we can build a deep open pit stone and coal mine.

Terraforming

  • Place a mine in the selected area
  • Extend the mine area to the circular border
  • Build a temporary road around it to mark the maximum mine area
  • Bulldoze the mine
  • Terraform a pit in the middle for the mine building
  • Terraform a spiral path to the bottom of the mine four times wider than the gravel road

Road construction

  • Place a mine at the bottom of the pit. Click the right-mouse button to rotate the building.
  • Place a straight gravel road segment at the front of the mine.
  • Build a gravel road from the mine to the surface road on the spiral surface.


Mine area creation

  • Stretch the mine area between the road segments.
  • Continue the area definition up to the surface.