Running the same function multiple times with a different parameter

I want to run the function addItem() for every item. Multiple items will belong to the same slot (category). For each category I have to run the function with the same slot. I don’t want to manually write down the slot for each and every item, and I also want to keep it readable.

let equipment = {     head: {},     cape: {},     neck: {},     ammunition: {},     weapon: {},     body: {},     shield: {},     legs: {},     hand: {},     feet: {},     ring: {} };  function createShortName(name) {     return name.toLowerCase().replace(/\s/g, ''); }  function addItem(slot, name, cost, img, income=0, atk_bonus=0, str_bonus=0, def_bonus=0, rngd_bonus=0, mage_bonus=0) {      let newItem = {         slot: slot,         name: name,         cost: cost,         img: img,         income: income,         atk_bonus: atk_bonus,         str_bonus: str_bonus,         def_bonus: def_bonus,         rngd_bonus: rngd_bonus,         mage_bonus: mage_bonus     }      equipment[slot][createShortName(name)] = newItem; }  let currentSlot = 'head'; addItem(currentSlot, 'head_item_1', 100, 'img'); addItem(currentSlot, 'head_item_2', 200, 'img');  currentSlot = 'cape'; addItem(currentSlot, 'cape_item_1', 100, 'img'); addItem(currentSlot, 'cape_item_2', 200, 'img');  currentSlot = 'neck'; addItem(currentSlot, 'neck_item_1', 100, 'img'); addItem(currentSlot, 'neck_item_2', 200, 'img');  // etc. etc. etc. 

As you can see, I add items to the equipment object at the bottom of the code. Is there a better approach?

Does apps running on iOS 10 take up more storage space than on iOS 12?

On my iPhone 6s Plus running iOS 10, Clash Royale game app takes 800 MB of space, but on my iPad mini 2 running iOS 12, it takes up only 190 MB.

The Clash Royale account on my iPhone is the same as on the iPad, so it has the same data in both, and I usually play it more on the iPad than on the iPhone. So how come it takes more storage on my iPhone? Probably because my phone has iOS 10?

Issues running a virtual machine

Went to do an initial boot for a virtual machine I had setup and received the following error

Kernel driver not installed (rc=-1908)  The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please try setting it up again by executing  '/sbin/vboxconfig' 

so I ran “sudo /sbin/vboxconfig” and received the following

vboxdrv.sh: Stopping VirtualBox services. vboxdrv.sh: Starting VirtualBox services. vboxdrv.sh: Building VirtualBox kernel modules. vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.  There were problems setting up VirtualBox.  To re-start the set-up process, run   /sbin/vboxconfig as root.  If your system is using EFI Secure Boot you may need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information. 

Being a Linux noob I’m not sure what to do from here.

What is needed to secure a docker container that’s running on nodes in an AWS Private Subnet with internet access only via NAT?

I know securing a container is a big deal and a lot is needed to be done to secure a default container configuration. But having it in a private subnet should take care of a lots of risks.

So what major things does one need to start with to secure a docker container that’s running on nodes in an AWS Private Subnet with internet access only via NAT?

What pacing problems for the DM does Murder in Baldur’s Gate pose when running the adventure?

This question is directed at DM/GMs who have run the adventure Murder in Baldur’s Gate.

I am prepping to run this adventure, and it seems that this module’s ten phase / three faction plot structure makes for a variety of player and DM decision points and interaction with arbitrary sized groups of NPCs.

My objective is to do pre-emptive decision point preparation so that encounter size, pace, timing and CR all fit the plot. I’d like to use lessons learned from those who have run this adventure by identifying those points that most often slowed play down. (Once identified, mitigation can be applied).

I intend to run this in D&D 5e, but experience with pacing issues and their resolution in a 4e or 3.5 context should be highly relevant and are acceptable as answers.

If, as a DM, you ran this module/adventure during or after the playtest:

What pacing/adventure flow problems did you encounter as a DM when running the adventure, and how did you resolve them?

Docker | CentOS | $releasever is “” when running docker build

I am attempting to build a docker image from a CentOS parent image … and installing MongoDB. The error is happening when docker build is adding the MongoDB repo.

You can see that the error is happening because $ releasever is blank for some reason.

DockerFile

FROM centos:latest MAINTAINER "MyName" <myemail@gmail.com> ENV container docker RUN echo -e "\ [mongodb-org-4.0]\n\ name=MongoDB Repository\n\ baseurl=https://repo.mongodb.org/yum/redhat/$  releasever/mongodb-org/4.0/x86_64/\n\ gpgcheck=1\n\ enabled=1\n\ gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc\n" >> /etc/yum.repos.d/mongodb-org-4.0.repo RUN yum repolist all RUN yum install -y mongodb-org 

ERROR

https://repo.mongodb.org/yum/redhat//mongodb-org/4.0/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found 

Running a git-based program (Bup) on Ubuntu WSL gives error “[Errno 38] Function not implemented”

My Ubuntu setup is running great and things to seem to be working well for other things I’m doing but with one particular program (Bup) which is a backup solution built on top of git.

Running this command gives the errors [Errno 38] Function not implemented

bup save -n InitialCommit /mnt/c/BackupTest 

From basic Googling it seems to be Python or git related and possibly related to multithreaded processing not being supported, but I’m not sure if that is what’s happening here.

Two workflows running on a Library with Check in Check out

I have two workflows on my Document Library that has Check in/Check out, my first workflow works fine, my second workflow won’t work if I create a new document from a content type – it will work if I drag & drop or upload a document.

First workflow:

enter image description here

Second workflow (the document is checked in at the end of the workflow):

enter image description here

Does the second workflow have to wait for the first workflow to complete?

Any help would be much appreciated.

What types of Google Cloud application should I consider for something running as a continually available service that subscribes to a pub/sub?

I want to create an application that will run as a service that subscribes to a Google Cloud pub/sub topic, and delivers emails based on ‘alerts’ that it receives through the pub/sub subscription. It will read from Cloud DataStore to determine the email addresses to mail to, and it will probably use some type of 3rd party service and API to do the actual mailing. In future, there will be a requirement to send other types of notification, for example SMS alerts.

What types of Google Cloud application should I consider for this? I’m not sure what type of application would be appropriate for something that effectively acts as a constantly available ‘service’. Could I just create a normal Java application that subscribes to the topic in its ‘main’ method, and deploy this as an AppEngine app? Or are there more complex considerations I need to bear in mind? I’ve previously used DataFlow, which handles parallel processing of data very well, when subscribed to a pub/sub topic, however it’s really designed for processing Big Data and I don’t think would be appropriate.

Apologies for the noob question – I’m still learning to think in terms of Cloud architectures as opposed to traditionally running services. I’d really appreciate some basic guidance on what type of application I should be looking at creating.