Libreoffice has no menubar in Kubuntu 18.04 if Application button (for global menus) is added on window titlebar

It looks like a bug but I am not sure which program is to blame..

In Plasma 5.12 the option to add global menus in window titlebar has been removed. There is a panel widget that adds global menus to the panel, but also global menus are still available in the window titlebar as a button. I have added that button with global menus as indicated here. That’s under System Settings > Application Style > Windows Decorations > (tab) Buttons:

enter image description here

The idea is to get the global menus into a left-side button on the window upper margin; like for example in Chrome:

enter image description here

When this is done, Libreoffice has no menubar anymore. Adding the Menubar button and using it has no effect.

enter image description here

But once the “Application” button is dragged away from the titlebar at System Settings > Application Style > Windows Decorations > (tab) Buttons, the menubar in Libreoffice comes back.

enter image description here

Integer linear programming can’t find global minimum

I was working with Project Euler Problem 418 using Mathematica and got in trouble.

I wrote a function to find the unique factorization triple which minimizes c / a for integer n.

FactorizationTriple[n_] :=   Block[{factor, base, exponent, l, e, varmat, vars, cons1, cons2, cons3, solve, a, b, c},   factor = FactorInteger[n];   base = factor[[All, 1]];   exponent = factor[[All, 2]];   l = Length[factor];   varmat = Table[e[i, j], {i, 1, 3}, {j, 1, l}];   vars = Flatten[varmat];   cons1 = Thread[0 <= vars];   cons2 = Thread[exponent == Total[varmat, {1}]];   cons3 = {varmat[[1]].N[Log[base]] <= varmat[[2]].N[Log[base]] <= varmat[[3]].N[Log[base]]};   solve = FindMinimum[{varmat[[3]].N[Log[base]] - varmat[[1]].N[Log[base]], Join[cons1, cons2, cons3], Element[vars, Integers]}, vars];   a = Times @@ (Power @@@ ({base, Table[e[1, j], {j, 1, l}] /. solve[[2]]}\[Transpose]));   b = Times @@ (Power @@@ ({base, Table[e[2, j], {j, 1, l}] /. solve[[2]]}\[Transpose]));   c = Times @@ (Power @@@ ({base, Table[e[3, j], {j, 1, l}] /. solve[[2]]}\[Transpose]));   {a, b, c}] 

Since both f and cons in FindMinum are linear, I thought it uses Method->"LinearProgramming" and I expected it to return a global minimum.

FactorizationTriple does work when n = 165 or 100100 or 20!, but it can’t give me the correct answer when n = 43!:

AbsoluteTiming[FactorizationTriple[43!]] {1044.17, {392385912744443904, 392388272221065120, 392389380337500000}} 

The correct answer is {a, b, c} = {392386762388275200, 392388272221065120, 392388530688000000}.

Questions:

  1. Should I use NMinimize or LinearProgramming instead? (I had some try but failed.)
  2. How to set the options in FindMinum?
  3. How to improve the efficiency of FactorizationTriple? (It’s too slow now.)

referencia de um var dentro do for para global

então, eu queria saber com referencio as variaveis datas, listaComTudo, nomesDespesas e trasformalas em globais para poder resolver um erro de “UnboundLocalError: local variable ‘nomesDespesas’ referenced before assignment”

    @app.route("/download", methods=['GET', 'POST'])     def orac_detal():                     global orac_detal                                     state = {'gera':0, 'gera_total_csv':0, 'gera_orcamento':0, 'gera_total':0, 'taxas':0, 'gera_agrupamento':0, 'orac_detal':1}                 m = np.zeros((156,96))                    for loja in lojas:                     if os.path.isfile("./.pickles/orcamentoAux_"+str(loja)+".pickle"):                         with open(r"./.pickles/orcamentoAux_"+str(loja)+".pickle", "rb") as input_file:                             foo = pickle.load(input_file)                             datas = foo['datas'] # lista com todas as datas, para ser o cabeçalho da planilha                             listaComTudo = foo['listaComTudo'] # lista de lista, em que cada lista interna tem os dados de uma despesa                             nomesDespesas = foo['nomesDespesas'] # lista com o nome de todas as despesas, para ser inserida no final usando a função de colocar na primeira coluna                 datas=datas, listaComTudo=listaComTudo, nomesDespesas=nomesDespesas                  for i in range(len(listaComTudo)):                     m[i] += listaComTudo[i]                  for i in range(len(listaComTudo)):                     nomesDespesas[i] = nomesDespesas[i].replace(","," ")                     listaComTudo[i] = [nomesDespesas[i]] + listaComTudo[i]                  dicionario = {}                 for i in range(len(nomesDespesas)):                     chave = nomesDespesas[i][23:]                     dicionario[chave] = m[i]                    df = pd.DataFrame.from_dict(data=dicionario, orient='index', columns=datas)                 df.to_csv('despesas_detal.csv ' )  def download_file_named_in_unicode():     return excel.make_response_from_array('despesas_detal.csv', "xls",                                           file_name=u"despesas_detal") 

Does this algebra have finite global dimension ? (Human vs computer)

Usually computers can calculate the global dimension of a finite dimensional quiver algebra much faster than humans. But in this case a high end computer (calculating for 3 weeks) was not able to determine whether this algebra has global dimension 3 or not.

Let $ A=K\langle a,b\rangle/I$ with $ I$ the ideal generated by $ \langle a^2, ab+b^2-aba, ab^2, bab, ab+b^2+b^2a, b^3\rangle$ over a field $ K$ of characteristic not two. Let $ D=\operatorname{Hom}_K(-,K)$ the natural duality.

This algebra is a local non-Gorenstein algebra that was found by Jan Geuenich as a rare algebra with $ \operatorname{Ext}_A^1(D(A),A)=0$ . Let $ \tau_2 := \tau \Omega^1$ . Now let $ M:=A \oplus D(A) \oplus \tau_2(D(A)) \oplus \tau_2^2(D(A)) \oplus \tau_2^3(D(A))$ and $ B:=\operatorname{End}_A(M)$ .

The module $ M$ has vector space dimension 33 and the algebra $ B$ has vector space dimension 165.

It can be shown that $ M$ is a precluster tilting object in the sense of Iyama and Solberg – Auslander-Gorenstein algebras and precluster tilting and that the algebra has dominant dimension equal to the Gorenstein dimension equal to three. But the computer was not able to determine whether $ B$ has finite global dimension (the global dimension is either 3 or infinite).

Thus the question:

Does $ B$ have finite global dimension?

In case the answer is positive it would be the first 2-cluster tilting object for a local algebra in history! (at least to my knowledge)

I can think of two ways to determine the answer. The first is to check whether $ M$ is a 2-cluster tilting object directly but $ A$ is representation-infinite and one needs good knowledge of the module category of $ A$ for that. The other way would be to calculate the quiver and relations of $ B$ but this looks like a cruel torture when even a high end computer can not do it. So I hope there might be a good trick. $ B$ has Cartan determinant 1, which makes it look like the global dimension could really be finite.

A positive answer would also answer this old question: Cluster-tilting object for a local non-selfinjective algebra .

Can one always find a bigger global resolution

Let $ X$ be a scheme. Let $ E$ be a perfect complex of coherent sheaves on $ X$ and suppose it admits two global resolutions $ F$ and $ F’$ . By global resolution I mean that both $ F$ and $ F’$ are quasi-isomorphic to $ E$ and both are complexes of vector bundles.

$ \bf{Question:}$ Is it possible to find a global resolution $ H$ of $ E$ such that $ F, F’$ map mono-morphically into $ H$ ?

I know how to do this when $ E$ has perfect amplitude $ [0, 1]$ but I don’t see how to generalize to say $ [0, n]$ for arbitrary $ n$ .

Error “NameError: global name ‘lqi’ is not defined” al utilizar la función lqi() de control.matlab en python

necesito utilizar funciones de Matlab en python, específicamente funciones de teoría de control. Para ello estoy utilizando la documentacion respectiva encontrada en el siguiente link: http://python-control.sourceforge.net/manual-0.5a/matlab_strings.html#lqr-lqg-design

Ahora bien, al intentar utilizar la funcion lqi() ob tengo el error:

“NameError: global name ‘lqi’ is not defined”

Parte del código es el siguiente:

import numpy as np from control.matlab import *

def lqrlong(A,B,C,D):

Cnew2 = np.matrix([[1,0,0,0,0],[0,0,0,0,1]])    Dnew2=np.matrix([[0,0],[0,0]])   n=np.size(B,0)# cantidad de filas m=np.size(B,1)#cantidad decolumnas print (n) print (m) Znm=np.zeros((n,m), dtype=int) Znn=np.zeros((n,n), dtype=int) Zmn=np.zeros((m,n), dtype=int) Zmm=np.zeros((m,m), dtype=int)   Wlqrq=np.matrix([[0.01,0],[0,0.05]]);#Ref   Wlqrqb=np.matrix([[0.05,0,0,0,0],[0,0.01,0,0,0],[0,0,0.01,0,0],[0,0,0,0.01,0],[0,0,0,0,2.5]]);#Estados  Wlqrr=np.matrix([[20],[20]]);#Salidas  Q =[np.concatenate((Wlqrqb,Znm),axis=1),np.concatenate((Zmn,Wlqrq),axis=1)]; #print(Q)  #R =diag(Wlqrr); R=np.matrix([[20,0],[0,20]]);#Salidas   sys = ss(A,B ,Cnew2,Dnew2 );  [Kr] =lqi(sys,Q,R); 

AlonA=np.matrix([[0.068,-8.917,8.245,-9.779,0],[-0.979,-185.221,-0.051,-0.061,0],[1.686,-268.510,-3.814,0,0],[0,0,1,0,0],[-0.0062,0.999,0,-9.127,0]]);#A

BlonB=np.matrix([[-2.552,-0.283],[-2.312,0],[-24.53,0],[0,0],[0,0]]);#B

lqrlong(AlonA,BlonB,1,1)

Global program design literature?

For work I’ll be making a program that consists of different tools to manipulate or add stuff to a 3D world. For instance, with one tool you can add meshes to the world, with another you can measure distances, …

I’m now wondering if there is any literature I can read to help me with designing a robust and extensible system for this, and future projects.

So what is your go-to reference for global code-structure/design concepts and ideas?

Thanks!

Note: I hope Software Engineering is the right place to ask this, I fear this might be a too abstract question. If not, where would you suggest to ask this?