text:
Q: Looping a copy to new workbook function across multiple tabs based on tab names in cell values I want to copy data from each tab in a spreadsheet and save it as new workbooks. The original workbook has many tabs (approx 50) and one of these tabs set up for the macro to run data from, as there may be new tabs added in the future. The macro data tab contains the file location for each new workbook, the name of the tab and also some information used by another macro to e-mail these newly created workbooks to relevant parties.
The issue is getting the macro to recognize the tab names for finding the range to copy, as the tab names are listed in a cell. I am unsure if it is possible to use this list, or whether I add a sheet at the end to loop through all the sheets from a specified start location until that one with an if.
Sub Datacopy()

    Dim ws As Worksheet

    With Application
        .ScreenUpdating = False
    End With

    Application.DisplayAlerts = False

    Set ws = Sheets("email")

    For Each Cell In ws.Columns("B").Cells

        Dim file1 As String

        file1 = Cell.Offset(0, 3).Text

            Sheets("cell.value").Range("A1:L500").Copy
            Workbooks.Add.Worksheets("Sheet1").Range("A1").PasteSpecial (xlPasteAllUsingSourceTheme)
            Worksheets("Sheet1").Range("A1").PasteSpecial (xlPasteComments)
            ActiveWorkbook.SaveAs Filename:=file1
            ActiveWorkbook.Close

    Next Cell

    Application.DisplayAlerts = True

    With Application
        .ScreenUpdating = True
    End With

    MsgBox ("Finished making files!")

End Sub

A: Something like this should work for you. Note the following:

*

*Code assumes that on sheet "email" it has a header row which is row 1 and the actual data starts on row 2.

*It checks to see if the B column cell is a valid worksheet name in the workbook

I have verified that this code works properly and as intended based on your original post:
Sub Datacopy()

    Dim wb As Workbook
    Dim wsData As Worksheet
    Dim wsTemp As Worksheet
    Dim rSheetNames As Range
    Dim rSheet As Range

    Set wb = ActiveWorkbook
    Set wsData = wb.Sheets("email")

    Set rSheetNames = wsData.Range("B2", wsData.Cells(Rows.Count, "B").End(xlUp))
    If rSheetNames.Row < 2 Then Exit Sub    'No data

    With Application
        .ScreenUpdating = False
        .DisplayAlerts = False
    End With

    For Each rSheet In rSheetNames
        If Not Evaluate("ISERROR('" & rSheet.Text & "'!A1)") Then
            Set wsTemp = Sheets.Add
            Sheets(rSheet.Text).Range("A1:L500").Copy
            wsTemp.Range("A1").PasteSpecial xlPasteAllUsingSourceTheme
            wsTemp.Range("A1").PasteSpecial xlPasteComments
            wsTemp.Move
            ActiveWorkbook.SaveAs rSheet.Offset(, 3).Text
            ActiveWorkbook.Close False
        End If
    Next rSheet

    With Application
        .ScreenUpdating = True
        .DisplayAlerts = True
    End With

    MsgBox "Finished making files!"

End Sub


text:
Q: OpenWeatherMap casting arraylist to Map I am using a openweatherMap api for my project.The idea is to get current weather of any place.I used gson to convert json file and everything seems to work correctly.i am trying to get the "description" of the current weather from the json file,but it's stored in arraylist and so i get the error that arraylist can't be cast as map and i am unable to figure out this problem without major changes in the program
This is json file i am trying to parse:
https://samples.openweathermap.org/data/2.5/weather?q=London,uk&appid=b6907d289e10d714a6e88b30761fae22
Everything works fine with main and wind information from json file,but doesn't work with weather because it's arraylist.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.HashMap;
import java.util.Map;

import com.google.gson.*;
import com.google.gson.reflect.*;

public class DailyForecst  {

   public static Map<String,Object> jsonToMap(String str){
    Map<String,Object> map = new Gson().fromJson(str,new
 TypeToken<HashMap<String,Object>> () {}.getType());
    return map;
    }

   public static void  main(String[] args) {

      String API_KEY = "16 digit Private Key";
      String LOCATION = "fresno,us";
      String urlString = "http://api.openweathermap.org/data/2.5/weather?q=" + LOCATION + "&appid=" + API_KEY + "&units=imperial";

      try{

          StringBuilder result = new StringBuilder();
          URL url = new URL(urlString);
          URLConnection conn = url.openConnection();
          BufferedReader rd = new BufferedReader(new InputStreamReader (conn.getInputStream()));
          String line;
          while ((line = rd.readLine()) != null){
              result.append(line);
          }

          rd.close();
          System.out.println(result);

          Map<String, Object > respMap = jsonToMap (result.toString());
          Map<String, Object > mainMap = jsonToMap (respMap.get("main").toString());
          Map<String, Object > windMap = jsonToMap (respMap.get("wind").toString());

         Map<String, Object> weatherMap = (Map<String, Object>) respMap.get("weather");

         // Map<String, Object > weatherMap = jsonToMap (respMap.get("weather").toString());

          System.out.println("Location: " + LOCATION);
          System.out.println("Current Temperature: " + mainMap.get("temp")  );
          System.out.println("Current Humidity: " + mainMap.get("humidity")  );
          System.out.println("Max: " + mainMap.get("temp_min")  );
          System.out.println("Min: " + mainMap.get("temp_max")  );
          System.out.println("Desc: " + weatherMap.get("description")  );

          System.out.println("Wind Speed: " + windMap.get("speed")  );
          System.out.println("Wind Angle: " + windMap.get("deg")  );

      }catch (IOException e){
          System.out.println(e.getMessage());
      }

}
}

I tried to do the same way as i did for main and wind :             Map weatherMap = jsonToMap (respMap.get("weather").toString()); .But i got errors:
////java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 3 path $[0]
So i tried to not convert json to Map rather directly use map like Map weatherMap = (Map) respMap.get("weather"); but i got
////java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Map

redpajama_set_name: RedPajamaStackExchange


text:
Q: Botão que quando clicado mostra apenas o conteúdo de determinada classe Olá,
Estou criando um sistema em Javascript, onde preciso que um botão mostre apenas os parágrafos com determinada classe em uma div com conteúdo escondido.
Exemplo:
 <button id="btn1">Abre classe1</button>

Teste1

Teste2

Teste3

Gostaria que quando esse botão fosse clicado, a div carregasse apenas o texto  Teste1 e Teste2.
É possível?
Obrigada.

A: Para mostrar esses elementos com a classe que quer pode usar assim: http://jsfiddle.net/caYtr/
$('#btn1').on('click', function(){
    $('#conteudo p.classe1').show();
});

Estou a assumir que tem um CSS assim:
#conteudo p {
    display: none;
}

Porém seria util adicionar mais informação a esse button para criar código mais generalista e não tão localizado, no caso de haver botôes que mostrem outras classes.
Podia por exemplo juntar um campo data-classe onde juntava o nome exato da classe que esse botão devia mostrar.
Assim: http://jsfiddle.net/caYtr/2/
HTML
<button id="btn1" data-classe="classe1">Abre classe1</button>
<button id="btn2" data-classe="classe2">Abre classe2</button>

Teste1

Teste2

Teste3

JavaScript/jQuery
$('button').on('click', function () {
    var classe = $(this).data('classe');
    $('#conteudo p.' + classe).show();
});

E neste caso o javascript não precisa mais de mudar, independentemente de ter mais 20 classes diferentes.

A: Se todo conteúdo fica oculto e é exibido somente no click do botão, você pode fazer
Demo: JSFiddle
Exemplo:
CSS
/*oculta todos os parágrafos dentro da div conteúdo*/
#conteudo p {display:none;}

jQuery
//Ao clicar no botão com id #btn1, exibe os parágrafos com .classe1
$('#btn1').click(function(){
    $('p.classe1').show('slow');
});


text: Q: Finding the dimension of the set of all linear maps mapping $v_1, v_2, v_3$ to zero. Let $V$ and $W$ be finite-dimensional vector spaces. Let $v_1,v_2,v_3 \in V$. What are the possibilities for the dimension of the subspace $$\{T \in \mathrm{Hom}(V,W) : T(v_1) = 0, T(v_2) = 0, T(v_3) = 0 \}?$$


text:
Q: Translation of 0-dimensional objects As far as I can understand we can think of any line on a plane as a product of translation of some other arbitrary line by some arbitrary vector (and vice versa). But while it makes sense when we talk about lines, I cannot imagine the same procedure for dots. Is it even "possible" to translate a dot such that its origin and a translated "copy" would define a line?

A: Any point is a translate of any other point:
$$y = x + (y - x).$$
Taking any two points $x_0\ne y_0$ of a line, the line can be written as the set
$$\{x_0 + t(y_0 - x_0)\,\vert\,t\in\Bbb R\}.$$


text:
Q: Two questions about Fock spaces Let $\mathscr{H}$ be a complex Hilbert space and denote $\mathscr{H}_{n}$ the tensor product $\overbrace{\mathscr{H}\otimes\cdots\otimes\mathscr{H}}^{\text{n}}$. Denote by $\Pi_{\pm}$ the projection operators onto symmetric and anti-symmetric projections on $\mathscr{H}_{n}$:
$$\Pi_{+}(\psi_{1}\otimes \cdots \otimes \psi_{n}) = \frac{1}{n!}\sum_{\pi}\psi_{\pi(1)}\otimes\cdots\otimes \psi_{\pi(n)} \quad \mbox{and} \quad \Pi_{-}(\psi_{1}\otimes\cdots\otimes \psi_{n}) = \frac{1}{n!}\sum_{\pi}\operatorname{sign}(\pi)\psi_{\pi(1)}\otimes\cdots\psi_{\pi(n)}$$
where $\sum_{\pi}$ is a sum over all permutations $\pi$ of $\{1,...,n\}$. These operator can be extended to all $\mathscr{H}_{n}$ and I'll denote their images $\Pi_{\pm}(\mathscr{H}_{n})$ by $\mathscr{H}_{n}^{\pm}$.
Now, if $f \in \mathscr{H}$, let's take the usual creation and annihilation operators $b^{\dagger}(f)$ and $b(f)$, defined by means of the following conditions:
$$b^{\dagger}(f)(\psi_{1}\otimes \cdots \otimes \psi_{n}) = \sqrt{n+1}(f \otimes \psi_{1}\otimes \cdots \otimes \psi_{n})$$
$$b(f)(\psi_{1}\otimes \cdots \otimes \psi_{n}) =\sqrt{n}\langle f,\psi_{1}\rangle (\psi_{2}\otimes \cdots \otimes \psi_{n})$$
Again, these extend to bounded linear operators on $\mathscr{H}_{n}$. Depending on what subspace $\Pi_{\pm}(\mathscr{H}_{n})$ one wants to consider, one can define $a^{\dagger}(f) = \Pi_{\pm}b^{\dagger}(f)$ and $a(f) = \Pi_{\pm}b(f)$. One can prove:
$$a^{\dagger}(f)\Pi_{n}^{\pm}(\psi_{1}\otimes \cdots \otimes \psi_{n}) = \sqrt{n+1}\Pi_{n+1}^{\pm}(f\otimes \psi_{1}\otimes \cdots \otimes \psi_{n}). \tag{1}\label{1}$$
We can extend our analysis to symmetric and anti-symmetric Fock spaces $\mathcal{F}^{\pm}(\mathscr{H}) = \bigoplus_{n=0}^{\infty}(\mathscr{H}_{n}^{\pm})$. In this case, we extend both $a^{\dagger}(f)$ and $a(f)$ to a dense subspace of $\mathcal{F}^{\pm}(\mathscr{H})$, which is the space of finitely many particles $\mathcal{D}_{0} := \{\psi \in \mathcal{F}^{\pm}(\mathscr{H}): \mbox{there exists $N \in \mathbb{N}$ such that $\psi_{n} = 0$ for every $n \ge N$}\}$, by letting each of these operators to act componentwise. By using (\ref{1}), we see that this dense set can be built from sucessive creation of particles, i.e:
$$\Pi^{\pm}(f_{1}\otimes \cdots \otimes f_{n}) = \frac{1}{\sqrt{n!}}a^{\dagger}(f_{1})\cdots a^{\dagger}(f_{1})\Omega_{0} \tag{2}\label{2}$$
where $\Omega_{0} = (1,0,0,...) \in \mathcal{F}^{\pm}(\mathscr{H})$ is the vacuum state.
Question 1: It is usually used, specially in the physics literature, that every linear operator $A$ on $\mathcal{F}^{\pm}(\mathscr{H})$ can be written in terms of creation and annihilation operators. However, I have never seen any proof of this result, and it does not seem trivial to me. Is this a provable fact?
Question 2: How can we change the above scenario to include time evolution? More especifically, let $H$ be a Hamiltonian on $\mathscr{H}$. At least if the particles of the system are noninteracting, the time evolution operator on $\mathscr{H}_{n}$ is $e^{-itH_{n}} = e^{-itH}\otimes \cdots \otimes e^{-itH}$, where there are $n$ such tensor products. In Heisenberg's picture, one defined time-dependent operators, i.e:
$$a^{\dagger}(f,t) := e^{itH_{n}}a^{\dagger}(f)e^{-itH_{n}} \tag{3}\label{3}$$
On the other hand, we can evolve elements:
$$e^{-itH_{n}}(\Pi^{\pm}(f_{1}\otimes \cdots \otimes f_{n})) \tag{4}\label{4}$$
Does it follow from (\ref{1}) and (\ref{2}) that every such time-evolved element can be built from sucessive applications of $a^{\dagger}(f,t)$?
Add: Question 2 is better rephrased as follows. If time is considered, does (\ref{2}) still holds when the creation operators $a^{\dagger}(f_{i})$ on the right hand side of this equation is replaced by the time-dependent (\ref{3}) and the left hand side of (\ref{2}) is replaced by (\ref{4})?


text:
Q: centos 8 ssh remote server asking password despite PubkeyAuthentication yes I am trying to connect remote host from client computer without password (with password works perfectly)
On client computer I did following but when I try to connect ssh, still asking password. anyone can direct me right direction because I have been researching hours on this website to solve this problem and yet to solve it.
 [root@gtw2-au .ssh]# ssh-keygen -t rsa
    Generating public/private rsa key pair.
    Enter file in which to save the key (/root/.ssh/id_rsa): 10_0_1_1.id_rsa
    Enter passphrase (empty for no passphrase):       <= no password just enter
    Enter same passphrase again:                      <= no password just enter
    Your identification has been saved in 10_0_1_1.id_rsa.
    Your public key has been saved in 10_0_1_1.id_rsa.pub.
    The key fingerprint is:
    SHA256:6dsehkfzX4444RPsi7adrHpAJzDOlD5/cQ8K1vLfa9s root@gtw2-au.domainx.com
    The key's randomart image is:
    +---[RSA 3072]----+
    |        .        |
    |       =         |
    |      = 8 .      |
    |       = B + o   |
    |        4 2 = 4  |
    |       . = 5 o o |
    |        8 7 + + .|
    |         = =+=ooo|
    |        .o*++B**E|
    +----[SHA256]-----+

    [root@gtw2-au .ssh]# ls
    10_0_1_1.id_rsa  10_0_1_1.id_rsa.pub  authorized_keys  known_hosts
    [root@gtw2-au .ssh]# nano 10_0_1_1.id_rsa
    [root@gtw2-au .ssh]# ssh-copy-id -i ~/.ssh/10_0_1_1.id_rsa.pub root@10.0.1.1
    /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/10_0_1_1.id_rsa.pub"
    /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
    /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
    root@10.0.1.1's password:

    Number of key(s) added: 1

    Now try logging into the machine, with:   "ssh 'root@10.0.1.1'"
    and check to make sure that only the key(s) you wanted were added.

    [root@gtw2-au .ssh]# ssh 'root@10.0.1.1'
    root@10.0.1.1's password:

Remote host /etc/ssh/sshd_config
PubkeyAuthentication yes
EDIT: debug added.
[root@gtw2-au .ssh]# ssh -vvv 'root@10.0.1.1'
OpenSSH_8.0p1, OpenSSL 1.1.1c FIPS  28 May 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: /etc/ssh/ssh_config line 51: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0
debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
debug2: checking match for 'final all' host 10.0.1.1 originally 10.0.1.1
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: not matched 'final'
debug2: match not found
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 (parse only)
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug3: gss kex names ok: [gss-gex-sha1-,gss-group14-sha1-]
debug3: kex names ok: [curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1]
debug1: configuration requests final Match pass
debug2: resolve_canonicalize: hostname 10.0.1.1 is address
debug1: re-parsing configuration
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: /etc/ssh/ssh_config line 51: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0
debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
debug2: checking match for 'final all' host 10.0.1.1 originally 10.0.1.1
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: matched 'final'
debug2: match found
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug3: gss kex names ok: [gss-gex-sha1-,gss-group14-sha1-]
debug3: kex names ok: [curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1]
debug2: ssh_connect_direct
debug1: Connecting to 10.0.1.1 [10.0.1.1] port 22.
debug1: Connection established.
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: identity file /root/.ssh/id_xmss type -1
debug1: identity file /root/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.0
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.0
debug1: match: OpenSSH_8.0 pat OpenSSH* compat 0x04000000
debug2: fd 5 setting O_NONBLOCK
debug1: Authenticating to 10.0.1.1:22 as 'root'
debug3: hostkeys_foreach: reading file "/root/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /root/.ssh/known_hosts:5
debug3: load_hostkeys: loaded 1 keys from 10.0.1.1
debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,aes128-ctr,aes128-cbc
debug2: ciphers stoc: aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,aes128-ctr,aes128-cbc
debug2: MACs ctos: hmac-sha2-256-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha1,umac-128@openssh.com,hmac-sha2-512
debug2: MACs stoc: hmac-sha2-256-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha1,umac-128@openssh.com,hmac-sha2-512
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,aes128-ctr,aes128-cbc
debug2: ciphers stoc: aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,aes128-ctr,aes128-cbc
debug2: MACs ctos: hmac-sha2-256-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha1,umac-128@openssh.com,hmac-sha2-512
debug2: MACs stoc: hmac-sha2-256-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha1,umac-128@openssh.com,hmac-sha2-512
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: aes256-gcm@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: aes256-gcm@openssh.com MAC: <implicit> compression: none
debug1: kex: curve25519-sha256 need=32 dh_need=32
debug1: kex: curve25519-sha256 need=32 dh_need=32
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:MwDFESndWiq/f5N2Dam+N81M7CUWjvSCfafoZGMR95I
debug3: hostkeys_foreach: reading file "/root/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /root/.ssh/known_hosts:5
debug3: record_hostkey: found key type ECDSA in file /root/.ssh/known_hosts:5
debug3: load_hostkeys: loaded 1 keys from 10.0.1.1
debug1: Host '10.0.1.1' is known and matches the ECDSA host key.
debug1: Found key in /root/.ssh/known_hosts:5
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey out after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey in after 4294967296 blocks
debug1: Will attempt key: /root/.ssh/id_rsa
debug1: Will attempt key: /root/.ssh/id_dsa
debug1: Will attempt key: /root/.ssh/id_ecdsa
debug1: Will attempt key: /root/.ssh/id_ed25519
debug1: Will attempt key: /root/.ssh/id_xmss
debug2: pubkey_prepare: done
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,password
debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup gssapi-with-mic
debug3: remaining preferred: publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-with-mic
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available (default cache: KCM:)
debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available (default cache: KCM:)

debug2: we did not send a packet, disable method
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug3: no such identity: /root/.ssh/id_rsa: No such file or directory
debug1: Trying private key: /root/.ssh/id_dsa
debug3: no such identity: /root/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /root/.ssh/id_ecdsa
debug3: no such identity: /root/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /root/.ssh/id_ed25519
debug3: no such identity: /root/.ssh/id_ed25519: No such file or directory
debug1: Trying private key: /root/.ssh/id_xmss
debug3: no such identity: /root/.ssh/id_xmss: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
root@10.0.1.1's password:

A: You've changed the name of the key to a non-standard one, unless set in your ssh_config, it won't be used by default.
Try renaming the key as id_rsa or connect using ssh -i ~/.ssh/10_0_1_1.id_rsa root@10.0.1.1.


text:
Q: Finding the radius of convergence for the given series. How to find out the radius of convergence for $\sum x^{n!}$? I tried the ratio and the root test. But no luck. Kindly help !

A: According to Cauchy-Hadamard, the radius of convergence $r$ of $\sum a_nx^n$ is given by
$$\tag1\frac 1r=\limsup_{n\to\infty}\sqrt[n]{|a_n|}$$
For your example, $a_n=1$ if $n=k!$ for some $k>1$, $a_1=2$ and $a_n=0$ otherwise. As with any 0-1-sequence that is $1$ infinitely often, the limes superior in $(1)$ equals $1$, henec also $r=1$.

A: For the radius of convergence of the series
\begin{equation*}
\sum_{n\in\mathbb{N}}c_nx^{n},
\end{equation*}
use the definition
\begin{equation*}
l:=\limsup_{n\to\infty}|c_n|^{1/n}.
\end{equation*}
Therefore we have
\begin{equation*}
l=\lim_{n\to\infty}(1)^{1/{n!}}=1\Rightarrow R=1.
\end{equation*}


text:
Q: Google maps v2 getting fragment instance I am trying to make a map which is in tab. I added support library so that Google maps would be supported from 2.2 android version. The main problem is that my tabs are fragments and nested fragments are not supported I created two xml files:
1) has an Relative layout and is inflated when  onCreateView() method is called in tab
2) second xml file hold fragment which is instance of SupportMapFragment
The second xml file is inflated and added to first xml file Relative layout. Map is shown but I cant get the instance of fragment. Is there a way to get instance off fragment in a view?

A: The nested fragments are supported since API Level 4.2 and support library 11.
They should be added dynamically and can be accessed by getChildFragmentManager().


text:
Q: How to check if a view is inViewHierarchy or not? For example, if a view of a viewController is in viewHierarchy and I just finished downloading stuff, I want to update stuff quickly. If self.view is not in viewHierarchy, I want to postpone updating.
I suppose, I can just add a boolean variable to indicate that and put it on viewWillAppear and viewWillDisappear.
I can also scan windows and see if UIView is in the viewHierarchy or not.
Is there a more straightforward way?

A: As of iOS 9.0, in Swift, you can do this in your view controller:
if viewIfLoaded?.window != nil {
    // view should be updated
}

or this if you want to actually use the view:
if let view = viewIfLoaded, view.window != nil {
    // update view
}

For older versions of iOS, in Objective-C:
if (self.isViewLoaded && self.view.window != nil) {
    // view is in a view hierarchy and should be updated
}

A: viewDidLoad will get triggered only after the view loading is done, i think. So you can add necessary functionality in viewDidLoad itself, i think.

A: To check if it's not in the view hierarchy, this is enough:
// From a UIViewController sub-class
if !self.isViewLoaded {
    // view is not in the view hierarchy
}


text:
Q: Navigate to specific screen when clicked on notification? I am using react-native-fcm for notification and successfully receiving notification. My problem is when i click on that notification it must navigate to specific screen.
I have a stack navigator with home and alerts.
i am writing my code in login which much navigate to alerts.
FCM.on(FCMEvent.Notification, async (notif) => {
if (notificationData.message === 'New alert generated.') {

        FCM.presentLocalNotification({
            vibrate: 500,
            title: 'title',
            priority: "high",
            show_in_foreground: true,
            group: 'test',
            large_icon: "ic_launcher",
            icon: "ic_launcher",
        });
    }
}

Here im using presentLocalNotification() to show notification. where should i use this.props.navigation.navigate('alerts');

A: FCM.on(FCMEvent.Notification, async (notif) => {
 if(notif){
  if(notif.opened_from_tray && notif.local_notification) {
     // Handle navigation here
     this.props.navigation.navigate('alerts');
   } else {
     FCM.presentLocalNotification({
            vibrate: 500,
            title: 'title',
            priority: "high",
            show_in_foreground: true,
            group: 'test',
            large_icon: "ic_launcher",
            icon: "ic_launcher",
        });
   }
 }
}


text:
Q: Showing a hidden link upon clicking another link I have a page that will show 2 graphs, with different information in them, depending on which link is clicked at the top of my page (adding the variable in the address line).
When clicking this link, i also want to have a button appear below the graphs, adding an option to download the entire database.
I have looked into this, and found a solution that "should" work, but it does not.
My Menu:

    KMA
    KMO

The jQuery (placed inside the Docuemnt.ready function):
$("#menu").click(function () {
    $("#downloadlink").show();
});

And lastly, the link i want make appear:

        Click here to download databse

The above does not work. If anyone could provide help on the matter, i would be much appreciated, as im quite frankly getting a bit frustrated, this close to the weekend!
Thanks in advance, Jon.

A: Try:
$(".menu a").click(function () {
    $("#downloadlink").show();
});

A: it´s difficult to figure out what´s the problem but you could try to trigger the click on the anchors, it may be they are in "front" of the div so you click them instead of div.menu
$(".menu a").click(function () {
    $("#downloadlink").show();
});

A: The class selector is of the form .classname and not #classname
$('.menu a').click(function() {
    $("#downloadlink").show();
    return false; // important
});

should do the trick.


text:
Q: Tomcat localhost page showing HTTP500 but I can access the 'sample' war / app but no others - Jenkins installed I'm trying to set up my server properly so that I can run servlets on it with the help from Jenkins.    Within the webapps folder are two war files.  One for jenkins and one for the sample from apache.  Both work fine but when trying to access localhost:8080 I get an HTTP 500 error.
I first discovered the error as I was trying to get a spring web app to deploy.  All have so far failed although if I run the web app on my laptop it works fine so I'm assuming that the war file and the web app itself are fine.
Is there a possibility that the previous war files that I tried to deploy have caused a problem somewhere?
The laptop does not have jenkns installed - could jenkins be causing the problem?
I searched various posts and tried to find the jar file within other folders within the webapp directory but could find nothing.
I then deleted all of the war files with the exception of jenkins.  Jenkins loads but the main page does not.
Thanks for any help.
The full error message is:
HTTP Status 500 - java.lang.ClassCastException: org.apache.jasper.runtime.ELContextImpl cannot be cast to org.apache.jasper.el.ELContextImpl
type Exception report

message java.lang.ClassCastException: org.apache.jasper.runtime.ELContextImpl cannot be cast to org.apache.jasper.el.ELContextImpl

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: java.lang.ClassCastException:      org.apache.jasper.runtime.ELContextImpl cannot be cast to org.apache.jasper.el.ELContextImpl
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    root cause

   java.lang.ClassCastException: org.apache.jasper.runtime.ELContextImpl cannot be cast to     org.apache.jasper.el.ELContextImpl
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:1023)
org.apache.jsp.index_jsp._jspService(index_jsp.java:85)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
 note The full stack trace of the root cause is available in the Apache Tomcat/7.0.42 logs.

When I received this message when trying to deploy the webapp (the one that works on laptop), the error line was where jstl was used but in this instance the webapp is no longer on the server and I'm just trying to access localhost.

A: The deployed app has probably included its own version of jasper.jar.  Remove jasper.jar from the app's /WEB-INF/lib directory.  See https://stackoverflow.com/questions/12384779/org-apache-jasper-el-elcontextimpl-cannot-be-cast-to-org-apache-jasper-runtime-e for further details.


text:
Q: How to convert a python dictionary with tuples into a pandas dataframe? I have a python dictionary in which the keys of the dictionary are tuples of two strings and the values are integers.
It looks like this:
mydic = { ('column1', 'index1'):33,
          ('column1', 'index2'):34,
          ('column2', 'index1'):35,
          ('column2', 'index2'):36 }

The first string of the tuples should be used as the column-name in the dataframe and the second string in the tuple should be used as the index.
The dataframe from this should look like this:

(index)
column1
column 2

index1
33
35

index2
34
36

Is there any way to do this?
(Or do I have to loop through all elements of the dictionary and build the dataframe one value at a time by hand?)

A: Build a pd.Series first (which will have a MultiIndex), then use pd.Series.unstack to get the column names.
df = pd.Series(mydic).unstack(0)
print(df)

        column1  column2
index1       33       35
index2       34       36

A: You can use pd.MultiIndex.from_tuples.
mydic = { ('column1', 'index1'):33,
          ('column1', 'index2'):34,
          ('column2', 'index1'):35,
          ('column2', 'index2'):36 }

df = pd.DataFrame(mydic.values(), index = pd.MultiIndex.from_tuples(mydic))

                 0
column1 index1  33
        index2  34
column2 index1  35
        index2  36

What comes after that is just a workaround.
df.T.stack()

          column1  column2
0 index1       33       35
  index2       34       36

Notice that the index contains two rows. Do not forget to reset it.
df.T.stack().reset_index().drop('level_0', axis = 1)

  level_1  column1  column2
0  index1       33       35
1  index2       34       36

You can rename the level_1 if you want to. Hope it helps.


text:
Q: SpringBoot Sleuth/Zipkin Tracing: Issue adding a client, for Zipkin Server Small question regarding a Java 11 + SpringBoot 2.6.7 web application, in the context of Zipkin please.
I have a very simple micro services architecture SpringBoot repo that can be found here: https://github.com/dogukankrtlz/springboot-sleuth-zipkin, please feel free to clone.
Here are the relevant code for each micro service, it is very straightforward, I omitted the POJOs etc...
Main service, called customer service, is calling to call two child services:
    @RequestMapping(value="/customer/{cid}", method=RequestMethod.GET)
    public CustomerDetails getCustomer(@PathVariable String cid) {

        CustomerDetails customer = new CustomerDetails();

        ContactDetails svc1 = wc.get()
                .uri("http://localhost:8081/customer/" + cid + "/contactdetails")
                .retrieve()
                .bodyToMono(ContactDetails.class)
                .block();

        VehicleDetails svc2 = wc.get()
                .uri("http://localhost:8082/customer/" + cid + "/vehicledetails")
                .retrieve()
                .bodyToMono(VehicleDetails.class)
                .block();

        customer.setContactId(cid);
        customer.setContactName(svc1.getContactName());
        customer.setPostalCode(svc1.getPostalCode());
        customer.setLicensePlate(svc2.getLicensePlate());
        customer.setCarType(svc2.getCarType());

        return customer;
    }

Calling service A
 @RequestMapping(value="/customer/{cid}/contactdetails", method= RequestMethod.GET)
    public ContactDetails getCustomerContactDetails(@PathVariable String cid) throws InterruptedException {
        Span dbSpan = this.tracer.nextSpan().name("DBLookup");
        try (Tracer.SpanInScope ws = this.tracer.withSpan(dbSpan.start())) {

            dbSpan.tag("call", "sql-database");

            Random r = new Random();
            int multiplier = r.nextInt(5) * 1000;
            Thread.sleep(multiplier);

            dbSpan.event("db lookup complete");
        }
        finally {
            dbSpan.end();
        }

        return details.stream().filter(detail -> cid.equals(detail.getContactId())).findAny().orElse(null);

    }

Then calling service B
 @RequestMapping(value="/customer/{cid}/vehicledetails", method=RequestMethod.GET)
    public VehicleDetails getCustomerVehicleDetails(@PathVariable String cid) {

        return details.stream().filter(detail -> cid.equals(detail.getCustomerId())).findAny().orElse(null);
    }

Once I make a request, I can see in the logs the traces, things are working, happy:
DEBUG [customerservice,25ef30dd73fbb6d8,25ef30dd73fbb6d8] 26578 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed 200 OK
DEBUG [dataservice1,25ef30dd73fbb6d8,65be0bf2df917b35] 26576 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet        : Completed 200 OK
DEBUG [dataservice2,25ef30dd73fbb6d8,a490771db3881b76] 26570 --- [nio-8082-exec-1] o.s.web.servlet.DispatcherServlet        : Completed 200 OK

Please note, I can see all trace IDs fine: 25ef30dd73fbb6d8,25ef30dd73fbb6d8 on the Main service, 25ef30dd73fbb6d8,65be0bf2df917b35 and 25ef30dd73fbb6d8,a490771db3881b76 on child services.
Most important part, I can even see the traces in Zipkin Server, they are all here, beautiful, will all relevant information: (see screenshot)

Things are working quite well, so far. Now, I would like to add a client. This is where things start to go south.
I add this client, also very straightforward:
 public static void main(String[] args) {
        final OkHttpSender        sender    = OkHttpSender.newBuilder().endpoint("http://localhost:9411/api/v2/spans").build();
        final AsyncReporter<Span> reporter  = AsyncReporter.create(sender);
        final Tracing             tracing   = Tracing.newBuilder().localServiceName("ClientService").addSpanHandler(ZipkinSpanHandler.create(reporter)).build();
        final BraveTracer               tracer    = BraveTracer.create(tracing);
        final BraveSpan                 parent    = tracer.buildSpan("client start API").start();
        final WebClient           webClient = WebClient.create().mutate().defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE, HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE).clientConnector(new ReactorClientHttpConnector(HttpClient.create().responseTimeout(Duration.ofSeconds(10)).wiretap(true).protocol(HttpProtocol.HTTP11))).build();
        final String              response  = webClient.get().uri("http://localhost:8080/customer/500").header("X-B3-TraceId", parent.unwrap().context().traceIdString()).header("X-B3-SpanId", parent.unwrap().context().spanIdString()).retrieve().bodyToMono(String.class).onErrorReturn("ERROR").block();
        parent.finish();
        reporter.flush();
        System.out.println("->" + response);
    }

I do see logs from both client and server:
client: X-B3-TraceId: d96d2354f60b306a..X-B3-SpanId: d96d2354f60b306a
server:
DEBUG [customerservice,d96d2354f60b306a,d96d2354f60b306a]
DEBUG [dataservice1,d96d2354f60b306a,f61a595dfd045e17]
DEBUG [dataservice2,d96d2354f60b306a,df125c7d44c5143c]

I go back into Zipkin with hope, and this is all I see:

What I would expect to see, is definitely something more like this (photoshop).

May I ask what went wrong here?
How to achieve a result where I can see the complete trace, from client all the way to server, all in one place in Zipkin?
Thank you

A: You can't create those objects manually (those objects == tracer, webclient, tracing etc.). You have to get them from the application context as beans. Then all the inbuilt instrumentations will be applied.
UPDATE:
Since it seems you're not using Spring Cloud Sleuth in all projects, you can still achieve sth similar by doing the instrumentation manually. That means that you would have to add the tracing exchange functions to web client etc. In general all the instrumentations that Sleuth does automatically behnd the scenes you would have to do manually.


text:
Q: how to write and execute a hello world program in hadoop? Am an absolute beginner in apache hadoop.
could you please tell me how to do a hello world python program in apache hadoop,and also hoe programs are run in hadoop( I just need to do it in a single culster). I have to do it in no time and am posting this because am so desperate. I've configured hadoop on my ubuntu 10.10 and some examples programs were run successfully like the
$ bin/hadoop jar hadoop-0.20.1-examples.jar pi 10 100

I have no clue regarding what is happening behind this step.Also kindly tell me a good place to start with hadoop(ebooks,links etc). I should have somehow figured this out if i had time and since i dont have it pls respond and that ll be so helpful.

A: i suggest to read docs,
http://hadoop.apache.org/common/docs/r0.20.2/index.html
and the wiki
http://wiki.apache.org/hadoop/FrontPage
in docs, you'll find some samples as shown by answer before. Good luck.

A: Since you can run this example in hadoop, it's the same way to run an application.
Check the doc here:http://hadoop.apache.org/common/docs/r0.18.2/mapred_tutorial.html
And WordCount example is a hello world program for you.

A: Look at Yahoo Hadoop Tutorial(http://developer.yahoo.com/hadoop/tutorial/).
You may also want to look at the src of the hadoop-examples to get a better feel of the programming with Hadoop.
You may also want to readup on Hadoop streaming(http://wiki.apache.org/hadoop/HadoopStreaming)


text:
Q: Kerion vpn control installation error Help me please. I tried to install kerio vpn client. Installation failed with error:
kerio-control-vpnclient (9.2.7.2921-1) …
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Failed to start kerio-kvc.service: Unit kerio-kvc.service is not loaded properly: Exec format error.
See system logs and 'systemctl status kerio-kvc.service' for details.
invoke-rc.d: initscript kerio-kvc, action "start" failed.
● kerio-kvc.service - Kerio Control VPN Client
   Loaded: error (Reason: Exec format error)
   Active: inactive (dead)

сен 28

ervice:13: Executable path is not absolute: pkill -SIGHUP kvpncsvc
сен 28 20:22:41 kokunovai-Inspiron-5748 systemd[1]: /lib/systemd/system/kerio-kvc.service:13: Executable path is not absolute: pkill -SIGHUP kvpncsvc
сен 28 20:22:41 kokunovai-Inspiron-5748 systemd[1]: /lib/systemd/system/kerio-kvc.service:13: Executable path is not absolute: pkill -SIGHUP kvpncsvc
dpkg: ошибка при обработке пакета kerio-control-vpnclient (--install):
 installed kerio-co 20:22:41 kokunovai-Inspiron-5748 systemd[1]: /lib/systemd/system/kerio-kvc.sntrol-vpnclient package post-installation script subprocess returned error exit status 1

.
What can I do to install this correctly?

A: your problem was solved?
you may fix it.
edit file /lib/systemd/system/kerio-kvc.service
find this:
ExecReload=pkill -SIGHUP kvpncsvc

and replace for:
ExecReload=/usr/bin/pkill -SIGHUP kvpncsvc


text:
Q: Storing ArrayList in Excel using Apache POI HSSF I have a data list:
List data1 = (List) session.getAttribute("data");

Now, I want this data to be stored in an Excel file:
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("Excel Sheet");

HSSFRow rowhead = sheet.createRow((short) 0);

rowhead.createCell((short) 0).setCellValue("lOGINID");
rowhead.createCell((short) 1).setCellValue("CUSTOMERID");
rowhead.createCell((short) 2).setCellValue("updatetime");

int index = 1;
for (itr = data1.iterator(); itr.hasNext(); ) {
    // what to write here?
}

A: You haven't clearly stated what your List holds. List data1 = (List) session.getAttribute("data");  It must be List<SomeClass>.
You can simply iterate over the list, pull the object on current index, create new row and fill the values in cells
for (int i = 0; i < data1.size(); i++) { //iterate over the list

   SomeClass data = data1.get(i);//pull the object on current index i

   HSSFRow row = sheet.createRow(i + 1); //create new row

   //fill the values
   row.createCell(0).setCellValue(data.field1);
   row.createCell(1).setCellValue(data.field2);
   row.createCell(2).setCellValue(data.field3);

A complete example assuming the list contains RowData,:
import lombok.AllArgsConstructor;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;

    void writeList() throws IOException {
        //read data , RowData can be different in your case
        List<RowData> data1 = (List<RowData>) session.getAttribute("data");

        HSSFWorkbook wb = new HSSFWorkbook();
        HSSFSheet sheet = wb.createSheet("Excel Sheet");

        HSSFRow rowhead = sheet.createRow(0); //header

        rowhead.createCell(0).setCellValue("lOGINID");
        rowhead.createCell(1).setCellValue("CUSTOMERID");
        rowhead.createCell(2).setCellValue("updatetime");

        for (int i = 0; i < data1.size(); i++) {

            RowData data = data1.get(i);//rows

            HSSFRow row = sheet.createRow(i + 1);

            row.createCell(0).setCellValue(data.loginId);
            row.createCell(1).setCellValue(data.customerId);
            row.createCell(2).setCellValue(data.time);
        }

        //write to file
        try (FileOutputStream out = new FileOutputStream("test.xlsx")) {
            wb.write(out);
        }
    }

    @AllArgsConstructor
    class RowData {
        String loginId;
        String customerId;
        String time;
    }


text:
Q: About definition of "extended absolute value" (in $\overline{\Bbb{R}}=\Bbb{R}\cup\{+\infty,-\infty\}$) Is correct following definition?

*

*Def.: Let be $a \in \overline{\Bbb{R}}=\Bbb{R}\cup\{+\infty,-\infty\}$, $$|a|=\begin{cases}
 |a|& \text{ if } a\in \Bbb{R} \\
 +\infty & \text{ if } a \in \{+\infty,-\infty\}
\end{cases}$$

Thanks in advance!


text:
Q: Should I use one or multiple Azure WebJobs I have a system that posts messages to an Azure Service Bus topic. The topic has multiple subscribers and I am writing a webJob to process the messages.
When I care a new WebJob project in Visual Studio, I get a class called 'Functions.cs', which has code to check a queue. I have updated the code to check a subscription within a topic:
public static void ProcessTopicMessage([ServiceBusTrigger("topic-name", "subscription-name")] string message, TextWriter log)
{
    // Processing goes here
}

The topic has multiple subscriptions, which I need to monitor and then perform different actions for each message that is received. This will involve connecting to third-party services through API's, a different API for each subscription.
Example:
topic-name
    subscription-1  // Perform action #1
    subscription-2  // Perform action #2
    subscription-3  // Perform action #3
    ...

My question is: Should I write a separate WebJob for each subscription or should I add additional methods into the 'Functions.cs' class?
I wonder if the performance will reduce if I have multiple methods in the same WebJob and if I need to make the methods asyncronous.

A:
My question is: Should I write a separate WebJob for each subscription or should I add additional methods into the 'Functions.cs' class?

According to your requirement, you have multiple subscriptions which subscrible the same Topic and each subscription has the different logic to deal with the same message.
Per my understanding, since the multiple subscriptions share the same configuration(App Settings of Azure ServiceBus) and each subscription handles the similar logic. Multiple functions could reuse the same host which could be scaled to multiple instances. I assumed that multiple functions in the same WebJob is a better approach for you.

I wonder if the performance will reduce if I have multiple methods in the same WebJob and if I need to make the methods asynchronous.

As I known, the JobHost would start a thread from the managed thread pool, when your functions are triggered. You could configure the maximum number of concurrent calls to handle the messages from ServiceBus as follows:
ServiceBusConfiguration.MessageOptions.MaxConcurrentCalls=20 //16 by default

Since you would invoke a third-party API, you could mark your function as asynchronous to increase scalability of your WebJob. Also, there is an issue about async for performance, you could refer to it.

A: Creating a web job per each subscription or one web job for all depends on your requirement.
ex:
How much time does it take to process a request?
Answering this question will determine if more than one subscription will highly impact the performance or not
Is there an SLA for this time?
If you have an SLA for each request, then you may need to scale the web job into different one for each subscription, otherwise, one will be enough
Are there any special configuration for each subscription?
If all subscriptions share the same connection, configuration, then you may not need separate web job for each subscription.
You can also you the strategy pattern, and move each subscription to its own class for implementing the logic specific to each one


text:
Q: Updating deeply nested structures in clojure I've got a structure like this:
[["/1417612109-first-migration.clj"  {:applied true :date-applied 1423233980}]
 ["/1417612450-second-migration.clj" {:applied false}]
 ["/1417615919-forth-migration.clj"  {:applied false}]]

I eventually need to manipulate it and return a new version of it. To find the value I need to manipulate I use filter and first which gives me the vector I'm after, E.G:
 ["/1417612450-second-migration.clj" {:applied false}]

My question is; how do I update the map for that particular item without having to map over the whole lot again? Can I use the above as a reference somehow?

A: If you don't need the matching vector returned for other purposes, i.e. you're only finding it in order to update it, then use a map, instead of filter and first, with a function that checks each entry to see whether needs updating and returns either the changed/unchanged entry as appropriate.
(def test
  [["/1417612109-first-migration.clj"  {:applied true :date-applied 1423233980}]
   ["/1417612450-second-migration.clj" {:applied false}]
   ["/1417615919-forth-migration.clj"  {:applied false}]])

(map #(if (:applied (second %))
        % ; if applied is already true then use it unchanged
        (assoc-in % [1 :applied] true)) ; if applied is false update it
     test)

; (["/1417612109-first-migration.clj" {:applied true, :date-applied 1423233980}]
;  ["/1417612450-second-migration.clj" {:applied true}]
;  ["/1417615919-forth-migration.clj" {:applied true}])

If you don't need the outer collection to be a vector then you could make it a map and then use e.g. "/1417612450-second-migration.clj" as a key to assoc-in or update-in.
(def test-map
  {"/1417612109-first-migration.clj"  {:applied true :date-applied 1423233980}
   "/1417612450-second-migration.clj" {:applied false}
   "/1417615919-forth-migration.clj"  {:applied false}})

(def result ["/1417612450-second-migration.clj" {:applied false}])

(assoc-in test-map [(first result) :applied] true)

;{"/1417612109-first-migration.clj" {:applied true, :date-applied 1423233980},
; "/1417612450-second-migration.clj" {:applied true},
;"/1417615919-forth-migration.clj" {:applied false}}

A: You can use update-in function https://clojuredocs.org/clojure.core/update-in
(update-in my-vector [0 1 :applied] f)

where f is a function that takes the old value and return the new one. This example will update the applied value in the map from your first vector. It also works for deep structures. For more see the documentation.


text:
Q: ASP .Net Core MVC Routing Not Working in Visual Studio 2017 after changing "applicationUrl" I have created an empty ASP.NET Core Web Application and I added the MVC service and configuration to "Startup.cs" file
And in order to set my start up view "Users/Create", I have changed the "applicationUrl" in launchSettings.json file as following
"applicationUrl": "http://localhost:61541/Users/Create",

First Issue
I got the expected URL when running the visual studio "http://localhost:61541/Users/Create" but it shows me the "Home/Index" view (the default route)
Solution
Now I realized that I shouldn't change the "applicationUrl" value as MVC consider it the basic root. This is why I got the following behavior

*

*http://localhost:61541/Users/Create -->  returns the default
route "Home/Index"

*http://localhost:61541/Users/Create/Users/Create --> returns
"Users/Create"

The Main Issue

When I decided to change the "applicationUrl" back to be "http://localhost:61541" and navigate to "http://localhost:61541/Users/Create", I got again the "Home/index" view (the default route)
Also I got the following behavior:

*

*http://localhost:61541/Users/Create --> returns "Home/Index"

*http://localhost:61541/Users/Index --> returns "Users/Index"

*http://localhost:61541/Users/Create/Users/Create --> returns "Users/Create"

Note: everything is working as expected after deploying the solution into IIS. But in Visual Studio the behavior still odd for me

My Question
I am asking why the routing inside Visual Studio (with IIS express) not working as before? although I changed the "applicationUrl" back to its original value?!

Here is the solution code
public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddMvc();
    }

    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {
        app.UseMvc(routes =>
        {
            routes.MapRoute(
                name: "default",
                template: "{controller=Home}/{action=Index}/{id?}");
        });
    }
}

Then I added two controllers with two views for each
 public class HomeController : Controller
{
    public IActionResult Index()
    {
        return View();
    }

    public IActionResult Create()
    {
        return View();
    }
}

public class UsersController : Controller
{
    public IActionResult Index()
    {
        return View();
    }

    public IActionResult Create()
    {
        return View();
    }
}

A: It looks like each time you make a change to the application url in Visual Studio it is writing to [project directory].vs\config\applicationhost.config. It adds a new "application" node under your "site" node. In my case it was /users and then /web, as per your recommendation. It just keeps adding new application paths with "virtualDirectory" nodes having path="/". It does not remove any of them. Each new "application" path will work. However, if the path you provide is a controller it is confusing.
From the VS user interface it seems reasonable to assume if you change the App Url your are changing a single value, not adding to a list of valid values.
Anyway, if you edit applicationhost.config to remove the "application"s under your site that you don't want, it should work as before.

A:
The only workaround that I have now is to add suffix to the
  "applicationUrl" to be "http://localhost:61541/web" so I can have
  the routing fixed in Visual Studio.

Here are the results

*

*http://localhost:61541/web/Users/Create --> returns "Users/Create"

*http://localhost:61541/web/Users/Index --> returns "Users/Index"

*http://localhost:61541/web/Home/Create --> returns "Home/Create"

*http://localhost:61541/web --> returns "Home/Index" (the default route)

Note: this solution may cause Ajax call debugging problems.
Which means you may not be able to debug Ajax calls in server side. But to avoid this issue you can start the Ajax Url with the suffix like '/web/...'


text:
Q: учебное задание на ассемблере (микроконтроллер 8051) Реализовать программу: пользователь устанавливает в Р0 некоторое число N. Программа должна занести в стек натуральные числа от 1 до N. После этого, вынимая их поочередно из стека, сосчитать их сумму и вывести ее в портах Р1 (младший байт) и Р2 (старший байт).
Какое максимальное число может быть в Р0, чтобы программа корректно работала?

A: Вопрос с подвохом: максимальное число ограничено размером стека. Его максимальное значение на 8051-архитектуре 96 байт, т.е. ответ 96. Сумма при этом меньше 65535, т.е. на порты ее вывести можно.


text:
Q: Threading in Python - Threads or processes? How are threads implemented in python? Does python create a separate process for each thread?
Consider this code.
from threading import Thread
from time import sleep

class testThread(Thread):
    def __init__(self):
        Thread.__init__(self)
    def run(self):
        while True:
            print "Thread inner!"
            sleep(5)
threadTest = testThread()
threadTest.start()
while True:
    print "Thread outer!"
    sleep(10)

On running this code on the shell and then doing a Ctrl+C the "Thread outer" print stops coming, however the "Thread inner" continues to  get printed until i manually kill it using 'kill -9 pid' command.

A: Each Thread is a thread, not a separate process, on Linux.  Use ps to see what processes are launched when your script is running, and you'll see a single python process.
The docs for the threading module note:

A thread can be flagged as a "daemon thread". The significance of this
flag is that the entire Python program exits when only daemon threads
are left. The initial value is inherited from the creating thread. The
flag can be set through the daemon property.
...
There is a "main thread" object; this corresponds to the initial
thread of control in the Python program. It is not a daemon thread.

Reading between the lines, the entire Python program only exits when all non-daemon threads (including the main thread) exit.

A: Threads are not separate processes. They share the same resources as the main thread. What's going on is that Python waits for all threads to finish running before exiting.
If you want Python to exit after the main process exits, daemonize all the other threads. You can do this as follows:
...
threadTest.daemon = True
threadTest.start()
...

This will work for very basic threads. However, according to the docs (linked above):

Daemon threads are abruptly stopped at shutdown. Their resources (such as open files, database transactions, etc.) may not be released properly. If you want your threads to stop gracefully, make them non-daemonic and use a suitable signalling mechanism such as an Event.


text:
Q: Running snort behind iptables I run a Centos 6.5 server with a highly restrictive iptables ruleset allowing incoming traffic only on a small handful of tcp ports (8 in total) and blocks all incoming unsolicited UDP traffic.
I recently built snort 2.9.7.0 from source and am running it in policy_mode:inline-test
I notice it's alerting on packets that are blocked by my iptables configuration, from which I surmise it's inserted itself in the processing chain before iptables.
I have read the manual and done several web searches but can find no mention of this behavior, or how to configure it so it runs after iptables.  I don't believe I need alerts on traffic that will be blocked anyway.
Is there a reason I would want to see those alerts, and if not, is there a way to set things up so I don't get alerts for iptables-blocked packets?

A: Since both Snort and Iptables getting the packets from interface so both will process the packets and both will trigger the action which is given by you in the rule. There is no need to use Iptables if you are running Snort. Create a rule for Snort which you have configured Iptables and set the rule action Drop in Snort rule. It will do the same work as iptables. Since you are analyzing the traffic inline so you have compile the snort with nfq(netfilter queue). In inline mode snort will take the packets from the queue.


text:
Q: Unable to replace values using Dict on DataFrame column I am creating a dictionary code_data by loading a CSV file to a data frame and converting it with to_dict method. This is a fragment of my code:
path = "E:\Knoema_Work_Dataset\hrfpfwd\MetaData\MetaData_num_person.csv"
code_data = pd.read_csv(path, usecols=['value', 'display_value'], dtype=object)
code_data = code_data.set_index('value')['display_value'].to_dict()

In the following line I am attempting to replace its values:
data["Number of Deaths"] = data["Number of Deaths"].replace(code_data)

Sadly, it leads to an error:
Cannot compare types 'ndarray(dtype=int64)' and 'str'

Could you provide me with some assistance with regards to my problem?


text:
Q: How to get rid of command line window when starting IISExpress? Is there a chance to get rid of command line window when starting IISExpress (iisexpress.exe)?
In the thread Use IIS Express in visual studio 2010 without sp1 and command window is determined, that it is not possible with a parameter of iisexpress.exe itself.
Are there any tricks with batch scripting or something like that?
I want to start IISExpress with a .bat file, but then the command windows should hide itself (because stopping the server is also possible with the tray icon).

A: Using PowerShell:
Start-Process .\iisexpress.exe -WindowStyle Hidden

A: Meanwhile I found a few ways to solve this.
One way is a Windows Script, see Duncan Smart's Weblob or directly his GIT-Repository.
Another way is to build a Windows Form Application (or similar), and use the ProcessStartInfo class, which offers the ProcessWindowStyle.Hidden property.
What I did at last: I dropped IIS Express and switched to CassiniDev. It is a great webserver (amongst others available as console application and DLL-assembly) which allowed me to build be "self-hosted" website by importing a single DLL.


text:
Q: Is there a bounded connected set $X$ such that for all point $b$ there exists $r > 0$ such that $X \setminus O(b, r)$ is disconnect? I find a question by myself, and I do not know if it is an interesting question.
Let $X \subseteq \mathbb{R}^n$ be a bounded connected set. And I define a "bad point" $b \in \mathbb{R}^n$ with respect to $X$ if there exists $r > 0$ such that $X \setminus O(b, r)$ is not connect, where $O(b, r)$ is a ball with center point $b$ and radius $r$. Let $B(X)$ be a set of all "bad point" with respect to $X$.
Strong question: Is there a bounded connected set $X$ such that $B(X) = \mathbb{R}^n$?
Weak question: Is there a bounded connected set $X$ such that $X \subseteq B(X)$?
I have no idea how to solve my question. I give some examples of my definition.
(1) If $X$ is a ball or spherical surface, then $B(X) = \varnothing$.
(2) If $X = \{(x,0, \ldots, 0) \mid x \in [0,1] \}$ is a close line segment, then $$B(X) = \{(x,a_{1}, \ldots, a_{n - 1}) \mid x \in (0,1), a_{i} \in \mathbb{R} \}$$
(3) If $X = \{(x,0, \ldots, 0) \mid x \in (0,1) \}$ is a open line segment, then $$B(X) = \{(x,a_{1}, \ldots, a_{n - 1}) \mid x \in (0,1), a_{i} \in \mathbb{R} \}$$

A: As commented, the weak question is already solved.
For the strong one, I think there is a simple example if I've understood your question well. Consider a cross $C$ in $\Bbb{R}^2$ center at the origin, i.e the union of $I_x=\{(x,0)\mid x\in[-1,1]\}$ and $I_y=\{(0,y)\mid y\in[-1,1]\}$.
Any ball that covers $(0,0)$ by not the whole cross would disconnect $C$. But you can see that for any point $b\in\Bbb{R}^2\setminus\{(0,0)\}$, the (closed) ball $O(b,|b|)$ contains $(0,0)$ but not the whole cross (if you mean open ball then just take a slightly bigger radius). Note that for $b=(0,0)$ you can take a small radius and it will work as well.
So, for every $b\in\Bbb{R}^2$ there exists $r>0$ such that $C\setminus O(b,r)$ is disconnected. This example can be easily generalized to any higher $\Bbb{R}^n$.

A: Your weak question is most assuredly true -- just take $X=\{(x,0,\ldots,0):x\in(-1,1)\}$. Since deleting any sufficiently small neighborhood of any point in $X$ will leave behind two disjoint line segments, we are done.
Your strong questions is interesting, but I don't know how to answer it well, so bear with me as I describe a construction in $\mathbb{R}^2$:
Consider the curve (in polar coordinates)
$$
(r,\theta) = \left(\exp(f(\theta)),\theta\right)
$$
where $f(\theta)$ is any continuous, monotonically increasing function with range $\left(-\ln(2),0\right)$, such as an appropriately scaled and translated $\arctan$ function. Take this curve, a circle with radius $1/2$ centered at the origin, and the unit circle, and define $X$ to be their union.
Where are the "bad points"? If you take a point outside the unit circle, say $(0,2)$, then we can find a radius $r=1+\epsilon$ which will "cut" the spiral off from the unit circle, leaving us a disconnected set. The same will be true for a point inside the circle of radius $1/2$, and a point inside the annulus can have a radius chosen to "cut" the two circular boundaries off from one another. Thus, all of $\mathbb{R}^2$ is "bad".
How do we take this construction and make it work in higher dimensions? There may or may not be an elegant equation for it, but the idea definetely generalizes -- take some increasingly fine "spiral" along the surface of hyper-sphere shells, and then take many such shells nested together, limiting towards to bounding shells, and link them together with line segments.
I wish I could describe that better, but I don't know how. Hopefully your mental picture is the same as mine.
EDIT: Please just use Javi's answer if you want a good example. This is far too complicated, even in $\mathbb{R}^2$.


text:
Q: PDFmake: pdfmake.createPdf is not a function After installing pdfmake using npm:
npm install pdfmake --save-dev

and compiling bundles with webpack I get an error when running:
pdfmake = require 'pdfmake'
pdfmake.createPdf(doc_definition).download('test.pdf')

Saying:
pdfmake.createPdf is not a function

I've read this suggestion, installed the script-loader and changed the requirement to:
pdfmake = require 'script!pdfmake'

But that gave even more errors. Besides, I wouldn't know what that script loader would be needed. Any suggestions?
EDIT
As described here it seems as if NPM installs the node (serverside) version of pdfmake instead of the browserside version, both of which have completely different API's. This should be the correct flow for the browserside:
npm install pdfmake --save-dev
pdfmake = require 'pdfmake'
pdfmake.createPdf(doc_definition).download('test.pdf')

A: On server side method createPdf is not supported.
Server side pdfmake Nodejs - TypeError: pdfmake.createPdf is not a function #1355
BUT I tried var PDF = require('pdfmake/build/pdfmake') and the error is gone.
Also I suggest you to get the vfs_fonts too
var PDF_Fonts=require('pdfmake/build/vfs_fonts')
and set the pdfmake.vfs like this
PDF.vfs = PDF_Fonts.pdfMake.vfs;


text:
Q: Select line count from LONGTEXT without using REPLACE I'm trying to retrieve the number of lines in a LONGTEXT field.
I know I can do the following:
select

(
    CHAR_LENGTH(log_data) - CHAR_LENGTH(REPLACE(log_data, "\n", ""))
) / CHAR_LENGTH("\n") as line_count

from client_logs where id = 7;

However, using REPLACE is insanely slow on un-indexed data, especially when the data can be 100,000 lines long or more. As is it takes ~18 seconds to determine the line count on a LONGTEXT with ~63,000 lines.
Is there any other way to get the number of lines in a LONGTEXT without using this costly procedure?
Edit: Since this was marked as a duplicate, please keep in mind I am specifically asking how to do this WITHOUT using REPLACE.


text:
Q: jquery javascript get checkbox's initial value I have a check box and want to get the very inital value or in other words get the default value just like we get the default value of a text box as follows:
 document.getElementById("myTextBoxID").defaultValue

I want to do the something similar either using jQuery/JS
 document.getElementById("myChkBoxID").defaultValue

So if I get a checkbox value checked from the server the very first time...now whenever the user changes the checkbox ...i should have a way of restoring it back to the very inital state
Is it possible

A: Try:
    document.getElementById("myChkBoxID").defaultChecked

https://developer.mozilla.org/en/DOM/HTMLInputElement

A: Use the defaultChecked property.
defaultChecked and defaultValue are defined in DOM level 2 as follows:

defaultChecked of type boolean
When type has the value "radio" or "checkbox", this represents the HTML checked attribute
of the element. The value of this attribute does not change if the state of the
corresponding form control, in an interactive user agent, changes. See the checked
attribute definition in HTML 4.01.
defaultValue of type DOMString
When the type attribute of the element has the value "text", "file" or "password", this
represents the HTML value attribute of the element. The value of this attribute does not
change if the contents of the corresponding form control, in an interactive user agent,
changes. See the value attribute definition in HTML 4.01.

Note that a checkbox does have a value attribute which you can change, but it is usually not something you would want, and can cause hard-to-find bugs...
Alternatives:
Since you are letting the server set the initial value, you can include a hidden input field and let the server set the initial state on it.
Or you can reset the entire form.

A: Just save the data when the page loads:
$(function() {
  $(':input').each(function() {
    $(this).data('default', $(this).val());
  });
});

Now, for any <input /> element, you can get its default value easily:
$('#yourInputElement').data('default');

When you want to reset the element to its default state, just call val() once more:
$('#yourInputElement').val($('#yourInputElement').data('default'));

A: You'll need to store the default value somehow. In this instance, I would think a data attribute would be acceptable.
//onload
$('#textboxID, #checkboxID').each(function(){
    $(this).data('default', $(this).val());
});

//on reset
$('#textboxID, #checkboxID').each(function(){
    $(this).val( $(this).data('default'));
});


text:
Q: Python mocking with parameter evaluation i have a problem when using the patch decorator for mocking a method in python.
the goal is to overwrite the following function call
self.util.database.getLatestPrice(token)

def getLatestPrice(self, token) -> Price | None:

and transport the input parameters.
    def mockedLatestPrice(self, token):
        return self.testUtil.util.database.getHistoryPrice(token, self.time)

    @mock.patch.object(Db, "getLatestPrice", side_effect=mockedLatestPrice)
    def testStrategyWithHistory(self, mock):
        strategy = Strategy(self.testUtil)
        for i in range(1, self.days, 1):
            for j in range(1, 1440, 1):
                logging.info(f"run day {i}, minute {j}:")
                strategy.runStrategy()
                self.nextTime()

i also tried it with side_effect=mockedLatestPrice(token) but it is not working.
do i need to use kwargs?
the error message i got is:
TypeError: Test.mockedLatestPrice() missing 1 required positional argument: 'token'

hope s.o. can help

A: I think the problem is that mockedLatestPrice is an instance method of the TestCase, but  when you pass it as side_effect=mockedLatestPrice that method is not yet bound (because TestCase class is not fully defined yet).
So the token is getting passed to self and the token arg is missing.
Try this:
    def testStrategyWithHistory(self):
        with mock.patch.object(
            Db, "getLatestPrice", side_effect=self.mockedLatestPrice
        ) as mock:
            strategy = Strategy(self.testUtil)
            for i in range(1, self.days, 1):
                for j in range(1, 1440, 1):
                    logging.info(f"run day {i}, minute {j}:")
                    strategy.runStrategy()
                    self.nextTime()


text:
Q: Tomcat 8 ERR_SSL_VERSION_OR_CIPHER_MISMATCH I have bought wildcard SSL from ssl2buy. installed it on my Tomcat 8  - server 2012 server, there I run my Java applications. After I insttaled the certificate I receive such error message : ERR_SSL_VERSION_OR_CIPHER_MISMATCH
support tolled me:
"Cipher and protocol issue is not related to SSL certificate, its about protocol and cipher settings. You should update the correct cipher security settings."
after telling me this support go offline and my ticket that I opened is not answered :D So maybe someone here will be able to help me.
this steps I used to create jks file:
keytool -genkey -alias ge.shemo -keyalg RSA -keystore shemo_wildcard

keytool -certreq -keyalg RSA -alias ge.shemo -file irakli.csr -keystore shemo_wildcard

keytool -importcert -file shemo_Wildcart.cer -keystore shemo_wildCard.jks -alias "ge.shemo"

Can someone please tell me what I have done wrong? or what I need to change?
UPDATED
I started everything from the begining:
Here are the steps I followed.

*

*bought certificate from ssl2buy.com

*generated csr :
keytool -keysize 3096 -genkey -alias *.shemo.ge -keyalg RSA -keystore tomcat8.keystore

pass: TesT123
keytool -certreq -keyalg RSA -alias *.shemo.ge -file tomcat8.csr -keystore tomcat8.keystore

Generated csr:
-----BEGIN NEW CERTIFICATE REQUEST-----
MIID4TCCAkYCAQAwZjELMAkGA1UEBhMCR0UxEDAOBgNVBAgTB3RiaWxpc2kxEDAOBgNVBAcTB3Ri
aWxpc2kxDjAMBgNVBAoTBXNoZW1vMQ4wDAYDVQQLEwVzaGVtbzETMBEGA1UEAwwKKi5zaGVtby5n
ZTCCAaUwDQYJKoZIhvcNAQEBBQADggGSADCCAY0CggGEAODEEKcJJ7AccanmeIIpAAG2ES6hCAIM
eiFe7WfJtFydDvGAUS9DhKpwW1CtYT3i0vhmbYZxxGc5FK9bHYtHwPtV/Yhptqi+xzk1eFkZxcvo
7dLNQGo73PfqPE1ikHrlyTffYB+/JEbBglxsem3tfjPpnb+SoiJ4sq5RFNB/Zm45etnlpdEnsRxC
dAEIUXzCaCnfR6nB5547BMOqmqTJxwB/BRoYLDmZoloJ/PsPTMIruKo7SzMQAkCLZ0J+S24Ihfei
95Y7n5XRxYdWOKBS5LUWJXpWEkiGmfP0ombV0l7YW2Fb/nJEjASLSNSliTE2yXRV4P8lT2BZbVL6
8O5UMCexD6Xa33n4HMn94ZsfnQuZSHF0YWYK9No6Cs2Tc9F0OR3dQlOj1Xht9Q5vmg/6B/ooRaJB
XmyJRPAxOe1WGzsr2ElbGu7CS9XMVY7VU+5fi3ojRbU1m0d7gLG6QEmuaR7Ti+wT28LUL44ezVtY
bOGW3peXxgw/SKm18D4ue+ArWTgwFQIDAQABoDAwLgYJKoZIhvcNAQkOMSEwHzAdBgNVHQ4EFgQU
BDAEJE34muDqTKxiUm30R+ZJW8cwDQYJKoZIhvcNAQELBQADggGEAHmu5dxjHgyh2BwDuqTN7l5t
oa+lQBQxDZBtZpduAulm3a2Dt8qELy3VF3IZLa2bWrG/91zoZWJCgCLva9uq7Yq9aUtJau0CebnJ
eWZ2XjiwJ/6ZvO12Y9Nc9oISFF9mswdXLOm7EHAXVfttRG4itgsNnTVziX2nynQPwN/1k9F4MysD
dVeBRyoY1QctWW1rj3cuZdz+vs4x9uWd+Wew4+GPzicq4hkGBLhvARP1WP0yUoU9+s60l6oqqFPY
prY/245XcXCEbiqtlMrnKFJ0quokpIgmb03ak1AyqDNTy6L1z1mKl3suQd0VR8TzLDEYp8j+lq3t
usOhT4SDMp4fPRcBCfFlmjpvGZ2lWZ3ewadldxifbG/xC4mAyLHHj9Px+/sU44gQ6qOk2rhYGI16
nsaHTADSYUfKOCzcZB7kPbG6rZojVLL8dpRNCfJdZWZXPRjMHBQWkdGaU6MbG2LUOKp5oB540QKX
3I/QR6g8fgN4JCuzAjxxbxlG42y4N5hsWhnt2Q==
-----END NEW CERTIFICATE REQUEST-----

Received certificate via Email. Created file called it tomcat8.cer with fllowing code
Received certificate:
-----BEGIN CERTIFICATE-----
MIIFSzCCBDOgAwIBAgISESHnxxQ9Z9905TDRC/T5a1nPMA0GCSqGSIb3DQEBCwUA
MEwxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMSIwIAYD
VQQDExlBbHBoYVNTTCBDQSAtIFNIQTI1NiAtIEcyMB4XDTE2MDIyMjE1NDIwNVoX
DTE3MDIyMDA3MzcyNFowODEhMB8GA1UECxMYRG9tYWluIENvbnRyb2wgVmFsaWRh
dGVkMRMwEQYDVQQDDAoqLnNoZW1vLmdlMIIBpTANBgkqhkiG9w0BAQEFAAOCAZIA
MIIBjQKCAYQA4MQQpwknsBxxqeZ4gikAAbYRLqEIAgx6IV7tZ8m0XJ0O8YBRL0OE
qnBbUK1hPeLS+GZthnHEZzkUr1sdi0fA+1X9iGm2qL7HOTV4WRnFy+jt0s1Aajvc
9+o8TWKQeuXJN99gH78kRsGCXGx6be1+M+mdv5KiIniyrlEU0H9mbjl62eWl0Sex
HEJ0AQhRfMJoKd9HqcHnnjsEw6qapMnHAH8FGhgsOZmiWgn8+w9Mwiu4qjtLMxAC
QItnQn5LbgiF96L3ljufldHFh1Y4oFLktRYlelYSSIaZ8/SiZtXSXthbYVv+ckSM
BItI1KWJMTbJdFXg/yVPYFltUvrw7lQwJ7EPpdrfefgcyf3hmx+dC5lIcXRhZgr0
2joKzZNz0XQ5Hd1CU6PVeG31Dm+aD/oH+ihFokFebIlE8DE57VYbOyvYSVsa7sJL
1cxVjtVT7l+LeiNFtTWbR3uAsbpASa5pHtOL7BPbwtQvjh7NW1hs4Zbel5fGDD9I
qbXwPi574CtZODAVAgMBAAGjggG2MIIBsjAOBgNVHQ8BAf8EBAMCBaAwSQYDVR0g
BEIwQDA+BgZngQwBAgEwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93d3cuZ2xvYmFs
c2lnbi5jb20vcmVwb3NpdG9yeS8wHwYDVR0RBBgwFoIKKi5zaGVtby5nZYIIc2hl
bW8uZ2UwCQYDVR0TBAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIw
PgYDVR0fBDcwNTAzoDGgL4YtaHR0cDovL2NybDIuYWxwaGFzc2wuY29tL2dzL2dz
YWxwaGFzaGEyZzIuY3JsMIGJBggrBgEFBQcBAQR9MHswQgYIKwYBBQUHMAKGNmh0
dHA6Ly9zZWN1cmUyLmFscGhhc3NsLmNvbS9jYWNlcnQvZ3NhbHBoYXNoYTJnMnIx
LmNydDA1BggrBgEFBQcwAYYpaHR0cDovL29jc3AyLmdsb2JhbHNpZ24uY29tL2dz
YWxwaGFzaGEyZzIwHQYDVR0OBBYEFAQwBCRN+Jrg6kysYlJt9EfmSVvHMB8GA1Ud
IwQYMBaAFPXN1TwIUPlqTzq3l9pWg+Zp0mj3MA0GCSqGSIb3DQEBCwUAA4IBAQB6
stii/rEwoUTd2dIqnwmYB6k6hH9Nn8VAsd1sLYNmK+LctDGLqc+uYyWcFbsDcWYA
aVd8OtxFLZWjubvj/RH+qQAonPNj2Q7zdk5KW05EaMtezGLPiPq1KT2Zw83xj20y
+lHRa+aZL7VoTgO0Ud86rpzKnVNHwG90k5HR9LtnsWNc56xzXOul/ws1d6gSGWi2
YOkMrPaDwJst84+hxPOv9ZHXJNos6QmX8eJXlQfIeRcFwc5/A3ghCvMO0Z3NdYdu
f7Lk92M/kPBz0aDgBSD9fH0lR1PcuPBDe972FwVieN7ynup2RVKPrpW13t1F2RmI
Xyk5F2qTpY588dTiMihC
-----END CERTIFICATE-----

Then did following :
keytool -import -alias root -keystore tomcat8.keystore -trustcacerts -file tomcat8.cer

keytool -import -alias intermed -keystore tomcat8.keystore -trustcacerts -file tomcat8.cer

keytool -importcert -file tomcat8.cer -keystore twix.jks -alias *.shemo.ge

Here is my connector:
 Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
           maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS" keystoreFile ="C:\Program Files (x86)\Java\jdk1.7.0_79\bin\twix.jks"  keystorePass="TesT123"/>

After all I restarted the server and still receive this eror:
ERR_SSL_VERSION_OR_CIPHER_MISMATCH

A: Let me try to give a general explanation for this issue:
A server usually supports different SSL protocol versions (SSLv3, TLS1.0, TLS1.1, TLS1.2), and a bunch of different ciphers.
During the handshake client and server negotiate one protocol version and one cipher to be used.
If there is a mismatch, that means your server is configured to only support TLS1.2, but your client is only capable of TLS1.0 for example, or that the client and server have not a single cipher that both support.
I never used Tomcat, but a quick look at https://tomcat.apache.org/tomcat-8.0-doc/security-howto.html tells me that the sslEnabledProtocols and ciphers arguments might be of interest to you:

The sslEnabledProtocols attribute determines which versions of the SSL/TLS protocol are used. Since the POODLE attack in 2014, all SSL protocols are considered unsafe and a secure setting for this attribute in a standalone Tomcat setup might be sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2"
The ciphers attribute controls the ciphers used for SSL connections. By default, the default ciphers for the JVM will be used. This usually means that the weak export grade ciphers will be included in the list of available ciphers. Secure environments will normally want to configure a more limited set of ciphers. This attribute accepts the OpenSSL syntax for including/excluding cipher suites. As of 2014-11-19, with standalone Tomcat 8 and Java 8, Forward Secrecy can be achieved by specifying only TLS protocols using the sslEnabledProtocols attribute (above) and excluding non-DH ciphers, and weak/broken ciphers. The Qualys SSL/TLS test is a useful tool for configuring these settings.

But since by default it already uses very conservative/compatible settings, I cannot really tell where the source of your issue is, maybe you have some global setting override somewhere. Also you have not mentioned which client you used to get that specific error code. Maybe just remove sslProtocol="TLS", assuming your client only supports SSLv3.

A: The answer @Nappy gave is correct and very useful. However it did not solve my problem, I got the same error message and in my case it was due to the private key not being loaded to my keystore. Because I always have a hard time installing SSL certificates to Tomcat on Windows, I found a solution for myself which might help others.
Because I have a wildcard certificate with the private key included (*.pfx). You can just install that certificate, add the path to that certificate in the server.xml and add the corresponding password to the file. Also add a line to declare the type of keystore between File and Pass:
keystoreFile="C:\Users\Your\Certificate.pfx"
keystoreType="pkcs12"
keystorePass="Password123" sslProtocol = "TLS"

To me this is way easier than installing everything to the Tomcat keystore with the keytool.
Hope this helps!

A: I had this problem recently, here is another possible solution.
My problem was in fact due to 2 things:

*

*Update Java 6, which doesn't support TLS 1.2, to Java 8 (1.8.0_333)

*Modified the server.xml of my Tomcat to force TLSv1.2

*

*Before: clientAuth="false" sslProtocol="TLS"

*After:  clientAuth="false" sslProtocol="TLS" sslEnabledProtocols="TLSv1.2"

Hope this might help someone that is having a similar problem resolve it quicker than I did .
Cheers.


text:
Q: Google Apps Script Slides add shadow to a shape I am trying to add a shadow to a shape in slides via the Google Apps Script Api for slides.
I followed https://developers.google.com/slides/reference/rest/v1/presentations.pages/other#Page.Shadow
This is my updateShapeRequest object
{
      "updateShapeProperties":{
        "objectId":pageElementId,
        "shapeProperties":{

          "shadow":{
            "alignment": "RECTANGLE_POSITION_UNSPECIFIED",
            "alpha":0.5,
            "blurRadius":{"unit":"EMU"},
            "color":{
              "rgbColor": {
                  "red":0,
                  "green":0,
                  "blue":0
               },
            },
              "propertyState":"RENDERED",
              "rotateWithShape": false,
              "transform": {
                "scaleX": 1.5,
                "scaleY": 1.5,
                "unit": "PT"
              }
          }
        },
        "fields":"shadow"
      }
    }

But it doesnt work. Any help is greatly appreciated.

A: The official document says as follows.

shadow: The shadow properties of the shape. If unset, the shadow is inherited from a parent placeholder if it exists. If the shape has no parent, then the default shadow matches the defaults for new shapes created in the Slides editor. This property is read-only. Ref

From this, in the current stage, shadow of ShapeProperties is the read-only. By this, unfortunately, the shadow cannot be added using UpdateShapePropertiesRequest with the batchUpdate method of Slides API. And also, in this case, in the current stage, Slides service cannot also achieve this.
So, how about requesting this as the future request to the issue tracker?
References:

*

*UpdateShapePropertiesRequest

*shapeProperties


text:
Q: Android (Kotlin): text now showing after I set it Playing around with Android and following this simple introduction but I can't get the line resultsTextView.text = rand.toString() to trigger. Not sure what I'm missing.
The main Kotlin code looks like this (MainActivity.kt):
package io.github.ovid.randomizer

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button
import android.widget.SeekBar
import android.widget.TextView
import kotlin.random.Random

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val rollButton = findViewById<Button>(R.id.rollButton)
        val resultsTextView = findViewById<TextView>(R.id.resultsTextView)
        val seekBar = findViewById<SeekBar>(R.id.seekBar)

        rollButton.setOnContextClickListener {
            val rand = Random.nextInt(seekBar.progress) + 1
            resultsTextView.text = rand.toString()
            true
        }
    }
}

And my activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    <Button
        android:id="@+id/rollButton"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="96dp"
        android:layout_marginLeft="96dp"
        android:layout_marginEnd="96dp"
        android:layout_marginRight="96dp"
        android:layout_marginBottom="24dp"
        android:text="Roll"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <SeekBar
        android:id="@+id/seekBar"
        style="@style/Widget.AppCompat.SeekBar.Discrete"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="32dp"
        android:layout_marginLeft="32dp"
        android:layout_marginEnd="32dp"
        android:layout_marginRight="32dp"
        android:layout_marginBottom="24dp"
        android:max="10"
        android:progress="3"
        app:layout_constraintBottom_toTopOf="@+id/rollButton"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="24dp"
        android:layout_marginLeft="24dp"
        android:layout_marginBottom="16dp"
        android:text="How Many"
        app:layout_constraintBottom_toTopOf="@+id/seekBar"
        app:layout_constraintStart_toStartOf="parent" />

    <View
        android:id="@+id/divider"
        android:layout_width="409dp"
        android:layout_height="1dp"
        android:layout_marginBottom="16dp"
        android:background="?android:attr/listDivider"
        app:layout_constraintBottom_toTopOf="@+id/textView"
        tools:layout_editor_absoluteX="1dp" />

    <TextView
        android:id="@+id/resultsTextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="0dp"
        android:layout_marginLeft="0dp"
        android:textAppearance="@style/TextAppearance.AppCompat.Large"
        android:textSize="144sp"
        app:layout_constraintBottom_toTopOf="@+id/divider"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

Everything on the layout in the emulator looks correct, but pressing the "Roll" button shows I clicked the button, but no text shows up in the resultsTextView.

A: D'oh! It was setOnClickListener, not setOnContextClickListener. Made the change and removed the true at the end and it worked fine. Sorry for the noise.

A: Just replace the event method from setOnContextClickListener to setOnClickListener, an it will work fine. Just like this:
rollButton.setOnClickListener {
        val rand = Random.nextInt(seekBar.progress) + 1
        resultsTextView.text = rand.toString()
    }


text:
Q: How can I make sense of black hole complementarity if the universe consist of one manifold and observers are not married to coordinates? I'm reaching way over my head here, so bare in mind my knowledge base is at best upper undergraduate. This is, unfortunately, yet another byproduct of discussions in this page that is itself a byproduct of another question.
User benrg says,

Judging from this and some other comments, safesphere believes that different observers occupy different "private universes," and it can be true in one observer's coordinate system that an object crosses the horizon and in another's that it never does. That simply isn't true.

Then commenter Accumulation replies,

If it is untrue, it being untrue certainly isn't simple. According to black hole complementarianism, to the outside observer, nothing ever crosses the event horizon. To an infalling observer, they do cross the event horizon.

I know black hole complementarity is only a rough postulate, but I'm not sure how to make sense of it. If the universe, including those having black holes, consists of one spacetime manifold, does that not mean there is only one possible account of what happens?
Yes, the event horizon allows us to have events that are causally disconnected, but they lie on the same manifold so they can't occupy different universes.
Suppose I throw a rock radially into the black hole.
There are at least two different descriptions of what happens according to different coordinates.

*

*According to the Schwarzschild coordinates, the rock goes in slower and slower inward (according to the Schwarzschild $r$ and $t$) and it reaches the event horizon only at $t\rightarrow\infty$.

*According to the Kruskal–Szekeres coordinates, the rock passes the event horizon like nothing happened with finite Kruskal–Szekeres coordinates.

Now both descriptions are true, because the difference is a matter of coordinates. So far so good.
Here is my problem: observers are not coordinate systems. An outside observer does not occupy Schwarzschild coordinates and an observer is not married to Schwarzschild coordinates. An observer occupies a coordinate-independent universe modeled by a spacetime manifold.
Moreover, an observer does not experience Schwarzschild coordinates. The only thing an observer experiences is his worldline and all the photons that reach him. That's it. So in that case, it makes no sense to identify a person with any coordinate system.
Question: Are my statements correct so far?
Now, this leads me to the follow conundrum: black hole complementarity says that to an outside distant observer, an infalling object never gets past the event horizon. What I don't understand is what does it even mean to say, "to an outside distant observer [this thing] happens?" Like I said above, the only thing an observer experiences is his worldline and all the photons that reach him.
Moreover, can't a distant observer decide to use Kruskal–Szekeres coordinates in his or her calculations to conclude that the object does fall past the event horizon with no issues whatsoever.
Question: How can black hole complementarity make sense if a distant outside observer is not married to any particular coordinate system AND he or she can simply choose coordinates that extend past the EV?
Question: Is there a more precise phrasing of black hole complementarity that would clear up my confusion?

A: Black hole complementarity is supposed to be a duality like AdS/CFT. That is, the physics on the boundary (event horizon) and the physics in the bulk (black hole interior) are supposed to be the same physics described in different coordinate systems, though the coordinate systems are bases for something like a quantum Hilbert space rather than charts on a manifold.
I don't think it's impossible that a theory could be subjective in the sense that whether a black hole interior exists or not depends on whether or not you fall in – i.e., there are different worlds like those of many-worlds/relative-state QM, but you choose which one you end up in by your spacetime motion instead of being duplicated in all of them – but black hole complementarity isn't an idea of that kind.
(And my other answer was about classical general relativity, where there isn't any horizon complementarity, much less private universes.)

How can black hole complementarity make sense if a distant outside observer is not married to any particular coordinate system AND he or she can simply choose coordinates that extend past the EH?

If complementarity is correct, then anyone, even if they've fallen through the horizon, is free to pick a boundary or bulk description of the interior, since they're equivalent.


text:
Q: How do I cast a dependency property in {x:bind}? The documentation for {X:bind} mentions that casting in a property path is possible (the mention {x:Bind obj.(TextBox.Text)}) as example. I can't see how this should work in the following simple example. I tried various combinations of the type name in parens, but no success.
A common use case would be a two-way binding for a combobox, here I would cast the SelectedValue property from the generic object type to a more specifc type.
Example xaml page MainPage.xaml:
<Page
    x:Class="XBindTest4.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:XBindTest4"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" >

    <StackPanel>
        <ComboBox ItemsSource="{x:Bind SampleList, Mode=OneWay}"
                  SelectedValue="{x:Bind SampleData, Mode=TwoWay}"/>
    </StackPanel>

</Page>

Code behind MainPage.xaml.cs:
using System.Collections.ObjectModel;
using Windows.UI.Xaml.Controls;

namespace XBindTest4 {

    public class SampleClass {
    }

    public sealed partial class MainPage : Page {

        public ObservableCollection<SampleClass> SampleList = new ObservableCollection<SampleClass>(new[] {
            new SampleClass(),
            new SampleClass()
            });

        public SampleClass SampleData { get; set; }

        public MainPage() {
            this.InitializeComponent();
        }
    }
}

A: Currently, this is not possible with the existing syntax possiblities. That's bad because it adds unnecessary and repeating code to the binding expression: to use {x:Bind} in such a scenario, a converter has to be specified, even if it does nothing.
...
SelectedValue="{x:Bind SampleData, Mode=TwoWay, Converter={StaticResource NoOpConverter}}
...

If a converter is used, the apropriate cast is inserted into the generated file MainPage.g.cs:
this.dataRoot.SampleData = (global::XBindTest4.SampleClass)this.LookupConverter("NoOpConverter").ConvertBack((this.obj2).SelectedValue, typeof(global::XBindTest4.SampleClass), null, null);

Additional sources:
NoOpConverter.cs:
using System;
using Windows.UI.Xaml.Data;

namespace XBindTest4 {

    public class NoOpConverter : IValueConverter {
        public object Convert(object value, Type targetType, object parameter, string language)
            => value;

        public object ConvertBack(object value, Type targetType, object parameter, string language)
            => value;

    }
}

Register the converter in App.xaml:
<Application
    x:Class="XBindTest4.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:XBindTest4"
    RequestedTheme="Light">

    <Application.Resources>
        <ResourceDictionary>
            <local:NoOpConverter x:Key="NoOpConverter"/>
        </ResourceDictionary>
    </Application.Resources>

</Application>

MainPage.xaml.cs:
<Page
    x:Class="XBindTest4.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:XBindTest4"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" >

    <StackPanel>
        <ComboBox ItemsSource="{x:Bind SampleList, Mode=OneWay}"
                  SelectedValue="{x:Bind SampleData, Mode=TwoWay, Converter={StaticResource NoOpConverter}}"/>
    </StackPanel>
</Page>