replacement – Apply a function to all coefficients of a polynomial

I would like to apply a given function $f$ to each one of the coefficients of a polynomial.

For example if $P=(x – 2) (y^2 + 1)= -2 + x – 2 y^2 + x y^2$ and $f(c)=c^2$, I would like to obtain the polynomial $Q= 4+x+4y^2 + xy^2$.

I am aware of CoefficientRules and FromCoefficientRules but I do not know how to modify rules.

f(t_) := t^2;
P = (x - 2) (y^2 + 1);
P // Expand
(* -2 + x - 2 y^2 + x y^2 *)
rules = CoefficientRules(P, {x, y})
(* {{1, 2} -> 1, {1, 0} -> 1, {0, 2} -> -2, {0, 0} -> -2}*)
(* Something should happen here I guess *)
Q = FromCoefficientRules(rules, {x, y})
(* -2 + x - 2 y^2 + x y^2 *)

Ideally the method could also apply to more general function, such as going from $2 sin(2x) -5$ to $4sin(x) + 25$, although it may be more involved as $sin(2x)$ could also be changed into $sin(4x)$.

How do I apply more than one conditional formatting rule using JSON to a SP Online List column?

You cannot apply multiple JSON formatting codes to single column. So, you have to manage multiple conditions/rules within same JSON.

For changing color to red when number is negative, add below code in your existing JSON:

...

"style": {
      "color": "=if(@currentField < 0, 'red', '#323130')"
}

...

Documentation: Use column formatting to customize SharePoint

html – Why would you ever use the shadow DOM if you can’t apply global styles?

How can you expect to create re-usable components with the shadow DOM and also be expected to give it a separate style? How can anyone be able to share components with each other if that person can’t apply a style on top? I would never use anyone else’s components if they aren’t using my css library..

Side suggestion, <slot> should be useable in light dom with custom components.

southeast asia – How to apply for Vietnam tourist visa

Unfortunately, the government of Vietnam does not appear to host an (English) website listing all their official embassy sites. However, if your nation hosts a list of official missions, you may be able to find it there. Beyond that, searching for “Vietnamese Embassy ” normally finds some viable candidates. Real embassy sites seem to always refer to “The Socialist Republic of Vietnam”, and the front page will normally list announcements by Vietnamese officials, trade deals, etc.

In the case of Japan, it would appear all Visas are handled by the main embassy in Tokyo, hence your problems with the Osaka consulate. However, as the process seems to involve only posting off your passport, the exact location is unimportant. The process involves filling out a form, and sending, it, your passport, and the fee off together. See application page on the Vietnamese embassy site.

It is also possible to acquire a “Pre-approved Visa on Arrival” for Vietnam, provided your are entering by air to Ho Chi Minh, Hanoi or Da Nang airports. This tends to be cheaper than getting a visa through embassies, but has less flexibility and involves joining a queue at the airport. It also requires that the pre-approval is negotiated by a Vietnamese private agency. You can find a fairly detailed description fo the process in a TripAdvisor FAQ. Roughly speaking it works like this:

  1. Find a suitable agency, send the details they require and their fee off to them.
  2. The agency will send you a scan of a letter with your name (and possibly several others) on it, and an official Vietnamese government stamp.
  3. On arrival at the airport, you find the appropriate desk. You show your letter, hand over your passport, and pay another fee (the amount of this keeps changing and depends on your visa type), and the Visa is added to your passport. You can now proceed to immigration

Only limited types of visa are available on the pre-approved visa on arrival scheme. If you want another type of visa, or are arriving at a land border, sea border, or an airport not on the approved list, you will need a visa (or to be entitled to visa-free entry)

google sheets – How to Apply Conditional Formatting Based on Adjacent Cell Value for Entire Column?

I am looking to apply conditional formatting to all cells in a column (excluding the header) where a colour will be applied depending on if its value is greater, equal, or less than the adjacent cell.

Simple example:

A B
1 100 200
2 50 150
3 80 20

Here is a simple spreadsheet that is more complex implementing @RubĂ©n’s solution:

https://docs.google.com/spreadsheets/d/1pl_UOyyE8r-JOcGWM2zsA2fFAbuvH3EUg7YnonaTZqY/edit?usp=sharing

Range B:B has the following custom formulas:

  • =B2>=A2 for green (if the cell on the right is greater than or equal to the cell on the left)
  • =B2<A2 for red (if the cell on the right is less than the cell on the left)

If the value in column B is greater than or equal to the value in column A, colour the B cell green. If the value in column B is less than the value in column A, colour the B cell red.

So rows 1 and 2 should be green, and 3 red.

I am familiar with how to do this individually on a per cell basis, but if I have hundreds of rows and need to do this over multiple columns I don’t want to manually do this hundreds of times. It looks like I need to use the Custom formula is on Conditional formatting rules, but I can’t figure out how to target a relative cell by position.


What I’ve tried:

  • Conditional formatting on one cell such as Great than or equal to $A2, then dragging this row down hoping the 2 increments. It doesn’t. This also wouldn’t work in scenarios where there are unique formulas or static values in the cells without going back and updating the cell values.
  • Using the Custom formula is, but unable to find the correct function to pair it with to again make that 2 value increment. Looked at MATCH and other descriptions of functions and didn’t see anything suitable for dynamic cell.
  • Looked at using the Script Editor, but this didn’t seem right and seemed like overkill for what I feel is pretty simple.
  • Googling, but somehow not finding anyone who’s wanted to do this before. Stack has questions that are close, such as Conditional Formatting based on other column that also use the MATCH function, but I wasn’t able to make this work.

networking – Network Configuration Gone – Unable to Reset or Apply Netplan

I’m not sure what’s going on or what happened; I run a machine headless Ubuntu 20.04.2 LTS, it performed an update sometime overnight and when I logged in it prompted me that it needed a reboot – so I did, however, it didn’t appear to come back up.

After attaching a monitor to it I discovered it was running but the network interface was none functional. Not even appearing actually, like it was just deleted or removed. I’ll try to share as much information here – but I’m just not sure what could be wrong and I honestly don’t know where else to look.

After trying everything below, I still have no internet connection – and what’s worse, after a reboot the only way to get an IP address on my LAN to allow an SSH is by using:

$ sudo ip link set enp3s0 down
$ sudo ip link set enp3s0 up
$ sudo ip addr add 192.168.1.150/24 dev enp3s0

$ sudo lshw -class network

  *-network                 
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: enp3s0
       version: 0c
       serial: 2c:56:dc:97:80:9f
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=5.8.0-48-generic duplex=full firmware=rtl8168g-2_0.0.1 02/06/13 ip=192.168.1.150 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
       resources: irq:18 ioport:e000(size=256) memory:fea00000-fea00fff memory:f0800000-f0803fff

$ sudo nano /etc/netplan/netcfg.yaml

network:
  version: 2
  renderer: networkd
  ethernets:
    enp3s0:
      dhcp4: no
      addresses:
        - 192.168.1.150/24
      gateway4: 192.168.1.1
      nameservers:
          addresses: (8.8.8.8, 1.1.1.1)

After a reboot, the above netplan configuration remains, however, additional spacing is being added to some of the lines – causing it to fail.

$ ip a

2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 2c:56:dc:97:80:9f brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.150/24 scope global enp3s0
       valid_lft forever preferred_lft forever
    inet6 2001:1970:4a26:8100:2e56:dcff:fe97:809f/64 scope global dynamic mngtmpaddr 
       valid_lft 86140sec preferred_lft 14140sec

$ ip route show

default via 192.168.1.1 dev enp3s0 
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown 
172.18.0.0/16 dev br-5c71e5479641 proto kernel scope link src 172.18.0.1 
192.168.1.0/24 dev enp3s0 proto kernel scope link src 192.168.1.150

I am only able to get the default via 192.168.1.1 dev enp3s0 portion to appear after running $ sudo ip route add default via 192.168.1.1

$ sudo netplan –debug try

DEBUG:enp3s0 not found in {}
DEBUG:Merged config:
network:
  ethernets:
    enp3s0:
      addresses:
      - 192.168.1.150/24
      dhcp4: false
      gateway4: 192.168.1.1
      nameservers:
        addresses:
        - 8.8.8.8
        - 1.1.1.1
  renderer: networkd
  version: 2

DEBUG:New interfaces: set()
** (generate:53716): DEBUG: 22:58:01.445: Processing input file /etc/netplan/netcfg.yaml..
** (generate:53716): DEBUG: 22:58:01.445: starting new processing pass
** (generate:53716): DEBUG: 22:58:01.446: We have some netdefs, pass them through a final round of validation
** (generate:53716): DEBUG: 22:58:01.446: enp3s0: setting default backend to 1
** (generate:53716): DEBUG: 22:58:01.446: Configuration is valid
** (generate:53716): DEBUG: 22:58:01.446: Generating output files..

An error occurred: the configuration could not be generated

Reverting.
DEBUG:netplan generated networkd configuration changed, restarting networkd
DEBUG:enp3s0 not found in {}
DEBUG:Merged config:
network:
  ethernets:
    enp3s0:
      addresses:
      - 192.168.1.150/24
      dhcp4: false
      gateway4: 192.168.1.1
      nameservers:
        addresses:
        - 8.8.8.8
        - 1.1.1.1
  renderer: networkd
  version: 2

DEBUG:no netplan generated NM configuration exists
DEBUG:enp3s0 not found in {}
DEBUG:Merged config:
network:
  ethernets:
    enp3s0:
      addresses:
      - 192.168.1.150/24
      dhcp4: false
      gateway4: 192.168.1.1
      nameservers:
        addresses:
        - 8.8.8.8
        - 1.1.1.1
  renderer: networkd
  version: 2

DEBUG:Link changes: {}
DEBUG:netplan triggering .link rules for lo
DEBUG:netplan triggering .link rules for enp3s0
DEBUG:netplan triggering .link rules for br-5c71e5479641
DEBUG:netplan triggering .link rules for docker0
DEBUG:netplan triggering .link rules for vethf90fcb2
DEBUG:netplan triggering .link rules for veth71540be
DEBUG:netplan triggering .link rules for veth18e90b7
DEBUG:netplan triggering .link rules for vetheb58aaa
DEBUG:netplan triggering .link rules for veth728e8e9
DEBUG:netplan triggering .link rules for veth96def70
DEBUG:netplan triggering .link rules for vetha4b92ad
DEBUG:netplan triggering .link rules for vethd43e21c
DEBUG:netplan triggering .link rules for vethb777853
DEBUG:netplan triggering .link rules for veth2b054d4
DEBUG:netplan triggering .link rules for veth8f6354f
DEBUG:netplan triggering .link rules for vethc69182e
DEBUG:netplan triggering .link rules for veth9e52006
DEBUG:netplan triggering .link rules for veth9b90b02
DEBUG:netplan triggering .link rules for veth3f22dda
DEBUG:netplan triggering .link rules for vethc39e6d3
DEBUG:netplan triggering .link rules for vetha38ae56
DEBUG:netplan triggering .link rules for vethf68a144
DEBUG:enp3s0 not found in {}
DEBUG:Merged config:
network:
  ethernets:
    enp3s0:
      addresses:
      - 192.168.1.150/24
      dhcp4: false
      gateway4: 192.168.1.1
      nameservers:
        addresses:
        - 8.8.8.8
        - 1.1.1.1
  renderer: networkd
  version: 2

This is about all the information I have. I’m just not sure what went wrong, where, how, when.

Any help is greatly appreciated. Thanks!

Can I apply for a new UK visit visa when I have still Valid UK visitor visa?

My exam was on 26th of March and which was cancelled due to this covid pandemic, but I applied for visa on that exam date, now that i have got the 6month visitor visa which is valid till 14th of september, 2021. Now the issue is that the earliest exam that I could book was 10th of october, 2021 and my visa will ve expired by that time.Now i am confused that can I apply for a new visitor visa while still having a valid uk visitor visa. please guide what to do in this situation