Can a Tomelock swap the Book of Ancient Secrets invocation with itself upon level-up, and gain more than two ritual spells that way?

Eldritch Invocations (PHB, p. 107):

…Additionally, when you gain a level in this class, you can choose one of the invocations you know and replace it with another invocation that you could learn at that level.

Book of Ancient Secrets (BoAS) (PHB, p. 110):

Prerequisite: Pact of the Tome

You can now inscribe magical rituals in your Book of Shadows. Choose two 1st-level spells that have the ritual tag from any class’s spell list (the two needn’t be from the same list). The spells appear in the book and don’t count against the number of spells you know. With your Book of Shadows in hand, you can cast the chosen spells as rituals. You can’t cast the spells except as rituals, unless you’ve learned them by some other means. You can also cast a warlock spell you know as a ritual if it has the ritual tag.

On your adventures, you can add other ritual spells to your Book of Shadows. When you find such a spell, you can add it to the book if the spell’s level is equal to or less than half your warlock level (rounded up) and if you can spare the time to transcribe the spell. For each level of the spell, the transcription process takes 2 hours and costs 50 gp for the rare inks needed to inscribe it.

Assuming that the DM rules that the Rituals learned by BoAS don’t vanish upon dismissing (old) BoAS:

Is it possible by RAW to gain two new ritual spells with every warlock level by switching the BoAS invocation with the BoAS invocation upon level-up?

Bonus:

Assuming that the DM rules that the spells learned from BoAS vanish:

Can a warlock copy a spell from his Book of Shadows to his Book of Shadows and preserve the Spells in this way to get more ritual spells by switching BoAS with BoAS on level-up?

LinuxLite Ram blow but swap still 0

Im using Linux Lite in a old notebook to play Minecraft with my little boy.

I made one machine install and every thing works fine, but second machine I suffer with a strange swap problem.

As I know Minecraft Java Edition uses a lot of ram and I can set the amount to reserve for java while starting game.

When I reserve 2GB for java the game loads and I can start play almost all Ram in use and only few mb used in swap.

Swap usage

Different from another machine that swaps grow im a way that seems normal to me like 600, 700, 900MB and keeps a secure amount of ram free. Already tried others swapiness combinations like 10 20 50 70 90, but nothing changes. A see a curious thing in Gparted the swap partition still off and I must enable it with swapon command

Partition boots like this: Swap off when boot

And then after right click swapon the swap is mounted and appears available in htop.

Noticed another strange info at Disks app. the swap allways show as unknow. mounted or umounted state. Unknow Partition

Btw I read something about this distro using a swap file instead partition, but I guess indifferent of type they should appears in use at htop.

Someone can guide me a direction. Im newby in linux but Im not give up a good fight. I really like that in linux.

Thanks you all.

This is a plain swap of 64-bit integers on 64-bit ARM, using inline assembly in gcc, but it needs to be in clang

I’d like to get an opinion for this, which I found in BDE and modified.

I need the fastest 64-bit integer swap possible. This is for a mobile application used by a lot of people, so I want to create a template specialization for this (in addition to std::swap() ) and integrate it into the C++ std library for our platform.

I’m not sure about how to port this to clang 7. It builds fine with gcc. Any advice would be appreciated..

inline int64_t swapInt64(int64_t *atomicInt,               int64_t swapValue) {     int64_t oldValue;     int rc;      // Clang doesn't support register     // pairs that represent a 64bit value.  So instead of 'ldrexd %1, %H1, [%3]'     // the exact registers have to be specified, as in 'ldrexd r2, r3, [%3]'.      asm volatile (         "1:     ldrexd  r2, r3, [%4]           \n\t"         "       mov     %[old1], r2            \n\t"         "       mov     %[old2], r3            \n\t"         "       mov     r2, %[val1]            \n\t"         "       mov     r3, %[val2]            \n\t"         "       strexd  %[rc], r2, r3, [%4]    \n\t"                 : [rc]   "=&r" (rc),                   [old1] "=&r" (((Int64_Words &) oldValue).w1),                   [old2] "=&r" (((Int64_Words &) oldValue).w2),                          "+Qo" (*atomicInt)                 :        "r"   (atomicInt),                   [val1] "r"   (((Int64_Words &) swapValue).w1),                   [val2] "r"   (((Int64_Words &) swapValue).w2)                 : "r2", "r3", "cc", "memory");      return oldValue; }  

how to make sure Ubuntu 16.04 use swap only when memory is true used instead of full of cache?

I have set vm.swappness to 0, but the system start to use swap when the rest of memory is full by cache after a few days. This leads to high load and high latency, probably because I put SWAP and the system on one hard disk.

my free -hm

I have read through https://help.ubuntu.com/community/SwapFaq/#What_is_swappiness_and_how_do_I_change_it.3F And i found ” The Linux kernel automatically moves RAM reserved by programs–but not really used–into swap, so that it can serve the better purpose of extending cached memory.” is this the true reasone? how can i avoid this when i can still use swap for unforeseeable circumstances?

Intermitent bug on encrypted swap over Ubuntu 18

Wanting encrypt swap and the only script I found to do it as I want is it:

    sudo -i     cd /root      mkdir -p ./.myfolder      cd ./.myfolder      swapsize='4G'      curdir=$  (pwd)      flNmDev="myfile"     flPtDev="$  curdir/$  flNmDev"      flNmKey="mykeyfile"      flPtKey="$  curdir/$  flNmKey"      flNmMnt="mydevname"      flPtMnt="$  curdir/$  flNmMnt"      fallocate -l $  swapsize $  flPtDev &> /dev/null     chmod 0600 $  flPtDev     chown root $  flPtDev      dd if=/dev/urandom of=$  flPtKey bs=4096 count=1 conv=notrunc,noerror &> /dev/null      sudo chmod 0600 $  flPtKey     chown root $  flPtKey cat << EOF > /etc/crypttab # <target name> <source device>         <key file>      <options> $  flNmMnt $  flPtDev $  flPtKey swap,offset=1024,cipher=aes-xts-plain64 EOF     cryptdisks_start $  flNmMnt &> /dev/null     mappedCryptPath="/dev/mapper/$  flNmMnt"     mkswap -L swapone $  mappedCryptPath -f &> /dev/null     rpl "/swap.img" "#/swap.img" /etc/fstab &> /dev/null     echo "$  mappedCryptPath none swap sw 0 0" >> /etc/fstab     swapon -a  

On the same machine and same Version of Ubuntu it sometimes works but sometimes crash on boot.
Following some output on each boot it did:

uname -v  #54-Ubuntu SMP Mon May 6 18:46:08 UTC 2019 

journalctl -b   systemd[1]: Mounting /boot... swapon[995]: swapon: /dev/mapper/mydevname: swapon failed: Device or resource busy mkswap[991]: mkswap: unable to erase bootbits sectors  systemd[1]: systemd-cryptsetup@mydevname.service: Control process exited, code=exited status=1  systemd[1]: systemd-cryptsetup@mydevname.service: Failed with result 'exit-code'.  systemd[1]: Failed to start Cryptography Setup for mydevname.  systemd[1]: Dependency failed for Local Encrypted Volumes.  systemd[1]: cryptsetup.target: Job cryptsetup.target/start failed with result 'dependency'.  systemd[1]: dev-mapper-mydevname.swap: Swap process exited, code=exited status=255  systemd[1]: dev-mapper-mydevname.swap: Failed with result 'exit-code'.  systemd[1]: Failed to activate swap /dev/mapper/mydevname.  systemd[1]: Dependency failed for Swap.  systemd[1]: swap.target: Job swap.target/start failed with result 'dependency'. 

cat /proc/meminfo | grep Sw  SwapCached:            0 kB SwapTotal:             0 kB SwapFree:              0 kB 

cat /proc/swaps   Filename                Type        Size    Used    Priority 

cat /proc/swaps   Filename                Type        Size    Used    Priority /dev/dm-1                               partition   4193788 72704   -2 

cat /proc/meminfo | grep Sw  SwapCached:        10644 kB SwapTotal:       4193788 kB SwapFree:        4102396 kB 

journalctl -b  mkswap[868]: mkswap: /dev/mapper/mydevname: warning: wiping old swap signature. systemd[1]: Found device /dev/mapper/mydevname. systemd[1]: Activating swap /dev/mapper/mydevname... mkswap[868]: Setting up swapspace version 1, size = 4 GiB (4294438912 bytes) mkswap[868]: no label, UUID=348deb8f-7457-4829-a1a2-0ebd1b61f6d6 systemd[1]: Started Cryptography Setup for mydevname. systemd[1]: Reached target Local Encrypted Volumes. kernel: Adding 4193788k swap on /dev/mapper/mydevname.  Priority:-2 extents:1 across:4193788k FS systemd[1]: Activated swap /dev/mapper/mydevname. systemd[1]: Reached target Swap. 

cat /proc/swaps   Filename                Type        Size    Used    Priority /dev/dm-1                               partition   4193788 0   -2 

journalctl -b  mkswap[683]: mkswap: unable to erase bootbits sectors systemd[1]: systemd-cryptsetup@mydevname.service: Control process exited, code=exited status=1 systemd[1]: systemd-cryptsetup@mydevname.service: Failed with result 'exit-code'. systemd[1]: Failed to start Cryptography Setup for mydevname. systemd[1]: Dependency failed for Local Encrypted Volumes. systemd[1]: cryptsetup.target: Job cryptsetup.target/start failed with result 'dependency'. systemd[1]: Dependency failed for dev-mapper-mydevname.device. systemd[1]: Dependency failed for /dev/mapper/mydevname. systemd[1]: Dependency failed for Swap. systemd[1]: swap.target: Job swap.target/start failed with result 'dependency'. systemd[1]: dev-mapper-mydevname.swap: Job dev-mapper-mydevname.swap/start failed with result 'dependency'. systemd[1]: dev-mapper-mydevname.device: Job dev-mapper-mydevname.device/start failed with result 'dependency'. systemd[1]: Activating swap /dev/mapper/mydevname... systemd[1]: Starting Cryptography Setup for mydevname... systemd-cryptsetup[688]: Volume mydevname already active. kernel: Adding 4193788k swap on /dev/mapper/mydevname.  Priority:-2 extents:1 across:4193788k FS systemd[1]: Activated swap /dev/mapper/mydevname. mkswap[690]: mkswap: error: /dev/mapper/mydevname is mounted; will not make swapspace systemd[1]: systemd-cryptsetup@mydevname.service: Control process exited, code=exited status=1 systemd[1]: systemd-cryptsetup@mydevname.service: Failed with result 'exit-code'. systemd[1]: Failed to start Cryptography Setup for mydevname. 

cat /proc/meminfo | grep Sw  SwapCached:            0 kB SwapTotal:       4193788 kB SwapFree:        4193788 kB 

Dual booting 18.04 with 2 SSDs: swap file or partition?

setting up dual boot with Dell 7820, 64gb ram, 2 2tb SSDs, Win10 workstation installed on SSD #1. Want to put Ubuntu 18.04 on SSD #2.

I understand 18.04 does not use a swap partition but rather a swap file. Still, some instructions I found said if you have a fast SSD or small ram you can set up a swap partition. I sometimes exceed my RAM and get a memory error under windows. Should I set up a swap partition, or swap file? I plan to devote 3x my RAM (64gb) = 200gb to swap, whether file or partition. This will still leave 1.8tb for root and home. I often use up my 64gb RAM and will be doing new things that would need vastly more RAM.

I’ve read other posts suggested, and it seems swap files are the default now because a swap partition is hard on an SSD. Seems confusing to me because swap is swap? Both will be on the #2 SSD. How do the two work differently?

If there is a way to make the 2 tb SSDs last longer it would be good.

Help understanding this would be greatly appreciated.

Thanks very much,

Jim

How to implement onclick in ResultCard and swap the div with another component

I want to display the details of what’s user clicks in the ResultCard.

I want to replace the divs contents (currently displayed results) with rendered html based on the result found in my elastic search cluster(res) when user click the url in the resultcard.

I tried adding onclick properties but nothing happens. Reactivesearch documentation don’t list this attribute.

Of course, I could pass argument in the url properties of ResultCard and redirect user to another page but page would be reloaded completely (with the menus defined in index.js and the footer)

I think creating parent component with state from the currently displayed children component in the div is the way to go.

But, how to run a javascript setting the state when user click in the resultcard?

class App extends Component { render() { return ( <div style={{ display: “flex”, “flexDirection”: “row” }}> <div style={{ display: “flex”, “flexDirection”: “column”, “width”: “40%” }}>

        </div>         <**ResultCard**           componentId="result"           dataField="nom"           title="Results"           from={0}           size={6}           pagination={true}            react={{             and: ["searchbox"]           }}           onData={(res) => {             return {               image: "data:image/png;base64,iVBORw0KG.....",               title: res.occupations,               description: res.nom,       url: "/details/" + res             }           }}           style={{             "width": "60%",             "textAlign": "center"           }}         />       </div>     </ReactiveBase> ); 

} }

export default App;

Expected result is to change the div content with the rendered html from another component (not still coded).

removing swap space

I have create a swap space by executing following commands:

sudo fallocate -l 8G /swapfile  sudo chmod 600 /swapfile sudo mkswap /swapfile  sudo swapon  

I no longer need it so I removed it by doing:

sudo swapoff /swapfile sudo rm -f /swapfile 

Now when I run the command: free -h it shows me:

               total        used        free      shared  buff/cache   available Mem:           7.7G        301M        7.1G        720K        285M        7.2G Swap:            0B          0B          0B 

I just want to confirm, if the swap space have been removed? since it still shows in the output.

Macbook Pro w/ USB-C and multiple monitors occasionally swap non-main screens

My Macbook Pro (15″, 2017 model) running High Sierra has a multi monitor setup involving my laptop on the left, an external monitor to its right (and configured to be the main screen with the menu bar and dock), and another monitor to the right of that. Both external monitors (same brand and same resolution) are connected via HDMI cables that attach to Thunderbolt/USB-C plugs that go into an Elgato dock which then connects to the laptop via a Thunderbolt/USB-C cable.

I frequently will disconnect the laptop to go to a meeting and occasionally when I reconnect, my leftmost and rightmost screens become reversed, what I used to see on the laptop screen is now on the right external monitor. This goes for not only floating windows but also full screen apps. I then need to go into Mission Control to move the windows and full screen apps back to their preferred positions.

So firstly I want to know why this is happening and secondly how I can prevent that from occurring or a tool I can use to restore the windows as expected. I have seen some mention online that it could be related to which monitors are recognized by the computer first, and for sure for about 20 seconds after I plug in the cable I see a crazy dance of windows being resized and sometimes they all restore correctly. Could this be an issue with the dock or is it related to the OS and how it recognizes external monitors?

Thank you in advance!