Library/tool for drawing ternary/triangle plots

Question: I need to draw ternary/triangle plots representing mole fractions (x, y, z) of various substances/mixtures (x + y + z = 1). Each plot represents iso-valued substances, e.g. substances which have the same melting point. The plots need to be drawn on the same triangle with different colors/symbols and it would be nice if I could also connect the dots.
I have looked at matplotlib, R and gnuplot, but they don't seem to be able to draw this kind of plot. The 3rd party ade4 package for R seems to be able to draw it, but I'm not sure if I can draw multiple plots on the same triangle.
I need something that runs under Linux or Windows. I'm open to any suggestions, including libraries for other languages, e.g. Perl, PHP, Ruby, C# and Java.
Comment: There are a few more R options than listed below; try `library(sos); findFn("{ternary plot}")`
Comment: an R package I have just authored does what you require (and more) it is based off ggplot, website is www.ggtern.com
Answer: Created a very basic script for generating ternary (or more) plots.  No gridlines or ticklines, but those wouldn't be too hard to add using the vectors in the "basis" array.

from pylab import *

def ternaryPlot(
            data,

            # Scale data for ternary plot (i.e. a + b + c = 1)
            scaling=True,

            # Direction of first vertex.
            start_angle=90,

            # Orient labels perpendicular to vertices.
            rotate_labels=True,

            # Labels for vertices.
            labels=('one','two','three'),

            # Can accomodate more than 3 dimensions if desired.
            sides=3,

            # Offset for label from vertex (percent of distance from origin).
            label_offset=0.10,

            # Any matplotlib keyword args for plots.
            edge_args={'color':'black','linewidth':2},

            # Any matplotlib keyword args for figures.
            fig_args = {'figsize':(8,8),'facecolor':'white','edgecolor':'white'},
        ):
    '''
    This will create a basic "ternary" plot (or quaternary, etc.)
    '''
    basis = array(
                    [
                        [
                            cos(2*_*pi/sides + start_angle*pi/180),
                            sin(2*_*pi/sides + start_angle*pi/180)
                        ]
                        for _ in range(sides)
                    ]
                )

    # If data is Nxsides, newdata is Nx2.
    if scaling:
        # Scales data for you.
        newdata = dot((data.T / data.sum(-1)).T,basis)
    else:
        # Assumes data already sums to 1.
        newdata = dot(data,basis)

    fig = figure(**fig_args)
    ax = fig.add_subplot(111)

    for i,l in enumerate(labels):
        if i >= sides:
            break
        x = basis[i,0]
        y = basis[i,1]
        if rotate_labels:
            angle = 180*arctan(y/x)/pi + 90
            if angle > 90 and angle <= 270:
                angle = mod(angle + 180,360)
        else:
            angle = 0
        ax.text(
                x*(1 + label_offset),
                y*(1 + label_offset),
                l,
                horizontalalignment='center',
                verticalalignment='center',
                rotation=angle
            )

    # Clear normal matplotlib axes graphics.
    ax.set_xticks(())
    ax.set_yticks(())
    ax.set_frame_on(False)

    # Plot border
    ax.plot(
        [basis[_,0] for _ in range(sides) + [0,]],
        [basis[_,1] for _ in range(sides) + [0,]],
        **edge_args
    )

    return newdata,ax

if __name__ == '__main__':
    k = 0.5
    s = 1000

    data = vstack((
        array([k,0,0]) + rand(s,3),
        array([0,k,0]) + rand(s,3),
        array([0,0,k]) + rand(s,3)
    ))
    color = array([[1,0,0]]*s + [[0,1,0]]*s + [[0,0,1]]*s)

    newdata,ax = ternaryPlot(data)

    ax.scatter(
        newdata[:,0],
        newdata[:,1],
        s=2,
        alpha=0.5,
        color=color
        )
    show()

Answer: R has an external package called VCD which should do what you want.
The documentation is very good (122 page manual distributed w/ the package); there's also a book by the same name, Visual Display of Quantitative Information, by the package's author (Prof. Michael Friendly).
To create ternary plots using vcd, just call ternaryplot() and pass in an m x 3 matrix, i.e., a matrix with three columns.
The method signature is very simple; only a single parameter (the m x 3 data matrix) is required; and all of the keyword parameters relate to the plot's aesthetics, except for scale, which when set to 1, normalizes the data column-wise.
To plot data points on the ternary plot, the coordinates for a given point are calculated as the gravity center of mass points in which each feature value comprising the data matrix is a separate weight, hence the coordinates of a point V(a, b, c) are
V(b, c/2, c * (3^.5)/2

To generate the diagram below, i just created some fake data to represent four different chemical mixtures, each comprised of varying fractions of three substances (x, y, z). I scaled the input (so x + y + z = 1) but the function will do it for you if you pass in a value for its 'scale' parameter (in fact, the default is 1, which i believe is what your question requires). I used different colors & symbols to represent the four data points, but you can also just use a single color/symbol and label each point (via the 'id' argument).
Comment: that's too bad--i think you might have enjoyed using that library otherwise. (Quite a coincidence that when i was typing my answer above, i was sitting in the Bucharest airport on my way back to Spain from a climbing trip in the gorgeous Fagaras mountains.) I don't think i have the rep to add an 'r' tag to your Q, so if you agree, perhaps add that tag when you have a chance.
Comment: It definitely looks interesting, too bad it has so many dependencies which I don't have on my Fedora 12 machine :-( Anyway thank you for answering and +1 from me.
Comment: I managed to install it on Fedora 12 by running R and typing at the R prompt `install.packages(c("vcd"))`. Also the examples from the `ternaryplot` manual page worked like a charm. Thank you again! As for the `r` tag, I haven't noticed your comment, otherwise I would have added it myself. P.S.: I'm glad that you enjoyed your climbing trip.
Answer: A package I have authored in R has just been accepted for CRAN, webpage is www.ggtern.com:
It is based off ggplot2, which I have used as a platform. The driving force for me, was a desire to have consistency in my work, and, since I use ggplot2 heavily, development of the package was a logical progression.
For those of you who use ggplot2, use of ggtern should be a breeze, and, here is a couple of demonstrations of what can be achieved.

Produced with the following code:
# Load data
data(Feldspar)

# Sort it by decreasing pressure
# (so small grobs sit on top of large grobs
Feldspar <- Feldspar[with(Feldspar, order(-P.Gpa)), ]

# Build and Render the Plot
ggtern(data = Feldspar, aes(x = An, y = Ab, z = Or)) +
#the layer
geom_point(aes(fill = T.C,
               size = P.Gpa,
               shape = Feldspar)) +
#scales
scale_shape_manual(values = c(21, 24)) +
scale_size_continuous(range = c(2.5, 7.5)) +
scale_fill_gradient(low = "green", high = "red") +

#theme tweaks
theme_tern_bw()  +
theme(legend.position      = c(0, 1),
      legend.justification = c(0, 1),
      legend.box.just      = "left") +

#tweak guides
guides(shape= guide_legend(order   =1,
                           override.aes=list(size=5)),
       size = guide_legend(order   =2),
       fill = guide_colourbar(order=3)) +

#labels and title
labs(size = "Pressure/GPa",
     fill = "Temperature/C") +
ggtitle("Feldspar - Elkins and Grove 1990")

Contour plots have also been patched for the ternary environment, and, an inclusion of a new geometry for representing confidence intervals via the Mahalanobis Distance.

Produced with the following code:
ggtern(data=Feldspar,aes(An,Ab,Or)) +
  geom_confidence(aes(group=Feldspar,
                      fill=..level..,
                      alpha=1-..level..),
                      n=2000,
                  breaks=c(0.01,0.02,0.03,0.04,
                           seq(0.05,0.95,by=0.1),
                           0.99,0.995,0.9995),
                  color=NA,linetype=1) +
  geom_density2d(aes(color=..level..)) +
  geom_point(fill="white",aes(shape=Feldspar),size=5) +
  theme_tern_bw() +
  theme_tern_nogrid() +
  theme(ternary.options=element_ternary(padding=0.2),
                        legend.position=c(0,1),
                        legend.justification=c(0,1),
                        legend.box.just="left") +
  labs(color="Density",fill="Confidence",
   title="Feldspar - Elkins and Grove 1990 + Confidence Levels + Density") +
  scale_color_gradient(low="gray",high="magenta") +
  scale_fill_gradient2(low="red",mid="orange",high="green",
                       midpoint=0.8) +
  scale_shape_manual(values=c(21,24)) +
  guides(shape= guide_legend(order   =1,
                             override.aes=list(size=5)),
         size = guide_legend(order   =2),
         fill = guide_colourbar(order=3),
         color= guide_colourbar(order=4),
         alpha= "none")

Answer: Veusz supports ternary plots. Here is an example from the documentation:
Answer: Chloë Lewis developed a triangle-plot general class, meant to support the soil texture triangle
with Python and Matplotlib. It's available here http://nature.berkeley.edu/~chlewis/Sourcecode.html https://github.com/chlewissoil/TernaryPlotPy
Chloe editing to add: Moved it to a more reliable host! Also, it's a public repo, so if you want to request library-ization, you could add an issue. Hope it's useful to someone.
Comment: Nice plots and +1 Too bad the code isn't generic enough to be used as a library.
Answer: There seems to be an implementation at work here in gnuplot:

(source: ugm.ac.id)
Comment: It looks interesting, but I'm having problems with the last command. I had to modify (truncate) it. I'll investigate it further. Thank you.
Answer: I just discovered a tool which uses Python/Matplotlib to generate ternary plots called wxTernary. It's available via http://wxternary.sourceforge.net/ -- I was able to successfully generate a ternary plot on the first try.
Comment: project seems not to have checked in the script in SCM :(
Answer: There is a R package named soiltexture. It's aimed at soil texture triangle plot, but can be customized for some aspects.
Answer: Find a vector drawing library and draw it from scratch if you can't find an easier way to do it.
Comment: I have thought of this, too, but it would be too much (grunt) work. There are many details that have to be figured out, e.g. the locations of the axes labels or tick marks.

Btw, Phil's solution is basically drawing the plot from scratch.


Lexmark Printer z705 job stopped

Question: I recently bought a Lexmark z705 printer, when I try to print a something I get the error message "stopped: filter failed"
I add the logs
Comment: What logs? There is nothing here.
Answer: <code>E [14/Apr/2021:17:29:27 -0300] [Job 16] Unable to open raster stream - : Broken pipe
E [14/Apr/2021:17:29:37 -0300] [Job 16] Job stopped due to filter errors; please consult the /var/log/cups/error_log file for details.
D [14/Apr/2021:17:29:37 -0300] [Job 16] The following messages were recorded from 17:29:26 to 17:29:37
D [14/Apr/2021:17:29:37 -0300] [Job 16] Applying default options...
D [14/Apr/2021:17:29:37 -0300] [Job 16] Adding start banner page "none".
D [14/Apr/2021:17:29:37 -0300] [Job 16] Adding end banner page "none".
D [14/Apr/2021:17:29:37 -0300] [Job 16] File of type application/vnd.cups-pdf-banner queued by "matias".
D [14/Apr/2021:17:29:37 -0300] [Job 16] hold_until=0
D [14/Apr/2021:17:29:37 -0300] [Job 16] Queued on "Z700-P700-Series" by "matias".
D [14/Apr/2021:17:29:37 -0300] [Job 16] time-at-processing=1618432166
D [14/Apr/2021:17:29:37 -0300] [Job 16] 4 filters for job:
D [14/Apr/2021:17:29:37 -0300] [Job 16] bannertopdf (application/vnd.cups-pdf-banner to application/pdf, cost 32)
D [14/Apr/2021:17:29:37 -0300] [Job 16] pdftopdf (application/pdf to application/vnd.cups-pdf, cost 66)
D [14/Apr/2021:17:29:37 -0300] [Job 16] gstoraster (application/vnd.cups-pdf to application/vnd.cups-raster, cost 99)
D [14/Apr/2021:17:29:37 -0300] [Job 16] rastertoz700 (application/vnd.cups-raster to printer/Z700-P700-Series, cost 0)
D [14/Apr/2021:17:29:37 -0300] [Job 16] job-sheets=none,none
D [14/Apr/2021:17:29:37 -0300] [Job 16] argv[0]="Z700-P700-Series"
D [14/Apr/2021:17:29:37 -0300] [Job 16] argv[1]="16"
D [14/Apr/2021:17:29:37 -0300] [Job 16] argv[2]="matias"
D [14/Apr/2021:17:29:37 -0300] [Job 16] argv[3]="Test Page"
D [14/Apr/2021:17:29:37 -0300] [Job 16] argv[4]="1"
D [14/Apr/2021:17:29:37 -0300] [Job 16] argv[5]="job-uuid=urn:uuid:fc41d6a6-5cf3-31eb-5558-24b6a093ec35 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1618432166 time-at-processing=1618432166"
D [14/Apr/2021:17:29:37 -0300] [Job 16] argv[6]="/var/spool/cups/d00016-001"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[0]="CUPS_CACHEDIR=/var/cache/cups"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[1]="CUPS_DATADIR=/usr/share/cups"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[2]="CUPS_DOCROOT=/usr/share/cups/doc-root"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[3]="CUPS_FONTPATH=/usr/share/cups/fonts"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[4]="CUPS_REQUESTROOT=/var/spool/cups"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[5]="CUPS_SERVERBIN=/usr/lib/cups"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[6]="CUPS_SERVERROOT=/etc/cups"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[7]="CUPS_STATEDIR=/run/cups"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[8]="HOME=/var/spool/cups/tmp"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[9]="PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[10]="SERVER_ADMIN=root@alice"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[11]="SOFTWARE=CUPS/2.3.1"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[12]="TMPDIR=/var/spool/cups/tmp"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[13]="USER=root"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[14]="CUPS_MAX_MESSAGE=2047"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[15]="CUPS_SERVER=/run/cups/cups.sock"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[16]="CUPS_ENCRYPTION=IfRequested"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[17]="IPP_PORT=631"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[18]="CHARSET=utf-8"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[19]="LANG=es_AR.UTF-8"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[20]="PPD=/etc/cups/ppd/Z700-P700-Series.ppd"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[21]="RIP_MAX_CACHE=128m"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[22]="CONTENT_TYPE=application/vnd.cups-pdf-banner"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[23]="DEVICE_URI=usb://Lexmark/Z700-P700%20Series?serial=15L018533128813"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[24]="PRINTER_INFO=Z700-P700-Series"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[25]="PRINTER_LOCATION="
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[26]="PRINTER=Z700-P700-Series"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[27]="PRINTER_STATE_REASONS=none"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[28]="CUPS_FILETYPE=document"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[29]="FINAL_CONTENT_TYPE=application/vnd.cups-raster"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[30]="AUTH_I****"
D [14/Apr/2021:17:29:37 -0300] [Job 16] Started filter /usr/lib/cups/filter/bannertopdf (PID 5455)
D [14/Apr/2021:17:29:37 -0300] [Job 16] Started filter /usr/lib/cups/filter/pdftopdf (PID 5456)
D [14/Apr/2021:17:29:37 -0300] [Job 16] Started filter /usr/lib/cups/filter/gstoraster (PID 5457)
D [14/Apr/2021:17:29:37 -0300] [Job 16] Started filter /usr/lib/cups/filter/rastertoz700 (PID 5458)
D [14/Apr/2021:17:29:37 -0300] [Job 16] Started backend /usr/lib/cups/backend/usb (PID 5459)
D [14/Apr/2021:17:29:37 -0300] [Job 16] PID 5458 (/usr/lib/cups/filter/rastertoz700) stopped with status 102 (No such file or directory)
D [14/Apr/2021:17:29:37 -0300] [Job 16] Hint: Try setting the LogLevel to "debug" to find out more.
D [14/Apr/2021:17:29:37 -0300] [Job 16] pdftopdf: Last filter determined by the PPD: rastertoz700; FINAL_CONTENT_TYPE: application/vnd.cups-raster => pdftopdf will not log pages in page_log.
D [14/Apr/2021:17:29:37 -0300] [Job 16] OUTFORMAT=\"(null)\", so output format will be CUPS/PWG Raster
D [14/Apr/2021:17:29:37 -0300] [Job 16] execv failed: No such file or directory
D [14/Apr/2021:17:29:37 -0300] [Job 16] Loading USB quirks from \"/usr/share/cups/usb\".
D [14/Apr/2021:17:29:37 -0300] [Job 16] Loaded 181 quirks.
D [14/Apr/2021:17:29:37 -0300] [Job 16] Printing on printer with URI: usb://Lexmark/Z700-P700%20Series?serial=15L018533128813
D [14/Apr/2021:17:29:37 -0300] [Job 16] PDF template file doesn\'t have form. It\'s okay.
D [14/Apr/2021:17:29:37 -0300] [Job 16] PID 5455 (/usr/lib/cups/filter/bannertopdf) exited with no errors.
D [14/Apr/2021:17:29:37 -0300] [Job 16] PDF interactive form and annotation flattening done via QPDF
D [14/Apr/2021:17:29:37 -0300] [Job 16] Color Manager: Calibration Mode/Off
D [14/Apr/2021:17:29:37 -0300] [Job 16] PID 5456 (/usr/lib/cups/filter/pdftopdf) exited with no errors.
D [14/Apr/2021:17:29:37 -0300] [Job 16] Calling FindDeviceById(cups-Z700-P700-Series)
D [14/Apr/2021:17:29:37 -0300] [Job 16] Found device /org/freedesktop/ColorManager/devices/cups_Z700_P700_Series
D [14/Apr/2021:17:29:37 -0300] [Job 16] Calling org.freedesktop.ColorManager.Device.Get(ProfilingInhibitors)
D [14/Apr/2021:17:29:37 -0300] [Job 16] Calling FindDeviceById(cups-Z700-P700-Series)
D [14/Apr/2021:17:29:37 -0300] [Job 16] Found device /org/freedesktop/ColorManager/devices/cups_Z700_P700_Series
D [14/Apr/2021:17:29:37 -0300] [Job 16] Calling GetProfileForQualifiers(Color.Plain....)
D [14/Apr/2021:17:29:37 -0300] [Job 16] Failed to send: org.freedesktop.ColorManager.Device.NothingMatched:nothing matched expression \'Color.Plain.,Color.Plain.*,Color.*.,Color.*.*,*\'
D [14/Apr/2021:17:29:37 -0300] [Job 16] Failed to get profile filename for cups-Z700-P700-Series
D [14/Apr/2021:17:29:37 -0300] [Job 16] Color Manager: no profiles specified in PPD
D [14/Apr/2021:17:29:37 -0300] [Job 16] Color Manager: ICC Profile: None
D [14/Apr/2021:17:29:37 -0300] [Job 16] Ghostscript using Any-Part-of-Pixel method to fill paths.
D [14/Apr/2021:17:29:37 -0300] [Job 16] Ghostscript command line: gs -dQUIET -dSAFER -dNOPAUSE -dBATCH -dNOINTERPOLATE -dNOMEDIAATTRS -dShowAcroForm -sstdout=%stderr -sOutputFile=%stdout -sDEVICE=cups -r600x600 -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=842 -dcupsBitsPerColor=8 -dcupsColorOrder=0 -dcupsColorSpace=1 -dcupsCompression=1 -dcupsRowStep=3 -scupsPageSizeName=A4 -I/usr/share/cups/fonts -c \'<</.HWMargins[18.000000 36.000000 10.000000 5.000000] /Margins[0 0]>>setpagedevice\' -f -_
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[0]=\"CUPS_CACHEDIR=/var/cache/cups\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[1]=\"CUPS_DATADIR=/usr/share/cups\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[2]=\"CUPS_DOCROOT=/usr/share/cups/doc-root\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[3]=\"CUPS_FONTPATH=/usr/share/cups/fonts\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[4]=\"CUPS_REQUESTROOT=/var/spool/cups\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[5]=\"CUPS_SERVERBIN=/usr/lib/cups\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[6]=\"CUPS_SERVERROOT=/etc/cups\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[7]=\"CUPS_STATEDIR=/run/cups\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[8]=\"HOME=/var/spool/cups/tmp\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[9]=\"PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[10]=\"SERVER_ADMIN=root@alice\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[11]=\"SOFTWARE=CUPS/2.3.1\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[12]=\"USER=root\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[13]=\"CUPS_MAX_MESSAGE=2047\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[14]=\"CUPS_SERVER=/run/cups/cups.sock\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[15]=\"CUPS_ENCRYPTION=IfRequested\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[16]=\"IPP_PORT=631\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[17]=\"CHARSET=utf-8\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[18]=\"LANG=es_AR.UTF-8\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[19]=\"PPD=/etc/cups/ppd/Z700-P700-Series.ppd\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[20]=\"RIP_MAX_CACHE=128m\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[21]=\"CONTENT_TYPE=application/vnd.cups-pdf-banner\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[22]=\"DEVICE_URI=usb://Lexmark/Z700-P700%20Series?serial=15L018533128813\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[23]=\"PRINTER_INFO=Z700-P700-Series\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[24]=\"PRINTER_LOCATION=\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[25]=\"PRINTER=Z700-P700-Series\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[26]=\"PRINTER_STATE_REASONS=none\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[27]=\"CUPS_FILETYPE=document\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[28]=\"FINAL_CONTENT_TYPE=application/vnd.cups-raster\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] envp[29]=\"AUTH_INFO_REQUIRED=none\"
D [14/Apr/2021:17:29:37 -0300] [Job 16] Start rendering...
D [14/Apr/2021:17:29:37 -0300] [Job 16] Processing page 1...
D [14/Apr/2021:17:29:37 -0300] [Job 16] Error: /ioerror in --showpage--
D [14/Apr/2021:17:29:37 -0300] [Job 16] Operand stack:
D [14/Apr/2021:17:29:37 -0300] [Job 16] true   (/tmp/gs_0Kenab)   --nostringval--   1   true
D [14/Apr/2021:17:29:37 -0300] [Job 16] Execution stack:
D [14/Apr/2021:17:29:37 -0300] [Job 16] %interp_exit   .runexec2   --nostringval--   showpage   --nostringval--   2   %stopped_push   --nostringval--   showpage   showpage   false   1   %stopped_push   1990   2   3   %oparray_pop   1989   2   3   %oparray_pop   1977   2   3   %oparray_pop   showpage   1978   4   3   %oparray_pop   showpage   showpage   2   1   1   showpage   %for_pos_int_continue   1981   4   7   %oparray_pop   showpage   showpage   1840   3   9   %oparray_pop   showpage   showpage
D [14/Apr/2021:17:29:37 -0300] [Job 16] Dictionary stack:
D [14/Apr/2021:17:29:37 -0300] [Job 16] --dict:740/1123(ro)(G)--   --dict:1/20(G)--   --dict:80/200(L)--   --dict:80/200(L)--   --dict:135/256(ro)(G)--   --dict:315/325(ro)(G)--   --dict:33/64(L)--   --dict:6/9(L)--   --dict:7/20(L)--
D [14/Apr/2021:17:29:37 -0300] [Job 16] Current allocation mode is local
D [14/Apr/2021:17:29:37 -0300] [Job 16] Last OS error: Broken pipe
D [14/Apr/2021:17:29:37 -0300] [Job 16] GPL Ghostscript 9.50: Unrecoverable error, exit code 1
D [14/Apr/2021:17:29:37 -0300] [Job 16] Rendering completed
D [14/Apr/2021:17:29:37 -0300] [Job 16] PID 5457 (/usr/lib/cups/filter/gstoraster) stopped with status 1.
D [14/Apr/2021:17:29:37 -0300] [Job 16] Hint: Try setting the LogLevel to "debug" to find out more.
D [14/Apr/2021:17:29:37 -0300] [Job 16] libusb_get_device_list=11
D [14/Apr/2021:17:29:37 -0300] [Job 16] STATE: +connecting-to-device
D [14/Apr/2021:17:29:37 -0300] [Job 16] STATE: -connecting-to-device
D [14/Apr/2021:17:29:37 -0300] [Job 16] Printer found with device ID: MFG:Lexmark ;CMD:CPDNPA001;MODEL:Z700-P700 Series;CLASS:Printer;DES:Lexmark Z700-P700 Series;COMMENT:030305-1; Device URI: usb://Lexmark/Z700-P700%20Series?serial=15L018533128813
D [14/Apr/2021:17:29:37 -0300] [Job 16] Device protocol: 2
D [14/Apr/2021:17:29:37 -0300] [Job 16] Enviando datos a la impresora.
D [14/Apr/2021:17:29:37 -0300] [Job 16] Sent 0 bytes...
D [14/Apr/2021:17:29:37 -0300] [Job 16] Waiting for read thread to exit...
D [14/Apr/2021:17:29:37 -0300] [Job 16] Read thread still active, aborting the pending read...
D [14/Apr/2021:17:29:37 -0300] [Job 16] PID 5459 (/usr/lib/cups/backend/usb) exited with no errors.
D [14/Apr/2021:17:29:37 -0300] [Job 16] End of messages
D [14/Apr/2021:17:29:37 -0300] [Job 16] printer-state=3(idle)
D [14/Apr/2021:17:29:37 -0300] [Job 16] printer-state-message="Enviando datos a la impresora."
D [14/Apr/2021:17:29:37 -0300] [Job 16] printer-state-reasons=none
</code>
Answer: I have Canon MF4010 on the Orange Pi Zero 2 with Armbian (sort of). I had similar errors and this answer helped me - https://ubuntuforums.org/showthread.php?t=2445778

sudo apt install libcupsimage2

Lexmark Printer z705 job stopped


Ruby gem method only available in controller? If so, how to make it available in other files?

Question: I was under the impression that a gem's methods can be accessed anywhere in the Rails app once it's been installed with bundler. But is this not the case? I'm confused because a method accessible in the controller isn't recognised when moved outside the file.
Is there some way I could require the gem to run the code below in the command file instead of the controller?
I'm using an authentication gem called sorcery to implement an OAuth login system. There are some methods like login_from(provider) that the gem provides, which can be accessed from my controller just fine.
# app/controllers/oauths_controller.rb
class OauthsController < ApplicationController
  skip_before_action :require_login

  def callback
    provider = params[:provider]
    if @user = login_from(provider)
    # method continues
  end

However, we're trying to take a command-query separation approach in our app, so I tried moving this process containing login_from(provider) method to a different file called app/commands/authentication/login_command.rb. This resulted in the method not being recognised:
NoMethodError (undefined method 'login_from' for #<Authentication::LoginCommand:>)

Thanks in advance.
Answer:
I was under the impression that a gem's methods can be accessed anywhere in the Rails app once it's been installed with bundler.

That would be an incorrect impression.
As you can see, Sorcery::Engine causes ActionController::Base to include methods defined in Sorcery::Controller, here:
require 'sorcery'
require 'rails'

module Sorcery
  # The Sorcery engine takes care of extending ActiveRecord (if used) and ActionController,
  # With the plugin logic.
  class Engine < Rails::Engine
    config.sorcery = ::Sorcery::Controller::Config

    initializer 'extend Controller with sorcery' do
      # TODO: Should this include a modified version of the helper methods?
      if defined?(ActionController::API)
        ActionController::API.send(:include, Sorcery::Controller)
      end

      if defined?(ActionController::Base)
        ActionController::Base.send(:include, Sorcery::Controller)
        ActionController::Base.helper_method :current_user
        ActionController::Base.helper_method :logged_in?
      end
    end
  end
end

Sorcer::Controller in turn, includes a series of submodules:
module Sorcery
  module Controller
    def self.included(klass)
      klass.class_eval do
        include InstanceMethods
        Config.submodules.each do |mod|
          # FIXME: Is there a cleaner way to handle missing submodules?
          # rubocop:disable Lint/HandleExceptions
          begin
            include Submodules.const_get(mod.to_s.split('_').map(&:capitalize).join)
          rescue NameError
            # don't stop on a missing submodule.
          end
          # rubocop:enable Lint/HandleExceptions
        end
      end
      Config.update!
      Config.configure!
    end

    ...
  end
end

One of these submodules is Sourcery::Controller::Submodules::External which, when included, also includes Sourcery::Controller::Submodules::External::InstanceMethods, here:
module Sorcery
  module Controller
    module Submodules
      # This submodule helps you login users from external auth providers such as Twitter.
      # This is the controller part which handles the http requests and tokens passed between the app and the @provider.
      module External
        def self.included(base)
          base.send(:include, InstanceMethods)
          ...
        end
      end
    end
  end
end

And, InstanceMethods contains the method login_from, here:
module Sorcery
  module Controller
    module Submodules
      # This submodule helps you login users from external auth providers such as Twitter.
      # This is the controller part which handles the http requests and tokens passed between the app and the @provider.
      module External
        def self.included(base)
          base.send(:include, InstanceMethods)

        module InstanceMethods
          protected

          ...

          # tries to login the user from provider's callback
          def login_from(provider_name, should_remember = false)
            sorcery_fetch_user_hash provider_name

            return unless (user = user_class.load_from_provider(provider_name, @user_hash[:uid].to_s))

            # we found the user.
            # clear the session
            return_to_url = session[:return_to_url]
            reset_sorcery_session
            session[:return_to_url] = return_to_url

            # sign in the user
            auto_login(user, should_remember)
            after_login!(user)

            # return the user
            user
          end

          ...
        end
      end
    end
  end
end

Soooo, that's a long way of saying that login_from is defined as a protected instance method on classes that inherit from ActionController::Base and is not defined as an instance method on classes that DO NOT inherit from ActionController::Base which is why you're getting the NoMethodError.

Is there some way I could require the gem to run the code below in the command file instead of the controller?

Maybe. Maybe not. As you can see, login_from is using other sorcery methods and methods inherited from ActionController::Base. So, you would need to make sure all of those methods are available in Authentication::LoginCommand in order for login_from to behave appropriately.
Comment: Thank you so much for walking me through it. I'd never used a gem in an unconventional way like this, so it was tricky. Based on your explanation, I tried making this command class inherit from `ActionController::Base` (like this: `Authentication::LoginCommand < ActionController::Base`) but this hacky way didn't work, as it returned this error: `NoMethodError Exception: undefined method 'parameters' for nil:NilClass`. Starting to feel like it may be safer to use this method in the controller as originally intended.
Comment: Yeah, it could be tricky. Remember that controllers are always used as instances. So, minimally, you'd probably need to use an instance of `Authentication::LoginCommand`. But, I would guess that you'll end up with other errors. Might be easier, as you say, to use the method in the controller as originally intended. (Although, it could be a good learning exercise to get your PORO working as you're describing.)


Walkthroughs for Armed Assault

Question: Armed Assault is a really tough game.  I was in the Army and I still think it's tough.
I'd really like a good walkthrough for Armed Assault. Does anyone know of one?
Comment: Do you mean ArmA: Armed Assault?
Comment: It was called Armed Assault in the US I believe.
Answer: Dslyecxi, a member of Shacknews, wrote an incredibly detailed guide on Arma which includes diagrams, videos, and explanations for just about everything in the entire game. You won't find a better or more detailed guide anywhere:
http://dslyecxi.com/armattp.html
He also has a glossy print version available, but be warned that this is a 168 page 8.5"x11" guide.
Comment: Good lord, thats impressive.
Comment: Yeah, Dslyecxi's enthusiasm for realistic tactical games like Arma is amazing, and his time in the military definitely helped in the writing of the guides. Bohemia Interactive even recommends his guides.

Walkthroughs for Armed Assault


Stop `sudo apt-get remove git` from removing Atom text editor automatically

Question: I am removing git using $ sudo apt-get remove git. But along with it I notice that it writes
Removing atom (1.45.0) ...
Removing git (1:2.17.1-1ubuntu0.7) ...

And all of a sudden, Atom gets removed. This is quite annoying. Is this a bug (and should be reported) or am I doing it wrong ?
Answer: The atom package has Depends: git in its metadata. It cannot be installed if the git package is not installed. If you think that it should be able to work without git installed, complain to the maintainers of that package.
If you are providing the git command on your system some other way, you might want to look into using equivs to create a package which Provides: git and Replaces: git.


Connecting double vanity do single drain with distance above 30inches

Question: I purchased double vanity and thought I will be able to just connct it using single trap to existing 1 1/2 wall drain
After some reading I found out that this is only allowed when distance is less than 30" between drains and in my case it is going to be around 41" (I am in Illinois, I assume this rule still applies).
I don't know what is happening in the wall or where the stack is. Any proposal how can i connect it correctly?
Do I have to open the wall and add 2nd drain outlet as shown on the picture?
Thanks
Answer: This may be dipping into a gray area of rules.  I will defer to any professional plumbers to give a final ruling.
In lieu of opening the wall and moving the drain pipe, I would add a 90 deg sweep and move the drain 10 inches or more to the left.
Then I would add another 90 and a wye and the P-trap connections, so technically (maybe) neither sink has a drain more than 30 inches from the discharge drain.
Of course maintain the proper slope, and add the necessary 45 deg. 0r 22 1/2 deg. fittings to get the traps aligned.
Comment: @Arek you would add the angles and Wye under the cabinet, not in the walls. Unless, of course, you _want_ to open up the wall to do so.
Comment: My answer was assuming you did NOT want to open the wall and the work was done under the vanity.  YES...if you are opening the wall then it is a simple task of adding the second drain.
Comment: @Arek...if you knew what you needed to do WHY did you ask a question as if you were at a loss s to how to overcome the problem?
Comment: Thanks both. I would prefer to avoid opening the wall but also don't want to have drain problems or enter Grey area of code. As I have drawers in the vanity also not sure if I have all the space needed for all the connections. What do you mean by having traps aligned?
Comment: Thanks @RMDman. I didnt knew what to do. Looking for best option to install it, ideally without opening the walls.
Comment: Doing it under the cabinet instead of inside the wall will be quite handy when it clogs up. And, someday, it will.


sudo apt-get is not working

Question: So I keep trying to run the following command sudo apt-get install libaa-bin and every time I get the message. Unable to fetch some archives, maybe run apt-get update or try with --fix-missing/ I' ran sudo apt-get update but when I try the command again I get the same response. Any help here?
This is my sources.list :
deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main

here's what I get when I run sudo apt-get update :
Ign http://extras.ubuntu.com trusty InRelease
Ign http://extras.ubuntu.com trusty Release.gpg
Ign http://extras.ubuntu.com trusty Release
Ign http://extras.ubuntu.com trusty/main Sources/DiffIndex
Ign http://extras.ubuntu.com trusty/main i386 Packages/DiffIndex
Ign http://security.ubuntu.com trusty-security InRelease
Ign http://us.archive.ubuntu.com trusty InRelease
Ign http://ppa.launchpad.net trusty InRelease
Ign http://security.ubuntu.com trusty-security Release.gpg
Ign http://us.archive.ubuntu.com trusty-updates InRelease
Ign http://ppa.launchpad.net trusty Release.gpg
Ign http://us.archive.ubuntu.com trusty-backports InRelease
Ign http://security.ubuntu.com trusty-security Release
Ign http://dl.google.com stable InRelease
Ign http://ppa.launchpad.net trusty Release
Ign http://us.archive.ubuntu.com trusty Release.gpg
Ign http://security.ubuntu.com trusty-security/main Sources/DiffIndex
Ign http://extras.ubuntu.com trusty/main Translation-en_US
Ign http://ppa.launchpad.net trusty/main i386 Packages/DiffIndex
Ign http://us.archive.ubuntu.com trusty-updates Release.gpg
Ign http://security.ubuntu.com trusty-security/restricted Sources/DiffIndex
Hit http://dl.google.com stable Release.gpg
Ign http://extras.ubuntu.com trusty/main Translation-en
Ign http://us.archive.ubuntu.com trusty-backports Release.gpg
Ign http://us.archive.ubuntu.com trusty Release
Err http://extras.ubuntu.com trusty/main Sources
  403  Forbidden [IP: 22.214.171.124 80]
Err http://extras.ubuntu.com trusty/main i386 Packages
  403  Forbidden [IP: 188.8.131.52 80]
Ign http://us.archive.ubuntu.com trusty-updates Release
Ign http://us.archive.ubuntu.com trusty-backports Release
Ign http://us.archive.ubuntu.com trusty/main Sources/DiffIndex
Ign http://us.archive.ubuntu.com trusty/restricted Sources/DiffIndex
Ign http://security.ubuntu.com trusty-security/universe Sources/DiffIndex
Hit http://dl.google.com stable Release
Hit http://dl.google.com stable/main i386 Packages
Ign http://us.archive.ubuntu.com trusty/universe Sources/DiffIndex
Ign http://us.archive.ubuntu.com trusty/multiverse Sources/DiffIndex
Ign http://us.archive.ubuntu.com trusty/main i386 Packages/DiffIndex
Ign http://us.archive.ubuntu.com trusty/restricted i386 Packages/DiffIndex
Ign http://us.archive.ubuntu.com trusty/universe i386 Packages/DiffIndex
Ign http://us.archive.ubuntu.com trusty/multiverse i386 Packages/DiffIndex
Ign http://ppa.launchpad.net trusty/main Translation-en_US
Ign http://ppa.launchpad.net trusty/main Translation-en
Err http://ppa.launchpad.net trusty/main i386 Packages
  403  Forbidden [IP: 126.96.36.199 80]
Ign http://security.ubuntu.com trusty-security/multiverse Sources/DiffIndex
Ign http://security.ubuntu.com trusty-security/main i386 Packages/DiffIndex
Ign http://security.ubuntu.com trusty-security/restricted i386 Packages/DiffIndex
Ign http://security.ubuntu.com trusty-security/universe i386 Packages/DiffIndex
Ign http://security.ubuntu.com trusty-security/multiverse i386 Packages/DiffIndex
Ign http://us.archive.ubuntu.com trusty-updates/main Sources/DiffIndex
Ign http://us.archive.ubuntu.com trusty-updates/restricted Sources/DiffIndex
Ign http://us.archive.ubuntu.com trusty-updates/universe Sources/DiffIndex
Ign http://dl.google.com stable/main Translation-en_US
Ign http://dl.google.com stable/main Translation-en
Ign http://us.archive.ubuntu.com trusty-updates/multiverse Sources/DiffIndex
Ign http://us.archive.ubuntu.com trusty-updates/main i386 Packages/DiffIndex
Ign http://us.archive.ubuntu.com trusty-updates/restricted i386 Packages/DiffIndex
Ign http://us.archive.ubuntu.com trusty-updates/universe i386 Packages/DiffIndex
Ign http://us.archive.ubuntu.com trusty-updates/multiverse i386 Packages/DiffIndex
Ign http://us.archive.ubuntu.com trusty-backports/main Sources/DiffIndex
Ign http://us.archive.ubuntu.com trusty-backports/restricted Sources/DiffIndex
Ign http://us.archive.ubuntu.com trusty-backports/universe Sources/DiffIndex
Ign http://us.archive.ubuntu.com trusty-backports/multiverse Sources/DiffIndex
Ign http://us.archive.ubuntu.com trusty-backports/main i386 Packages/DiffIndex
Ign http://us.archive.ubuntu.com trusty-backports/restricted i386 Packages/DiffIndex
Ign http://us.archive.ubuntu.com trusty-backports/universe i386 Packages/DiffIndex
Ign http://us.archive.ubuntu.com trusty-backports/multiverse i386 Packages/DiffIndex
Ign http://security.ubuntu.com trusty-security/main Translation-en_US
Ign http://security.ubuntu.com trusty-security/main Translation-en
Ign http://security.ubuntu.com trusty-security/multiverse Translation-en_US
Ign http://security.ubuntu.com trusty-security/multiverse Translation-en
Ign http://security.ubuntu.com trusty-security/restricted Translation-en_US
Ign http://security.ubuntu.com trusty-security/restricted Translation-en
Ign http://security.ubuntu.com trusty-security/universe Translation-en_US
Ign http://security.ubuntu.com trusty-security/universe Translation-en
Err http://security.ubuntu.com trusty-security/main Sources
  403  Forbidden [IP: 126.96.36.199 80]
Err http://security.ubuntu.com trusty-security/restricted Sources
  403  Forbidden [IP: 220.127.116.11 80]
Err http://security.ubuntu.com trusty-security/universe Sources
  403  Forbidden [IP: 126.96.36.199 80]
Err http://security.ubuntu.com trusty-security/multiverse Sources
  403  Forbidden [IP: 18.104.22.168 80]
Err http://security.ubuntu.com trusty-security/main i386 Packages
  403  Forbidden [IP: 220.127.116.11 80]
Err http://security.ubuntu.com trusty-security/restricted i386 Packages
  403  Forbidden [IP: 126.96.36.199 80]
Err http://security.ubuntu.com trusty-security/universe i386 Packages
  403  Forbidden [IP: 184.108.40.206 80]
Err http://security.ubuntu.com trusty-security/multiverse i386 Packages
  403  Forbidden [IP: 220.127.116.11 80]
Ign http://us.archive.ubuntu.com trusty/main Translation-en_US
Ign http://us.archive.ubuntu.com trusty/main Translation-en
Ign http://us.archive.ubuntu.com trusty/multiverse Translation-en_US
Ign http://us.archive.ubuntu.com trusty/multiverse Translation-en
Ign http://us.archive.ubuntu.com trusty/restricted Translation-en_US
Ign http://us.archive.ubuntu.com trusty/restricted Translation-en
Ign http://us.archive.ubuntu.com trusty/universe Translation-en_US
Ign http://us.archive.ubuntu.com trusty/universe Translation-en
Ign http://us.archive.ubuntu.com trusty-updates/main Translation-en_US
Ign http://us.archive.ubuntu.com trusty-updates/main Translation-en
Ign http://us.archive.ubuntu.com trusty-updates/multiverse Translation-en_US
Ign http://us.archive.ubuntu.com trusty-updates/multiverse Translation-en
Ign http://us.archive.ubuntu.com trusty-updates/restricted Translation-en_US
Ign http://us.archive.ubuntu.com trusty-updates/restricted Translation-en
Ign http://us.archive.ubuntu.com trusty-updates/universe Translation-en_US
Ign http://us.archive.ubuntu.com trusty-updates/universe Translation-en
Ign http://us.archive.ubuntu.com trusty-backports/main Translation-en_US
Ign http://us.archive.ubuntu.com trusty-backports/main Translation-en
Ign http://us.archive.ubuntu.com trusty-backports/multiverse Translation-en_US
Ign http://us.archive.ubuntu.com trusty-backports/multiverse Translation-en
Ign http://us.archive.ubuntu.com trusty-backports/restricted Translation-en_US
Ign http://us.archive.ubuntu.com trusty-backports/restricted Translation-en
Ign http://us.archive.ubuntu.com trusty-backports/universe Translation-en_US
Ign http://us.archive.ubuntu.com trusty-backports/universe Translation-en
Err http://us.archive.ubuntu.com trusty/main Sources
  403  Forbidden [IP: 220.127.116.11 80]
Err http://us.archive.ubuntu.com trusty/restricted Sources
  403  Forbidden [IP: 18.104.22.168 80]
Err http://us.archive.ubuntu.com trusty/universe Sources
  403  Forbidden [IP: 18.104.22.168 80]
Err http://us.archive.ubuntu.com trusty/multiverse Sources
  403  Forbidden [IP: 188.8.131.52 80]
Err http://us.archive.ubuntu.com trusty/main i386 Packages
  403  Forbidden [IP: 188.8.131.52 80]
Err http://us.archive.ubuntu.com trusty/restricted i386 Packages
  403  Forbidden [IP: 188.8.131.52 80]
Err http://us.archive.ubuntu.com trusty/universe i386 Packages
  403  Forbidden [IP: 22.214.171.124 80]
Err http://us.archive.ubuntu.com trusty/multiverse i386 Packages
  403  Forbidden [IP: 188.8.131.52 80]
Err http://us.archive.ubuntu.com trusty-updates/main Sources
  403  Forbidden [IP: 18.104.22.168 80]
Err http://us.archive.ubuntu.com trusty-updates/restricted Sources
  403  Forbidden [IP: 22.214.171.124 80]
Err http://us.archive.ubuntu.com trusty-updates/universe Sources
  403  Forbidden [IP: 126.96.36.199 80]
Err http://us.archive.ubuntu.com trusty-updates/multiverse Sources
  403  Forbidden [IP: 184.108.40.206 80]
Err http://us.archive.ubuntu.com trusty-updates/main i386 Packages
  403  Forbidden [IP: 18.104.22.168 80]
Err http://us.archive.ubuntu.com trusty-updates/restricted i386 Packages
  403  Forbidden [IP: 220.127.116.11 80]
Err http://us.archive.ubuntu.com trusty-updates/universe i386 Packages
  403  Forbidden [IP: 126.96.36.199 80]
Err http://us.archive.ubuntu.com trusty-updates/multiverse i386 Packages
  403  Forbidden [IP: 18.104.22.168 80]
Err http://us.archive.ubuntu.com trusty-backports/main Sources
  403  Forbidden [IP: 188.8.131.52 80]
Err http://us.archive.ubuntu.com trusty-backports/restricted Sources
  403  Forbidden [IP: 22.214.171.124 80]
Err http://us.archive.ubuntu.com trusty-backports/universe Sources
  403  Forbidden [IP: 184.108.40.206 80]
Err http://us.archive.ubuntu.com trusty-backports/multiverse Sources
  403  Forbidden [IP: 126.96.36.199 80]
Err http://us.archive.ubuntu.com trusty-backports/main i386 Packages
  403  Forbidden [IP: 126.96.36.199 80]
Err http://us.archive.ubuntu.com trusty-backports/restricted i386 Packages
  403  Forbidden [IP: 126.96.36.199 80]
Err http://us.archive.ubuntu.com trusty-backports/universe i386 Packages
  403  Forbidden [IP: 22.214.171.124 80]
Err http://us.archive.ubuntu.com trusty-backports/multiverse i386 Packages
  403  Forbidden [IP: 22.214.171.124 80]
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/trusty/main/source/Sources  403  Forbidden [IP: 220.127.116.11 80]

W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/trusty/main/binary-i386/Packages  403  Forbidden [IP: 188.8.131.52 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/main/source/Sources  403  Forbidden [IP: 188.8.131.52 80]

W: Failed to fetch http://ppa.launchpad.net/anton+/dnscrypt/ubuntu/dists/trusty/main/binary-i386/Packages  403  Forbidden [IP: 220.127.116.11 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/restricted/source/Sources  403  Forbidden [IP: 188.8.131.52 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty/main/source/Sources  403  Forbidden [IP: 220.127.116.11 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty/restricted/source/Sources  403  Forbidden [IP: 18.104.22.168 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/universe/source/Sources  403  Forbidden [IP: 184.108.40.206 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty/universe/source/Sources  403  Forbidden [IP: 220.127.116.11 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty/multiverse/source/Sources  403  Forbidden [IP: 220.127.116.11 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty/main/binary-i386/Packages  403  Forbidden [IP: 184.108.40.206 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty/restricted/binary-i386/Packages  403  Forbidden [IP: 18.104.22.168 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty/universe/binary-i386/Packages  403  Forbidden [IP: 184.108.40.206 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty/multiverse/binary-i386/Packages  403  Forbidden [IP: 18.104.22.168 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/multiverse/source/Sources  403  Forbidden [IP: 22.214.171.124 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/main/binary-i386/Packages  403  Forbidden [IP: 18.104.22.168 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/restricted/binary-i386/Packages  403  Forbidden [IP: 184.108.40.206 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/universe/binary-i386/Packages  403  Forbidden [IP: 18.104.22.168 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/multiverse/binary-i386/Packages  403  Forbidden [IP: 184.108.40.206 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/main/source/Sources  403  Forbidden [IP: 188.8.131.52 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/restricted/source/Sources  403  Forbidden [IP: 18.104.22.168 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/source/Sources  403  Forbidden [IP: 18.104.22.168 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/multiverse/source/Sources  403  Forbidden [IP: 184.108.40.206 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/main/binary-i386/Packages  403  Forbidden [IP: 126.96.36.199 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/restricted/binary-i386/Packages  403  Forbidden [IP: 220.127.116.11 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/binary-i386/Packages  403  Forbidden [IP: 188.8.131.52 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/multiverse/binary-i386/Packages  403  Forbidden [IP: 18.104.22.168 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-backports/main/source/Sources  403  Forbidden [IP: 220.127.116.11 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-backports/restricted/source/Sources  403  Forbidden [IP: 184.108.40.206 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-backports/universe/source/Sources  403  Forbidden [IP: 220.127.116.11 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-backports/multiverse/source/Sources  403  Forbidden [IP: 188.8.131.52 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-backports/main/binary-i386/Packages  403  Forbidden [IP: 188.8.131.52 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-backports/restricted/binary-i386/Packages  403  Forbidden [IP: 126.96.36.199 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-backports/universe/binary-i386/Packages  403  Forbidden [IP: 22.214.171.124 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-backports/multiverse/binary-i386/Packages  403  Forbidden [IP: 184.108.40.206 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.

Comment: For some reason, your IP is being blacklisted (or may be a server side problem)..check after some time or if you want you can temporarily disable the problematic repos by commenting out the relevant lines from `/etc/apt/sources.list` and also from `/etc/apt/sources.list.d/` and then everything should be normal..also enable those after some time to check again..alternately you can use another mirror that is near to you..
Comment: Please [edit](http://askubuntu.com/posts/663939/edit) your question to add the output of `cat /etc/apt/sources.list`
Comment: did you try the `--fix-missing`? E.G. - `sudo apt-get install -f libaa-bin`
Comment: can you please explain  how that works I'm still kind of new to Linux @heemayl
Comment: Got the same message @HeatherBrown
Comment: From your `terminal` run `cat /etc/apt/sources.list`, you would get some output, then [edit](http://askubuntu.com/posts/663939/edit) your question and copy-paste the output you have got from that command..
Comment: Sent it up now @heemayl
Comment: Ok, now run `sudo apt-get update` and post the full output ..
Comment: so what am I missing on all of the @heemayl
Comment: Please post the full output of `sudo apt-get update` ..
Comment: ok but you may need to edit it once I post it sorry @heemayl
Comment: it's up @heemayl
Comment: I think I figured it out, I put opendns on my computer and put really tight restrictions on it so I think it got caught up in DNS
Answer: From here it appears you might be behind some proxy or your internet is regulated which is blocking your access to some IP addresses.
If the error is because of some proxy/regulation then your best bet is to download the deb file using browser form https://packages.debian.org/sid/i386/libaa-bin/download (assuming you can acess this website on your network)
and then run the .deb file to install libaa-bin

sudo apt-get is not working


What is the connection between these quantities?

Question: $S = 6,15,20,15,6,1$ is a row of Pascal's triangle with its left-hand edge removed.
What is the relationship between $S$, the number of m-faces of a regular n-simplex, and states of a finite quantum system?
Edited to add: Some MSE contributors who also read at MO may recall this MO post and the very mixed reactions to it.
Edited 12/30/2017: I'm adding this so people can see the nature of the biomolecular data which gave rise to the posted question:
One example of 261632 cases over the DNA alphabet {tcag} instantiating the palindrome pair rrrryrrrr and ryrrrrryr over the 2-letter {y,r} alphabet. (The {y,r}-alphabet reduces t,c to y and a,g to r, and the {w,s} alphabet reduces t,a to w and c,g to s.)
ggggcgggg    9-tuple 1 over {tcag}
gcgggggca    9-tuple 2 over {tcag}
rrrryrrrr    9-tuple 1 over {y,r} (palindromic)
ryrrrrryr    9-tuple 2 over {y,r} (palindromic)
sssssssss    9-tuple 2 over {w,s}
ssssssssw    9-tuple 2 over {w,s}
4            count of positions in which tuples 1 and 2 differ
0            difference indicator for position 1
2            difference indicator for position 2
0            difference indicator for position 3
0            difference indicator for position 4
5            difference indicator for position 5
0            difference indicator for position 6
0            difference indicator for position 7
8            difference indicator for position 8
9            difference indicator for position 9

Note that the 261632 cases deliberately includes NO case in which tuples 1 and 2 have the SAME representation over {w,s}. (This is because energetically speaking, they are basically alike.)
See this post for background discussion of the "reduced" {y,r} and {w,s} alphabets:
Cases where ANY 2 of 3 +/- choices select one of four possible elements
Note also that 2-tuples over the DNA {tcag} alphabet or the RNA {ucag} alphabet have associated "relative-delta-H enthalpies" as follows.  (These indicate relative strength of complementary binding of these 2-tuples across the two strands in duplex ("double-helix") DNA or RNA - the values below are for RNA, not DNA).
aa  2.80
ga  1.41
ua  2.07
ca  1.16
ag  1.52
au  2.86
gg  0.27
ac  1.91
ug  1.16
cg  0.00
gu  1.91
gc  0.95
uu  2.80
cu  1.52
uc  1.41
cc  0.27

The paper reporting these values can be found here:
http://onlinelibrary.wiley.com/doi/10.1002/bip.360220812/abstract;jsessionid=3DB31A510C70A7C72FDA23FAB9FFB3E9.f04t04
Answer: See:
OEIS A135278: T(n,m) is the number of m-faces of a regular n-simplex
https://oeis.org/A135278
and in particular:
a) this comment by Tom Copeland (24 July 2017) on the relationship between the combinatorics of the n-simplex and states of a quantum system: "For a correlation between the states of a quantum system and the combinatorics of the n-simplex, see Boya and Dixit";
b) the paper by Boya and Dixit referenced in his comment:
https://arxiv.org/pdf/0808.1930.pdf
Edited 12/30/2017: I'm adding this so people can see the nature of the biomolecular data which gave rise to the posted question:
One example of 261632 cases over the DNA alphabet {tcag} instantiating the palindrome pair rrrryrrrr and ryrrrrryr over the 2-letter {y,r} alphabet.  (The {y,r}-alphabet reduces t,c to y and a,g to r, and the {w,s} alphabet reduces t,a to w and c,g to s.)
ggggcgggg    9-tuple 1 over {tcag}
gcgggggca    9-tuple 2 over {tcag0}
rrrryrrrr    9-tuple 1 over {y,r} (palindromic)
ryrrrrryr    9-tuple 2 over {y,r} (palindromic)
sssssssss    9-tuple 2 over {w,s}
ssssssssw    9-tuple 2 over {w,s}
4            count of positions in which tuples 1 and 2 differ
0            difference indicator for position 1
2            difference indicator for position 2
0            difference indicator for position 3
0            difference indicator for position 4
5            difference indicator for position 5
0            difference indicator for position 6
0            difference indicator for position 7
8            difference indicator for position 8
9            difference indicator for position 9

Note that the 261632 cases deliberately includes NO case in which tuples 1 and 2 have the SAME representation over {w,s}.  (This is because energetically speaking, they are basically alike.)
This deliberate omission MAY be why we're not seeing 512 cases.
See this post for background discussion of the "reduced" {y,r} and {w,s} alphabets:
Cases where ANY 2 of 3 +/- choices select one of four possible elements
Note also that 2-tuples over the DNA {tcag} alphabet or the RNA {ucag} alphabet have associated "relative-delta-H enthalpies" as follows. (These indicate relative strength of complementary binding of these 2-tuples across the two strands in duplex ("double-helix") DNA or RNA - the values below are for RNA, not DNA).
aa  2.80
ga  1.41
ua  2.07
ca  1.16
ag  1.52
au  2.86
gg  0.27
ac  1.91
ug  1.16
cg  0.00
gu  1.91
gc  0.95
uu  2.80
cu  1.52
uc  1.41
cc  0.27

Answer: This one is a sixth tragmic-power of a point.  I imagine we should look for a power-product.
Comment: @WendyKrieger - thanks as always - I have five more cases to do out of six to see if the same numbers arise. Also, note that in my team's empirical research, the numbers arise multiplied by 4096, as: 24576, 61440, 81920, 61440, 24576, 4096
Comment: From the sample, there seems to be an impost in the first value, of 512.  Then it gives the row of the triangle, less 512,0,0,0,....   Curiouser and curiouser.
Comment: @WendyKrieger - I've added an example to the post here, and also sent you an email with the complete set of 261632 cases underlying row 1 of ht PDF previously sent.  I added the example here so that peolple can see the nature of the underlying biomolecular data which led to the numbers similar to the OEIS sequence.
Answer: Here is the way the rows  of Pascal's triangle for n = 3, 6 actually occur in my team's energetic data.  The two 1-3-3-1 cases probably represent the initial energetic scaffold for an early version of the genetic code and the two 1-6-15-20-15-6-1 cases probably represent a later energetic scaffold underlying a more complex exfoliation of the original code.  So, the relevant OEIS sequence is actually A135278
https://oeis.org/A135278
See in particular the Boya and Dixit paper (referenced by Tom Copeland) regarding m-faces of n-simplices in relation to states of a finite quantum system.
https://arxiv.org/abs/0808.1930
In our case, the energetics derive from the relative-delta-H enthalpies of dinucleotides bound to complementary dinucleotides across the two strands of a DNA or RNA double helix, as calculated by Ornstein and Fresco in these two papers:
https://www.ncbi.nlm.nih.gov/pubmed/6616016
http://onlinelibrary.wiley.com/doi/10.1002/bip.360220812/abstract
Case 2 rrryryrrr vs yryrrryry

                N     Diff        N       N     Diff      Sum of   Sum of N's
Mismatches   Less     Less     Zero    More     More       N's      / 32768
    6       16348    -166.618    60   16360   +166.500   32768        1
    7       49285    -210.190    93   48926   +211.733   98304        3
    8       49403    -246.811    86   48815   +249.784   98304        3
    9       16489    -279.088    54   16225   +283.629   32768        1

Case 5 ryryyyryr vs yyyryryyy

                N      Diff      N       N      Diff     Sum of   Sum of N's
Mismatches   Less      Less    Zero    More     More       N's     / 32768
    6       16360   -166.500     60   16348    +166.618  32768        1
    7       48926   -211.733     93   49285    +210.190  98304        3
    8       48815   -249.784     86   49403    +246.811  98304        3
    9       16225   -283.629     54   16489    +279.088  32768        1

Case 1 rrrryrrrr vs ryrrrrryr

                    N     Diff        N       N     Diff      Sum of   Sum of N's
    Mismatches   Less     Less     Zero    More     More       N's      / 4096
        3        2071   -160.563    22     2003   +166.014    4096        1
        4       12269   -191.979    36    12271   +191.948   24576        6
        5       30782   -216.581    77    30581   +218.004   61440       15
        6       41153   -238.724   122    40645   +241.707   81920       20
        7       30841   -259.855    50    30549   +262.338   61440       15
        8       12305   -279.920    15    12256   +281.039   24576        6
        9        2052   -297.321    16     2028   +300.840    4096        1

Case 6 yryyyyyry vs yyyyryyyy

                    N      Diff      N       N      Diff     Sum of   Sum of N's
    Mismatches   Less      Less    Zero    More     More       N's     / 4096
        3        2003   -166.014    22     2071   +160.563    4096        1
        4       12271   -191.948    36    12269   +191.979   24576        6
        5       30581   -218.004    77    30782   +216.581   61440       15
        6       40645   -241.707   122    41153   +238.724   81920       20
        7       30549   -262.338    50    30841   +259.855   61440       15
        8       12256   -281.039    15    12305   +279.920   24576        6
        9        2028   -300.840    16     2052   +297.321    4096        1


Nested Callback Handlers?

Question: I am getting a set of data from the database where the query produces a repetition of data with a different "Special" value. For example the user "A" can be repeated twice, having three different "Special" values under the "Special Column".
I am using a callback handler to retrieve the data and put it into a list, now additionally I want the Special column to have its own callback where for each user the specials list will be stored, so therefore the user data wont be repeatedly taken and stored into the list and I wont have to manually filter it out. Can anyone point me to a direction of achieving this?
Another way of achieving this is to concatenate the results into a string there itself, which would be easier, but the query seems to be complex and messy when I include the joins.
The code is below
<code>    String query   = getQuery(SPECIALS_REPORT_QUERY);

    getJdbcTemplate().query(query, parameters, dataTypes, new RowCallbackHandler() {
        @Override
        public void processRow(ResultSet rs) throws SQLException {

            SpecialsResultsSetDTO dto = new SpecialsResultsSetDTO();

            dto.setRoomNo(rs.getString("ROOM_NO"));
            dto.setGuestName(rs.getString("GUEST_NAME"));
            dto.setNoOfAdults((rs.getInt("NO_OF_ADULTS")));
            dto.setNoOfChildren(rs.getInt("NO_OF_CHILDREN"));
            dto.setNoOfInfants(rs.getInt("NO_OF_INFANTS"));
            dto.setMealPlanCode(rs.getString("MEAL_PLAN_CODE"));
            dto.setArrivalDateTime(rs.getDate("ARRIVAL_DATE_TIME"));
            dto.setDepartureDate(rs.getString("DEPARTURE_DATE"));

            //there should be a callback handler or something to store the data to a list in the dto bean object (for the specials)

            dtoList.add(dto);
        }
    });
</code>
Any advice on solving this problem would be helpful
Regards,
Milinda
Answer: In your dto cant you create an hashmap which would have the user as the key and special value as the column.

Nested Callback Handlers?


Oracle Apex Image Component seems to be escaping the ITEM SOURCE

Question: When I create my Image item in Apex 5 I am setting my source to be "Static Value" and am using this substitution string.
#APP_IMAGES#images/servlet.png

However, the HTML it is outputting seems to be escaped, and the image is not being returned in the rendered page.
The items is set up as "Image URL based on page item value" and then I am using a Static value with a substitution string.

Any advice appreciated.
Answer: I think your source should be just:
#APP_IMAGES#servlet.png

Comment: but when I uploaded the image as a static application file I specified "images" as the folder?  In fact I took the value "APP_IMAGES#images/servlet.png" straight from my list of static files presented back to me after the upload.
Comment: OK, but you keep omitting the leading # in your example, is that the issue?  It should be `#APP_IMAGES#images/servlet.png`
Comment: my apologies, this is what I am adding in the Static Value field:  #APP_IMAGES#images/servlet.png which I am copying from the shared components list itself.  Not sure why the leading hash got dropped, but I am entering with a forward #.


Your system is running in low graphics mode on 12.04 + no space left on device (issue)?

Question:
Possible Duplicate:
How to fix "The system is running in low-graphics mode" error?

EDIT: I managed to solve it myself... First of all I searched for the command to see my disk space... I discovered my drive was full, so after an LS I realise the "Documents" folder... I cd there and some of the things from windows that Ubuntu was trying to import were there... So I deleted the whole folder and rebooted. That fixed my issue! (including the low graphics issue)
I did a new install (my first Linux install, and my first Ubuntu install of course) on my HP Pavilion 7 (550 GB HD, AMD Radeon 6750M and AMD Radeon 6255G, 64 bits AMD A8 processor, Ubuntu x64 release):
The steps I followed for the installation were:
1- Delete the HP primary partition for HP_TOOLS (200MB)
2- Shrink my main partition (leaving 20 free GB more or less)
3- Run installation from Ubuntu's CD by booting from CD (not from windows).
4- Choose first default option (install Windows besides Linux).
The bootloader prompted correctly, so I decided to check firstly if my Windows partitions was still working... tested it and rebooted, then logged into my Ubuntu partition.
The error "your system is running in low-graphics mode" appeared, I try to have it resolved automatically with no success, and then tried to use the session anyway... in both cases the screen stayed black (or dark purple... I don't recall) so I rebooted.
On my third run I entered the command prompt in an atempt to try some of the fixes I've seen around.
1st thing I tried) :

sudo apt-get install fglrx

Which resulted in the download of the file...but when it was expanding the package the error "failed to extend .....(in each file)...no space left in device" appeared...then an error, and after the reboot Nothing.
2nd thing I tried) :

sudo apt-get install --reinstall ubuntu-desktop

Same issue.. but after using this I realised now my system didn't even show me the "running in low graphics mode", it just took me to a dark purple screen and stayed there (I could still log in any terminal). Notice this MAY HAVE happened after throwing the first command, and maybe I didn't notice, because I tried one solution after the other.
Any tips?
Please try to be as clear as possible as I'm not familiar with Linux environment... I do now one or other command, but please act as if I didn't know any, as I don't know many.
Comment: If you solved your issue please post it as an answer instead of adding it to the question, Thanks :)
Answer: I have same problem:
My configuration :

Virtualbox installed on pc (windows xp pro)
Ubuntu 12.04 installed as host in virtualbox

Yesterday when I was starting ubuntu on virtualbox I have Your system is running in low graphics mode.
After searching on the web I found this post : how-do-i-fix-your-system-is-running-in-low-graphics-mode
I tried this
   When the message that "Your system is running in low-graphics mode" appears, I have selected "Exit to console".
After I pressed Ctrl+Alt+F1, then login appears.
After logging I have typed these commands:
sudo apt-get install --reinstall ubuntu-desktop
sudo reboot

The problem was not resolved.
Then I logged to console and typed these commands :
sudo apt-get install gdm

After I have chosen gdm in menu then was done I typed :
sudo service gdm restart

And the sytem was rebooted normaly.
But now I have no space left on device (I have again 500Mb free)!
Actually I don't have solution for this problem and I'm searching.
Can you try this and give a feedback.
Good luck
Johan


How can i get the user data from the following vue array?

Question: The vue.js array output
This is my vue array out put . i am able to get the length of the likes by using @{{post.like.length}} but i am unable to fetch the perticular data like @{{post.like.id}} or @{{post.like.user_id}}
Comment: Well, you need to iterate over the list to access the individual items (`length` is a property of the array, `id` is a property each element features). Can you show, what you already tried?
Comment: You have not share any code and not any sample data
Comment: i have tried  @{{post.like[0].id}} but it is showing one array only not any other property .
Comment: i have shared a screenshot of the vue root in inspect element .check it please
Comment: `post.like[0]` is the whole `like` object? also, shouldn't be `post.likes[0]` (with `s`)?
Comment: Let me check that
Answer: To render the likes of a post within a template, use v-for. For example:

    Like ID: {{ like.id }},
    Post ID: {{ like.post_id }},
    User ID: {{ like.user_id }}

With plain JS, use forEach:
post.likes.forEach(function (like) {
  // access like.post_id, like.id, ...
});

Comment: thanks sir . i think i got the answer from your answer


Recent Nvidia drivers (418 and above) are not working on GTX 1660

Question: I'm running Ubuntu 20.04 (5.4.0-74-generic kernel) and I'm having a problems with Nvidia's drivers.  I have an Nvidia GTX 1660 video card and some of the drivers aren't working, my monitor never gets a signal and just stays turned off.  I was able to fix the problem by downgrading to the open source (Nouveau) driver.  In the "Additional Drivers" tab on the Software & Updates application there are several drivers available so I tested each one and got the following results....
Does not work:
Nvida driver metapackage nvidia-driver-460 (proprietary, tested)
Nvida driver metapackage nvidia-driver-465 (proprietary)

Works:
Nvida Server driver metapackage nvidia-driver-418-server (proprietary)
X.Org X Server -- Nouveau display driver from xserver-xorg-video-nouveau (open source)

So the only options for me are to use the 418 server driver or the open source driver.  My question is; How come the more recent version of Nvidia's drivers aren't working?  Is there a configuration setting I'm missing?
EDIT:
Solved it (kind of).  The dmesg showed this error
kernel: BUG: kernel NULL pointer dereference, address: 0000000000000020

Which many linux users are getting when they updated their Nvidia drivers to 455.23.04 and above (the issue still isn't fixed).  I installed driver 450.80.02 and the issue was solved.  If I update to 455.23.04 and above the issued comes back.  The problem is being discussed on Nvidia's help forum here: https://forums.developer.nvidia.com/t/bug-report-455-23-04-kernel-panic-due-to-null-pointer-dereference/155506
Comment: @Karlom Ubuntu's official 460 driver did not work, but their official 418 server driver worked.  Also, the 450 driver, which I downloaded from Nvidia's site, works.  Anything above version 450.23.04 does not work regardless of whether it's official or not.
Comment: Is the official driver released for Ubuntu 20.04? If not, no surprise that it does not work. I had the same issue with NVIDIA RX 580 driver, which is still only available for `18.04` and id did not work on my `20.04` machine.
Answer: The older versions of the proprietary Nvidia graphics driver are included in the default Ubuntu repositories so users can install them if the newer drivers don't work. Trying the available Nvidia driver versions until you find a version that works for you is all you can do in some situations. There is no magic configuration that makes a non-working Nvidia driver version work, and no magic reason that explains why a particular Nvidia driver version doesn't work for everyone either.


CakePHP: Can only load index.php, all pages 404 after Cake Bake

Question: I'm trying to bake my first CakePHP application and am unable to get any page to particularly load for me right now.  I've updated my config settings for salt,database, etc. and the index.php page tells me that I have configured everything.
So far I've used cake bake all on just one database table so far to make sure it loads properly.  I created the Model, Controller, and View for the standard add/index/view/edit pages.  When I try to access URL/organizations/index.php I'm hitting a 404 error however.
Is there any troubleshooting someone might have advice for how to solve this one?  It is confusing to me that the index.php loads (so it redirects properly when loading the webroot) but trying to view any View pages yields no results.  Is there any debug commands I can do to view what the valid pages would be?  Or any additional information I can provide?
Answer: If you try URL/index.php/organisations or something similar to this and it works, then there is an issue with URL re-writing on the server which you'll need to correct.
Answer: I believe if you have things set up correctly you would want to visit /organizations in order to access the index() method of the organizations controller.
In general the ".php" is left off of the URL, as your index.php file initiates all the bootstrapping and routing. This also requires a correct .htaccess setup. Hard to say exactly what the problem is without seeing the app or an error message.
Answer: Try in url
URL/organizations/index.php

To
URL/organizations/index
or
URL/organizations/index.ctp

Cakephp using .ctp extension, that means cakephp Template. Please see this link. And also you can see your app\view\Organizations folder. Here all file is with .ctp extension. Isn't it ?


Chrome bug when maximizing

Question: I'm running Ubuntu Gnome 16.04.  When I maximize Chrome it fills the screen except the right and bottom sides are invisible and the desktop shows through.  You can see other windows behind it, but the buttons on the invisible maximized chrome are still active.  If you drag the title bar down to un-maximize (or use the invisible buttons) the window returns to it's shape and is completely visible.

Here's another shot of the maximized window in expose mode showing the entire graphical bug.  Notice that the window selector shows the right and bottom sides as transparent.
Answer: I haven't found a complete solution.  But I dug up an old bug report for Chromium (the opensource version of Chrome) regarding the exact same issue.
One of the commenters posted a workaround:

It means that the WM is somehow failing to resize the window properly. We've had this
  kind of problem before, but I couldn't find the bug for it. As a workaround, you could
  try enabling the system titlebar (right click on empty part of tab strip).

This works for now.

Chrome bug when maximizing


React-Native-Maps Marker Array in Child Component

Question: I'm currently learning react-native and react-native-maps (using typescript ES6) and I'm having some issues rendering markers in that they just don't appear. I've attempted to separate my logic into components that make's sense to me but I'm wondering if this is the reason I can't get them to render.
What I have is the following:
Main Map Component
<MapView style={styles.map}
         region={this.props.region}
         showsUserLocation={true}
         followsUserLocation={false}>
    <View>
        <SearchCircle />
        <MarkerList />
    <View>
 <MapView>

SearchCircle
The SearchCircle works perfectly and the code contains:
import { Circle } from 'react-native-maps';

...

class SearchCircle extends React.Component<SearchProps> {
    render() {
        return (
            <Circle center={this.props.user.location}
                    radius={this.props.map.searchRadius}
                    fillColor={'rgba(230,238,255,0.5)'}
                    strokeColor={'#1A66FF'}
                    strokeWidth={1} />
        );
    }
}

MarkerList - ISSUE
The MarkerList is the component that does not render correctly. It contains:
class MarkerList extends React.Component<MarkerListProps> {

    // render our contacts
    render() {
        return (
            <View>
                {this.props.markerlist[0] != undefined && this.props.markerList.map((marker, index) => (
                    this.renderMarker( marker, index )
                ))}
            </View>
        );
    }

    renderMarker( marker: MarkerEntry, index: number ) {
        return (
            <View key={index}>
                <Marker coordinate={marker.location} title={marker.title} />
                <Text>{'Lat: ' + marker.location.latitude + ', Long: ' + marker.location.longitude}</Text>
            </View>
        );
    }
}

The MarkerList component does call render() when the state updates (when I update the markers locations) BUT only the Text element renders/updates correctly. The Lat/Lng is displayed correctly on my screen however the Marker element does not appear at all. The markerlist property for the MarkerList component is a list of type MarkerEntry which contains the following:
interface MarkerEntry {
    title: string
    location: LatLng
}

No matter what I try, I cannot get any markers to render from this array. If I statically define markers then everything works just fine but with my property array list map they never render.
Static Example that works
class MarkerList extends React.Component<MarkerListProps> {

    // render our contacts
    render() {

        let marker = {
            id: 'Test',
            location: {
                latitude: -31.970097415447232,
                longitude: 115.92362245895334
            }
        };

        let markerArray: any[] = [];
        markerArray.push( marker );

        return (
            <View>
                {markerArray[0] != undefined && markerArray.map((c, index) => (
                    <Marker key={index} coordinate={c.location} title={c.id} />
                ))}
            </View>
        );
    }
}

Is anyone able to assist. I can't understand what I'm doing wrong or if I'm missing something about how react-native should be structured for this to work.
Thanks in advance!
Answer: So I've managed to solve my problem and thought I'd leave my final solution here for anyone else that needs it. The issues were with how I was defining the MapView and also with how I was returning the map results.
Map Component
For the main map component I had to remove the child <View> entry I had defined.
Before
<MapView style={styles.map}
         region={this.props.region}
         showsUserLocation={true}
         followsUserLocation={false}>
    <View>**
        <SearchCircle />
        <MarkerList />
    <View>
 <MapView>

After
<MapView style={styles.map}
         region={this.props.region}
         showsUserLocation={true}
         followsUserLocation={false}>
    <SearchCircle />
    <MarkerList />
 <MapView>

MarkerList
The second part I had to change was the render function and it's syntax in the render function.
Before
class MarkerList extends React.Component<MarkerListProps> {
    // render our contacts
    render() {
        return (
            <View>
                {this.props.markerlist[0] != undefined && this.props.markerList.map((marker, index) => (
                    this.renderMarker( marker, index )
                ))}
            </View>
        );
    }

    renderMarker( marker: MarkerEntry, index: number ) {
        return (
            <View key={index}>
                <Marker coordinate={marker.location} title={marker.title} />
                <Text>{'Lat: ' + marker.location.latitude + ', Long: ' + marker.location.longitude}</Text>
            </View>
        );
    }
}

After
Note the additional return statements outside and inside the map call and the removal of the <View> element.
class MarkerList extends React.Component<MarkerListProps> {
    // render our contacts
    render() {
        return this.props.markerList.map((marker, index) => {
            return( this.renderMarker( marker, index ));
        });
    }

    renderMarker( marker: MarkerEntry index: number)  {
        return (
            <View key={index}>
                <Marker coordinate={marker.location} title={marker.title} />
            </View>
        );
    }
}


ChromiumWebBrowser opens blank form why?

Question: I created a project and added CefSharp.WinForms from nuget in it.
I gave an address and ChromiumWebBrowser opened it. While I was navigating around this address, I clicked a download link. No problem, the file is downloaded. but with that an empty form opens.
what is this empty form, why is it opening and how can i close it from the code?
Blank Form Comes Link
Answer: If the link you clicked opened a popup then a blank window is expected. You can hide the window until the download is complete then close it. The following code saves all files to a temp folder. You can change the folder to a path within the users profile or instead of UseFolder call AskUser.
<code>[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool IsWindowVisible(IntPtr hWnd);

[DllImport("user32.dll")]
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

var tempPath = System.IO.Path.GetTempPath();

browser.DownloadHandler =
    Fluent.DownloadHandler.UseFolder(tempPath,
        (chromiumBrowser, browser, downloadItem, callback) =>
        {
            if (downloadItem.IsComplete || downloadItem.IsCancelled)
            {
                if (browser.IsPopup && !browser.HasDocument)
                {
                    browser.GetHost().CloseBrowser(true);
                }
            }
            //TODO: You may wish to customise this condition to better suite your
            //requirements.
            else if(downloadItem.ReceivedBytes < 100)
            {
                var popupHwnd = browser.GetHost().GetWindowHandle();

                var visible = IsWindowVisible(popupHwnd);
                if(visible)
                {
                    const int SW_HIDE = 0;
                    ShowWindow(popupHwnd, SW_HIDE);
                }
            }
        });
</code>
Comment: http://cefsharp.github.io/api/100.0.x/html/M_CefSharp_Fluent_DownloadHandler_AskUser.htm


From C++ how to execute a method or access struct which is in C?

Question: I need to pass string value from C++ to C library.
How do you call CppCallToC or from .cpp how can i access the struct rtmp_stream *stream; ?
C++ file: UI/window-basic-main.cpp:
void OBSBasic::Load(const char *file) {
  //From C++ how to go to the C method?
  CppCallToC();
}

C file: plugin/obs-outputs/rtmp-stream.c:
static void CppCallToC() {

  //https://github.com/jp9000/obs-studio/blob/master/libobs/util/dstr.h
  //struct dstr      path, key;
  struct rtmp_stream *stream;
  //dstr_printf(&stream->path,  obs_path);
  //dstr_printf(&stream->key,   obs_key);
}

Comment: `std::string` and references aren't `c`.
Comment: 1. You can't access local variables in a different function; 2. You can't call that function anyway – and you're not supposed to – since it's static; 3. This looks like an [XY problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem).
Answer: Your problem is not a C vs C++ issue. All functions in rtmp-stream.c are declared static, which means they have internal linkage and cannot be called from a different compilation unit. You can only access those functions indirectly via the rtmp_output_info struct defined at the end of the file and declared in obs-outputs.c, and even that declaration is only available within that file.
I don't know anything about OBS Studio, so I can't help you any more than that, I'm afraid. You'll have to track down what happens in obs_register_output(&rtmp_output_info).


store a mysql result set as Session item for For future use

Question: can i do that in PHP:
when my website first load i want to
connect my DB execute a query and keep the result set as Session item.
than i want to be able to execute a select query on this result set.
something like this(pseudo code):
<code><?php

    include 'open_connection.php';

        $result = mysqli_query($con,"SELECT `city`,`state_code` FROM `cities`");

        mysqli_close($con);

        session_start();

        $_SESSION['TABLE'] = $result;

        //than run a query on the result set
           $result = mysqli_query($_SESSION['TABLE'],"SELECT `city`,`state_code` FROM `cities`");

?>
</code>
something like asp.net disconnected architecture.
can i do it?
thank you.
Comment: Store it in an array...
Comment: If you are repeatedly executing this query, MySQL will likely be able to cache it _for you_ automatically, especially since you have no `WHERE` clause. Its performance will be excellent.
Answer: No, you cannot do it in PHP nor you have any need in this.
Storing table contents in a session will create awfully unreliable and - worst part - incredibly multiplied "cache".
While you don't need such a cache at all:
A database is not something big and hulky, nor something to be afraid of. Generally speaking it's the same storage as a session. Yet it can be blazingly fast and require no cache at all if used properly. Such an issue of getting city via primary key lookup is indeed the case.
Just get your data right from DB every time you need it and don't bother with sessions at all
Answer: I would prefer :
1) the mysql cache functions to set look at :
http://dev.mysql.com/doc/refman/5.1/en/query-cache.html
2) Or if u have hughe amount to cache then i would advice php memcache http://php.net/manual/en/book.memcache.php.
It's easy to setup.


Is it possible to modify arrow damage in Minecraft 1.8

Question: It seems there will be a NBT tag in minecraft 1.9 that will allow to set custom damage. In the meanwhile, is there a way to do it in previous versions?
Comment: Detect when the player is hit and deal additional damage?
Answer: Yes, you can modify arrow damage with the damage tag of the Arrow entity. This has been present since the power enchantment was added.
E.g.
/summon Arrow ~ ~5 ~ {damage:10}

Comment: You can use `entitydata` on a fast clock to set the damage of all arrows in the game (except super-point blank shots). Note: Doing this will override any Power enchantments placed on the bow.
Comment: You could also use stats to detect when someone uses a bow, then change the nearest arrow's damage based on the enchant on the bow they are holding, if power is important
Comment: @Lionitow Yes, arrow items do not have this tag. There are ways to work around this though. You could use `execute` on players that have just shot a bow and have these special arrows to change the data of arrows in their immediate vicinity.
Comment: Does it mean that I cannot give item arrows with the damage tag?
Comment: @MrLemon Wouldn't that mean an unbuffed player shooting a buffed player could still get the buff?
Comment: @acbabis theoretically, yes. But note that entitydata is only called in the same tick as the shooter fires (using a `stat.useItem.bow` objective). It will take some testing to determine the minimal radius around the shooter in which this will still work, but if that is small enough, the chance to enhance incoming arrows should be tolerably low (I could be wrong though).
Comment: 1.13 updates to previous comments: you use `/data merge entity` instead of `/entitydata` and `minecraft.used:minecraft.bow` instead of `stat.useItem.bow`.


How to win the pike proving ground?

Question: Even though I upgraded my Brusher's Pike to level 5, I still can't seem to get the 1st prize in Camp Dauncy, the Pike's proving ground. My best is 10 seconds later than the threshold.
I know that I don't have to kill all the pincushions and that I can throw the pike to clear multiple pincushions in a row, but I still can't make it. Are there any other tips on how to win it, or perhaps even a precise guide?
Answer: First, this is the set-up you should use:
Tonics:

Werewhiskey
Hearty Punch

Spear Upgrades:

Hunting Grip
Hollowed Staff

The reasoning for the Hollowed Staff is the increased reload speed will help cut a few seconds off the clock, and the Hunting Grip will result in +50% critical hit damage since you'll have Werewhiskey activate.
Do not pick up the spear yet. Go to the area to your left, and position yourself around the center and kill yourself.  The hearty punch will result in most of the the enemies in this area being destroyed, which will save you a fair amount of time. Now you want to jump off the side until were whiskey activates, giving you 100% critical hit chance.
Pick up the spear. Go to the area to the left and activate the switch there. From here, you have a little more choice. I follow the path taken in the video, in which he first goes for the center switch, right most switch, left most switch, the switch near the exit, and then the top switch. However I've seen others go for the top switch first, and save the switch near the exit for last.
Finally, here is a video walk through of it, in case you prefer visual guides. As you will see in the video, it is possible to beat this without using the hearty punch, but it does it make easier:
Comment: The combination of werewhiskey and hearty punch definitely made things easier, got my prize! Thanks
Comment: You could also just die and restart to kill the pincushions.
Answer: I know I'm pretty late to the party, but I only recently started playing anyway. I managed to get 1st place in this challenge with only the first tier upgrade for the pike (crit chance, which is useless in this case since I didn't use werewhiskey), and a hearty potion. So basically, just the basic pike and a hearty potion.
It took me probably around 20 tries to perfect my route, but I ended up using the following route:
Bottom left -> center -> bottom right -> top right -> top -> top left
By running through a few attacks, and lining up the right throws, it's possible, but just barely. After figuring out my final plan, out of 3 attempts, I got 1:00, 1:00, and 0:57 where I finally got 1st place. If anyone is interested in seeing a video guide for my route, just ask, and I'll get on it.

How to win the pike proving ground?


panelAccordion inside panelTabbed does not expand

Question: I have a problem using accordionPanel inside one of tabs, I can't expand accordion item to show its content. Works nicely outside tabbedPanel. Can anybody help? I suppose it might be something with nested showDetailItems, but even when every component has its own Id it still does not work.
Here is the code I have problem with:
<code>            <tr:panelTabbed id="pt1">
            <tr:showDetailItem text="Tab 1" id="sdiT1">
                <tr:panelHeader text="Header 1" />
                <tr:panelAccordion discloseNone="true" id="pa1">
                    <tr:showDetailItem text="Accordion 1" id="sdiA1">
                        <tr:panelHeader text="Header 1" />
                    </tr:showDetailItem>
                    <tr:showDetailItem text="Accordion 2" id="sdiA2">
                        <tr:panelHeader text="Header 2" />
                    </tr:showDetailItem>
                    <tr:showDetailItem text="Accordion 3" id="sdiA3">
                        <tr:panelHeader text="Header 3" />
                    </tr:showDetailItem>
                </tr:panelAccordion>
            </tr:showDetailItem>
            <tr:showDetailItem text="Tab 2" id="sdiT2">
                <tr:panelHeader text="Header 2" />
            </tr:showDetailItem>
            <tr:showDetailItem text="Tab 3" id="sdiT3">
                <tr:panelHeader text="Header 3" />
            </tr:showDetailItem>
            <tr:showDetailItem text="Tab 4" id="sdiT4">
                <tr:panelHeader text="Header 4" />
            </tr:showDetailItem>
            <tr:showDetailItem text="Tab 5" id="sdiT5">
                <tr:panelHeader text="Header 5" />
            </tr:showDetailItem>
        </tr:panelTabbed>
</code>
Thanks in advance
Comment: I think it can be something with maximum open tabs (showItemDetails) set default to 1. If it also applies to showItemDetails in panelAccordion, nothing can be shown.
Answer: I have tested your code and it works. Is the above code inside a
<code><tr:form>
</code>
tag?
I am on jsf1.2 and trinidad 1.2.14
Comment: Yes it was. After I have removed it from `` it worked! Thank you.


Compute explicitly Lévy–Prokhorov metric for $2$ finite Dirac measures

Question:
Let $(X, d)$ be a metric space and $\mathcal{M} :=\mathcal{M}(X)$ the space all non-negative finite Borel measures on $X$. The Prokhorov metric $d_P$ on $\mathcal{M}$ is defined by
$$
d_{P}(\mu, \nu) :=
\inf \left\{ \alpha>0 \,\middle\vert\,
\begin{align*}
\mu(A) \leq \nu\left(A_{\alpha}\right)+\alpha \\
\nu(A) \leq \mu \left(A_{\alpha}\right)+\alpha
\end{align*} \quad
\forall A \in \mathcal{B}(X)
\right\},
$$
with $A_{\alpha} := \{x \mid d(x, A)<\alpha\}$ and $d(x, A) := \inf \{d(x, a) \mid a \in A\}$.

Previously, I proved that $d_P$ is indeed a metric. In my lecture note, $d_P$ has been computed for Dirac probability measures, i.e.,
$$
d_P (\delta_x, \delta_y) = \min\{d(x, y), 1\} \quad \forall x,y \in X.
$$
Now I try to compute it for finite Dirac measures, i.e.,

Let $\mu := a \delta_x$ and $\nu := b \delta_y$ with $a,b \ge 0$ and $x,y \in X$. Compute $d_P(\mu, \nu)$.

Could you have a check on my attempt?
I post my proof separately as below answer. If other people post an answer, of course I will happily accept theirs. Otherwise, this allows me to subsequently remove this question from unanswered list.
Answer:
Let $A = \{x\}$. Then $\mu(A)=\mu(A_\alpha) = a$. Also, $\nu(A) = b1_{x=y}$ and $\nu(A_\alpha) = b1_{\{\alpha>d(x,y)\}}$. If $\alpha > d(x, y)$, the conditions become $\alpha \ge \max \{a-b, b1_{x=y}-a\}$. If $\alpha \le d(x, y)$, the conditions become $\alpha \ge \max \{a, b1_{x=y}-a\}$.

Let $A = \{y\}$. If $\alpha > d(x, y)$, the conditions become $\alpha \ge \max \{b-a, a1_{x=y}-b\}$. If $\alpha \le d(x, y)$, the conditions become $\alpha \ge \max \{b, a1_{x=y}-b\}$.

Let $A = \{x, y\}$. Then $\alpha \ge \max \{ a-b, b-a \} = |a-b|$.

Clearly, $|a-b| \ge \max \{b1_{x=y}-a, a1_{x=y}-b\}$. So the combination of above cases reduces to

Let $A = \{x\}$. If $\alpha > d(x, y)$, the conditions become $\alpha \ge |a-b|$. If $\alpha \le d(x, y)$, the conditions become $\alpha \ge \max \{a, |a-b|\}$.

Let $A = \{y\}$. If $\alpha > d(x, y)$, the conditions become $\alpha \ge |a-b|$. If $\alpha \le d(x, y)$, the conditions become $\alpha \ge \max \{b, |a-b|\}$.

Let $A = \{x, y\}$. Then $\alpha \ge |a-b|$.

So the set of eligible $\alpha$ on which we take the infimum is
$$
\mathcal A := \{ \alpha > d(x,y), \alpha \ge |a-b|\} \bigcup \{ \alpha \le d(x,y), \alpha \ge \max \{a,b,|a-b|\}\}.
$$
Notice that $a,b \ge0$, so $\alpha \ge \max \{a,b,|a-b|\} \iff \alpha \ge \{a,b\}$. Then
$$
\mathcal A = \{ \alpha > d(x,y), \alpha \ge |a-b|\} \bigcup \{ \alpha \le d(x,y), \alpha \ge \max \{a,b\} \}.
$$

If $\max \{a,b\} \le d(x,y)$, then $|a-b| \le d(x,y)$. So
$$
\begin{align}
\mathcal A &= \{ \alpha > d(x,y)\} \bigcup \{ \max \{a,b\} \le \alpha \le d(x,y)\} \\
&= \{ \alpha > d(x,y)\}.
\end{align}
$$
Then $d_P(\mu, \nu) = \inf \mathcal A = \max\{a,b\}$.

If $\max \{a,b\} > d(x,y)$, then
$$
\begin{align}
\mathcal A &= \{ \alpha > d(x,y), \alpha \ge |a-b| \}.
\end{align}
$$
Then $d_P(\mu, \nu) = \inf \mathcal A = \max \{d(x,y), |a-b|\}$.


Whirlpool ice maker making knocking noise, but still makes ice

Question: Ice maker is making ice but has started making a clicking noise.  I can see the two gears slipping and making the noise.  It is still making ice, but the noise is irritating.  Any suggestions how to fix this?  The gears do not look damaged.
Comment: What model is this unit?
Comment: Does it eject normally? You haven't made it clear *when* it clicks. Please edit your post to explain better and add model information.
Comment: My Whirlpool ice maker failed in 13 months ( after warrentee).. I fixed it by getting a Samsung refrigerator.
Answer: I had the exact same issue.  Web search just turned up retailers and drop shippers trying to sell me a new ice maker.
DO NOT ATTEMPT THIS KIND OF REPAIR UNLESS YOU ARE COMFORTABLE WITH WIRING ISSUES!!
There are several YouTube videos showing how to remove and replace the ice maker from the freezer.
What I discovered was a poor connection at the factory wire nut connecting the thermostat to the heating element.  This prevented the heating element from warming up fast enough to free the cubes before the ejection fingers hit the cubes.  Fingers could not move causing the gears to slip.  I simply removed the crimped wire nut, soldered the connection and replaced the wire nut with a twist on type.  Unit has worked great ever since.