text:
Q: How do I use the mouse to click on a cell in the parent window's Qtablewidget to get a value, and then fill it into the child's QlineEdit? I want to do a function, kind of like insert function in Excel,just like this:

Now I'm confused about how to use the mouse to fetch data in the parent window (Qtablewidget) and fill the data into the lineEdit that the mouse cursor stays in the child window.In other words, how do I know which component the cursor is in.
Here is MainWindow.py:
from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(1191, 941)
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(Form)
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.frame = QtWidgets.QFrame(Form)
        self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame.setObjectName("frame")
        self.horizontalLayout = QtWidgets.QHBoxLayout(self.frame)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.pushButton = QtWidgets.QPushButton(self.frame)
        self.pushButton.setObjectName("pushButton")
        self.horizontalLayout.addWidget(self.pushButton)
        self.pushButton_2 = QtWidgets.QPushButton(self.frame)
        self.pushButton_2.setObjectName("pushButton_2")
        self.horizontalLayout.addWidget(self.pushButton_2)
        spacerItem = QtWidgets.QSpacerItem(940, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.verticalLayout_2.addWidget(self.frame)
        self.tabWidget = QtWidgets.QTabWidget(Form)
        self.tabWidget.setTabPosition(QtWidgets.QTabWidget.West)
        self.tabWidget.setObjectName("tabWidget")
        self.tab = QtWidgets.QWidget()
        self.tab.setObjectName("tab")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.tab)
        self.verticalLayout.setObjectName("verticalLayout")
        self.tableWidget = QtWidgets.QTableWidget(self.tab)
        self.tableWidget.setRowCount(5)
        self.tableWidget.setObjectName("tableWidget")
        self.tableWidget.setColumnCount(4)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setHorizontalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setHorizontalHeaderItem(1, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setHorizontalHeaderItem(2, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setHorizontalHeaderItem(3, item)
        self.verticalLayout.addWidget(self.tableWidget)
        self.tabWidget.addTab(self.tab, "")
        self.tab_2 = QtWidgets.QWidget()
        self.tab_2.setObjectName("tab_2")
        self.tabWidget.addTab(self.tab_2, "")
        self.verticalLayout_2.addWidget(self.tabWidget)
        self.verticalLayout_3.addLayout(self.verticalLayout_2)

        self.retranslateUi(Form)
        self.tabWidget.setCurrentIndex(0)
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        _translate = QtCore.QCoreApplication.translate
        Form.setWindowTitle(_translate("Form", "Form"))
        self.pushButton.setText(_translate("Form", "PushButton"))
        self.pushButton_2.setText(_translate("Form", "PushButton"))
        item = self.tableWidget.horizontalHeaderItem(0)
        item.setText(_translate("Form", "A"))
        item = self.tableWidget.horizontalHeaderItem(1)
        item.setText(_translate("Form", "B"))
        item = self.tableWidget.horizontalHeaderItem(2)
        item.setText(_translate("Form", "C"))
        item = self.tableWidget.horizontalHeaderItem(3)
        item.setText(_translate("Form", "D"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("Form", "Tab 1"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("Form", "Tab 2"))

Here is ChildWindow.py:
from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_Dialog(object):
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(558, 331)
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(Dialog)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.frame = QtWidgets.QFrame(Dialog)
        self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame.setObjectName("frame")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.frame)
        self.verticalLayout.setObjectName("verticalLayout")
        self.groupBox = QtWidgets.QGroupBox(self.frame)
        self.groupBox.setObjectName("groupBox")
        self.gridLayout = QtWidgets.QGridLayout(self.groupBox)
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtWidgets.QLabel(self.groupBox)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
        self.lineEdit = QtWidgets.QLineEdit(self.groupBox)
        self.lineEdit.setObjectName("lineEdit")
        self.gridLayout.addWidget(self.lineEdit, 0, 1, 1, 1)
        self.label_2 = QtWidgets.QLabel(self.groupBox)
        self.label_2.setObjectName("label_2")
        self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
        self.lineEdit_2 = QtWidgets.QLineEdit(self.groupBox)
        self.lineEdit_2.setObjectName("lineEdit_2")
        self.gridLayout.addWidget(self.lineEdit_2, 1, 1, 1, 1)
        self.label_3 = QtWidgets.QLabel(self.groupBox)
        self.label_3.setObjectName("label_3")
        self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)
        self.lineEdit_3 = QtWidgets.QLineEdit(self.groupBox)
        self.lineEdit_3.setObjectName("lineEdit_3")
        self.gridLayout.addWidget(self.lineEdit_3, 2, 1, 1, 1)
        self.verticalLayout.addWidget(self.groupBox)
        self.frame_2 = QtWidgets.QFrame(self.frame)
        self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_2.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.frame_2.setObjectName("frame_2")
        self.horizontalLayout = QtWidgets.QHBoxLayout(self.frame_2)
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtWidgets.QSpacerItem(88, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.pushButton_3 = QtWidgets.QPushButton(self.frame_2)
        self.pushButton_3.setObjectName("pushButton_3")
        self.horizontalLayout.addWidget(self.pushButton_3)
        spacerItem1 = QtWidgets.QSpacerItem(87, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem1)
        self.verticalLayout.addWidget(self.frame_2)
        self.verticalLayout_2.addWidget(self.frame)
        self.line = QtWidgets.QFrame(Dialog)
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line.setObjectName("line")
        self.verticalLayout_2.addWidget(self.line)
        self.frame_3 = QtWidgets.QFrame(Dialog)
        self.frame_3.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_3.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_3.setObjectName("frame_3")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.frame_3)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        spacerItem2 = QtWidgets.QSpacerItem(150, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem2)
        self.pushButton_4 = QtWidgets.QPushButton(self.frame_3)
        self.pushButton_4.setObjectName("pushButton_4")
        self.horizontalLayout_2.addWidget(self.pushButton_4)
        self.pushButton_5 = QtWidgets.QPushButton(self.frame_3)
        self.pushButton_5.setObjectName("pushButton_5")
        self.horizontalLayout_2.addWidget(self.pushButton_5)
        spacerItem3 = QtWidgets.QSpacerItem(149, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem3)
        self.verticalLayout_2.addWidget(self.frame_3)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)

    def retranslateUi(self, Dialog):
        _translate = QtCore.QCoreApplication.translate
        Dialog.setWindowTitle(_translate("Dialog", "IF_1"))
        self.groupBox.setTitle(_translate("Dialog", "IF"))
        self.label.setText(_translate("Dialog", "Logical_text"))
        self.label_2.setText(_translate("Dialog", "True_value"))
        self.label_3.setText(_translate("Dialog", "Flase_value"))
        self.pushButton_3.setToolTip(_translate("Dialog", "
打开下一级嵌套
"))
        self.pushButton_3.setText(_translate("Dialog", "Nested"))
        self.pushButton_4.setText(_translate("Dialog", "Save"))
        self.pushButton_5.setText(_translate("Dialog", "Close"))

Here is the logical file:
import sys, traceback

from PyQt5 import QtCore
from PyQt5.QtWidgets import QApplication, QMenu, QTableWidgetItem, QWidget, QDialog, QMessageBox
from PyQt5.QtCore import QObject, Qt, pyqtSignal

from UI.test import test
from UI.test.IF_1 import Ui_Dialog

class IF_window(QDialog, Ui_Dialog):
    Signal = pyqtSignal(str)

    def __init__(self):
        super(IF_window, self).__init__()
        self.setupUi(self)
        #self.pushButton_3.clicked.connect(self.btnclick)
        self.pushButton_4.clicked.connect(self.trans_data)
        self.pushButton_5.clicked.connect(self.close)

    def trans_data(self):
        a = self.lineEdit.text()
        b = self.lineEdit_2.text()
        c = self.lineEdit_3.text()
        d = 'IF(' + a + ',' + b + ',' + c + ')'
        self.Signal.emit(d)
        QMessageBox.information(self, "notice", "Save success!", QMessageBox.Yes)

    def btnclick(self):
        try:
            self.form = IF_window_2()
            #styleFile = 'E:\Development\Study\Qss\qss.css'
            #qssStyle = CommonHelper.readQss(styleFile)
            #self.form.setStyleSheet(qssStyle)
            self.form.Signal_1.connect(self.signal_text_1)
            self.form.Signal_2.connect(self.signal_text_2)
            self.form.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
            self.form.show()
        except:
            exc_type, exc_value, exc_traceback = sys.exc_info()
            a = repr(traceback.format_exception(exc_type, exc_value,
                                                exc_traceback))
            QMessageBox.information(self, "notice", a, QMessageBox.Yes)

    def signal_text_1(self, d):
        self.lineEdit_2.setText(d)

    def signal_text_2(self, d):
        self.lineEdit_3.setText(d)

class MyMainWindow(QWidget, test.Ui_Form):
    def __init__(self):
        super(MyMainWindow, self).__init__()
        self.setupUi(self)

        self.tableWidget.setContextMenuPolicy(Qt.CustomContextMenu)
        self.tableWidget.customContextMenuRequested.connect(self.generateMenu)

    def generateMenu(self, pos):

        try:
            column_num = -1
            row_sum = []
            column_sum = []
            for i in self.tableWidget.selectionModel().selection().indexes():
                row_num = i.row()
                column_num = i.column()
                row_sum.append(row_num)
                column_sum.append(column_num)

            if column_num != -1:
                menu = QMenu()
                item1 = menu.addAction(u"IF_function")
                action = menu.exec_(self.tableWidget.mapToGlobal(pos))

                if action == item1:
                    self.form = IF_window()
                    #styleFile = 'E:\Development\Study\Qss\qss.css'
                    #qssStyle = CommonHelper.readQss(styleFile)
                    #self.form.setStyleSheet(qssStyle)
                    self.form.Signal.connect(self.get_data)
                    self.form.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
                    self.form.show()
                else:
                    return

        except:
            exc_type, exc_value, exc_traceback = sys.exc_info()
            a = repr(traceback.format_exception(exc_type, exc_value,
                                                exc_traceback))
            QMessageBox.information(self, "notice", a, QMessageBox.Yes)

    def get_data(self, d):
        try:
            row_sum = []
            column_sum = []
            for i in self.tableWidget.selectionModel().selection().indexes():
                row_num = i.row()
                column_num = i.column()
                row_sum.append(row_num)
                column_sum.append(column_num)
            data = QTableWidgetItem(d)
            self.tableWidget.setItem(row_sum[0], column_sum[0], data)

            print(row_sum[0], column_sum[0])

        except:
            exc_type, exc_value, exc_traceback = sys.exc_info()
            a = repr(traceback.format_exception(exc_type, exc_value,
                                                exc_traceback))
            QMessageBox.information(self, "notice", a, QMessageBox.Yes)

class CommonHelper:
    def __init__(self):
        pass

    @staticmethod
    def readQss(style):
        with open(style, 'r', encoding='UTF-8') as f:
            return f.read()

if __name__ == "__main__":
    app = QApplication(sys.argv)
    win = MyMainWindow()
    #styleFile = 'E:\Development\Study\Qss\qss.css'
    #qssStyle = CommonHelper.readQss(styleFile)
    #win.setStyleSheet(qssStyle)
    win.show()
    sys.exit(app.exec_())

A: I solved this problem by adding a clicked signal to the childwindow's LineEdit , which fires a text signal .The parentwindow takes the signal and uses the text to determine which child's LineEdit was clicked, then gets the value of the parent window's clicked cell,and  simply setText().


text:
Q: bootstrap 4 table search not returning good rows I have a table with bootstrap 4 but when you search I get this:

As you can see I search for data but for some reason also HDMI > HDMI for example pops up which has no word of data in it.
Why is that and how can I solve this?
Here is my code for the table:
<!DOCTYPE html>

<?php
include("protected.php");
?>
<title>Inventory</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Dashboard</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/dataTables.bootstrap4.min.css">

<?php include_once("navbar.html"); ?>

Inventaris

                    <?php
                    // Include config file
                    require_once "config.php";
                    // Attempt select query execution
                    $sql = "SELECT * FROM products ORDER BY merk,model";
                    if($result = mysqli_query($link, $sql)){
                        if(mysqli_num_rows($result) > 0){
                            echo "
";
                                echo "
";
                                    echo "
";
                                        echo "Merk	";
                                        echo "Model	";
                                        echo "voorraad	";
                                        echo "threshold	";
                                        echo "Action	";
                                    echo "
";
                                echo "
";
                                echo "
";
                                while($row = mysqli_fetch_array($result)){
                                    $sql2 = "SELECT SUM(aantal) FROM mutaties WHERE product_id = ".$row['id'];
                                    if($result2 = mysqli_query($link, $sql2)){
                                    $row2 = mysqli_fetch_array($result2);
                                        if(empty($row2['SUM(aantal)'])){
                                            $voorraad = "0";
                                        }
                                        else{
                                            $voorraad = $row2['SUM(aantal)'];
                                        }
                                    }
                                    else{
                                        echo "Error";
                                    }

                                    if($voorraad < $row['threshold'])
                                    {
                                        $sql4 = "SELECT * FROM orders WHERE geleverd = 0 AND product_id =" .$row['id'];
                                        if($result4 = mysqli_query($link,$sql4))
                                        {
                                                if(mysqli_num_rows($result4)>0)
                                                {
                                                    $classNaam = 'oranje';
                                                }
                                                else
                                                {
                                                    $classNaam = 'red';
                                                }
                                        }

                                    }
                                    else
                                    {
                                        $classNaam = '';

                                    }

                                    echo '
';
                                        echo "" . $row['merk'] . "	";
                                        echo "" . $row['model'] . "	";
                                        echo "" . $voorraad . "	";
                                        echo "" . $row['threshold'] . "	";
                                        echo "";
                                            echo "";
                                            echo "";
                                            echo "";
                                            echo "";
                                            echo "";
                                            echo "	";
                                    echo "
";
                                }
                                echo "
";
                            echo "
";
                            // Free result set
                            mysqli_free_result($result);
                        } else{
                            echo "
Er zijn momenteel geen producten
";
                        }
                    }
                    else{
                    echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
                    }
                    // Close connection
                    mysqli_close($link);
                    ?>

When I type in the search field HDMI all the hdmi show up and nothing more.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Setting Environment Variables at the User level I have a Jenkins setup where i want to configure the environment variable before building my pipeline.
I can set the environment variable in the configure page and use it in Jobs. However, I can not give the Administrator permission to the user to set it up. In-order to set the Environment variable user should have the admin access.
I have taken a look into the Injecting Environment variable at the Job level by installing Environment inject plugin. In this case also, user has to come to the configuring the job and set up.
Please let me know if there is a way to have the external script file and set the environment variable through it.

A: You can use the "This project is parameterized" option in jenkins job configure page and pass the arguments.

You can also have "environment" block in Jenkinsfile to declare all the variable.
environment {
        CC = 'clang'
    }

Please follow the link for more information.

A: please refer https://jenkins.io/doc/book/pipeline/syntax/#environment
pipeline {
   agent none
   environment {
       field = 'some'
   }
   stages {
       stage ('Preparation') {
           agent { label 'master'}
           environment {
               JENKINS_PATH = sh(script: 'pwd', , returnStdout: true).trim()
           }
           steps {
               echo "Hello world"
               echo "PATH=${JENKINS_PATH}"
               sh 'echo "JP=$JENKINS_PATH"'
          }
      }
   }
}


text:
Q: run user defined function, if number of user connected through sockets is atleast one - Nodejs I am trying to find a way to stop setInterval(test,5000) function from running if no user is connected to the socket stop setInterval function as it causes lot of waste of resources.
I found the method but I dont know how to put it
io.engine.clientsCount  //this will tell number of users connected but only inside socket.on function.

below is my code:
var connectCounter = 0;

app.get('/', function(req, res){
  res.sendFile(__dirname + '/index.html');
});

 function test()
  {
    httpk.get("api-url", function(res) {
        var body = '';
        res.on('data', function(data){
            body += data;
        });

        res.on('end', function() {
            var parsed = JSON.parse(body);
            console.log(parsed.johndoe.example1);
            nsp.emit('live-quote', parseFloat(parsed.johndoe.example1);
        });
    });
  }

     setInterval(test,5000);

nsp.on('connection', function(socket){

  //Make a http call
  connectCounter++;
  nsp.emit('live-users',connectCounter);
  console.log('1 user connected, Total Joined: '+connectCounter);

  socket.on('disconnect', function(){
    connectCounter--;
    nsp.emit('live-users',connectCounter);
    console.log('1 user disconnected, Total Left: '+connectCounter);

  });

console.log("total clients: "+io.engine.clientsCount);

if(io.engine.clientsCount >= 1)
{
  //do something
  //if I put setInterval here it will cause problems, that is for each connection it will run setInterval causing lot of http get request
  // meaning, if 100 users then 100 get request in 5 seconds (depending on setInterval time).
}

});

How do I best stop execution of SetInterval(test,5000) if no users connected?

A: To stop setInterval, use clearInterval

Refer to
  Stop setInterval call in JavaScript

Do you also need help to stop/resume setInterval if you have no/1+ connected user?
If so, you can try managing a reference to your setInterval at the same time as your counter:
var connectCounter = 0;
var interval = undefined;

then:
connectCounter++;
if (interval === undefined) interval = setInterval(test,5000);

then:
connectCounter--;
if (connectCounter <= 0 && interval !== undefined) interval = clearInterval(interval);


text:
Q: C# | Web Application | Static contents caching issue Versioning | Azure PaaS I have a web application deployed on the Azure app service developed in ASP.NET MVC using C#.
I am using the following code for Static content (js, CSS) versioning.
 public static void RegisterBundles(BundleCollection bundles)
 {
    // Update the base url for css and script with static content url and appends versionid
    Styles.DefaultTagFormat = string.Format("<link href='{0}{{0}}?v=1' rel='stylesheet'/>"
                                , ApplicationConfigHelper.StaticContentUrl);

    Scripts.DefaultTagFormat = string.Format("<script src='{0}{{0}}?v=1'></script>"
                               , ApplicationConfigHelper.StaticContentUrl);

    // If we are in debug mode, then we will not bundle and minify for developer advantage
    if (HttpContext.Current.IsDebuggingEnabled)
    {
        BundleHelper bundleHelper = new BundleHelper();
        BundleTable.VirtualPathProvider = new StaticContentVirtualPathProvider();
        bundleHelper.IncludeBundleFiles(bundles);
    }
}

The same code was used to cache all the static contents in the browser before. Suddenly it stopped caching and started downloading the same in every request without any change in code and we don't know what is the root cause.
By initial finding and changing code, we came to know that it started caching both after removing the version of js and CSS while bundling the same as below sample code.
    Styles.DefaultTagFormat = string.Format("<link href='{0}{{0}}?' rel='stylesheet'/>"
                                , ApplicationConfigHelper.StaticContentUrl);

    Scripts.DefaultTagFormat = string.Format("<script src='{0}{{0}}?'></script>"
                               , ApplicationConfigHelper.StaticContentUrl);

Is there any specific way to set the version of static content while bundling in C#?


text:
Q: HTA output is not appearing

  row1_col2

  row2_col1
  row2_col2

  row3_col1
  row3_col2

The username only appears in the  tags above the HTML. When I use window.Alert userName, the value does display but only if that code is in the  section above. When I perform the same window.Alert in the body, I get "" (empty string).
I can't figure out whats going on. I updated the code as per the suggestions on one of the comments.

A: <% %> is ASP syntax, not HTA syntax. In HTA you could use a nested

BTW, I strongly recommend to use stylesheets for formatting tags (like setting the  background color). It's much cleaner, and also much easier to maintain.


text: Q: CodeIgniter query returns -1 rows Trying to do a CodeIgniter database query on a SQL Sever database. I keep getting no results but I noticed that the num_rows field in the query object is -1 (as opposed to 0 if I were actually getting no results). What does this mean? I'm assuming it is trying to report an error but I haven't found any information on it.


text:
Q: Triangle array multiplied by an indicator function is also strong mixing (proof verification) Say that a triangle array $\{x_{n,i}:1\leq i\leq n, n\geq 1\}$ of random variables on some probability space $\{\Omega, \mathcal{F}, P\}$ is strong mixing if the coefficients
$$\alpha_n(j)=\sup_{1\leq k\leq n-j}\sup\{\lvert P(A\cap B)-P(A)P(B)\rvert:A\in F_{1,n}^k, B\in F_{k+j,n}^n\}, \quad 0\leq j<n$$
satisfy $\alpha(j)=\sup_{n:0\leq j<n}\alpha_n(j)\to 0$ as $j\to\infty$ where $F_{i,n}^k= \sigma(x_{n,l}:i\leq l\leq k)$. Here we use the convention that $\alpha_{n}(j)=0$ for $j\geq n$ and $\alpha_{n}(j)=1/4$ for $j<0$.
My question: For each $n$, let $J_n\subseteq \{1,\dotsc,n\}$. Is $\{x_{n,i}1(i\in J_n):1\leq i\leq n, n\geq 1\}$ also strong mixing?
My attempt
Let $n=n_0$ be the smallest integer such that $J_n$ is nonempty. If $n<n_0$, Then $x_{n,i}=0$ for all $1\leq i \leq n$ (degenerate random variables, and thus, independent). In this case, $\alpha_n(j)=0, \forall j\geq 0$ for each $n< n_0$.
Let $\alpha'_T$ be the mixing coefficient of $\{x_{n,i}1(i\in J_n):1\leq i\leq n, n\geq 1\}$. If $n\geq n_0$, then
\begin{align}
F_{1,n}^k=\sigma (\cup_{l=1}^k\sigma(x_{n,l}))\supseteq \sigma (\cup_{l\in \{1,\dotsc,k\}\cap J_n}\sigma(x_{n,l}))
\end{align}
using the fact that $\cup_{l\in\{1,\dotsc,k\}\setminus J_n}\sigma(x_{n,l})$ is the trivial sigma algebra $\{\Omega,\emptyset\}$. Similarly,
\begin{align}
F_{k+j,n}^n=\sigma (\cup_{l=k+j}^n\sigma(x_{n,l}))\supseteq \sigma (\cup_{l\in\{k+j,\dotsc,n\}\cap J_n}\sigma(x_{n,l}))
\end{align}
 for each $n,j$ and $k$. Therefore $\alpha'_n(j)\leq \alpha_n(j)\leq \sup_n \alpha_n(j)\to 0$ as $j\to\infty$, for every $n\geq n_0$.
Combining these results we conclude that $\alpha'_n(j)\leq \alpha_n(j)\leq \sup_n \alpha_n(j)\to 0$ as $j\to\infty$, for every $n\geq 1$.
Is it acceptable?


text:
Q: How to merge GitHub git init'd repo with non init'd local copy after changes I can not get my head around the sequence to merge this mess. Whatever I try I get stuck, or in too deep to go further for fear of breaking things.

*

*User A is working on repo no probs.

*Unknowingly user B gets a Zip of repo, does not init locally and makes code changes locally.

*User A learns of this, and commits all his pending changes.

So, how to merge changes from both A and B while keeping the repo intact? Initially I have a copy of both local folders (one with a .git from A and one without a .git from B).

A: A bit late, but for future readers, here's how I'd solve this problem without many conflicts to be resolved:
git clone thecorrectrepositoryurl xxx
cd xxx
git checkout to-a-commit-where-mistaken-developer #was at before committing the mistakes, or branch

Now copy over all files from the mistaken developer. And if there is chance for deleted files, remove all files before copying the files
With no conflicts, adding deleted files, commit and checkout the current branch
git commit -A -m "Changes that should have been in git already"
git checkout the-current-branch

Git will tell you about losing changes if you checked out a commit, otherwise replace the below with:: git merge [your-branch]
git merge abcf00 # Add the refspec git mentioned, example abcf00

Resolve the conflicts, there should not be many
git commit -m "Merge Changes that should have been in git already"


text:
Q: Install xdebug for lamp I have big troubles installing xdebug and get it working with my lamp installation. I'm on an ubuntu system and i installed xdebug via sudo apt-get install php-xdebug.
I also have a standalone php binary, for which xdebug automatically installed fine. I located the xdebug.so and added the zend_extension=path/to/xdebug.so in my lamp/etc/php.ini. However i got an error
wrong ELF class: ELFCLASS64

which probably means that my lamp runs in differnt bit mode than my standalone php.
However i went to xdebug.com and downloaded the source. Followed the steps mentioned in the manual installation:
/opt/lamp/bin/phpize
./configure --enable-xdebug --with-php-config=/opt/lampp/bin/php-config
make

(The first time phpize complained about missing autoconf so i also to install autoconf sudo apt-get install autoconf).
Then again when running make i ran into the follwing error
fatal error: php.h: file or directory not found

Also phpize had some warnings and also didn't print any API numbers which is probably related.
grep: [path]/php.h: Datei oder Verzeichnis nicht gefunden
grep: [path]/Zend/zend_modules.h: Datei oder Verzeichnis nicht gefunden
grep: [path]/Zend/zend_extensions.h: Datei oder Verzeichnis nicht gefunden
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
configure.in:3: warning: prefer named diversions
configure.in:3: warning: prefer named diversions

Anyway, so xdebug didn't work with lamp out of the box and i couldn't compile it from the sources either.
I hope somebody has suggestions what i could try next.

A: Go to http://sourceforge.net/projects/xampp/files/XAMPP%20Linux/ and install the devel version of xampp.
Without the development version you won't be able to compile any packages simply because the regular version does not contain the necessary sources.


text:
Q: Interpret error from testbench after sending in an XSLT processed document I am wondering how to read and interpret below error line from a suppliers test bench. My understanding is that the supplier run default configuration.
My assumptions:
<Q{.../2017-09-30}disposition-of-results>
...is referring to a element with namespace.
The Q is for QName the date is for the namespace path and "disposition-of-results" is element name.
The error complaints about that content model does not allow 2 defined elements to come one after another?
Something wrong detected at line -1 of file Xxx. In content of element <xbrl>: The content model does not allow element <Q{.../2017-09-30}disposition-of-results> to appear immediately after element <Q{.../2017-09-30}Sales>. The following elements would be valid here: xbrli:unit, link:footnoteLink, xbrli:context, xbrli:tuple, xbrli:item (or nothing).


text:
Q: Why does printing a constant change the results of a single core / process application? I have written a short (450 lines) program that calculates some situations that can actually occur in a Connect Four game. The program tries to build the game tree and it recognizes if a situation already occured (also I skip branches if only the symmetric version happened).
I count the number of times that I come to an situation that already happened with int alreadyCounter. But I've noticed something strange when executing:
Adding
printf("abcdefghijklm");

changes the result of my alreadyCounter!
I don't use other cores/ processes / threads. I compile the C-program with
gcc -g -W -Wall -Werror -std=c99 -o connectfour

The full source is at GitHub. (I'm sorry, I couldn't make the code significantly shorter)
Take a look at connectfour.c and connectfour-strange.c.
They only differ in line 386.
But they give - apart from many "abcdefghijklm" - different results:
connectfour:
[...]abcdefghijklmabcdefghijklm########################Finish:
Maximum of 20000 reached
alreadyCounter: 1547
mirroredCounter: 0

connectfour-strange:
[...]
########################Finish:
Maximum of 20000 reached
alreadyCounter: 1566
mirroredCounter: 0

Why do I get different results on a single core / process / thread program when I only add some constant output?

A: I've seen this problem several times in my job of assistant in my school.
some students had their program segfaulting unless they added a printf somewhere.
Printf allocs some memory and does some crazy stuff with it.
My guess is that you have a buffer overflow somewhere, or you don't alloc enough memory for a structure, and printf erases it.
Try running valgrind to see if something goes wrong.

A: I don't know if that is the cause for your observations, but in lines 334ff,
char mirrored[BOARD_WIDTH][BOARD_HEIGHT];
for (int x = 0; x<BOARD_WIDTH; x++) {
    for (int y=0; y<BOARD_HEIGHT; y++) {
        mirrored[x+1-BOARD_WIDTH][y] = board[x][y];
    }
}

you write outside the allocated memory (your row index goes from -(BOARD_WIDTH) to -1), thus invoking undefined behaviour.
Also, that doesn't mirror the board. You very probably meant
mirrored[BOARD_WIDTH - 1 - x][y] = board[x][y];

there. Apart from that, I see no obvious candidates like out-of-bounds writes.
In isBoardFinished (line 43ff), you stop checking before you have reached row/column 0:
while (xTemp > 0)

(ditto for y in the top-down check, and both in the diagonals checks). That should be x >= 0 to use the full board. But this could not overwrite alreadyCounter, still it may be useful.
But compiling the code with warnings turned on and optimisations shows the probable cause:
connect-four.c: In function 'getFirstIndex':
connect-four.c:202:19: warning: 'index' may be used uninitialized in this function [-Wuninitialized]
connect-four.c: In function 'getNewIndex':
connect-four.c:202:19: warning: 'index' may be used uninitialized in this function [-Wuninitialized]
connect-four.c:199:18: note: 'index' was declared here
connect-four.c: In function 'getMyIndex':
connect-four.c:202:19: warning: 'index' may be used uninitialized in this function [-Wuninitialized]
connect-four.c:199:18: note: 'index' was declared here
connect-four.c: In function 'makeTurns':
connect-four.c:202:19: warning: 'index' may be used uninitialized in this function [-Wuninitialized]
connect-four.c:199:18: note: 'index' was declared here
connect-four.c:202:19: warning: 'index' may be used uninitialized in this function [-Wuninitialized]
connect-four.c:199:18: note: 'index' was declared here

So the warning and accompanying note (it appears multiple times with different function names but the same location due to inlining) tell us that it should be
unsigned int getFirstIndex(char board[BOARD_WIDTH][BOARD_HEIGHT]) {
    unsigned int index = 0;
    //               ^^^^^^^

to get deterministic results from invoking getFirstIndex with identical boards. Since you take the modulus with respect to MAXIMUM_SITUATIONS before returning an index, the returned index shouldn't be out of bounds, however, so no crash is to be expected as a consequence of that. But when you print out something, that may cause allocation on the stack (need not, the arguments and return address could be all passed in registers), and if it does, that can influence the bit-pattern at the place where index is allocated the next time getFirstIndex is called. That would change the returned value, and you look in the wrong slot in database, so you miss a previous occurrence of an identical board, thus you get fewer duplicates than if the value getFirstIndex produces only depends on the passed-in board (and not also on what bits happened to occupy a particular stack location).
Note that it is - with my version of gcc - necessary to have both, warnings tuned on and optimisations, to get the warning. My clang doesn't warn about it even with warnings and optimisations turned to the highest level. Other versions of gcc and clang, and other compilers may have different success in identifying the problem.
With index initialised to 0 in getFirstIndex, I get a consistent
########################Finish:
Maximum of 20000 reached
alreadyCounter: 4412

independent from whether the string is printed and the optimisation level. Without the initialisation, the value of alreadyCounter depends on both factors.

A: I'm not going to go through 500 lines of code to find it, but it is almost always a memory issue.
Typically it is something like a stack corruption where you are indexing an array beyond the end, so the print statement modifies the stack and so the out of bounds access result is changed.
Run it through a tool like valgrind and it should help pinpoint the violation.

A: I didn't find an instance of it, but that is a common result when using macros and passing something like i++ to it.
the ABS(outcome) is a macro that inserts the code
(outcome) (outcome < 0 ? -outcome : outcome)
if outcome is passed as i++, then you would get
(i++) (i++ < 0 ? -i++ : i++)
perhaps in the threaded version the macro is somehow getting rolled in by the compiler


text:
Q: Where to find values-v11 & values-v14 in Android Studio Projects? I'm developing an app that is compatible with froyo+ devices and I need to set a theme that is only compatible with API11+ devices but, I cannot fix this cause (obviously) because as soon as I set the Holo.Dark theme the editor gives me an error about its compatibility. I know that I need those (only one of them) folder and their style.xml files to fix this issue but Android Studio doesn't generate those folder. I am wondering if I need to create all those folders and styles.xml files to do the trick or if there is a real workaround to this?
The current files tree is this
├───res
    │   ├───drawable-hdpi
    │   ├───drawable-mdpi
    │   ├───drawable-xhdpi
    │   ├───drawable-xxhdpi
    │   ├───layout
    │   ├───menu
    │   ├───values
    │   ├───values-w820dp

A: If you are using Android studio, right click res in your project, then New->Android resource file, and select the resource type: Values, and you can select size, region and others properties at left side.

A: I have the same problem on Android Studio.
after I create new folder "values-v11", it doesn't show in Android Studio.
you should open this folder in Explore and add *.xml file to this folder then the *.xml file will show in Android Studio in the "values" folder


text:
Q: AIrflow scheduler command crashes with sqlalchemy.exc.InternalError: (psycopg2.errors.InFailedSqlTransaction) When I run airflow scheduler in terminal it always crashes with
  File "/home/ec2-user/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1803, in _execute_context
    cursor, statement, parameters, context
  File "/home/ec2-user/.local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 732, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.InternalError: (psycopg2.errors.InFailedSqlTransaction) current transaction is aborted, commands ignored until end of transaction block

[SQL: UPDATE job SET state=%(state)s WHERE job.job_type = %(job_type_1)s AND job.state = %(state_1)s AND job.latest_heartbeat < %(latest_heartbeat_1)s AND job.job_type IN (%(job_type_2_1)s)]
[parameters: {'state': <TaskInstanceState.FAILED: 'failed'>, 'job_type_1': 'SchedulerJob', 'state_1': <TaskInstanceState.RUNNING: 'running'>, 'latest_heartbeat_1': datetime.datetime(2022, 2, 1, 13, 6, 22, 941318, tzinfo=Timezone('UTC')), 'job_type_2_1': 'SchedulerJob'}]
(Background on this error at: https://sqlalche.me/e/14/2j85)
[2022-02-01 13:10:24 +0000] [20329] [INFO] Shutting down: Master

Environment: Amazon Linux AMI; Airflow 2.2.3; psql 13.5
Command airflow db init works fine. Airflow UI also says that The scheduler does not appear to be running. Last heartbeat was received a few seconds ago. so the scheduler can connect to psql.
What am I doing wrong?


text:
Q: Java.io.FileNotFoundException when downloading file I can't figure out whats the problem here, it used to work but not anymore. I am trying to download a file from an url. It seems i am not properly creating the file.
            static String PATH = Environment.getExternalStorageDirectory() + "/Android/data/com.xxxx.xxxx/";
            url = new URL("http://xxxxxxx.xxx/file.apk");
            HttpURLConnection c = (HttpURLConnection) url.openConnection();
            c.setRequestMethod("GET");
            c.setDoOutput(false);
            c.connect();

            File file = new File(PATH);
            File outputFile = new File(file, "update"+separated[1]+".apk");

            //it crashes at this point

            FileOutputStream fos = new FileOutputStream(outputFile);

            InputStream is = c.getInputStream();

            byte[] buffer = new byte[1024];
            int len1 = 0;
            while ((len1 = is.read(buffer)) != -1) {
                fos.write(buffer, 0, len1);
            }
            fos.close();
            is.close();

 java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.xxxxx.xxx/update150.apk: open failed: ENOENT (No such file or directory)
    at libcore.io.IoBridge.open(IoBridge.java:409)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
    at com.sanisidrolsa.appterris.GcmIntentService.onHandleIntent(GcmIntentService.java:67)
    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:136)
    at android.os.HandlerThread.run(HandlerThread.java:61)
 Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
    at libcore.io.Posix.open(Native Method)
    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
    at libcore.io.IoBridge.open(IoBridge.java:393)
    ... 7 more

A: From Android 4.0, you can not make network or HTTP requests on the main thread, otherwise you get an ANR (Application Not Responding) error.
You need to put the HTTP request into a new thread. Because the high version of Android OS considers that asynchronous I/O requests, such as network or database, are better.
There are several techniques about async operations in Android OS.
Maybe this is helpful for you.


text:
Q: how to upload image in correct path - image: Property "image" expects a valid pathname as data in akeneo
i already installed akeneo 2.0
I need to upload an image via Xl file
but I give the path
showing

Warning
image: Property "image" expects a valid pathname as data, "/tmp/pim/upload_tmp_dir/01.png" given.

how I can solve this???

A: In order to import images while import products, you will have to include it in your zip archive, and use its relative path (compared to your product import file) in the archive.
e.g if your archive file has the following structure:
- products_import.xlsx
- images/
      image1.png

you will have to put ./images/image1.png in the image column of your products_import.xlsx file
Then upload the zip archive (instead of only the Excel file) in the import profile:


text:
Q: Display HTML in Boxlayout I want to display HTML in my forms. The problem is I have to use a Boxlayout to place my components. So when I put a WebBrowser I'll have some height and scroll issues. I get the HTML I want to display from a webservice. The length of the content is variable. I just want to display a part of this response. Here is what I already have:

The webBrowser is below the edit button and ends near the LBL_LIB_NOM label.
As you can see the webBrowser is way too high and I can't scroll the Form when I click over the WebBrowser. In this example I would like to reduce the size of the WebBrowser so we can only see the Title. I also would like if possible to scroll my form when I click on the WebBrowser since I don't want the WebBrowser to scroll.
I have tried a few things to solve my issue:

*

*I tried to override the calcPreferredSize method.

*I revalidate my form and my webbrowser.

*I resized it's container using the deprecated setPreferedSize method.
In that case the container is well sized but the the WebBrowser displays
above the other components.

The usual answer I have seen in other posts is to put the WebBrowser in a BorderLayout but I can't do that.
So here is my question: Is there any other component I can use to display one HTML line ? Or is there a way to make a webBrowser work properly in a boxLayout ? Do I have to write my own HTML renderer ?

A: I'm guessing you want box layout so you can scroll... This is problematic.
Web views generally expect to scroll themselves and this is common in native widgets which handle their own events and thus scrolling. It's hard for our code to know when your swipe is intended for us or to the underlying native widget and it's harder still to do this in a consistently portable way.
There are 3 options:

*

*Use only Codename One code

*Use a border layout or similar layout

*Use the web browser for the entire UI of this form

If you want to take the first option this article might be useful as a starting point.


text:
Q: WinJS write binary data / blob to file Do WinJS or Windows 8 javascript apps in general support writing blobs to file? All the examples and documentation I have found only mention writing text. I need to store binary data within the application, not user defined via a file picker.
In case it does not, what's an alternative? Writing base64 strings?
Or better look into IndexedDB?

A: You can use a variety of techniques, but if you'd just like to write an array of bytes for example to the file system, you might use PathIO.WriteBytesAsync. Have a look at the other methods of PathIO for simple ways to access the file system.
IndexedDB may not be the best fit depending on the amount of data you need to store. There's a limit of 250MB per application for example.


text:
Q: java.lang.NoSuchMethodError: android.webkit.WebView.evaluateJavascript Android 6 Looks like this is a repeat question but its not indeed.  This happens in Android 6.
I am just using the following code to button onclick in MainActivity.
    alert.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            webView.evaluateJavascript("console.log(window.getSelection().baseNode.nodeValue);", null);
        }
    });

Here I am getting the following error.
E/AndroidRuntime(601): java.lang.NoSuchMethodError: android.webkit.WebView.evaluateJavascript

I seen articles and forums says this has been rectified from verion 4.2.
How this occurred in Android  6.0


text:
Q: adb install command is not working I am trying to install apk via usb is not installing.
Device is detected perfectly .but apk is not installing.
Even i tried with the following command.
D:\Softwares\adt-bundle-windows-x86-20131030\sdk\platform-tools>adb install f:Fi
lth\Sample\bin\Sample.apk
4669 KB/s (277327 bytes in 0.058s)

D:\Softwares\adt-bundle-windows-x86-20131030\sdk\platform-tools>

A: First, check whether your device is connected or not. If connected, check there is only one device running i.e. mobile or emulator.
Copy your apk file and paste inside the platform-tools folder
D:\Softwares\adt-bundle-windows-x86-20131030\sdk\platform-tools>

now shift+right click on the platform-tools folder -> Open command window here
Then check whether your adb is running successfully or not.Try these command to restart adb
 adb kill-server
 adb start-server

now you got the message "daemon started successfully"
now just use
adb install Sample.apk

Check out the image if you still have any problem.


text:
Q: String value converted to double automatically change to decimal value in Swift Working with Swift.
I am converting value from String to double.
let value: String = "8"
var size: Double
size = Double(value)
size = 8.0 // 8.0

Result should be 8 unless string value is 8.0

A: Double only stores a numeric magnitude. "8" and "8.0" have the same magnitude, so they get represented by the same Double value. Whether you show trailing 0s or not is a consequence of how you choose to format and present your values.
print does it one way for debugging, but NumberFormatter gives you more control to format numbers for real, non-debugging purposes.


text:
Q: C++ matrix destruction causes breakpoint and critical error (solution is at the end of the question) So I want to create a 4x4 matrix class which stores its data as a float** m.
I initialize it like this:
Matrix4f::Matrix4f()
{
    this->m = new float*[4];

    for (int i = 0; i < 4; i++)
    {
        this->m[i] = new float[4];
        memset(this->m[i], 0, sizeof(float) * 4);
    }
}

And after that, I have a destructor like this:
Matrix4f::~Matrix4f()
{
    for (int i = 0; i < 4; i++)
    {
        delete[] m[i];
    }

    delete[] m;
}

But sometimes when I use this class, this line:
delete[] m[i];

Causes a breakpoint, and it throws: Critical error detected c0000374
Is this the right way of initializing and deleting a 4x4 matrix?
Edit: for future readers: my problem was that I didn't override the copy constructor of the matrix, and the assignment operator (void operator=(const Matrix&). This is a problem because it is possible that a copy is made silently (like saying Matrix4f mat = getTransformationMatrix();, and this matrix then gets deleted at the end of the scope, releasing the same pointer as the transformation matrix has, because the pointer is copied, not the contents. So override those two functions like in the accepted answers, and it will get rid of problems like this.

A: As pointed out in the comments, your code is fine, if and only if you corretly manage the case of copies.
You have three choices:

*

*disable copy

*shallow copy

*deep copy

Let us discuss this choices:

*

*you would need to only declare the copy constructor and the copy assigment operator delted. Now there is no way to copy objects of your class. This reduces the usefullness of the matrix-class.

*This has no real value for its' own. Since you can achieve this by wrapping a object of type 3 into an std::shared_ptr.

*There is no need for dynamic memory in this case. And even if there were, you would like to use a std::vector or something to manage the memory.
The sane solution would be to use an float[4][4] as m.
This would be more robust since you avoided the memory managment.

A: As already mentioned the rule of the three could be the issue. Your provided code is technical correct, however, if you copy a Matrix4f you have to reimplement the copy constructor and the overloaded assignment constructor:
#include <iostream>

class Matrix4f
{
public:
    Matrix4f()
        : m_data(new float*[4])
    {
        for (int i = 0; i < 4; i++)
            m_data[i] = new float[4]{ 0 };
    }
    Matrix4f(const Matrix4f& source)
    {
        m_data = new float*[4];
        for (int i = 0; i < 4; i++)
        {
            m_data[i] = new float[4]{ 0 };
            for (int j = 0; j < 4; j++)
            {
                m_data[i][j] = source.m_data[i][j];
            }
        }
    }
    Matrix4f& operator=(const Matrix4f& source)
    {
        if (this == &source) return *this;

        clear();
        m_data = new float*[4];
        for (int i = 0; i < 4; i++)
        {
            m_data[i] = new float[4]{ 0 };
            for (int j = 0; j < 4; j++)
            {
                m_data[i][j] = source.m_data[i][j];
            }
        }

        return *this;
    }
    ~Matrix4f()
    {
        clear();
    }
//private:
    float**m_data;

    void clear()
    {
        if (m_data != NULL)
        {
            for (int i = 0; i < 4; i++)
            {
                delete[] m_data[i];
            }
            delete[]m_data;
        }
    }

    void print()const
    {
        for (int i = 0; i < 4; i++)
        {
            for (int j = 0; j < 4; j++)
            {
                std::cout << m_data[i][j] << "\t";
            }
            std::cout << "\n";
        }
    }
};

int main()
{
    Matrix4f m1;

    m1.m_data[0][0] = m1.m_data[1][1] = m1.m_data[2][2] = m1.m_data[3][3]  = 1;

    {
        Matrix4f m2(m1);
        Matrix4f m3 = m2;

        m2.print();
        m3.print();
    }

    m1.print();
}

But I recommend you to use one dimensional vectors instead, its much faster and much safer.


text:
Q: Capitalize first letter in list of acronyms using the acro package How can I capitalize the first letter in the list of acronyms with the acro package without adjusting all acronym declarations? A solution that capitalizes all first letters of all words would also be acceptable.
What I have tried
acro allows setting individual formats for list entries.
However, \MakeUppercase affects all letters instead of only the first one (see MWE). \capitalisewords has not effect.
MWE
\documentclass{article}

\usepackage{acro}
%\usepackage{mfirstuc}  % for \capitalisewords
\DeclareAcronym{PC}{short=PC,long=personal computer}

\begin{document}

I am writing this on my \ac{PC}.

%\acsetup{format/list={\capitalisewords}}  % has no effect
\acsetup{format/list={\MakeUppercase}}  % not working as expected
\printacronyms

\end{document}

With \MakeUppercase:

Without \MakeUppercase:

Related questions do not apply
I have found several related questions, but none seems to apply.

Question

Capitalize the first letter in acronym list
solutions are specific to acronym package, or require redefinition of all acronym declarations (which I would like to avoid)

Capitalization of the first letter in acronym list
refers to Capitalize the first letter in acronym list

Capitalize first letter of each word when printing list of acronyms
solutions are specific to glossaries package or require redefinition of all acronym declarations

capitalisation and list of acronyms
solutions are specific to glossaries package

How to get acronyms entries in uppercase letters and capitalize only the first letter of the entries from the glossary?
specific to glossaries package

A: It looks like I haven't documented all options… :|
You have to set the option uppercase/list:
\documentclass{article}

\usepackage{acro}
\acsetup{
  uppercase/list
}

\DeclareAcronym{PC}{short=PC,long=personal computer}

\begin{document}

I am writing this on my \ac{PC}.

\printacronyms

\end{document}

If you want the first letter of each word capitalised, i.e., want to use mfirstuc then you have to set the option list/uppercse/cmd as well and use \ecapitalisewords:
\documentclass{article}

\usepackage{acro}
\usepackage{mfirstuc}
\acsetup{
  uppercase/list ,
  list/uppercase/cmd = \ecapitalisewords
}

\DeclareAcronym{PC}{short=PC,long=personal computer}

\begin{document}

I am writing this on my \ac{PC}.

\printacronyms

\end{document}


text:
Q: Encountering "404 NOT FOUND" for Laravel update/edit in edit_customer:
<form action="{{ url('customer/profile_update', [ 'id'=> $cust->id ]) }}" method="POST" enctype="multipart/form-data">
   @csrf
   @method("PUT")

web.php
//Customer related pages
Route::prefix('customer')->middleware(['auth','verified'])->name('customer.')->group(function(){
     Route::get('/',[HomeController::class,'index']);
     Route::get('cdash', Cdash::class)->name('cdash');
     Route::get('edit_customer/{id}',[Profile::class,'edit_customer'])->name('edit_customer');
     Route::put('update_customer/{id}',[Profile::class,'update_customer'])->name('update_customer');

Profile.php (controller)
public function edit_customer($id)
{
    $cust=  User::findOrFail($id);
     return view('customer.edit_customer', compact('cust'));

 }

 public function update_customer(Request $request, $id)
 {
     $customer = User::find($id);

         //thebarber table details
         if($request->hasFile('image'))
         {
             $avatarpath= '/profileimages/'.$customer->image;

             if(File::exists($avatarpath))
             {
                 File::delete($avatarpath);
             }

             $file=$request->file('image');
             $ext=$file->getClientOriginalExtension();
             $filename=time().'.'.$ext;

             $file->move('/profileimages/',$filename);
             $customer->image=$filename;
         }

      $customer->firstname=$request->input('firstname');
      $customer->lastname=$request->input('lastname');
      $customer->email=$request->input('email');
      $customer->phone=$request->input('phone');
      $customer->city=$request->input('city');
      $customer->county=$request->input('county');
      $customer->country=$request->input('country');

      $customer->update();

      return redirect('/home')->with('message',"Customer Updated Sucessfully");

 }

A: On edit_customer you are setting your method to PATCH and you are defining your route as PUT, please change one to match the other.

A: You are using route group prefix "customer", so your url in the form should be prefixed
url('customer/update_customer', [ 'cust' => $cust->id ]
https://laravel.com/docs/8.x/routing#route-group-prefixes
Route::prefix('customer')->middleware(['auth','verified'])->name('customer.')->group(function(){
 Route::get('/',[HomeController::class,'index']);
 Route::get('cdash', Cdash::class)->name('cdash');
 Route::get('edit_customer/{id}',[Profile::class,'edit_customer'])->name('edit_customer');
 Route::put('update_customer/{id}',[Profile::class,'update_customer'])->name('update_customer');

Your url for the from, to hit the update_customer function should be customer/update_customer/{id}
so this
<form action="{{ url('customer/profile_update', [ 'id'=> $cust->id ]) }}" method="POST" enctype="multipart/form-data">

should look like this
<form action="{{ url('customer/update_customer', [ 'id'=> $cust->id ]) }}" method="POST" enctype="multipart/form-data">

And a good practice is tou use route name instead of urls, so better to be
<form action="{{ route('customer.update_customer', [ 'id'=> $cust->id ]) }}" method="POST" enctype="multipart/form-data">


text:
Q: Why I get 'No toolchains found in the NDK toolchains' error? I installed Android SDK, but got error message below

No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi

Do you know what does it mean?


text:
Q: Shortcut keys disabled on Chrome menu Why are all the shortcut keys on my main menu in Chrome disabled?
I'm doing extensive debugging, and instead of the convenience of Ctrl + Shift + J for the JavaScript console I always have to go through the menu. The only extension I'm running is the Web Developer extension, but disabling it does nothing for the shortcut key problem.

A: Hotkeys obviously won't work if the menu is open. Once the menu is open, you have to press the corresponding accelerator key to access the menu items. If you don't know the accelerators, open the Wrench menu by pressing Alt+E instead of clicking on it; the accelerators will be underlined (eg for Options, it is 'O'; for the JavaScript console, it is 'L' for the Tools submenu, then 'J').
The hotkeys you are asking about have no meaning in the menu. How would you focus the Omnibar when the menu has none? How would open the DevTools/JS Console for the menu? How would Ctrl+U makes sense to view the source code of the Wrench menu? Those keys only apply to browser windows/tabs. When you open the menu, you switch from the context of tab, to the context of the menu.
Close the Wrench menu and the hotkeys will work for the currently active tab.


text:
Q: Difficulty setting up Flex (lexical analyser) I'm looking to use Flex for a University module, however I'm having some trouble setting it up on my home computer.

*

*I downloaded the Setup file from http://gnuwin32.sourceforge.net/packages/flex.htm

*I ran Setup

*I then tried to use flex from the Command Line, by navigating to the directory containing the .l (Lex) file and typing flex -ooutputfile.yy.c inputfile.l (This resulted in the message " 'flex' is not recognised as an internal or external command, operable program or batch file.")

*I remembered that my tutor had told us to use the Visual Studio 2008 Command line, so I downloaded and installed that from Dreamspark.

*I tried to do the above, but from the Visual Studio 2008 Command Line. The same message resulted.

*I looked into the Installation and Usage http://gnuwin32.sourceforge.net/install.html and noticed that it said you would need msvcrt.dll (and sometimes also msvcp60.dll) and that these would be in the Windows\System folder. It also said that these would be there if you had Internet Explorer 4.0. or greater on your system. These .dll files are not there.
Do you think the likely cause of this error is the missing .dll files, or am I missing something else?
What is a good, simple way to get hold of these .dll files?
Thank you.

A: The message

'flex' is not recognised as an internal or external command, operable program or batch file.

is telling you that the environment of your shell can't find flex. The environment is relying on its PATH variable for a list of directories to search. You can

*

*use the fully qualified pathname to your installation of flex, i.e.
Edit
c:\path\to\flexinstall\flex .exe -ooutputfile.yy.c inputfile.l

*Add the flex installation path to your Windows path. ControlPanel->System-AdvancedSettings-SystemPropertiesDialogBox->EnvironmentVariablesButton.
I hope this helps.


text:
Q: Payment calculation for video content creators using Google Analytics I'm interning at an ed-tech startup where we have to pay the content creators on the basis of video watch time using Google Analytics. The current approach suggested is this:
Report of google analytics.

It shows video watched time of a particular video by a particular user. So, if there are 5 users and each watches 3 videos, there will be 15 entries. There could be thousands or even hundreds of thousands entries once the application scales.
The company wants to calculate the watch time of a video by all users on a particular day and pay accordingly on a per-day basis.
To avoid malpractices, they've suggested to fetch this whole report using Cron job every day and store this whole report in our MongoDB database. After that, to calculate the payment, we will run a query in the database which will check:

*

*if the user has watched a video more than it's total duration. (This will be checked for all the user entries that are present in that day's report for a particular video. And this will be performed for all the videos)

*If yes, it'll only consider the total duration. And if no, it'll take the original value which is less than the total duration of that particular video.

At last, we'll take a sum of all the values and pay the user according to that sum.
I find this approach very naive and not scalable.
What is your view/opinion?

A: What you propose can certainly be an approach, obviously for large numbers you will need a system that allows you to manage large amounts of data.
You could also use unique events (daily) for the video completion event (in case a user has seen the same video multiple times in multiple sessions in one day), that way knowing the length of the video you can divide it by the number of unique events.


text:
Q: Can I use the minimum lambda.1se among 100 iterations of 10-fold cv.glmnet to tune the final model? I am running 10-fold cross-validation(cv.glmnet) 100 times on a training dataset in R. The purpose of this process is to find the optimal lambda to tune the final model for my prediction model.

*

*I did 100 rounds of 10-fold cv.glmnet

for (i in 1:100) {
            lasso.fit[[i]] = cv.glmnet(x = as.matrix(data), y = ref.groups, type.measure = "class", alpha = 1, family = "binomial")
            lasso.coef[[i]] = as.data.frame(as.matrix(coef(lasso.fit[[i]],s = lasso.fit[[i]]$lambda.1se)))
            lasso.lambda[[i]] = data.frame(lasso.fit[[i]]$lambda.min, lasso.fit[[i]]$lambda.1se)
            lasso.cvm[[i]]= data.frame(lasso.fit[[i]]$cvm[lasso.fit[[i]]$lambda==lasso.fit[[i]]$lambda.min],
                                       lasso.fit[[i]]$cvm[lasso.fit[[i]]$lambda==lasso.fit[[i]]$lambda.1se])}

*then extract the lowest lambda.1se from 100 iterations

write.table(lasso.cvm, file="lasso.cvm.csv",row.names=FALSE,sep=",") ##check the lowest lambda.1se

lmabda_opt=lasso.fit[["15"]]$lambda.1se ##extract optimal lambda -> round 15 was the lowest lambda.1se among 100iterations

*Final model tuning

lasso.fit.fin= glmnet(as.matrix(data),  y = ref.groups,alpha = 1, family = "binomial",lambda = lmabda_opt) ##manually plugging lambda into glmnet

This was my procedure for model development. It is known that lambda.1se gives the most regularized model, which is most simple within one standard deviation of the optimal model. So I thought it would be best to pick the model with the minimum lambda.1se of all 100 iterations. I was wondering can I use the minimum lambda.1se among 100 iterations to tune my final model for the prediction?
Thank you.


text:
Q: getting immediate text from an XML element with cheerio using cheerio to parse XML, consider
<foo>this<bar>that</bar></foo>

I want to get only "this" when I do $('foo').text() but I am getting "thisthat". How do I restrict the response to only the immediate text in the element foo?

A: For the example in your question, you can get the text of the first child of foo:
$("foo")[0].children[0].data; //'this'

If instead you want all the immediate text inside of foo, you can iterate over its children and act on their type. Snippet:
function getImmediateText(str){
    let retStr = "";
    var $ = cheerio.load(str);
    var children = $("foo")[0].children;

    children.forEach(function(child){
        //if type is text, add to return string
        if(child.type == "text")
            retStr += child.data;
    })
    return retStr;
}

If your text is <foo>this<bar>that</bar>after</foo>, this will return thisafter. You can easily change it to put spaces or line breaks between "this" and "after" if need be.


text:
Q: three.js How to position one object beside another (global world position) I load one object with objloader on my scene, later, I load a second object on my scene, but I want to change it's absolute position to another side of my first object.
All position of both object is relative to local (0,0,0).
How I can change it's global position ?

A: The answer that davincy posted is now out of date. In my version of threejs it responded with this warning:

THREE.Matrix4: .getPosition() has been removed. Use
  Vector3.setFromMatrixPosition( matrix ) instead.

So then you'll need to replace it with the following:
objectA.position.setFromMatrixPosition( objectB.matrixWorld );

wherein objectB is the object that is in the scene and the object that you want objectA to copy its position from.

A: I found my answer:
object1.position.copy(object2.matrixWorld.getPosition());

A: Every object you can put into a scene has a "position" property, which is a three-dimensional vector. You can simply change its x/y/z values.
For example, given your object is called "mesh":
mesh.position.x += 1; //you need re-render if you change something in the object after adding to the scene
yourScene.add(mesh);

This will move the object one "unit" on the scene. This means you can do that:
mesh2.position.x = mesh1.position.x + 1;
yourScene.add(mesh1);
yourScene.add(mesh2);

Here you can check other properties and methods available for objects you can put on THREE.js scene:
https://threejs.org/docs/#api/en/core/Object3D


text:
Q: java.lang.IllegalArgumentException: A ServletContext is required to configure default servlet handling I have the following test class:
@ActiveProfiles({ "DataTC", "test" })
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {BaseTestConfiguration.class, DataTestConfiguration.class, JpaConfiguration.class, PropertyPlaceholderConfiguration.class })
public class RegularDayToTimeSlotsTest {
...

The issue seems to come from the BaseTestConfiguration class:
@Configuration
@ComponentScan(basePackages = { "com.bignibou" }, excludeFilters = { @Filter(type = FilterType.CUSTOM, value = RooRegexFilter.class),
        @Filter(type = FilterType.ANNOTATION, value = Controller.class), @Filter(type = FilterType.ANNOTATION, value = ControllerAdvice.class) })
public class BaseTestConfiguration {

}

I systematically get this exception:
Caused by: java.lang.IllegalArgumentException: A ServletContext is required to configure default servlet handling
    at org.springframework.util.Assert.notNull(Assert.java:112)
    at org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer.<init>(DefaultServletHandlerConfigurer.java:54)
    at org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.defaultServletHandlerMapping(WebMvcConfigurationSupport.java:329)
    at org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration$$EnhancerByCGLIB$$bb4ceb44.CGLIB$defaultServletHandlerMapping$22(<generated>)
    at org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration$$EnhancerByCGLIB$$bb4ceb44$$FastClassByCGLIB$$368bb5c1.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:326)
    at org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration$$EnhancerByCGLIB$$bb4ceb44.defaultServletHandlerMapping(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166)
    ... 43 more

I am not sure how to get around this issue. Somehow Spring is looking for a ServletContext when I run the test and I get the above exception...

A: It seems like you are missing
@WebAppConfiguration

from your test class.
The documentation states

The resource base path is used behind the scenes to create a
  MockServletContext which serves as the ServletContext for the test's
  WebApplicationContext.

Typically a Servlet container would provide the ServletContext. Since you are in a testing environment, you need a fake. @WebAppConfiguration provides that.

A: One of your @Configuration classes is obviously annotated with @EnableWebMvc. That's how DelegatingWebMvcConfiguration ends up in your stack trace, since it is imported by @EnableWebMvc.
So although you think you don't need a WebApplicationContext (and hence a ServletContext), you in fact do need it simply because you are loading an application context with @EnableWebMvc.
You have two options:

*

*Compose the configuration classes for your integration test so that you are not including the web-related configuration (i.e., the @Configuration class(es) annotated with @EnableWebMvc).

*Annotate your test class with @WebAppConfiguration as suggested in other comments above.

Regards,
Sam (author of the Spring TestContext Framework)

A: For you to instantiate the Servlet context, you would have to use the annotation.
@WebAppConfiguration

A class-level annotation that is used to declare that the ApplicationContext loaded for an integration test should be a WebApplicationContext. The mere presence of @WebAppConfiguration on a test class ensures that a WebApplicationContext will be loaded for the test, using the default value of "file:src/main/webapp" for the path to the root of the web application (i.e., the resource base path). The resource base path is used behind the scenes to create a MockServletContext which serves as the ServletContext for the test's WebApplicationContext.

A: I was getting a similar error but whilst running the application normally rather than trying to run tests.
It turns out if you're making use of a custom PermissionEvaluator then you need to declare it in a separate @Configuration class to the one with your main Spring security configuration in.
See: How do I add method based security to a Spring Boot project?
There is also an open Github issue: https://github.com/spring-projects/spring-boot/issues/4875


text:
Q: How do I move looks and dashboards between Looker instances? We have Looker production and Looker staging instances. We need a way to move looks and dashboards between them.

A: At Ro we've built a tool on top of "gzr" that will help you bulk-migrate looks and dashboards between instances. For more information, see https://medium.com/ro-data-team-blog/ro-gazer-bulk-looker-content-management-ad7f96f4100


text:
Q: CSS: How to get this overlay to extend 100% with scrolling? Here is an example of the issue in question:
http://dev.madebysabotage.com/playground/overlay.html
You see there is a gray overlay over the entire page, but if you scroll down, the content below the initial loaded page doesn't have the overlay.
I have an #overlay div and it seems it doesn't keep the 100% height during scrolling, so trying to figure out how to pull that off.
Here's the full source:

html {
  height: 100%;
  min-height: 100%;
}

body {
  height: 100%;
  min-height: 100%;
  font-family: Georgia, sans-serif;
}

#overlay {
  background: rgba(0, 0, 0, 0.4);
  width: 100%;
  height: 100%;
  min-height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10000;
}

header,
section,
footer {
  width: 800px;
  margin: 0 auto 20px auto;
  padding: 20px;
  background: #ff0;
}

section {
  min-height: 1500px;
}

Header

Here's some sweet content

Here's my footer

A: This happens because the #overlay position: absolute is relative to the  and using it's dimensions, which is only the viewport height.
To make sure that the #overlay uses the dimensions of whole page, you could use position: relative; on the  (but you will need to remove the min-height: 100% and height: 100% on the  first because this makes it use the viewport size). The #overlay will then use the  dimensions and fill the entire page.

A: position: fixed; on the overlay.

A: Change #overlay position:absolute to position:fixed


text:
Q: Single Events as Sub-Page to Main Calendar Page Does anyone have experience with Time.ly's Event Calendar? I've contacted Time.ly help and they informed me this sort of thing would have to be custom work. Soo, I come to the trusty WPSE!
Do you know of a way to have single events show up as sub-posts/-pages beneath the main calendar page?
For example, the current permalink structure is:

*

*Main Calendar: domain.com/calendar

*Single Event:  domain.com/ai1ec_event/single-event-title
What I'd like to do, is have the permalink structure be:

*

*Main Calendar: domain.com/calendar

*Single Event:  domain.com/calendar/single-event-title
or even...

*Single Event: domain.com/calendar/ai1ec_event/single-event-title
Either of those two single event permalinks would be fine with me, I just want to have it be under the Calendar page itself.
I'm not completely sure where to begin with this though. Just thought I'd put it out there for anyone who might be able to give me a jumping off point.

//edit
Also, if someone with 300+ rep wouldn't mind creating these two new tags and adding them to this post, that'd be great.

*

*all-in-one-event-calendar

*timely
Thanks!

A: I'll preface this by saying I have no experience with or knowledge of the plugin, this answer is based entirely on a 30 second scan of the code that registers the post type for use in the plugin, so you may uncover issues with this solution that my quick clicking of a test event didn't catch. With that said...
The basic gist of this is to unset the post type registered by the plugin, and then re-register it with the same settings except for the modified rewrite slug. To understand how this works you should familiarize yourself with the register_post_type function if you're not already.
The code that registers the post type for the plugin is in the file app/helper/class-ai1ec-app-helper.php.
The following code was tested in the Twenty Eleven theme's functions.php file. You can do this in your own plugin, but you'll have to be sure it runs after the event calendar plugin's init for this to work.
Be sure to read all of the comments within the code to understand what was changed, the important detail being the rewrite argument of register_post_type which gives us our desired URL: 'rewrite' => array( 'slug' => 'calendar/event', 'with_front' => false )
add_action( 'init', 'wpa64981_event_calendar_init' );

function wpa64981_event_calendar_init() {

    // make sure the plugin is active and has set itself up
    if( defined( 'AI1EC_POST_TYPE' ) ) :

        // globalize the post types array and some plugin settings we'll need
        global $wp_post_types, $ai1ec_settings, $ai1ec_app_helper;

        // unset the original post type created by the plugin
        unset( $wp_post_types[ AI1EC_POST_TYPE ] );

        // the labels array was copied wholesale from the plugin
        // EXCEPT 'all_items' value, which originally reference $this
        $labels = array(
            'name' => _x( 'Events', 'Custom post type name', AI1EC_PLUGIN_NAME ),
            'singular_name' => _x( 'Event', 'Custom post type name (singular)', AI1EC_PLUGIN_NAME ),
            'add_new' => __( 'Add New', AI1EC_PLUGIN_NAME ),
            'add_new_item' => __( 'Add New Event', AI1EC_PLUGIN_NAME ),
            'edit_item' => __( 'Edit Event', AI1EC_PLUGIN_NAME ),
            'new_item' => __( 'New Event', AI1EC_PLUGIN_NAME ),
            'view_item' => __( 'View Event', AI1EC_PLUGIN_NAME ),
            'search_items' => __( 'Search Events', AI1EC_PLUGIN_NAME ),
            'not_found' => __( 'No Events found', AI1EC_PLUGIN_NAME ),
            'not_found_in_trash' => __( 'No Events found in Trash', AI1EC_PLUGIN_NAME ),
            'parent_item_colon' => __( 'Parent Event', AI1EC_PLUGIN_NAME ),
            'menu_name' => __( 'Events', AI1EC_PLUGIN_NAME ),
            'all_items' => $ai1ec_app_helper->get_all_items_name()
        );

        // identical to plugin's original values
        $supports = array( 'title', 'editor', 'comments', 'custom-fields', 'thumbnail' );

        // this is where the important change is made
        // to get our own rewrite slug:
        //
        // 'rewrite' => true
        //
        // changes to:
        //
        // 'rewrite' => array( 'slug' => 'calendar/event', 'with_front' => false )
        //
        $args = array(
            'labels' => $labels,
            'public' => true,
            'publicly_queryable' => true,
            'show_ui' => true,
            'show_in_menu' => true,
            'query_var' => true,
            'rewrite' => array( 'slug' => 'calendar/event', 'with_front' => false ),
            'capability_type' => array( 'ai1ec_event', 'ai1ec_events' ),
            'capabilities' => array(
                'read_post'               => 'read_ai1ec_event',
                'edit_post'               => 'edit_ai1ec_event',
                'edit_posts'              => 'edit_ai1ec_events',
                'edit_others_posts'       => 'edit_others_ai1ec_events',
                'edit_private_posts'      => 'edit_private_ai1ec_events',
                'edit_published_posts'    => 'edit_published_ai1ec_events',
                'delete_post'             => 'delete_ai1ec_event',
                'delete_posts'            => 'delete_ai1ec_events',
                'delete_others_posts'     => 'delete_others_ai1ec_events',
                'delete_published_posts'  => 'delete_published_ai1ec_events',
                'delete_private_posts'    => 'delete_private_ai1ec_events',
                'publish_posts'           => 'publish_ai1ec_events',
                'read_private_posts'      => 'read_private_ai1ec_events' ),
            'has_archive' => true,
            'hierarchical' => false,
            'menu_position' => 5,
            'supports' => $supports,
            'exclude_from_search' => $ai1ec_settings->exclude_from_search,
        );

        // register the post type with our new settings
        register_post_type( AI1EC_POST_TYPE, $args );

    endif;

}


text:
Q: difference between a++ and ++a in while loop i am trying to figure out, why do i end up with different outcome, when i use a++ versus ++a in a while loop? i know that they are postfix and prefix operations but still do not get why i am getting the results i get
var a = 1;
 while (a < 3) {
   console.log(a);
   a++;

}
i ger results: 1, 2, 2  , when using ++a instead of a++ i get different outcome.
 var a = 1;
 while (a < 3) {
       console.log(a);
       ++a;
  }

in this case i get 1,2,3.
 can someone explain operations order step by step and why do i get the output i get?

A: You'll only get 1,2,2 or 1,2,3 if you run this in the console - outside the console both will only output 1,2 - check the console when running this fiddle
When running in the console, the last number you see in the console is the "result" of the last operation ... so, 2 (because of post increment) in the first case, and 3 (because of pre increment) in the second -
if you add ONE line after the } with just a; - both will show 1,2,3 - like so
var a = 1;
 while (a < 3) {
   console.log(a);
   a++;
}
a;

and
var a = 1;
while (a < 3) {
    console.log(a);
    ++a;
}
a;

shows that a is the same after the while loop finishes


text:
Q: Converged applications Azure AD v2, register programmatically Hi i trying figure out how register app in https://apps.dev.microsoft.com programmatically.

Any idea?

A: The only way to register Azure AD v2.0 applications at this point in time is through the Microsoft Graph API beta endpoint.
You'll need to use the beta/resource/Application endpoint and perform a HTTP POST with a valid access token.  This is a beta endpoint meaning it may change in the future and is not recommended for production.
Here's the MS Graph getting started to help use the API.


text:
Q: Refreshing a window from another thread while other operations are performed? I have been trying to keep the splash screen for my application from hanging while the application loads its initial data, however I have not yet been sucessful in finding a way to do this.
Here is the code I have tried:
SplashView splashScreen = new SplashView();
            new Thread((ThreadStart)delegate
            {
                splashScreen.Dispatcher.Invoke((Action)delegate
                {
                    while ((bool)splashScreen.Dispatcher.Invoke((Func<SplashView, bool>)delegate(SplashView sView) { return sView.IsEnabled; }, DispatcherPriority.Render, new object[] { splashScreen }))
                    {
                        splashScreen.Dispatcher.Invoke((Action<SplashView>)delegate(SplashView sView) { sView.UpdateLayout(); }, DispatcherPriority.Render, new object[] { splashScreen });
                        Thread.Sleep(10);
                    }
                }, DispatcherPriority.Render, new object[] { });
            }).Start();

Can someone please tell me how to accomplish this?
Thanks,
Alex.

A: *

*Load all your data (model / view models) on background thread (like BackgroundWorker).

*Dispatcher.Invoke() will hang your UI thread as multiple invokes would block due to synchronous execution of code. Use Dispatcher.BeginInvoke() instead. It uses the dispatcher queue more effectively.

*Use DispatcherPriority to your advantage. Any Splash UI notifications which are of lower importance could be displayed following higher priority ones.

*Use Dispatcher.PushFrames() if you want to notify Splash for something on priority.

*Split your data loading in multltiple background threads and use Wait / Pulse to notify others when the slower ones finish. Unrelated data can be loaded in different threads e.g. Finance related data and employee related data can be loaded using different threads.


text:
Q: Why do we represent each column by x and y values in column picture of a system of linear equations I started watching Gilbert Strang's Linear Algebra lectures. In the first lecture, he has the following system of linear equations
$$\begin{cases}
 2x - y = 0 \\
 -x + 2y = 3
\end{cases}
$$
When he talks about column picture of the equations, he writes the equations as the following linear combination of columns
$X\begin{bmatrix} 2 \\ -1\end{bmatrix}$ + $Y\begin{bmatrix} -1 \\ 2\end{bmatrix}$ = $\begin{bmatrix} 0 \\ 3\end{bmatrix}$
And then, he shows how it looks geometrically as follows

One thing that i don't understand from the above representation is, how can we consider two coefficients of X (2 and -1) and plot them as if they are X and Y coordinates of a vector?

A: We didn't represent X,Y tables of data in X,Y plots before 1600.
It was a sort of discovery, and you can test it, predict, and so on.
It is useful.
In the same way, you can look at those coefficients as being vectors, and it's very insightful. Because from their shape and values, you can derive properties of solutions etc.
It is exactly the same with matrices.

A: Take the following substitutions: $u=\begin{bmatrix} 2 \\ -1\end{bmatrix}$, $v=\begin{bmatrix} -1 \\ 2\end{bmatrix}$ and $w=\begin{bmatrix} 0 \\ 3\end{bmatrix}$. Then, Gilbert Strang  says that we have to add some amount (say $x=a$) of the vector  $u$ to some amount (say $y=b$) of the vector $v$ to get the vector $w=au+bv$. Next, he finds the right amounts to make the equality true and simply draws them. I don't think there is something perplexing :)


text:
Q: Как можно в код php вставить возможность перезагрузить страничку. Добрый день! Подскажите пожалуйста, нельзя ли как-нибудь по условию if  в php код  вставить указание страничке перезагузиться в первоначальный вид.
Нужно для случая . если юзер ввел что-то не то при авторизации, и сессия создана , но пуста, вернуть ему возможность опять заполнить форму . Как-то может туда Logout вставить?


text:
Q: Creating an item based on text in a cell of a DataGrid In a LightSwitch application I have the following three tables:

These tables are part of a bigger, already existing database that cannot be modified for this application.
I also have the following grid on the details page of a Post:

What's shown is the 'Tag' property of PostTag, filtered for just one Post.
So far so good. However, because there can be a lot of different tags, I want to allow users to create a new tag by simply typing in a non-existing tag into the AutoCompleteBox and then, in some way, create a new tag with the entered value.
I have found this blog post by Beth Massi explaining how one could do something like this, but the solution is for just a single AutoCompleteBox. It looks absolutely terrible in a DataGrid, because the button will be shown in all rows and I have not managed to find a way to disable them conditionally (in a DataGrid).
Another acceptable solution would be this one using a message box and LostFocus, but it, too, does not seem to play nice with a DataGrid.
Is there a way to get what I want, or do I have to add some other way of easily creating new Tags?


text:
Q: Existence of Non-Trivial, Convex, Open Set in $C_{\mathbb{C}}[0,1]$ Under $L^{0}$ Metric I've been struggling with this problem for the last four hours. The problem is to show that the space of $\mathbb{C}$-valued continuous functions on $[0,1]$ under the metric
$d(f,g)=\int_{0}^{1}\frac{\vert f-g\vert}{1+\vert f-g\vert}dx$ has no non-trivial convex open sets. I refer to d as the $L^{0}$ metric since such a metric is often used on the space of random variables on a probability space.
I've taken two thus far fruitless approaches. In the first approach, I assumed there existed such a non-trivial convex set U then  tried to show that any $f\in C_{\mathbb{C}}[0,1]$ can be expressed as convex combination of elements of U.
Second thought was to use the fact that $C_{\mathbb{C}}[0,1]$ is a dense subspace of $L^{p}$, with $0<p<1$, under the $L^{0}$ metric. I wanted to show that since such a set does not exist in $L^{p}$ under this metric then it cannot exist in $C_{\mathbb{C}}[0,1]$. I was able to get as far as showing that these $L^{p}$-spaces have no non-trivial, convex, open sets under this metric.

A: Suppose $U$ is a nonempty convex open set. By translation, we can assume that $0\in U$. Thus there is a $\delta > 0$ such that $B_\delta(0) = \{ f : d(f,0) < \delta\} \subset U$. Fix an integer $n > 2/\delta$, and for $0 \leqslant k \leqslant n$, let
$$\varphi_k(x) = \begin{cases} n\left(x - \frac{k-1}{n}\right) &, \frac{k-1}{n}\leqslant x \leqslant \frac{k}{n}\\ n\left(\frac{k+1}{n}-x\right) &, \frac{k}{n} \leqslant x \leqslant \frac{k+1}{n}\\ \qquad 0 & x < \frac{k-1}{n} \lor x > \frac{k+1}{n}\end{cases}$$
where, for $k = 0$ resp $k = n$ the part outside $[0,1]$ is of course ignored. Then we have
$$\sum_{k=0}^n \varphi_k(x) = 1$$
for all $x\in [0,1]$, and for any continuous $f\colon [0,1]\to\mathbb{C}$,
$$f = \sum_{k=0}^n \frac{1}{n+1}\cdot \underbrace{\left((n+1)\cdot \varphi_k\cdot f\right)}_{\psi_k}.\tag{1}$$
Now,
$$d(\psi_k,0) = \int_0^1 \frac{\lvert \psi_k(x)\rvert}{1+\lvert\psi_k(x)\rvert}\,dx = \int_{(k-1)/n}^{(k+1)/n} \frac{\lvert \psi_k(x)\rvert}{1+\lvert\psi_k(x)\rvert}\,dx < \int_{(k-1)/n}^{(k+1)/n}\,dx = \frac{2}{n} < \delta$$
for $1 \leqslant k < n$, and adjusting the integral limits to $0$ resp. $1$ for $k = 0$ resp. $k = n$ shows that also $d(\psi_0,0) < \delta$ and $d(\psi_n,0) < \delta$.
Thus $(1)$ shows that $f$ is a convex combination of functions in $B_\delta(0) \subset U$, and since $U$ is convex, it follows that $f\in U$. Since $f$ was completely arbitrary, this shows that $U = C([0,1],\mathbb{C})$. Thus there are only two convex open sets - $\varnothing$ and $C([0,1],\mathbb{C})$ - in the topology defined by $d$.


text:
Q: Show that there is only one $r \in \mathbb{N}$ such that $n + r = m $ Let $m,n \in \mathbb{N}$, such that $n ≤ m$. Show that there is only one $r \in \mathbb{N}$ such that $n + r = m$
Assuming  $0\in \mathbb{N}$

A: (I am assuming $0 \in \mathbb N$)
We proceed by induction on $m$.
Base case: $m=0$, the only other natural number $n \le m$ is $0$. $0 + r = r, \forall r \in \mathbb N $. So then $r = 0$ and is the only unique one that does this.
Now we assume this is true for all naturals less than $m$
We want to find an $r$ such that $n+r = m$. If $m = n$, $0$ does this, so lets assume $n < m $. We have then the predecessor to  $m$, $m-1$, is greater than or equal to $n \le m-1$. Therefore $\exists ! r$ by induction hypothesis s.t. $n + r = m - 1$. Applying the successor function to both sides we get $(n+r) +1 = m$. You can show that this is the same as $n + (r+1) = m$ by the definition of addition as repeated applications of the successor function. So we have shown existence and also since $r$ was unique by induction hypothesis, we can also note that $r+1$ will be the unique one that does this.