algorithms – Better version of heavy-light decomposition: always draw path to largest subtree

Can someone tell me if this works? It seems to be easier to implement and also creates slightly less paths (though still O(log N) ).

The problem: given any tree of size N, find a way to split it into some disjoint paths such that from any node, you can reach the root by passing through log N paths. Heavy light decomposition: https://cp-algorithms.com/graph/hld.html

I was thinking that a small modification is that instead of choosing an edge only when a child’s subtree is of size at least half of this subtree, you just choose the largest subtree. Proof that this works is the same: when you switch paths, the size of the subtree must at least double.

Edit: just noticed that the link also mentions you can do this, so I’m wondering why heavy-light decomposition is used instead of this, because this seems easier to understand and also slightly more performant (because of less paths).

windows 10 – Open local files in Internet Explorer mode file extension allow list (Edge version 88.0705.74)

Im trying out the new feature in edge to open .MHT files in edge in IEmode.

  • I installed Edge version 88.0705.74 on Win 10 20h2
  • I set the policy Configure Internet Explorer integration (InternetExplorerIntegrationLevel) to iemode
  • I set the policy Open local files in Internet Explorer mode file extension allow list to .mht files

I tried different GPOs to help me succeed
-Open local files in Internet Explorer mode file extension allow list -enabled

But if i try to open the files they keep on opening in edge not in iemode. Do i need to do something with the assocation?

android – How to maintain and deploy a poc (Proof Of Concept) version of an app?

In our organization we sometimes have to create a poc (proof of concept) to either validate or invalidate the way to go. Currently we’re having a discussion around how to embed this within our development/testing process in the app and thus the same repo itself. It would be nice that the poc can enter the internal testing / testflight mode on android playstore and iOS appstores.. The timeline of a poc can be as less as a day to the span of multiple weeks whereas the latter can disrupt our deployment process.

A few possible methods raised by the team were:

  • Creating a long-lived branch in git and deploying it to internal testing/testflight
    • this disrupts our development process in where we deploy to internal testing / testflight as soon as a ‘feature’ is done. A feature is defined to be able to be done within a sprint and thus ‘short-lived’ branches.
  • Creating a long-lived branch in git, change settings to create the app with a different name, upload as app (poc-testing) and only deploy to internal testing / testflight making the app not available for the public.
    • A downside to this is everytime we make a poc we’ll have to make a new application and so on.
  • Don’t deploy the app at all to internal testing / testflight and manually distribute the apk/bundle to the people and/or inform them of a place where and how to download/install it.
    • A downside to this is it’s all manually (the installation part). We do have a pipeline which builds the app into the desired formats for iOS and Android.
  • Create a complete new application (and repo) solely for the purpose of the poc.
    • This has as a downside that you don’t have access to the app’s code. This can also be an upside.

The requirements we have are:

  1. Easy to maintain
  2. Our testers know exactly what they’re testing (the poc or new features)
  3. It doesn’t block our app from deploying to the internal testing / testflight when a feature is done.
  4. It’d be nice if the poc is available within internal testing / testflight so it gets spread automatically

What is the way to go for this?

compiling – gcc version change using update-alternative

i wanted a lower version of gcc to be installed for an old GPU and used gcc-opt to install and changed the gcc auto to the lower version using

update-alternatives

the following error showed up

gcc-opt: Failed to open /CurrentlyBuilding
ccache: error: execv of /usr/bin/gcc-4.0.gcc-opt failed:

when i tried to get back to gcc-9 using the same command [ update-alternatives], it doesn’t get back to gcc-9, just showed the same message.
Even after i uninstalled gcc-opt, and tried the same, i couldn’t change anything.

co.combinatorics – Young-Fibonacci version of Nekrasov-Okounkov

This question addresses a hierarchy of linear recurrences
which arise from an attempt to generalize the Nekrasov-Okounkov
formula to the Young-Fibonacci setting.
A related posting

extensions of the Nekrasov-Okounkov formula

asks how one might try to extend the Nekrasov-Okounkov formula
by replacing the Plancherel measure on the Young lattice $Bbb{Y}$
with another ergodic, central measure.
In this discussion I want to instead replace the Young lattice $Bbb{Y}$
by the Young-Fibonacci lattice $Bbb{YF}$ which comes equipped with its own Plancherel measure in virtue of being a $1$-differential poset.
Allow me to briefly review some basics of the Young-Fibonacci lattice
before I state the putative $Bbb{YF}$-version of the Nekrasov-Okounkov partition function.

Young-Fibonacci Preliminaries:
Recall that a fibonacci word $u$ is a word formed
out of the alphabet ${1,2}$. As a set $Bbb{YF}$ is the
collection of a (finite) fibonacci words and $Bbb{YF}_n$
will denote the set of fibonacci words $u in Bbb{YF}$ of length
$|u|=n$ where
$|u|:= a_1 + cdots + a_k$ and where $u=a_k cdots a_1$ is the
parsing of $u$ into its digits $a_1, dots, a_k in {1,2 }$.
The adjective fibonacci reflects the fact that the cardinality of $Bbb{YF}_n$
is the $n$-th fibonacci number. I will skip defining the poset structure
on $Bbb{YF}$ and instead I point the readers to the Wikipedia page
https://en.wikipedia.org/wiki/Young–Fibonacci_lattice. Suffice it to
say that when endowed with an appropriate partial order $unlhd$ the set $Bbb{YF}$ becomes a ranked, modular (but not distributive), $1$-differential lattice. R. Stanley’s $1$-differential property (see https://en.wikipedia.org/wiki/Differential_poset) is key here because it implies that the function
$mu^{(n)}_mathrm{P}: Bbb{YF}_n longrightarrow Bbb{R}_{>0}$
defined by

begin{equation}
begin{array}{ll}
mu^{(n)}_mathrm{P}(u)
&displaystyle := {1 over {n!}} , dim^2(u) quad text{where} \
dim(u)
&displaystyle :=
# left{
begin{array}{l}
text{all saturated chains $(u_0 lhd cdots lhd u_n)$ in $Bbb{YF}$} \
text{starting with $u_0 = emptyset$ and ending at $u_n =u$}
end{array}
right}
end{array}
end{equation}

is a strictly positive probability distribution
on $Bbb{YF}_n$ for each $n geq 0$. Furthermore these distributions are
coherent in the sense that the ratios

begin{equation}
tilde{mu}_mathrm{P}(u lhd v) :=
{mu^{(n+1)}_mathrm{P}(v) over {mu^{(n)}_mathrm{P}(u)}}
end{equation}

restrict to a probability distribution on the set of
covering relations $u lhd v$
(i.e. edges in the Hasse diagram of $Bbb{YF}$)
for any fixed $u in Bbb{YF}_n$.
We refer to
$mu^{(n)}_mathrm{P}$ as the Plancherel
measure
for $Bbb{YF}_n$. If $S:Bbb{YF} longrightarrow Bbb{R}_{geq 0}$
is some statistic let $langle S rangle_n$ denote its expectation
value with respect to the Plancherel measure, i.e.

begin{equation}
langle S rangle_n := sum_{|u|=n} , {dim^2(u) over {n!}} , S(u)
end{equation}

We may visualize a fibonacci word $u in Bbb{YF}$
using a profile of boxes
akin to the way one depicts a partition by its Young diagram.
The following example with $u = 12112211$
should illustrate the concept of a Young-Fibonacci diagram clearly. For emphasis
each digit of the fibonacci word $u$ is written directly underneath the corresponding column of boxes:

begin{equation}
begin{array}{cccccccc}
& Box & & & Box & Box & & \
Box & Box & Box & Box & Box & Box & Box & Box \
1 & 2 & 1 & 1 & 2 & 2 & 1 & 1
end{array}
end{equation}

A fibonacci word $u$ will be synonymous with its Young-Fibonacci diagram
and $Box in u$ will indicate membership of a box.
The hook length $mathrm{h}(Box)$ of a box $Box in u$
is defined to be $1$ whenever it is in the top row; otherwise $mathrm{h}(Box)$
equals $1$ plus the total number of boxes directly
above it and to its right. For example the hook lengths of the boxes of
$u = 12112211$ are indicated in the tableaux below:

begin{equation}
begin{array}{cccccccc}
& boxed{1 } & & & boxed{1 } & boxed{1 } & & \
boxed{11} & boxed{10} & boxed{8 } & boxed{7 }
& boxed{6 } & boxed{4 } & boxed{2 } & boxed{1 }
end{array}
end{equation}

These graphical conventions allows us to reformulate
the value of the Plancherel measure as a product of
hook-lenghts, i.e.

begin{equation}
mu^{(n)}_mathrm{P}(u) = prod_{Box , in , u} , {n! over
{mathrm{h}^2(Box)} }
end{equation}

This is a non-trivial observation made by R. Stanley in the course
of his work examining differential posets.

The $Bbb{YF}$-version of the Nekrasov-Okounkov partition function:
For a fibonacci words $u in Bbb{YF}$
define a $t$-statistic
$H_t(u) := prod_{Box , in , u} , big(mathrm{h}^2(Box) – t big)$ and the $Bbb{YF}$-Nekrasov-Okounkov partition function as

begin{equation}
begin{array}{ll}
F(z;t)
&displaystyle = sum_{n geq 0} {z^n over {n!}}
, langle H_t rangle_n \
&displaystyle = sum_{n geq 0} {z^n over {n!}} ,
sum_{|u|=n} , {dim^2(u) over {n!}} , H_t(u)
end{array}
end{equation}

It will be convenient, when dealing with expansions into elementary
symmetric polynomials, to make the change of variable $z mapsto -z$
and consider $F^vee(z;t)
:= F(-z;t)$
instead; the effect of this sign-change is to
replace the statistic $H_t(u)$ by $H^vee_t(u) := prod_{Box , in , u} , big(t -mathrm{h}^2(Box) big)$ in the definition of the partition
function. After expanding into elementary symmetric polynomial $E_k$ we
get

begin{equation}
H^vee_t(u) = sum_{k=1}^n , (-t)^{n-k} , E_k big( mathrm{h}^2(Box) big)_{Box , in , u}
end{equation}

and

begin{equation}
F^vee(z;t) =
sum_{k geq 0} , (-t)^{n-k} ,
overbrace{sum_{n geq 0}
, {z^n over {n!}} ,
langle E_k rangle_n}^{F^vee_k(z)}
end{equation}

which effectively reduces the problem of calculating $F^vee(z;t)$
to the problem of evaluating the expectation values
$langle E_k rangle_n$.

Evaluating expectation values:
Fibonacci words $u in Bbb{YF}_n$ with $n geq 2$ can be separated into two
disjoint groups: Those of the form $u=1v$ for $v in Bbb{YF}_{n-1}$
and those of the form $u=2v$ for $v in Bbb{YF}_{n-2}$. Depending on
whether the prefix of $u$ is $1$ or $2$ we can write down a recursive
formula for the value of $E_k(u) := E_k big( mathrm{h}^2(Box) big)_{Box , in , u}$ by analyzing the hook length(s) of the box(es) in the left-most
column, specifically:

begin{equation}
begin{array}{lll}
E_k(1v)
&= E_k(v) + n^2E_{k-1}(v)
&text{if} |v| = n-1 \
E_k(2v)
&= E_k(v) + (n^2+1)E_{k-1}(v) + n^2E_{k-2}(v)
&text{if} |v| = n-2
end{array}
end{equation}

Using the observation that $dim(1v) = dim(v)$ and
$dim(2v) = (|v| + 1)^2 dim(v)$ we may conclude

begin{equation}
langle E_k rangle_n
= left{
begin{array}{l}
displaystyle {1 over n} langle E_k rangle_{n-1}
+ {n-1 over n} langle E_k rangle_{n-2} \ \
displaystyle + n langle E_{k-1} rangle_{n-1} +
{(n-1)(n^2+1) over n} langle E_{k-1} rangle_{n-2} +
n(n-1) langle E_{k-2} rangle_{n-2}
end{array}
right.
end{equation}

If we set $sigma_k(n) := {1 over {n!}} , langle E_k rangle_n$ then
the above recursion can be rewritten as:

begin{equation}
n^2sigma_k(n) =
underbrace{sigma_k(n-1) + sigma_k(n-2)}_{text{homogeneous part}}
+
underbrace{n^2sigma_{k-1}(n-1)
+(n^2 +1)sigma_{k-1}(n-2) + n^2sigma_{k-2}(n-2)}_{text{inductive heap of inhomogeneous junk}}
end{equation}

which can be converted, using the usual yoga of generating functions, into the following second order inhomogeneous ODE for $F^vee_k(z) :=
sum_{n geq 0} sigma_k(n) z^n$

begin{equation}
z^2 , {d^2 over {dz^2}} , F^vee_k +
z , {d over {dz}} , F^vee_k +
big(z^2 + z big) , F^vee_k
=
G_{leq k}(z) + big( sigma_k(1) – sigma_k(0) big)z
end{equation}

where $G_{leq k}(z)$ is the generating function associated
to the heap of inhomogeneous junk which, by induction,
will have been previously evaluated. The homogeneous ODE
has two nice independent solutions $Y_1(z) = e^z$ and
$Y_2(z)= e^z int z^{-1} e^{-2z} dz$ whose Wronskian is
just $W={z^{-1}}$. One starts the inductive engine beginning
with $F^vee_0(z) = e^z$. For $k=1$ its not hard to see that
$sigma_1(1)=1$ and $sigma_1(0)=0$ while

begin{equation}
begin{array}{ll}
displaystyle G_{leq 1}(z)
&displaystyle = {z^2 over {1-z}} +
2 sum_{n geq 2} , n^2 z^n \
&displaystyle = {z^2 over {1-z}} +
2z , Bigg( {1+z over {(1-z)^3}} , – , 1 Bigg)
end{array}
end{equation}

so the ODE for $F^vee_1(z)$ becomes

begin{equation}
z^2 , {d^2 over {dz^2}} , F^vee_1 +
z , {d over {dz}} , F^vee_1 +
big(z^2 + z big) , F^vee_1
=
z + G_{leq 1}(z)
end{equation}

By variation of parameters, a particular inhomogeneous solution is

begin{equation}
begin{array}{rl}
displaystyle Y_mathrm{particular}(z)
&displaystyle = V_1(z) cdot e^z + V_2(z) cdot
e^z overbrace{int {dz over z} , e^{-2z} }^{gamma(z)} \
displaystyle V_1(z)
&displaystyle = -int z , e^z , gamma(z) ,
Big(z + G_{leq 1}(z) Big) , dz \
displaystyle V_2(z)
&displaystyle = int z , e^z ,
Big(z + G_{leq 1}(z) Big) , dz
end{array}
end{equation}

Question: Has the linear recurrence satisfied by $sigma_k(n)$
or else the hierarchy of 2nd order inhomogeneous ODEs been
studied ?

thanks, ines.

iOS: control (ensure latest) app version on supervised iPad

My goal: setup iPads, so that an app we develop is always auto-updated.

Context: we provide our clients with an iPad that will run our app. We want to ensure that this app is always up to date – ideally it should auto-update also on cellular connection.

We are able to set the devices up with a USB connection (maybe using Apple Configurator?).

We are already using Expo, which is a framework that allows “in app” updates over “in store” updates, but a full app-store update is still required sometimes.

What is the easiest way to ensure auto-updates?

Thanks!

android – auth.signInWithEmailAndPassword – Firebase authentication using the latest version – 20.0.2 is giving error

With the firebase version-19.2.0 , authentication works fine.

On using firebase(20.0.2 version) authentication,
auth.signInWithEmailAndPassword(email, password).addOnCompleteListener { task->
following error is shown.

com.google.firebase.FirebaseException: An internal error has occurred. ( socket failed:EPERM (Operation not permitted) ) at com.google.android.gms.internal.firebase-auth-api.zztt.zza(com.google.firebase:firebase-auth@@20.0.2:4) at com.google.android.gms.internal.firebase-auth-api.zzvb.zza(com.google.firebase:firebase-auth@@20.0.2:9) at com.google.android.gms.internal.firebase-auth-api.zzvc.zzk(com.google.firebase:firebase-auth@@20.0.2:1) at com.google.android.gms.internal.firebase-auth-api.zzuz.zzh(com.google.firebase:firebase-auth@@20.0.2:25) at com.google.android.gms.internal.firebase-auth-api.zztq.zzk(com.google.firebase:firebase-auth@@20.0.2:1) at com.google.android.gms.internal.firebase-auth-api.zzoi.zza(com.google.firebase:firebase-auth@@20.0.2:2) at com.google.android.gms.internal.firebase-auth-api.zzvg.zza(com.google.firebase:firebase-auth@@20.0.2:26) at com.google.android.gms.internal.firebase-auth-api.zzuq.zzf(com.google.firebase:firebase-auth@@20.0.2:4) at com.google.android.gms.internal.firebase-auth-api.zzpy.zzj(com.google.firebase:firebase-auth@@20.0.2:5) at com.google.android.gms.internal.firebase-auth-api.zztu.zzi(com.google.firebase:firebase-auth@@20.0.2:8) at com.google.android.gms.internal.firebase-auth-api.zzsk.zzd(Unknown Source:15) at com.google.android.gms.internal.firebase-auth-api.zzsj.accept(Unknown Source:6) at com.google.android.gms.common.api.internal.zacj.doExecute(com.google.android.gms:play-services-base@@17.1.0:2) at com.google.android.gms.common.api.internal.zaf.zac(com.google.android.gms:play-services-base@@17.1.0:6) at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zac(com.google.android.gms:play-services-base@@17.1.0:167) at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zab(com.google.android.gms:play-services-base@@17.1.0:139) at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zabg(com.google.android.gms:play-services-base@@17.1.0:99) at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zabe(com.google.android.gms:play-services-base@@17.1.0:40) at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.onConnected(com.google.android.gms:play-services-base@@17.1.0:19) at com.google.android.gms.common.internal.zaf.onConnected(com.google.android.gms:play-services-base@@17.1.0:2) at com.google.android.gms.common.internal.BaseGmsClient$zzg.zzj(com.google.android.gms:play-services-basement@@17.1.0:24) at com.google.android.gms.common.internal.BaseGmsClient$zza.zza(com.google.android.gms:play-services-basement@@17.1.0:12) at com.google.android.gms.common.internal.BaseGmsClient$zzb.zzo(com.google.android.gms:play-services-basement@@17.1.0:11) at com.google.android.gms.common.internal.BaseGmsClient$zzc.handleMessage(com.google.android.gms:play-services-basement@@17.1.0:49) at android.os.Handler.dispatchMessage(Handler.java:107) at com.google.android.gms.internal.common.zzi.dispatchMessage(com.google.android.gms:play-services-basement@@17.1.0:8) at android.os.Looper.loop(Looper.java:214) at android.os.HandlerThread.run(HandlerThread.java:67) 2021

What version of Thunderbird is the latest stable version provided by Ubuntu software?

According to Mozilla, the current stable version of Thunderbird is 78.7.1. According to Alan Pope in his blog on 12/10/2020, the current version is 82. When I started running Ubuntu 18.04 last January, I downloaded TB from the Ubuntu software and got v68. At the end of December, I upgraded to 20.04 and ended up with TB v84. A few weeks later, v84 was upgraded (I don’t know how because I didn’t actively perform an upgrade) to 86.01b.

I had no desire to have a beta release of anything and there were problems with the beta release that I wanted to get free of so I ran the following:
sudo snap refresh thunderbird –channel=stable

and now have TB 78.7.1.

Are version numbers of TB software available from Mozilla different from those available from Ubuntu? If not, why does Pope say the current version is 82?

If I choose to install one of the apps found in the Ubuntu Software app, what is the source of the app? I assume Canonical

Here is what I find searching for thunderbird in terminal using snap list:

thunderbird 78.7.1 110 latest/stable canonical

and whereis: /snap/bin/thunderbird

Can’t scroll website over product image on mobile version

I was testing my site on my mobile phone and I noticed I can’t scroll when passing over a product image on the product description page.

Here’s the same issue on this example:

Home 1


Try and scroll over the featured shoe image on mobile version.

Desktop version has a zoom hover effect and I think there’s a script of it making conflict on mobile because I tried clearing the html classes and attributes of related tags on the inspector but nothing changed.
I also deleted the class=”zoomContainer” element that’s the zoom viewport but still.

Looking for some snippet to deactivate this, even in desktop version also if it’s necessary, or whatever other solution around the corner.

Thanks!

sql server – Can’t restore database with (apparently) same version

The two managed types of SQL Server in Azure (SQL Database and Managed Instance) are version 12.0.2000.8. Don’t be fooled by the low version number, it is always higher than on-prem meaning you can never restore an “Azure SQL” backup to on-prem.
You cannot perform a backup from SQL Database, but you can do a copy only backup from Managed Instance. This would be my guess.

Perhaps the error message is incorrect, and should have said that backup is from 12.00.2000

If it is the 3:rd type of “SQL Server in Azure”, a VM with SQL Server installed, then it is of any version you like. This should be restoreable.

So, find out what type of SQL you have in Azure, then take it from there.