text:
Q: Hibernate Search 6: Methods mapping In Hibernate Search 5.x I can map entity method as the fulltext field like this:
@Entity
public class Person {

    @Id
    @GeneratedValue
    private Long id;

    private String name;

    private String surname;

    public String getWholeName() {
        return name + " " + surname;
    }

    // getters, setters
}

// Mapping configuration, programmatic approach
SearchMapping sm = new SearchMapping();
sm
  .entity(Person.class)
  .indexed()
  .property("wholeName", ElementType.METHOD)
  .field();

Then I have a field with name "wholeName" in my fulltext index and it contains return value of getWholeName() method.
How to do it in Hibernate Search 6? I found only a way how to map an entity field but not a method. Thank you!

A: Short answer
If there is no field named wholeName, Hibernate Search 6 will automatically fall back to the getter. The ElementType from Hibernate Search 5 is no longer necessary, and that's why it was removed.
Note that Hibernate Search is also smarter when it comes to detecting changes in entities. That's usually great, but the downside is that you'll need to tell Hibernate Search what other attributes wholeName relies on. See this section of the documentation (you can also find an example using the programmatic mapping API here).
Long answer
When an attribute has a field but no getter, or a getter but no field, there is no ambiguity. Hibernate Search uses the only available access type.
When an attribute has both a field and a getter, there is a choice to be made. Hibernate Search 6 chooses to comply with Hibernate ORM's access type.
Hibernate ORM accesses attributes either by direct access to the field ("field" access type) or through getters/setters ("property" access type).
By default, the access type in Hibernate ORM is determined by where your @Id annotation is. In this case, the @Id annotation is located on a field, not a method, so Hibernate ORM will use the "field" access type. And so will Hibernate Search.
You can also set the Hibernate ORM access type explicitly using the @Access annotation, either for the whole entity (put the annotation on the class) or for a particular property (put the annotation on the field). Hibernate Search will comply with this too.


text:
Q: how to get parameters in php page with ajax and $.post actually i'm new to web and php,
i'm building a website,
i would like to introduce chat session there but, when the user click the insert button that's not working (failing to pass the paramerts to another page)
Help me out...!!!
here is the code
chat_page.php
<input type="text" id="txtmsg" name="txtmsg" size="25"> <input type="button" value="send" onclick="sndmsg()">

jscript.js
function sndmsg() {
    msg=document.getElementById('txtmsg').value;
    $.post("insert.php",{u:un,m:msg},function(){ });
    document.getElementById('txtmsg').value="";
}

insert.php
include("connec.php");
$chatmsg=mysql_real_escape_string($_REQUEST['m']);
$uname=mysql_real_escape_string($_REQUEST['u']);
echo $chatmsg;
echo $uname;
mysql_query("INSERT INTO `mdi_chat_msg`(`uname`, `chatmsg` ) VALUES ( '$uname','$chatmsg')") or die(mysql_error());

A: What is un in jscript.js. Maybe, that parameter is unknown.
$.post("insert.php",{u:un,m:msg},function(){ });

You should declare un and msg variables;
var un, msg;

A: Check you have declare  and change the type="submit" instead type="button"  you cant use the word msg as variable and cant pass the js value in ajax  and check un variable.
<form>
   <input type="text" id="txtmsg" name="txtmsg" size="25"> <input type="submit" value="send" onclick="sndmsg()">
</form>

<script>
    function sndmsg() {
        msg1=$("#txtmsg").val();
        $.post("insert.php",{u:un,m:msg},function(){ });
        document.getElementById('txtmsg').value="";
    }
    $.ajax({
        type: "POST",
        url: "insert.php",
        data: { u: un,m:msg1},
    });
</script>

redpajama_set_name: RedPajamaStackExchange


text:
Q: A Conditional Probability Question- Card Problem Here's a basic conditional probability question:
Suppose you have two cards: one is painted black on both sides and the other is painted black on
one side and orange on the other You select a card at random and view one side. You notice it is
black. What is the probability the other side is orange?
So, let's say O denotes a side is orange and B denotes a side is black. Here's my attempt:
$P(\text {O|other side B} )=\frac{P(\text {B|other side O} )P(\text{O})}{P(\text {B|other side O} )P(\text{O})+P(\text {B|other side B} )P(\text{B})}=\frac{1\times \frac{1}{4}}{1\times \frac{1}{4}+\frac{1}{2}\times \frac{3}{4}}=\frac{2}{5}$
But when I try in this way: $P(\text {O|other side B} )=P(O\cap B)/P(B)=1/3$
The answer is $\frac{1}{3}$, where is the mistake? Any help is appreciated. Thanks in advance.

A: Call the card with one orange and one black side the $OB$ card, and call the card with two black sides the $BB$ card.
$$P(\text{You picked $OB$ } \mid \text{you saw black side}) = \frac{P(\text{one side is black} \cap \text{ you picked OB})}{P(\text{you saw black side})}  $$
$$= \frac{\frac{1}{2} \cdot \frac{1}{2}}{\frac{1}{2} \cdot \frac{1}{2} + \frac{1}{2} \cdot 1} = \boxed{1/3}$$
In order to compute $P(\text{you saw black side})$, you need to condition on which card you drew. With probability $1/2$, you will pick $OB$ in which case you will see the black side with probability $1/2$. On the other hand, with probability $1/2$ you will pick $BB$ in which case you will see the black side with probability $1$. You must consider both cases.

A: The two card have in total 3 black sides
Hence n(s)=3
Of which only one is favourable for other side to be orange , hence n(E) =1
P(E)=1/3

A: Alternative solution of the problem posed in your question.
Originally there are $6$ sides with equal probability to become the side viewed.
Then the condition is posed that the side viewed is black.
That means that $3$ candidates fall off and there are now $3$ sides left, again with equal probability to become the side viewed.
For exactly $1$ of these sides it is true that the other side is orange.
So the probability on that event equals $\frac13$.


text:
Q: Could not find getter for Component member We're using Fluent Nhibernate and I can't seem to map a component. My component class isn't an entity and has two values:
 public class Member
 {
    public int ID;
    public string Name;
 }

The parent entity is mapped to a view with two columns to fill the two properties. I map the class as a component using Linq as:
Component(x => x.CurrentMember, m =>
{
    m.Map(x => x.ID, "MemberId");
    m.Map(x => x.Name, "MemberName");
});

When I run this I get FluentNHibernateConfigurationException building the SessionFactory: "Could not find a getter for property 'ID' in class 'Member". This isn't an entity so I'm a little confused as to what I'm missing?

A: Well your class doesn't specify a property called ID - it specifies a field. Perhaps you should try giving your class properties rather than public fields:
public class Member
{
   public int ID { get; set; }
   public string Name { get; set; }
}

A: maybe try to use property, which should be virtual


text:
Q: i686-linux-gcc:error trying to exec 'cc1':execvp:No such file or directory When I run make otapackge on android4.4 ,it runs with the errori686-linux-gcc:error trying to exec 'cc1':execvp:No such file or directorywhen build fs_config,I am very confused about that

A: I fixed it by export PATH=../prebuilts/gcc/linux-x86/host/.../i686-linux/4.4.3/:$PATH


text:
Q: Warning unused variable in Haskell code Real World Haskell says "Haskell compiler can warn us if we introduce a variable name in a pattern, but do not use it in a function's body".
I often forget to use variables which I bind, so I want to use this feature. But my ghci and ghc seem to be fine with unused variables, and I actually have never seen this since I started learning Haskell a few months ago.
How can I use this feature? Or Haskell compiler does not have this feature anymore?

A: You can look at Warnings. I generally use -Wall in my projects which shows unused binded variables along with several other useful warnings. There is specific flag (-fwarn-unused-binds) too to do just what you want.

A: You can add the -fwarn-unused-binds flag to ghc or ghci. To enable other useful warnings, use -W. To enable all warnings, use -Wall. For example:
ghci -fwarn-unused-binds

A: As said before, the option is -fwarn-unused-binds or -Wall for all warnings. Another one is -Werror to make the warnings stop the compilation.
To use them, you pass them to ghc or ghci on the command-line. Additionally, during a session in ghci, you can type
:set -fwarn-unused-binds

With cabal you can add ghc-options to the executable section. For instance :
executable my-program
  main-is:        MyProgram.hs
  hs-source-dirs: src
  ghc-options:    -Wall

Now, running cabal configure && cabal build (and other commands) will use the -Wall option.


text:
Q: Getting a error message SQL SELECT person.first_name, person.last_name, meeting.meeting_id, meeting.meeting_start, meeting.meeting_end
-> FROM person INNER JOIN (meeting
-> INNER JOIN person_meeting ON meeting.meeting_id = person_meeting.meeting_id)
-> ON person.person_id = person_meeting.person_id
-> WHERE person.person_id IN (SELECT person_id
-> FROM person_meeting
-> WHERE meeting_id IN ((SELECT meeting_id
-> FROM meeting
-> WHERE meeting_id NOT IN (SELECT meeting_id
-> FROM meeting
-> WHERE meeting_start >'2016-12-25 00:00:00')));

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the ri
  ght syntax to use near '' at line 11

A: Your SQL query has unbalanced parenthesis. You open 5 parenthesis, you close 4.
This would solve it:
SELECT
    person.first_name, person.last_name, meeting.meeting_id, meeting.meeting_start, meeting.meeting_end
FROM
    person
    INNER JOIN
    (
        meeting
        INNER JOIN person_meeting
             ON meeting.meeting_id = person_meeting.meeting_id
    )
    ON person.person_id = person_meeting.person_id
WHERE
    person.person_id IN
    (
        SELECT
            person_id
        FROM
            person_meeting
        WHERE
            meeting_id IN
            (
                (SELECT
                     meeting_id
                 FROM
                      meeting
                 WHERE
                      meeting_id NOT IN
                      (
                          SELECT
                              meeting_id
                          FROM
                              meeting
                          WHERE
                               meeting_start > '2016-12-25 00:00:00'
                      )
                 )
           )
      ) ;

Plus: your query is more complicated that it needs be. You seem to look for all meetings attended by people who attended meetings NOT starting later than 20161225. This can be achieved with one less level of subquery, plus some simplification at the top JOINs:
SELECT
    person.first_name, person.last_name, meeting.meeting_id, meeting.meeting_start, meeting.meeting_end
FROM
    person
    JOIN person_meeting ON person_meeting.meeting_id = person.person_id
    JOIN meeting ON meeting.meeting_id = person_meeting.meeting_id
WHERE
    person.person_id IN
    (SELECT  /* s2: Persons NOT having attended meetings NOT starting {1} */
        person_id
    FROM
        person_meeting
    WHERE
        meeting_id IN
        (SELECT /* s1: Meetings NOT starting later than 20161225 {1} */
            meeting_id
        FROM
            meeting
        WHERE
            meeting_start <= /* reversed! */  '2016-12-25 00:00:00'
        )
   ) ;

Check it all at dbfiddle here


text:
Q: Is it possible to add a cipher for an sftp client? I'm running into an issue where a server was upgraded to RHEL 6.5, and we have automated scripts on an RHEL 5.9 install that connects through sftp and ssh commands.
Now, the new server only supports the ciphers aes128-ctr, aes192-ctr, and aes256-ctr.
I was able to update the ssh commands to use the -c option with aes256-ctr and this worked:
ssh -c aes256-ctr ${remote_host} ${my_command}

However, when I tried do the equivalent for sftp:
sftp -oCipher=aes256-ctr ${remote_host} <<< $'get /home/me/* me/'

I am getting an error that the client does not support the same ciphers as the server:

no matching cipher found: client
  arcfour256,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
  server aes128-ctr,aes192-ctr,aes256-ctr

These ssh and sftp command are executed on the same RHEL 5.9 box, so I'm wondering why this works for ssh and not sftp?
Also, how do fix this so I can connect using sftp without any client side changes?

A: sftp -o accepts ssh_option (source).
ssh_config says that Cipher is for ssh protocol v1 (which you should never use) and Ciphers is for ssh protocol v2.

A: The Cipher directive is for SSH version 1 (which is not in use nowadays).
For SSH version 2, use the Ciphers:
sftp -oCiphers=aes256-ctr

See ssh_config man page.

Though note that the sftp supports the -c switch too. So there's no need for using the -o.
See the sftp man page:

-c cipher
Selects the cipher to use for encrypting the data transfers.
  This option is directly passed to ssh(1).

The option is supported since OpenSSH 5.4. The change is disguised as "Support most of scp(1)'s commandline arguments in sftp(1)".

Note the command-line argument -c is primarily an equivalent to the Ciphers directive (while it can fall back to the Cipher). Quote from the ssh man page:

-c cipher_spec
Selects the cipher specification for encrypting the session.
  Protocol version 1 allows specification of a single cipher. The supported values are "3des", "blowfish", and "des". For protocol
  version 2, cipher_spec is a comma-separated list of ciphers listed in
  order of preference. See the Ciphers keyword in ssh_config(5) for more
  information.


text:
Q: Does endianness reverse an array? I am receiving a buffer from the network, which is big endian, and I'm on a little endian system. Do I have to reverse the buffer before using it on my system? I'm not sure if the endianness only reverses the byte ordering for a single type or if it also applies to an entire buffer.
For instance, let's say I'm receiving a buffer of unsigned longs from the network, and I'm on a little endian system. The code would be this:
for(int i=0;i<size;i++)
    system_buffer[i]=ntohl(network_buffer[i]);

Before I use system_buffer, do I also have to reverse it (so the last element becomes the first element and visa versa)?
reverse_buffer(system_buffer);

Furthermore, if I'm receiving an array of unsigned chars, do I need to compensate for endianness at all, or can I use the buffer as-is?
Thanks!

A: Endianess is only applicable to single variables,
ie. only to each array element value, not to the order of elements in the array.
And 1-byte-variables can´t have their byte order reversed,
so no need to do anything with them.

A: Endianness affects the byte order of integers of size larger than one byte only (i.e. it does not affect a byte or int8_t).
You need to read the protocol description in what byte order the integers are.

A: Endianness only affects the order of bytes (not bits) in a data word. Since a char is always one-byte in size, you don't have to do any adjustments to them. The standard library function ntohl changes the byte order of an unsigned integer (l) from network byte order (n) to host byte order (h). Therefore you don't need to reverse the buffer before using it. You only need to change the byte order of each element in the buffer.
for(int i = 0; i < size; i++) {
    // network byte order to system byte order

    system_buffer[i] = ntohl(network_buffer[i]);
}

// process system_buffer


text:
Q: Fatal error on with Asterisk::AMI i'm trying to use the Asterisk::AMI package but with a simple example dont works
#!/usr/bin/perl -w
# ami_test.pl

use strict;
use diagnostics;
use Asterisk::AMI;

// use default 127.0.0.1 5038
my $astman = Asterisk::AMI->new(
    Username => 'manager',
    Secret => 'secret'
);

die "Unable to connect to Asterisk" unless ($astman);

my $response = $astman->({
    Action => 'Command',
    Command => 'sip show peers'
});

print $response->{'Response'};

Alway i get an error :
Not a CODE reference at ami_test.pl line 17 (#1)
    (F) Perl was trying to evaluate a reference to a code value (that is, a
    subroutine), but found a reference to something else instead.  You can
    use the ref() function to find out what kind of ref it really was.  See
    also perlref.

Uncaught exception from user code:
        Not a CODE reference at ami_test.pl line 17.
 at ami_test.pl line 17

EDIT
the documentation see wrong, i've try
my $response = $astman->action({
    Action => 'Command',
    Command => 'sip show peers'
});

and works fine

A: The documentation for Asterisk::AMI is wrong. You should write
my $response = $astman->action({
    Action => 'Command',
    Command => 'sip show peers'
});

which is equivalent to
my $action = $astman->send_action({
    Action => 'Command',
    Command => 'sip show peers'
});

my $response = $astman->get_response($action);

By default there is no timeout on actions. To specify a default timeout for all actions, create your AMI object using, for example
my $astman = Asterisk::AMI->new(
    Username => 'manager',
    Secret => 'secret',
    Timeout => 10
);

A: You have the astman. If you do this:
$astman->({ Action => 'Ping' }, \&actioncb);

You are passing parameters to an object.
You should pass parameters to a method, for example:
my $action = $astman->send_action({ Action => 'Ping' }, \&actioncb);

The Perl Documentation is fine. The CPAN web site for Asterisk::AMI has a little mistake (at least in version 0.2.8).


text:
Q: AuthKey in header So my client needs a REST API using PHP that provides output as per the conditions on the URL parameters
So now there are three URL's basically which is currently needed and they are done.
so they are
localhost/newapi/client/<AuthKey> - for authorizing

localhost/newapi/client/<clientid>/categories/ - to get all the categories

localhost/newapi/client/<clientid>/categories/<categoryid> - to get all items in a category

used .htaccess for fancy URL
So now he requested that AuthKey need to be added to HTTP header not the URL. So the AuthKey must be passed as header and the rest as URL parameters
So my question is how this can be done. and how to retrieve the AuthKey from the request?
Any tutorials or comments regarding this question is welcome

A: you can tell the client when he request your api he add a header as below:
AuthKey: your-api-auth-key
or
Token: your-api-token
and then in your php code make
$headers = getallheaders();
$token = $headers['Token'] or ['AuthKey'];

then you check if the key in database and then process your code
Note:
your client can add Header with PHP cURL
curl_setopt($curl-handle, CURLOPT_HEADER, array(
'Token' => 'client-auth-token', //or
'AuthKey' => 'client-auth-token'
));

A: you can use this code to connect with rest in php
$url = 'localhost/newapi/client/';
    $opts = array('http' =>
        array(
            'method'  => 'POST',
            'header'  => "Content-Type: application/json\r\n"."Authorization: Basic ".<authkey>."\r\n",
            'content' => $data,
            'timeout' => 60
            )
        );

    $context  = stream_context_create($opts);
    $result = file_get_contents($url, false, $context, -1, 40000);

    return $result;


text: Q: How Linux struct buffer_head gets flushed? I'm wondering how a buffer_head struct in Linux gets flushed to the disk after it's marked as dirty. Now I'm assuming there are some background routines that periodically check if there are any buffers need to be flushed, but I cannot find which specific function or any subsystem does this job. Hope anyone can shed a light on this, thanks!


text:
Q: AnimationMixer wont play animation(gltf file) I'm import an model with three js and works fine i want to run animation from gld file i can get animations name with three js but TJS wont play my animations
GLB FILE
I have two animation in glb file with this names "Intro" and "Rotate" i can see this animations with this command console.log(gltf.animations);
but i cant use this animations on
var mixer = new THREE.AnimationMixer(mesh);
Source code
var scene, renderer;
var camera;
var mesh;
var clickDown;
var model;

var isMouseDown = false;

function execFA() {

    scene = new THREE.Scene();

    camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
    camera.position.z = 25;
    camera.position.y = 15;

    renderer = new THREE.WebGLRenderer();
    renderer.setSize(window.innerWidth, window.innerHeight);
    document.getElementById('container').appendChild(renderer.domElement);

    renderer.setClearColor(0x00ffff, 1);
    renderer.gammaOutput = true;

    var light = new THREE.DirectionalLight("#c1582d", 1);
    var ambient = new THREE.AmbientLight("#85b2cd");
    light.position.set(0, -70, 100).normalize();
    scene.add(light);
    scene.add(ambient);

    var texture = new THREE.Texture();
    var manager = new THREE.LoadingManager();
    manager.onProgress = function(item, loaded, total) {};
    var onProgress = function(xhr) {};
    var onError = function(xhr) {};

    var loader = new THREE.GLTFLoader();

    // Load a glTF resource
    loader.load(
        // resource URL
        './models/vc.glbf',
        // called when the resource is loaded
        function(gltf) {
            model = gltf;
            mesh = gltf.scene;
            mesh.scale.set(3, 3, 3);
            var animations = gltf.animations;

            //scene.add( gltf.scene );
            console.log(gltf.animations);
            console.log(gltf.scenes);
            var clip = THREE.AnimationClip.findByName(animations, 'Intro');
            var mixer = new THREE.AnimationMixer(mesh);
            console.log(clip)
                // var action = mixer.clipAction(clip);

            animations.forEach(animation => {

                mixer.clipAction(animation).play();

            });
            // action.setLoop(THREE.LoopOnce);
            animate();
            render();

            scene.add(mesh);
            // action.play();

            // action.play();

            //gltf.animations; // Array<THREE.AnimationClip>
            //gltf.scene; // THREE.Scene
            //gltf.scenes; // Array<THREE.Scene>
            //gltf.cameras; // Array<THREE.Camera>
            //gltf.asset; // Object

        },
        // called when loading is in progresses
        function(xhr) {

            console.log((xhr.loaded / xhr.total * 100) + '% loaded');

        },
        // called when loading has errors
        function(error) {

            console.log('An error happened', error);

        }
    );

    document.addEventListener("mousedown", onMouseDown);
    document.addEventListener("touchstart", onMouseDown);
    document.addEventListener("mouseup", onMouseUp);
    document.addEventListener("touchend", onMouseUp);
    document.addEventListener("mousemove", onMouseMove);
    document.addEventListener("touchmove", onMouseMove);

    render();
}

function animate() {
    // render();

    requestAnimationFrame(animate);
}

function render() {
    if (model) {
        requestAnimationFrame(render);
        renderer.render(scene, camera);
        // mesh.rotation.z += 0.01;
        // mesh.rotation.x += 0.01;
        // mesh.rotation.y += 0.01;

    }

}

function onMouseDown(event) {
    isMouseDown = true;
}

function onMouseMove(event) {
    if (isMouseDown) {
        if (mesh) {
            mesh.rotation.y = getMouseX(event) / 50;
            mesh.rotation.x = getMouseY(event) / 50;

        }
    }
}

function onMouseUp(event) {
    isMouseDown = false;
}

function getMouseX(event) {
    if (event.type.indexOf("touch") == -1)
        return event.clientX;
    else
        return event.touches[0].clientX;
}

function getMouseY(event) {
    if (event.type.indexOf("touch") == -1)
        return event.clientY;
    else
        return event.touches[0].clientY;
}

window.addEventListener('DOMContentLoaded', execFA());

A: It's necessary to update the animation mixer in the animation loop. Try it with this updated code
var scene, renderer;
var camera;
var mesh;
var clickDown;
var model;

var mixer, clock; // declare variables globally

var isMouseDown = false;

function execFA() {

    scene = new THREE.Scene();

    clock = new THREE.Clock(); // create clock

    camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
    camera.position.z = 25;
    camera.position.y = 15;

    renderer = new THREE.WebGLRenderer();
    renderer.setSize(window.innerWidth, window.innerHeight);
    document.getElementById('container').appendChild(renderer.domElement);

    renderer.setClearColor(0x00ffff, 1);
    renderer.gammaOutput = true;

    var light = new THREE.DirectionalLight("#c1582d", 1);
    var ambient = new THREE.AmbientLight("#85b2cd");
    light.position.set(0, -70, 100).normalize();
    scene.add(light);
    scene.add(ambient);

    var texture = new THREE.Texture();
    var manager = new THREE.LoadingManager();
    manager.onProgress = function(item, loaded, total) {};
    var onProgress = function(xhr) {};
    var onError = function(xhr) {};

    var loader = new THREE.GLTFLoader();

    // Load a glTF resource
    loader.load(
        // resource URL
        './models/vc.glbf',
        // called when the resource is loaded
        function(gltf) {
            model = gltf;
            mesh = gltf.scene;
            mesh.scale.set(3, 3, 3);
            var animations = gltf.animations;

            //scene.add( gltf.scene );
            console.log(gltf.animations);
            console.log(gltf.scenes);
            var clip = THREE.AnimationClip.findByName(animations, 'Intro');
            mixer = new THREE.AnimationMixer(mesh); // create mixer
            console.log(clip)
                // var action = mixer.clipAction(clip);

            animations.forEach(animation => {

                mixer.clipAction(animation).play();

            });
            // action.setLoop(THREE.LoopOnce);
            animate();
            render();

            scene.add(mesh);
            // action.play();

            // action.play();

            //gltf.animations; // Array<THREE.AnimationClip>
            //gltf.scene; // THREE.Scene
            //gltf.scenes; // Array<THREE.Scene>
            //gltf.cameras; // Array<THREE.Camera>
            //gltf.asset; // Object

        },
        // called when loading is in progresses
        function(xhr) {

            console.log((xhr.loaded / xhr.total * 100) + '% loaded');

        },
        // called when loading has errors
        function(error) {

            console.log('An error happened', error);

        }
    );

    document.addEventListener("mousedown", onMouseDown);
    document.addEventListener("touchstart", onMouseDown);
    document.addEventListener("mouseup", onMouseUp);
    document.addEventListener("touchend", onMouseUp);
    document.addEventListener("mousemove", onMouseMove);
    document.addEventListener("touchmove", onMouseMove);

    render();
}

function animate() {
    // render();

    requestAnimationFrame(animate);
}

function render() {
    if (model) {
        requestAnimationFrame(render);
        var delta = clock.getDelta();
        mixer.update( delta ); // update animation mixer
        renderer.render(scene, camera);
        // mesh.rotation.z += 0.01;
        // mesh.rotation.x += 0.01;
        // mesh.rotation.y += 0.01;

    }

}

function onMouseDown(event) {
    isMouseDown = true;
}

function onMouseMove(event) {
    if (isMouseDown) {
        if (mesh) {
            mesh.rotation.y = getMouseX(event) / 50;
            mesh.rotation.x = getMouseY(event) / 50;

        }
    }
}

function onMouseUp(event) {
    isMouseDown = false;
}

function getMouseX(event) {
    if (event.type.indexOf("touch") == -1)
        return event.clientX;
    else
        return event.touches[0].clientX;
}

function getMouseY(event) {
    if (event.type.indexOf("touch") == -1)
        return event.clientY;
    else
        return event.touches[0].clientY;
}

window.addEventListener('DOMContentLoaded', execFA());


text:
Q: Additional condition to the Bollobas theorem (Sperner's therorem) in extremal set theory The Bollobas'1965 theorem is the following:
If $A_1,...,A_n$ and $B_1,...,B_n$ are two sequences of subsets of $X=\{1,...,r\}$ such that $A_i\cap B_j = \emptyset$ if and only if $i=j$, then
$$\sum_{i=1}^n\binom{|A_i|+|B_i|}{|A_i|}^{-1}\leq 1.$$

First of all, I am interested in the case where $A_i$ and $B_i$ are
  complementary.

It means we obtain
$$\sum_{i=1}^n\binom{r}{|A_i|}^{-1}\leq 1.$$
from which we have the Sperner's theorem since $\binom{r}{\lfloor \frac{r}{2} \rfloor}^{-1}\leq \binom{r}{k}^{-1}$ for all $k$:
$$n\leq \binom{r}{\lfloor \frac{r}{2} \rfloor}.$$
For a given $n$, it is therefore easy to find the smallest value $r$ for which the previous inequality is verified.

However, I am interested in a special case where there are additional
  conditions on the $A_i$'s and $B_i$'s:
$$|(A_i\cap B_j) \cup (A_{i+1}\cap B_{j+1})|\geq 2, \text{ for all } i\neq j.$$

How could I adapt the previous results with this additional condition?
That is, for a given $n$, how could I find the smallest integer $r$ such that all the conditions are verified?
I suppose that for a given $n$, the smallest integer $r$ for which there are such sets $A_i$ and $B_i$ will be bigger than without the additional conditions.
A way to prove the original problem is by counting the number of permutations separating a pair $(A,B)$ (see this link for example).
However, I do not see how to adapt this approach.
Thanks for your help!


text:
Q: Frisby/Jest doesn't show the name of the field causing the error I wrote my first test using Frisby and I got a strange behaviour.
This is a portion of my test file:
it('check function', function (done) {
  frisby.get(BASE_URL + 'check')
    .expect('status', 200)
    .done(done);
});

it('user login', function (done) {
  frisby.post(BASE_URL + 'login', user)
    .expect('status', 200)
    .expect('jsonTypes', 'id', Joi.number().required())
    .expect('jsonTypes','email', Joi.string().email().required())
    .expect('json','emailConfirmed', 1)
    .expect('jsonTypes','name', Joi.string().required())
    .expect('jsonTypes','surname', Joi.string().required())
    .expect('jsonTypes','avatar', Joi.string())
    .expect('jsonTypes','city', Joi.string().required())
    .expect('jsonTypes','token', Joi.string().required())
    .expect('json','role', 'user')
    .done(done);
});

and it works fine!
If I change this row
.expect('jsonTypes','name', Joi.string().required())

with the following one
.expect('jsonTypes','name', Joi.number().required())

I get this output
● user login

    ValidationError: "value" must be a number

      at Object.<anonymous>.exports.process (node_modules/joi/lib/errors.js:152:19)
      at Object.<anonymous>.internals.Number.Object.<anonymous>.internals.Any._validateWithOptions (node_modules/joi/lib/any.js:633:27)
      at Object.<anonymous>.module.exports.internals.Any.root.validate (node_modules/joi/lib/index.js:104:23)
      at jsonTypesAssertion (node_modules/frisby/src/frisby/expects.js:104:24)
      at Object.withPath (node_modules/frisby/src/frisby/utils.js:67:12)
      at FrisbySpec.jsonTypes (node_modules/frisby/src/frisby/expects.js:103:11)
      at FrisbySpec._addExpect.response (node_modules/frisby/src/frisby/spec.js:368:23)
      at FrisbySpec._runExpects (node_modules/frisby/src/frisby/spec.js:260:24)
      at _fetch.fetch.then.then.responseBody (node_modules/frisby/src/frisby/spec.js:139:14)
      at process._tickCallback (internal/process/next_tick.js:109:7)

I should expect to receive
"name" must be a number

in order to immediately identify the error in my API.
Moreover, if I change my API removing the field "name", I get this output
  ● user login

    ValidationError: "value" is required

It seems that Jest shows the Joi output, and Joi doesn't know the field name. But jest does, so it should show the proper name of the field causing the error.
Am I missing something?


text:
Q: Python thread with tkinter (threads can only be started once) - after checking if previous thread isAlive() I have a GUI with a button. When the button is clicked I want it to run a background process (without freezing the GUI). I would also like to check the variables in the command window (Spyder).

*

*The pseudo code below does the threading, but doesn't give control back at the command line.

*When the button is pressed again, I get "RuntimeError: threads can only be started once" error. This is confusing. I am canceling the thread if it is alive and then starting it.

Any suggestions?
....
....
def timer_start(t):
    if t.isAlive():
        t.cancel()
    else:
        print('No threads are running')
    t.start()
...
...

import threading
timer = threading.Timer(0.1,clicked,[lbl])
timer.daemon = True

btn = ttk.Button(window, text="Start", command=lambda: timer_start(timer))


text:
Q: Monitor WiFi association attempts I'm using hostapd to create an access point and I was wondering if there's any way for me to get an output of current or recent association attempts.
Ideally I'd like to see the MAC ID and any other lower level information.  I'm more interested in monitoring at the physical level, not DHCP.

A: In your hostapd.conf:
# Module bitfield (ORed bitfield of modules that will be logged; -1 = all
# modules):
# bit 0 (1) = IEEE 802.11
# bit 1 (2) = IEEE 802.1X
# bit 2 (4) = RADIUS
# bit 3 (8) = WPA
# bit 4 (16) = driver interface
# bit 5 (32) = IAPP
# bit 6 (64) = MLME
#
# Levels (minimum value for logged events):
#  0 = verbose debugging
#  1 = debugging
#  2 = informational messages
#  3 = notification
#  4 = warning
#
logger_syslog=-1
logger_syslog_level=2

You should see log like that after in messages :
hostapd: wlan0: STA 00:0c:f1:11:57:4e IEEE 802.11: authentication OK (open system)
 hostapd: wlan0: STA 00:0c:f1:11:57:4e MLME: MLME-AUTHENTICATE.indication(00:0c:f1:11:57:4e, OPEN_SYSTEM)
 hostapd: wlan0: STA 00:0c:f1:11:57:4e MLME: MLME-DELETEKEYS.request(00:0c:f1:11:57:4e)
 hostapd: wlan0: STA 00:0c:f1:11:57:4e IEEE 802.11: authenticated
 hostapd: wlan0: STA 00:0c:f1:11:57:4e IEEE 802.11: association OK (aid 1)
 hostapd: wlan0: STA 00:0c:f1:11:57:4e IEEE 802.11: associated (aid 1)
 hostapd: wlan0: STA 00:0c:f1:11:57:4e MLME: MLME-ASSOCIATE.indication(00:0c:f1:11:57:4e)
 hostapd: wlan0: STA 00:0c:f1:11:57:4e MLME: MLME-DELETEKEYS.request(00:0c:f1:11:57:4e)
 hostapd: wlan0: STA 00:0c:f1:11:57:4e WPA: event 1 notification
 hostapd: wlan0: STA 00:0c:f1:11:57:4e WPA: start authentication
 hostapd: wlan0: STA 00:0c:f1:11:57:4e IEEE 802.1X: unauthorizing port
 hostapd: wlan0: STA 00:0c:f1:11:57:4e WPA: sending 1/4 msg of 4-Way Handshake
 hostapd: wlan0: STA 00:0c:f1:11:57:4e WPA: EAPOL-Key timeout
 hostapd: wlan0: STA 00:0c:f1:11:57:4e WPA: sending 1/4 msg of 4-Way Handshake

A: You can enable the control interface, and then use the built-in hostapd_cli to connect to its UNIX socket and issue commands.
In hostapd.conf :
ctrl_interface=/var/run/hostapd # default path of the socket, can be changed if needed
ctrl_interface_group=wifi # group that will own the socket, can be a name or GID


text:
Q: Tulip/asyncIO: why not all calls be async and specify when things should be synchronous? I went to the SF Python meetup when Guido talked about Tulip, the future asyncIO library for asynchronous operations in Python.
The take away is that if you want something to be run asynchronously you can use the "yield from" + expression and a couple of decorators to specify that the call to what comes after yield from should be executed asynchronously. The nice thing about it is that you can read the statements in that function normally (as if it was synchronous) and it will behave as if it was synchronous with respect to the execution of that function (return values and error/exception propagation and handling).
My question is: why not have the opposite behavior, namely, have all function calls be by default async (and without the yield from) and have a different explicit syntax when you want to execute something synchronously?
(besides the need for another keyword/syntax spec)

A: The real answer is that Guido likes the fact that asynchronous yield points are explicit in coroutines, because if you don't realize that a call can yield, then that's an invitation to concurrency problems -- like with threads. But if you have to write an explicit yield from, it's fairly easy to make sure it doesn't land in the middle of two critical operations that should appear atomic to the rest of the code.
As he mentions in his PyCon 2013 keynote, there are other Python async frameworks like Gevent, which are async by default, and he doesn't like that approach. (at 11:58):

And unfortunately you're still not completely clear of the problem
that the scheduler could at a random moment interrupt your task and
switch to a different one. [...] Any function that you call today that
you happen to know that it never switches, tomorrow someone could add
a logging statement or a lazy caching or a consulting of a settings
file. [...]

A: Note that the possible uses of yield from are a small part of the asynch PEP, and never need to be used.  Maybe Guido oversold them in his talk ;-)
As to why functions aren't being changed to always be async by default, that's just realism.  Asynch gimmicks bring new overheads and semantic complications, and Python isn't going to slow down and complicate life for everyone to make a few applications easier to write.
In short, "practicality beats purity" ;-)


text:
Q: IIS URL Rewrite - match pattern I'm trying to rewrite the path folder1/folder2/folder3...
to d
efault.aspx?id=folder1/folder2/folder3
(default.aspx?id={R:1}/")

I currently have the following pattern: ^([^/]+/?[^/]+/?[^/]+/?[^/]+)/$ which works ok with a 4-level deep folder structure. However, since the number of folders should vary, I'm wondering if there is a pattern that does not limit me to 'hardcode' to a number of folders in the URL.
thanks

A: This probably isn't exactly what you are looking for, but based on your example will work...
<rule name="ExampleRule" stopProcessing="true">
  <match url="^.+$" />
  <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
  </conditions>
  <action type="Redirect" url="/default.aspx?id={R:1}" />
</rule>


text:
Q: Unable to retrieve a high quality image from google drive API Im trying to launch an application with a serverless architecture using AWS Lambda and a React frontend. The Lambda function works fine and is currently retrieving the data from my google drive. Unfortunately, The main purpose of this data is to serve images on my site, and the only working Image option the google data provides is a thumbnail link. Naturally this gets pixelated when scaling to the size I'm using. Here is a snippet of the data I'm choosing to retrieve from what is brought back by the google API call.
          let filteredResults = res.data.items.map( (el) => {
              return {
                        "title": el.title,
                        "description": el.description,
                        "id": el.id,
                        "embedLink": el.embedLink,
                        "thumbnailLink": el.thumbnailLink,
                        "createdDate": el.createdDate,
                        "modifiedDate": el.modifiedDate,
                     }
          });

As for what is available to choose from, the list is quite extensive and I won't post it all here. Here's a snippet of what appears to be what I have to work with
id: '',
    etag: '',
    selfLink: '',
    webContentLink: '',
    alternateLink: '',
    embedLink: '',
    iconLink: ''.
    thumbnailLink: '',

The images are being displayed on the frontend using a component like so
<MarinerImage src={props.driveData[0].thumbnailLink}>
</MarinerImage>

If I use any of the other available link types, this is the result
'Cross-Origin Read Blocking (CORB) blocked cross-origin response'
So once again, I'm just wondering if there's something I'm not seeing in the response data that could be used to generate a higher quality image. Failing that, Is there any way to configure things directly from my drive so that I could response to an API call with a higher quality image? It seems odd that I can't get anything other than a thumbnail. Thanks very much for any effort or time invested in this.


text:
Q: object files both in prerequisites and recipe output as targets in makefile With coding like
$(PROG): $(PROCESS) $(CHECK_SA) makefile $(LIBS)
        $(FC) $(FFLAGS) -o $(PROG) $(PROCESS) $(CHECK_SA) $(LINKLIBS)

The $(PROCESS) is .o object files.
There don't exist .o files in the directory at beginning. So when run make, it will first generate object files as prerequisites. So the target $(PROCESS) after -o is for creating the prerequisites? Is that correct?
But one thing that is strange is that, suppose I already have the object files at the beginning, it surely will come as prerequisites. But why do we still need the object file after -o as targets?
So what is the use of the same object files appearing both in the prerequisite and targets? Especially the target object files after -o.


text:
Q: SQL Stored Procs Null Parameters for a search of item I am creating a SQL stored procedure that will be used for the search of an item. I am allowing the user to search by item code or UPC. Thus, I need to be able to allow my parameters to be null. I think I'm close, however, when I execute this stored procedure it returns too many results when I am expecting only one.
Here's what I have:
  @itm_ItemCode int,
  @itm_UPC varchar(11)

SELECT
     ITEM_CODE as itm_itemcode
    ,UPC_CODE as itm_upc
    ,[DESCRIPTION] as itm_description
    ,BASE_PRICE as itm_regularcost

FROM ITEM_TABLE
    where (ITEM_CODE = @itm_ItemCode or @itm_ItemCode IS NULL)
          OR (UPC_CODE = @itm_UPC or @itm_UPC IS NULL)

Here are a few examples of what I have for my EXEC statement when I try to test my stored procedure: (Is this how I'm suppose to write my EXEC statements?
EXEC stp_ItemSearch null, 71591010583
EXEC stp_ItemSearch 300, null

Thank you for your help!
P.S. I'm using SQL Server Manager

A: You mean and, not or
 where (ITEM_CODE = @itm_ItemCode or @itm_ItemCode IS NULL)
      AND (UPC_CODE = @itm_UPC or @itm_UPC IS NULL)

Both of your examples have one parameter as null, so will return all rows.
If Item_code and upc_code are not nullable, then your code can be shortened to
where (ITEM_CODE = ISNULL(@itm_ItemCode,ITEM_CODE ))
      AND (UPC_CODE = ISNULL(@itm_UPC,UPC_CODE ))


text:
Q: Laravel getting javascript file as locale I am using Datapicker in Laravel project. I also implemented localalization there. The problem is Laravel is getting pikaday.js file as locale at first session. However, when I set locale manually as /en everything works fine untill the end of the session. How can I deal with this problem?
dd(\app()->getLocale()); is showing this:

Here is the middleware for localization:

This is the way of how I am importing js files for Datepicker.

A: You can add local under script
After below var can be used in the javascript file.
<script>
var locale = '{{ config('app.locale') }}';
console.log(locale);
</scripe>


text:
Q: How do I change order of Libs in a cmake file? Link order matters. I have observed that when I compile my program with:
gcc `pkg-config --cflags --libs gtk+-2.0` program.cpp -o program

which produces a number of linker errors: "undefined reference to `_gtk_init_abi_check' ", and others.  This can be remedied by specificying the input file before the libraries.
gcc program.cpp `pkg-config --cflags --libs gtk+-2.0` -o program

My Question:
How can I fix a problem of this nature when I am using a Cmake file?  Here are the contents of a simple cmake file I am currently using.
cmake_minimum_required(VERSION 2.6)

project(program)

add_executable(program
program.cpp
)

EXEC_PROGRAM(pkg-config ARGS --cflags --libs gtk+-2.0
             OUTPUT_VARIABLE GTK2_PKG_FLAGS)
SET(GTK2_PKG_FLAGS CACHE STRING "GTK2 Flags" "${GTK2_PKG_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GTK2_PKG_FLAGS}")

Now when I do a cmake followed by a make I get the same linker errors that the first line above gives me, so I know my linker problems are strictly related to order. So how do I change the link order when using pkg-config in a cmake file?  I've tried reordering parts of my cmake file, but I don't seem to be finding the right order.

A: You have passed both the arguments --cflags and --libs in the command which will give both -I and -L parts of the .pc file in one variable.
Try running message("${GTK2_PKG_FLAGS}") to print the contents.
Hence it may not be prudent to link the complete variable $GTK2_PKG_FLAGS  using target_link_libraries().
You may also want to try below steps
    INCLUDE(FindPkgConfig)
    pkg_check_modules(GTK REQUIRED gtk+-2.0)

#include
    include_directories(${GTK_INCLUDE_DIRS})

#link
    link_directories(${GTK_LIBRARY_DIRS})
    target_link_libraries(program ${GTK_LIBRARIES})

Refer question

A: Aha! After much searching around and some trial and error I finally got it to work by adding the following lines to my cmake file CMakeLists.txt:
target_link_libraries(program
${GTK2_PKG_FLAGS}
)

And by using some of the advice from user2618142's answer I improved it. The function pkg_check_modules() doesn't work for me for some reason. I get Unknown CMake command "pkg_check_modules" but by using the following as my cmake file, things work as expected.
cmake_minimum_required(VERSION 2.6)

project(program)

exec_program(pkg-config ARGS --cflags gtk+-2.0 OUTPUT_VARIABLE GTK_FLAGS)
exec_program(pkg-config ARGS --libs   gtk+-2.0 OUTPUT_VARIABLE GTK_LIBS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GTK_FLAGS}")

add_executable(program
program.cpp
)

target_link_libraries(program
${GTK_LIBS}
)

A: To fix the error Unknown CMake command "pkg_check_modules",
Use below code at the top of CMakeLists.txt.
find_package(PkgConfig)


text:
Q: Sphere cartopy gridspacing and Labeling I'm projecting a 2D map onto a sphere with cartopy and the gridlines keep doing what they want. Especially my xz perspective is messy!
I would love to place them like every 30° in both directions.
My code right now is like this
plt.figure(figsize=(10, 10))

ax = plt.axes(projection=ccrs.Orthographic(0, -90))
ax.gridlines(color='black', linestyle='dotted',linewidth='2')
ax.imshow(img, origin="upper", extent=(-180, 180, -90, 90),
          transform=ccrs.PlateCarree())  # Important

The image

Also I would love to label certain meridians like 270°


text:
Q: Turn FirebaseAnimatedList's into one single call I'm starting my journey on Flutter, mostly following some tutorials and codes on the web. I've been using a pre-made project which are making a single call to every FirebaseAnimatedList on the app (there are more than 6 FirebaseAnimatedList in different pages). The code below is a example on how I'm making those calls.
I've some questions that would help me a lot!

*

*How would be a better and smarter way to make one single call for the entire app?

*How I would change those FirebaseAnimatedList to another widget displaying the same content?

*Is there a way to cache these data coming from the Firebase Realtime Database?

*Any other suggestion I highly appreciated!

Thanks again!
class ExampleCode extends GetView<StatefulWidget> {
  ExampleCode({Key? key}) : super(key: key);
  Query dbRef = FirebaseDatabase.instance.ref().child('moedas');
  DatabaseReference reference = FirebaseDatabase.instance.ref().child('moedas');
  @override
  Widget build(BuildContext context) {
    FirebaseDatabase.instance.setPersistenceEnabled(true);
    return FirebaseAnimatedList(
      shrinkWrap: true,
      query: dbRef,
      itemBuilder: (BuildContext context, DataSnapshot snapshot,
          Animation<double> animation, int index) {
        Map moedas = snapshot.value as Map;
        moedas['key'] = snapshot.key;
        return appCardDefault(
          child: Column(
            children: [
              Row(
                children: [
                  Text(
                    moedas['moedaName'],
                    style: appTextTheme.headline2,
                  ),
                  Text(moedas['currentValue'], style: appTextTheme.headline1),
                ],
              ),
              CachedNetworkImage(imageUrl: moedas['moedaImg']!, width: 60),
            ],
          ),
        );
      },
    );
  }
}


text:
Q: Laravel scheduler not working as expected I build an application in laravel which suppose to fetch news using webhose.io every 4 hours for all country . It seems to work fine for sometime . But stops and restart again after sometime . I don't know how to track what is going wrong .
Laravel Version
Laravel Framework 5.5.45
Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-142-generic x86_64)
CRON Job details
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
* * * * * php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1
00 22 * * * /opt/dbbackup/db.sh /dev/null 2>&1

Kernel.php
<?php

    namespace App\Console;

    use DB;
    use App;
    use Illuminate\Console\Scheduling\Schedule;
    use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

    class Kernel extends ConsoleKernel
    {
        /**
        * The Artisan commands provided by your application.
        *
        * @var array
        */
        protected $commands = [
            //
            '\App\Console\Commands\GetNewsUpdates',
            '\App\Console\Commands\AddBirthdayNotifications',
            '\App\Console\Commands\DeleteBirthdayNotifications',
        ];

        /**
        * Define the application's command schedule.
        *
        * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
        * @return void
        */
        protected function schedule(Schedule $schedule)
        {
            //  $schedule->command(AddBirthdayNotifications::class, ['--force'])->daily();
            $schedule->command('AddBirthdayNotifications:addbdaynotifications')->dailyAt('13:00')->withoutOverlapping();

            $schedule->command('DeleteBirthdayNotifications:deletebdaynotifications')->daily()->withoutOverlapping();
            //->daily() // midnight
            if ( App::environment('live') ) {
              $schedule->command('GetNewsUpdates:getnews')->cron('0 */4 * * *')->sendOutputTo('/root/logs/laravel_output.log');
            }
            $schedule->command('DeleteSendEmails:deleteEmailsSend')->weekly()->withoutOverlapping();
            $schedule->command('SendEmails:sendEmailToUser')->hourly()->withoutOverlapping();
            $schedule->command('ConnectSendEmails:sendEmailToConnectUser')->hourly()->withoutOverlapping();
            // $schedule->command('GetNewsUpdates:getnews')->everyMinute();
            //  $schedule->command('DeleteBirthdayNotifications:deletebdaynotifications')
            //            ->daily();
            /*  $schedule->call(function () {
            DB::table('recent_users')->delete();
            })->daily();*/
        }

        /**
        * Register the commands for the application.
        *
        * @return void
        */
        protected function commands()
        {
            $this->load(__DIR__.'/Commands');

            require base_path('routes/console.php');
        }
    }

Laravel Logs for Jobs
Recent logs ( Which is working fine )
1062 BN 1062 BN 1062 BN 1062 BN 1062 IO 1061 IO 1061 IO 1061 IO 1061 IO 1061 IO 1061 IO 1061 IO 1061 IO 1061 IO 1061 IO 1061 IO 1061 IO 1061 IO 1061 IO 1061 IO 1061 BR 988 BR 988 BR 988 BR 988 BR 988 BR 988 BR 988 BR 988 BR 988 BR 988 BR 988 BR 988 BR 988 BR 988 BW 1059 BW 1059 BW 1059 BW 1059 BW 1059 BW 1059 BW 1059 BW 1059 BW 1059 BW 1059 BW 1059 BW 1059 BW 1059 BA 1058 BA 1058 BA 1058 BA 1058 BA 1058 BO 1057 BO 1057 BO 1057 BO 1057 BO 1057 BO 1057 BO 1057 BO 1057 BO 1057 BO 1057 BO 1057 BO 1057 BO 1057 BO 1057 BO 1057 BO 1057 BT 1056 BT 1056 BT 1056 BT 1056 BT 1056 BT 1056 BT 1056 BT 1056 BT 1056 BT 1056 BT 1056 BT 1056 BT 1056 BT 1056 BT 1056 BM 1055 BM 1055 BM 1055 BM 1055 BM 1055 BM 1055 BM 1055 BM 1055 BM 1055 BM 1055 BM 1055 BM 1055 BM 1055 BM 1055 BM 1055 BM 1055 BZ 1053 BZ 1053 BZ 1053 BZ 1053 BE 987 BE 987 BE 987 BE 987 BE 987 BE 987 BE 987 BE 987 BE 987 BE 987 BE 987 BE 987 BE 987 BE 987 BE 987 BY 1052 BY 1052 BY 1052 BY 1052 BY 1052 BY 1052 BY 1052 BY 1052 BY 1052 BY 1052 BY 1052 BY 1052 BY 1052 BY 1052 BY 1052 BY 1052 BB 1051 BB 1051 BB 1051 BB 1051 BB 1051 BB 1051 BB 1051 BB 1051 BB 1051 BB 1051 BB 1051 BB 1051 BB 1051 BB 1051 BB 1051 BB 1051 BD 1050 BD 1050 BD 1050 BD 1050 BD 1050 BD 1050 BD 1050 BD 1050 BD 1050 BD 1050 BD 1050 BD 1050 BD 1050 BD 1050 BD 1050 BD 1050 BH 1049 BH 1049 BH 1049 BH 1049 BH 1049 BH 1049 BH 1049 BH 1049 BH 1049 BH 1049 BH 1049 BH 1049 BH 1049 BH 1049 BH 1049 AZ 1047 AZ 1047 AZ 1047 AZ 1047 AZ 1047 AZ 1047 AZ 1047 AZ 1047 AZ 1047 AZ 1047 AZ 1047 AZ 1047 AZ 1047 AZ 1047 AZ 1047 AT 986 AT 986 AT 986 AT 986 AT 986 AT 986 AT 986 AT 986 AT 986 AT 986 AT 986 AT 986 AT 986 AT 986 AT 986 AT 986 AU 985 AU 985 AU 985 AU 985 AU 985 AU 985 AU 985 AU 985 AU 985 AU 985 AU 985 AU 985 AU 985 AU 985 AW 1046 AW 1046 AW 1046 AW 1046 AW 1046 AW 1046 AW 1046 AW 1046 AW 1046 AW 1046 AW 1046 AW 1046 AW 1046 AW 1046 AW 1046 AW 1046 AM 1045 AM 1045 AM 1045 AM 1045 AM 1045 AM 1045 AM 1045 AM 1045 AM 1045 AM 1045 AM 1045 AM 1045 AM 1045 AG 1044 AG 1044 AG 1044 AG 1044 AG 1044 AG 1044 AG 1044 AG 1044 AG 1044 AG 1044 AG 1044 AG 1044 AG 1044 AG 1044 AG 1044 AG 1044 AI 1042 AI 1042 AI 1042 AI 1042 AI 1042 AI 1042 AI 1042 AI 1042 AI 1042 AI 1042 AI 1042 AI 1042 AI 1042 AI 1042 AI 1042 AO 1041 AO 1041 AO 1041 AO 1041 AO 1041 AO 1041 AO 1041 AO 1041 AO 1041 AO 1041 AO 1041 AO 1041 AO 1041 AO 1041 AO 1041 AO 1041 AD 1040 AD 1040 AD 1040 AD 1040 AD 1040 AD 1040 AD 1040 AD 1040 AD 1040 AD 1040 AD 1040 AD 1040 AD 1040 AD 1040 AD 1040 AD 1040 AS 1039 AS 1039 AS 1039 AS 1039 AS 1039 AS 1039 AS 1039 AS 1039 AS 1039 DZ 1038 DZ 1038 DZ 1038 DZ 1038 DZ 1038 DZ 1038 DZ 1038 DZ 1038 DZ 1038 DZ 1038 DZ 1038 DZ 1038 DZ 1038 DZ 1038 DZ 1038 DZ 1038 AL 1037 AL 1037 AL 1037 AL 1037 AL 1037 AL 1037 AL 1037 AL 1037 AL 1037 AL 1037 AL 1037 AL 1037 AL 1037 AL 1037 AL 1037 AF 1036 AF 1036 AF 1036 AF 1036 AF 1036 AF 1036 AF 1036 AF 1036 AF 1036 AF 1036 AF 1036 AF 1036 AF 1036 AF 1036 AF 1036 AF 1036

Log for CRON Job
LOG for CRON from System log
Feb 25 10:05:01 connect424 CRON[6770]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:05:01 connect424 CRON[6771]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Feb 25 10:05:01 connect424 CRON[6774]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:06:01 connect424 CRON[6804]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:06:01 connect424 CRON[6805]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:07:01 connect424 CRON[6836]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:07:01 connect424 CRON[6837]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:08:01 connect424 CRON[6871]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:08:01 connect424 CRON[6870]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:09:01 connect424 CRON[6919]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:09:01 connect424 CRON[6920]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Feb 25 10:09:01 connect424 CRON[6922]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:10:01 connect424 CRON[7013]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:10:01 connect424 CRON[7014]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:11:01 connect424 CRON[7041]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:11:01 connect424 CRON[7043]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:12:01 connect424 CRON[7071]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:12:01 connect424 CRON[7073]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:13:01 connect424 CRON[7123]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:13:01 connect424 CRON[7125]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:14:01 connect424 CRON[7174]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:14:01 connect424 CRON[7175]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:15:01 connect424 CRON[7221]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Feb 25 10:15:01 connect424 CRON[7222]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:15:01 connect424 CRON[7225]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:16:01 connect424 CRON[7269]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:16:01 connect424 CRON[7270]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:17:01 connect424 CRON[7310]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:17:01 connect424 CRON[7311]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Feb 25 10:17:01 connect424 CRON[7309]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:18:01 connect424 CRON[7347]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:18:01 connect424 CRON[7348]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:19:01 connect424 CRON[7396]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:19:02 connect424 CRON[7398]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:20:01 connect424 CRON[7426]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:20:01 connect424 CRON[7427]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:21:01 connect424 CRON[7462]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:21:01 connect424 CRON[7464]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:22:01 connect424 CRON[7500]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:22:01 connect424 CRON[7501]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:23:01 connect424 CRON[7532]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:23:01 connect424 CRON[7534]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:24:01 connect424 CRON[7574]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:24:01 connect424 CRON[7575]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:25:01 connect424 CRON[7613]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Feb 25 10:25:01 connect424 CRON[7614]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:25:01 connect424 CRON[7616]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)
Feb 25 10:26:01 connect424 CRON[7649]: (root) CMD (php /var/www/html/connect/artisan schedule:run >> /root/logs/sec.log 2>&1)
Feb 25 10:26:01 connect424 CRON[7650]: (developer) CMD (php /var/www/html/connect/artisan schedule:run >> /dev/null 2>&1)

Edit :
Added withoutoverlapping() Logs with time
I found news update task is running every 4 hours but getting intreputted by other task .
if (App::environment('live')) {
            $schedule->command('GetNewsUpdates:getnews')->cron('0 */4 * * *')->withoutOverlapping(10)->sendOutputTo('/root/logs/laravel_output.log');

Logs with time
2019-02-27 12:00:01: Running scheduled command: '/usr/bin/php7.2' 'artisan' GetNewsUpdates:getnews > '/root/logs/laravel_output.log' 2>&1
2019-02-27 12:01:01: No scheduled commands are ready to run.
2019-02-27 12:02:01: No scheduled commands are ready to run.
2019-02-27 12:03:01: No scheduled commands are ready to run.
2019-02-27 12:04:01: No scheduled commands are ready to run.
2019-02-27 13:30:01: No scheduled commands are ready to run.
Running scheduled command: '/usr/bin/php7.2' 'artisan' SendEmails:sendEmailToUser > '/dev/null' 2>&1
Running scheduled command: '/usr/bin/php7.2' 'artisan' ConnectSendEmails:sendEmailToConnectUser > '/dev/null' 2>&1
2019-02-27 13:31:01: No scheduled commands are ready to run.
2019-02-27 13:59:01: No scheduled commands are ready to run.
2019-02-27 14:00:01: Running scheduled command: '/usr/bin/php7.2' 'artisan' SendEmails:sendEmailToUser > '/dev/null' 2>&1
2019-02-27 14:59:01: No scheduled commands are ready to run.
2019-02-27 15:00:01: Running scheduled command: '/usr/bin/php7.2' 'artisan' SendEmails:sendEmailToUser > '/dev/null' 2>&1
2019-02-27 15:01:01: No scheduled commands are ready to run.
2019-02-27 15:02:01: No scheduled commands are ready to run.
2019-02-27 15:58:01: No scheduled commands are ready to run.
2019-02-27 15:59:01: No scheduled commands are ready to run.
2019-02-27 16:00:01: Running scheduled command: '/usr/bin/php7.2' 'artisan' GetNewsUpdates:getnews > '/root/logs/laravel_output.log' 2>&1
2019-02-27 16:58:01: No scheduled commands are ready to run.
2019-02-27 16:59:01: No scheduled commands are ready to run.
2019-02-27 17:00:01: Running scheduled command: '/usr/bin/php7.2' 'artisan' ConnectSendEmails:sendEmailToConnectUser > '/dev/null' 2>&1
2019-02-27 17:01:01: No scheduled commands are ready to run.
2019-02-27 17:58:01: No scheduled commands are ready to run.
2019-02-27 17:59:01: No scheduled commands are ready to run.
2019-02-27 18:00:01: Running scheduled command: '/usr/bin/php7.2' 'artisan' ConnectSendEmails:sendEmailToConnectUser > '/dev/null' 2>&1
2019-02-27 18:01:01: No scheduled commands are ready to run.
2019-02-27 18:58:02: No scheduled commands are ready to run.
2019-02-27 18:59:01: No scheduled commands are ready to run.
2019-02-27 19:00:01: Running scheduled command: '/usr/bin/php7.2' 'artisan' ConnectSendEmails:sendEmailToConnectUser > '/dev/null' 2>&1
2019-02-27 19:01:01: No scheduled commands are ready to run.
2019-02-27 19:09:01: No scheduled commands are ready to run.
2019-02-27 19:10:01: No scheduled commands are ready to run.
2019-02-27 19:59:01: No scheduled commands are ready to run.
2019-02-27 20:00:01: Running scheduled command: '/usr/bin/php7.2' 'artisan' GetNewsUpdates:getnews > '/root/logs/laravel_output.log' 2>&1
2019-02-27 20:01:01: No scheduled commands are ready to run.
2019-02-27 20:59:01: No scheduled commands are ready to run.
2019-02-27 21:00:01: Running scheduled command: '/usr/bin/php7.2' 'artisan' ConnectSendEmails:sendEmailToConnectUser > '/dev/null' 2>&1
2019-02-27 21:01:01: No scheduled commands are ready to run.
2019-02-27 21:19:01: No scheduled commands are ready to run.
Running scheduled command: '/usr/bin/php7.2' 'artisan' SendEmails:sendEmailToUser > '/dev/null' 2>&1
Running scheduled command: '/usr/bin/php7.2' 'artisan' ConnectSendEmails:sendEmailToConnectUser > '/dev/null' 2>&1
2019-02-27 21:20:01: No scheduled commands are ready to run.
2019-02-27 21:59:01: No scheduled commands are ready to run.
2019-02-27 22:00:01: Running scheduled command: '/usr/bin/php7.2' 'artisan' ConnectSendEmails:sendEmailToConnectUser > '/dev/null' 2>&1
2019-02-27 22:01:01: No scheduled commands are ready to run.
2019-02-27 22:59:01: No scheduled commands are ready to run.
2019-02-27 23:00:01: Running scheduled command: '/usr/bin/php7.2' 'artisan' SendEmails:sendEmailToUser > '/dev/null' 2>&1
2019-02-27 23:01:01: No scheduled commands are ready to run.
2019-02-27 23:59:01: No scheduled commands are ready to run.
2019-02-28 00:00:01: Running scheduled command: '/usr/bin/php7.2' 'artisan' DeleteBirthdayNotifications:deletebdaynotifications > '/dev/null' 2>&1
Running scheduled command: '/usr/bin/php7.2' 'artisan' GetNewsUpdates:getnews > '/root/logs/laravel_output.log' 2>&1
2019-02-28 01:00:01: Running scheduled command: '/usr/bin/php7.2' 'artisan' ConnectSendEmails:sendEmailToConnectUser > '/dev/null' 2>&1
Running scheduled command: '/usr/bin/php7.2' 'artisan' SendEmails:sendEmailToUser > '/dev/null' 2>&1
Running scheduled command: '/usr/bin/php7.2' 'artisan' ConnectSendEmails:sendEmailToConnectUser > '/dev/null' 2>&1
2019-02-28 01:01:01: No scheduled commands are ready to run.

Laravel Recent Log where you can see inconsistency .
Incomplete task is being done if you compare with complete task from above.
ZW 1226 ZW 1226 ZW 1226 ZW 1226 ZW 1226 ZW 1226 ZW 1226 ZW 1226 ZW 1226 ZW 1226 ZW 1226 ZW 1226 ZW 1226 ZW 1226 ZW 1226 ZW 1226 ZM 1225 ZM 1225 ZM 1225 ZM 1225 ZM 1225 ZM 1225 ZM 1225 ZM 1225 ZM 1225 ZM 1225 ZM 1225 ZM 1225 ZM 1225 ZM 1225 YE 1223 YE 1223 YE 1223 YE 1223 YE 1223 YE 1223 YE 1223 YE 1223 YE 1223 YE 1223 YE 1223 YE 1223 YE 1223 YE 1223 YE 1223 YE 1223 VG 1219 VG 1219 VG 1219 VG 1219 VG 1219 VG 1219 VG 1219 VG 1219 VG 1219 VG 1219 VG 1219 VG 1219 VG 1219 VG 1219 VG 1219 VG 1219 VN 1218 VN 1218 VN 1218 VN 1218 VN 1218 VN 1218 VN 1218 VN 1218 VN 1218 VN 1218 VN 1218 VN 1218 VN 1218 VN 1218 VN 1218 VN 1218

A: In Simple Terms
When the CRON daemon calls the php artisan schedule:run command every minute, the Console Kernel will be booted up and the jobs you defined inside your App\Console\Kernel::schedule() method will be registered into the scheduler.
The schedule() method takes an instance of Illuminate\Console\Scheduling\Schedule as the only argument, this is the schedule manager used to record the jobs you give it and decides what should run every time the CRON daemon pings it.
Now moving towards your issue .
as @hoseinz3 Mentioned is almost right
How Laravel prevents your scheduled jobs from overlapping ?
Sometimes a scheduled job takes more time to run than what we initially expected, and this causes another instance of the job to start while the first one is not done yet, for example imagine that we run a job that generates a report every minute, after sometime when the data gets huge the report generation might take more than 1 minute so another instance of that job starts while the first is still ongoing.
In most scenarios this is fine, but sometimes this should be prevented in order to guarantee correct data or prevent a high server resources consumption .
Laravel will check for the Console\Scheduling\Event::withoutOverlapping class property and if it's set to true it'll try to create a mutex for the job, and will only run the job if creating a mutex was possible.
For more on Mutex
So Laravel creates a mutex when the job starts the very first time, and then every time the job runs it checks if the mutex exists and only runs the job if it doesn't.
So Laravel creates a filter-callback method that instructs the Schedule Manager to ignore the task if a mutex still exists, it also creates an after-callback that clears the mutex after an instance of the task is done.
Try this snippet
<?php

namespace App\Console;

use App;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel {
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
        '\App\Console\Commands\GetNewsUpdates',
        '\App\Console\Commands\AddBirthdayNotifications',
        '\App\Console\Commands\DeleteBirthdayNotifications',
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule) {

        // ---------- Birthday Notification at Daily at 15:00 --------------------
            $schedule->command('AddBirthdayNotifications:addbdaynotifications')
                     ->dailyAt('23:45')
                     ->withoutOverlapping(60);

        // ---------- Delete Birthday Notification at Daily at 23:30 -------------
            $schedule->command('DeleteBirthdayNotifications:deletebdaynotifications')
                     ->dailyAt('23:30')
                     ->withoutOverlapping(60);

        /*
            Get News At every 4 Hours Daily
        */

        if (App::environment('live')) {
            $schedule->command('GetNewsUpdates:getnews')
                ->cron('0 */4 * * *')
                ->withoutOverlapping(100)
                ->pingBefore("") //This will alert if something fails
                ->thenPing("")
                ->appendOutputTo('output.log');
        }

        // -----------  Delete Send Emails at weekly -------------------
            $schedule->command('DeleteSendEmails:deleteEmailsSend')
                     ->weekly()
                     ->withoutOverlapping(60);

        // ----------- Send Emails at Daily at 6:00 --------------------
            $schedule->command('SendEmails:sendEmailToUser')
                     ->dailyAt('6:00')
                     ->withoutOverlapping()
                     ->appendOutputTo('/root/logs/Emails_output.log');

        // ------------ Bulk user email scheduling Run Daily at 9:30 According to America time .... -----------------
            $schedule->command('ConnectSendEmails:sendEmailToConnectUser')
                     ->timezone('America/New_York')
                     ->dailyAt('9:30')
                     ->withoutOverlapping()
                     ->appendOutputTo('/root/logs/BulkEmails_output.log');

/**
 * Register the commands for the application.
 *
 * @return void
 */
    protected function commands() {
        $this->load(__DIR__ . '/Commands');

        require base_path('routes/console.php');
    }
}

Try some kind of CRON Job Monitoring system .
You can Try Eyewitness which is very good tool to monitor Laravel Application .

A: You have used withoutOverlapping method, based on  Laravel documentation that means when one job took longs time to run Laravel Hold new job for 24 hours by default, and after that, it tries to run that job if no job would running, and you could also change this number by passing through withoutOverlapping argument. for example
$schedule->command('command')->hourly()->withoutOverlapping(5);

It means Laravel hold new command for 5 hours if there is running command after that it will try to run this again.

A: Laravel run cron jobs synchronously, so some tasks can block other.

*

*You can try dispatch some event to queue instead of just running command.

*Or try run command in background
$schedule->command('analytics:report')
     ->daily()
     ->runInBackground();

*Also simple workaround is configure your cron jobs at different schedule. Like with minutes difference.
Since cron start each minute all scheduled tasks will be started normally with few minutes delay between it without blocking each other.
$schedule->command('analytics:report')->hourlyAt(1); // run every hour at 1 minute
$schedule->command('analytics:report2')->hourlyAt(2); // run every hour at 2 minute
$schedule->command('analytics:report3')->hourlyAt(3); // run every hour at 3 minute

or
$schedule->command('analytics:report')->dailyAt('13:01');
$schedule->command('analytics:report2')->dailyAt('13:02');
$schedule->command('analytics:report3')->dailyAt('13:03');


text:
Q: Random system halt/crash with Ubuntu 20.04 on Raspberry Pi 4 I installed Ubuntu 20.04 with Xfce4 DE (xubuntu-desktop) on a Raspberry Pi 4 4GB.
System runs good but randomly it shutdowns/halts, I don't known exactly what happens because I use it as headless server and connect via SSH or VNC.
When I can't connect to it, I go where the Pi is and I find it with both leds (activity and power) off. There is a little fan connected to +3.3 V pin of GPIO for cooling and it is on...
I'm sure there aren't hardware failure because the Pi runs like a charm with Raspbian Buster OS!

A: I have put some more time into this problem. After running stable for 24h hours now I am quite certain the issue is related to the suspend feature offered by the hardware and several desktop environments. The Raspberry Pi either fails to wake from suspend or fails to suspend.
What solved the issue for me was turning off Auto-suspend. For example, Gnome allows you to set suspend under System Settings -> Power. The Auto-suspend setting there is enabled by default. If you change that setting to Never, the Raspberry will run stable.
On a somewhat related note, it would be very nice to have kdump/kexec work on the Pi. Did someone ever figure out an initramfs/cmdline that works?

A: I replaced Gnome with XFCE and it works without crashing.
I made this decision because with the remote access via ssh it still worked, unfortunately a BUG in Gnome causes this to crash, even disabling the items with reference to power did not solve the problem.

A: I have similar experience - I wanted to install kubuntu desktop and it says it is installed, but there is no way of login into it - just option for the Ubuntu. The same with lubuntu. So i ended with installing the full Ubuntu desktop, which is not somewhat OK, but if I log out, the system crashes with just cursor on the screen; hard reset required. Also it would crash after the system goes to sleep/hybernation. Pretty annoying - Raspbian is running perfect.
Also, from the beginning I am having problem with only one, quite low and weird resolution available for my 4k Samsung display. Sadly, there is nothing yet to be found on internet suggesting, what kind of problem it could be and how to fix it...

A: I have found that the Gnome desktop is causing the problem. Killing all gnome processes on the Raspi gave me a stable machine. It now runs for 18 hours without a problem. Before it would halt every 30 mins or so... I am running the machine headless.

A: Still a little early, but with suspend turned off my Rasp Pi with lubuntu desktop is running longer than it ever has without locking up.

A: Go to Settings → Session and Startup and disable:

*

*Power Manager

*Printers

*Blueman (if you don't use Bluetooth)

*...


text:
Q: RPM gives a warning during un-installation if file does not exist Some files of my rpm package (depending on some conditions) are deleted in %post scriptlet which causes a warning during the uninstallation: "remove failed: No such file or directory"
Note: The problem does not occur in systems with older versions of RPM and is noticed only on RHEL7 and SLES12.
While trying to figure this out, I found the following code in RPM sources (fsm.c):
    /*
     * Missing %ghost or %missingok entries are not errors.
     * XXX: Are non-existent files ever an actual error here? Afterall
     * that's exactly what we're trying to accomplish here,
     * and complaining about job already done seems like kinderkarten
     * level "But it was MY turn!" whining...
     */
    if (rc == RPMERR_ENOENT && missingok) {
    rc = 0;
    }

    /*
     * Dont whine on non-empty directories for now. We might be able
     * to track at least some of the expected failures though,
     * such as when we knowingly left config file backups etc behind.
     */
    if (rc == RPMERR_ENOTEMPTY) {
    rc = 0;
    }

    if (rc) {
    int lvl = strict_erasures ? RPMLOG_ERR : RPMLOG_WARNING;
    rpmlog(lvl, _("%s %s: remove failed: %s\n"),
        S_ISDIR(sb.st_mode) ? _("directory") : _("file"),
        fpath, strerror(errno));
        }
    }

Seems the %missingok virtual file attribute solves the problem, but
actually, there is no %missingok attribute, there is the %config(missingok) one, instead.
What makes this look strange to me is that we mark the file as config file, though AFAICS there is no strict difference between config files and ordinary files.
The question: Is it OK to use the abovementioned attribute for non-config files (for binaries)? Will this cause problems on upgrades or something?
Thanks.


text:
Q: CSS overlay on revolution slider slides I have been having a confused moment with some CSS which, as far as I can see should work fine.
I have a revolution slider which generates the slides and puts an overlay on each slide. I want the overlay on some slides and not on others so have put a class on the preceeding element (li) at runtime called noOverlay. The child div (the overlay, with a class called slotholder) has css applied to it, in the form of an ::after, to apply the overlay as a background. I have created another css declaration which selects the slotholder::after via the parent div.
Problem is, the css doesnt seem to be applied.
You can see the live page here http://wwtw.org.uk/woa
Thanks in advance for any help you can give.
Code is as follows; (the first css declaration gives all the slides the overlay, the second, i was hoping, would remove it)
CSS:
.banner .rev_slider .slotholder:after {
    width: 100%;
    height: 100%;
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    /* black overlay with 50% transparency */
    background: rgba(0, 0, 0, 0.5);
}

.noOverlay .slotHolder:after {
   background: rgba(0, 0, 0, 0.0) !important;
}

HTML:


text:
Q: Обработчик события .on() $('a[href^="#"]').click(function() {
    // Код
    return false;
});

Прочитал в документации что можно переделать на:
$('a[href^="#"]').on('click', function() {
    // Код
    return false;
});

handler — функция, которая будет установлена в качестве обработчика.
  Вместо функции, можно указать значение false, это будет эквивалентно
  установке такой функции: function(){return false;}.

$('a[href^="#"]').on('click', function(false) {
    // Код
});

$('a[href^="#"]').on('click', false) {
    // Код
});

Но что-то не чего не получается, я не как понял или просто не правильно прописываю?

A: Внимательно посмотрите в консоль браузера, наверняка ошибки вываливаются. В документации(англ) к jQuery приведен пример:
$( "a.disabled" ).on( "click", false );

У вас написано лишнее

$('a[href^="#"]').on('click', false) {
   // Код
});


text:
Q: Problem with induction of binomial coefficiency (Sorry for making up math language, I am roughly translating math terms here)
This is part of some of the induction exercises in the book "Otto Forster: Analysis 1" (1.2):
$$\binom{x+y}{n}=\sum_{k=0}^{n}\binom{x}{n-k}\binom{y}{k}.$$
$$(a_n = b_n)$$
I am also instructed to consider that:
$$\binom{x}{k}=\prod_{j=1}^{n}\frac{x-j+1}{j}$$
I think I understood what induction is, and I am also able to make simple induction proofs, but this one is kind of hard to me. Normally I try to extract a statement from one side of the equation the resembles the "step forward" in the term/sequence. As in $a_{n+1} - a_n = a_{dif}$, and then try to add that "difference" to the other side of the equation to see if I can form something like $b_n + a_{dif} = b_{n+1}$. However this simplefied technique doesn't seem to work on this excersice. Nothing I do seems to lead anywhere, mostly because of
$\sum_{k=0}^{n}\binom{x}{n-k}\binom{y}{k}$ (Normally I can just "take off" the last member (n+1) of the sum and hook it onto the other term)
Is this really as hard as I feel it is? Is my approach just unsuited
for this problem? I could really use some clues on how to move on here.


text:
Q: Does WAL cause Hbase writing performance inefficient The book says that one RegionServer only have one opened WAL file. So I'm wondering if I have multiple writing requests to one RegionServer at the same time, so will the WAL become the bottleneck of writing, since the file lock will change the parallel writing to very slow sequential writing? Thanks!

A: Take a look here about wals : https://hbase.apache.org/book.html#_multiwal
It says you can have parallel wal writing after 1.0 version and if you need, you can split wal files for regions, so you can have more than one wal file for a RegionServer.
And if your data is not so important, you can disable wal writing for individual Put operations.


text:
Q: Hive Variable Substitution with function I am trying to to something like the following in Hive
set TODAY="2013-11-04"; //this works
SET TODAY = to_date(from_unixtime(unix_timestamp())); //this does not..
set TODAY;
TODAY=to_date(from_unixtime(unix_timestamp()))
Any suggestions?

A: SET TODAY = to_date(from_unixtime(unix_timestamp()));

This is not available in Hive.
What you can do is
select  concat ('set TODAY=',to_date(from_unixtime(unix_timestamp())),'\;') from testTableName limit 1 >>/path/to/HQL/file/fileName.sql

Now in the file fileName.sql you will see
set TODAY=2013-11-05;

The file fileName.sql need to be loaded before running the other dependent queries. That you can do by this:
hive -f hiveQueries.sql

You file hiveQueries.sql should contain something like this:
    use testDB;
    source /path/to/HQL/file/fileName.sql;
    select * from testTable where someColumn=${hiveconf:TODAY};

Hope this helps..:)


text:
Q: Issue using a "used" SSD as a Windows 8.1 Boot Drive So, I'm something of a Mac person, but decided to take a stab at this whole "build yourself a PC" thing - right now, the thing is assembled, posts just fine, and can get to the BIOS. The problem is the drive I want to use - I intended to use a 80 GB Corsair SSD I've had sitting around as the boot drive, and a new Samsung SSD for games and the like.
So I boot using a Windows 8.1 install USB stick, and if the Samsung drive is plugged in, it happily offers to install Windows on it. The Corsair drive though, it's flipped out - I reformatted it as a blank NTFS drive (it was HFS for Mac purposes) and the BIOS can't see it, nor can the Windows installer.
What's wrong, and how do I fix it? The tools at my disposal are:
The current ASUS BIOS that came with my motherboard (a Z87I-Deluxe), a Mac running the latest OS X which can also boot to Windows 7 if needed via either Parallels or Bootcamp.
Update 1: Update: Based on a friend's suggestion to switch SATA ports, Windows 8.1's installer can now see the drive as Drive 0, Partition 1, a 83.8 GB "Primary" partition. But when I click it and hit "Next", I get the following error:
"We couldn't create a new partition or locate an existing one. For more information, see the Setup log files" - not that it gives any clue how to access those.
Update 2: Following a trail of Google suggestions, I ended up going into advanced tools and just reformatting the drive as follows:
Start DISKPART.
Type LIST DISK and identify your SSD disk number (from 0 to n disks).
Type SELECT DISK <n> where <n> is your SSD disk number.
Type CLEAN
Type CREATE PARTITION PRIMARY
Type ACTIVE
Type FORMAT FS=NTFS QUICK
Type ASSIGN
Type EXIT twice (one to get out of DiskPart, the other to exit the command line tool)

Per these instructions. This goes well  enough, but now I can select the disk for installation, and I get a new error: "Windows 8 cannot be installed to this disk. The selected disk has an MBR partition table. On EFI systems, Windows can only be installed to GP disks."
So, Googling that, I do the following:
select disk 0
clean
convert gpt
exit

...and we might have fixed it. Windows is at least trying to install now.


text:
Q: PHP - concatenate parts in a var or use multiple echo, right way? I didn't find an answer to this (maybe wrong search), so giving the following simple example:
echo '
'. $varname .'
';

What would be the right (= faster, better from the perspective of performance or memory usage) way of doing it? Just echoing everything at once or breaking in concatenated parts, like:
$thevar = '
';
$thevar .= $varname;
$thevar .= '
';
echo $thevar;

I have seen both ways around, does it make any difference?

A: As always, this depends on the situation you have. So, let's consider the cases:
Concatenation
echo '
'. $varname .'
';

This does a single calculation and it has no faults by itself. However, if you need to calculate this many times (outputting it in 1000 places, for instance), then you might want to store this into a variable to avoid code duplications and improve performance.
Concatenation with template
echo "
{$varname}
";

or even
echo "
{$varname}
";

Behaves in the same way as above, but you do not have to explicitly concatenate.
Variable
$foo = '
'. $varname .'
';
echo $foo;

If you compute this into a variable and then you reuse that variable, then, if you need to get the same value repeatedly, then it's better for your performance to only compute it once and reuse the result. The caveat is that your variable is stored in memory and you need to avoid wasting performance and memory.
Conclusion
In more general terms, your question is as follows:
Is it better for performance/memory usage to compute the results of a formula and store it in a variable, or is it to be preferred that you just compute the result and pass it on
And the answer is:

*

*if you only use the value once, then storing it into a variable as a minuscule cost in performance and memory usage (assuming that your value is not very big), because storing something takes more memory and time than not storing it, yet, this is such a small cost that you should not worry about it and if your code is more understandable with putting this into a variable, then do so

*if you need to reuse this many times, then it's better to store it into a variable (again, if the value is very big, that requires separate analysis), because computing the same thing again and again is costing you in performance and duplicating code leads to inconsistencies and inconsistencies lead to bugs

*if you need to reuse many huge such values many times, then you need to carefully analyze your current situation

But, everything aside, don't optimize your code before you have performance issues, because the reasons of performance issues are often different from what you perceive them to be. It's good to write high-performing code that does not use much memory, so if you know something to be quicker/smaller beforehand, use that knowledge while you write code, but don't aim for mathematical perfection of performance improvement at the time of the initial implementation of your code, because your effort is unlikely to pay off. It's possible that you will never encounter performance issues with the code you write and if you do, then it will likely be different from the one you believe it to be at some point in the future.


text:
Q: Enable Gitlab link redirects for slack We're running a self hosted Gitlab instance and using Slack for communication  at work.
I've run into some issues when trying to follow links to our Gitlab instance posted on Slack (by web-hooks in this case) where ABE would just block the redirection. Since the purpose of the redirect is to strip out the referrer info, I'd rather not disable that feature in Slack as it affects all other links too.
I found a solution to this by tweaking the SYSTEM setting in ABE to:
# Prevent Internet sites from requesting LAN resources.
Site LOCAL
Accept from LOCAL
Accept GET from slack-redir.net
Deny

As I understand it this allows slack-redir.net to do any GET request locally, and I'd prefer to only allow the redirection to gitlab.
Any suggestions on how that might be done are most welcome.

A: Regex does the trick! It can probably be less greedy but it works quite nicely.
# Prevent Internet sites from requesting LAN resources.
Site LOCAL
Accept from LOCAL
Accept GET from git.mydomain.com ^http.:\/\/slack-redir\.net\/link\?url=https\%3A\%2F%2Fgit\.mydomain\.com.*$
Deny


text:
Q: Independence of random vectors Let $(X_1,X_2)$ be a random vector verifying $E[f(X_1,X_2)] \leq E[f(Y_1,Y_2)]$ for every real function $f \in C^2(\mathbf{R}^2)$ satisfying $\partial^2 f/\partial x \partial y \geq 0$ and some independent r.v.'s $Y_1, Y_2$ such that $Y_j \overset{\text{d}}{=} X_j$ for each $j=1,2$. It is possible to find nonnegative independent r.v.'s $Z_1$ and $Z_2$ such that the vectors $(Z_1,Z_2)$, $(X_1,X_2)$ are independent and $(Z_1,Z_2)$, $(Y_1,Y_2)$ are dependent? With thanks.

A: It depends.  If you let $(Y_1, Y_2)$ be any random vector, then we can choose $(X_1,X_2)$ so that no such $(Z_1,Z_2)$ exists, or choose $(X_1,X_2)$ so that such a vector does exist.  For instance, if you let $X_1 = Y_1$ and $X_2 = Y_2$ then no such vector can possibly exist.  However, if you let $X_1$ and $X_2$ be independent copies of $Y_1$ and $Y_2$ and set $Z_j = |Y_j|$ then clearly $(X_1,X_2)$ is independent of $(Z_1,Z_2)$ but $(Y_1,Y_2)$ is not independent of $(Z_1,Z_2)$.


text:
Q: Table-valued parameter to be used in two stored procedures I wrote a stored procedure to insert values into a table-valued parameter.
CREATE PROCEDURE insert_timezone_table
    @TZ NVARCHAR(10)
AS
BEGIN
    DECLARE @Table CT_sp;

    IF type_id('[dbo].[COUNTRY_TIMEZONE_sp]') IS NOT NULL
        DROP TYPE [dbo].[COUNTRY_TIMEZONE_sp];

    CREATE TYPE COUNTRY_TIMEZONE_sp as TABLE (country_code NVARCHAR(2))

    INSERT @Table (country_code)
        SELECT country_code
        FROM Timezones
        WHERE fo_timezone = @TZ
END

Then I want to pass this as input for another stored procedure, using in the end  in the WHERE clause like this:
WHERE country_code IN (SELECT country_code FROM @TimezoneTable)

This is not yielding what I want, so I have two questions:

*

*Is it possible to make a simple select on the table-valued parameter to see exactly what fell inside there on the 1st procedure?

*I reckon this can be a problem of missing quotes on the strings being passed in the IN clause.. How can I solve this problem? Anyway I can in the first stored procedure add the results of the other table concatenated with '' ?
WHERE country_code IN (SELECT country_code FROM @TimezoneTable)
I guess it is doing something like IN ( DE,PL) so it retrieves blanks, and it should be doing IN ('DE','PL') but I do not know how to put the country_codes in quotations
Thank you!


text:
Q: Redirect all to HTTPS I would like to redirect all http and https to 1 domain, thus I'd be interested to know the code to add into the .htaccess file in order to redirect:
From: HTTP(non-www) + HTTP(www) + HTTPS(www) To: HTTPS(non-www)
I have found the following answer:
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https:// %{HTTP_HOST}%{REQUEST_URI}

but it redirects to HTTPS(www) for as far I understood and mine should be redirected to HTTPS(non-www)
Thanks in advance.

A: If you always redirect to a specific domain which is always the same, then you just need to put it instead of %{HTTP_HOST} in your RewriteRule.
The %{HTTP_HOST} tells to use the same http hostname as the source of the redirect. But you need to have your own destination name, not copied from the source.
Something like this:
RewriteEngine On
RewriteRule (.*) https://mydomain.com/%{REQUEST_URI}

P.S.: Please make sure the destination domain does not have the same rule to avoid cyclic redirects.


text:
Q: PyQt: Move an image around a canvas and save canvas image as PNG I am a beginner in PyQt and I am trying to create a canvas where I could place multiple PNG images and move it around the canvas. (Pretty much like the Photoshop/GIMP). May I have any pointers on how to realize these?

*

*Dragging actual image from the list to place on canvas

*Move images around the canvas

*Save the whole canvas (including the images placed on the canvas) as a single PNG file with transparent background

Here is a diagram illustrating what I am trying to achieve: the green arrows are the drag actions and the images are free to move around the canvas upon selection.
https://i.imgur.com/ArjGHJl.png
I have tried to create the image list but I am not sure how to drag the image out. I would also like to know the correct way of implementating a canvas which allow image to place on it. I have tried QPainter but it seems irrelevant to the task i am trying to achieve.
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import sys
import os
from PIL import Image, ImageQt

class DragDropListWidget(QListWidget):
    def __init__(self):
        super().__init__()
        self.setAcceptDrops(True)
        self.setIconSize(QSize(72, 72))
        print(self.size())
        print(self.sizeHint())
        self.resize(self.sizeHint())

        folder_path = 'dummy_folder'
        list_files = self.get_img_list(folder_path)
        for file in list_files:
            in_path = os.path.join(folder_path, file)
            self.put_into_img_list(in_path)

    def put_into_img_list(self, path):
        picture = Image.open(path)
        picture.thumbnail((71, 71), Image.Resampling.LANCZOS)
        icon = QIcon(QPixmap.fromImage(ImageQt.ImageQt(picture)))
        item = QListWidgetItem(path, self)
        item.setStatusTip(path)
        item.setIcon(icon)

    def get_img_list(self, path):
        IMG_FORMATS = 'png', 'PNG'
        list_img = [img for img in os.listdir(path) if (img.split(".")[-1] in IMG_FORMATS) ==True]
        return list_img

class MyCanvas(QWidget):
    def __init__(self):
        super().__init__()
        # creating canvas
        self.image = QImage(self.size(), QImage.Format_ARGB32)
        self.image.fill(Qt.black)

# creating class for window
class Window(QMainWindow):
    def __init__(self):
        super().__init__()
        title = "Dummy GIMP"
        top = 0
        left = 0
        width = 800
        height = 450
        self.setWindowTitle(title)
        self.setGeometry(top, left, width, height)

        box = QHBoxLayout()
        self.canvas = MyCanvas()
        self.image_list = DragDropListWidget()
        wid = QFrame(self)
        self.setCentralWidget(wid)
        box.addWidget(self.image_list)
        box.addWidget(QPushButton("Save as PNG"))
        box.addWidget(self.canvas)
        wid.setLayout(box)

if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = Window()
    window.show()
    sys.exit(app.exec())

Code output:
https://i.imgur.com/Fkt8Yjc.png


text:
Q: Setting up Eclipse for C development using CDT plugin I am using Eclipse 3.5.2. I want to install the CDT plugin so that I can compile C/C++ programs.
I attempted to install the CDT plugin and it failed, given the following error message:
Cannot complete the install because one or more required items could not be found.
  Software being installed: C/C++ GCC Cross Compiler Support 1.1.0.201206111645 (org.eclipse.cdt.build.crossgcc.feature.group 1.1.0.201206111645)
  Missing requirement: C/C++ Managed Builder UI 8.1.0.201206111645 (org.eclipse.cdt.managedbuilder.ui 8.1.0.201206111645) requires 'bundle org.eclipse.ui.console [3.5.100,4.0.0)' but it could not be found
  Cannot satisfy dependency:
    From: CDT GCC Cross Compiler Support 1.1.0.201206111645 (org.eclipse.cdt.build.crossgcc 1.1.0.201206111645)
    To: bundle org.eclipse.cdt.managedbuilder.ui 8.1.0
  Cannot satisfy dependency:
    From: C/C++ GCC Cross Compiler Support 1.1.0.201206111645 (org.eclipse.cdt.build.crossgcc.feature.group 1.1.0.201206111645)
    To: org.eclipse.cdt.build.crossgcc [1.1.0.201206111645]

Has anyone managed to install/use the CDT plugin with Eclipse v 3.5.2 ?

A: Do you have GCC installed? If I remember correctly CDT does not include the compiler. You need to find a C compiler and install it before installing CDT.


text:
Q: Angular 2 Typescript Highcharts Highmap mouse wheel scroll I'm just wondered if its not possible to subscribe to the zooming event in a highmap (Angular 2 Typescript Highcharts/Highmap) - or even to a mouse wheel scrolling event.
 @HostListener('scroll', ['$event'])
   onScroll(e) {
     // do smth - but never reached
    }

It's only called if you scroll on the divs border - but not in the map (it only zooms in/out, thats okay but i want to add smth)
Already tried to set (scroll)="yourFunction($event)" to the map div and a container div.
Any suggestions?

A: Did you try this
you may want to look @ xAxis.events.setExtremes And/Or chart.events.selection