Dynamically changing the href on a link with data-dialog-type = modal does not work

For reference I am working on this issue for the Focal Point module…

I have a link whose href is updated dynamically using js based on a particular user interaction (moving the focal point on an image). The link may start as /admin/focal_point/preview/10/21×68 but after a user moves the focal point to another part of the image it is changed to /admin/focal_point/preview/10/75×28. In attempting to open this preview page open in a modal (as opposed to a new window) I’m finding that clicking the link loads the preview as though the link had not been changed. Any idea how to tell the ajax logic that loads modals to acknowledge the changed href?

Google Sheets – How to preserve colors of each series from changing when inserting new data in Chart Editor?

This issue occurs on every chart type. As an example, I have a pie chart created from a long table of data where each column is assigned a specific text color, so each slice of the pie corresponds to the color of that column. I maintain this color coding on various other graphs of the same data to aid in reading the data.

When I insert a new column into the table data, I want to assign it a new color, and have its slice take that color. The new data is inserted into the series of the pie chart. However, the series will not keep their assigned colors, instead the inserted series will take the color of the series that was in its place, causing a domino effect as every series after will shift its color. The last series will have a new color. As such all the slices in the chart after the inserted slice will no longer correspond to the color of its column.

Chart before and after inserting new data

I then have to manually change each series back to its original assigned color which is extremely time-consuming and frustrating every time I want to insert new data.

How can I preserve the color of each slice/series so that the colors don’t all change when I insert new data?

Complexity of a Turing Machine when changing its alphabet to binary

I found in ‘Computational Complexity: A Modern approach’ Book the following statement that i dont quite understand its proof :

For every f : {0, 1}∗ → {0, 1} and time-constructible T : N → N, if f is computable in time T(n) by a TM M using alphabet A, then it is computable in time 4log|A|T(n)by a TM M ̃ using the alphabet {0,1,Blank,◃}.

The proof is on the link :

First Part of proof

Second Part

So basically if we have a running time of T(n) on a certain alphabet A and we wanna switch to binary.. we gonna have to multiply it by log(|A|) (log of base 2, the number of bits to represent an element from A) because every step will be multiplied by the number of bits used to represent the element.

But in the proof, starting from the second paragraph, i dont really understand what they say and how they end up with the ‘4’ in ‘4log|A|T(n)’.

Any help is welcome, Thank you so much.

changing file name in a prefer sequence format, Python

I have a list of file which I have gathered them in time order, I should change the file name (just name) in order of the time. The name changing process will contain;

Removing the name from ‘#’ sign until the end. Save the name before ‘#’ and add the 1.1 for the first file and the numbering will continue until 10.2, I have a 20 file so at the end I will have below order:

file in folder: First name:

2019-06-12_#01 2019-06-12_#02 2019-06-12_#03 … … 2019-06-12_#20

final name:

2019-06-12_#1.1 2019-06-12_#1.2 2019-06-12_#2.1 2019-06-12_#2.2 … … 2019-06-12_#10.2

I have see some post like below: but I need the exact code to deliver the correct output.

import os  os.rename('a.txt', 'b.kml') 

or below code, I have a fix folder. so I can address files directly:

   import os    old_file = os.path.join("directory", "a.txt")    new_file = os.path.join("directory", "b.kml")    os.rename(old_file, new_file) 

Changing back the default python version to 3.7 on Ubuntu 19.04

I installed python3.5.2 on my Ubuntu 19.04 for some reason, and now I want to make the python3.7 the default for python3 command on terminal and even remove the 3.5.2 version from my system. The installation process of 3.5.2 was manual, and there is not a python3.5.2 in /usr/bin directory:

$   ls /usr/bin 

enter image description here

$   python3.7 -V Python 3.7.3  $   python3.5 -V Python 3.5.2  $   python3 -V Python 3.5.2 

Some other functionalities in the system are broken too. For example, when I use jupyter notebook it uses python3.5.2 as its kernel and it doesn’t recognize the libraries I’ve installed for the 3.7 version. So how can I restore the python version to the Ubuntu 19.04 default?