问:
Redirect stdout and stderr to file permanently but keep printing them
By doing the following(1):

```<code> exec >> log_file
 exec 2>&1
 ls
</code>```

stdout and stderr is permanently redirected for the next commands but not anymore displayed on terminal. Here, ls output will be in log_file but not displayed in terminal

By doing the following(2):

```<code>command | tee log_file
</code>```

command output will be both in log_file and printed on terminal but this will work only for command and not for the next commands as method 1.

How to redirect permanently stdout and stderr output in a file for a given terminal like method 1 and, keep stdout and stderr printed on the terminal instance like method 2 ?

答:
I currently use this in my scripts:

```<code>exec > >(tee -a "${FILE_Log}" )
exec 2> >(tee -a "${FILE_Log}" >&2)
</code>```

Basically you are telling bash to send the output (both stdout and stderr) to tee's stdin, and since tee is running in the subshell (within the parentheses), it will live as long as your script does.

Put that somewhere near the top, then any and all command output, echo, print, and, printf will be logged.

This saves having to create a LOG() function and constantly piping commands to tee

Hope that helps!

Body:
By doing the following(1):

 exec >> log_file
 exec 2>&1
 ls

stdout and stderr is permanently redirected for the next commands but not anymore displayed on terminal. Here, ls output will be in log_file but not displayed in terminal

By doing the following(2):

command | tee log_file

command output will be both in log_file and printed on terminal but this will work only for command and not for the next commands as method 1.

How to redirect permanently stdout and stderr output in a file for a given terminal like method 1 and, keep stdout and stderr printed on the terminal instance like method 2 ?

Body:
I currently use this in my scripts:

exec > >(tee -a "${FILE_Log}" )
exec 2> >(tee -a "${FILE_Log}" >&2)

Basically you are telling bash to send the output (both stdout and stderr) to tee's stdin, and since tee is running in the subshell (within the parentheses), it will live as long as your script does.

Put that somewhere near the top, then any and all command output, echo, print, and, printf will be logged.

This saves having to create a LOG() function and constantly piping commands to tee

Hope that helps!


来源: stackexchange

问:
How do I set up git so that I get a message through gchat or aim that someone pushed onto the server?
What do I need to set up the server so that I get an update message through gchat/aim? Do I just set up a client on the server and use a hook combined with a script? </p>

答: yes. all you need to do is make sure you have a command-line way of using your instant messenger application.</p>

ContentLicense: CC BY-SA 2.5


问:
iOS core-bluetooth Dynamic Scan Response data
Using a BLE113 I have been successfully using kCBAdvDataLocalName, in the scan response, to contain dynamically changing data from a sensor. This is then picked up nicely in an iOS App. iOS interprets the data associated with
kCBAdvDataLocalName as a string which has its limitations. I need to send more data and cannot afford the space lost in encoding to ASCII.

Does anyone have recommendations for the sending of Raw data in Scan Responses?

答:
You can send out this data as an advertising packet (scan responses end up using more power, if I recall correctly).

An advertising packet, using a manufacturing ID of 0xff should allow you access to 31 bytes of data for you to use for whatever you want.

Check out the iBeacon examples here: https://github.com/sureshjoshi/ble113-firmware-examples

Similar concept.

If you're insistent on the local name, what is the encoding issue? If you're sending bytes of data, a string is just a set of bytes - so where are you losing data by encoding?

ContentLicense: CC BY-SA 3.0


问:
I wanted to take datas from database and also change the query dynamically and store the id from database in an array and use then to call a function
I am new to PHP, can anyone help me out in this. What I am trying to do is call a function which fetch id from a table and store id in an array, then calling another method in a loop in such a way that the array elements should be parameter which is passing in function. </p>

```<code><?php

include 'connection.php';

$releaseidarr=array();

function getreleaseid($p)
{
    $releaseid=array();
    $releaseidp="select release_id from `release` where project_id=".$p.";";
    $query4=mysql_query($GLOBALS['db'],$releaseidp);
    while($row=mysqli_fetch_array($query4))
    {
        $releaseid[]=$row['release_id'];
    }
    return $releaseid;

}
$p=1;
while($p<8)
{
    //echo "hi";
    $releaseidarr=getreleaseid($p);
    echo $releaseidarr[$p];
    $p++;
}

?>

Connection.php contains

<?php

$GLOBALS['server']="******";
$GLOBALS['username']="*****";
$GLOBALS['password']="****";
$GLOBALS['database']="dashtest";

$GLOBALS['conn']= mysqli_connect($server,$username,$password,$database);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
//echo "Connected successfully";

$GLOBALS['db'] = mysqli_connect($server,$username,$password,$database);
//echo "connected";

?>
</code>```

答:
Here Don't use both mysql and mysqli. Only use to write in mysqli.
and in foreach loop use array push method. first declare one empty array like</p>

```<code>$array = [];
foreach($a as $k){
array_push($array,$k);
}
return $array;
</code>```

Body:
I am new to PHP, can anyone help me out in this. What I am trying to do is call a function which fetch id from a table and store id in an array, then calling another method in a loop in such a way that the array elements should be parameter which is passing in function.

<?php

include 'connection.php';

$releaseidarr=array();

function getreleaseid($p)
{
    $releaseid=array();
    $releaseidp="select release_id from `release` where project_id=".$p.";";
    $query4=mysql_query($GLOBALS['db'],$releaseidp);
    while($row=mysqli_fetch_array($query4))
    {
        $releaseid[]=$row['release_id'];
    }
    return $releaseid;

}
$p=1;
while($p<8)
{
    //echo "hi";
    $releaseidarr=getreleaseid($p);
    echo $releaseidarr[$p];
    $p++;
}

?>

Connection.php contains

<?php

$GLOBALS['server']="******";
$GLOBALS['username']="*****";
$GLOBALS['password']="****";
$GLOBALS['database']="dashtest";

$GLOBALS['conn']= mysqli_connect($server,$username,$password,$database);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
//echo "Connected successfully";

$GLOBALS['db'] = mysqli_connect($server,$username,$password,$database);
//echo "connected";

?>

Body:
Here Don't use both mysql and mysqli. Only use to write in mysqli.
and in foreach loop use array push method. first declare one empty array like

$array = [];
foreach($a as $k){
array_push($array,$k);
}
return $array;


问:
clapack import error (from Scipy)
I'm having problems with the importation of some libraries from Scipy. I got this error.

```<code>>>> from scipy import interpolate
 in <module>
    from scipy.linalg import clapack
ImportError: /usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so: undefined symbol: clapack_sgesv
</code>```

I believe that it could be happen because I have some libraries installed in /usr/lib and anothers in /usr/local/lib and it seems that they are not linked. I have tried to do it with LD_PATH and also changing /etc/ld.so.config but nothing works.

If I type ldd command (for clapack.so), I got this:

```<code>ldd -r /usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so
        /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0xb6f71000)
        liblapack.so.3 => /usr/lib/liblapack.so.3 (0xb68ff000)
        libatlas.so.3 => /usr/lib/libatlas.so.3 (0xb663b000)
        libgfortran.so.3 => /usr/lib/arm-linux-gnueabihf/libgfortran.so.3 (0xb6593000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6522000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb64fa000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb63c6000)
        libblas.so.3 => /usr/lib/libblas.so.3 (0xb60d1000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb60b2000)
        /lib/ld-linux-armhf.so.3 (0xb6fae000)
undefined symbol: PyExc_ImportError     (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyExc_ValueError      (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyExc_TypeError       (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyComplex_Type        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyExc_RuntimeError    (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyType_Type   (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: _Py_NoneStruct        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyExc_AttributeError  (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyCObject_Type        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_sgesv (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_dgesv (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_cgesv (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_zgesv (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_sposv (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_dposv (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_cposv (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_zposv (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_spotrf        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_dpotrf        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_cpotrf        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_zpotrf        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_spotrs        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_dpotrs        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_cpotrs        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_zpotrs        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_spotri        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_dpotri        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_cpotri        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_zpotri        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_slauum        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_dlauum        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_clauum        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_zlauum        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_strtri        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_dtrtri        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_ctrtri        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_ztrtri        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyDict_SetItemString  (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyString_AsString     (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyMem_Free    (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyCObject_FromVoidPtr (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyErr_NoMemory        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: _PyObject_New (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyOS_snprintf (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyString_FromStringAndSize    (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: Py_FindMethod (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyErr_Format  (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyErr_Occurred        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyArg_ParseTupleAndKeywords   (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyString_FromString   (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyString_FromFormat   (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyModule_GetDict      (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PySequence_GetItem    (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyCObject_AsVoidPtr   (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyType_IsSubtype      (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PySequence_Check      (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: Py_BuildValue (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyObject_GetAttrString        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyErr_NewException    (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyDict_GetItemString  (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyErr_Print   (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyString_ConcatAndDel (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyDict_DelItemString  (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: Py_InitModule4        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyImport_ImportModule (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyErr_Clear   (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyErr_SetString       (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyNumber_Int  (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyMem_Malloc  (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyDict_New    (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
</code>```

I have tried to install diferent versions of SciPy but neither this way fixes the problem.

答:
Ok. I have fixed the problem with this commands obtained from ldd other question (undefined symbol: clapack_sgesv)

```<code>update-alternatives --config liblapack.so.3
update-alternatives --config libblas.so.3
</code>```

I just needed to change the default configuration of liblapack.so.3 and it works.

Title: clapack import error (from Scipy)

Body:
I'm having problems with the importation of some libraries from Scipy. I got this error.

>>> from scipy import interpolate
 in <module>
    from scipy.linalg import clapack
ImportError: /usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so: undefined symbol: clapack_sgesv

I believe that it could be happen because I have some libraries installed in /usr/lib and anothers in /usr/local/lib and it seems that they are not linked. I have tried to do it with LD_PATH and also changing /etc/ld.so.config but nothing works.

If I type ldd command (for clapack.so), I got this:

ldd -r /usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so
        /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0xb6f71000)
        liblapack.so.3 => /usr/lib/liblapack.so.3 (0xb68ff000)
        libatlas.so.3 => /usr/lib/libatlas.so.3 (0xb663b000)
        libgfortran.so.3 => /usr/lib/arm-linux-gnueabihf/libgfortran.so.3 (0xb6593000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6522000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb64fa000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb63c6000)
        libblas.so.3 => /usr/lib/libblas.so.3 (0xb60d1000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb60b2000)
        /lib/ld-linux-armhf.so.3 (0xb6fae000)
undefined symbol: PyExc_ImportError     (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyExc_ValueError      (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyExc_TypeError       (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyComplex_Type        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyExc_RuntimeError    (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyType_Type   (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: _Py_NoneStruct        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyExc_AttributeError  (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyCObject_Type        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_sgesv (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_dgesv (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_cgesv (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_zgesv (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_sposv (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_dposv (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_cposv (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_zposv (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_spotrf        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_dpotrf        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_cpotrf        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_zpotrf        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_spotrs        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_dpotrs        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_cpotrs        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_zpotrs        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_spotri        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_dpotri        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_cpotri        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_zpotri        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_slauum        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_dlauum        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_clauum        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_zlauum        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_strtri        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_dtrtri        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_ctrtri        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: clapack_ztrtri        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyDict_SetItemString  (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyString_AsString     (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyMem_Free    (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyCObject_FromVoidPtr (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyErr_NoMemory        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: _PyObject_New (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyOS_snprintf (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyString_FromStringAndSize    (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: Py_FindMethod (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyErr_Format  (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyErr_Occurred        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyArg_ParseTupleAndKeywords   (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyString_FromString   (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyString_FromFormat   (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyModule_GetDict      (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PySequence_GetItem    (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyCObject_AsVoidPtr   (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyType_IsSubtype      (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PySequence_Check      (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: Py_BuildValue (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyObject_GetAttrString        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyErr_NewException    (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyDict_GetItemString  (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyErr_Print   (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyString_ConcatAndDel (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyDict_DelItemString  (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: Py_InitModule4        (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyImport_ImportModule (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyErr_Clear   (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyErr_SetString       (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyNumber_Int  (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyMem_Malloc  (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)
undefined symbol: PyDict_New    (/usr/local/lib/python2.7/site-packages/scipy/linalg/clapack.so)

I have tried to install diferent versions of SciPy but neither this way fixes the problem.

Body:
Ok. I have fixed the problem with this commands obtained from ldd other question (undefined symbol: clapack_sgesv)

update-alternatives --config liblapack.so.3
update-alternatives --config libblas.so.3

I just needed to change the default configuration of liblapack.so.3 and it works.


问:
What happens if Var args method also exists with overloaded methods exists in a Java method
Here is a program with method overloading done.

```<code>package com.tests;
public class BasicClass {

    public void getMe(Object a) {
        System.out.println("getMe 1");
    }

    public void getMe(Object a, Object b) {
        System.out.println("getMe 2");
    }

    public void getMe(Object a, Object b, Object c) {
        System.out.println("getMe 3");
    }

    public void getMe(Object a, Object b, Object c, Object d) {
        System.out.println("getMe 4");
    }

    public void getMe(Object... parms) {
        System.out.println("getMe 5");
    }
}
</code>```

What is the exact benefit do we get with this type of polymorphism..?

答:
This is often done for optimization. It allows common operations (providing up to four values) to be performed without creating an array, whilst still giving the flexibility of allowing an arbitrary number of arguments.

To give a concrete, suppose we didn't have the first four overloads. In that case,

```<code>instance.getMe("a", "b");
</code>```

would be converted by the compiler into:

```<code>instance.getMe(new Object[] { "a", "b" });
</code>```

If the implementation doesn't need the arguments in an array, it's nice to avoid that array creation.

Body:
Here is a program with method overloading done.

package com.tests;
public class BasicClass {

    public void getMe(Object a) {
        System.out.println("getMe 1");
    }

    public void getMe(Object a, Object b) {
        System.out.println("getMe 2");
    }

    public void getMe(Object a, Object b, Object c) {
        System.out.println("getMe 3");
    }

    public void getMe(Object a, Object b, Object c, Object d) {
        System.out.println("getMe 4");
    }

    public void getMe(Object... parms) {
        System.out.println("getMe 5");
    }
}

What is the exact benefit do we get with this type of polymorphism..?

Body:
This is often done for optimization. It allows common operations (providing up to four values) to be performed without creating an array, whilst still giving the flexibility of allowing an arbitrary number of arguments.

To give a concrete, suppose we didn't have the first four overloads. In that case,

instance.getMe("a", "b");

would be converted by the compiler into:

instance.getMe(new Object[] { "a", "b" });

If the implementation doesn't need the arguments in an array, it's nice to avoid that array creation.


问:
MVC Model require true
Is there a way through data annotations to require that a boolean property be set to true?</p>

```<code>public class MyAwesomeObj{
    public bool ThisMustBeTrue{get;set;}
}
</code>```

答:
You could create your own validator:</p>

```<code>public class IsTrueAttribute : ValidationAttribute
{
    #region Overrides of ValidationAttribute

    /// <summary>
    /// Determines whether the specified value of the object is valid.
    /// </summary>
    /// <returns>
    /// true if the specified value is valid; otherwise, false.
    /// </returns>
    /// <param name="value">The value of the specified validation object on which the <see cref="T:System.ComponentModel.DataAnnotations.ValidationAttribute"/> is declared.
    ///                 </param>
    public override bool IsValid(object value)
    {
        if (value == null) return false;
        if (value.GetType() != typeof(bool)) throw new InvalidOperationException("can only be used on boolean properties.");

        return (bool) value;
    }

    #endregion
}
</code>```

Title: MVC Model require true

Body:
Is there a way through data annotations to require that a boolean property be set to true?

public class MyAwesomeObj{
    public bool ThisMustBeTrue{get;set;}
}

Body:
You could create your own validator:

public class IsTrueAttribute : ValidationAttribute
{
    #region Overrides of ValidationAttribute

    /// <summary>
    /// Determines whether the specified value of the object is valid.
    /// </summary>
    /// <returns>
    /// true if the specified value is valid; otherwise, false.
    /// </returns>
    /// <param name="value">The value of the specified validation object on which the <see cref="T:System.ComponentModel.DataAnnotations.ValidationAttribute"/> is declared.
    ///                 </param>
    public override bool IsValid(object value)
    {
        if (value == null) return false;
        if (value.GetType() != typeof(bool)) throw new InvalidOperationException("can only be used on boolean properties.");

        return (bool) value;
    }

    #endregion
}


问:
Queue shapes must have the same length as dtypes
Im trying to initialize a FIFOQueue similar to the shape of my numpy array
but get the below error.

My - numpy array shape - (1, 17428, 3)

```<code>dtypes=[tf.float32,tf.float32,tf.float32]
print len(dtypes)
shapes=[1, 17428, 3]
print len(shapes)
q = tf.FIFOQueue(capacity=200,dtypes=dtypes,shapes=shapes)

ValueError: Queue shapes must have the same length as dtypes
</code>```

答:
The documentation specifies that the parameters for FIFOQueue's constructor are (emphasis mine):

dtypes: A list of DType objects. The length of dtypes must equal the number of tensors in each queue element.

shapes: (Optional.) A list of fully-defined TensorShape objects with the same length as dtypes, or None.

What you are specifying as shapes is not a list of fully-defined TensorShape objects, though. It is a list of three dimensions that will be interpreted as one TensorShape resulting in shapes=[TensorShape([Dimension(1), Dimension(17428), Dimension(3)])] which is of length 1. To tell the constructor that you want three 1D tensors you can specify:

```<code>shapes=[tf.TensorShape(1), tf.TensorShape(17428), tf.TensorShape(3)]
</code>```

Then q = tf.FIFOQueue(capacity=200,dtypes=dtypes,shapes=shapes) will run and no error will be raised.

Body:
Im trying to initialize a FIFOQueue similar to the shape of my numpy array
but get the below error.

My - numpy array shape - (1, 17428, 3)

dtypes=[tf.float32,tf.float32,tf.float32]
print len(dtypes)
shapes=[1, 17428, 3]
print len(shapes)
q = tf.FIFOQueue(capacity=200,dtypes=dtypes,shapes=shapes)

ValueError: Queue shapes must have the same length as dtypes

Body:
The documentation specifies that the parameters for FIFOQueue's constructor are (emphasis mine):

dtypes: A list of DType objects. The length of dtypes must equal the number of tensors in each queue element.

shapes: (Optional.) A list of fully-defined TensorShape objects with the same length as dtypes, or None.

What you are specifying as shapes is not a list of fully-defined TensorShape objects, though. It is a list of three dimensions that will be interpreted as one TensorShape resulting in shapes=[TensorShape([Dimension(1), Dimension(17428), Dimension(3)])] which is of length 1. To tell the constructor that you want three 1D tensors you can specify:

shapes=[tf.TensorShape(1), tf.TensorShape(17428), tf.TensorShape(3)]

Then q = tf.FIFOQueue(capacity=200,dtypes=dtypes,shapes=shapes) will run and no error will be raised.


问:
Console.WriteLine does not work when attached to process in VS
If I have a code in C# .NET (winforms) which contains a Console.WriteLine("TEST"); and visual studio is attached to the process it doesn't write "TEST" in the output window.
(application is correctly attached)

If I start my program normal with visual studio, it works.

Why does it not work in the first case?

答:
Visual Studio, when debugging windows programs (/target:winexe) will launch them with the  stdout and stderr redirected to Named Pipes. The other end of the named pipe is owned by the VS debugger and anything read on these pipes (ie. anything written by the app to stdout or stderr) will be displayed in the Debug Output window (which by no means is the debugged application Output window).

When attach to an application, this redirect can no longer be done (obviously, since the application is already started and stderr and stdin cannot be redirected post-factum). So the Console.Write is no longer auto-magically redirected to the Debug output.

Note that this stdout/stderr redircetion does not occur for console programs (/target:exe)

But there is a dedicated API to write Debug info: Debug.Write. This uses the OutputDebugString functions, which sends text to the attached debugger (if any). This works no matter when or how the debugger is attached, as is not dependent upon stdout/stderr redirection tricks.

Replace your Console.Write with Debug.Write.


问:
I am getting UnsatisfiedDependencyException in my project
I am getting UnsatisfiedDependencyException in project
and i have used all jars related with spring-mvc spring-tx hibernate mysql connector and all by using maven tool

type Exception report

```<code>    message Servlet.init() for servlet kichha threw exception

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

    exception

    javax.servlet.ServletException: Servlet.init() for servlet kichha threw exception
        org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
        org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
        org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
        org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
        org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
        org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
        java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        java.lang.Thread.run(Unknown Source)
    root cause

    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'feedbackDao': Unsatisfied dependency expressed through field 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/kichha-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.applyClassLoader(Ljava/lang/ClassLoader;)Lorg/hibernate/boot/registry/BootstrapServiceRegistryBuilder;
        org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)
        org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
        org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
        org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
        org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
</code>```

In sts spring tool detail log message

```<code>Nov 15, 2017 4:59:48 AM org.apache.tomcat.util.digester.SetPropertiesRule beginWARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:hebbuli' did not find a matching property.
Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version:        Apache Tomcat/7.0.81
Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          Aug 11 2017 10:21:27 UTC
Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number:         7.0.81.0
Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:Windows 8.1Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            6.3
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Architecture:          x86
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Java Home:             C:\Program Files\Java\jre1.8.0_20
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: JVM Version:           1.8.0_20-b26
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: JVM Vendor:            Oracle Corporation
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: CATALINA_BASE:         C:\Users\admin\Documents\LiveProjectWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: CATALINA_HOME:         C:\tomcat7
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dcatalina.base=C:\Users\admin\Documents\LiveProjectWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dcatalina.home=C:\tomcat7
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dwtp.deploy=C:\Users\admin\Documents\LiveProjectWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Djava.endorsed.dirs=C:\tomcat7\endorsed
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dfile.encoding=Cp1252
    Nov 15, 2017 4:59:48 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_20\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_20/bin/client;C:/Program Files/Java/jre1.8.0_20/bin;C:/Program Files/Java/jre1.8.0_20/lib/i386;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;;C:\endlessjourny\sts\sts-bundle\sts-3.9.1.RELEASE;;.
    Nov 15, 2017 4:59:49 AM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["http-bio-8080"]
    Nov 15, 2017 4:59:49 AM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
    Nov 15, 2017 4:59:49 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 2040 ms
    Nov 15, 2017 4:59:49 AM org.apache.catalina.core.StandardService startInternal
    INFO: Starting service Catalina
    Nov 15, 2017 4:59:49 AM org.apache.catalina.core.StandardEngine startInternal
    INFO: Starting Servlet Engine: Apache Tomcat/7.0.81
    Nov 15, 2017 4:59:56 AM org.apache.catalina.startup.TldConfig execute
    INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
    Nov 15, 2017 4:59:56 AM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
      at java.lang.Thread.run(Unknown Source)
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/kichha-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.applyClassLoader(Ljava/lang/ClassLoader;)Lorg/hibernate/boot/registry/BootstrapServiceRegistryBuilder;
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
      at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)
      ... 37 more
    Caused by: java.lang.NoSuchMethodError: org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.applyClassLoader(Ljava/lang/ClassLoader;)Lorg/hibernate/boot/registry/BootstrapServiceRegistryBuilder;
      at org.springframework.orm.hibernate5.LocalSessionFactoryBean.getMetadataSources(LocalSessionFactoryBean.java:362)
      at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:399)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
      ... 47 more

    Nov 15, 2017 5:00:32 AM org.apache.catalina.core.ApplicationContext log
    SEVERE: StandardWrapper.Throwable
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'feedbackDao': Unsatisfied dependency expressed through field 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/kichha-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.applyClassLoader(Ljava/lang/ClassLoader;)Lorg/hibernate/boot/registry/BootstrapServiceRegistryBuilder;
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)
      at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
      at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)
      at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634)
      at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682)
      at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553)
      at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494)
      at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:138)
      at javax.servlet.GenericServlet.init(GenericServlet.java:158)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1269)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1182)
      at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:853)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Unknown Source)
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/kichha-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.applyClassLoader(Ljava/lang/ClassLoader;)Lorg/hibernate/boot/registry/BootstrapServiceRegistryBuilder;
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
      at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)
      ... 37 more
    Caused by: java.lang.NoSuchMethodError: org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.applyClassLoader(Ljava/lang/ClassLoader;)Lorg/hibernate/boot/registry/BootstrapServiceRegistryBuilder;
      at org.springframework.orm.hibernate5.LocalSessionFactoryBean.getMetadataSources(LocalSessionFactoryBean.java:362)
      at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:399)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
      ... 47 more

    Nov 15, 2017 5:00:32 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Allocate exception for servlet kichha
    java.lang.NoSuchMethodError: org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.applyClassLoader(Ljava/lang/ClassLoader;)Lorg/hibernate/boot/registry/BootstrapServiceRegistryBuilder;
      at org.springframework.orm.hibernate5.LocalSessionFactoryBean.getMetadataSources(LocalSessionFactoryBean.java:362)
      at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:399)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
      at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
</code>```

org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
          at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
          at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)
          at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634)
          at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682)
          at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553)
          at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494)
          at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:138)
          at javax.servlet.GenericServlet.init(GenericServlet.java:158)
          at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1269)
          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1182)
          at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:853)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)

spring configuration file(kichha-servlet.xml)

```<code>    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:mvc="http://www.springframework.org/schema/mvc"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
            http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
            http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">

        <context:component-scan base-package="com.kichha.hebbuli"></context:component-scan>

    <bean id="myDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
            destroy-method="close">
            <property name="driverClass" value="com.mysql.jdbc.Driver"/>
            <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/telusko"/>
            <property name="user" value="root" />
            <property name="password" value="root" />

            <property name="maxPoolSize" value="20" />
            <property name="minPoolSize" value="5" />
            <property name="maxIdleTime" value="30000" />
    </bean>

    <bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
            <property name="dataSource" ref="myDataSource" />
            <property name="packagesToScan" value="com.kichha.hebbuli.entity" />
            <property name="hibernateProperties">
                <props>
                    <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
                    <prop key="hibernate.show_sql">true</prop>
                </props>
            </property>
    </bean>

    <bean id="myTransactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>

    <tx:annotation-driven transaction-manager="myTransactionManager"></tx:annotation-driven>

    </beans>

    **FeedbackDao Class**

    package com.kichha.hebbuli.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.kichha.hebbuli.entity.Feedback;

@Component
public class FeedbackDao{

    @Autowired
    private SessionFactory sessionFactory;

    @Transactional
    public void addFeedback(Feedback fb) {

        System.out.println("In feedback dao"+fb);

        Session session=sessionFactory.getCurrentSession();
        session.save(fb);
    }
}
</code>```

MAVEN(POM.XML)

```<code><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.telusko</groupId>
<artifactId>tusk</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>hebbuli Maven Webapp</name>
<url>http://maven.apache.org</url>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.7.RELEASE</version>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.9.Final</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.3.7.RELEASE</version>
</dependency>

<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.39</version>
</dependency>

<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.5.2</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>4.3.7.RELEASE</version>
</dependency>

</dependencies>
<build>
<finalName>hebbuli</finalName>
</build>
</project>

   Hello guies i have added pom.xml as wel that is maven tool so kindly have a look once again thanking you in advance
</code>```

答:
There is a problem while including hibernate jar files. As per the error line,

```<code>java.lang.NoSuchMethodError: org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.applyClassLoader(Ljava/lang/ClassLoader;)Lorg/hibernate/boot/registry/BootstrapServiceRegistryBuilder;
</code>```

applyClassLoader method is present in the hibernate 5.1, where as it was not present in hibernate 4.3 version

Body:
I am getting UnsatisfiedDependencyException in project
and i have used all jars related with spring-mvc spring-tx hibernate mysql connector and all by using maven tool

type Exception report

    message Servlet.init() for servlet kichha threw exception

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

    exception

    javax.servlet.ServletException: Servlet.init() for servlet kichha threw exception
        org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
        org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
        org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
        org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
        org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
        org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
        java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        java.lang.Thread.run(Unknown Source)
    root cause

    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'feedbackDao': Unsatisfied dependency expressed through field 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/kichha-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.applyClassLoader(Ljava/lang/ClassLoader;)Lorg/hibernate/boot/registry/BootstrapServiceRegistryBuilder;
        org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)
        org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
        org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
        org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
        org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)

In sts spring tool detail log message

Nov 15, 2017 4:59:48 AM org.apache.tomcat.util.digester.SetPropertiesRule beginWARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:hebbuli' did not find a matching property.
Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version:        Apache Tomcat/7.0.81
Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          Aug 11 2017 10:21:27 UTC
Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number:         7.0.81.0
Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:Windows 8.1Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            6.3
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Architecture:          x86
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Java Home:             C:\Program Files\Java\jre1.8.0_20
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: JVM Version:           1.8.0_20-b26
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: JVM Vendor:            Oracle Corporation
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: CATALINA_BASE:         C:\Users\admin\Documents\LiveProjectWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: CATALINA_HOME:         C:\tomcat7
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dcatalina.base=C:\Users\admin\Documents\LiveProjectWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dcatalina.home=C:\tomcat7
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dwtp.deploy=C:\Users\admin\Documents\LiveProjectWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Djava.endorsed.dirs=C:\tomcat7\endorsed
    Nov 15, 2017 4:59:48 AM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dfile.encoding=Cp1252
    Nov 15, 2017 4:59:48 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_20\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_20/bin/client;C:/Program Files/Java/jre1.8.0_20/bin;C:/Program Files/Java/jre1.8.0_20/lib/i386;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;;C:\endlessjourny\sts\sts-bundle\sts-3.9.1.RELEASE;;.
    Nov 15, 2017 4:59:49 AM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["http-bio-8080"]
    Nov 15, 2017 4:59:49 AM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
    Nov 15, 2017 4:59:49 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 2040 ms
    Nov 15, 2017 4:59:49 AM org.apache.catalina.core.StandardService startInternal
    INFO: Starting service Catalina
    Nov 15, 2017 4:59:49 AM org.apache.catalina.core.StandardEngine startInternal
    INFO: Starting Servlet Engine: Apache Tomcat/7.0.81
    Nov 15, 2017 4:59:56 AM org.apache.catalina.startup.TldConfig execute
    INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
    Nov 15, 2017 4:59:56 AM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
      at java.lang.Thread.run(Unknown Source)
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/kichha-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.applyClassLoader(Ljava/lang/ClassLoader;)Lorg/hibernate/boot/registry/BootstrapServiceRegistryBuilder;
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
      at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)
      ... 37 more
    Caused by: java.lang.NoSuchMethodError: org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.applyClassLoader(Ljava/lang/ClassLoader;)Lorg/hibernate/boot/registry/BootstrapServiceRegistryBuilder;
      at org.springframework.orm.hibernate5.LocalSessionFactoryBean.getMetadataSources(LocalSessionFactoryBean.java:362)
      at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:399)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
      ... 47 more

    Nov 15, 2017 5:00:32 AM org.apache.catalina.core.ApplicationContext log
    SEVERE: StandardWrapper.Throwable
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'feedbackDao': Unsatisfied dependency expressed through field 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/kichha-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.applyClassLoader(Ljava/lang/ClassLoader;)Lorg/hibernate/boot/registry/BootstrapServiceRegistryBuilder;
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)
      at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
      at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)
      at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634)
      at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682)
      at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553)
      at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494)
      at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:138)
      at javax.servlet.GenericServlet.init(GenericServlet.java:158)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1269)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1182)
      at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:853)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Unknown Source)
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/kichha-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.applyClassLoader(Ljava/lang/ClassLoader;)Lorg/hibernate/boot/registry/BootstrapServiceRegistryBuilder;
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
      at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)
      ... 37 more
    Caused by: java.lang.NoSuchMethodError: org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.applyClassLoader(Ljava/lang/ClassLoader;)Lorg/hibernate/boot/registry/BootstrapServiceRegistryBuilder;
      at org.springframework.orm.hibernate5.LocalSessionFactoryBean.getMetadataSources(LocalSessionFactoryBean.java:362)
      at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:399)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
      ... 47 more

    Nov 15, 2017 5:00:32 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Allocate exception for servlet kichha
    java.lang.NoSuchMethodError: org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.applyClassLoader(Ljava/lang/ClassLoader;)Lorg/hibernate/boot/registry/BootstrapServiceRegistryBuilder;
      at org.springframework.orm.hibernate5.LocalSessionFactoryBean.getMetadataSources(LocalSessionFactoryBean.java:362)
      at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:399)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
      at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)

org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
          at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
          at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)
          at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634)
          at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682)
          at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553)
          at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494)
          at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:138)
          at javax.servlet.GenericServlet.init(GenericServlet.java:158)
          at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1269)
          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1182)
          at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:853)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)

spring configuration file(kichha-servlet.xml)

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:mvc="http://www.springframework.org/schema/mvc"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
            http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
            http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">

        <context:component-scan base-package="com.kichha.hebbuli"></context:component-scan>

    <bean id="myDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
            destroy-method="close">
            <property name="driverClass" value="com.mysql.jdbc.Driver"/>
            <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/telusko"/>
            <property name="user" value="root" />
            <property name="password" value="root" />

            <property name="maxPoolSize" value="20" />
            <property name="minPoolSize" value="5" />
            <property name="maxIdleTime" value="30000" />
    </bean>

    <bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
            <property name="dataSource" ref="myDataSource" />
            <property name="packagesToScan" value="com.kichha.hebbuli.entity" />
            <property name="hibernateProperties">
                <props>
                    <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
                    <prop key="hibernate.show_sql">true</prop>
                </props>
            </property>
    </bean>

    <bean id="myTransactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>

    <tx:annotation-driven transaction-manager="myTransactionManager"></tx:annotation-driven>

    </beans>

    **FeedbackDao Class**

    package com.kichha.hebbuli.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.kichha.hebbuli.entity.Feedback;

@Component
public class FeedbackDao{

    @Autowired
    private SessionFactory sessionFactory;

    @Transactional
    public void addFeedback(Feedback fb) {

        System.out.println("In feedback dao"+fb);

        Session session=sessionFactory.getCurrentSession();
        session.save(fb);
    }
}

MAVEN(POM.XML)

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.telusko</groupId>
<artifactId>tusk</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>hebbuli Maven Webapp</name>
<url>http://maven.apache.org</url>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.7.RELEASE</version>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.9.Final</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.3.7.RELEASE</version>
</dependency>

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.39</version>
</dependency>

<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.5.2</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>4.3.7.RELEASE</version>
</dependency>

</dependencies>
<build>
<finalName>hebbuli</finalName>
</build>
</project>

   Hello guies i have added pom.xml as wel that is maven tool so kindly have a look once again thanking you in advance

Body:
There is a problem while including hibernate jar files. As per the error line,

java.lang.NoSuchMethodError: org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.applyClassLoader(Ljava/lang/ClassLoader;)Lorg/hibernate/boot/registry/BootstrapServiceRegistryBuilder;

applyClassLoader method is present in the hibernate 5.1, where as it was not present in hibernate 4.3 version


问:
How Temp Table works in Stored Procedures (global & local )
Image #1: I am creating a stored procedure for inserting records into #t1.
In the same session I am executing the Localtemp1 stored procedure for any number of times, and it works fine:

Image #2: again executing the stored procedure in another session & works fine as well:

Image #3: now creating stored procedure for inserting records into ##tt. For the first execution of globaltemp1 stored procedure, it works well:

Image #4: but when I executed it a second time, it is showing errors (does not exist in DB):

Image #5: then I closed the session where globaltemp stored procedure was created, and in a new session, I executed the stored procedure, and it works well for the first time:

Image #6: but when I execute it a second time, again it is showing errors (does not exist in DB):

What I know is scope of local temp & global temp, but in stored procedures, they were completely different

Can someone tell me

Execution of localtemp1 stored procedure for many times gives output but while executing globaltemp1 sp for the first time gives output and second time results in an error

As far as I know, after execution of stored procedure temptable gets dropped. Then why localtemp1 stored procedure is getting executed across all sessions and many number of times?

Why globaltemp1 stored procedure is executing once and for second time showing an error?

Final one, Globaltemp stored procedure shows output in another session for the first time only when created session was closed

I mean

56 ----> globaltemp sp was created

57 ----> to get o/p i need to close 56

58 ----> to get o?p i need to close 57   (  WHY ??? )

I am a beginner at SQL and please, someone make me understand because if I don't find logic & correct reason I could not dive into another topic.

答:
The concept of temp table is to hold records temporarily. It's some kind of an array where you can store multiple records using the same variable.

When you create a Temp Table, actually it is being created in the tempdb of the corresponding server. Even if you are naming it as just #temp, the name on which it was created on the tempdb will be having some additional parameters like your database name from which the table was created and your session id etc.

I just created the following temp table in my master database

and this is how it was named in the tempdb

still, in my database, I can access it using the name #temp. But The limitation of such temp table is that they are local and can be accessed only from that session, So if I try to access this #temp from any other Query Window (Session) even on the same database, I won't be able to access it. That's where we use Global temp tables. So If I add one more # to the table name then it becomes global temp table which can be accessed across the sessions. It is still created on the Tempdb but like this

Whenever you close the query window/session both Local and Global temp tables are automatically dropped.

So in the case of stored procedures, the starting and ending time of the sp is treated as one session. So once the sp execution is completed all the temp tables created inside that sp is dropped. So you can not use one temp table that was created by one SP in another one.

Hope this helps


问:
why do i have to reload the app after change direction from LTR to RTL in react-native?
I use I18nManager.forceRTL(true) in initialState or componentDidMount life cycle but it does't work and if I reload my App, it works.

I mean I have to reload the App to see the effect, what is the reason?

Thanks in advance

答: You can use RNRestart.Restart() after I18nManager.forceRTL(true). It will not close your app.


问:
Why does Javascript filter focus lost
I am implementing a filter search for my search box, everything works well the array get filtered as i need, but it has a strange behaviour, since the search is almost at the bottom of the page (the scrool is at the bottom too) when i enter a character to search on the searchbox the scrool go up i think th ebehaviour has nothing to do with css, the problem is with my filter function.

I do it this way:

```<code>public onSearchChange(nameSearch: string): void {
    if (this.myFullArr) {
        const search = nameSearch.toLowerCase();
        this.myArr = this.myFullArr.filter((element) => {
            if (element.Name.toLowerCase().indexOf(search) !== -1) {
                return true;
            }
            return false;
        })
    }
}
</code>```

this function is called when my search box change, as you guys can see the myFullArr is the initial contend that is static and doesn't change, since i can't use just the original array because it will change, the myArr is the filtered array.

Any help?

Thanks

答:
Try calling your onSearchChange function as follows.

```<code>    <input id="text" type="text" />

    the function

    document.getElementById('text').onkeydown = new function(event){
    onSearchChange("your search text")
    return false
}
</code>```

You can get an idea from this question as well.

Title: Why does Javascript filter focus lost

Body:
I am implementing a filter search for my search box, everything works well the array get filtered as i need, but it has a strange behaviour, since the search is almost at the bottom of the page (the scrool is at the bottom too) when i enter a character to search on the searchbox the scrool go up i think th ebehaviour has nothing to do with css, the problem is with my filter function.

I do it this way:

public onSearchChange(nameSearch: string): void {
    if (this.myFullArr) {
        const search = nameSearch.toLowerCase();
        this.myArr = this.myFullArr.filter((element) => {
            if (element.Name.toLowerCase().indexOf(search) !== -1) {
                return true;
            }
            return false;
        })
    }
}

this function is called when my search box change, as you guys can see the myFullArr is the initial contend that is static and doesn't change, since i can't use just the original array because it will change, the myArr is the filtered array.

Any help?

Thanks

Body:
Try calling your onSearchChange function as follows.

    <input id="text" type="text" />

    the function

    document.getElementById('text').onkeydown = new function(event){
    onSearchChange("your search text")
    return false
}

You can get an idea from this question as well.


问:
how to plot a "group by" dataframe in Bokeh as Bar chart
i have a dataframe

```<code>     suite_name  fail  Pass      Report_datetime
0   VOLTE-VOLTE     5     7  2017-11-14 00:00:00
1   VOLTE-VOLTE     5     7  2017-11-11 00:00:00
2   VOLTE-VOLTE     5     7  2017-11-10 00:00:00
3   VOLTE-VOLTE     5     7  2017-11-09 00:00:00
4   VOLTE-VOLTE     5     7  2017-11-14 00:00:00
5   VOLTE-VOLTE     5     7  2017-11-14 00:00:00
</code>```

i have grouped it

```<code>g1=df.groupby( [ 'Report_datetime'] ).sum()
print g1
</code>```

Output :

```<code>Report_datetime         fail        Pass
2017-11-14 00:00:00     5     7
2017-11-11 00:00:00     5     7
2017-11-10 00:00:00     5     7
2017-11-10 00:00:00     5     7

**
</code>```

How to plot this data in Bokeh?
Bar.charts are not supported in latest version of Bokeh , so any example with Vbar and Figure would be great

答:
You can use visual dodge method:

First data preparation:

```<code>g1 = df.groupby('Report_datetime', as_index=False).sum()
print (g1)
  Report_datetime  fail  Pass
0      2017-11-09     5     7
1      2017-11-10     5     7
2      2017-11-11     5     7
3      2017-11-14    15    21

#convert datetimes to strings
g1['Report_datetime'] = g1['Report_datetime'].dt.strftime('%Y-%m-%d')
#convert dataframe to dict
data = g1.to_dict(orient='list')
dates = g1['Report_datetime'].tolist()
</code>```

```<code>from bokeh.core.properties import value
from bokeh.io import show, output_file
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure
from bokeh.transform import dodge

output_file("dodged_bars.html")

source = ColumnDataSource(data=data)

#get max possible value of plotted columns with some offset
p = figure(x_range=dates, y_range=(0, g1[['fail','Pass']].values.max() + 3),
           plot_height=250, title="Report",
           toolbar_location=None, tools="")

p.vbar(x=dodge('Report_datetime', -0.25, range=p.x_range), top='fail', width=0.4, source=source,
       color="#c9d9d3", legend=value("fail"))

p.vbar(x=dodge('Report_datetime',  0.25,  range=p.x_range), top='Pass', width=0.4, source=source,
       color="#718dbf", legend=value("Pass"))

p.x_range.range_padding = 0.1
p.xgrid.grid_line_color = None
p.legend.location = "top_left"
p.legend.orientation = "horizontal"

show(p)
</code>```

Body:
i have a dataframe

     suite_name  fail  Pass      Report_datetime
0   VOLTE-VOLTE     5     7  2017-11-14 00:00:00
1   VOLTE-VOLTE     5     7  2017-11-11 00:00:00
2   VOLTE-VOLTE     5     7  2017-11-10 00:00:00
3   VOLTE-VOLTE     5     7  2017-11-09 00:00:00
4   VOLTE-VOLTE     5     7  2017-11-14 00:00:00
5   VOLTE-VOLTE     5     7  2017-11-14 00:00:00

i have grouped it

g1=df.groupby( [ 'Report_datetime'] ).sum()
print g1

Output :

Report_datetime         fail        Pass
2017-11-14 00:00:00     5     7
2017-11-11 00:00:00     5     7
2017-11-10 00:00:00     5     7
2017-11-10 00:00:00     5     7

**

How to plot this data in Bokeh?
Bar.charts are not supported in latest version of Bokeh , so any example with Vbar and Figure would be great

Body:
You can use visual dodge method:

First data preparation:

g1 = df.groupby('Report_datetime', as_index=False).sum()
print (g1)
  Report_datetime  fail  Pass
0      2017-11-09     5     7
1      2017-11-10     5     7
2      2017-11-11     5     7
3      2017-11-14    15    21

#convert datetimes to strings
g1['Report_datetime'] = g1['Report_datetime'].dt.strftime('%Y-%m-%d')
#convert dataframe to dict
data = g1.to_dict(orient='list')
dates = g1['Report_datetime'].tolist()

from bokeh.core.properties import value
from bokeh.io import show, output_file
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure
from bokeh.transform import dodge

output_file("dodged_bars.html")

source = ColumnDataSource(data=data)

#get max possible value of plotted columns with some offset
p = figure(x_range=dates, y_range=(0, g1[['fail','Pass']].values.max() + 3),
           plot_height=250, title="Report",
           toolbar_location=None, tools="")

p.vbar(x=dodge('Report_datetime', -0.25, range=p.x_range), top='fail', width=0.4, source=source,
       color="#c9d9d3", legend=value("fail"))

p.vbar(x=dodge('Report_datetime',  0.25,  range=p.x_range), top='Pass', width=0.4, source=source,
       color="#718dbf", legend=value("Pass"))

p.x_range.range_padding = 0.1
p.xgrid.grid_line_color = None
p.legend.location = "top_left"
p.legend.orientation = "horizontal"

show(p)


问:
UIView having Animation from right to left
how to make uiview animated so it appears slowly from right to left and having two UIButtons on it having images on buttons and one of them image on button will change on button click</p>

答:
Right to Left animation & Left to right animation as-

```<code>        let firstViewTowardsLeft = UIView(frame: CGRect(x: 0, y: 150, width: 50, height: 50))
        firstViewTowardsLeft.backgroundColor = .red
        view.addSubview(firstViewTowardsLeft)
        UIView.animate(withDuration: 1, delay: 0, options: .repeat, animations: {Bool in
            firstViewTowardsLeft.frame = CGRect(x: 100, y: 150, width: 50, height: 50)

        }, completion: nil)

        let secondViewTowardsLeft = UIView(frame: CGRect(x: 100, y: 100, width: 50, height: 50))
        secondViewTowardsLeft.backgroundColor = .red
        view.addSubview(secondViewTowardsLeft)
        UIView.animate(withDuration: 1, delay: 0, options: .repeat, animations: {Bool in
            secondViewTowardsLeft.frame = CGRect(x: 0, y: 100, width: 50, height: 50)

        }, completion: nil)
</code>```

https://developer.apple.com/documentation/uikit/uiview/1622418-animate

Body:
Right to Left animation & Left to right animation as-

        let firstViewTowardsLeft = UIView(frame: CGRect(x: 0, y: 150, width: 50, height: 50))
        firstViewTowardsLeft.backgroundColor = .red
        view.addSubview(firstViewTowardsLeft)
        UIView.animate(withDuration: 1, delay: 0, options: .repeat, animations: {Bool in
            firstViewTowardsLeft.frame = CGRect(x: 100, y: 150, width: 50, height: 50)

        }, completion: nil)

        let secondViewTowardsLeft = UIView(frame: CGRect(x: 100, y: 100, width: 50, height: 50))
        secondViewTowardsLeft.backgroundColor = .red
        view.addSubview(secondViewTowardsLeft)
        UIView.animate(withDuration: 1, delay: 0, options: .repeat, animations: {Bool in
            secondViewTowardsLeft.frame = CGRect(x: 0, y: 100, width: 50, height: 50)

        }, completion: nil)

https://developer.apple.com/documentation/uikit/uiview/1622418-animate