Tunnels and canals are buried in the Cities: Skylines editor

Cities: Skylines only fully renders the unlocked tiles. Locked (not yet purchased) tiles and all tiles in the editor are not fully rendered to save processor power. When you create a tunnel entrance or a canal, it is buried under earth.

Subscribe to the “Common Ground” mod to fully render any number of tiles you specify. The Options page of the mode allows you to select what to render in the game and in the Editor. If you use the 81 Tiles mod in the game, you can disable the Common Ground mod, but you still need it in the editor, as we need to disable the 81 Tiles mod while using the Editor.

Cronometer cannot connect to Strava

Cronometer is an app to record food you eat and get a report on the consumed calories and nutrients. It can automatically retrieve exercise information from Strava to calculate the burned calories.

For some reason recently we cannot connect to Strava from the Cronometer app. To successfully connect Cronometer to Strava to get exercise information:

  • Log into the Cronometer web site at https://cronometer.com/
  • On the left margin select Settings, Devices
  • On the Strava line click Connect to Strava
  • Enter the Strava user name and password to authorize the connection

Create a Next.js React web site

Next.js is a framework based on React to build a “full stack” dynamic web application with routing and data handling capability. React provides the page components on top of HTML and JavaScript, Next.js routes between pages, and displays and modifies the data in a database.

Configure the development environment

  • Install npm
  • Make sure npx is available on your workstation
    npx comes with npm 5.2 and higher

Create the Next.js web application

Create the web site skeleton

  • Create a parent directory for the project
  • Execute in the terminal
    npx create-next-app@latest
    • To select between the options in iTerm use the left and right arrow key on the keyboard

Start the development server

  • Step into the web application directory
    cd MY_PROJECT_NAME
  • Start the server
    npm run dev
  • Navigate to http://localhost:3000 to view the site

Source control

When we created the Next.js application above, it created a .gitignore file and initialized the Git repository in the root of the web site. If you want to place more folders in the Git repository, like Terraform files to create cloud resources, the Next.js application will not be in the root of the repository anymore. As some of the entries in the .gitignore file refer to the root with the leading slash, Git will not ignore large libraries.

  • Move the .gitignore file from the web application directory to the higher level where you want to initialize the Git repository
  • Delete the .git directory in the web application folder
  • Navigate to the root directory of the Git repository
  • Open the .gitignore file and remove the leading slashes from the following lines, because the Next.js application is not in the root of the repository anymore
    /node_modules
    /.pnp
    /coverage
    /.next/
    /out/
    /build

Environment variables

.env

Next.js now supports the .env file to declare environment variables during development

Environment variables in the browser

If the environment variable name starts with NEXT_PUBLIC_ the variable is available for the JavaScript code in the browser via process.env instruction:

console.log('Version', process.env.NEXT_PUBLIC_VERSION);

Building forms

For more information see https://nextjs.org/docs/guides/building-forms

Create a React web site

The React framework adds components on top of HTML and JavaScript to create dynamic one-page web applications. It does not have routing and data handling capabilities, to create a full stack web application use Next.js or Remix.

Configure the development environment

  • Install npm
  • Make sure npx is available on your workstation
    npx comes with npm 5.2 and higher

Create the React web site skeleton

Create the web site skeleton

View the new React web site

  • Step into the web application directory
    cd MY_WEB_SITE_NAME
  • Start the web application
    npm start
  • If asked, allow iTerm to control Google Chrome
  • Your React application loads in a new browser window at http://localhost:3000/

Test the application

By default the test are related to the changes made since the last Git commit.

  • If running, stop the application by pressing CTRL-C
  • Open the terminal in the application directory
    cd MY_WEB_SITE_NAME
  • Execute the test
    npm test

Deploy the application

Build the application

The application build process creates the minified version of the site in the “build” directory

  • To build a minified bundle of the application execute
    npm run build

Using GitHub Copilot

GitHub Copilot is a ChatGPT based AI pair programmer extension for Visual Studio Code, Visual Studio, JetBrains IDE, and Neovim. It is most effective in Python, JavaScript, TypeScript, Ruby, Go, C# and C++.

Installation

GitHub Copilot has personal and business subscription model. Start your free trial at https://github.com/features/copilot

Ask for suggestions

  • Create a file with the standard file extension of the language to indicate the preferred programming language to the AI.
  • Start to create a function with the name that describes its purpose (in this example we will use the JavaScript syntax)
    function getDaysInMonth(month, year) {
    (If your IDE automatically adds the closing curly brace, remove it, otherwise Copilot does not offer solutions)
    or
  • Create a comment to describe the functionality
    // Express server on port 3000 and return the current date

Select the suggestion

  • Use the Alt-[ and Alt-] on Windows, Option-[ and Otion-] on Mac to cycle through the suggested solutions and press Tab to accept it, or Esc to reject all of them.

See all suggestions in a new tab

  • Press Ctrl-Enter to open a new tab, and a few seconds later all suggestions will be listed in the new tab.
  • Click the Accept Solution link above the suggestion to insert it into your file.

For more information see the documentation

To activate and deactivate the GitHub Copilot

  • In the lower right corner of the editor click the Copilot icon
  • Select the scope to disable GitHub Copilot: for all languages, or for a specific language only.

Kerbal Space Program 2 configuration

Settings file

The game settings file is located at C:\Users\YOUR_USER_NAME\AppData\LocalLow\Intercept Games\Kerbal Space Program 2\Global\Settings.json

Mods

Mods make using KSP 2 a better experience. Modders can create functionality faster than the development team, as they only have to concentrate to their particular area. This also means, a game update can render a mod unusable until the modder also updates the mod.

Recommended mods for Kerbal Space Program 2

To configure the mods, in the Settings menu select Mods, and scroll down to the mod to adjust.

NameDescriptionRecommended settingsHome page
Docking Alignment DisplayAdds a new instrument providing necessary information to dock with precision!https://forum.kerbalspaceprogram.com/topic/218752-v011-for-ksp2-013-docking-alignment-display-dad/
Flight PlanPlan your (Space) Flight! Fly your Plan! Handy tools to help you set up maneuver nodes that will get you where you want to be.
Making spaceflight planning easier for Kerbal Space Program 2 one mission at a time.
https://forum.kerbalspaceprogram.com/index.php?/topic/216393-flight-plan/
K2-D2The Kerbal Space Program astromech
A set of tools to Help Space Navigation.
https://spacedock.info/mod/3325/K2-D2
KerbalHeadlampAdd Kerbal Headlamps so you can see in the dark.https://forum.kerbalspaceprogram.com/topic/222849-kerbalheadlamp-012-for-ksp2-020/
Kontrol System 2Scripting framework for autopilotshttps://forum.kerbalspaceprogram.com/topic/214543-release-kontrolsystem2-042/
Lazy OrbitLazy Orbit is a simple mod that allows you to set a vessel’s orbit, land it on a surface, or teleport it to another vessel via a simple GUI. Open the GUI by clicking the button in the app bar (or press ALT+H), select a body and an altitude, and press Set Orbit. Great for testing and modding, don’t use it for anything nefarious!https://forum.kerbalspaceprogram.com/index.php?/topic/214571-lazy-orbit-v040-set-a-vessels-orbit-via-a-simple-menu/#comment-4253292
Maneuver Node ControllerProvides an interface to finely tune maneuver nodes and restores missing maneuver node features from Kerbal Space Program 1. Make fine tuned adjustments to your maneuver nodes even if they are off screen!https://forum.kerbalspaceprogram.com/index.php?/topic/214244-maneuver-node-controller-003/
MapView Focus and TargetingUse keyboard shortcuts to focus and target celestial bodies in KSP2.

Press Home to focus on the current vessel, press PgUp and PgDn to cycle through planets. Right-click to bring up Set Target menu.
https://spacedock.info/mod/3346/MapView Focus and Targeting
MICRO ENGINEERDisplays useful information about your vessel in flight and in VAB. See your orbital and surface parameters, deltaV, TWR and many other things.https://forum.kerbalspaceprogram.com/index.php?/topic/215989-micro-engineer/
Orbital SurveyScan celestial bodies from orbit.https://forum.kerbalspaceprogram.com/topic/221133-orbital-survey/
Science ArkiveSee all your science experiments at a glance, and check where you can pick some more points!https://forum.kerbalspaceprogram.com/topic/222785-science-arkive-v010-for-ksp2-v020/
Shadow Inc: Exploration DivisionThis mod adds parts that are orientated around explorationhttps://spacedock.info/mod/3407/Shadow Inc: Exploration Division
SPARK TechnologiesSPARK Technologies is proud to present the latest in electric rocket engines.https://forum.kerbalspaceprogram.com/topic/219596-stellar-plasma-assisted-rocket-kinetics-spark-technologies-010/
The Nuclear OptionWhen solar power, batteries, and fuel cells simply aren’t enough, it’s time for The Nuclear Optionhttps://forum.kerbalspaceprogram.com/topic/219626-the-nuclear-option-tno-010/
WASD For VABControl the VAB camera using WASDRequire Right Click For Controlhttps://forum.kerbalspaceprogram.com/topic/223551-wasd-for-ksp/
Wayfarer’s Wings (Rank Ribbons)Give each Kerbal the fame they deserve, know who was the first to plant a flag on Mun, or whatever else!https://forum.kerbalspaceprogram.com/topic/223457-wayfarers-wings-rank-ribbons-v040-for-ksp2-v021/

The clicking area of the object in Phaser does not cover the entire image

When Phaser constructs the input area of an object where the user’s click will trigger the action, it tries to read the dimensions of the image. It usually works, but in some cases the area does not cover the entire image.

To display the input area add the enableDebug() function to your code.

  • First, set the button interactive
  • Enable this.input.enableDebug() on the button
this.nextPlayerButton.setInteractive();
this.input.enableDebug(this.nextPlayerButton);

Error: EACCES: permission denied, open …

When Node.js libraries cannot open files on the local disk, the file does not exist at the specified location, or the file or folder permission are not correct.

To check the permission of the file see Get the octal file permission number of a file or directory

If you get the error message related to the AWS credential and config files,

Error: EACCES: permission denied, open ‘/Users/…/.aws/config’ or

Error: EACCES: permission denied, open ‘/Users/…/.aws/credentials’

  • Set the permission of the AWS config and credentials files to 744
sudo chmod 744 /Users/$USER/.aws/config
sudo chmod 744 /Users/$USER/.aws/credentials

Using the redis Docker container locally

To develop applications with the redis database we can use a Docker image.

The documentation is at https://hub.docker.com/_/redis/

Set up the redis container to be accessed via localhost on the local computer

Start the redis container

Start the redis container “detached” ( -d ) in the background and expose it through localhost:6379

  • In the terminal execute
    docker run -dit --name redis -p 127.0.0.1:6379:6379 redis

Check if the container running

  • In the terminal execute
    docker ps -a

Test the redis database

Start a shell session in the redis container to access the command line utility

  • In the terminal execute
    docker exec -it redis sh
  • At the # prompt start the redis cli
    redis-cli
  • At the 127.0.0.1:6379> prompt test the connection
    ping
    The response should be “PONG”
  • Store a value
    set cat 10
    The response should be “OK”
  • Retrieve the value
    get cat
    The response should be “10”
  • Get the list of all keys
    keys *

Set up redis to be used by other Docker containers

Create a network

Create a Docker network, so multiple containers can communicate with each other using it.

  • In the terminal execute
    docker network create redis

Start the redis container

Start the redis container “detached” ( -d ) in the background in the “redis” network to make it available for redis-cli.

  • In the terminal execute
    docker run --name redis --network redis -d redis

Start the redis command line utility

  • In the terminal execute
    docker run --name redis-cli -it --network redis --rm redis redis-cli -h redis

Using the redis command line utiliy

Store a value in the redis database
  • In the terminal execute
    set cat 10
Read a value from the redis database
  • In the terminal execute
    get cat