text:
Q: Dropdown animation when I remove mouse I've coded an animation for my navbar, which shows the log in form when hovered, but when I remove the mouse from it, it just disappears, I would like it to smoothly go away the same way it came, what do I have to add to the code?

HTML
<!DOCTYPE html>

<title>¡Servicios en un Chasquido! | Chasquido Servicios</title>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/style.css">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">

INICIO

CONTACTO

REGISTRATE

INGRESAR

Datos

              <form>

CORREO

                <input type="text" name="" placeholder="Escribir e-mail">

CONTRASEÑA

                <input type="password" name="" placeholder="Escribir Contraseña">
                <input type="submit" name="" value="Listo">
                ¿Contraseña olvidada?
              </form>

CSS:
.main-wrapper{
margin: 0 auto;
width: 95%;
min-width: 900px;

}

body{
margin: 0;
background: #222;
font-family: sans-serif;

}
.container{
width: 80%;
margin: 0 auto;
}
header{
background: #151515 ;
 }
.logo{
float: left;
padding: 10px 0;
}
nav{
float: right;
}
nav ul{
margin: 0;
padding: 0;
list-style: none;
position: relative;
z-index:1000;
}
nav li{
display: inline-block;
margin-left: 50px;
padding: 40px;
position: relative;

}
nav a{
color: lightgrey;

}
nav a:hover {
color: white;
text-decoration: none;

}
body{
margin: 0;
padding: 0;
background: white;
}
.menu {
display: flex;
list-style: none;
background-color: #151515;
margin-left: 50px;
}
.menu li.with-arrow {
padding: 35px 50px;
cursor: pointer;
padding-bottom: 20px;
position: relative;
margin: 5px;
color: lightgray;
font-family: sans-serif;
margin-left: 50px;
}
.menu li.with-arrow:after {
 font-family: FontAwesome;
 font-size: 20px;
content: '\f107';
display: inline-block;
color: yellow;
position: absolute;
bottom: 0;
left: 50%;
transform: translate(-50%, 0);
transition: transform 0.3s ease;
}
.menu li.with-arrow:hover {
background-color: rgba(0, 0, 0, 0.25);
}
.menu li.with-arrow:hover:after {
transform: translate(-50%, 5px);
}

.menu li {
 padding: 35px 15px;
 padding-bottom: 20px;
position: relative;
margin: 5px;
color: lightgray;
font-family: sans-serif;
 cursor: pointer;
}
.menu li:before{
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 3px;
background: white;
overflow: hidden;
z-index: -1;
transform: scaleX(0);
transform-origin: right;
transition: .15s;
}
.menu li:hover:before{
transform: scaleX(1);
transform-origin: left;
}
.menu li.home:after{
content: '';
position: absolute;
bottom: 0;
right: 0;
width: 100%;
height: 3px;
background: white;
overflow: hidden;
z-index: -1;
transform: scaleX(0);
transform-origin: left;
transition: .15s;
}
.menu li.home:hover:after{
transform: scaleX(1);
transform-origin: right;
}
.menu li:hover {
  background-color: rgba(0, 0, 0, .25);
color: white;
}
.login-box{
width: 350px;
height: 420px;
padding: 80px 40px;
box-sizing: border-box;
background: rgba(0, 0, 0, .8);
position: absolute;
right: 0px;
top: 100%;
opacity: 0;
visibility: hidden;
cursor: auto;

}
.menu li:hover .login-box{
animation: load .3s forwards;
display: block;
visibility: visible;
}
@keyframes load{
0%{
    transform: translateX(25px) scale(1.6);
}
100%{
    opacity: 1;
    transform: translateX(0px);
}
}

h2 {
margin: 0;
padding: 0px;
color: #efed40;
text-align: center;

}
.login-box p
{
margin: 0;
padding: 0;
color: white;
}
.login-box input
{
width: 100%;
margin-bottom: 20px;
}
.login-box input[type="text"],
.login-box input[type="password"]
{
border: none;
border-bottom: 1px solid #fff;
background: transparent;
outline: none;
height: 40px;
color: white;
font-size: 16px;

}
::placeholder
{
color: rgba(255, 255, 255, .3);
font-family: sans-serif;
font-weight: bold;
}
.login-box input[type="submit"]
{
border: none;
outline: none;
height: 40px;
color: #fff;
font-size: 16px;
background: #ff267e;
cursor: pointer;
border-radius: 20px;
}
.login-box input[type="submit"]:hover
{
background: #efed40;
color: #262626;
}
.login-box a
{
color: #fff;
font-size: 14px;

text-decoration: none;

}
.login-box a:hover
{
color: yellow;

}

This is my entire code if you would like to see it, if it looks unprofessional or something like that, please know that I'm new to all this and it'll take me some time, I'm still in the dark here, anyway, thanks!

A: You can't leave the
 outside of the tag you put the
 in. Your code is:

INICIO

CONTACTO

REGISTRATE

INGRESAR

Datos

        <form>

CORREO

          <input type="text" name="" placeholder="Escribir e-mail">

CONTRASEÑA

          <input type="password" name="" placeholder="Escribir Contraseña">
          <input type="submit" name="" value="Listo">
          ¿Contraseña olvidada?
        </form>

That's not valid, and it simply doesn't make any sense. It's like doing

It should be:

INICIO

CONTACTO

REGISTRATE

INGRESAR

Datos

        <form>

CORREO

          <input type="text" name="" placeholder="Escribir e-mail">

CONTRASEÑA

          <input type="password" name="" placeholder="Escribir Contraseña">
          <input type="submit" name="" value="Listo">
          ¿Contraseña olvidada?
        </form>

A: For this simple animation you dont need the keyframes. This animation can easily create with transition. If you want to have the animation with keyframes you need to work with javascript and so you can handle the classes from li  when entering and leaving the element with the mouse. You can then give various animations to the different classes

.menu li .login-box {
  transform: translateX(25px) scale(1.6);
  opacity: 0;
  transition: .3s all linear;

}

.menu li:hover .login-box {
  display: block;
  visibility: visible;
  opacity: 1;
  transform: translateX(0px);

}

And here is the result with your Codesample:

.main-wrapper {
  margin: 0 auto;
  width: 95%;
  min-width: 900px;

}

body {
  margin: 0;
  background: #222;
  font-family: sans-serif;

}

.container {
  width: 80%;
  margin: 0 auto;
}

header {
  background: #151515;
}

.logo {
  float: left;
  padding: 10px 0;
}

nav {
  float: right;
}

nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
  z-index: 1000;
}

nav li {
  display: inline-block;
  margin-left: 50px;
  padding: 40px;
  position: relative;

}

nav a {
  color: lightgrey;

}

nav a:hover {
  color: white;
  text-decoration: none;

}

body {
  margin: 0;
  padding: 0;
  background: white;
}

.menu {
  display: flex;
  list-style: none;
  background-color: #151515;
  margin-left: 50px;
}

.menu li.with-arrow {
  padding: 35px 50px;
  cursor: pointer;
  padding-bottom: 20px;
  position: relative;
  margin: 5px;
  color: lightgray;
  font-family: sans-serif;
  margin-left: 50px;
}

.menu li.with-arrow:after {
  font-family: FontAwesome;
  font-size: 20px;
  content: '\f107';
  display: inline-block;
  color: yellow;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 0);
  transition: transform 0.3s ease;
}

.menu li.with-arrow:hover {
  background-color: rgba(0, 0, 0, 0.25);
}

.menu li.with-arrow:hover:after {
  transform: translate(-50%, 5px);
}

.menu li {
  padding: 35px 15px;
  padding-bottom: 20px;
  position: relative;
  margin: 5px;
  color: lightgray;
  font-family: sans-serif;
  cursor: pointer;
}

.menu li:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: white;
  overflow: hidden;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: right;
  transition: .15s;
}

.menu li:hover:before {
  transform: scaleX(1);
  transform-origin: left;
}

.menu li.home:after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 3px;
  background: white;
  overflow: hidden;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left;
  transition: .15s;
}

.menu li.home:hover:after {
  transform: scaleX(1);
  transform-origin: right;
}

.menu li:hover {
  background-color: rgba(0, 0, 0, .25);
  color: white;
}

.login-box {
  width: 350px;
  height: 420px;
  padding: 80px 40px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, .8);
  position: absolute;
  right: 0px;
  top: 100%;
  opacity: 0;
  visibility: hidden;
  cursor: auto;

}

.menu li .login-box {
  transform: translateX(25px) scale(1.6);
  opacity: 0;
  transition: .3s all linear;

}

.menu li:hover .login-box {
  display: block;
  visibility: visible;
  opacity: 1;
  transform: translateX(0px);

}

h2 {
  margin: 0;
  padding: 0px;
  color: #efed40;
  text-align: center;

}

.login-box p {
  margin: 0;
  padding: 0;
  color: white;
}

.login-box input {
  width: 100%;
  margin-bottom: 20px;
}

.login-box input[type="text"],
.login-box input[type="password"] {
  border: none;
  border-bottom: 1px solid #fff;
  background: transparent;
  outline: none;
  height: 40px;
  color: white;
  font-size: 16px;

}

::placeholder {
  color: rgba(255, 255, 255, .3);
  font-family: sans-serif;
  font-weight: bold;
}

.login-box input[type="submit"] {
  border: none;
  outline: none;
  height: 40px;
  color: #fff;
  font-size: 16px;
  background: #ff267e;
  cursor: pointer;
  border-radius: 20px;
}

.login-box input[type="submit"]:hover {
  background: #efed40;
  color: #262626;
}

.login-box a {
  color: #fff;
  font-size: 14px;

  text-decoration: none;

}

.login-box a:hover {
  color: yellow;

}
<!DOCTYPE html>

<title>¡Servicios en un Chasquido! | Chasquido Servicios</title>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/style.css">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">

INICIO

CONTACTO

REGISTRATE

INGRESAR

Datos

              <form>

CORREO

                <input type="text" name="" placeholder="Escribir e-mail">

CONTRASEÑA

                <input type="password" name="" placeholder="Escribir Contraseña">
                <input type="submit" name="" value="Listo">
                ¿Contraseña olvidada?
              </form>

The js Result: jsfidde


text:
Q: OrganizationServiceContext not loading EntitySet - CRM 2013 I have an entity ex: A and it has a related "X_Message" entity for which X_MessageSet is created in the ServiceContext class created by crmsvcutil tool.
When I use this I get error "the specified type X_message is not a known entity type" and this exception happens in LINQ code.
This is happening in our ServiceContext class which is XRMServiceContext.
Class which we are using to create instance of Context:
    public CrmServiceProxy(IOrganizationService orgService)
    {
        _orgService = orgService;
        context = new XrmServiceContext(this._orgService);
    }

     public System.Linq.IQueryable<XXX.X_message> X_messageSet
    {
        get
        {
            return this.CreateQuery<XXX.X_message>();
        }
    }

When I debugging my Plugin, I am seeing that "context" is having this X_messageset as a property but its giving System.ArgumentException, so am unable to debug too.
Please help.

A: are you sure you are using the "context" variable you set up?
I find it easiest to do this:
using (var srv = new XrmServiceContext(_orgService)){
    List<new_entity> e = srv.new_entitySet.Where(e => e.Id == passedInId).ToList();
//Do Stuff with your list
}

where 'new_entity' is the name of the entity, "Where" is returning me all "new_entity" records that meet the condition specified (the id equals "passedInId" in this example)

redpajama_set_name: RedPajamaStackExchange


text:
Q: Printing Point array in Java I been stuck on this for a while now. I have read an Object which is a Point type and I want to assign it to a Point array and print it. For some reason my code isnt printing anything..would anyone know what is causing this.
private Point[] pointArray;
while ((obj = inStream.readObject()) != null)

            {

                Point pointValue = (Point) obj;

                int xValue = pointValue.x;
                int yValue = pointValue.y;

                pointArray[counter] = new Point(xValue, yValue);

                System.out.println(pointArray[counter].toString());
                counter++;
            }

A: You could use an ArrayList to read the points, then convert it to your array:
    List<Point> points = new ArrayList();

    // Read Points and add them to the list
    // points.add(new Point(1, 2));
    // points.add(new Point(3, 4));

    Point[] pointsArray = new Point[points.size()];
    points.toArray(pointsArray);

A: Arrays have a fixed size in Java, you'll need to use an ArrayList so something like:
    List<Point> points = new ArrayList<Point>();
    while ((obj = inStream.readObject()) != null) {

        Point pointValue = (Point) obj;

        int xValue = pointValue.x;
        int yValue = pointValue.y;

        points.add(new Point(xValue, yValue));

        System.out.println(points.get(points.size()-1).toString());
        counter++;
    }

A: Before run your code you need to correct your code else this code not compile at least.
private Point[] pointArray; // you have declare the array

But you never initialize it. First initialize this.
Again you are calling toString() method of an Array. Never do that since it will call Object class toString() method in Java.
Edit: for your comment.
I dont know the size of the array as it depends on the file.

Then use List instead of Array
List<Point> pointsList=new ArrayList<>();

Not only this advantage but also you can directly call toString() not like in Arrays. Since toString() method has override in AbstractCollection, you need to override toString() method in your Point class

A: The problem with the above code that the array is not initialized and according to you you don't have the actual size to initialize it so you can go with list the convert the list to array if you neeed
List<Point> points = new ArrayList<Point>();
    while ((obj = inStream.readObject()) != null) {

        Point pointValue = (Point) obj;

        int xValue = pointValue.x;
        int yValue = pointValue.y;

        pointsList.add(new Point(xValue, yValue));

        System.out.println(pointsList.get(pointsList.size()-1).toString());
        counter++;
    }
    Point[] pointsArray = pointsList.toArray(new Point[pointsList.size()]);


text:
Q: Certificate of K3S cluster I'm using a K3S Cluster in a docker(-compose) container in my CI/CD pipeline, to test my application code. However I have problem with the certificate of the cluster. I need to communicate on the cluster using the external addres. My docker-compose script looks as follows
version: '3'
services:
  server:
    image: rancher/k3s:v0.8.1
    command: server --disable-agent
    environment:
    - K3S_CLUSTER_SECRET=somethingtotallyrandom
    - K3S_KUBECONFIG_OUTPUT=/output/kubeconfig.yaml
    - K3S_KUBECONFIG_MODE=666
    volumes:
    - k3s-server:/var/lib/rancher/k3s
    # get the kubeconfig file
    - .:/output
    ports:
#    - 6443:6443
     - 6080:6080
     - 192.168.2.110:6443:6443

  node:
    image: rancher/k3s:v0.8.1
    tmpfs:
    - /run
    - /var/run
    privileged: true
    environment:
    - K3S_URL=https://server:6443
    - K3S_CLUSTER_SECRET=somethingtotallyrandom
    ports:
      - 31000-32000:31000-32000

volumes:
  k3s-server: {}

accessing the cluster from python gives me
MaxRetryError: HTTPSConnectionPool(host='192.168.2.110', port=6443): Max retries exceeded with url: /apis/batch/v1/namespaces/mlflow/jobs?pretty=True (Caused by SSLError(SSLCertVerificationError("hostname '192.168.2.110' doesn't match either of 'localhost', '172.19.0.2', '10.43.0.1', '172.23.0.2', '172.18.0.2', '172.23.0.3', '127.0.0.1', '0.0.0.0', '172.18.0.3', '172.20.0.2'")))

Here are my two (three) question

*

*how can I add additional IP adresses to the cert generation? I was hoping the --bind-address in the server command triggers taht

*how can I fall back on http providing an --http-listen-port didn't achieve the expected result

*any other suggestion how I can enable communication with the cluster

changing the python code is not really an option as I would like o keep the code unaltered for testing. (Fallback on http works via kubeconfig.

A: The solution is to use the parameter tls-san
server --disable-agent --tls-san 192.168.2.110


text:
Q: JSON only returning first character when decoding? My JSON:
{"data":{"addresses":{"bitcoincash":"qzx3k8cq2e66k4glnt2derr5mppzc6xmvuxgsyp778","bitcoin":"1GjKuo1Q9sw8NytE31J5RPnVpYpEzp47hu","ethereum":"0xd7410e84e9c336937637e3cb472ad112c258ede3","litecoin":"LiQCBwuvW4RVuAg2dBNzS4fkviDwi8EBKa"},"code":"PGVD745Y","created_at":"2018-08-18T04:26:23Z","description":"dddd","expires_at":"2018-08-18T05:26:23Z","hosted_url":"https://commerce.coinbase.com/charges/example","id":"ddd","metadata":{"customer_id":"IuYBD5X7ylEV6g0xyTWi","name":"Guest@localhost.com"},"name":"ddd","payments":[],"pricing":{"local":{"amount":"19.85","currency":"USD"},"ethereum":{"amount":"0.063584000","currency":"ETH"},"bitcoin":{"amount":"0.00303719","currency":"BTC"},"bitcoincash":{"amount":"0.03345637","currency":"BCH"},"litecoin":{"amount":"0.32861518","currency":"LTC"}},"pricing_type":"fixed_price","resource":"charge","timeline":[{"status":"NEW","time":"2018-08-18T04:26:23Z"}]}}

My PHP:
$exec = json_encode($exec);
        $json = json_decode($exec, TRUE);

        echo $json['hosted_url'];

It just returns { always, in fact even if I put $json['safasfsaf'] it would still return {
What is the issue, the JSON is valid?

A: You can get hosted_url in this way (ERROR: you missing data $json['data']['hosted_url'])
also you can check your desired output here
<?php
$a = '{
    "data": {
        "addresses": {
            "bitcoincash": "qzx3k8cq2e66k4glnt2derr5mppzc6xmvuxgsyp778",
            "bitcoin": "1GjKuo1Q9sw8NytE31J5RPnVpYpEzp47hu",
            "ethereum": "0xd7410e84e9c336937637e3cb472ad112c258ede3",
            "litecoin": "LiQCBwuvW4RVuAg2dBNzS4fkviDwi8EBKa"
        },
        "code": "PGVD745Y",
        "created_at": "2018-08-18T04:26:23Z",
        "description": "dddd",
        "expires_at": "2018-08-18T05:26:23Z",
        "hosted_url": "https://commerce.coinbase.com/charges/example",
        "id": "ddd",
        "metadata": {
            "customer_id": "IuYBD5X7ylEV6g0xyTWi",
            "name": "Guest@localhost.com"
        },
        "name": "ddd",
        "payments": [],
        "pricing": {
            "local": {
                "amount": "19.85",
                "currency": "USD"
            },
            "ethereum": {
                "amount": "0.063584000",
                "currency": "ETH"
            },
            "bitcoin": {
                "amount": "0.00303719",
                "currency": "BTC"
            },
            "bitcoincash": {
                "amount": "0.03345637",
                "currency": "BCH"
            },
            "litecoin": {
                "amount": "0.32861518",
                "currency": "LTC"
            }
        },
        "pricing_type": "fixed_price",
        "resource": "charge",
        "timeline": [{
            "status": "NEW",
            "time": "2018-08-18T04:26:23Z"
        }]
    }
}';

$json = json_decode($a, TRUE);
echo "<pre>";
print_r($json['data']['hosted_url']);

A: You have error reporting turned off
This error is hidden for you

Warning: Illegal string offset 'hosted_url'

You can turn error reporting on with this code
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

For your code you need to replace $json['hosted_url'] with $json['data']['hosted_url']
$exec = getJson();
$json = json_decode($exec, TRUE);

echo $json['data']['hosted_url'];

Also response is already json so you must not json_encode it

A: I have noticed that, you are decode json data two time, so you are getting errors.
Hi, i have tried this way.
$exe = '{"data":{"addresses":{"bitcoincash":"qzx3k8cq2e66k4glnt2derr5mppzc6xmvuxgsyp778","bitcoin":"1GjKuo1Q9sw8NytE31J5RPnVpYpEzp47hu","ethereum":"0xd7410e84e9c336937637e3cb472ad112c258ede3","litecoin":"LiQCBwuvW4RVuAg2dBNzS4fkviDwi8EBKa"},"code":"PGVD745Y","created_at":"2018-08-18T04:26:23Z","description":"dddd","expires_at":"2018-08-18T05:26:23Z","hosted_url":"https://commerce.coinbase.com/charges/example","id":"ddd","metadata":{"customer_id":"IuYBD5X7ylEV6g0xyTWi","name":"Guest@localhost.com"},"name":"ddd","payments":[],"pricing":{"local":{"amount":"19.85","currency":"USD"},"ethereum":{"amount":"0.063584000","currency":"ETH"},"bitcoin":{"amount":"0.00303719","currency":"BTC"},"bitcoincash":{"amount":"0.03345637","currency":"BCH"},"litecoin":{"amount":"0.32861518","currency":"LTC"}},"pricing_type":"fixed_price","resource":"charge","timeline":[{"status":"NEW","time":"2018-08-18T04:26:23Z"}]}}';
$data = json_decode($exe, TRUE);
echo $data['data']['hosted_url'];


text:
Q: Get all windows xp and server 2003 machines code fail I need to find in my organization all the old machines like winxp or server 2003,win98
 i ran this code but i dont get any error neither a result
get-adcomputer -filter * -properties name,operatingsystem | where-object {($_.operatingsystem -like "windows xp") -and ($_.operatingsystem -like "windows server 2003") -and ($_.operating system -like "windows 98")}

A: First of all, as mentioned in the comments, you should use the logical operator OR. It is one or the other ... not all together.
Also, because using like, try to use a smaller keywords that would match like XP for Windows XP, 2003 for Windows Server 2003 and etc.
get-adcomputer -filter "operatingsystem -like '*xp*' -or operatingsystem -like '*2003*' -or operatingsystem -like '*98*'" -properties operatingsystem

What I would do personally is to export everything into CSV, put it into excel with table and filters and review in details. Sometimes the names look a bit strange (i.e. windows server 2008 has a strange symbol included like trademark, or something) and you will get more holistic view on the OS names
you may also do something like this to identify numbers:
get-adcomputer -filter * -properties operatingsystem | Group-Object -Property operatingsystem


text:
Q: Error heritage no access to a method C++ There is my code:
Fenetre *fen;
fen = new Fenetre(h, l);
tab_Ouverture[i]= *fen;

air_facade - tab_Ouverture[i].get_air();

Error:  error: 'class Ouverture' has no member named 'get_air'

Thinks to know:
Fenetre is child of class Rectangle. Rectangle got the method
get_air();

Fenetre is child of class Ouverture too.
There is my .h for class Rectangle, Ouverture and Fenetre:
#ifndef DEF_RECTANGLE
#define DEF_RECTANGLE

 class Rectangle {

 protected:
 float hauteur;
 float largeur;

 public:

 Rectangle();

 Rectangle(float h, float l);
 float get_air();

 };

 #endif

 #ifndef DEF_OUVERTURE
 #define DEF_OUVERTURE

  class Ouverture
  {

  };

  #endif

#include "rectangle.h"
#include "ouverture.h"
#ifndef DEF_FENETRE
#define DEF_FENETRE

 class Fenetre:public Rectangle, public Ouverture
 {
 public:

 Fenetre();

 Fenetre(float h, float l);

 };

 #endif

Definition of Ouverture and Fenetre:
   Ouverture *tab_Ouverture;
   tab_Ouverture = new Ouverture[5];

   Fenetre *fen;
   fen = new Fenetre(h, l);

If i i understand, Fenetre can't have access to get_air() method cause Fenetre is reconvert to a Ouverture Objet, and my Ouverture object aren't child of Rectangle?
How can i resolve this problem withtout do an heritance between Rectangle and Ouverture?
Thks!!!

A: Ouverture has no get_air() method.
get_air() is a accessible only for Rectangle and Fenetre classes (since Fenetre is also a rectangle)
Cast your pointer to Fenetre class, than it will work.

A: You have two problems:  Firstly when you write
    tab_Ouverture[i]= *fen;

you slice your Fenetre object.  Only the Ouverture base object is assigned to tab_Ouverture, and the rest is thrown away.  If you want tab_Ouverture to hold different types of objects, it is going to have to contain (smart) pointers.
So your code needs to look something like:
    std::vector<std::unique_ptr<Ourveture>> tab_Ouverture;  // Vector of pointers

    auto fen = std::make_unique<Fenetre>(h, l);  // Create a new Fenetre

    tab_Ouverture.push_back(std::move(fen));     // Move it into vector.  fen is now gone.

    ...
    air_facade = tab_Ouverture[i]->get_air();

You will notice I have used a vector rather than a simple new'ed array, and std::unique_ptr.  The advantage of this is that it is much harder to leak memory, fail to call destructors.
The only issue is that this still won't work :-)  Your second problem is that tab_Ouverture[i] has static type of "(smart) pointer to Ouverture", and Ouverture has no get_air method.  There are two solutions to this:

*

*Cast the pointer you get from tab_Ouverture[i] into a Fenetre pointer.

*Give Ouverture a (pure) virtual get_air function.

The cast would look like:
    auto pFen = dynamic_cast<Fenetre*>(&*tab_Ouverture[i]);
    if (pFen)
    {
        air_facade = pFen->get_air();
    }

The rather strange &* is the simplest way to turn a smart-pointer into a real address.  * returns a reference to the object the smart pointer refers to; & obtains it's address.  (There are ways this can break, but you don't need to worry about them.)
I strongly recommend the virtual in Ouverture.


text:
Q: Calculations on Jquery created items don't work I have this bit of code - works perfectly
$('.canti,.precio').change(function() {
 var total = 0;
 var $item = $(this).parent();
 var canti = $item.find(".canti").val();
 var precio = $item.find(".precio").val();
 total = parseFloat(canti * precio);
 $item.find(".subto").attr("value", total);
});

it makes calculations based on a field set
<fieldset class="item">
<input name="item[]" type"text" value="" />
<input class="canti" name="cantidad[]" type"text" value="" />
<input class="precio" name="preciounitario[]" type"text" value="" />
<input class="subto" name="importe[]" type"text"value="" readonly="readonly"/>
</fieldset>

I had multiple actual fieldsets and it worked perfectly. However rather than initially having X fieldsets I wanted the user to be able to add as they required, so wrote this:
var newFieldset='<fieldset class="item"><input name="item[]" type"text" value="" /><input class="canti" name="cantidad[]" type"text"  value="" /><input class="precio" name="preciounitario[]" type"text"  value="" /><input class="subto" name="importe[]" type"text"value="" readonly="readonly"/></fieldset>'
$(".add").click(function(){
    $(".add").before(newFieldset);
});

Again - works perfectly and adds in a new fieldset BUT the calculations on the .canti and .precio items in the new "virtual" fieldsets don't do anything.
Any ideas? Is what I'm hoping to do even possible?
There's a more complete version at http://www.cristalyaluminiodiestro.com/estimate-create-testing

A: Need to delegate the Event
You can use the jQuery .on() method
$('body').on('change','.canti,.precio' ,function() {

That is because the way you are adding the events will not work for dynamically created elements
'body' can be replaced with the closest static parent container..

A: Yes this is possible, you just need to attach the event handler to an element that is a ancestor of all, this is possible using the on method:
$('body').on('change', '.canti,.precio', function() { ... });

This is the case because the change handler is only attached to the elements that pass the '.canti,.precio' filter on DOM ready - the elements that you add dynamically will obviously not be present and so will not have the handler attached.
In my example above I have used the body element as the common ancestor of all elements, if you're able to do so it is preferable to use a closer common ancestor for performance resons.


text:
Q: Parsing Nested Arrays using VBA and JSON I have a JSON I am trying to parse in VBA. I have successfully parsed out the array of "offers". Inside the array of "offers" is another array "prices""USD".
The problem is that not every "offers" object has the "USD" array. I am trying to create an object that I can make a table/sheet with but I can't even get the objects to print in debug mode. This works but fails because not every Dict OfferDetails contains the "USD" object.
What I would like to do is be able to print the string and if the "USD" object is missing just skip it and only print the ones that have the "USD". I have tried the IsMissing (in code) but it fails when it hits the missing "USD" object.
Any idea how I can get this string with the "USD" values? Note that the "USD" is an array and contains several objects, but I don't know how to address them either. Ideally I would like to parse out the "USD" the same way I did the "offers". I am totally lost as I am not very good in VBA
This is a working script with a valid web JSON.
  Sub getJSONEP_lib_working()
      'Need the JsonConverter found here https://github.com/VBA-tools/VBA-JSON
      'Need the Microsoft Scripting Runtime

      Dim Parsed As Dictionary
      Dim Item As Dictionary
      Dim OfferDetails As Dictionary
      Dim Price As Dictionary
      Dim USD As Dictionary

              URL = "http://wraymac.com/JSON/example1.json"
              url2 = "[{" & """mpn""" & ":" & """41202""" & "}]"

              Set MyRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
              MyRequest.Open "GET", URL
              MyRequest.Send

              JsonString = MyRequest.ResponseText

              Dim json As Object
              Set json = JsonConverter.ParseJson(JsonString)

      Set Parsed = JsonConverter.ParseJson(MyRequest.ResponseText)

         For Each Item In Parsed("results")(1)("items")
           For Each OfferDetails In Item("offers")

      'I tried this it doesn't work, it fails when it finds a non existent "USD"
            If Not IsMissing(OfferDetails("prices")("USD")(1)(1)) Then
            Debug.Print OfferDetails("prices")("USD")(1)(1)
            Else
            Debug.Print "Missing"
            End If

      x = Item("mpn") & "   " & "sku" & " - " & OfferDetails("sku") & "," & "UID" & " - " & OfferDetails("seller")("uid") & "   " & OfferDetails("moq") & "packaging" & " = " & OfferDetails("packaging") & "  " & OfferDetails("seller")("name") & "  " & Item("manufacturer")("name")
      Debug.Print x

      'This works but fails because not every Dict OfferDetails contains the "USD" object
      'x = Item("mpn") & "   " & "sku" & " - " & OfferDetails("sku") & "," & "UID" & " - " & OfferDetails("seller")("uid") & "   " & OfferDetails("moq") & "packaging" & " = " & OfferDetails("packaging") & "  " & OfferDetails("seller")("name") & "  " & Item("manufacturer")("name")& "  "&OfferDetails("prices")("USD")(1)(1)

       Next OfferDetails
           Next

      End Sub

A: You want to use the Dictionary's Exists method:
Set Parsed = JsonConverter.ParseJson(MyRequest.ResponseText)

For Each Item In Parsed("results")(1)("items")
    For Each OfferDetails In Item("offers")

            If OfferDetails("prices").Exists("USD") Then
                Debug.Print OfferDetails("prices")("USD").Count & " items:"
                Debug.Print "-----------------"
                For Each x In OfferDetails("prices")("USD")
                    Debug.Print x(1), x(2)
                Next x
                Debug.Print "-----------------"
            Else
                Debug.Print "No USD"
            End If

     Next OfferDetails
 Next

The converter parses objects ({}) to dictionaries, and arrays ([]) to collections, so you can use Count to determine the number of items in each of those types of object.


text:
Q: Running .sh file from python script I am trying to run a .sh file from a python script. However, the .sh file contains in it a function that requires inputs.
So if I were to run the .sh file from the terminal it would look like:
./test.sh 1 2
I can see that in python, subprocess.call(['./test.sh']) won't work because there is no room for arguments. Is there any other branch of subprocess I can use?

A: Arguments are additional elements in the list.
subprocess.run(['./test.sh', '1', '2'])

You should also use subprocess.run() rather than subprocess.call(), which is an obsolete method.

A: You can do this. Have a look here in the docs:
Python2:
https://docs.python.org/2/library/subprocess.html
Python3.8:
https://docs.python.org/3.8/library/subprocess.html
example:
subprocess.call(["ls", "-l"])

A: You can do too with the function:
try:
    ressys = subprocess.check_call('script.sh',  shell=True)
except subprocess.CalledProcessError, e:
    res = str(e.output) + " -- Code: " + str(e.returncode)
    print res


text:
Q: Facebook Android SDK AppEvents not recognizing users on Insights Dashboard How are you?
We are integrating our App with AppEvents. To do so we are following this guide.
We are first trying to register simple default events after user logs in and interact with the App (ie AppEventsConstants.EVENT_NAME_ADDED_TO_CART).   As far as we could see, data is being posted ok (App Id and logged in user Access Token seems to be ok) and we get no errors on the app.
When we enter to Events section on Insights the data we sent is there but the info about the user isn't being processeed. For example, only gender and country filters with "Unknown" return results.
We are using SDK v3.23.1.
Thanks in advance!

A: Update based on Facebook Team answer:

This is actually by design. We do not show breakdowns for events when
  the number of unique users that have fired that event is too low. The
  reason is that with a small number of users for a certain event, it
  may be possible to deduce who those users are. Once the number of
  users exceed a certain threshold, this breakdown will be available,
  and no longer show up as "Unknown". This is threshold is currently set
  at 100, but is subject to change.


text:
Q: Organise image files into year/month folders I use MS OneDrive to sync photos taken on my Android phone to my Mac (they are synced to ~/OneDrive/Photos/Camera Roll).  I would like to move the synced files into folders organised by Year and Month (Year/Month) that the photo was taken (or simply the file creation date).
Ideally this process would run whenever new photos are added to the Camera Roll folder.
I took a look at Automator Folder Actions, but it seems limited to only doing the exact same thing to everything that gets added to the folder (e.g. move all new items into a specific folder).
I found a PowerShell script that does exactly this in Windows, but haven't found any corresponding scripts or free apps that do this in macos.
Any suggestions?

A: You could use the folder actions to run a bash script like this:
#!/bin/bash

DIR="/Users/USERNAME/OneDrive/Photos/Camera Roll"
target=$DIR
cd "$DIR" || exit

for file in *; do
    # Top year folder name
    year=$(stat -c "%y" "$file" | awk '{print substr($0,0,4)}')
    # Secondary folder name
    subfolderName=$(stat -c "%y" "$file" | awk '{print substr($0,6,2)}')

    if [ ! -d "$target/$year" ]; then
        mkdir "$target/$year"
        echo "starting new year: $year"
    fi
    if [ ! -d "$target/$year/$subfolderName" ]; then
        mkdir "$target/$year/$subfolderName"
        echo "starting new day & month folder: $subfolderName"
    fi
    echo "moving file $file"
    mv "$file" "$target/$year/$subfolderName"

done

You can also modify the directory names to include the day or the year and the month by changing the selected substring in the substr command.

A: I found Organize - an open source and free of charge command line tool designed to do exactly this sort of thing.
The following config does the trick:
rules:
  # Move photos into Year/Month folders in My Photos
  - folders: ~/OneDrive/Pictures/Camera Roll
    filters:
    - extension: jpg
    - created
    actions:
     - move: ~/Pictures/My Photos/{created.year}/{created.month:02}/

I then created an Automator Folder Action that will Run a Shell Script anytime a file is added to the OneDrive Camera Roll:
/usr/local/bin/organize run --config-file=~/OneDrivePhotoSync.yaml


text:
Q: Alternate which plot gets new line? I'm collecting data over time which I'd like to plot in two studies on the same plot. At issue for me is the order of how the data is gathered and added to the plot as time proceeds. For the sake of example, the following code plots the same set of random values twice and adds two lines to each study:
# 2 figures arranged in 2 rows
par(mfrow=c(2,1))
set.seed(123)
A = sample(seq(from = -2, to = 2, by = 0.1), size = 10, replace = TRUE)

plot(seq(1:10),A, main="Plot 1")
abline(1.2,0, col="red") #First line added
abline(-0.3,0, col="blue") #Third line added

plot(seq(1:10),A, main="Plot 2")
abline(0.7,0, col="green") #Second line added
abline(-0.5,0, col="purple") #Fourth line added

What I need to do is execute both plot commands at the beginning and then execute the addition of the 4 lines in the order of red, green, blue, purple. I.e. add a line to the top study, add a line to the bottom study, and as new data appears alternate between the two studies. I.e. - I'd like the code to execute like:
plot(seq(1:10),A, main="Plot 1")
plot(seq(1:10),A, main="Plot 2")
#Wait awhile
abline(1.2,0, col="red") #First line added
abline(0.7,0, col="green") #Second line added
#Wait awhile
abline(-0.3,0, col="blue") #Third line added
abline(-0.5,0, col="purple") #Fourth line added

How might I do this in R, hopefully using plot and not one of the more esoteric plot libraries.

A: The simplest approach is to just recreate the entire plot each time.  Create the 2 plots, then when the first additional data comes in, redraw the 1st plot and add the line, then redraw the 2nd plot and redraw the line.  When more data comes in: redraw the 1st plot add the 1st line, add the 2nd line, ...
If you really insist on not redrawing the plots then you can draw the 1st plot and save the graphics options using something like par1 <- par(no.readonly=TRUE).  Then draw the second plot and save the options again par2 <- par(no.readonly=TRUE).
Now you can go back to the 1st plot by first resetting the plotting parameters then using par(mfg=c(1,1)).
For example:
par(mfrow=c(2,1))

plot( 1:10, 1:10 )
par1 <- par(no.readonly=TRUE)

plot( 101:110, 110:101 )
par2 <- par(no.readonly=TRUE)

par(par1)
par(mfg=c(1,1))
abline(h=5)

par(par2)
par(mfg=c(2,1))
abline(h=105)

You can keep going back and forth with par(mfg=..., but remember to also set the graphical parameters as well.

A: Take a look at the mfg argument of the par() function.  For example:
A <- sample(seq(from=-2, to=2, by=0.1), size=10, replace=TRUE)

par(mfrow=c(2, 1))
plot(seq(1:10), A, main="Plot 1")
    abline(1.2, 0, col="red")
plot(seq(1:10), A, main="Plot 2")
    abline(0.7, 0, col="green")

par(mfg=c(1, 1))
    abline(-0.3, 0, col="blue")

par(mfg=c(2, 1))
    abline(-0.5, 0, col="purple")


text:
Q: Can I use games already installed on Xbox 360 hard drive? I just bought an Xbox 360 hard disk, with previously installed games. Inspecting it with FatXplorer, I can see a list; some games are shown as "Console Signed" and others as "PIRS Signed"

I don't have my X360 working at the moment, so I can't test, but my question is: will I be able to play these games in future, installing this HD (obviously on a different console than the one it was before), and logging into my own XBox account? Or do I need something else? Can the previous owner "reclaim" the property over these games using his own gamertag?

A: Games installed via disk still require the disk to be inserted to run them. Downloaded content from the marketplace requires the buyer to still be signed into the system or have the system be set as the buyer's home system.
You shouldn't be able to play any of the games previously installed.


text:
Q: Retrofit with Logansquare Unable to create converter for java.util.ArrayList I am using Retrofit 2 with Logansquare converter. Here's my call:

    @GET("v1/account/notification/{accountId}")
    Call<ArrayList<Message>> getUnreadMessages(@Path("accountId") String accountId);

And here's the crash log message:

Caused by: java.lang.IllegalArgumentException: Unable to create converter for java.util.ArrayList<com.example.dataModels.Message>

My Message class:
@JsonObject
public class Message {

    @JsonField
    public String _id;
    @JsonField
    public String message;
    @JsonField
    public String createdAt;

    public Message() {
    }
}

Is there a solution to this? Please help.


text:
Q: Is it possible to update Chrome WebDriver options? Is it possible to change Chrome WebDriver ChromeOptions/Capabilities after creation of the WebDriver object?
Map<String, Object> preferences = new HashMap<String, Object>();
preferences.put("download.default_directory", "C:/downloads/");

ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("prefs", preferences);

DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);

WebDriver driver = new ChromeDriver(capabilities);

// do some stuff with the driver
// is it possible to change the default download directory here?

EDIT 1:
I have few hundred subpages on my website, each of them has few attachments. I would like to create the tree of the directories (each directory contains files connected only to this specific subpage).

A: Once you set the chromedriver options, its fixed to the driver instance, so it cannot be changed. An approach to going about this, will be to tear down the instance and create a new one with the updated path.


text:
Q: Prevent Binding of not existing Items
'ddlUser' has a SelectedValue which is invalid because it does not
  exist in the list of items. Parameter name: value

This is the Errormessage i get, when I call the following Code:
ASPX:
<asp:FormView ID="FormView1" runat="server" DataSourceID="EntityDataSource1">
  <EditItemTemplate>
      <asp:DropDownList runat="server" ID="ddlUser" Selectedvalue='<%# Bind("UserID") %>'
                        AppendDataBoundItems="true" DataSourceID="EntityDataSource2"
                        DataTextField="UserName" DataValueField="UserID" >
          <asp:ListItem></asp:ListItem>
       </asp:DropDownList>

<asp:EntityDataSource ID="EntityDataSource2" runat="server" EntitySetName="User" AutoGenerateWhereClause="true">
    <WhereParameters>
        <asp:Parameter Name="deleted" DefaultValue="false" Type="Boolean" />
    </WhereParameters>
</asp:EntityDataSource>

The reason for this issue is, that EntityDataSource2 only selects not deleted users. BUT selected users can be deleted any time and then they appear no longer in the result, which leads to this error.
I've searched for answers and only fond this one, which works but produces duplicate entries (because DataBind is called twice). Another discussion here without result.
Question: How can I prevent this error and select the empty item if the user was deleted in the meantime.

What i've tried so far:
First I thought of
protected void DropDownList1_DataBinding(object sender, EventArgs e)
{
    DropDownList DropDownList1 = (DropDownList)sender;
    if(!Helper.CheckIfValid(DropDownList1.SelectedValue))
    {
       DropDownList1.SelectedValue = "";
    }
}

but the SelectedValue  is not set at DataBinding event.

A: I suggest you define a custom control in your project (and reference it instead of asp:DropDownList) derived from the standard DrowDownList that will not throw when the selection is not defined as an item in the list.
If should work as is (by default, the empty value item will be selected), but you can also define what you consider as the value or the text that represent the "not selected" item using one of its properties. Here is the class:
public class ExtendedDropDownList : System.Web.UI.WebControls.DropDownList
{
    protected override void PerformDataBinding(IEnumerable dataSource)
    {
        try
        {
            base.PerformDataBinding(dataSource);
        }
        catch (ArgumentOutOfRangeException)
        {
            ListItem item;

            // try the value we defined as the one that represents <no selection>
            if (NoSelectionValue != null)
            {
                item = Items.FindByValue(NoSelectionValue);
                if (item != null)
                {
                    item.Selected = true;
                    return;
                }
            }

            // try the text we defined as the one that represents <no selection>
            if (NoSelectionText != null)
            {
                item = Items.FindByText(NoSelectionText);
                if (item != null)
                {
                    item.Selected = true;
                    return;
                }
            }

            // try the empty value if it exists
            item = Items.FindByValue(string.Empty);
            if (item != null)
            {
                item.Selected = true;
                return;
            }
        }
    }

    [DefaultValue(null)]
    public string NoSelectionValue
    {
        get
        {
            return (string)ViewState[nameof(NoSelectionValue)];
        }
        set
        {
            ViewState[nameof(NoSelectionValue)] = value;
        }
    }

    [DefaultValue(null)]
    public string NoSelectionText
    {
        get
        {
            return (string)ViewState[nameof(NoSelectionText)];
        }
        set
        {
            ViewState[nameof(NoSelectionText)] = value;
        }
    }
}

}

A: This is a work around suggestion. I think this is not a clean solution but hope it could help.
The reason for this issue is that the selected item does not exist in the list of items. To prevent it happens, we should ensure that the selected item will always  exist by doing as following.
We add an item that has the same value as selected value.
<asp:DropDownList runat="server" ID="ddlUser" Selectedvalue='<%# Bind("UserID") %>'
                        AppendDataBoundItems="true" DataSourceID="EntityDataSource2"
                        DataTextField="UserName" DataValueField="UserID"
                        OnDataBound="OnListDataBound" >
          <asp:ListItem Value="">(none)</asp:ListItem>
          <asp:ListItem Value='<%# Bind("UserID") %>'></asp:ListItem>
</asp:DropDownList>

Then on DataBound event, we do addition check to find out weither the selected value is valid or not.

*

*If there is only one list item that has same value as selected value,
it should be invalid selected value. We should remove it from list
and reset selected value to empty.

*If there are two items that have same value as selected value, we should remove the item which has empty text and set selected value to the remain item.

protected void OnListDataBound(object sender, EventArgs e)
{
   // addition check
}

UPDATE
After revising the problem, seem I've been thinking too complicated. My above suggestion is also a bad solution.
Obviously, it's not valid to select an item that doesn't exist in the list. So instead trying to bind a value that could be invalid, why don't we remove it, and then select the correct value in code behind?
ASPX
<asp:DropDownList runat="server" ID="ddlUser"
     AppendDataBoundItems="true" DataSourceID="EntityDataSource2"
    DataTextField="UserName" DataValueField="UserID"
    OnDataBound="OnListDataBound" >
          <asp:ListItem Value="">(none)</asp:ListItem>
</asp:DropDownList>

Code-behind
protected void OnListDataBound(object sender, EventArgs e)
{
    DropDownList dropdown = (DropDownList)sender;
    string userId = string.Empty;

    // Assign value for userId from FormView1.DataSource
    ....

    // Check to select valid item
    ListItem foundItem = dropdown.Items.FindByValue(userId);
    if (foundItem != null)
    {
        dropdown.SelectedValue = userId;
    }
    else
    {
        dropdown.SelectedValue = string.Empty;
    }
}


text:
Q: Holomorphic extension of the Laplace transform Let $u \in L^1_{\mbox{loc}}((0,+\infty))$ be such that $e^{-\lambda t} u(t) \in L^1((0,+\infty))$ for some $\lambda >0$. Let $\mathcal{L}[u]$ be the Laplace transform of $u$, that is
$$\mathcal{L}[u](s) = \int_0^{+\infty}e^{-st}u(t)\,dt \qquad\mbox{ for all}\, s \in \mathbb{C} \,\mbox{ s.t. } \mbox{Re}(s)>\lambda.$$
If $\mathcal{L}[u]$ is holomorphic in $\mbox{Re}(s)>\lambda$ and admits a holomorphic extension $F(s)$ to the semi-plane $\mbox{Re}(s)>\lambda_1$ with $\lambda_1 < \lambda$, then is it true that $e^{-\lambda_2 t} u(t) \in L^1((0,+\infty))$ for all $\lambda_2 > \lambda_1$ and $\mathcal{L}[u](s) = F(s)$ in $\mbox{Re}(s)>\lambda_1$? Do you have a proof or a reference for this fact?

A: This is not the case, there are functions whose Laplace transform is entire (or rather, whose Laplace transform is the restriction of an entire function to a half-plane) but the integral converges only for $\operatorname{Re} s > \lambda_0$. I will give an example constructed from the Dirichlet $\eta$ function. Using
$$\frac{1}{n^s} = s\int_n^{+\infty} \frac{dx}{x^{s+1}} = s\int_1^{+\infty} \frac{\chi_{[n,+\infty)}(x)}{x^{s+1}}\,dx$$
(where $n^s$ and $x^{s+1}$ are formed using the real logarithm of $n$ and $x$) one obtains an integral representation for a Dirichlet series
$$F(s) = \sum_{n = 1}^{+\infty} \frac{a_n}{n^s}\,, \tag{1}$$
namely
$$F(s) = s\int_1^{+\infty} \frac{A(x)}{x^{s+1}}\,dx \tag{2}$$
where
$$A(x) = \sum_{n \leqslant x} a_n\,.$$
In the half-plane of absolute convergence of $(1)$ we can interchange summation and integration in
$$F(s) = \sum_{n = 1}^{+\infty} s\int_1^{+\infty} \frac{a_n \chi_{[n,+\infty)}(x)}{x^{s+1}}\,dx$$
by the dominated convergence theorem, and
$$\sum_{n = 1}^{+\infty} a_n\chi_{[n,+\infty)}(x) = A(x)\,.$$
By the identity theorem, $(2)$ holds on every half-plane where both sides are defined. Now consider the entire function
$$F(s) = \eta(s) - \eta(0)\,.$$
For $\operatorname{Re} s > 0$ this is given by the Dirichlet series
$$\frac{1}{2} + \sum_{n = 2}^{+\infty} \frac{(-1)^{n-1}}{n^s}$$
and consequently by the integral
$$s\int_1^{+\infty} \frac{B(x)}{x^{s+1}}\,dx$$
where
$$B(x) = \frac{1}{2}\cdot (-1)^{\lfloor x\rfloor - 1}$$
for $x \geqslant 1$. Making the substitution $x = e^t$ we find that for $u(t) = B(e^t)$ we have
$$\mathcal{L}[u](s) = \int_0^{+\infty} u(t)e^{-st}\,dt = \int_1^{+\infty} \frac{B(x)}{x^{s+1}}\,dx = \frac{\eta(s) - \eta(0)}{s}$$
for $\operatorname{Re} s > 0$. So the Laplace transform of $u$ has a holomorphic continuation to the entire plane, but since $\lvert u(t)\rvert = \frac{1}{2}$ for all $t \geqslant 0$ we have $u(t)e^{-\lambda t} \in L^1((0,+\infty))$ if and only if $\lambda > 0$. And the integral also doesn't exist as an improper Riemann integral for $\operatorname{Re} s \leqslant 0$.
However, things are different if $u$ is eventually nonnegative (or nonpositive). If $u \in L^1_{\text{loc}}((0,+\infty))$ and there is a $t_0$ such that $u(t) \geqslant 0$ for $t \geqslant t_0$, then
$$\lambda_0 = \inf \: \Biggl\{ \lambda \in \mathbb{R} : \int_{t_0}^{+\infty} u(t)e^{-\lambda t}\,dt < +\infty\Biggr\}$$
is a singularity (not necessarily a pole) of $\mathcal{L}[u]$. (This is strongly related to Landau's lemma for Dirichlet series with nonnegative coefficients.)


text:
Q: MVC Durandal app doesn't work when deployed to IIS The platform is IIS on Win8.1
The project is created from the Durandal project template. No changes are made, and the project is run: the Durandal start kit appears in a web browser.
The project is deployed to a folder D:\Client
IIS manager is used to map a virtual application off the default web to D:\Client. The app pool for this is specified as DefaultAppPool which on my machine is set to FX4.0 and runs with my user credentials. Deliberately setting it to FX2.0 produces a 502 as expected. This implies that the FX version is not the problem.
http://localhost/Client produces the splash screen but the app hangs there. Using the browser's own debugger reveals that main has NOT been executed.
Loaded:

*

*bootstrap.js

*jquery-1.9.1.js

*knockout 2.3.0.debug.js

*require.js

Has anyone experienced this and what did you do to resolve it?

A: Virtual Directories are created to serve static content as far as I understand. ( Just a subfolder of another application ). As the StarterKit runs using MVC4/5 you need also ASP.NET support thus creating a normal application ( parallel to defaultapp ) should do the trick.
If you did that already that way maybe you're missing some files. Had a situation where some files weren't deployed ( eg. the views folder ). Double check if those are present.


text:
Q: Next week implementation in android In my sample project i have to implement next week Monday to sunday in a text view (like 6 May >> 12 My). on click of next button it must show next week start date and end date (like 13 May >> 19 May). I have implemented the intial week view with the following code
   Calendar c = Calendar.getInstance();
    c.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
    SimpleDateFormat df = new SimpleDateFormat("dd MMMM");
    String printDate = df.format(c.getTime());
    //gestureEvent.setText(reportDate);
    c.add(Calendar.DAY_OF_WEEK, 6);
    String printDate2 = df2.format(c.getTime());
    gestureEvent.setText(reportDate +" >> "+reportDate2);

on click of next week button i have done this but it static it was just an attempt attempt
:)
onclick will call this function goNextWeek()
public void goNextWeek()
{

    Calendar c = Calendar.getInstance();
    c.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);

        c.add(Calendar.DAY_OF_WEEK, 6);
        System.out.println("End Date : " + c.getTime());

        SimpleDateFormat df = new SimpleDateFormat("dd MMMM");
        String reportDate = df.format(c.getTime());
        gestureEvent.setText(reportDate);
        c.add(Calendar.DAY_OF_WEEK, dates);
        c.add(Calendar.DAY_OF_WEEK, 1);
        System.out.println("End Date asdfadf: " + c.getTime());

}

please tell me how to show next week start and end date?

A: Here is your solution.
Calendar mCalendar = new GregorianCalendar();
        mCalendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
        SimpleDateFormat mDF = new SimpleDateFormat("dd MMMM");
        String printDate = mDF.format(mCalendar.getTime());
        mCalendar.add(Calendar.DAY_OF_MONTH, 6);
        String printDate2 = mDF.format(mCalendar.getTime());

        System.out.println(printDate + " >> " + printDate2);
        gestureEvent.setText(printDate + " >> " + printDate2);

Update for implementation on button
Write a method, which will take weekNumber as params..
private static String getNextWeek(int weekFromToday) {
        Calendar mCalendar = new GregorianCalendar();
        mCalendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
        mCalendar.set(Calendar.WEEK_OF_YEAR,
                mCalendar.get(Calendar.WEEK_OF_YEAR) + weekFromToday);

        SimpleDateFormat mDF = new SimpleDateFormat("dd MMMM");
        String printDate = mDF.format(mCalendar.getTime());
        System.out.println(printDate);

        //gestureEvent.setText(reportDate);
        mCalendar.add(Calendar.DAY_OF_MONTH, 6);
        String printDate2 = mDF.format(mCalendar.getTime());
        System.out.println(printDate + " >> " + printDate2);
        return printDate + " >> " + printDate2;
    }

Now declaire a static filed as
private static int weekNumber = -1;

and write below code on button click
weekNumber = weekNumber + 1;
gestureEvent.setText(getNextWeek(weekNumber));

This will work.
Happy coding :)

A: This kind of date-time work is easier with the Joda-Time 2.3 library.
If you truly want date only without time component, modify this code to use LocalDate class rather than DateTime.
// © 2013 Basil Bourque. This source code may be used freely forever by anyone taking full responsibility for doing so.
// import org.joda.time.*;
// import org.joda.time.format.*;

DateTime today = new DateTime().withTimeAtStartOfDay();

// Monday
DateTime monday = today.withDayOfWeek( DateTimeConstants.MONDAY ).withTimeAtStartOfDay();
if ( !(monday.isAfter( today )) ) {
    // If monday is today or earlier, move forward to future.
    monday = monday.plusWeeks( 1 );
}

// Sunday
DateTime sunday = today.withDayOfWeek( DateTimeConstants.SUNDAY ).withTimeAtStartOfDay();
if ( !(sunday.isAfter( today )) ) {
    // If sunday is today or earlier, move forward to future.
    sunday = sunday.plusWeeks( 1 );
}

System.out.println( "today: " + today );
System.out.println( "Monday: " + monday );
System.out.println( "Sunday: " + sunday );

When run…
today: 2013-12-08T00:00:00.000-08:00
Monday: 2013-12-09T00:00:00.000-08:00
Sunday: 2013-12-15T00:00:00.000-08:00


text:
Q: How to redirect admin user on login page if user is not authorized or not logged in I know this may be duplicate question but I am new to laravel and i am getting issue of localhost redirected you too many times. I want to do user should redirect on admin/login page in below scenario

*

*if admin user is not logged in.

*if the user is not admin and trying to access  then user should redirect to
http://localhost/blog/public/admin/login this url
In both cases system should redirect to admin/login page and ask for user to login but my code is not working according to my expectation.
My web.php is
Route::group(['prefix'=>'admin','middleware'=>['admin']],function(){
    Route::get('/',"admin\AdminController@index");
    Route::get('login',"admin\UserController@login");
    Route::post("checkLogin","admin\UserController@checkLogin");
    Route::resource('products',"admin\ProductController");
    Route::resource('categories','admin\CategoryController');
    Route::resource('roles','admin\roleController');
    Route::resource('users','admin\UserController');

});

my admin middleware  is
 public function handle($request, Closure $next)
    {
        if(Auth::check() && (Auth::user()->user_type=="admin") ){
         return $next($request);
        }
           return redirect('admin/login');
    }

It shows me This page isn't working what things i need to do in my middleware so that only admin user will get logged in .

A: Really need to see your controller code but this may be a good start.
Remove this:
Route::post("checkLogin","admin\UserController@checkLogin");

Change to:
Route::post("login","admin\UserController@checkLogin");

Because you should use the same login route name, one for post and one for get.
Handle Method
 public function handle($request, Closure $next, $guard = null)
        {
            if (Auth::guard($guard)->check()) {
                return redirect('/admin/login');
            }

            return $next($request);
        }

A: I think your problem is easy to fix,
try to replace this line:
return redirect('admin/login');
to this line:
return redirect('/admin/login');

A: In admin middleware you are checking auth with admin user_type, that means any unauthenticated request or none admin user_type get redirect to login route. However, your login route is also inside admin middleware so it get redirect loop. Your routes should be like this
Route without admin middleware
Route::group(['prefix'=>'admin'],function(){
    Route::get('login',"admin\UserController@login");
    Route::post("checkLogin","admin\UserController@checkLogin");
}

Route With admin middleware
Route::group(['prefix'=>'admin','middleware'=>['admin']],function(){
    Route::get('/',"admin\AdminController@index");
    Route::resource('products',"admin\ProductController");
    Route::resource('categories','admin\CategoryController');
    Route::resource('roles','admin\roleController');
    Route::resource('users','admin\UserController');
});

You can use admin namespace in Route::group so that you don't have to add admin\ in each controller name


text: Q: Switching user accounts on minecraft? We have three people in a family sharing two computers (and two Minecraft Bedrock Windows 10 accounts). Let's call them Tom, Dick, and Harry, using Minecraft accounts A and B. So, Tom and Dick usually play together on a world. But Harry wants to play on that world with Tom while Dick is off doing other things. Tom plays on account A and hosts the game, and Dick usually uses account B and joins as a guest/member. Harry could use Dick's account B and join the world, but then he would have all of Dick's stuff and Dick might log in to find his inventory rearranged and his character halfway across the map from where he was before. I want to know if Harry could also log into Tom's account A and play simultaneously as a guest/member with Tom (though they'd probably share a username, that's not a huge deal since its just the two of them on the world), so that he can potentially start as a separate character and have his own stuff and not mess up the inventory and location of Dick. Would this work, and is there a way to easily log in and out between accounts A and B on the single computer?


text:
Q: Changing Redmine URL structure and adding other domains I have set up a Redmine installation on a Windows server using the BitNami stack.
I would like to

*

*change the path of the URL that is used to address redmine at the moment (www.example.com/redmine/...) if possible without physically relocating the installation.

*map additional subdomains to certain projects (www.example2.com pointing directly at what is now at www.example.com/redmine/projects/projectname)
I am apt in Apache configuration, but a total Ruby / Rails newbie and at the moment, can't delve into it as deeply as I want to because of time constraints.
I'd appreciate pointers to HOWTO's and good documentation on how to apply such changes to a standard setup. A list of configuration files that I need to take a look into might already do as well, I just don't yet know my way around a Ruby application.
The stack consists of

*

*Redmine 0.9.3

*Apache 2.2.14

*MySQL 5.1.30

*Ruby 1.8.7-2010.01

*Rails 2.3.5

*RubyGems 1.3.5

A: There's a pretty active forum for the BitNami stack. First forum results:

*

*Rewriting the Redmine URL on Windows
working through that now. Additional input is still welcome of course.


text:
Q: Unity NullReferenceException: Object reference not set to an instance of an object Player.Update () (at Assets/Scripts/Player.cs:22) Sou novo no unity e ja rescrevi o codigo e de acordo com o tutorial que vi mas nao resolve
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour
{
    public float ForceMultiplier = 3f;
    public float maximumVelocity = 3f;

    void Start()
    {

    }

    void Update()
    {
      var HorizontalInput = Input.GetAxis("Horizontal");
      if (GetComponent<Rigidbody>().velocity.magnitude <= maximumVelocity){

        GetComponent<Rigidbody>().AddForce(new Vector3(HorizontalInput * ForceMultiplier, 0, 0));

      }
    }

    private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.CompareTag("Hazard"))
        {
          Destroy(gameObject);
        }
    }

}

A: Faça uma verificação se o GameObject onde está destinado seu script tens o componente Rigidbody.
Após fazer essa verificação e confirmar que ele é um componente no GameObject, destine o GetComponent no Start da seguinte maneira...
private Rigidbody rb;

void Start(){
   rb = GetComponent<Rigidbody>();
}

Quando o GameObject for ativo em cena ele buscara o componente Rigidbody dentro do componente pai.
Caso houver a necessidade de consultar um Rigidbody em um GameObject filho, você terá que usar o seguinte código.
private Rigidbody rb;

void Start(){
   rb = GetComponentInChildren<Rigidbody>();
}

Outra forma é você deixar esta variável como pública e linkar ela diretamente pelo inspector, arrastando o GameObject onde contem o Rigidbody, desta maneira não será necessário dar um GetComponent pelo script.
Depois de ter estes passos em mente vamos para o seu código...
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour
{
    public float ForceMultiplier = 3f;
    public float maximumVelocity = 3f;
    private Rigidbody rb;

    void Start()
    {
        rb = GetComponent<Rigidbody>();
    }

    void Update()
    {
      var HorizontalInput = Input.GetAxis("Horizontal");
      if (rb.velocity.magnitude <= maximumVelocity){

        rb.AddForce(new Vector3(HorizontalInput * ForceMultiplier, 0, 0));

      }
    }

    private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.CompareTag("Hazard"))
        {
          Destroy(gameObject);
        }
    }

}

A: Primeiramente recomendo você a não usar GetComponent. Ao invés disso, declare a variável do tipo que você quer, exemplo : Você está dando um Getcomponent no Rigidbody do objeto na qual essa classe está, faça assim [SerializeField] private Rigidbody rb = default;. Ao salvar esse código, na unity vai aparecer um campo pedindo "Qual objeto com Rigidbody eu pego ?", você arrasta o objeto que tem o rigidbody pra esse lugar e salva. No código, ao invés de você usar um GetComponent().velocity.magnitude você vai usar um rb.velocity.magnitude. As vantagens de você fazer isso é que o seu código não vai ficar buscando o objeto que tem esse componente várias vezes, ainda mais que você está chamando no Update, o Update vai buscar 30 ou 60 vezes por segundo esse objeto.
Vou refazer seu código como exemplo:
public class Player : MonoBehaviour
{
    public float ForceMultiplier = 3f;
    public float maximumVelocity = 3f;
    [SerializeField] private Rigidbody rb = default;

    void Start()
    {

    }

    void Update()
    {
      var HorizontalInput = Input.GetAxis("Horizontal");
      if (rb.velocity.magnitude <= maximumVelocity){

        rb.AddForce(new Vector3(HorizontalInput * ForceMultiplier, 0, 0));

      }
    }

    private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.CompareTag("Hazard"))
        {
          Destroy(gameObject);
        }
    }

}

O [SerializeField] serve para você tornar uma variável privada visível no editor (Unity).


text:
Q: Append row in data.frame using list of variable with same name of columns - R Language dears!
Summarizing my problem in a small example...
I want to append a row in data.frame using a list of variables with the same name of the data.frame columns, like this:
#createing a blank data.frame
df <- data.frame(matrix(ncol=3, nrow=0))
#naming the header
head <- c("col1", "col2", "col3")
# assigning header to data.frame
colnames(df) <- head
# creating three variables with the same name of header
col1 <- 1
col2 <- 2
col3 <- 3
#appending the row
rbind(df, list(col1, col2, col3))

The code runs, but the df continues blank. I would like a result like this for df:
col1    col2   col3
   1       2      3

Help me with this rbind.

A: If you use the names() function, you can rename the columns in R
#createing a blank data.frame
df <- data.frame(matrix(ncol=3, nrow=0))
#naming the header
head <- c("col1", "col2", "col3")
# assigning header to data.frame
colnames(df) <- head
# creating three variables with the same name of header
col1 <- 1
col2 <- 2
col3 <- 3
#appending the row
df2 <- rbind(df, list(col1, col2, col3))

names(df2) <- c("col1", "col2", "col3")

df2

produces the output below
  col1 col2 col3
     1    2    3


text:
Q: Releasing with Maven I recently released a maven project and could not stop thinking that the whole process is very complicated and error prone. Let us say I have an application which consists of 3 modules A, B and C, each having its own folder in subversion and a separate build job in Hudson. Each module has a parent POM which aggregates multiple artifacts. A depends on B, and B depends on C. The dependency versions are defined in a top level POM D, which is the parent of A, B and C. It does nothing else than making sure all versions are kept in one place and that there is only one version of each artifact used in the whole project. In order to make the release I do the following:

*

*Release the top level POM D with the release plugin through Hudson.

*Start at C which has no further dependencies.

*Change C to reference the released version of D. Release C with the release plugin.

*Enter the released version of C in D, so modules that depend on C can be released with the stable version of C.

*Release D again with the release plugin.

*Do 3-5 for B

*Do 3-5 for A

After that I have stable non-snapshot builds of all artifacts in A, B and C and can assemble them together to a final stable release of the application.
In real, I had not only 3 but like 20 such modules. Now I find this procedure very complicated and I think it has a lot of potential problems:

*

*I need to release D several times, once for each level in the dependency hierarchy. In the end I have D with only stable versions of A, B and C in it. To go on with the next development version I have to edit D again and reference all the new snapshot versions of the released modules. In general, the dependency management has to be done all by hand, even when using the release plugin.

*If somebody commits while I am doing the release it could mess up things. To be sure I would have to checkout a specific revision over all modules, build and test it, and then do the release for all modules on that revision. But how do I ensure that with Hudson and multiple jobs?

*Dependent on 3 different systems: Subversion server, Hudson server and the Maven archive server. If only one is down I can not release anymore.

*Time consuming. In this process a lot of building, packaging, uploading, downloading, extracting, etc. is made again and again for each module I release. A lot of redundant data exchange with the archive happens. But actually everything could be done locally, since Hudson has all the source code it needs. Just once in the end the final package needs to be uploaded.

*Say I loose the packages on the archive server. There is no easy way to tell Hudson to check out the tagged versions and rebuild them all in the proper order.
Why can this not be as easy as checkout all the code in one shot, adapt one global version, build and test it, commit, tag the commit and finally upload the binaries?
Thanks for any ideas on this.

A: It can be that easy.  Using a parent pom, you can have all your modules point to the same parent.  Then set the child modules version to: ${version.properties}, when you run a build run it with mvn -Dversion.properties x.y.x-SNAPSHOT (for dev) or x.y.z for a production build, then all the modules will be deployed at once with the same version.
So for an automated build to to specify a <version.properties>1.1.1-SNAPSHOT</version.properties> in the settings.xml, then if you need a released product specify an additional parameter at runtime with the -Dx.y.z to override the settings.xml file.
The only trick to this is your parent pom needs to have a non-dynamically-specified version, and that will need to be set in all the child documents as well.  So after each release you may want to update that version number manually (though there is probably a plugin for it)

A: If you are always releasing your modules in sync, I would have a single parent pom for the whole project which includes all the modules and makes sure all the version are the same.  When you release the top level, it releases all the modules in order with the right versions in one go.


text:
Q: Websocket close msg is not shown in chrome's developer tool? When debugging websocket messages, in chrome developer tool.
I can see normal data messages (similar as in here). But after close the connection (e.g normally), can't see the close msg, (though I did saw & print the msg via onclose handlers in client program).
Thus seems control msg is not show?
So, is there anyway to see close msg (and optionally ping/pong msg) in chrome developer tool?
Or I must use tools like wireshake or postman?


text:
Q: Why remove some files is so slow? While tidying up some folders I saw that deleting some files is very slow :
$ ls -lah a/
-rwxrwxrwx 1 user user    4 Nov 17 12:31 af8048e4aec858a02ac48119545413dd

$ time (rm -v af8048e4aec858a02ac48119545413dd)
removed 'af8048e4aec858a02ac48119545413dd'

real    0m7.908s
user    0m0.000s
sys     0m0.000s

While delete other file is like :
$ touch some_file
$ time (rm -v some_file)

removed 'some_file'

real    0m0.003s
user    0m0.000s
sys     0m0.000s

I don't understand what's going on. I fear about some hardware problem...
Any help is welcome and will be appreciated.
Thank you.

A: It depends on the size of the file and how fragmented the file is at the time of deletion.
Bigger files can take up more sectors on disk and are more likely to be more fragmented on the disk. The FS table has to remove the index entries for the file which can take longer if it has to find it on the disk.
It can also matter if there is driver performance issues or issues with the drive accessing that part of the disk.
If the drive has to zero the disk (secure erase) that will take time as well. I don't believe a simple "rm" will do a secure erase, but I know it will do it on database servers unless disabled.


text:
Q: Can we publish the customised changes in Microsoft BotFramework Webchat I am actually building a bot using C#, but I need speech support in that, then came to know that we can customise the chat window using this repo. Though, I have no idea about nodejs, as mentioned in the steps to follow, I have installed npm and was able to enable the speech functionality by following these steps.
Build the project: "npm run build"
Start a web server: "npm run start"
Aim your browser at "http://localhost:8000/samples?[parameters as listed below]"
My query is whether we can publish and use the customised changes, or the above steps have to be done all the time.

A: You do not need to build your own copy of Web Chat just to use speech.
Start with the Speech Sample.
Then make the following two changes to reference the CDN copy of WebChat. By pointing to this, your website will always have the latest version.
Change this line to:
<link href="https://cdn.botframework.com/botframework-webchat/latest/botchat.css" rel="stylesheet" />

And change this line to:
<script src="https://cdn.botframework.com/botframework-webchat/latest/botchat.js"></script>


text:
Q: WebScraping, Ignore Missing Items in For Loop. Selenium and BS4, Python I am having trouble with the for loop in the code below. I am currently trying to scrape ZocDoc and am looking to scrape multiple doctors url on the site for general info like: name, rating, number of reviews, bedside manner rating, etc. But the 2 variables causing trouble are 'language_spanish' and 'language_english'. For example, if the doctor does not speak Spanish and it is not listed on their profile, the 'language_spanish' variable will return a ''NoneType' object has no attribute 'text'' error since it does not exist in the HTML. If I eliminate the 'language_spanish' variable, the 'language_english' variable will work as well as the others(assuming both doctors at least speak English)(The temporary url list below contains 1 doctor who speaks English and Spanish, the other a doctor who speaks English and Arabic). How can I return a 'NULL' value for any one of the items in the for loop, should the item be missing on the doctors url. Thank you for any help.

PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)

questionlist_zoc_temp = ('https://www.zocdoc.com/doctor/danilo-hoyumpa-md-241162?LocIdent=101038&reason_visit=75&insuranceCarrier=-1&insurancePlan=-1&dr_specialty=153&spoAdDecisionId=244725316&ad_decision_token=e97292ba-57d2-418a-9fdd-bc69645de83f','https://www.zocdoc.com/doctor/george-girgis-md-97120?LocIdent=56500&reason_visit=75&insuranceCarrier=-1&insurancePlan=-1&dr_specialty=153&isNewPatient=true')

dr_data = []

for urls_dr in questionlist_zoc_temp:

    driver.get(urls_dr)
    sleep(randint(4,10))

    soup_dr = BeautifulSoup(driver.page_source, "html.parser")

    for dr_item in soup_dr:
            dr_scraper = {
            'name': dr_item.find('span', {'itemprop':'name'}).text,
            'specialties': dr_item.find('li', {'class':'krbmlv-5 cpBnTD'}).text,
            'review_count': dr_item.find('div', {'class':'sc-1evbz6z-2 qKvtL'}).text,
            'language_english': dr_item.find('li', {'data-test':'language-English'}).text,
            #'language_spanish': dr_item.find('li', {'data-test':'language-Spanish'}).text,
            'overall_rating': dr_item.find('div', {'data-test':'reviews-section-header-rating-0'}).text,
            'wait_time_rating': dr_item.find('div', {'data-test':'reviews-section-header-rating-1'}).text,
            'bedside_manner_rating': dr_item.find('div', {'data-test':'reviews-section-header-rating-2'}).text
            }
            dr_data.append(dr_scraper)

Ouput (assuming the elimination of the 'language_spanish' item)
[{'name': 'Dr. Danilo Hoyumpa, MD', 'specialties': 'Family Physician', 'review_count': '1464 reviews', 'language_english': 'English', 'overall_rating': 'Overall rating4.87', 'wait_time_rating': 'Wait time4.91', 'bedside_manner_rating': 'Bedside manner4.91'}, {'name': 'Dr. George Girgis, MD', 'specialties': 'Family Physician', 'review_count': '174 reviews', 'language_english': 'English', 'overall_rating': 'Overall rating4.91', 'wait_time_rating': 'Wait time4.39', 'bedside_manner_rating': 'Bedside manner4.96'}]

A: Simply use a try except and set the value to NULL. Then pass the value to your data etc
'language_spanish': lang-span
try:
    lang-span=dr_item.find('li', {'data-test':'language-Spanish'}).text
except:
    lang-span="NULL"

A: Here are a few different ways you can go about this.  First the code-heavy way:
for dr_item in soup_dr:
    dr_scraper = {
        'name': None,
        'specialties': None,
        'review_count': None,
        'language_english': None,
        'language_spanish': None,
        'overall_rating': None,
        'wait_time_rating': None,
        'bedside_manner_rating: None
    }
    if dr_item.find('span', {'itemprop':'name'}):
        dr_scraper['name] = dr_item.find('span', {'itemprop':'name'}).text
    if dr_item.find('li', {'class':'krbmlv-5 cpBnTD'}):
        dr_scraper['specialties'] = dr_item.find('li', {'class':'krbmlv-5 cpBnTD'}).text
    if dr_item.find('div', {'class':'sc-1evbz6z-2 qKvtL'}):
        dr_scraper['review_count'] = dr_item.find('div', {'class':'sc-1evbz6z-2 qKvtL'}).text
    if dr_item.find('li', {'data-test':'language-English'}):
        dr_scraper['language_english'] = dr_item.find('li', {'data-test':'language-English'}).text
    if dr_item.find('li', {'data-test':'language-Spanish'}):
        dr_scraper['language_spanish'] = dr_item.find('li', {'data-test':'language-Spanish'}).text
    if dr_item.find('div', {'data-test':'reviews-section-header-rating-0'}):
        dr_scraper['overall_rating'] = dr_item.find('div', {'data-test':'reviews-section-header-rating-0'}).text
    if dr_item.find('div', {'data-test':'reviews-section-header-rating-1'}):
        dr_scraper['wait_time_rating'] = dr_item.find('div', {'data-test':'reviews-section-header-rating-1'}).text
    if dr_item.find('div', {'data-test':'reviews-section-header-rating-2'}):
        dr_scraper['bedside_manner_rating'] = dr_item.find('div', {'data-test':'reviews-section-header-rating-2'}).text

    dr_data.append(dr_scraper)

That code could be condensed a bit:
for dr_item in soup_dr:
    dr_scraper = {}
    dr_scraper['name] = dr_item.find('span', {'itemprop':'name'}).text if dr_item.find('span', {'itemprop':'name'}) else None
    dr_scraper['specialties'] = dr_item.find('li', {'class':'krbmlv-5 cpBnTD'}).text if dr_item.find('li', {'class':'krbmlv-5 cpBnTD'}) else None
    dr_scraper['review_count'] = dr_item.find('div', {'class':'sc-1evbz6z-2 qKvtL'}).text if dr_item.find('div', {'class':'sc-1evbz6z-2 qKvtL'}) else None
    dr_scraper['language_english'] = dr_item.find('li', {'data-test':'language-English'}).text if dr_item.find('li', {'data-test':'language-English'}) else None
    dr_scraper['language_spanish'] = dr_item.find('li', {'data-test':'language-Spanish'}).text if dr_item.find('li', {'data-test':'language-Spanish'}) else None
    dr_scraper['overall_rating'] = dr_item.find('div', {'data-test':'reviews-section-header-rating-0'}).text if dr_item.find('div', {'data-test':'reviews-section-header-rating-0'}) else None
    dr_scraper['wait_time_rating'] = dr_item.find('div', {'data-test':'reviews-section-header-rating-1'}).text if dr_item.find('div', {'data-test':'reviews-section-header-rating-1'}) else None
    dr_scraper['bedside_manner_rating'] = dr_item.find('div', {'data-test':'reviews-section-header-rating-2'}).text if dr_item.find('div', {'data-test':'reviews-section-header-rating-2'}) else None
    dr_data.append(dr_scraper)

A more maintainable solution would be:
PROPS = [
    ('name', 'span', 'itemprop', 'name'),
    ('specialties', 'li', 'class', 'krbmlv-5 cpBnTD'),
    ('review_count', 'div', 'class', 'sc-1evbz6z-2 qKvtL'),
    ('language_english', 'li', 'data-test', 'language-English'),
    ('language_spanish', 'li', 'data-test', 'language-Spanish'),
    ('overall_rating', 'div', 'data-test', 'reviews-section-header-rating-0'),
    ('wait_time_rating', 'div', 'data-test', 'reviews-section-header-rating-1'),
    ('bedside_manner_rating', 'div', 'data-test', 'reviews-section-header-rating-2')
]

for dr_item in soup_dr:
    dr_scraper = {}
    for attr_name, tag, prop_name, prop_value in PROPS:
        element = dr_item.find(tag, {prop_name: prop_value})
        if element:
            dr_scraper[attr_name] = element.text
        else:
            dr_scraper[attr_name] = None
    dr_data.append(dr_scraper)


text:
Q: What's up with this little duck? I only encounter this duck on the final (scripted) stage where you defeat the devil. It doesn't seem to do anything interesting when swapped.
Is it the true antagonist of the game or something or just flavor?


text:
Q: How to process pygame.get_pressed() to receive input pygame.get_keypressed() returns a long list of 0s and 1s for each keys pressed that can be mapped by pygame. Sample below, is there a straight forward way to extract the letter representation of the key pressed?
I'm trying to avoid a long multiple if statements to test if K_a, K_b... ect is clicked, is there a way to process the 1s and 0s below?
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 0, 0, 0)

A: It looks like number in binary representation so you could convert it into integer and use bitwise 'AND' to compare it with some 'mask' (which represents keys you need). I do not know if it is worth doing.

For testing more keys (for example h,e,l,o ) you can use
pressed = pygame.get_keypressed()

if all( (pressed[x] for x in (K_h, K_e, K_l, K_o)) ):
    print "all keys are pressed: h, e, l, o"

if any( (pressed[x] for x in (K_h, K_e, K_l, K_o)) ):
    print "at least one key is pressed: h, e, l, o"

You can turn it into function
def test_all_keys( list_of_keys, pressed ):
    return all( (pressed[x] for x in list_of_keys) )

if test_all_keys((K_h, K_e, K_l, K_o), pressed):
    print "all keys are pressed: h, e, l, o"

if you need list of pressed keys:
list_of_pressed = [ i for i in range(len(pressed)) if pressed[i] ]

if K_a in list_of_pressed:
    print "key 'a' was pressed"


text:
Q: static initialization in c I have a function which is passed a list of ints, until one value is "-1" and calculates the minimum.
If the function gets called couple times, it is supposed to return the minimum between all calls.
So I wrote something like that:
int min_call(int num, ...)
{
    va_list argptr;
    int number;

    va_start(argptr, num);

    //static int min = va_arg(argptr, int); //////// the questioned line

    static int all_min = -1;

    int min = va_arg(argptr, int);

    if (min != -1)
    {
        while ((number = va_arg(argptr, int)) != -1)
        {
            if (number < min)
            {
                min = number;
            }

        }
    }

    if (min < all_min || all_min == -1)
    {
        all_min = min;
    }

    return all_min;
}

I want to know something about the marked line... why can't I call it - the compiler says because the expression being used to initialize the static int is not constant.
For some reason I remember that I can initialize a static variable and know that the initializing statement will be called only once (the first time) it's written in C++.
If that line would be available it would have saved me couple variables.
Is there a difference between C and C++ in this matter?

A: Yes, C++ allows for statics to be lazily initialized at runtime.  Effectively C++ turn static initialization into this:
static int XX_first_time = 1;
if (XX_first_time)
{
    // run the initializer
    XX_first_time = 0;
}

While this is convenient, it is not thread safe.   The standard does not require this to be thread safe although some compilers have done that anyway (gcc 4.x does thread safe initialization unless explicitly requested not to with -fno-threadsafe-statics).
C requires statics be to have their value configured at compile time.  Yes, this is more limited but is more in line with C doing little work for you behind your back (C can be thought of as portable assembly).

A: C static initialization must be done with constant values, i.e. something that is known at compile-time. Because your call to va_arg() won't resolve until runtime, you can't use it as a static initializer. You could assign a known-bad value to min at initialization and then simply call va_arg() after the variable has been initialized (John Dibling's example code does exactly that).
Also, it's important to note that static initialization only happens once per scope (in this case, your function), so even if your commented-out line worked, it would only be executed once and not each time the function is invoked (as I think you were expecting).

A: As others have said, in C, static variables must be initialized with compile-time constants.  If you omit the initial value, it is taken as 0.
Now, about the logic in your function.  I think the function is written much more clearly like this (I am not changing the form of the function):
#include <limits.h>

int min_call(int num, ...)
{
    va_list argptr;
    int number;
    static int min = INT_MAX;

    va_start(argptr, num);

    while ((number = va_arg(argptr, int)) != -1)
        if (number < min)
            min = number;

    va_end(argptr);
    return min;
}

If num should also be included in the calculation of the minimum, then you will need an additional check along the lines of if (num < min) min = num;.
I also have trouble understanding if (min < all_min || all_min == -1 ) line.  Since all_min was initialized to -1 in the beginning and then never touched, the if condition will always be true.
Note that the initialization of min is to INT_MAX and not INT_MIN as one of the comments says, and that we must call va_end().

A: You can't do what you're trying to do because the static is intialized before the program starts running -- argptr doesn't exist in context yet. You could try something like this:
va_start( argptr, num );

static bool  init = 0;
static int min = -1;
if( !init )
{
   min = va_arg( argptr, int );
   init = true;
}

static int all_min = -1;

A: Static doesn't just mean it only gets set the first time you call it. It means that it's set at compile time. The compiler doesn't know how to call your va_arg function at compile time. (It doesn't make any sense until you're in run-time and running the program and passing it arguments.)
(edit - In C. Someone else has noted C++ is different.)

A: This doesn't exactly answer your question, but the other answers have done a good job of doing so already.
However, I think you are approaching this very simple problem from the wrong direction. If you want your functions to be portable and re-usable, you should try to minimize their side effects.
For example, instead of keeping state data in your function (evil), you should be keeping that data in a variable (or struct) local to the scope that is using it. Like this:
{
    int min_so_far;

    min_so_far = min_call(NULL, 4, 7, 2, -6, 3, -12);
    min_so_far = min_call(&min_so_far, -11, 5, 3, 8, -3);

    printf("%d\n", min_so_far); //should output -12
}

The first argument to min_call would be an int*, and if it was passed in as NULL, then the function would disregard it. Otherwise, each argument would be compared against the int that was passed in.
This isn't as convenient, but it's definitely safer, and you will be able to use this function in more than one place in the application. Thinking about the reusability of your code is a good habit to get into.


text:
Q: Two services with same images should use different Dockerfiles I am trying to build the two services with the same image, but two different Dockerfile. However Docker will always use only one Dockerfile for both, even though two have been defined:
version: '3.4'
services:
 serviceA:
    image: myimage
    build:
      dockerfile: ./Dockerfile
      context: ${project.basedir}/${project.artifactId}-docker/target
    depends_on:
      - serviceB

 serviceB:
    image: myimage
    build:
      dockerfile: ./Dockerfile-cloud
      context: ${project.basedir}/${project.artifactId}-docker/target

Even though I also say dependsOn, running
docker-compose up -f docker-compose.yml

it only used the Dockerfile-cloud for both.

A: I guess your problem is that you tag your image as myimage (using latest by default). So docker will build a first version of myimage with Dockerfile, then it'll build another version of myimage with Dockerfile-cloud, and in the end it will only use the latest version. This is why it will use Dockerfile-cloud for both. To fix it remove image: myimage or do something like:
serviceA:
  image: myimage:serviceA
...
serviceB:
  image: myimage:serviceB

A: Since you're building the two containers' images from different Dockerfiles, they can't really be the same image; they'll have different content and metadata.
Compose is capable of assigning unique names for the various things it generates.  Unless you need to do something like docker-compose push built images to a registry, you can generally just omit the image: line.  The two containers will use separate images built from their own Dockerfiles, and the Compose-assigned names will avoid the ambiguity you're running into here.
version: '3.8'
services:
  serviceA:
    # no image:
    # short form of build: with default dockerfile: and no args:
    build: ${project.basedir}/${project.artifactId}-docker/target
    depends_on:
      - serviceB

  serviceB:
    # no image:
    build:
      context: ${project.basedir}/${project.artifactId}-docker/target
      dockerfile: ./Dockerfile-cloud


text:
Q: How can i access children using parent id I have this structure of html. To present the list of two different sets. and i must handle the click event differently.

first node

second node

third node

first node

second node

third node

I have to access the nodes using div id
$('#nodelist1 li.nodeelem').click(handler);
$('#nodelist2 li.nodeelem').click(handler2);

Is this rightway to access children clicks???

A: You forgot the hash # for ID selectors (although you corrected this in your edit):
$('#nodelist1 li.nodeelem').click(handler);
$('#nodelist2 li.nodeelem').click(handler2);

Tip: you can make the event more effective by using on() instead for event delegation:
$('#nodelist1').on('click', '.nodeelem', handler);
$('#nodelist2').on('click', '.nodeelem', handler2);


text:
Q: Haskell Diagrams crop image I'd like to be able to draw a bunch of shapes in Diagrams and crop the picture to a fixed size, leaving parts of the shapes in view (i.e. not completely occluding the shape)
I can't seem to find a way to do this. I found bounding boxes, but it seems they only do intersection/containment checks.
Thanks!


text:
Q: How do I add a Bookmarklet to the Navigation Bar in Firefox?
Possible Duplicate:
how to add firefox bookmark as toolbar button

I'm trying to find a way to add a single bookmarklet to the navigation bar in Firefox 7 - any method (add-on, hack, Greasemonkey script) is fine by me, but haven't been able to find anything that works so far.
Because I only have one bookmarklet that I need, I really don't want to have the bookmark toolbar enabled and take up all that screen real estate - hence, I'm wondering if there's a way to create an extra icon on the navigation bar (alongside the Search Bar and Home, Bookmarks, New Tab, etc buttons) that contains the bookmarklet.

A: You can perhaps use Custom Buttons.
I don't know how it handles complicated scripts, but I'm using it successfully to do some trivial tasks, e.g.

*

*a button which opens Google in new tab (instead of current):
gBrowser.selectedTab = gBrowser.addTab("http://www.google.com/");

*a button which performs site: Google search over current URL:
content.location = 'http://www.google.com/search?q=site:' + content.location.hostname;

*Same button, but with prompt:
var q=prompt("Search terms:").replace(/\s\+/g,"%252B");
var loc="http://www.google.com/search?q="+q
loc += "+site:"+content.location.hostname;
content.location = loc;

To create nice image buttons, you can use Notepad++ to base64-encode the icon or PNG image:
data:image/x-icon;base64,[data here]
data:image/png;base64,[data here]

A: You can add a button that opens your bookmarks in a sidebar. Thats the only solution I can come up with.
View -> Toolbars -> Customize... -> Display your bookmarks

There's also a keyboard shortcut for it (Command+B on Mac || CTRL + B on Windows)
That's all I can come up with, maybe it's already what you need.


text:
Q: show live updates in d3 sankey chart I was trying d3 chart for visualizing the network flow from source to destination. I was trying with d3 sankey and the results were satisfying. I would like to update the sankey with the new values after every 5s. help from experts is appreciated

A: http://bl.ocks.org/nl-hugo/c1a6c6f5b459449b9832d9f3ef73cb7d
Looks like a good start for updating data in d3 sankey charts.
Just apply some vanilla JS interval of 5 seconds and you are good to go.


text: Q: What is the difference (if any) between 'try and do something' and 'try to do something'? What is the difference (if any) between 'try and do something' and 'try to do something'? Do they mean the same thing? Are there any different connotations?


text:
Q: C++: no value is printing when passing array for loop? I'm new to C++ programming. Whenever I run this, it doesn't print anything.
What I want is to ask the user for their names infinite times and only break after typing "quit". And after typing "quit" it must print all the items in the array. But it's not printing anything. Where am I wrong?
Here's my code:
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int count = 0;
std::string arr[] = {};

void my_funct()
{
    for (int i = 0; i < count; i++){
        std::cout << arr[i];
    }
}

int main()
{
    std::string names;
    while (true)
    {
        std::cout << "Enter your name: \n";
        getline(std::cin, names);
        if (names == "quit")
        {
            my_funct();
            break;
        }
        else
        {
            std::string arr[] = {names};
            count++;
        }
    }
}

A: arr in my_funct() and arr in if-else statement are two different arrays. You are declaring local version in if-else, which after each iteration of loop is destroyed. You also declared it as an array of zero length - meaning it cannot hold any elements. What you want in your case is std::vector (you even included appropriate header).
You can then resign from count variable and use vec.size() (I've renamed arr to vec) instead.
#include <iostream>
#include <string>
#include <vector>
using namespace std;

std::vector<std::string> vec;

void my_funct()
{
    for (int i = 0; i < vec.size(); ++i) {
        std::cout << vec[i];
    }
}

int main()
{
    std::string name;
    while (true) {
        std::cout << "Enter your name: \n";
        getline(std::cin, name);
        if (name == "quit") {
            my_funct();
            break;
        }
        else {
            vec.push_bash(name);
        }
    }
}

A: #include <iostream>
#include <string>
#include <vector>
using namespace std;

int count = 0;
vector<string> arr;

void my_funct()
{
    for (auto ar : arr) {
        std::cout << ar << endl;
    }
}

int main()
{
    std::string names;
    while (true)
    {
        std::cout << "Enter your name: \n";
        getline(std::cin, names);
        if (names == "quit")
        {
            my_funct();
            break;
        }
        arr.push_back(names);
    }
}

A: There is your code I tried to correct. If you need  do not understand or need explanation just ask and I'll try to explain
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int counet = 0;

vector<string> arr;

void my_funct()
{
    for (int i = 0; i < arr.size(); i++){
        cout << arr[i] << endl;
    }
}

int main()
{

    std::string names;
    while (true)
    {
        std::cout << "Enter your name: \n";
        getline(std::cin, names);

        if (names == "quit")
        {
            my_funct();
            break;
        }
        else
        {
            arr.push_back(names);
        }
    }
}