So this seems simple, but I've been googling for days.   An install of gitlab went wrong, so I tried to purge it to reinstall, however I get this:  dpkg: error processing package gitlab-ce (--remove):     package is in a very bad inconsistent state; you should     reinstall it before attempting a removal   However trying to install it causes it to hang at 6%, the problem it had initially. I'm no longer needing gitlab at all (I'm using gitea on a different machine), but this problem is preventing me from installing anything at any time I use apt to install something it also wants to install gitlab at the same time, which again hangs at 6%.  For example sudo apt-get install curl shows this:  Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed:     gitlab-ce libcurl4 The following packages will be upgraded:     curl gitlab-ce libcurl4 3 upgraded, 0 newly installed, 0 to remove and 65 not upgraded. 1 not fully installed or removed. Need to get 472 MB of archives. After this operation, 1460 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 curl amd64 7.58.0-2ubuntu3.5 [159 kB] Get:2 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libcurl4 amd64 7.58.0-2ubuntu3.5 [214 kB] Get:3 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu bionic/main amd64 gitlab-ce amd64 11.5.0-ce.0 [472 MB] Fetched 287 MB in 18s (16.3 MB/s) (Reading database ... 54181 files and directories currently installed.) Preparing to unpack .../gitlab-ce_11.5.0-ce.0_amd64.deb ...
I can't update my system because it freezes while installing a third-party update (zramswap-enabler)! Sometimes I get the following message in Update manager:  Could not initialize the package information An unresolvable problem occurred while initializing the package information. Please report this bug against the 'update-manager' package and include the following error message: E:The package zramswap-enabler needs to be reinstalled, but I can't find an archive for it.  I tried to remove the zramswap-enabler, but it's impossible because I get the following message: dpkg: error processing zramswap-enabler (--remove):  Package is in a very bad inconsistent state - you should  reinstall it before attempting a removal. Errors were encountered while processing:  zramswap-enabler E: Sub-process /usr/bin/dpkg returned an error code (1)  Actually I would really reinstall that package, but it is unable to do it! If I remove this third-party PPA then the system is warning me about a very very serious problem. So why can I not install/reinstall/remove/update this package and why freezes the updater if I try to update?
When I create a folder or copy files, after the operation finishes I have to manually refresh the Explorer window (F5). For example, when I create a folder, I don't see the "New Folder" until I hit F5.  Does anyone have any idea how to fix this? I need to find algorithm that can calculate centroid A (aka gravity center, geometric center, center of mass) from the figure where circles T1,T2,T3,T4,T5,..,Tn intersect AND length of line R from centroid to farthest corner of mentioned figure   Following information is given:   T1   Latitude    =   56.999883   Longitude   =   24.144473   Radius  =   943 T2   Latitude    =   57.005352   Longitude   =   24.151168   Radius  =   857 T3   Latitude    =   57.005352   Longitude   =   24.163356   Radius  =   714 T4   Latitude    =   56.999042   Longitude   =   24.168506   Radius  =   714 T5   Latitude    =   56.994226   Longitude   =   24.15709    Radius  =   771   Result should look like this:  A Latitude = XX.XXXXXXX    Longitude = XX.XXXXXXX  Radius = XX    As you probably already figured out, I am working on software that can find device location by closest Wifi Access Points or Mobile Base stations, as number of access points or base stations might change, I need an algorithm that can adapt to uncertain amount of points.  There are some similar questions  and , but none of them exactly answers to my question. I've been very into acoustics lately, specifically the harmonic series. I find it fascinating how the harmonic series works as a sort of guideline to harmony, and how we base tuning systems on trying to estimate the intervals from the harmonic series.  As you've probably gathered already, I know close to nothing about acoustics. But I would love an acoustic textbook that's suitable for dummies like myself. How do I get timestamp from e.g. 22-09-2008? How can I automatically determine fonts used in an image or PDF? I've connected a USB to Serial bridge dongle, and running dmesg | grep tty outputted the following:  [    0.000000] console [tty0] enabled [603199.380677] usb 2-2: cp210x converter now attached to ttyUSB0   So now I'm trying to write to it as per  by running the following:  cat hello.txt &gt; /dev/ttyUSB0   and   sudo cat hello.txt &gt; /dev/ttyUSB0   But both result in the following error:  bash: /dev/ttyUSB0: Permission denied   What am I doing wrong?  Thanks I am trying to sniff on a custom SPI-like bus protocol, which uses a unified bidirectional data line instead of separate MISO/MOSI. To make sense of the communication, I need to split it up into unidirectional lines before feeding them to my logic analyzer. Otherwise I wouldn't be able to see which device is responsible for which part of the signal. Since my devices won't talk to each other unless the protocol is carried out correctly, it's obvious that the bus splitting device has to be transparent to the actual agents communicating.  I tried to construct a bus splitting device, but failed as described . Since this question was maybe too specific and has not been answered, I want to ask more generally: Is there a bidirectional bus splitter that is able to split  into four wire SPI? Where could I buy such a device? (This seems similar to  question, only that I'm not talking about two really different protocols, so the answer does not apply). In principle only getting one direction would also suffice, since I could just subtract it from the full signal in order to retrieve the other half. And I'm also only interested in the master side of the communication.    The  seems to be a good candidate. Although it's advertised for use with I2C, it seems to be agnostic to the actual protocol on the lines. (As it does not even differentiate between DATA and CLOCK line for I2C.)     Splits I2C-bus signal into pairs of forward/reverse Tx/Rx, Ty/Ry signals for interface with opto-electrical isolators and similar devices that need unidirectional input and output signal paths.   As my devices operate on SPI mode 3 (polarity 1, idling on HIGH), the implementation of the receive pin should work:        sense the voltage state of the I2C-bus pin Sx (or Sy) and transmit this state to the pinTx (Ty respectively), and   sense the state of the pin Rx (Ry) and pull the I2C-bus pin LOW whenever Rx (Ry) is LOW.      But I am still puzzled on how this would actually work in sniffing this bidirectional bus. I could connect one device with the I2C line and grab its MOSI at Tx and MISO at Rx, but I would eventually have to connect both lines before feeding it to the other device, therefore making it impossible to separate the signals at my logic analyzer again. How can I connect the Tx/Rx for the slave while still being able to read them separately with a third device?  Edit: I now think this is actually not helping at all, since it leaves me with the same splitting issue as with out the device. I already have separate master and slave lines, I just don't know how to join them while still retrieving the separate directions.    I also stumbled upon the . It seems like this is a device designed for sniffing on buses, but I don't think it can help me in my case. Is there a mode where I can use it as a bridge on a bidirectional line and grab unidirectional signals off of it simultaneously?    Edit: I found this  which seems related to the issue. This does supposedly split the bidirectional line to feed it to two unidirectional isolators. The question is: Does this work for my setup? It describes the I2C lines being open-drain, whereas my lines are open-collector and also I'm not entirely sure if I could just leave out the isolator part and grab the signals from the lines or if these would have to be also hooked up to some transistor or be pulled high. Relationship between SVD and PCA. How to use SVD to perform PCA? Principal component analysis (PCA) is usually explained via an eigen-decomposition of the covariance matrix. However, it can also be performed via singular value decomposition (SVD) of the data matrix $\mathbf X$. How does it work? What is the connection between these two approaches? What is the relationship between SVD and PCA?  Or in other words, how to use SVD of the data matrix to perform dimensionality reduction? What would make a question popular with high views? I was wondering what might be making my questions less attractive to users?  I get very low views most of the time. What should be done to increase a question's popularity? Why couldn't the Jedi detect Senator Palpatine as having powers? In Return of the Jedi, when trying to sneak into the base on a shuttle, Luke said he senses Darth Vader's presence and said he shouldn't have come lest he jeopardize the mission. Darth Vader also sensed Luke, but let him in anyways. Also, Yoda and Obi-Wan could detect the Force in young Anakin.  So if Jedi and Sith can detect each other, why couldn't they detect Senator Palpatine to begin with? It seems like a giant plot hole. I'm using Dataloader to Upsert a Child Account to Parent Account using an external ID.  When the Upsert is complete, the Child overwrites the parent, it's not not connecting the Child Account to the Parent Account.  ((See Answer Below)) Why can in-class initializers only use = or {}? Do there exist an infinite number of integer-solutions $(x,y,z)$ of $x^x\cdot y^y=z^z$ where $1\lt x\le y$? Question : Do there exist an infinite number of integer-solutions $(x,y,z)$ of $x^x\cdot y^y=z^z$ where $1\lt x\le y$ ?  Motivation : After struggling to find a solution, I've just got one solution, which is  $$(x,y,z)=(1679616, 2985984, 4478976).$$  In the following, I'm going to write how I got this solution.  Letting $d$ be the greatest common divisor of $x,y,z$, we can represent $$x=ad, y=bd, z=cd$$ where $a,b,c$ are coprimes with each other. Then, we get $$d^{a+b-c}\cdot a^a\cdot b^b=c^c.$$  In the following, let's consider without the condition $x\le y$. Here, I suppose  $$a=2^m, b=3^n, a+b-c=1.$$  (As a result, this supposition works.)  Then, we get $$d=\frac{c^c}{2^{ma}\cdot 3^{nb}}.$$  Hence, letting $c=2^k\cdot 3^l$, if  $$kc\ge ma=m\cdot 2^m, lc\ge nb=n\cdot 3^n,$$ then $d$ is an integer.  Since $(m,n)=(4,2)$ satisfies the above conditions, then we get $d=2^8\cdot 3^6=186624.$ Hence we can get  $$x=9d=2^8\cdot 3^8=1679616, y=16d=2^{12}\cdot 3^6=2985984, z=24d=2^{11}\cdot 3^7=4478976.$$ Note that here I interchanged $x$ and $y$.  P.S : I was surprised to get this solution because I got this almost by chance. So, I don't know the other solutions. If you have any helpful information, please teach me. I want to set a folder such that anything created within it (directories, files) inherit default permissions and group.    Lets call the group "media".  And also, the folders/files created within the directory should have g+rw automatically. How are Python's Built In Dictionaries Implemented? Does anyone know how the built in dictionary type for python is implemented?  My understanding is that it is some sort of hash table, but I haven't been able to find any sort of definitive answer. Union of a finite set and a countably infinite set is countably infinite Ok, here is the problem statement:     Prove that if $S$ is any finite set of real numbers, then the union of $S$ and the integers is countably infinite.   This seems pretty obvious to me, knowing that 2 countable sets are countable.  But is there some step by step way to prove this?  Like do I need to prove bijectivity or something?  Thanks! Assume: $p$ is a prime that satisfies $p \equiv 3 \pmod 4$  Show: $x^{2} \equiv -1 \pmod p$ has no solutions $\forall x \in \mathbb{Z}$.  I know this problem has something to do with Fermat's Little Theorem, that $a^{p-1} \equiv 1\pmod p$. I tried to do a proof by contradiction, assuming the conclusion and showing some contradiction but just ran into a wall. Any help would be greatly appreciated. Arriving at a different port of entry in the same state in USA? I am a girl in my early twenties traveling to USA from India and in my visa application I have provided the contact address for a relative in San Francisco, and their invitation letter. I would like to visit LA first. Will I face problems during immigration if I land in LA (with an immediate on wards ticket to SF)? I dont plan to get on the flight from LA to SFO.  Initially I was planning to fly to SFO from India and then fly to LA immediately after completing immigration at SFO airport. Calculating sequential numbers into sorted table using ArcGIS Desktop? Is there a way to calculate a sorted field with sequential numbers?  I have seen  that outlines how to calculate sequential numbers, but this is always calculated on FID order, not on sorted order.  #Pre-logic Script Code: rec=0 def autoIncrement():      global rec      pStart = 1       pInterval = 1      if (rec == 0):           rec = pStart       else:           rec += pInterval       return rec  #Expression: autoIncrement()   An example of what I'm trying to do.  I've used an advanced sort to sort by year, month, day, and now want to have sequential numbers in the Seq field.  You'll see that my OBJECTID field is not in order, so the above code won't work.    Can this be done either in the Field Calculator or using an Update Cursor in arcpy? I have a random sample of Bernoulli random variables $X_1 ... X_N$, where $X_i$ are i.i.d. r.v. and $P(X_i = 1) = p$, and $p$ is an unknown parameter.  Obviously, one can find an estimate for $p$: $\hat{p}:=(X_1+\dots+X_N)/N$.  My question is how can I build a confidence interval for $p$?