text:
Q: Why can't I get an Internet connection with Wifi Pineapple Nano? I am new to wifi pineapple. I am having a problem with my wifi pineapple nano for windows 10. I followed the initial setup of nano for windows and I am not getting any internet connection.
When I click the "Load Bulletins" from Dashboard, I get the error:

"Error connecting to WiFiPineapple.com. Please check your connection."

I have attached the images for my network setting and the error I am getting. I have even tried it without the Default Gateway value: 172.16.42.1 but it still does not work. Can someone please tell me what I am doing wrong?
Error seen on the home page of wifi pineapple nano:

My computer network settings:

A: My Windows 10 setup is working with this config (as per their video) using firmware 1.1.1:
IP address: 172.16.42.42
Subnet mask: 255.255.0.0 note your subnet mask is wrong
Default gateway: blank
Obtain DNS server address automatically - should be checked
That said, Windows 10 just wouldn't make the connection work. I tried repeated rebooting, rechecking, and repeating setup. Finally it (Load bulletins) worked but I don't know why it decided to do so.


text:
Q: Is $\mathfrak{sl}(n,k)$ solvable/nilpotent? I know $\mathfrak{sl}(n,k)$ isn't solvable if char$k\ne2$, and also $\mathfrak{sl}(2,k)$ is nilpotent if char$k=2$. What about $\mathfrak{sl}(n,k)$ when char$k=2$ in general?

A: The Lie algebra $\mathfrak{sl}_n(K)$ for $n>1$ is simple over any field of characteristic $p$ if and only if $p\nmid n$. In case of $p\mid n$, the center is nontrivial, but the quotient then by its center is again simple for $n>2$. This "new" simple Lie algebra is denoted by $\mathfrak{psl}_n(K)$ for $p\mid n$.
References:
Center of $\mathfrak{sl}(n,F)$
Is Lie algebra sl(n;F) simple?

redpajama_set_name: RedPajamaStackExchange


text:
Q: The limit of matrices Consider a square matrix $P$. We call it stochastic if it holds that
$$
p_{ij}\geq0\text{ and } \sum\limits_{j=1}^m\,\,\,\,p_{ij} = 1
$$
for all $1\leq i,j\leq m$. I wonder when the following limit exists: $Q = \lim\limits_{n\to\infty}P^n$.
I prefer to use the following norm:
$$
\|P\| = \sup\limits_{\|f\| = 1}\frac{\|Pf\|}{\|f\|}.
$$
For example, I know that $\|P\| = 1$.
This question strongly relates to the theory of Markov Chains, since each $P$ defines uniquely a Markov Chain on the space with $m$ states. Each $P^n$ is also a stochastic matrix, and the correspondent Markov Chain is a skeleton of the one defined by $P$.

A: If $P$ is stochastic, then $\lim_n P^n$ exists if and only if either of the following is true:

*

*(Analytically) If $\lambda$  is an eigenvalue of $P$ with $|\lambda|=1$, then $\lambda=1$.

*(Probabilistically) Every recurrent state is aperiodic.

A: Re-written, thanks to comment by Gerry Myerson. The limit will exist, applying the Frobenius Perron Theorem, if some power of $P$ has all its entries positive, or, more generally, the rows and columns of $P$ may be permuted so that $P$ is direct sum of square block matrices, each with this property. The limiting matrix will satisfy $PQ = Q$, naturally, but its rank will, in general, be the number of blocks in such a rearrangement.

A: The following is an attempt at a combinatorial characterization.
Lets call a directed graph $G=(V,E)$ multipartite if its vertex set $V$ can be partitioned into subsets $V_0, \ldots, V_{k-1}$ such that all the edges originating in $V_i$ lead to $V_{i+1 {\rm mod }~k}$. Consider the directed graph $G$ associated with the Markov chain $P$: we put the edge $(i,j)$ in $G$ whenever $p_{ij}>0$.
Claim 1: If $G$ is strongly connected, then $\lim_n P^n$ exists if and only if $G$ is not multipartite.
Proof: In one direction, its quite easy to verify that if $G$ is multipartite, $P^n$ does not have a limit.
Conversely, suppose that $G$ is not multipartite. Since $G$ is strongly connected (i.e.,  $P$ is irreducible), a result of Frobenius (the "Frobenius form" on page 680 here) implies that $P^m$ is a positive matrix for some power $m$, which, as Geoff Robinson explained, yield the desired conclusion.
Next, what about the more general case when $G$ is not necessarily strongly connected? Consider the graph obtained by collapsing every strongly connected component of $G$ into a vertex. Some of these "super-vertices" must have no incoming edges; let $g_1, g_2, \ldots, g_k$ be an enumeration of them. Then the graphs which collapsed to them - $G_1, \ldots, G_k$ - must be strongly connected subgraphs of $G$.
Claim 2: $\lim_n P^n$ does not exist if and only if at least one of $G_1, \ldots, G_k$ is multi-partite.
Proof: Again, if some $G_i$ is multipartite, its easy to see $P^n$ has no limit.
Conversely, suppose no $G_i$ is multipartite. We will next argue that $P^n$ has a limit.
Let $S$ be the set of vertices belonging to some $G_i$, and $S^c$ be the other vertices.
Let $x$ be a nonnegative vector that sums to $1$. We have that if $i \in S^c$, then $$\lim_n (x P^n)_i = 0.$$ This follows by a probabilistic argument - every certain number of steps there is a positive probability of escaping to $S$ and staying there forever so the probability of staying in $S^c$ must approach zero.
Now suppose $i \in S$; actually, for concreteness, lets suppose $i \in G_1$. Let $A_{n/2}$ be the event that starting from initial distribution $x$, the Markov chain reaches $G_1$ (and consequently stays there forever) by time $n/2$. Then $$\lim_n (x P^n)_i = P(A_{n/2}) P( \mbox{being at } i \mbox{ at time } n | A_{n/2}) + P_3(n) $$ where $P_3(n)$ is something that goes to zero as $n \rightarrow \infty$ by the previous paragraph. Its not hard to see that each of the first two terms in the previous equation approaches a limit as $n \rightarrow \infty$ - the first approaches the probability of eventual absorption into $G_1$; and the second approaches a limit because $P$ restricted to $G_1$ is strongly connected, and this is where we use Claim 1.
Finally, if $x P^n $ has a limit for every $x$ which is nonnegative and has components which sum to $1$, then by taking $x=e_j$ for every $j$ we see that $P^n$ has a limit. That concludes the proof.
Things are a bit simpler in the case when $G$ is an undirected graph (i.e., if $p_{ij}>0$ implies $p_{ji}>0$) since an undirected graph splits up into connected components and is multipartite if and only if it is bipartite. Thus:
Claim 3: If $G$ is undirected, $\lim_n P^n$ does not exist if and only if one of the connected components of $G$ is bipartite.


text:
Q: Avoiding Hard Coding in Apex following Best Practices In reference to the best practice #10 avoiding hard coding IDs, is my code considered to follow best practice without using Lists or Maps ??
Best Practices Link
trigger RecordTypeTester on Account (before update) {
    for (Account acc: trigger.new)
    {
        if(acc.RecordTypeId == [SELECT Id  from RecordType WHERE sObjectType = 'Account' AND IsActive = True AND Name = 'Health Care' LIMIT 1].Id)
        {
            //some code

        }
        else if (acc.RecordTypeId == [SELECT Id  from RecordType WHERE sObjectType = 'Account' AND IsActive = True AND Name = 'Hi-Tech' LIMIT 1].Id)
        {
            //some code
        }

    }
}

A: Initialize constant first
public final static Id INVOICE_SUMMARY_RECORD_TYPE_ID = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('Invoice Summary').getRecordTypeId();

and then, use it in a method
 if (oppItem.RecordTypeId != INVOICE_SUMMARY_RECORD_TYPE_ID)


text:
Q: Creating Symfony project from windows 10 error? Currently I have downloaded Symfony 3.0

and configured invironment variables and installed Composer and checked composer.json inside c:\xampp\htdocs\symfony it includes the downloaded version of symfony.
"require": {
        "php": ">=5.5.9",
        "symfony/symfony": "3.0.*",
        "doctrine/orm": "^2.5",
        "doctrine/doctrine-bundle": "^1.6",
        "doctrine/doctrine-cache-bundle": "^1.2",
        "symfony/swiftmailer-bundle": "^2.3",
        "symfony/monolog-bundle": "^2.8",
        "sensio/distribution-bundle": "^5.0",
        "sensio/framework-extra-bundle": "^3.0.2",
        "incenteev/composer-parameter-handler": "^2.0"
    },

I have two problems:
1. I have seen the congradualtin screen of symfony and I can't to access the windows of symfony
2. When I try to create the first project using :
c:\xampp\htdocs\Symfony>composer create-project symfony/framework-standard-edition my_project "3.0.*" --stability=dev

and also tried as:
C:\>composer create-project symfony/framework-standard-edition my_project_name "3.0.*"

I have got the following error:
  [Composer\Downloader\TransportException]
  The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: No connection could
  be made because the target machine actively refused it.

create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]

Any one try to solve the problem. Thanks everybody!


text:
Q: When deploying python Azure function on azure get No module found error I have created a Python Azure HttpTrigger function also executed on the local. It works fine on local but when I am deploying Azure HttpTrigger function on azure then I got below error:-
There was an error restoring dependencies. ERROR: cannot install pyodbc-4.0.25 dependency: binary dependencies without wheels are not supported.
Use the --build-native-deps option to automatically build and configure the dependencies using a Docker container. More information at https://aka.ms/func-python-publish

I have added the Pyodbc package in requirement.txt file. When python azure functions deploying on azure that time pyodbc installed on the local python path not in .env path.
I have already selected the python interpreter \.env\Scripts\python.ext but pyodbc package installs on the local python path.
I am not able to understand how can I solve above problem? If anybody knows the solution please let me know.  I want to install packages on azure funcions.

A: I suppose that you confused about how to install and use Python third-party module in the Azure function app. You could refer to my working steps.
Step 1 :
Navigate to your function app kudu url : https://Your_APP_NAME.scm.azurewebsites.net/DebugConsole.
Run below command in d:/home/site/wwwroot/<your function name> folder (will take some time)
python -m virtualenv myvenv

Step 2 :
Load the env via the below command in env/Scripts folder.
activate.bat

Step 3 :
Your shell should be now prefixed by (env).
Update pip
python -m pip install -U pip

Install what you need
python -m pip install MySQLdb <pyodbc>

Step 4 :
In your code, update the sys.path to add this venv:
import sys, os.path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname( __file__ ), 'env/Lib/site-packages')))

Then connect to mysql db via the snippet of code below
#!/usr/bin/python
import MySQLdb

# Connect
db = MySQLdb.connect(host="localhost",
                     user="appuser",
                     passwd="",
                     db="onco")

cursor = db.cursor()

# Execute SQL select statement
cursor.execute("SELECT * FROM location")

# Commit your changes if writing
# In this case, we are only reading data
# db.commit()

# Get the number of rows in the resultset
numrows = cursor.rowcount

# Get and display one row at a time
for x in range(0, numrows):
    row = cursor.fetchone()
    print row[0], "-->", row[1]

# Close the connection
db.close()

In addition, you could also refer to my previous case: Import module into Python Azure Function.


text:
Q: AppCompatActivity has changed my AlertDialog design I have change my activity to appCompat Activity.
Also i changed AlertDialog to Android.Support.V7.App.AlertDialog.
But i have lost my previous alertdialog design.
This is how it was look like.

And this is how it looks now

My theme till now was
parent="@android:style/Theme.Holo.Light.DarkActionBar">

But i was enforced to changed it cause appCompat doesn't support Holo theme.
So i change it to
 parent="Theme.AppCompat.Light.DarkActionBar">

How can i make alert dialog look like previous one?

A: Try this:
AlertDialog dialog= new AlertDialog.Builder(new ContextThemeWrapper(context, android.R.style.Theme_Holo_Dialog));

A: if you want to make buttons could help user for easier press, you can build a dialog with custom buttons and style the Button(e.g.style the Button on drawable folder).You can refer to the following code:
 AlertDialog.Builder dialog = new AlertDialog.Builder(this);
        AlertDialog alert = dialog.Create();
        alert.SetTitle("Login Information");
        //alert.SetMessage("Complex Alert");
        //alert.SetIcon(Resource.Drawable.alert);

        LayoutInflater inflater = (LayoutInflater)this.GetSystemService(Context.LayoutInflaterService);
        View view = inflater.Inflate(Resource.Layout.input_layout, null);
        alert.SetView(view);

        EditText editText_name = view.FindViewById<EditText>(Resource.Id.et_name);
        EditText editText_pwd = view.FindViewById<EditText>(Resource.Id.et_pwd);

        Button button1 = view.FindViewById<Button>(Resource.Id.button1);
        Button button2 = view.FindViewById<Button>(Resource.Id.button2);

        button1.Click += delegate {

            Toast.MakeText(this,"press button1!",ToastLength.Short).Show();
        };

        button2.Click += delegate {
            Toast.MakeText(this, "press button2!", ToastLength.Short).Show();
        };

        //alert.SetButton("OK", (c, ev) =>
        //{
        //    // Ok button click task
        //    string name = editText_name.Text;
        //    string password = editText_pwd.Text;
        //    Toast.MakeText(this, "name = " + name + " password= " + password, ToastLength.Long).Show();
        //});
        //alert.SetButton2("CANCEL", (c, ev) => { });
        alert.Show();

The input_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:id="@+id/et_name"
  android:hint="please input name"
/>
<EditText
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:id="@+id/et_pwd"
  android:password="true"
  android:hint="please input password"
/>

<LinearLayout
   android:padding="20dp"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"  >

    <Button
    android:id="@+id/button1"
     android:text="button1"
     android:textColor="@android:color/white"
      android:layout_weight="1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/defaultbutton"
    />
    <Button
    android:id="@+id/button2"
    android:layout_marginLeft="20dp"
    android:text="button2"
    android:textColor="@android:color/white"
    android:layout_weight="1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/defaultbutton"
    />
</LinearLayout>

define a xml(e.g. defaultbutton.xml) in folder drawable
<?xml version="1.0" encoding="utf-8" ?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#1E90FF" />
<!--<stroke
    android:width="2dp"
    android:color="#ffffff" />-->
<corners
  android:bottomLeftRadius="20dp"
  android:bottomRightRadius="20dp"
  android:topLeftRadius="20dp"
  android:topRightRadius="20dp" />
</shape>

Note:
1.define a xml( defaultbutton.xml) in folder drawable
2.use like this:
android:background="@drawable/defaultbutton"

The result is:


text:
Q: Пустое место после последнего слайда При использовании ссылок с заданным background появляется пустое пространство после последнего слайда, хотя, если вместо картинок использовать просто текст, то всё нормально работает. Размер картинки - квадрат с размерами 300px, это менять нельзя по задумке проекта.
$(document).ready(function(){
    $('.slider').slick({
        arrows:true,
        dots:false,
        infinity: true,
        slidesToShow:2,
        slidesToScroll:2,
        autoplay:true,
        speed:500,
        autoplaySpeed:2000,
        responsive:[
            {
                breakpoint: 768,
                settings: {
                    slidesToShow:2
                }
            },
            {
                breakpoint: 550,
                settings: {
                    slidesToShow:1
                }
            }
        ]
    });
});

.slider__block {
    width: 100%;
    max-width: inherit;
    background: #2c2a72;
    min-height: 512px;
}
.slider__uptitle {
    width: 100%;
    padding: 60px 0 40px;
    font-size: 60px;
    font-weight: normal;
    text-align: center;
    font-family: ChaletE;
}
.slick-slider{
    min-width: 0;
}

.slick-list {
    overflow: hidden;
    max-width: 1200px;
    margin: 0 auto;
}
.slick-track{
    display: flex;
    align-items: flex-start;
    padding-bottom: 40px;
}
.slider {
    position: relative;
    padding: 0px 60px;
}

.slider .slick-arrow{
    position: absolute;
    top: 50%;
    margin: -30px 30px 0px;
    z-index: 10;
    font-size: 0;
    width: 45px;
    height: 83px;
    border: none;
    opacity: 0.65;
}

.slider .slick-arrow:hover {
    opacity: 0.4;
}

.slider .slick-arrow.slick-prev{
    left: 0;
    background: url('../img/control-left.svg') 0 0 / 100% no-repeat;
}
.slider .slick-arrow.slick-next{
    right: 0;
    background: url('../img/control-right.svg') 0 0 / 100% no-repeat;
}
.slider .slick-arrow.slick-disabled{
    opacity: 0.2;
}

.slider__item {
    display: block;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.partner-link {
    display: block;
    width: 300px;
    height: 300px;
    padding: 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

a#partner-rostelecom {
    background-image: url("../img/logo/logo-rostelecom.png");
}

a#partner-snowmedia {
    background-image: url("../img/logo/logo-snowmedia.png");
}

a#partner-skobeev {
    background-image: url("../img/logo/logo-skobeev.png");
}

a#partner-ascon {
    background-image: url("../img/logo/logo-ascon.png");
}

a#partner-demis {
    background-image: url("../img/logo/logo-demis.png");
}

a#partner-lanta {
    background-image: url("../img/logo/logo-lanta.png");
}

a#partner-krtex {
    background-image: url("../img/logo/logo-krtex.png");
}

ПРЕДПРИЯТИЯ ПАРТНЕРЫ

A: Вот ваш код, никаких отступов нет

$(document).ready(function(){
    $('.slider').slick({
        arrows:true,
        dots:false,
        infinity: true,
        slidesToShow:2,
        slidesToScroll:2,
        autoplay:true,
        speed:500,
        autoplaySpeed:2000,
        responsive:[
            {
                breakpoint: 768,
                settings: {
                    slidesToShow:2
                }
            },
            {
                breakpoint: 550,
                settings: {
                    slidesToShow:1
                }
            }
        ]
    });
});
.slick-list {
    overflow: hidden;
    max-width: 1200px;
    margin: 0 auto;
}
.slider__block{
background: blue;
}
.slick-track{
    display: flex;
    align-items: flex-start;
    padding-bottom: 40px;
}
.slider {
    position: relative;
    padding: 0px 60px;
}

.slider .slick-arrow{
    position: absolute;
    top: 50%;
    margin: -30px 30px 0px;
    z-index: 10;
    font-size: 0;
    width: 45px;
    height: 83px;
    border: none;
    opacity: 0.65;
}

.slider .slick-arrow:hover {
    opacity: 0.4;
}

.slider .slick-arrow.slick-prev{
    left: 0;
    background: url('../img/control-left.svg') 0 0 / 100% no-repeat;
}
.slider .slick-arrow.slick-next{
    right: 0;
    background: url('../img/control-right.svg') 0 0 / 100% no-repeat;
}
.slider .slick-arrow.slick-disabled{
    opacity: 0.2;
}

.partner-link {
    display: block;
    width: 300px;
    height: 300px;
    padding: 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

a#partner-rostelecom {
    background-image: url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT7UDq6_M1hU-C3mNf7ouGM2uY96rzqOd5CJw&usqp=CAU");
}

a#partner-snowmedia {
    background-image: url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT7UDq6_M1hU-C3mNf7ouGM2uY96rzqOd5CJw&usqp=CAU");
}

a#partner-skobeev {
    background-image: url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT7UDq6_M1hU-C3mNf7ouGM2uY96rzqOd5CJw&usqp=CAU");
}

a#partner-ascon {
    background-image: url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT7UDq6_M1hU-C3mNf7ouGM2uY96rzqOd5CJw&usqp=CAU");
}

a#partner-demis {
    background-image: url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT7UDq6_M1hU-C3mNf7ouGM2uY96rzqOd5CJw&usqp=CAU");
}

a#partner-lanta {
    background-image: url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT7UDq6_M1hU-C3mNf7ouGM2uY96rzqOd5CJw&usqp=CAU");
}

a#partner-krtex {
    background-image: url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT7UDq6_M1hU-C3mNf7ouGM2uY96rzqOd5CJw&usqp=CAU");
}

<link href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.min.css" rel="stylesheet"/>

ПРЕДПРИЯТИЯ ПАРТНЕРЫ

A: @Alexandr, спасибо за помощь. В конечном итоге, я переделал вёрстку, оставив всего 3 slider-item. С JS убрал пока что responsive, но добавил fade: true, cssEase: 'linear'. Немного передал стили, что оно нормально центрировало изображения.
В конечном итоге вот, что вышло:
$(document).ready(function(){
    $('.slider').slick({
        arrows:true,
        dots:false,
        infinity: true,
        fade: true,
        cssEase: 'linear',
        autoplay:true,
        autoplaySpeed:2000,
    });
});

.slider__block {
    width: 100%;
    max-width: inherit;
    background: #2c2a72;
    min-height: 512px;
}

.slider__uptitle {
    width: 100%;
    padding: 60px 0 40px;
    font-size: 60px;
    font-weight: normal;
    text-align: center;
    font-family: ChaletE;
}

.slick-slider{
    min-width: 0;
}

.slick-list {
    overflow: hidden;
    max-width: 1200px;
    margin: 0 auto;
}

.slick-track{
    display: flex;
    align-items: flex-start;
    padding-bottom: 40px;
}

.slider {
    position: relative;
    padding: 0px 60px;
}

.slider .slick-arrow{
    position: absolute;
    top: 40%;
    margin: -30px 30px 0px;
    z-index: 10;
    font-size: 0;
    width: 30px;
    height: 50px;
    border: none;
    opacity: 0.65;
}

.slider .slick-arrow:hover {
    opacity: 0.4;
}

.slider .slick-arrow.slick-prev{
    left: 90px;
    background: url('../img/control-left.svg') 0 0 / 100% no-repeat;
    background-size: contain;
}
.slider .slick-arrow.slick-next{
    right: 90px;
    background: url('../img/control-right.svg') 0 0 / 100% no-repeat;
    background-size: contain;
}
.slider .slick-arrow.slick-disabled{
    opacity: 0.2;
}

.slider__item {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 300px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.partner-link {
    display: block;
    width: 300px;
    height: 300px;
    padding: 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

a#partner-rostelecom {
    background-image: url("../img/logo/logo-rostelecom.png");
}

a#partner-snowmedia {
    background-image: url("../img/logo/logo-snowmedia.png");
    width: 400px;
}

a#partner-skobeev {
    background-image: url("../img/logo/logo-skobeev.png");
}

a#partner-ascon {
    background-image: url("../img/logo/logo-ascon.png");
    background-position: center 80px;
    width: 400px;
}

a#partner-demis {
    background-image: url("../img/logo/logo-demis.png");
    width: 400px;
}

a#partner-lanta {
    background-image: url("../img/logo/logo-lanta.png");
}

a#partner-krtex {
    background-image: url("../img/logo/logo-krtex.png");
}

ПРЕДПРИЯТИЯ ПАРТНЕРЫ


text:
Q: What's going on the function inside of reduce method in JavaScript? - JavaScript30 exercise I have been working on the array exercise on Wes Bos's JavaScript30.
Please help me out with this exercise., which is #8.
The code in the video is the following.

const data =['car', 'car', 'truck', 'truck', 'bike', 'walk', 'car', 'van', 'bike', 'walk', 'car', 'van', 'car', 'truck']

const transportation = data.reduce(function(obj, item) {
  if (!obj[item]) {
    obj[item] = 0;
  }
  obj[item]++;
  return obj;
}, {});
console.log(transportation)

I tried two versions and get the wrong output or an error, and would like to figure out the difference between the code above and these two. Also, I'd like to understand what was going on with these two codes.
One is the following and the difference is that setting else block.

const data = ['car', 'car', 'truck', 'truck', 'bike', 'walk', 'car', 'van', 'bike', 'walk', 'car', 'van', 'car', 'truck']

const transportation = data.reduce(function(obj, item) {
  if (!obj[item]) {
    obj[item] = 0;
  } else {
    obj[item]++;
  }
  return obj;
}, {});

console.log(transportation)

This returns the object below.
{car: 0, truck: 0, bike: 0, walk: 0, van: 0}
In this case, does else detect nothing? How come the function keeps returning the same value zero?
Another one is the following and the difference is putting return inside of else block.

const data = ['car', 'car', 'truck', 'truck', 'bike', 'walk', 'car', 'van', 'bike', 'walk', 'car', 'van', 'car', 'truck']

const transportation = data.reduce(function(obj, item) {
  if (!obj[item]) {
    obj[item] = 0;
  } else {
    obj[item]++;
    return obj;
  }
}, {});

console.log(transportation)

This returns an error saying Uncaught TypeError: Cannot read property 'car' of undefined.
I understand that to return the object inside else block causes an error because this terminates the execution.
However, still don't understand the meaning of that error message.  Should I have defined each object key somewhere in some way?

A:

const data = ['car', 'car', 'truck', 'truck', 'bike', 'walk', 'car', 'van', 'bike', 'walk', 'car', 'van', 'car', 'truck']

const transportation = data.reduce(function(obj, item) {
  // if (!obj[item]) { // `obj[item] === 0` ==> `!obj[item] === false`
  if (!(item in obj)) {
    obj[item] = 0;
  } else {
    obj[item]++;
  }
  return obj;
}, {});

console.log(transportation)

A: Reduce function accept a function and on every iteration whatever value you return will gets assigned to first param(obj in our case). you missed to return, undefined will gets assigned and hence error.
const data = ['car', 'car', 'truck', 'truck', 'bike', 'walk', 'car', 'van', 'bike', 'walk', 'car', 'van', 'car', 'truck']

const transportation = data.reduce(function(obj, item) {
    if (!obj[item]) {
        obj[item] = 1;
    } else {
        obj[item]++;
    }
    return obj;
}, {});

console.log(transportation)


text:
Q: For the same Conditional Probability, why does Bayes's Theorem differ from a direct calculation? Abbreviate: $D =$ a person is diseased, $+ =$ the test is positive.
Assume: $\Pr(D) = 0.001, \; \Pr(+|D)=0.99, \; \Pr(+|D^C) = 0.01  \qquad ($$\iff$ $ \Pr(-|D^C) = 0.99).$
1. Use Bayes's Theorem: $\Pr(D|+) = 0.0 \; 90 \; 1639... \quad $ (confirmed; scroll down 30% hereof).
2. Quantify the above probabilities for 1000 people (per 1 and 2)
(Table herefrom. Green indicates True results, red False results).
$$\begin{array}{r|cc|c}
&D &\lnot D  &\text{Total}\\ \hline
+&\color{green}{\Pr(D)\Pr(+|D)}&\color{red}{\Pr(D^C)\Pr(+|D^C)}&\text{add the 2 left entries}\\
- &\color{red}{\Pr(D)\Pr(-|D)}&\color{green}{\Pr(D^C)\Pr(-|D^C)}&\color{black}{\text{add the 2 left entries}}\\ \hline
\text{Total}&\color{black}{1}&\color{black}{999}&\color{black}{1000}
\end{array}$$
$$\begin{array}{r|cc|c}
&D &\lnot D  &\text{Total}\\ \hline
+&\color{green}{1}&\color{red}{9.99}&10.99\\
- &\color{red}{\text{impertinent}}&\color{green}{\text{impertinent}}&\color{black}{\text{impertinent}}\\ \hline
\text{Total}&\color{black}{1}&\color{black}{999}&\color{black}{1000}
\end{array}$$
$3.$ So $\Pr(D|+) = \dfrac{ \color{green}{1} }{ 10.99 } = 0.0 \; 90 \; 9918... \quad $
Why do 1 and 3 differ starting at the ten-thousandth digit?

A: As mentioned in the comments, this is due to roundoff error. Try instead using $100000$ people:
$$\begin{array}{r|cc|c}
&D &\lnot D  &\text{Total}\\ \hline
+&\color{green}{99}&\color{red}{999}&1098\\
- &\color{red}{1}&\color{green}{98901}&\color{black}{98902}\\ \hline
\text{Total}&\color{black}{100}&\color{black}{99900}&\color{black}{100000}
\end{array}$$
So:
$$
\Pr[D \mid +] = \frac{99}{1098} = \frac{11}{122} = 0.090163934\ldots
$$

A: Thanks to user 'Adriano' 's answer, I recognised the problem: I neglected to calculate precisely the four numbers in the middle entry which should instead be:
$$\begin{array}{r|cc|c}
&D &\lnot D  &\text{Total}\\ \hline
+&\color{green}{0.99}&\color{red}{9.99}&10.98\\
- &\color{red}{ 0.01 }&\color{green}{989.01}&\color{black}{\text{989.02}}\\ \hline
\text{Total}&\color{black}{1}&\color{black}{999}&\color{black}{1000}
\end{array}$$
$3.$ So $\Pr(D|+) = \dfrac{ \color{green}{0.99} }{ 10.98 } = 0.0 \; 90 \; 1639344... \quad $


text:
Q: zoom pan issue in chrome 55 I'm using panzoom plugin of Timmywil
https://github.com/timmywil/jquery.panzoom
in my project. It has been working fine till now. But since chrome's latest update it's broken. It zooms once but if you start panning view is reset to original position. It works with mouse wheel but pinch zoom is not working.
This issue appears on chrome version 55 on android mobile.
Here is the forked test fiddle link
http://jsfiddle.net/trupti11/c3umpgud/
var $x = $('#x'), $y = $('#y');
var svg = $('svg').on('mousemove', function(e) {
    $x.text(e.clientX);
    $y.text(e.clientY);
    })[0];
var box = svg.getBoundingClientRect();
var $panzoom = $("#viewport").panzoom({
    cursor: 'default',
    increment: 4,
    minScale: 0.5,
    maxScale: 16,
    rangeStep: 2,
    transition: true,
    duration: 200,
    easing: "ease-in-out",
    $zoomIn: $('.zoom-in'),
    $zoomOut: $('.zoom-out'),
    $zoomRange: $('.zoom-range'),
    focal: {
        clientX: 108,
        clientY: 132
    }
});

var instance = $panzoom.panzoom('instance');
instance.parentOffset = { top: 32, left: 8 };

$('#pan').on('click', function(e) {
    $panzoom.panzoom('pan', 10, 10, { relative: true, animate: true });
});

I tried updating with the latest plugin files but not change.
Can anyone shed some light?
Here is another demo page which is not working in Android Chrome version 55.
http://timmywil.github.io/jquery.panzoom/demo/

A: Here is the solution which worked for me.
I had to update to new js file and comment line
"this.panning = true"

at line no 1164.
Another problem because of this change was that my image view was shifted halfway down to center of page div. But I got it sorted it by specifying height for main page div.
Check below links for more details
https://github.com/timmywil/jquery.panzoom/issues/308
https://github.com/timmywil/jquery.panzoom/issues/303


text:
Q: Pushing string from array into regex I have an array of strings I need to iterate over, push each string into a regex, then store it's output in a different array.  I can get the regex to work fine if I enter 1 string at a time manually, but can't get it to loop over each string.
Here's what I have:
results = []
arr = ["CAT", "DOG", "BIRD"]

for i in arr:
    patt='(i)+'
    string= contents
    p=re.compile(patt)
    replen=[sp.end()-sp.start() for sp in p.finditer(string)]
    results.append(max(replen)/(len(patt)-3))

*

*string = contents -- I have a txt file that holds the string I'm performing the regex on.  It's saved in contents.  If I print(string) it properly outputs the txt file string

*What I'm trying to do is have the program look at the string stored in contents, then see how many times "CAT" is consecutively found (eg.  ABCATCATCATDEFHGICAT = 3).  I want to store that number in results, then do the same thing all over again with DOG and BIRD and so on.

*If I lose the for loop and manually enter CAT or DOG or whatever in patt='(i)+' everything works fine, but I need it to iterate over each entry in the array.
Minimum reproducible answer:
results = []
arr = ["CAT", "DOG", "BIRD"]

patt='(CAT)+'
string= "ABCATCATCATCATDEFIJKCAT"
p=re.compile(patt)
replen=[sp.end()-sp.start() for sp in p.finditer(string)]
results.append(max(replen)/(len(patt)-3))

The above should push 4 into the results array.

A: Use string formatting to construct the pattern.
arr = ["CAT", "DOG", "BIRD"]

for i in arr:
    patt = '({})+'.format(i)
    ...

Or with f-strings
arr = ["CAT", "DOG", "BIRD"]

for i in arr:
    patt = f'({i})+'
    ...

A: You're using the literal i instead of the variable i. If you're using python >= 3.6 you can use fstrings and quickly take care of this.
However you have another problem in your code, if the regex isn't matched even once, you're going to get that replen is None. I fixed it so it wouldn't be dependent on the length of the regex, and instead dependent on how many matches are found (which is what you want).
results = []
arr = ["CAT", "DOG", "BIRD"]

for i in arr:
    patt=f'({i})+'
    string= contents
    p=re.compile(patt)
    replen=len([sp for sp in p.finditer(string)])
    results.append(replen)


text:
Q: Copying one vector into another starting at some position Say I have two vectors
auto a = std::vector<int>{10, 11, 12, 13, 14, 15};
auto b = std::vector<int>{21, 22, 23};

and I want to copy the entire content of b into a starting at some position (let's say 4), possibly overriding elements and resizing the vector, so that the resulting vector a looks like
[10, 11, 12, 13, 21, 22, 23]

Is there some function in the STL (maybe in <algorithm> or `) that does exactly that?

A: With the help of C++20 <ranges>
auto a = std::vector{10, 11, 12, 13, 14, 15};
auto b = std::vector{21, 22, 23};

auto pos = 4;
auto c = a | std::views::drop(pos);
auto sz = c.size();
std::ranges::copy(b | std::views::take(sz), c.begin());
std::ranges::copy(b | std::views::drop(sz), std::back_inserter(a));

Demo

A: You can do it like this:
    auto a = std::vector<int>{ 10, 11, 12, 13, 14, 15 };
    auto b = std::vector<int>{ 21, 22, 23 };

    int from = 4; //from which index

    a.insert(a.begin() + from, b.begin(), b.end());
    a.resize(from + b.size());

    for (auto i : a) {
        std::cout << i << " ";
    }

A: There's no ready-made algorithm to do it. You can implement it yourself like this:
auto a = std::vector<int>{10, 11, 12, 13, 14, 15};
auto b = std::vector<int>{21, 22, 23};

std::size_t insertionPoint = 4;
std::size_t elemCount = std::max(insertionPoint + b.size(), a.size());
a.resize(elemCount);
std::copy(std::cbegin(b), std::cend(b), std::begin(a) + insertionPoint);

Note:

*

*This requires the value type of std::vector (i.e., in this case, int) to be default constructible.

*If insertionPoint is greater than a.size() you'll get default constructed elements between the last element of a (before the insertion) and the first inserted element from b.


text:
Q: TimeZoneInfo.ConvertTimeFromUtc(timeUtc, cstZone) always in CST even though in daylight savings time? When I convert UTC to CST time by using code
DateTime timeUtc = DateTime.UtcNow;
TimeZoneInfo cstZone = TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time");
DateTime cstTime = TimeZoneInfo.ConvertTimeFromUtc(timeUtc, cstZone);

today Feb.27, 2016, the cstTime is in CST (Central Standard Time). But the cstTime will be CST (Central Standard Time) or CDT (Central Daylight Time) when the day is in Daylight Savings Time, for example, May 1, 2016? I check Microsoft's website
https://msdn.microsoft.com/en-us/library/system.timezoneinfo.converttimefromutc(v=vs.110).aspx
But it doesn't mention about this


text:
Q: How to avoid indicator deforming in expandable list view with custom images? When I don't set group indicator in expandable list it works fine and default indicator is shown left side. I want to put custom indicators with custom images (arrow_down.png and arrow_right.png).
 and
which have dimensions 100 x 100 and I put in xml in ExpanadableListView
android:groupIndicator="@drawable/indicator"

where indicator is
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_empty="true" android:drawable="@drawable/arrow_right"></item>
    <item android:state_expanded="true" android:drawable="@drawable/arrow_down"></item>
    <item android:drawable="@drawable/arrow_right"></item>
</selector>

but it totally deform images, especially when I expand row.
How to solve this and avoid indicator deforming ?


text:
Q: ¿Cuál es mi error al copilar el documento desde swave? resulta que quiero copilar un documento desde swave en r, con sus respectivas librerias xtable y knitr, y con los comandos de LateX, pero cuando voy a copilar me sale el siguiente error.
.....en la Writing to file EJEMPLO12020.tex
Processing code chunks with options ...

You can now run (pdf)latex on 'EJEMPLO12020.tex'
Running pdflatex.exe on EJEMPLO12020.tex...failed
Error running C:/Users/Jennifer/AppData/Local/Programs/MiKTeX/miktex/bin/x64/pdflatex.exe (exit code 1)

Tengo algo mal configurado?? o que debo hacer, mil gracias.

A: No sé con certeza cuál sea la causa exacta pero puedes probar una de estas opciones:

*

*Revisa que el path de R apunte a la instalación correcta de miktex (puedes seguir las instrucciones en esta respuesta de SO).
Para validar este caso, puedes usar el archivo environment de R para cambiar la variable PATH para R solamente. Revisa ?Startup en R para más detalles de este proceso. Sigue estos pasos:

*

*En R, revisa la salida de Sys.getenv("R_ENVIRON"). Esto retorna la ruta absoluta a un archivo existente de environment, que usualmente estará vacío. Si el archivo existe, salta al paso 3 más abajo.

*Si el paso anterior no retorna una ruta, crea un archivo Renviron.site en la carpeta R_HOME/etc donde R_HOME es la ruta que retorna Sys.getenv("R_HOME").

*Añade una línea al archivo de environment que contenga: PATH=C:\\full\\path\\to\\the\\folder\\with\\pdflatex;"${PATH}" (las comillas son importantes!)

*Reinicia R y revisa que Sys.getenv("PATH") y Sys.which("pdflatex") retornen las rutas correctas.

*Es posible que usar pdftex desde R Studio no instale todas las dependencias requeridas y por ello falle el proceso. En esta respuesta sugieren usar un archivo tex de prueba para garantizar que corra, genere todos los archivos intermedios sty y después ejecute correctamente cualquier tex que quieras compilar.
Fuente: foro tex


text:
Q: Can't display my JFrame and table at the same time So I've created a gui in the form on intellij and when I take out the code having to do with the table it comes out exactly how I want it, but when I put the code in all I get is the table itself. I was having trouble adding columns using the gui form itself and found a tutorial on showing how to add columns and such using the code. How would I be able to add rows to the table and/or have the table on the form
public class App extends JFrame{
    private JButton createRecordButton;
    private JPanel panel1;
    private JPanel east;
    private JPanel west;
    private JPanel south;
    private JButton deleteRecordButton;
    private JButton viewStatisticsButton;
    private JButton downloadDataButton;
    public JTable TestDB;

    public App() {

    }

    public static void main(String[] args) {
        JFrame frame=new JFrame("App");
        frame.setContentPane(new App().panel1);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);

        table gui=new table();
        gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        gui.setSize(600,200);
        gui.setVisible(true);
        gui.setTitle("The DataBase Table");

    }
}

A: You are generating an exception on line: frame.setContentPane(new App().panel1);
Note that you create the App object but the panel1 object is still null.
Use this code and you will see that both JFrames will appear:
public class App extends JFrame{
private JButton createRecordButton;
private JPanel panel1;
private JPanel east;
private JPanel west;
private JPanel south;
private JButton deleteRecordButton;
private JButton viewStatisticsButton;
private JButton downloadDataButton;
public JTable TestDB;

public App() {
    panel1 = new JPanel();
}

public static void main(String[] args) {
    JFrame frame=new JFrame("App");
    frame.setContentPane(new App().panel1);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);

    JFrame gui=new JFrame();
    gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    gui.setSize(600,200);
    gui.setVisible(true);
    gui.setTitle("The DataBase Table");

}

}


text:
Q: Unable to append 2 1D arrays in 1 1D array Below is my code where I'm trying to append 2 1D arrays to a 1 1D array:
import numpy as np
import random

arr = np.random.randint(10, size=(1,))
arr1 = np.random.randint(20, size=(1,))
arr2 = np.random.randint(30, size=(1,))

print(arr)
print(arr1)
print(arr2)

aparr = np.append(arr, arr1, arr2)
print(aparr)

However, I'm getting an error saying:
     21 print(arr2)
     22
---> 23 aparr = np.append(arr, arr1, arr2)
     24 print(aparr)

<__array_function__ internals> in append(*args, **kwargs)

/usr/local/lib/python3.7/dist-packages/numpy/lib/function_base.py in append(arr, values, axis)
   4669         values = ravel(values)
   4670         axis = arr.ndim-1
-> 4671     return concatenate((arr, values), axis=axis)
   4672
   4673

<__array_function__ internals> in concatenate(*args, **kwargs)

TypeError: only integer scalar arrays can be converted to a scalar index

Not sure, what am I missing/doing wrong. Can someone please take a look and point/explain the mistake by correcting the piece of code?

A: np.append() takes two arguments, an array to append to and a list of values to append to it. So, replace
aparr = np.append(arr, arr1, arr2)

by
aparr = np.append(arr, [arr1, arr2])

and it should work.

A: I believe the command you are looking for is called np.concatenate
That is what is commonly used to combine multiple arrays into one array of the same dimension.
arr = np.random.randint(10, size=(10,))
arr1 = np.random.randint(20, size=(10,))
arr2 = np.random.randint(30, size=(5,))
combined = np.concatenate([arr, arr1, arr2]) # will be of size 25

notice that all the arrays are in one list (can be tuple or something else, as long as it is passed as one variable to the function).
It is possible to use np.append, but that is just a limited version of np.concatenate as can be seen in the source code, and it only works when combining exactly two arrays, so you would have to do it in two steps or by combining the two arrays which should be added:
combined = np.append(np.append(arr, arr1), arr2)
# OR
combined = np.append(arr, [arr1, arr2])

The final alternative works because the arrays are flattened before combining, because axis (what dimension to combine the two arrays along) is not specified.


text:
Q: how to use group_concat with group by Here is my query:
 SELECT
    O.OrderId,
    O.Number,
    (SELECT
            CONCAT(A.Detail, ' ', C.Name, ' / ', Ci.Name)
        FROM
            kobiakinlar.Address AS A
                INNER JOIN
            County AS C ON C.CountyId = A.CountyId
                INNER JOIN
            City AS Ci ON C.CityId = Ci.CityId
        WHERE
            UserId = O.UserId) AS UserAddress,
    (SELECT
            CASE
                    WHEN O.Status = 0 THEN 'Onay Bekliyor'
                    WHEN O.Status = 1 THEN 'Onaylandı'
                    WHEN O.Status = 2 THEN 'Reddedildi'
                END
        ) Status,
    O.Creation,
    (SELECT
            CASE
                    WHEN O.IsDelivered = 0 THEN 'Teslim Edilmedi'
                    ELSE 'Teslim Edildi'
                END
        ) IsDelivered,
    SUM(T.Price) Price,
    GROUP_CONCAT(T.NAME) Products
FROM
    kobiakinlar.order O
        INNER JOIN
    (SELECT
        P.Name, op.OrderId, op.Price
    FROM
        kobiakinlar.product P
    JOIN kobiakinlar.orderproduct op ON op.ProductId = P.productId
 ) T ON O.orderId = T.orderId
        INNER JOIN
    address A ON A.AddressId = O.AddressId

It returns:

But I want to try have this one:

What should I do? Do you have any suggestion for me?

A: The syntax that you want is:
group_concat(distinct t.name separator ',') as Products

A: I changed my quert with this:
    SELECT op.OrderId,
    O.Number,
    SUM(op.Price) Price,
    (SELECT CONCAT(A.Detail, ' ',C.Name, ' / ', Ci.Name) FROM kobiakinlar.Address AS A
                INNER JOIN County AS C ON C.CountyId = A.CountyId
                INNER JOIN City AS Ci ON C.CityId = Ci.CityId
                WHERE UserId = O.UserId) AS UserAddress,
   ( SELECT CASE WHEN O.Status =0 THEN 'Onay Bekliyor'  WHEN O.Status =1 THEN 'Onaylandı' WHEN O.Status = 2 THEN 'Reddedildi' END) Status,
    O.Creation,
    ( SELECT CASE WHEN O.IsDelivered =0 THEN 'Teslim Edilmedi' ELSE 'Teslim Edildi' END) IsDelivered,
    group_concat(P.Name) Product
FROM
    kobiakinlar.product P
        JOIN
    kobiakinlar.orderproduct op ON op.ProductId = P.productId
        JOIN
    kobiakinlar.order O ON O.orderId = op.OrderId
   JOIN
kobiakinlar.address A ON A.addressId = O.AddressId
GROUP BY op.OrderId


text:
Q: independent clause or non-essential element, semi-colon or comma? The sentence I'm struggling with is:

The first version was coded from scratch in HTML and CSS, it looked like a 90's webpage.

Is the comma correct? Or should it be a semi-colon?
I thought it was a comma because

it looked like a 90's webpage.

seems to be a non-essential elements. However, one could also argue that it is an independent clause and therefore needs a semi-colon.

A: You are correct; it should be a semicolon. Where each phrase could be correctly written as a complete sentence, use a semicolon.
Note the above two sentences, in my answer; in the second sentence, "use a semicolon" could be written as a complete sentence on its own, but "where each phrase..." cannot, so I used a comma.
To be sure, there are additional rules for semicolons and commas (especially regarding lists)!
In your example, if you added the word "and" after the comma, the comma would be correct. "And it looked like a 90s web page" is not a complete sentence, whereas "It looked liked a 90s web page" is a complete sentence.


text:
Q: What is the reverse expression of 'is divisible by'? When I can say following expression with two numbers, a and b,
a is divisible by b, e.g. 24 is divisible by 6.
How can I say it in a reversed manner?
Say,
b is ... ... a, e.g. 6 is ... ... 24.

A: 24 is divisible by 6.
6 is a factor of 24.
factor
mathematics

factor, in mathematics, a number or algebraic expression that divides another number or expression evenly—i.e., with no remainder. For example, 3 and 6 are factors of 12 because 12 ÷ 3 = 4 exactly and 12 ÷ 6 = 2 exactly.

A: Alternatively, 6 divides 24.
(This might be useful if you're teaching division and haven't yet introduced the word "factor".)


text:
Q: JavaScript Countdown to Redirect another page when it hits 00:00 I have a JavaScript Countdown timer set for 30 min. I'm trying to redirect the existing page to redirect to the exit.php page when the timer hits 00:00
My code goes as:

function startTimer(duration, display) {
  var timer = duration,
    minutes, seconds;
  setInterval(function() {
    minutes = parseInt(timer / 60, 10)
    seconds = parseInt(timer % 60, 10);

    minutes = minutes < 10 ? "0" + minutes : minutes;
    seconds = seconds < 10 ? "0" + seconds : seconds;

    display.textContent = minutes + ":" + seconds;

    if (--timer < 0) {
      timer = duration;
    }
  }, 1000);
}

window.onload = function() {
  var fiveMinutes = 60 * 30,
    display = document.querySelector('#time');
  startTimer(fiveMinutes, display);
};

Section

    Time left: 30:00

Any Help Is Appreciated..

A: Here's my go at this, hope this is what you wanted:
https://jsfiddle.net/jom9s562/

var time = 30 * 60;
setInterval(function() {
  var seconds = time % 60;
  var minutes = (time - seconds) / 60;
  if (seconds.toString().length == 1) {
    seconds = "0" + seconds;
  }
  if (minutes.toString().length == 1) {
    minutes = "0" + minutes;
  }
  document.getElementById("time").innerHTML = minutes + ":" + seconds;
  time--;
  if (time == 0) {
    window.location.href = "exit.php";
  }
}, 1000);

Section

    Time left: Loading...


text:
Q: Is it possible to hide jid information - openfire I have one room with two users.
I want that only moderator of the room knows the members-list.
Now, if the member (not moderator) sends something like this:
http://jabber.org/protocol/muc#admin'>
or
http://jabber.org/protocol/muc#admin'>
the member could know the list and the jid's of the users, I want to keep it private that information.
Thanks in advance.

A: It is configurable per room - in most cases there is an option to show members list only to moderators.


text:
Q: Why should $\nu_\mu\to \nu_e$ oscillations be expected to be unobservable in short baseline experiments? The blog here says

On the other hand, several rogue experiments refuse to conform to the standard 3-flavor picture. The most severe anomaly is the appearance of electron neutrinos in a muon neutrino beam observed by the LSND and MiniBooNE experiments.

Within the $3$-flavour mixing and $3$-flavour neutrino oscillation scenario, why is it unlikely to observe $\nu_\mu\to \nu_e$ oscillation in short baseline ($L\leq 1$km) experiments?
In the standard 3-flavour mixing $$P(\nu_\mu\to\nu_e)=s^2_{23}\sin^2 2\theta_{13}\sin^2\Big(\frac{\Delta m^2_{31}L}{4E}\Big)$$
Why should $\nu_\mu\to \nu_e$ oscillations be expected to be unobservable in short baseline experiments?

A: Plugging in the implicit factor of $\hbar c$ and some conversion factors allows you to express the oscillation formula in units which are easier to calculate with:
$$P(\nu_\mu \rightarrow \nu_e) = \sin^2(\theta_{23})\sin^2(2\theta_{13})\sin^2\left(1.27 \frac{\Delta m_{31}^2}{[\mathrm{eV}^2]} \frac{L}{E} \frac{\mathrm{[km]}}{\mathrm{[GeV]}}\right)$$
The values of the mixing parameters and mass differences squared are approximately:
$$\sin^2(\theta_{23}) \approx 0.4$$
$$\sin^2(2\theta_{13}) \approx 0.08$$
$$\Delta m_{31}^2 \approx 0.002~\mathrm{eV}^2$$.
For Miniboone the distance of the detector from the target is approximately ~1 km and the energy of the neutrinos from the beam are of order 1 GeV. Plugging these in you get a value for the oscillation probability of approximately:
$$P(\nu_\mu \rightarrow \nu_e) \approx 10^{-7}$$
Since they observe ~100s of events, the probability of observing a $\nu_e$ due to neutrino oscillation is extremely unlikely.
Note that these detectors do expect to see some number of electron neutrino events coming from other sources. In Figure 1 from their recent paper here you can see that they do expect a non negligible number of electron neutrino events from kaon and muon decays, but the anomoly referred to in the blog is that they see more of these events than they expect.


text:
Q: How prove this $e=\frac{2}{1}\left(\frac{4}{3}\right)^{\frac{1}{2}}\left(\frac{6\cdot 8}{5\cdot 7}\right)^{\frac{1}{4}}\cdots$ I  see this nice equation:
$$e=\dfrac{2}{1}\left(\dfrac{4}{3}\right)^{\frac{1}{2}}\left(\dfrac{6\cdot 8}{5\cdot 7}\right)^{\frac{1}{4}}\left(\dfrac{10\cdot 12\cdot 14\cdot 16}{9\cdot 11\cdot 13\cdot 15}\right)^{\frac{1}{8}}\cdots$$
and this equation who first found it? and   How prove it.
Thank you very much!

A: This (PDF) has the proof of your equation.
New Wallis- and Catalan-Type Infinite Products for $\pi,e$, and $\sqrt{2+\sqrt 2}$
by Jonathan Sondow and Huang Yi


text:
Q: How can I monitor the haxe cpp garbage collector? I would like to ensure the garbage collector is not overused in haxe (cpp target).
I already have pools of large objects and frequently reused objects that I managed to efficiently recycle. But there are still some slowdowns. I'm sure I can limit some of the inconsistent slowdowns and skipped frames by reducing garbage collection.
How can I collect data about the gc? I would like to see the list of classes collected, the number of times they are collected and the number of objects registered in the GC.
Is there an option for that?

A: untyped __cpp__('code'); will let you execute arbitrary cpp code(passed as it is). Using this construction you can access any inner mechanisms, including garbage collector, so if youlook in gc implementatio, you can do anything you want I guess. You also can directly patch gc part of haxe after it was compiled to cpp.

A: For Haxe 3.1, use cpp.vm.ExecutionTrace.traceFunctions(); , traceLines, traceOff


text:
Q: Adding numbers on label when if-statement occurs I am making an app on windows forms application and I am stuck at a certain point.
btw, I am a very beginner in programming.
I put my code here:
        if (random.Next(3) == schat)
        {
            using (Graphics graphics = pictureBox1.CreateGraphics())
            {
                graphics.DrawImage(Properties.Resources.Schat, ClientRectangle);
            }

            MessageBox.Show("Hoera je hebt extra geld gevonden", "zoektocht");
            lblTotaalGeld.Text = Convert.ToString(100);
            double totaalGeld = Convert.ToDouble(lblTotaalGeld.Text) / 100;
            lblTotaalGeld.Text = Convert.ToString("€" + lblTotaalGeld.Text);

            btnZoektocht.Enabled = false;
        }

What I am trying to create is when this "if" statements occurs the second time.. I want the extra 100 dollars added to the bank account. At the moment I only get 100 and nothing adds.
I hope I make sense
Thanks in advance

A: double totaalGeld = 0;

Depending on how this if statement is occuring, you can put this variable at the begining of the code or as a global variable
if (random.Next(3) == schat)
        {
            using (Graphics graphics = pictureBox1.CreateGraphics())
            {
                graphics.DrawImage(Properties.Resources.Schat, ClientRectangle);
            }

            MessageBox.Show("Hoera je hebt extra geld gevonden", "zoektocht");
            totaalGeld += 100.0;
            lblTotaalGeld.text = totalGold.ToString();
         }

Now everytime this if statement occurs, totaalGeld will increment by 100 and the label lblTotaalGeld display the corresponding number
Hope this helps and will guide you to your solution !!

A: You can go about this a few different ways but I will suggest this way.
Store the value of what is inside your label in a variable/property outside the scope of your method and if-statement (global variable)
For an example of a Variable, you can have something like
private double totalGold = 0.0;

Or for a Property you can have something similar to this
public double totalGold { get; private set; }

Note: Since you say that you are a beginner, the first of these examples might be better for grasping the concept.
Also Note: You will need to add static between (private/public) and your variable/property name if you are doing this in a static class or your main class.
The implementation of both ways is the same. All we do is update this totalGold value whenever we enter this if-statement.
A rework of your current if-statement might look like:
    if (random.Next(3) == schat)
    {
        using (Graphics graphics = pictureBox1.CreateGraphics())
        {
            graphics.DrawImage(Properties.Resources.Schat, ClientRectangle);
        }

        totalGold += 100.0; // NEW LINE

        MessageBox.Show("Hoera je hebt extra geld gevonden", "zoektocht");
        lblTotaalGeld.Text = Convert.ToString("€" + totalGold);

        btnZoektocht.Enabled = false;
    }


text:
Q: joomla site not downloading google font, why? I created a website based on Joomla and I use google fonts in it, i.e. in the head part of the document I have:
<link href='http://fonts.googleapis.com/css?family=Lato|Merriweather+Sans:400,700,400italic' rel='stylesheet' type='text/css'>

and I see it in source of the page, when I browse to the web site.
In my windows xp underwhich I programmed it is working sure because I downloaded the fonts and installed, to do design under photoshop!
Browsing it to mobile phone or my other OS (windows 8, etc.) font will not appear!
What could be the reason please?
Edit:
I already added CORS header in joomla too! Still not working. I have @import(...) of the font correctly in my css. All spelling is ok and all is working in the windows system where I have the font installed. Why not working / downloading in other OS/browsers, remains a mystery to me!

A: cross check the name of the font in your CSS file with its name in the Google fonts page


text:
Q: What is sockets.ny.stackexchange.com? I've been navigating using Proxifier these days, and I when I start visiting a few Stack Overflow pages, a lot of connections to http://sockets.ny.stackexchange.com appear.
What is that site for?

A: It's Stack Exchange's WebSocket server, which is the technology used to provide live-updates.
For more info see New Feature: real time updates to questions, answers, and inbox


text:
Q: User icons appear broken and webmaster pro's has lost it's stylesheet All the profile icons on Stack Overflow and Meta appear broken, and webmaster pro's has lost it's stylesheet so is rendering as text.
Confirmed the problem through three different IP's each with a different ISP, and if it is a CDN problem I'm based in the UK.
What gives?
Meta - note broken gravatar images at screen shot:

Webmaster Pro's - lost stylesheet:


text:
Q: Gitlab rpm version It is recommended to installed Gitlab as a Omnibus package. Packages are  available for the popular deb and rpm formats. Packages are available here.
There is a also script that automates installation.
There are the following recent packages available for CentOS users:

*

*gitlab-ee-8.5.0-ee.1.el6.x86_64.rpm # Enterprise Linux 6.0 (CentOS, RedHat, Amazon Linux)

*gitlab-ee-8.5.0-ee.0.el6.x86_64.rpm # See above

*gitlab-ee-8.5.0-ee.1.el7.x86_64.rpm # Enterprise Linux 7.0 (CentOS, RedHat, Amazon Linux)

*gitlab-ee-8.5.0-ee.0.el7.x86_64.rpm # See above

What is the difference between 0.el6 and 1.el6?
I'm running CentOS release 6.7 (Final) with a kernel release Linux 2.6.32-573.7.1.el6.x86_64. Should I choose gitlab-ee-8.5.0-ee.1.el6.x86_64.rpm?

A: To understand RPM versioning it's helpful to look at how yum treats things. When I install the GitLab package repository and run yum info gitlab-ee --showduplicates I get the following output (shortened):
    Name        : gitlab-ee
    Arch        : x86_64
    Version     : 8.5.0
    Release     : ee.0.el7
    Size        : 282 M
    Repo        : gitlab_gitlab-ee/x86_64
    Summary     : GitLab Enterprise Edition and GitLab CI (including NGINX, Postgres, Redis)
    URL         : https://about.gitlab.com/
    License     : unknown
    Description : GitLab Enterprise Edition and GitLab CI (including NGINX, Postgres, Redis)

    Name        : gitlab-ee
    Arch        : x86_64
    Version     : 8.5.0
    Release     : ee.1.el7
    Size        : 282 M
    Repo        : gitlab_gitlab-ee/x86_64
    Summary     : GitLab Enterprise Edition and GitLab CI (including NGINX, Postgres, Redis)
    URL         : https://about.gitlab.com/
    License     : unknown
    Description : GitLab Enterprise Edition and GitLab CI (including NGINX, Postgres, Redis)

Notice the Release value for each. yum outputs the newest package at the bottom and you can see the bottom Release value is ee.1.el7. yum uses the combination of version and release to determine the newest package to install. In this case we (GitLab) had some issue in the ee.0.el7 package but not in the GitLab code itself so we repackaged it as ee.1.el7. The actual GitLab version is the same (8.5.0).
I hope this helps explain RPM versioning. I highly recommend adding the YUM repos


text:
Q: Может ли openbox (1 кнопка) действовать на 2 элемента верстки? Допустим у меня есть кнопка, по нажатию на которую появляется блок, при повторном нажатии он исчезает.
Но мне хотелось бы, чтобы появляющийся блок замещал другой, т.е. скрывал его (display: none). Как прописать такое в js?

function openbox(id = "bgdesc") {
    display1 = document.getElementById(id = "bgdesc").style.display;
    display2 = document.getElementById(id = "article-cont").style.display;

    if (display1 == 'none' || display2 == 'grid') {
        document.getElementById(id = "bgdesc").style.display = 'grid';
    }
    if (display1 == 'grid' || display2 == 'none') {
        document.getElementById(id = "article-cont").style.display = 'none';
    } else {
        document.getElementById(id = "article-cont").style.display = 'grid';
        document.getElementById(id = "bgdesc").style.display = 'none';
    }
}
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Пример</title>

         Кнопка

Не растрескивается, не деформируется под воздействием окружающей среды, влаги, солей, щелочей, кислот;

Не подвержена гниению, не поддается поражениям грибков и насекомых;

Обладает высокой механической прочностью, выдерживает установку тяжелых предметов;

Достаточно проста в монтаже: доски можно пилить, строгать, закручивать в них саморезы;

Обладает устойчивым внешним видом: не меняет форму, цвет, эксплуатационные характеристики;

Полностью экологична: не выделяет никаких вредных соединений, не имеет неприятного запаха;

Дарит комфорт и безопасность в эксплуатации (препятствует скольжению, не дает заноз, не царапает);

Пожаробезопасна: не поддерживает горение;

CopyPaste Li Europan Lingues [Plain Text] If you'd rather use a copy of li Europan lingues that doesn't include HTML markup such as for use in a Word document, WYSIWYG editor, or WordPress's visual editor, you can use this version. Li Europan lingues Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc, litot Europa usa li sam vocabular. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilite de un nov lingua franca: On refusa continuar payar custosi traductores. At solmen va esser necessi far uniform grammatica, pronunciation e plu commun paroles.

A:

const block1 = document.querySelector('#block1');
const block2 = document.querySelector('#block2');

const button = document.querySelector('button');

button.addEventListener('click', onClickHandler);

function onClickHandler() {
  block1.classList.toggle('hidden');
  block2.classList.toggle('hidden');
}
div {
  width: 100px;
  height: 100px;
  border: 1px solid black;
}

button {
  display: block;
}

.hidden {
  display: none;
}

block 1

block 2

<button>press</button>


text:
Q: "diffeomorphically inequivalent" functions? Define $f: \mathbb{R}^2 \rightarrow \mathbb{R}^2$ that maps $(x,y)$ to $(\arctan{x}, \arctan{y})$. It maps the $\mathbb{R}^2$ plane to the interior of a square.
Define $g: \mathbb{R}^2 \rightarrow \mathbb{R}^2$ that maps $(x,y)$ to $\displaystyle \left(\frac{x}{\sqrt{x^2+y^2+1}}, \frac{y}{\sqrt{x^2+y^2+1}} \right)$. It maps the $\mathbb{R}^2$ plane to an open (unit) disk.
I realize that $f$ and $g$ are different in the following sense:

*

*Add the boundaries to their images to make them a square with the boundary and a closed disk. (It's like compactification or "closure".)

*The square with the boundary is a manifold with corners, and the closed disk is a manifold with boundary, and they are not diffeomorphic to each other.

I suspect the difference between $f$ and $g$ as I noted above is a manifestation of something more fundamental. Hence my somewhat vague-wording question: How should I understand this difference between the two functions? What makes them have different "boundary structures"?
[I'd like to add some words on the background of what I am working on in case it helps people understand where I come from.
As a consequence of the different "boundary structures" between the square and the closed disk, $f$ has four "limiting functions" corresponding to the four sides of the square. For example, the upper side of the square corresponds $\lim_{y \rightarrow \infty} f = \tilde{f}$, where $\tilde{f}(x) = \left(\arctan{x}, \frac{\pi}{2}\right)$. In contrast, $g$ has only one "limiting function", the one corresponding to the circle.
Why am I interested in this kind of "limiting functions"? Because I am studying how to approximate certain functions. If we add a scaling factor $N$ to the definition of $f$ and have it now send $(x,y)$ to $(\arctan{x}, \frac{1}{N}\arctan{y})$, where $N \gg 1$, the square will now be squeezed along the y direction and become a thin rectangle. Then I can approximate $f$ with, say, $\tilde{f}$ as defined above, which, in a certain sense, is simpler but has little loss of fidelity. For $g$, similarly I can have it map $(x,y)$ to $\left(\frac{x}{\sqrt{x^2+y^2+1}}, \frac{1}{N}\frac{y}{\sqrt{x^2+y^2+1}} \right)$ and have the disk squeezed to an ellipse shape, but in this case I have only one "limiting" or approximating function.]
Any input (perspectives, references, correcting my terminologies or notations, etc.) on this will be received gratefully.


text:
Q: Pulling data from Firebase Realtime Database I am trying to pull data from my Realtime database in the form of a list that i can style into a leader board but am having issues with connecting it. The errors showing up are that document.getElementById is not a function and that window.onload(FetchAllData()); is not a function
This is the layout of my database:
how my database looks
This is my javascript=

function addItemsToList(name, score){
  var ul=document.getElementsById('highScoresList');
  var header= document.createElement('h2');

  var header= document.createElement('li'); //the number of highscores shown
  var header= document.createElement('li');
  var header= document.createElement('li');
  var header= document.createElement('li');
  var header= document.createElement('li');
  var header= document.createElement('li');
  var header= document.createElement('li');
  var header= document.createElement('li');
  var header= document.createElement('li');
  var header= document.createElement('li');

  header.innerHTML= 'Highscores-'+ (++scores)

  _name.innerHTML='Name: '+name;
  _score.innerHTML='Score: '+score;

  ul.appendChild(header);
  ul.appendChild(_name);
  ul.appendChild(_score);
}

//calls for the data from database
function FetchAllData(){
  firebase.database().ref('scores').once('value', function(snapshot){//a snapshot is a picture of the data at a particular database reference at a single point in time
    snapshot.forEach(
      function(ChildSnapshot){
        let name= ChildSnapshot.val().name;
        let score= ChildSnapshot.val().score;
        addItemsToList(name,score);
      }
    )
  })
}

window.onload(FetchAllData());

High Scores

        Go Home

I want to be able to pull the username and score into a table that orders them in terms of their score going from highest to lowest.
I also want to know if it is possible to create multiple arrays of data for different sections. Currently this is only showing the user score for a maths quiz but i want to keep the scores and user name for two different quizzes in the same place, is it possible for me to do this or do i need to have them in different databases?

A: You have syntax errors in your js code. That's why the above mentioned errors had occurred.
The first line of function addItemsToList should be changed like this.
var ul=document.getElementById('highScoresList');

It is not getElementsById. It is getElementById. s should be removed from the funtion.
And you cannot call functions on window.onload like this. (Refer this link) Use the following instead.
window.onload = () => FetchAllData();

or
window.onload = () => {
    console.log('Onload function called');
    FetchAllData();
}


text:
Q: Flexbox with a scrollable panel I am trying to achieve a layout that stretches to fill the screen, but then scrolls when the content is larger than the available pane.
I have a basic flexbox approach based on this answer, and it does a good job filling up the screen, but overflowing content causes the whole screen to scroll rather than just its own container.
If I change .outer height to a literal value like 200px then I get the scrolling behavior that I want, but the bottom content pane no longer fills up the screen.
I have tried using display: table and related CSS rather than flexbox, but ended up with the same result.
I have also considered using calc on the height of the content pane - something like
height: calc(100% - 60px);

but I want the header to be able to grow with its content, so I don't have a hard value for its height for the calculation.
I am looking for a pure CSS solution here rather than window sizing with Javascript of some flavor.

html,
body {
  height: 100%;
  margin: 0
}
.box {
  display: flex;
  flex-flow: column;
  height: 100%;
}
.box .row {
  border: 1px dotted grey;
  flex: 1 1 auto;
}
.box .row.header {
  background: aliceblue;
}
.box .row.content {
  background: pink;
}
.box .row.content .title {
  height: 40px;
  background: yellow;
}
.outer {
  height: -webkit-calc(100% - 40px);
  height: -moz-calc(100% - 40px);
  height: -o-calc(100% - 40px);
  height: calc(100% - 40px);
  overflow-y: auto;
}
.inner {
  height: 100%;
}
.text {
  height: 100px;
  margin-top: 10px;
  border: 1px solid gold;
}

header

(sized to content)

      content
      (fills remaining space)

Bacon ipsum dolor amet tongue corned beef landjaeger sausage beef meatball, kielbasa pastrami turkey boudin hamburger ham hock chuck tail pork. Shankle tail cupim ribeye.

Bacon ipsum dolor amet tongue corned beef landjaeger sausage beef meatball, kielbasa pastrami turkey boudin hamburger ham hock chuck tail pork. Shankle tail cupim ribeye.

Bacon ipsum dolor amet tongue corned beef landjaeger sausage beef meatball, kielbasa pastrami turkey boudin hamburger ham hock chuck tail pork. Shankle tail cupim ribeye.

Bacon ipsum dolor amet tongue corned beef landjaeger sausage beef meatball, kielbasa pastrami turkey boudin hamburger ham hock chuck tail pork. Shankle tail cupim ribeye.

Bacon ipsum dolor amet tongue corned beef landjaeger sausage beef meatball, kielbasa pastrami turkey boudin hamburger ham hock chuck tail pork. Shankle tail cupim ribeye.

Bacon ipsum dolor amet tongue corned beef landjaeger sausage beef meatball, kielbasa pastrami turkey boudin hamburger ham hock chuck tail pork. Shankle tail cupim ribeye.

Bacon ipsum dolor amet tongue corned beef landjaeger sausage beef meatball, kielbasa pastrami turkey boudin hamburger ham hock chuck tail pork. Shankle tail cupim ribeye.

A: Hope this is the behaviour you expected.

html,
body {
  height: 100%;
  widht: 100%;
}

body {
  margin: 0;
  padding: 0;
}

.box {
  display: flex;
  flex-flow: column;
  flex-wrap: nowrap;
  height: 100%;
}
.box .row {
  border: 1px dotted grey;
  flex: 0 0 auto;
  overflow: auto;
}
.box .row.header {
  background: aliceblue;
}
.box .row.content {
  flex: 1 1 auto;
  display: flex;
  flex-flow: column;
  flex-wrap: nowrap;
  background: pink;
}
.box .row.content .title {
  height: 40px;
  background: yellow;
  flex: 0 0 auto;
}
.text {
  height: 100px;
  margin-top: 10px;
  border: 1px solid gold;
}
.outer {
  height: 100%;
  flex: 1 1 auto;
  overflow-y: auto;
}
.inner {
  height: 100%;
}

header

(sized to content)

      content
      (fills remaining space)

Bacon ipsum dolor amet tongue corned beef landjaeger sausage beef meatball, kielbasa pastrami turkey boudin hamburger ham hock chuck tail pork. Shankle tail cupim ribeye.

Bacon ipsum dolor amet tongue corned beef landjaeger sausage beef meatball, kielbasa pastrami turkey boudin hamburger ham hock chuck tail pork. Shankle tail cupim ribeye.

Bacon ipsum dolor amet tongue corned beef landjaeger sausage beef meatball, kielbasa pastrami turkey boudin hamburger ham hock chuck tail pork. Shankle tail cupim ribeye.

Bacon ipsum dolor amet tongue corned beef landjaeger sausage beef meatball, kielbasa pastrami turkey boudin hamburger ham hock chuck tail pork. Shankle tail cupim ribeye.

Bacon ipsum dolor amet tongue corned beef landjaeger sausage beef meatball, kielbasa pastrami turkey boudin hamburger ham hock chuck tail pork. Shankle tail cupim ribeye.

Bacon ipsum dolor amet tongue corned beef landjaeger sausage beef meatball, kielbasa pastrami turkey boudin hamburger ham hock chuck tail pork. Shankle tail cupim ribeye.

Bacon ipsum dolor amet tongue corned beef landjaeger sausage beef meatball, kielbasa pastrami turkey boudin hamburger ham hock chuck tail pork. Shankle tail cupim ribeye.

A: The key to this layout is recognizing a flex item's minimum size:

4.5. Implied Minimum Size of Flex
  Items
To provide a more reasonable default minimum size for flex items, this
  specification introduces a new auto value as the initial value of
  the min-width and min-height properties defined in CSS 2.1.

In other words, a flex item will, by default, never be smaller than the size of its content.
Initial settings on a flex item:
min-width: auto;
min-height: auto;

This has the potential to force items to overflow their container.
The solution is to apply min-width: 0 for horizontal scroll, and min-height: 0 for vertical scroll, on the flex container.
Below is a simplified demonstration using your code (the JS is only to repeat the .text elements):

function multiplyNode(node, count, deep) {
    for (var i = 0, copy; i < count - 1; i++) {
        copy = node.cloneNode(deep);
        node.parentNode.insertBefore(copy, node);
    }
}

multiplyNode(document.querySelector('.text'), 10, true);
* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  border: 1px solid black;
}

.box {
  display: flex;
  flex-flow: column;
  height: 100%;
}

.header {
    background-color: aqua;
    flex: 0 0 auto;
}

.content {
    background-color: yellow;
    flex: 1;
    display: flex;              /* new */
    flex-direction: column;     /* new */
    min-height: 0;              /* new; allow flex item to be smaller than its content,
                                   enabling scroll */
}

.outer {
    background-color: pink;
    flex: 1;
    overflow-y: auto;
}

.text {
  height: 100px;
  margin-top: 10px;
  border: 1px solid gold;
}

header (sized to content, i.e., height: auto;)

content (fills remaining space, i.e. flex: 1;)

Bacon ipsum dolor amet tongue corned beef landjaeger sausage beef meatball, kielbasa pastrami turkey boudin hamburger ham hock chuck tail pork. Shankle tail cupim ribeye.

Tested on Chrome, FF and IE11.
More information:

*

*Why doesn't flex item shrink past content size?

*Rendering problems using flexbox in Firefox and Chrome 48


text:
Q: Applications of the martingale convergence theorem I am trying to solve the following question and the hint makes no sense to me as to why its even necessary to begin with:

We have that $\sup_n E(M_n^+) = \sup_n E(M_n) \leq E(\sup_n M_n) < \infty$ so that we may apply the martingale convergence theorem to state there exists a limit $M_\infty$ which is in $L^1$.  Now it is obvious that $M_n \leq \sup_n M_n \in L^1$ by assumption, so that dominated convergence yields the result.  Is this wrong?  Am I missing something huge?
Even if the question is much easier than the hint makes it out to be, I want to know the motivation and how to actually use it.  I can follow steps (a) - (d) easily enough, but I cannot conclude using the result in (d).  What were the people who made the question looking at trying to do?  How do you conclude using (d)?

A: I agree with your proof; $\mathbb{E} \sup M_n < \infty$ is such a strong condition that it is enough to by itself ensure uniform integrability.
As for what they were aiming, they were most likely trying to see if you know about test functions to test for uniform integrability. Essentially, if you have a non-negative function $\phi$ that is super-linear and is s.t. $\sup_{X \in \mathcal{X}} E[\phi(X)] = M < \infty$, then your class $\mathcal{X}$ is uniformly integrable. The proof is not bad; since $\phi$ is super linear, for any $n$, there exists a $C_n$ s.t. $\phi(x) > n x$ for $x > C_n$ . Then, we have
$$M \geq E[\phi(|X|)] \geq E[\phi(|X|) 1_{x > C_n}] > n E[|X| 1_{x > C_n}]$$,
which reduces to $$E[|X| 1_{x > C_n}] < \frac{M}{n}$$ for all $X \in \mathcal{X}$
which shows that the class is uniformly integrable.
They essentially wanted you to say that the function $x \rightarrow x \log^+ x$ was such a function, so $X_n$s are uniformly integrable, so convergence in $L_1$ holds.  (You can read further in these notes: https://web.ma.utexas.edu/users/gordanz/notes/uniform_integrability.pdf; I copied for you a part of proposition 12.6)


text:
Q: Left Join in Subsonic 3 I'm trying to do a left join in subsonic 3 using linq but it doesn't seem to work, I get a big error.
        var post = from p in Post.All()
                    join q in Quote.All() on p.ID equals q.PostID into pq
                    where p.ID == id.Value
                    from qt in pq.DefaultIfEmpty()
                    select new {p, qt};

I'm using subsonic 3, latest GIT version from Rob, but I'm getting an error, see below, when I try a left join.
I have searched but I didn't found any solution.
Can anyone explain to me why the error and how to fix it?
Thanks
Expression of type 'System.Collections.Generic.IEnumerable1[GetAQuote.Post]' cannot be used for parameter of type 'System.Linq.IQueryable1[GetAQuote.Post]' of method 'System.Linq.IQueryable1[<>f__AnonymousType221[GetAQuote.Post], System.Collections.Generic.IEnumerable1%5BGetAQuote.Quote%5D, System.Linq.Expressions.Expression1[System.Func2%5BGetAQuote.Post,System.Int32%5D%5D, System.Linq.Expressions.Expression1[System.Func2%5BGetAQuote.Quote,System.Int32%5D%5D, System.Linq.Expressions.Expression1[System.Func3%5BGetAQuote.Post,System.Collections.Generic.IEnumerable1[GetAQuote.Quote],<>f__AnonymousType22%5BGetAQuote.Post,System.Collections.Generic.IEnumerable1%5BGetAQuote.Quote%5D%5D%5D%5D">GetAQuote.Post,System.Collections.Generic.IEnumerable1[GetAQuote.Quote]]] GroupJoin[Post,Quote,Int32,<>f__AnonymousType22'`

A: to solve Left Join in Subsonic3 you just need to set .AsEnumerable() method on your linq query.
Try this
categories.AsEnumerable() or products.AsEnumerable()


text:
Q: Trying to submit stringified text to server as property of an object I have the following instructions:

*

*To submit a new chat message, you'll need to send a POST request to a RESTful resource endpoint on the Parse API. The url for that resource is https://api.parse.com/1/classes/chats.

*The endpoint is expecting to get an object from you that contains a property named "text" (and no other properties).

*NOTE: The Parse API expects the message data object you send to be encoded as JSON, so you'll want to stringify it that way before POSTing it.

I've created the following function but it doesn't seem to be working. When I fetch the text I submit, it just reads as "undefined". Any tips? Thanks so much!
var input1 = document.getElementById('input1'), sendbutton = document.getElementById('sendbutton');

function chatSend(){

    $.ajax({
           type: "POST",
           url: "https://api.parse.com/1/classes/chats",
           data: JSON.stringify({text: $('input1.draft').val()}),

           success:function(message){

           }
      })
    }

my html is setup as follows
<input class="draft" name="input1" id="input1" type="text" value=''/>


text:
Q: php undefined index error I have a stored procedure with three parameters @startdate, @enddate and @field1 and when I try to execute the following php code, I get error
undefined index: startdate
undefined index: enddate
undefined index: field1
<?php
$myServer = "instance_name"; // host/instance_name
$myUser = "username"; // username
$myPass = "password"; // paasword
$myDB = "databasename"; // database name
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
$selected = mssql_select_db($myDB, $dbhandle)
or die("Couldn't open database $myDB");

<?php
$startdate = isset($_REQUEST['startdate']) ? $_REQUEST['startdate'] : null;
$enddate = isset($_REQUEST['enddate']) ? $_REQUEST['enddate'] : null;
$field1 = isset($_REQUEST['field1']) ? $_REQUEST['field1'] : null;
?>

<form action = "thisfile.php" method = "post">
Please input startdate <input type = "text" name = "startdate" />

Please input enddate <input type = "text" name = "enddate" />

Please input field1 name <input type = "text" name = "field1" />

Please submit <input type = "submit" name = "submit" value = "submit" />

</form>

 <?php
    if (isset($startdate) && isset($enddate) ){
$query = "storedprocedure '$startdate','$enddate','field1'";
    $result = mssql_query($query);
while ($rows = mssql_fetch_array($result) ) {
echo "
".$rows[0]." ".$rows[1]."
   ".$rows[2]." ".$rows[3]."
    ".$rows[4]." ".$rows[5]." ";
}
}

I was just looking for three text boxes on the top and when I enter startdate, enddate and field1 names in the text boxes, it should display the output in the same page.
Edit:
My stored procedure is something similar to below :
Create procedure storedprocedure
@startdate datetime,
@enddate datetime,
@field1  varchar(50)
select date, sum(qty), sum(qty), sum(qty2), sum(qty3), sum(qty4) from table1
where date between @startdate and @enddate and field1 like @field1 + '%'
group by date

A: why don't you do try this
if (isset($startdate) && isset($enddate) ){
$query = "storedprocedure '$startdate','$enddate','field1'";
    $result = mssql_query($query);
while ($rows = mssql_fetch_array($result) ) {
echo "
".$rows[0]." ".$rows[1]."
   ".$rows[2]." ".$rows[3]."
    ".$rows[4]." ".$rows[5]." ";
}
}

This should stop  the notice

A: You can rewrite part of your code in such way:
<?php
    $startdate = isset($_REQUEST['startdate']) ? $_REQUEST['startdate'] : null;
    $enddate = isset($_REQUEST['enddate']) ? $_REQUEST['enddate'] : null;
    $field1 = isset($_REQUEST['field1']) ? $_REQUEST['field1'] : null;
?>

But actually you need to check whether all your request parameters (especially enddate and field1) are present.
See also http://php.net/manual/en/language.types.array.php


text:
Q: using html inside an input tag I am trying to input a break tag at the end of each line of code so that it doesn't just read all in one line inside the input box.
I have encoded the break tag as i thought that's how you can use html inside of an input box but for some reason it is just showing exactly what i have typed.
Any help to correct this would be much appreciated.
This is what i have so far. I have only encoded one of the break tags for demonstration purposes, just to show you what i have done.

      <form action="MAILTO:bg54wl@student.sunderland.ac.uk" method="post" enctype="text/plain" id="fback">
        Full Name:
        <input type="text" name="fname" id="fname" data-clear-btn="true" placeholder="Your Full name..." required>
        Email:
        <input type="text" name="email" id="email" data-clear-btn="true" placeholder="Your Email Address..." required email>
        Comments (Optional):
        <input type="text" name="comments" id="comments" data-clear-btn="true">

        Device Information:
        <input style="height:50px;" readonly name="deviceinfo" id="deviceinformation"/>

        <input type="submit" value="Send">
      </form>

A: Input tags completely ignore newlines.
You can use a textarea instead. Textareas preserve whitespace.
<textarea name="theName">
You can have
Multiple lines
In textareas
</textarea>


text:
Q: Will iOS backup include a paired Bluetooth keyboard? I have an iPad with a broken digitizer. This, of course, renders the iPad useless. Although I would still be able to use it for typing, etc, if only my Bluetooth keyboard was paired to it. But how to achieve that when the touch screen can't recieve input?
So I got an idea.
Can I pair the keyboard with another iOS device, backup that iOS device to my Mac, and then restore that backup to the iPad? Will that include the paired keyboard?
I am (barely) able to unlock the screen of the iPad, so I will be able to sync and restore it from the Mac.

A: Bluetooth pairing matches two hardware devices, so that pairing records are irrelevant if re-loaded on a different bluetooth adapter (on the new iOS device). Good thinking to get around a hardware repair - if you could somehow turn on assistive touch and try backing that up, you might be able to navigate - but I'm guessing that still needs some amount of digitizer functionality to restore the backup in the first place.

*

*https://support.apple.com/en-us/HT202658

A: I wouldn't expect network settings to be saved and transferred through backup, especially to two different machines, but I could be wrong.


text:
Q: GCM get Token for sending notification from server I'm using one signal to send notification but I need to send notification for specific users from server.
I searched for a while but every solution i found was deprecated.

A: On April 10, 2018, Google has shut down GCM (Google Cloud Messaging) support. So I strongly recommend that you should migrate your code to FCM (Firebase Cloud Messaging).
Check out this to migrate GCM to FCM.


text:
Q: New to curl & terminal... getting : zsh: parse error near `}' Help is appreciated!
error: zsh: parse error near `}'
curl -i -X POST "http://127.0.0.1:8080/api/user/login" -H "Accept: application/json" -H "Content-Type: application/json" —data-binary @- <<EOF {"email": "mail.xxx.com", "password": "XXX"} EOF

A: Two issues: The shell won't acknowledge curly "smart quotes" as syntax; and a heredoc needs to have a newline before its content starts, and after it ends. Compare to:
curl -i -X POST "http://127.0.0.1:8080/api/user/login" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  —data-binary @- <<EOF
{"email": "mail.xxx.com", "password": "XXX"}
EOF

Community Wiki since this question probably should be closed as caused by a typo, or could be closed as duplicative of two preexisting questions -- one on the quoting issue, another on one-liner heredocs.


text:
Q: Pyspark Streaming - Windows behavior vs Linux missing rows So I am reading a directory full of csv files that are ordered by dates using Pyspark readStream() with maxFilesPerTrigger=1. On Windows it starts from the earliest 2010-12-01.csv file and  processes it sequentially moving forward. I append the rows to the console and specify a watermark. 2010-12-01.csv => 2010-12-02.csv => 2010-12-03.csv ...
(Windows)
streaming = spark.readStream.format("csv").schema(staticSchema)\
      .option("maxFilesPerTrigger", 1)\
      .load("D:\\data\\*.csv")

(Linux)
streaming = spark.readStream.format("csv").schema(staticSchema)\
  .option("maxFilesPerTrigger", 1)\
  .load("file:///opt/data/*.csv")

(Same on both)
stream = streaming.selectExpr("car", "cost", "timestamp")\
        .withWatermark("timestamp", "30 seconds")\
        .groupBy(F.col("car"), F.window("timestamp", "1 hour").alias("tmst_window"))\
        .agg(F.sum("cost").alias("agg_cost"))

stream.writeStream.format("console")\
  .queryName("customer_purchases")\
  .option('truncate', False)\
  .outputMode("append").start()

Now when I run the same exact code on Linux, it reads randomly from the set of csv files, not starting at the very beginning like Windows. A problem I've encountered on Linux, is that it reads the very LAST file  (2011-12-10.csv, +1 year diff) within the first couple of minutes and just stops processing the rest of the files. It thinks its done, maybe because the rest of the files are "behind" the filedate it processed with the watermark and stops. On Windows, I get thousands of rows, on Linux I only get 41 rows. Behavior stays the same on successive runs on Windows and Linux. Anyone know why this behavior exists?
Both are standalone instances:
Linux: PySpark version 2.4.0.16 (datastax docker image)
Windows: spark-3.1.1-bin-hadoop3.2

A: Just wanted to close this out in case anyone encounters this same problem. I recreated the datasets on Databricks cloud and used another docker image that purely had Pyspark installed only. Both of the above gave me the same results as my Windows Pyspark behavior. So 3 of the four work correctly. With that said, I would stay away from Datastax DSE docker image, as it won't work correctly. It may be a problem with the Datastax image using it's own proprietary file system.


text:
Q: jsTree 3 - How do I pre-check an item without selecting it I'm using jsTree 3 and trying to pre-check some lines based on a criteria.
Here's how I configure the tree:-
    $(function () {
        $("#ProductInterests").jstree
            ({
                "core" : { "themes" : { "icons" : false }},
                "plugins": ["themes", "html_data", "checkbox"]
            });

    });

I've then found three suggested solutions elsewhere on the net (the first half of the if should result in checked nodes and the second should result in unchecked ones):-

    @foreach (var productGroup in ViewBag.ProductGroups)
    {

@productGroup.Name

                @foreach (var product in productGroup.Products)
                {
                    if (Model.LeadProductInterests.Any(lpi => lpi.ProductID == product.ID))
                    {

@product.Name

@product.Name

@product.Name

                }
                    else
                    {

@product.Name

@product.Name

@product.Name

                    }
                }

    }

Of the three approaches, the first results in the node being both selected and checked.  The second and third result in nodes that are neither selected nor checked.  I would like to get a node that is checked but not selected.

A: Get the latest code from the repo - this is a known bug which is now fixed. Also keep in mind that in order to have separate checked and selected collections you need to set checkbox.tie_selection to false (as seen in the fiddle below).
Once you get the latest copy (not 3.1.1, but the actual repo code: https://github.com/vakata/jstree/archive/master.zip) you can use this:

@product.Name

Here is the demo: http://jsfiddle.net/DGAF4/516/


text:
Q: Usage of URL_HASH in FetchContent_Declare I am a newbie in CMake and trying to understand the following CMake command
FetchContent_Declare(curl
URL                    https://github.com/curl/curl/releases/download/curl-7_75_0/curl-7.75.0.tar.xz
URL_HASH               SHA256=fe0c49d8468249000bda75bcfdf9e30ff7e9a86d35f1a21f428d79c389d55675
USES_TERMINAL_DOWNLOAD TRUE)

When I open a browser and put in https://github.com/curl/curl/releases/download/curl-7_75_0/curl-7.75.0.tar.xz, the file curl-7.75.0.tar.xz will start downloading without the need for the URL_HASH. I am sure it is not redundant. I wanted to know what the purpose of the URL_HASH is?
Also how can SHA256 be found? Because when I visit https://github.com/curl/curl/releases/download/curl-7_75_0 to find out more, the link is broken.

A:
I am sure it is not redundant. I wanted to know what the purpose of the URL_HASH is?

Secure hash functions like SHA256 are designed to be one-way; it is (in practice) impossible to craft a malicious version of a file with the same SHA256 hash as the original. It is even impossible to find two arbitrary files that have the same hash. Such a pair is called a "collision" and finding even one would constitute a major breakthrough in cryptanalysis.
The purpose of this hash in a CMakeLists.txt, then, is as an integrity check. If a bad actor has intercepted your connection somehow, then checking the hash of the file you actually downloaded against this hard-coded expected hash will detect whether or not the file changed in transit. This will even catch less nefarious data corruptions, like those caused by a faulty hard drive.
Including such a hash (a "checksum") is absolutely necessary when downloading code or other binary artifacts.

Also how can SHA256 be found?

Often, these will be published alongside the binaries. Use a published value if available.
If you have to compute it yourself, you have a few options. On the Linux command line, you can use the sha256sum command. As a hack, you can write a deliberately wrong SHA256=0 value or something and fish the observed value from the error message.
Note that if you compute the hash yourself, you should either (a) download the file from an absolutely trusted connection and device or (b) download it from multiple independent devices (free CI systems like GitHub Actions are useful for this) and ensure the hash is the same across all of them.


text:
Q: FBRequestConnection.startWithGraphPath crashes swift I'm using the Facebook SDK to get users profile data in swift, but calling FBRequestConnection.startWithGraphPath:completionHandler: is crashing swift.
I'll leave what I think is the relevant part of the log
1.  While type-checking 'profile' at /Users/fratelli/Documents/Projects/Wink/Wink/OAuthFacebookSession.swift:118:14
2.  While type-checking expression at [/Users/fratelli/Documents/Projects/Wink/Wink/OAuthFacebookSession.swift:139:9 - line:142:9] RangeText="FBRequestConnection.startWithGraphPath(
            self.readPermissions(),
            completionHandler: completionHandler
        )"
<unknown>:0: error: unable to execute command: Segmentation fault: 11
<unknown>:0: error: swift frontend command failed due to signal (use -v to see invocation)
Command /Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code 254

I already filled a bug report. Now, besides using Objective-c, I don't see any other way around this. What I would like to know is if there's any other FB SDK method that I could try that achieves the same effect.
Here's the code:
    var completionHandler = {
        connection, result, error in
    } as FBSessionStateHandler;

    // Request the profile info
    FBRequestConnection.startWithGraphPath(
        "me?fields=birthday,gender,first_name,last_name,name_format,picture",
        completionHandler: completionHandler
    );

A: Try this:
var completionHandler = {
    connection, result, error in
} as FBRequestHandler;

// Request the profile info
FBRequestConnection.startWithGraphPath(
    "me?fields=birthday,gender,first_name,last_name,name_format,picture",
    completionHandler: completionHandler
);

FBRequestConnection.startWithGraphPath is expecting FBRequestHandler, not FBSessionStateHandler

A: In the end, I had to use Objective-c. So I created a OAuthFacebookWrapper.h file
#import <Foundation/Foundation.h>
#import <FacebookSDK/FacebookSDK.h>

@interface OAuthFacebookWrapper : NSObject

+ (void) startWithGraphPath:(NSString *)graphPath completionHandler:(FBRequestHandler)handler;

@end

Then OAuthFacebookWrapper.m
#import "OAuthFacebookWrapper.h"

@implementation OAuthFacebookWrapper

+ (void) startWithGraphPath:(NSString *)graphPath completionHandler:(FBRequestHandler)handler
{
    [FBRequestConnection startWithGraphPath: graphPath completionHandler: handler];
}

@end

Calling that method with the same arguments as before works.


text:
Q: Python - Selenium scrape table from the website I want to scrape the table "Ownership Reports" from https://www.sec.gov/cgi-bin/own-disp?action=getissuer&CIK=0000320193
How would I scrape this table information? I'm using Selenium.
I tried the following code my_output = driver.find_elements_by_xpath('/html/body/div/table[1]/tbody/tr[2]/td/table/tbody/tr[3]/td/table')[0].text.split('\n')[1:]using XPath but the output looks horrible.
I expect to put this data in a Pandas DataFrame. Can anyone share some thoughts? Thank you so much.

for tr in driver.find_elements_by_xpath('/html/body/div/table[1]/tbody/tr[2]/td/table/tbody/tr[3]/td/table'):
tds = tr.find_elements_by_tag_name('td')
output_lst = [td.text for td in tds]

I found a solution above - although it's not that elegant but can do the work. I look forward to seeing a better solution!

A: output_lst = []

for tr in driver.find_elements_by_xpath('/html/body/div/table[1]/tbody/tr[2]/td/table/tbody/tr[3]/td/table'):
tds = tr.find_elements_by_tag_name('td')
output_lst = [td.text for td in tds]

The coding above works