text:
Q: Issue with reading/extracting value from XmlNode in efficient way I would like to extract information from this xml response that i receive but i'm having issues.
I believe that my current code is not efficient as i have to write a lot of if statements to extract the data.
Essentially i want to go through the elements and store the values i want in a variable that i will use later on in my code.
Can someone advise on a better alternative to what i'm trying to achieve please?
Here is the XML response that I receive:
 <?xml version="1.0"?>
<gls:TheDocument xmlns:pbr="http://www.something.com" xmlns:gls="http://www.testsomething.com" xmlns:cnr="http://www.organisation.com"
xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="2.8">
<gls:PatientDem>
            <cnr:PatientId>
                <cnr:IdValue>123455</cnr:IdValue>
                <cnr:IdScheme>TEST</cnr:IdScheme>
                <cnr:IdType>PRN</cnr:IdType>
            </cnr:PatientId>
            <cnr:PatientName>
                <cnr:Name>
                    <cnr:Title>Mr</cnr:Title>
                    <cnr:GivenName>Joe</cnr:GivenName>
                    <cnr:FamilyName>Wood</cnr:FamilyName>
                </cnr:Name>
                <cnr:NameType>Current Name</cnr:NameType>
            </cnr:PatientName>
            <cnr:PatientAddress>
                <cnr:Address>
                    <cnr:AddressLine>57 High Street</cnr:AddressLine>
                    <cnr:AddressLine>London</cnr:AddressLine>
                </cnr:Address>
                <cnr:PostCode>WC1E 7HU</cnr:PostCode>
                <cnr:AddressType>Current Residence</cnr:AddressType>
            </cnr:PatientAddress>
            <cnr:DateOfBirth>1969-11-02</cnr:DateOfBirth>
            <cnr:Sex>M</cnr:Sex>
        </gls:PatientDem>
</gls:TheDocument>

Here is the C#
        XmlDocument xml = new XmlDocument();
        xml.Load(responseXML);

        XmlNamespaceManager nsmgr = new XmlNamespaceManager(xml.NameTable);
        nsmgr.AddNamespace("gls", "http://www.testsomething.com");
        nsmgr.AddNamespace("cnr", "http://www.organisation.com");

        XmlNodeList list = xml.SelectNodes("//gls:PatientDem", nsmgr);

        string idType = string.Empty;
        string idScheme = string.Empty;
        string idValue = string.Empty;

        string title = string.Empty;
        string givenName = string.Empty;
        string familyName = string.Empty;
        string nameType = string.Empty;

        string addressLine = string.Empty;
        string postCode = string.Empty;
        string addressType = string.Empty;
        DateTime dateOfBirth;
        string gender = string.Empty;

        string gpName = string.Empty;
        string gpAddressLine = string.Empty;
        string gpPostCode = string.Empty;
        string gpAddressType = string.Empty;

        foreach (XmlNode xmlNode in list)
        {
            //Root Node Patient
            if (xmlNode.HasChildNodes)
            {
                foreach (XmlNode childNode in xmlNode.ChildNodes)
                {
                    if (childNode.HasChildNodes)
                    {
                        foreach (XmlNode node in childNode.ChildNodes)
                        {
                            if (node.HasChildNodes)
                            {
                                foreach (XmlNode innerChildNode in node.ChildNodes)
                                {
                                    if (innerChildNode.LocalName == "AddressLine" && childNode.LocalName == "PatientAddress")
                                    {
                                        if (addressLine.Length > 0)
                                        {
                                            addressLine += "," + innerChildNode.InnerText;
                                        }
                                        else
                                        {
                                            addressLine = innerChildNode.InnerText;
                                        }
                                    }

                                    switch (innerChildNode.LocalName)
                                    {
                                        case "Title":
                                            title = innerChildNode.InnerText;
                                            break;
                                        case "GivenName":
                                            givenName = innerChildNode.InnerText;
                                            break;
                                        case "FamilyName":
                                            familyName = innerChildNode.InnerText;
                                            break;
                                        default:
                                            break;
                                    }

                                    if (innerChildNode.LocalName == "#text")
                                    {
                                        var parentNode = innerChildNode.ParentNode;

                                        switch (parentNode.LocalName)
                                        {
                                            case "IdValue":
                                                idValue = node.InnerText;
                                                break;
                                            case "IdScheme":
                                                idScheme = node.InnerText;
                                                break;
                                            case "IdType":
                                                idType = node.InnerText;
                                                break;
                                            case "NameType":
                                                nameType = node.InnerText;
                                                break;
                                            case "PostCode":
                                                postCode = node.InnerText;
                                                break;
                                            case "AddressType":
                                                addressType = node.InnerText;
                                                break;
                                            default:
                                                break;
                                        }
                                    }
                                }
                            }
                            else
                            {
                                if (childNode.LocalName == "DateOfBirth")
                                {
                                    dateOfBirth = Convert.ToDateTime(childNode.InnerText);
                                }

                                if (childNode.LocalName == "Sex")
                                {
                                    if (childNode.InnerText == "M")
                                    {
                                        gender = "Male";
                                    }
                                    else if (childNode.InnerText == "F")
                                    {
                                        gender = "Female";
                                    }
                                }
                            }

                        }
                    }

                }
            }
        }

A: Try following Xml Linq.  I'm reading xml from file and putting into a string.  Youcan use your response string instead.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;
using System.IO;

namespace ConsoleApplication97
{
    class Program
    {
        const string FILENAME = @"c:\temp\test.xml";
        static void Main(string[] args)
        {
            string xml = File.ReadAllText(FILENAME);

            XDocument doc = XDocument.Parse(xml);
            XElement root = doc.Root;
            XNamespace glsNs = root.GetNamespaceOfPrefix("gls");
            XNamespace cnrNs = root.GetNamespaceOfPrefix("cnr");

            List<XElement> xPatientDems = doc.Descendants(glsNs + "PatientDem").ToList();

            List<PatientDem> patientDems = new List<PatientDem>();
            foreach (XElement xPatientDem in xPatientDems)
            {
                PatientDem patientDem = new PatientDem();
                patientDems.Add(patientDem);

                XElement xPatientId = doc.Descendants(cnrNs + "PatientId").FirstOrDefault();
                patientDem.patientId = (string)xPatientId.Element(cnrNs + "IdValue");
                patientDem.patientIdScheme = (string)xPatientId.Element(cnrNs + "IdScheme");
                patientDem.patientIdType = (string)xPatientId.Element(cnrNs + "IdType");

                XElement xPatientName = doc.Descendants(cnrNs + "PatientName").FirstOrDefault();
                patientDem.title = (string)xPatientName.Descendants(cnrNs + "Title").FirstOrDefault();
                patientDem.givenName = (string)xPatientName.Descendants(cnrNs + "GivenName").FirstOrDefault();
                patientDem.familyName = (string)xPatientName.Descendants(cnrNs + "FamilyName").FirstOrDefault();
                patientDem.nameType = (string)xPatientName.Descendants(cnrNs + "NameType").FirstOrDefault();

                XElement xPatientAddress = doc.Descendants(cnrNs + "PatientAddress").FirstOrDefault();
                patientDem.addrressLine = xPatientAddress.Descendants(cnrNs + "AddressLine").Select(x => (string)x).ToList();
                patientDem.postCode = (string)xPatientAddress.Element(cnrNs + "PostCode");
                patientDem.addressType = (string)xPatientAddress.Element(cnrNs + "AddressType");

                patientDem.dateOfBirth = (DateTime)xPatientDem.Element(cnrNs + "DateOfBirth");
                patientDem.sex = (string)xPatientDem.Element(cnrNs + "Sex");

            }
        }
    }
    public class PatientDem
    {

       public string patientId { get;set;}
       public string patientIdScheme { get;set;}
       public string patientIdType { get;set;}

       public string title { get;set;}
       public string givenName { get;set;}
       public string familyName { get;set;}
       public string nameType { get; set; }

       public List<string> addrressLine { get;set;}
       public string postCode { get;set;}
       public string addressType { get;set;}

       public DateTime dateOfBirth { get;set;}
       public string sex { get;set;}
    }

}

A: I would prefer to deserialize the XML in one go as shown in below code.
1. Generate classes required to hold deserialized XML
first to generate XSD from xml -
D:\temp>xsd test.xml

then to generate c# classes from xsd -
D:\temp>xsd test.xsd /classes

2. Deserialize into C# objects
MySerializableClass myObject;

// Construct an instance of the XmlSerializer with the type
// of object that is being deserialized.
XmlSerializer mySerializer =  new XmlSerializer(typeof(MySerializableClass));

// To read the file, create a FileStream.
FileStream myFileStream =  new FileStream("myFileName.xml", FileMode.Open);

// Call the Deserialize method and cast to the object type.
myObject = (MySerializableClass)mySerializer.Deserialize(myFileStream)

3. Whatever you need, extract using your custom logic
Hope this helps.


text:
Q: Why python throws an "ImportError: No module named linkextractor" even if the Scrapy module already installed? I want to install portia. It requires scrapy and slybot.
I also installed virtualenv (as recommended) and executed virtualenv Portia to create a python virtual environment only for this project. Now it requires to start twisted server with twistd -n slyd, but then it throws an Error:
  File "/home/john/Downloads/portia-master/slybot/slybot/linkextractor/__init__.py", line 6, in <module>
    from .base import BaseLinkExtractor, ALLOWED_SCHEMES   File "/home/john/Downloads/portia-master/slybot/slybot/linkextractor/base.py", line 6, in <module>
    from scrapy.linkextractor import IGNORED_EXTENSIONS ImportError: No module named linkextractor

I have Ubuntu 12.04, installed: python 2.7, pip, python-scrapy, python-twisted
What could be here wrong? I didn't use pip and virtualenv before, does seem something wrong with the deployment workflow (e.g. ENVIRONMENT variables, other virtualenv/pip configurations) I described above?

A: In python3, just add s to the end of linkextractor.
Replace :
from scrapy.linkextractor import LinkExtractor

with :
from scrapy.linkextractors import LinkExtractor
                         ^

and enjoy it.
for more information read the Scrapy documentation from here.

A: It misses out the middle part; contrib, of which linkextractor is a submodule.
It is supposed to be:
scrapy.contrib.linkextractor
       ^^^^^^^

A: Well, I think that you should see this issue (https://github.com/scrapinghub/portia/issues/13) in github scrapinhub repo.
I solved some errors with imports installing the libraries in my system instead of in virtualenv.
In my case, the libraries were jsonschema (pip install jsonschema), and slybot (pip install -e slybot), and after I ran requirements.txt.
Best regards!

redpajama_set_name: RedPajamaStackExchange


text:
Q: I can't understand the two sentence from hackerone 《blog-How-To-Server-Side-Request-Forgery-SSRF》
A cool pivot to escalate the SSRF to a Remote Code Execution (RCE) is by pushing asynchronous jobs on a Redis queue that then get executed by an application using the gopher:// protocol. It's really convenient that a lot of Redis instances don't use any form of authentication. Exploiting this, however, warrants its own blog post given the debugging you have to do. Something for another blogpost!

Source
In the first sentence, 'A cool pivot to escalate ... (RCE)' is the subject follows by the predicate 'is'. What's the rest of the sentence. 'Pushing asynchronous jobs on a Redis queue that then get executed by an application using the gopher:// protocol is the pivot to escalate the SSRF to a Remote Code Execution', is this synonym for the origin? And I don't know what 'that then get executed' is used to describe(the Remote code or Redis queue), I guess that is Remote code.  I would appreciate it if anything help.

A: The clauses are:
A cool pivot
  to escalate the SSRF
    to a Remote Code Execution (RCE)
is
  by pushing asynchronous jobs
    on(to) a Redis queue
      that then get executed
        by an application
          using the gopher:// protocol.

It is the jobs that are executed.  The jobs are executed in the sequence in which they were placed in the queue.  First in, first out. You have to define an application that gets triggered when a job appears on the queue.  That application uses the "gopher://" protocol to execute the job.
Further details are technical and are more appropriately discussed on Stackoverflow.


text:
Q: bash command for with if statement I am trying to write a bash code which run over a folder where few .json files are allocated, and depending which ones is i want to run a specific Tippecanoe command with specific parameters.
for i in $$(find ./ -type f -name '*.json'); do
        if [$i.json == 'file1.json'] && [$i_part2.json == 'file1_part2.json']
            then
                tippecanoe --minimum-zoom=13 --maximum-zoom=16 --read-parallel -b13 -r13 -pc -l $i -o "$i.mbtiles" "$i" "$i_cetroid.json"
                echo $i done
        else
        if $(echo $i).json == 'file2.json' or $(echo $i)_cetroid.json == 'file2_part2.json'
        then tippecanoe --minimum-zoom=13 --maximum-zoom=16 --read-parallel -b13 -r13 -pc -l $i-o "$i.mbtiles" "$i" "$i_cetroid.json"
            echo $i done
        else
        if $(echo $i).json == 'file3.json' or $(echo $i)_cetroid.json == 'file3_part2.json'
        then tippecanoe --minimum-zoom=5 --maximum-zoom=16 --read-parallel -b5 -r5 -pc -l $i-o "$i.mbtiles" "$i" "$i_centroid.json"
            echo $i done
        else
break
        fi
done

I have gone through it but I am getting different errors if I split the code individually

A: You really shouldn't parse the output of find like this, but you might be looking for:
for i in $(find . -name '*.json'); do
    if [ "$i" = file1 ]; then
        tippecanoe --minimum-zoom=13 --maximum-zoom=16 --read-parallel -b13 -r13 -pc -l $i -o "$i.mbtiles" "$i" "$i_part2.json"
        echo ${i}done
    elif test "$i" = file3; then
        tippecanoe --minimum-zoom=5 --maximum-zoom=16 --read-parallel -b5 -r5 -pc -l $i -o "$i.mbtiles" "$i" "$i_centroid.json"
        echo ${i}done
    else
        break
    fi
done

(I've omitted the file2 portion, since your original code seems to rely on the string cetroid being equal to the string part2, which is logically impossible.).  Also note that I used test instead of [ on the second case.  There's absolutely no difference between test and [ (30 years ago, it was common to find that one was a shell builtin and the other was not, but that's rare now) other than the fact that [ requires that its final argument be ] and that it confuses many people.  Because of the unnecessary confusion, I tend to prefer test and recommend it.   Note that this could (and should!) be refactored to reduce redundancy:
for i in $(find . -name '*.json'); do
    if [ "$i" = file1 ]; then
        minzoom=13
        b=13
        suffix=part
    elif [ "$i" = file3 ]; then
        minzoom=5
        b=5
        suffix=centroid
    else
        break
    fi
    tippecanoe --minimum-zoom=$minzoom --maximum-zoom=16 --read-parallel -b$b -r$b -pc -l $i -o "$i.mbtiles" "$i" "${i}_${suffix}.json"
    echo ${i}done
done

Which could be further simplified with a case statement:
for i in $(find . -name '*.json'); do
    case "$i" in
    file1)
        minzoom=13
        b=13
        suffix=part
    ;;
    file3)
        minzoom=5
        b=5
        suffix=centroid
    ;;
    *) break;;
    esac
    tippecanoe --minimum-zoom=$minzoom --maximum-zoom=16 --read-parallel -b$b -r$b -pc -l $i -o "$i.mbtiles" "$i" "${i}_${suffix}.json"
    echo ${i}done
done


text:
Q: When I open new window with button click, also another mini window pops up I want to open new window with button click and close the old one. I tried to do that with this code, but when I click button it's also open another mini window with title 'tk'. How can I prevent that?
from tkinter import *
from PIL import Image, ImageTk

def openOperationsGui():
    window.destroy()
    operationsWindow = Toplevel()
    operationsWindow.title("Operations")
    operationsWindow.geometry("1366x768")

window = Tk()

logo = Image.open("resources\logo.png")
logoImg = ImageTk.PhotoImage(logo)

logoLbl = Label(image=logoImg)
logoLbl.place(x=450, y=120, height=500, width=500)

conn = Button(window, text="Connect", fg='blue', command=openOperationsGui)
conn.place(x=450, y=533, height=87, width=490)

passw = Entry(window, text="", bd=5)
passw.place(x=620, y=480, height=50, width=150)

window.title('Title')

window.geometry("1366x768")

window.mainloop()


text:
Q: Android - shadow effect below rectangle I would like to create a shadow effect as in picture

Tried multiple options saw in stack overflow. None of them worked.
Any help would be really appreciated.

A: The easiest way to approach this is by creating any type of view and give it a background designed as black fill with the gradient property, like explained here:
How to add a blurred drop shadow to a button?
And then place this view on top of the original image, overlapping it.


text:
Q: How to tell pip to keep the most updated version of a lib when installing? my requirements.txt:
google-api-python-client>=1.6.2
httplib2==0.9.2
...

In this case google-api-python-client installs the httplib2=0.14.0. But I would be overwritten to the older version on the next line.
Of course, in this case, I could act. But there are some cases that a lib depends on another, that depends on another, etc.
So I'm wondering whether there's a way to tell pip to always keep the most recent version of the libs.
like: pip install -r --keep-most-recent requirements.txt

A: This would mean that pip should install the latest version of the requirements and their dependencies no matter what the version constraints in requirements.txt are, is that right? Impossible as far as I know.
Not sure exactly what you are trying to achieve but maybe you would prefer working with one of these tools:

*

*poetry update

*pip-compile --upgrade

*pipenv update


text:
Q: Angularjs select display value if not in array I would like to create a select for add and remove value in my array. But the value must be unique.
This is my code but dosen't work correctly because I don't know how I can to hide or show the value in the select

Select something

    <select ng-model="selectedBucket"
     ng-options="row as row.display for row in bucketEnum | filter:bootstrapValues">
    </select>

    <button ng-click="add(selectedBucket.value)">
    add
    </button>

        {{initialSet}}

        {{bucketEnum}}

And controller and filters :
  var app = angular.module('myApp', []);
    app.controller('myController', function ($scope, $filter) {
         $scope.initialSet = [1, 2, 4, 7];
         $scope.bucketEnum = [
            { display: '0', value: 0, bool:true },
            { display: '1', value: 1, bool:true},
            { display: '2', value: 2, bool:true },
            { display: '3', value: 3, bool:true },
            { display: '4', value: 4, bool:true },
            { display: '5', value: 5, bool:true },
            { display: '6', value: 6, bool:true },
            { display: '7', value: 7, bool:true }
         ];
                $scope.add = function(value){
                $scope.initialSet.push(value);
             $scope.selectedBucket = $filter('bootstrapValues')($scope.initialSet, $scope.bucketEnum);
            }
        });

        app.filter('bootstrapValues', function(){
        return function(initial, baseBucket){
            var result = [];
            for(var i = 0; i < initial.length; i++){
                var flag = false;
                for(var j=1; j<baseBucket.length; j++){ //from 1 or 0.. you call
                    if(initial[i] === baseBucket[j].value){
                        flag = true;
                        baseBucket[j].bool = false;
                        break; // if there are repeated elements
                    }
                }
            }
            return result;
        };
 });

A: If you want to disable the added value in current select, then You can achieve this by disable when syntax of angular 1.4+ version
See this fiddle of your code.(for disable)
and, If you want to delete the added value in current select then See this fiddle (for delete)


text:
Q: Как добавить индекс и значения всей строки None к имеющемуся фрейму данных? Есть фрейму данных df, нужно добавить последней строкой значения None  с индексом "моя строка".
for ind in df2.index:
    if ind not in df1.index:
        df1.at[ind] = None
        # df1.loc[(ind),[None]]

Пример данных

df1
Column1
Column2

index
1
4

First
2
5

Second
3
6

df2
Column1
Column2

index
1
5

First
2
6

Second
3
7

Моя строка
4
8

df1 (после преобразования)
Column1
Column2

index
1
4

First
2
5

Second
3
6

Моя строка
None
None

A: Пример:
In [5]: df = pd.DataFrame([[1,4], [2,5], [3,6]], columns=["Column1", "Column2"], index=["index", "First", "Second"])

In [6]: df
Out[6]:
        Column1  Column2
index         1        4
First         2        5
Second        3        6

In [7]: df.loc["Моя строка"] = [np.nan] * df.shape[1]

In [8]: df
Out[8]:
            Column1  Column2
index           1.0      4.0
First           2.0      5.0
Second          3.0      6.0
Моя строка      NaN      NaN

A: При ваших исходных:
df = df.reindex([*df.index, "Моя строка"])

df:
              1    4
First       2.0  5.0
Second      3.0  6.0
Моя строка  NaN  NaN


text:
Q: windows openssh server authentification fails with correct password I have 2 computers, one is windows 10, the other is macos 10.15.7. I try to login my windows 10 from my mac with ssh laptop-qjn9a0b1\quebec@198.168.3.84. Again and again, it said Permission denied, please try again.. Then I try ssh laptop-qjn9a0b1\quebec@localhost on my windows, it fails again. I'm quite sure that the password is correct, it's the login password of account quebec, which is the administor. laptop-qjn9a0b1\quebec@198.168.3.84 is windows' output of whoami.
There is no problem with windows' openssh client. I can login my mac from windows.
I close windows' firewall.
This is the debug message of sshd.exe -ddd:
debug2: load_server_config: filename __PROGRAMDATA__\\ssh/sshd_config
debug2: load_server_config: done config len = 272
debug2: parse_server_config: config __PROGRAMDATA__\\ssh/sshd_config len 272
debug3: __PROGRAMDATA__\\ssh/sshd_config:30 setting PermitRootLogin yes
debug3: __PROGRAMDATA__\\ssh/sshd_config:31 setting StrictModes no
debug3: __PROGRAMDATA__\\ssh/sshd_config:52 setting PasswordAuthentication yes
debug3: __PROGRAMDATA__\\ssh/sshd_config:77 setting Subsystem sftp      sftp-server.exe
debug3: checking syntax for 'Match Group administrators'
debug1: sshd version OpenSSH_for_Windows_8.1, LibreSSL 3.0.2
debug1: private host key #0: ssh-rsa SHA256:khudF/t3vmcq7aPwsOUqCe6NSkwpngfqXpy/IOxE4vw
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:IIhCEjqhUPaZIgneTaTnwU6pWHftw1Ri/6HzK3Ihj9M
debug1: private host key #2: ssh-ed25519 SHA256:vX2iHtUoj7LB7Z9pXlGIvxEHRcw/ACEJHK0FXc5Yg9g
debug1: rexec_argv[0]='C:\\Windows\\System32\\OpenSSH\\sshd.exe'
debug1: rexec_argv[1]='-ddd'
debug2: fd 3 setting O_NONBLOCK
debug3: sock_set_v6only: set socket 3 IPV6_V6ONLY
debug1: Bind to port 22 on ::.
Server listening on :: port 22.
debug2: fd 4 setting O_NONBLOCK
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
debug3: fd 5 is not O_NONBLOCK
debug1: Server will not fork when running in debugging mode.
debug3: send_rexec_state: entering fd = 8 config len 272
debug3: ssh_msg_send: type 0
debug3: send_rexec_state: done
Connection from ::1 port 1677 on ::1 port 22
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_for_Windows_8.1
debug1: match: OpenSSH_for_Windows_8.1 pat OpenSSH* compat 0x04000000
debug2: fd 5 setting O_NONBLOCK
debug3: spawning "C:\\Windows\\System32\\OpenSSH\\sshd.exe" -ddd -y
debug2: Network child is on pid 11424
debug3: send_rexec_state: entering fd = 4 config len 272
debug3: ssh_msg_send: type 0
debug3: send_rexec_state: done
debug3: ssh_msg_send: type 0
debug3: ssh_msg_send: type 0
debug3: preauth child monitor started
debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug3: send packet: type 20 [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
debug3: receive packet: type 20 [preauth]
debug1: SSH2_MSG_KEXINIT received [preauth]
debug2: local server KEXINIT proposal [preauth]
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1 [preauth]
debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
debug2: compression ctos: none,zlib@openssh.com [preauth]
debug2: compression stoc: none,zlib@openssh.com [preauth]
debug2: languages ctos:  [preauth]
debug2: languages stoc:  [preauth]
debug2: first_kex_follows 0  [preauth]
debug2: reserved 0  [preauth]
debug2: peer client KEXINIT proposal [preauth]
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c [preauth]
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa [preauth]
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
debug2: compression ctos: none,zlib@openssh.com,zlib [preauth]
debug2: compression stoc: none,zlib@openssh.com,zlib [preauth]
debug2: languages ctos:  [preauth]
debug2: languages stoc:  [preauth]
debug2: first_kex_follows 0  [preauth]
debug2: reserved 0  [preauth]
debug1: kex: algorithm: curve25519-sha256 [preauth]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256 [preauth]
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none [preauth]
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none [preauth]
debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
debug3: receive packet: type 30 [preauth]
debug3: mm_sshkey_sign entering [preauth]
debug3: mm_request_send entering: type 6 [preauth]
debug3: mm_sshkey_sign: waiting for MONITOR_ANS_SIGN [preauth]
debug3: mm_request_receive_expect entering: type 7 [preauth]
debug3: mm_request_receive entering [preauth]
debug3: mm_request_receive entering
debug3: monitor_read: checking request 6
debug3: mm_answer_sign
debug3: mm_answer_sign: KEX signature 00000209CD357210(101)
debug3: mm_request_send entering: type 7
debug2: monitor_read: 6 used once, disabling now
debug3: send packet: type 31 [preauth]
debug3: send packet: type 21 [preauth]
debug2: set_newkeys: mode 1 [preauth]
debug1: rekey out after 134217728 blocks [preauth]
debug1: SSH2_MSG_NEWKEYS sent [preauth]
debug1: Sending SSH2_MSG_EXT_INFO [preauth]
debug3: send packet: type 7 [preauth]
debug1: expecting SSH2_MSG_NEWKEYS [preauth]
debug3: receive packet: type 21 [preauth]
debug1: SSH2_MSG_NEWKEYS received [preauth]
debug2: set_newkeys: mode 0 [preauth]
debug1: rekey in after 134217728 blocks [preauth]
debug1: KEX done [preauth]
debug3: receive packet: type 5 [preauth]
debug3: send packet: type 6 [preauth]
debug3: receive packet: type 50 [preauth]
debug1: userauth-request for user laptop-qjn9a0b1\\\\quebec service ssh-connection method none [preauth]
debug1: attempt 0 failures 0 [preauth]
debug3: mm_getpwnamallow entering [preauth]
debug3: mm_request_send entering: type 8 [preauth]
debug3: mm_getpwnamallow: waiting for MONITOR_ANS_PWNAM [preauth]
debug3: mm_request_receive_expect entering: type 9 [preauth]
debug3: mm_request_receive entering [preauth]
debug3: mm_request_receive entering
debug3: monitor_read: checking request 8
debug3: mm_answer_pwnamallow
debug2: parse_server_config: config reprocess config len 272
debug3: checking match for 'Group administrators' user quebec host ::1 addr ::1 laddr ::1 lport 22
debug3: get_user_token - i am running as quebec, returning process token
debug1: user quebec matched group list administrators at line 85
debug3: match found
debug3: reprocess config:86 setting AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
debug3: mm_answer_pwnamallow: sending MONITOR_ANS_PWNAM: 1
debug3: mm_request_send entering: type 9
debug2: monitor_read: 8 used once, disabling now
debug2: input_userauth_request: setting up authctxt for laptop-qjn9a0b1\\\\quebec [preauth]
debug3: mm_inform_authserv entering [preauth]
debug3: mm_request_send entering: type 4 [preauth]
debug2: input_userauth_request: try method none [preauth]
debug3: user_specific_delay: user specific delay 0.000ms [preauth]
debug3: ensure_minimum_time_since: elapsed 15.623ms, delaying 11.248ms (requested 6.718ms) [preauth]
debug3: mm_request_receive entering
debug3: monitor_read: checking request 4
debug3: mm_answer_authserv: service=ssh-connection, style=
debug2: monitor_read: 4 used once, disabling now
debug3: userauth_finish: failure partial=0 next methods="publickey,password,keyboard-interactive" [preauth]
debug3: send packet: type 51 [preauth]
debug3: receive packet: type 50 [preauth]
debug1: userauth-request for user laptop-qjn9a0b1\\\\quebec service ssh-connection method publickey [preauth]
debug1: attempt 1 failures 0 [preauth]
debug2: input_userauth_request: try method publickey [preauth]
debug2: userauth_pubkey: valid user laptop-qjn9a0b1\\\\quebec querying public key rsa-sha2-512 AAAAB3NzaC1yc2EAAAADAQABAAABgQC7F2FofCnaDR5xUCMSYZAJg7W/Pz+2LHupjnThm3Z+ffFFJOrEgZK5EonZNpEJx5LRfhQ6VhFnAA8dcnJEZQ4tQU4HE5ka7cTvU1DC98/T0Ztep2VjT9Fg9igs9d0BpKbB4aqZQwcBectnDHBNMlgwbB0o3TByCjS+UImNj6c66Z0xDlw7J1GxBGmrBrxCv446C2uu1S79cwITW3ZTcIuK5SgvIRQ/4mpB87FXBOXi446Yt9H77q/cZ7NSwwJ7BCdAl7yxGodSDf5BFYOp4Bd8ODIBhxZ10RXy2tmxQt5zPXk/su1J3eCX4GTDjOs7VErGLQ87H/YTJgHzTxMqKpzLqEVN1zoM9OkL9q2LuiX5DLzfzkjWPl9Olyb4EO5mn9ZihPtmPyvkZvP8kuvAZbqufpHQnBH/2m5gtBOHA+ks2NFoDI8vc1FaS8vm2T4xbf8hiBA2Rwz/jP/kDPupj7nuwzELagUQbDJJeBBsWTkgzD7aU3kX9xet0PI6bYGOeT0= [preauth]
debug1: userauth_pubkey: test pkalg rsa-sha2-512 pkblob RSA SHA256:RfKJV/XfmfN98xcjUf7ojEg/h9eMx3Hx1vlySzwnyrE [preauth]
debug3: mm_key_allowed entering [preauth]
debug3: mm_request_send entering: type 22 [preauth]
debug3: mm_key_allowed: waiting for MONITOR_ANS_KEYALLOWED [preauth]
debug3: mm_request_receive_expect entering: type 23 [preauth]
debug3: mm_request_receive entering [preauth]
debug3: mm_request_receive entering
debug3: monitor_read: checking request 22
debug3: mm_answer_keyallowed entering
debug3: mm_answer_keyallowed: key_from_blob: 00000209CD361060
debug1: trying public key file __PROGRAMDATA__/ssh/administrators_authorized_keys
debug3: Failed to open file:C:/ProgramData/ssh/administrators_authorized_keys error:2
debug1: Could not open authorized keys '__PROGRAMDATA__/ssh/administrators_authorized_keys': No such file or directory
debug3: mm_answer_keyallowed: publickey authentication test: RSA key is not allowed
Failed publickey for laptop-qjn9a0b1\\quebec from ::1 port 1677 ssh2: RSA SHA256:RfKJV/XfmfN98xcjUf7ojEg/h9eMx3Hx1vlySzwnyrE
debug3: mm_request_send entering: type 23
debug2: userauth_pubkey: authenticated 0 pkalg rsa-sha2-512 [preauth]
debug3: user_specific_delay: user specific delay 0.000ms [preauth]
debug3: ensure_minimum_time_since: elapsed 0.000ms, delaying 6.718ms (requested 6.718ms) [preauth]
debug3: userauth_finish: failure partial=0 next methods="publickey,password,keyboard-interactive" [preauth]
debug3: send packet: type 51 [preauth]
debug3: receive packet: type 50 [preauth]
debug1: userauth-request for user laptop-qjn9a0b1\\\\quebec service ssh-connection method keyboard-interactive [preauth]
debug1: attempt 2 failures 1 [preauth]
debug2: input_userauth_request: try method keyboard-interactive [preauth]
debug1: keyboard-interactive devs  [preauth]
debug1: auth2_challenge: user=laptop-qjn9a0b1\\\\quebec devs= [preauth]
debug1: kbdint_alloc: devices '' [preauth]
debug2: auth2_challenge_start: devices  [preauth]
debug3: user_specific_delay: user specific delay 0.000ms [preauth]
debug3: ensure_minimum_time_since: elapsed 0.000ms, delaying 6.718ms (requested 6.718ms) [preauth]
debug3: userauth_finish: failure partial=0 next methods="publickey,password,keyboard-interactive" [preauth]
debug3: send packet: type 51 [preauth]
debug3: receive packet: type 50 [preauth]
debug1: userauth-request for user laptop-qjn9a0b1\\\\quebec service ssh-connection method password [preauth]
debug1: attempt 3 failures 2 [preauth]
debug2: input_userauth_request: try method password [preauth]
debug3: mm_auth_password entering [preauth]
debug3: mm_request_send entering: type 12 [preauth]
debug3: mm_auth_password: waiting for MONITOR_ANS_AUTHPASSWORD [preauth]
debug3: mm_request_receive_expect entering: type 13 [preauth]
debug3: mm_request_receive entering [preauth]
debug3: mm_request_receive entering
debug3: monitor_read: checking request 12
debug1: Windows authentication failed for user: quebec domain: . error: 1326
debug3: mm_answer_authpassword: sending result 0
debug3: mm_request_send entering: type 13
Failed password for laptop-qjn9a0b1\\quebec from ::1 port 1677 ssh2
debug3: mm_auth_password: user not authenticated [preauth]
debug3: user_specific_delay: user specific delay 0.000ms [preauth]
debug3: ensure_minimum_time_since: elapsed 93.757ms, delaying 13.727ms (requested 6.718ms) [preauth]
debug3: userauth_finish: failure partial=0 next methods="publickey,password,keyboard-interactive" [preauth]
debug3: send packet: type 51 [preauth]

This is debug message of ssh -vvv laptop-qjn9a0b1\quebec@localhost.
PS C:\Users\1> ssh laptop-qjn9a0b1\quebec@localhost
laptop-qjn9a0b1\quebec@localhost's password:
Permission denied, please try again.
laptop-qjn9a0b1\quebec@localhost's password:
Permission denied, please try again.
laptop-qjn9a0b1\quebec@localhost's password:
laptop-qjn9a0b1\\quebec@localhost: Permission denied (publickey,password,keyboard-interactive).
PS C:\Users\1> ssh laptop-qjn9a0b1\quebec@localhost
laptop-qjn9a0b1\quebec@localhost's password:
Permission denied, please try again.
laptop-qjn9a0b1\quebec@localhost's password:
PS C:\Users\1> ssh laptop-qjn9a0b1\quebec@localhost
laptop-qjn9a0b1\quebec@localhost's password:
Permission denied, please try again.
laptop-qjn9a0b1\quebec@localhost's password:
Permission denied, please try again.
laptop-qjn9a0b1\quebec@localhost's password:
PS C:\Users\1> ssh laptop-qjn9a0b1\quebec@localhost
laptop-qjn9a0b1\quebec@localhost's password:
Permission denied, please try again.
laptop-qjn9a0b1\quebec@localhost's password:
PS C:\Users\1> ssh -vvv laptop-qjn9a0b1\quebec@localhost
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug3: Failed to open file:C:/Users/1/.ssh/config error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2
debug2: resolving "localhost" port 22
debug2: ssh_connect_direct
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\1/.ssh/id_rsa type 0
debug3: Failed to open file:C:/Users/1/.ssh/id_rsa-cert error:2
debug3: Failed to open file:C:/Users/1/.ssh/id_rsa-cert.pub error:2
debug1: identity file C:\\Users\\1/.ssh/id_rsa-cert type -1
debug3: Failed to open file:C:/Users/1/.ssh/id_dsa error:2
debug3: Failed to open file:C:/Users/1/.ssh/id_dsa.pub error:2
debug1: identity file C:\\Users\\1/.ssh/id_dsa type -1
debug3: Failed to open file:C:/Users/1/.ssh/id_dsa-cert error:2
debug3: Failed to open file:C:/Users/1/.ssh/id_dsa-cert.pub error:2
debug1: identity file C:\\Users\\1/.ssh/id_dsa-cert type -1
debug3: Failed to open file:C:/Users/1/.ssh/id_ecdsa error:2
debug3: Failed to open file:C:/Users/1/.ssh/id_ecdsa.pub error:2
debug1: identity file C:\\Users\\1/.ssh/id_ecdsa type -1
debug3: Failed to open file:C:/Users/1/.ssh/id_ecdsa-cert error:2
debug3: Failed to open file:C:/Users/1/.ssh/id_ecdsa-cert.pub error:2
debug1: identity file C:\\Users\\1/.ssh/id_ecdsa-cert type -1
debug3: Failed to open file:C:/Users/1/.ssh/id_ed25519 error:2
debug3: Failed to open file:C:/Users/1/.ssh/id_ed25519.pub error:2
debug1: identity file C:\\Users\\1/.ssh/id_ed25519 type -1
debug3: Failed to open file:C:/Users/1/.ssh/id_ed25519-cert error:2
debug3: Failed to open file:C:/Users/1/.ssh/id_ed25519-cert.pub error:2
debug1: identity file C:\\Users\\1/.ssh/id_ed25519-cert type -1
debug3: Failed to open file:C:/Users/1/.ssh/id_xmss error:2
debug3: Failed to open file:C:/Users/1/.ssh/id_xmss.pub error:2
debug1: identity file C:\\Users\\1/.ssh/id_xmss type -1
debug3: Failed to open file:C:/Users/1/.ssh/id_xmss-cert error:2
debug3: Failed to open file:C:/Users/1/.ssh/id_xmss-cert.pub error:2
debug1: identity file C:\\Users\\1/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_for_Windows_8.1
debug1: match: OpenSSH_for_Windows_8.1 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to localhost:22 as 'laptop-qjn9a0b1\\quebec'
debug3: hostkeys_foreach: reading file "C:\\Users\\1/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file C:\\Users\\1/.ssh/known_hosts:3
debug3: load_hostkeys: loaded 1 keys from localhost
debug3: Failed to open file:C:/Users/1/.ssh/known_hosts2 error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts2 error:2
debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:IIhCEjqhUPaZIgneTaTnwU6pWHftw1Ri/6HzK3Ihj9M
debug3: hostkeys_foreach: reading file "C:\\Users\\1/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file C:\\Users\\1/.ssh/known_hosts:3
debug3: load_hostkeys: loaded 1 keys from localhost
debug3: Failed to open file:C:/Users/1/.ssh/known_hosts2 error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts2 error:2
debug1: Host 'localhost' is known and matches the ECDSA host key.
debug1: Found key in C:\\Users\\1/.ssh/known_hosts:3
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey in after 134217728 blocks
debug3: unable to connect to pipe \\\\.\\pipe\\openssh-ssh-agent, error: 2
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: Will attempt key: C:\\Users\\1/.ssh/id_rsa RSA SHA256:RfKJV/XfmfN98xcjUf7ojEg/h9eMx3Hx1vlySzwnyrE
debug1: Will attempt key: C:\\Users\\1/.ssh/id_dsa
debug1: Will attempt key: C:\\Users\\1/.ssh/id_ecdsa
debug1: Will attempt key: C:\\Users\\1/.ssh/id_ed25519
debug1: Will attempt key: C:\\Users\\1/.ssh/id_xmss
debug2: pubkey_prepare: done
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug3: start over, passed a different list publickey,password,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: C:\\Users\\1/.ssh/id_rsa RSA SHA256:RfKJV/XfmfN98xcjUf7ojEg/h9eMx3Hx1vlySzwnyrE
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: C:\\Users\\1/.ssh/id_dsa
debug3: no such identity: C:\\Users\\1/.ssh/id_dsa: No such file or directory
debug1: Trying private key: C:\\Users\\1/.ssh/id_ecdsa
debug3: no such identity: C:\\Users\\1/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: C:\\Users\\1/.ssh/id_ed25519
debug3: no such identity: C:\\Users\\1/.ssh/id_ed25519: No such file or directory
debug1: Trying private key: C:\\Users\\1/.ssh/id_xmss
debug3: no such identity: C:\\Users\\1/.ssh/id_xmss: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug3: send packet: type 50
debug2: we sent a keyboard-interactive packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug3: userauth_kbdint: disable: no info_req_seen
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred:
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
debug3: failed to open file:C:/dev/tty error:3
debug1: read_passphrase: can't open /dev/tty: No such file or directory
laptop-qjn9a0b1\quebec@localhost's password:
debug3: send packet: type 50
debug2: we sent a password packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
debug3: failed to open file:C:/dev/tty error:3
debug1: read_passphrase: can't open /dev/tty: No such file or directory

This is $env:programdata/ssh/sshd_config:
# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey __PROGRAMDATA__/ssh/ssh_host_rsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_dsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_ecdsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
PermitRootLogin yes
StrictModes no
#MaxAuthTries 6
#MaxSessions 10

#PubkeyAuthentication yes

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
#AuthorizedKeysFile .ssh/authorized_keys

#AuthorizedPrincipalsFile none

# For this to work you will also need host keys in %programData%/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
#PermitEmptyPasswords yes

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

# override default of no subsystems
Subsystem   sftp    sftp-server.exe

# Example of overriding settings on a per-user basis
#Match User anoncvs
#   AllowTcpForwarding no
#   PermitTTY no
#   ForceCommand cvs server

Match Group administrators
AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys

So what might be the cause?

A: Finally figure it out by chance. According to this link

If you log into your computer using a Windows PIN: Using your PIN in the password field will not work. Instead please make sure your Windows account has a password assigned to it. You can do this on your Windows computer by opening up the  Settings app -> Accounts -> Sign In Options and create a Password for your account.

I set my microsoft account password and reboot(it's necessary), then everything works just fine.


text:
Q: Select months between two dates I am trying to create a form which will take attendance data from a database and transfer to a excel sheet to print out.
I have created the form and with two datetimepickers I have managed to get the month to begin the travel claim and the month I want to claim too.
I am struggling with separating  this into individual months so that I can use the individual months to intigrate the database.
so far I have
    if (TodateTimePicker.Value.Date <= FromdateTimePicker.Value.Date)
    {
        MessageBox.Show("End Date must be after Start Date");
    }
    else
    {
        fromDate = FromdateTimePicker.Value.Date;
        toDate = TodateTimePicker.Value.Date;

        fromDate = (fromDate.AddDays(1 - fromDate.Day));

        toDate = (toDate.AddDays(1 - toDate.Day)).AddMonths(1).AddDays(-1)
    }

I also have the database command I want to use
            com = new OleDbCommand("SELECT count(*), FROM Attendances WHERE year([Attendance_Date]) = ? GROUP BY [Person] ORDER BY count(*) DESC", Program.DB_CONNECTION);
            com.Parameters.Add(new OleDbParameter("", month));
            com.Parameters.Add(new OleDbParameter("", p.ID));

My real question is how to get the 1st of each month and the last date of each month between the two dates selected?

A: Here are the 2 easiest ways I've found :
private int IntervalInMonthsBetweenDates(DateTime date1, DateTime date2)
{
    return date2.Subtract(date1).Days / 30;
}

private int IntervalInMonthsBetweenDates(DateTime date1, DateTime date2)
{
    return ((date1.Year - date2.Year) * 12) + date1.Month - date2.Month;
}

A: If you want a sequece of DateTimes between the year and month of two given DateTimes where each beginning and end of the month is represented then you could do the following.
public static IEnumerable<DateTime> BeginEndOfEachMonthBetween(DateTime from, DateTime to)
{
    DateTime start = from.AddDays(1 - from.Day);
    while(start <= to)
    {
        yield return start;
        yield return start.AddMonths(1).AddDays(-1);
        start.AddMonths(1);
    }
}

But it would help to see how you plan to use this.
It sounds like you might want a query similar to this
SELECT
    DatePart(year,Attendance_Date) As Year,
    DatePart(month,Attendance_Date) As Month,
    Count(*) As Attendance
FROM Attendances
WHERE Attendance_Date Between @BeginDate And @EndDate
GROUP BY
    DatePart(year,Attendance_Date),
    DatePart(month,Attendance_Date)

A: I came up with a solution where I calculated the number of months between the two dates, then ran through a loop to add the number of months to the start date to give me the first and last day of each month between the two original dates, probably not the neatest way but it works exactly as I planned.
int months = ((toDate.Year - fromDate.Year) * 12 + toDate.Month - fromDate.Month) + 1; // find the munber of months between the two dates and add one
        DateTime dateofclaim = new DateTime(); // define dateofclame to a new date

        for (int i = 0; i < months; i++) // for each month run the code below, this will first run the fromDate then add a month until it gets to the toDate
        {
            dateofclaim = fromDate.AddMonths(i); // add one month to the start date

            claimfromDate = (dateofclaim.AddDays(1 - dateofclaim.Day)); // calculate the first date of the month

            claimtoDate = (dateofclaim.AddDays(1 - dateofclaim.Day)).AddMonths(1).AddDays(-1); // calculate the last day of the month

            OleDbCommand com = new OleDbCommand("SELECT sum([sum]) FROM Attendance WHERE ([Attendance_Date]) >= ? AND ([Attendance_Date]) <= ? AND [Person] = ?", Program.DB_CONNECTION); // count the total attendances in the month
            com.Parameters.Add(new OleDbParameter("", claimfromDate));
            com.Parameters.Add(new OleDbParameter("", claimtoDate));
            com.Parameters.Add(new OleDbParameter("", person.ID));

            OleDbDataReader dr = com.ExecuteReader(); // start reader

            if (dr.Read()) // if a result is returned
            {
                try
                {
                    int attendance = Convert.ToInt32(dr.GetDouble(0)); // this is how many attendances have been counted for the selected month

                    ws.get_Range("B" + row.ToString()).Value2 = dateofclaim.ToString("MMM yyyy"); // print the Month of the clame into Colum B and row 83 then adding one for each following month
                    ws.get_Range("I" + row.ToString()).Value2 = attendance.ToString(); // print the number of attendances into Colum B and the respective row
                    row++; // add one to the row so next time this runs the data will be on the next row
                }
                catch // if nothing as returned from the database then add the month and 0 in the attendance colum
                {
                    ws.get_Range("B" + row.ToString()).Value2 = dateofclaim.ToString("MMM yyyy");
                    ws.get_Range("I" + row.ToString()).Value2 = "0";
                    row++;
                }
            }
            dr.Close(); // close the database reader
        }

A: for (DateTime i = fromDate; i.Date <= toDate.Date; i = i.AddMonths(1))
        {
            Console.WriteLine(i.Month);
        }


text:
Q: FloatingActionButton not showing on scroll with Build tools 25 After updating to Build tools 25 the floating action button stop showing on scroll. It was perfectly working with tools 24
This is my Behavior calss:
public class ScrollAwareFABBehavior extends FloatingActionButton.Behavior {
private boolean mEnable = true;

public ScrollAwareFABBehavior(Context context, AttributeSet attrs) {
    super();
}

@Override
public boolean onStartNestedScroll(final CoordinatorLayout coordinatorLayout, final FloatingActionButton child, final View directTargetChild, final View target, final int nestedScrollAxes) {
    // Ensure we react to vertical scrolling
    return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL || super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, nestedScrollAxes);
}

@Override
public void onNestedScroll(final CoordinatorLayout coordinatorLayout, final FloatingActionButton child,
                           final View target, final int dxConsumed, final int dyConsumed,
                           final int dxUnconsumed, final int dyUnconsumed) {
    super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed);

    if (dyConsumed > 0 && child.getVisibility() == View.VISIBLE) {
        // FootballUser scrolled down and the FAB is currently visible -> hide the FAB
        child.hide();
    } else if (dyConsumed < 0 && child.getVisibility() != View.VISIBLE) {
        // FootballUser scrolled up and the FAB is currently not visible -> show the FAB
        if (mEnable)
            child.show();
    }
}

public void setEnabled(boolean enable) {
    mEnable = enable;
}

}
And this is the layout:
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".activity.MainActivity">

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:layout_scrollFlags="scroll|enterAlways|snap"
        app:popupTheme="@style/AppTheme.PopupOverlay"/>

    <android.support.design.widget.TabLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:tabGravity="fill"
        app:tabIndicatorColor="@android:color/white"
        app:tabMode="fixed"/>
</android.support.design.widget.AppBarLayout>

<android.support.v4.view.ViewPager
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

<android.support.design.widget.FloatingActionButton
    android:id="@+id/floating_button_add"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end"
    android:layout_margin="@dimen/fab_margin"
    android:src="@drawable/ic_add_white_24dp"
    app:layout_anchor="@id/container"
    app:layout_anchorGravity="bottom|right|end"
    app:layout_behavior="com.footballscout.app.helpers.ScrollAwareFABBehavior"/>

Nothing special.


text:
Q: how to get position absolute div height in css Parent div has two child div. First child div is position absolute div which contains img element.
first-child div is background with food image and second div is food description.
When screen size changes, position absolute first-child div and second div should be same height.

.parent {
  display: flex;
  justify-content: flex-end;
  position: relative;
}

.first-child {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: -1;
}

.second-child {
  position: relative;
  width: 250px;
  /* want to set height with the same height of .first-child div */
}

    // food description here.

I want to set second child div's height as same height of first position absolute child div.
How to achieve this?

A: This probably isn't 100% what you're looking for, but it's the closest I could come up with using my own experience of using images as backgrounds for text.
I used floats rather than flexbox, setting a background image instead of img element and the height of the parent container to 100vh (in this case)
I then set the height of both children to 100%
HTML

// food
description here.

CSS
.parent {
  position: relative;
  height: 100vh;
  background-image: url(/food.png);
  background-size: cover;
  background-repeat: no-repeat;
}

.first-child {
  width: 60%;
  height: 100%;
  float: left;
}

.second-child {
  width: 40%;
  height: 100%;
  float: left;
  /* want to set height with the same
height of .first-child div */
}

Hope that helps, if it absolutely must be flexbox you'll need a different solution.


text:
Q: Factorization of Characteristic Function Let $X$ be an open subset of $\mathbb{R}^n$ and for any subset $A\subseteq \mathbb{R}^n$, let $\chi_A$ be the characteristic function of $X$, i.e.:
$$
\chi_X(x):= \begin{cases}
1 & : x \in A\\
0 & : x \not\in A.
\end{cases}
$$
Can $\chi_X$ be written as $\chi_{(\frac1{2},\infty)}\circ f$ where $f:\mathbb{R}^n\to (0,1)$ continuously?

A: This puts the following conditions on $f$: if $x \in X$, then $\chi_X(x)=\chi_{(\frac1{2},\infty)}(f(x))=1$ which means that $f(x) > \frac12$, while $x \notin X$ implies $\chi_X(x)=\chi_{(\frac1{2},\infty)}(f(0))=0$, so $f(x) \le \frac12$. So $X=f^{-1}[(\frac12, \infty)]$ and so $X$ is open when $f$ is continuous. If $X$ is also closed, connectedness of $\Bbb R^n$ implies that this can only happen for $X=\emptyset$ or $X=\Bbb R^n$.


text:
Q: New formulae for the Riemann Zeta Series Back in late April I arrived at the following formula for when $x+b < -1$:
$$\tag{1}\boxed{
 \sum_{a=1}^{\infty}\sum_{k=0}^{\infty}\frac{(k+a)^{x+b}}{a} = \sum_{k=0}^{\infty}\sum_{g=0}^{k}\frac{b^{g}}{(g!)^{2}}\binom{k}{g}\sum_{a=1}^{\infty}\frac{(k+a-g)^{x}}{a}\ln^{g}(k+a-g).
}$$
I presented my work to a professor and he did not deny its validity.
Now, plug in $0$ for $b$ and notice that the formula is true, though assuming $0^{0}=1$. What is weird is that I then applied the Abel partial summation formula to obtain a new result. I do not see if there is a mistake in my argumentation but the result is either false or extremely counterintuitive. The professor said that the next boxed equation is numerically false.
$$ \sum_{g=0}^{k}\frac{b^{g}}{(g!)^{2}}\binom{k}{g}\sum_{a=1}^{\infty}\frac{(k+a-g)^{x}}{a}\ln^{g}(k+a-g)$$ $$ = \sum_{g=0}^{k}\frac{b^{g}}{(g!)^{2}}\binom{k}{g}\sum_{a=1}^{\infty}\frac{(k+a-g)^{x}}{a}\ln^{-(k-g)}(k+a-g)\ln^{k}(k+a-g), $$
so by Abel's partial summation formula
$$ \sum_{g=0}^{k}\frac{b^{g}}{(g!)^{2}}\binom{k}{g}\sum_{a=1}^{\infty}\frac{(k+a-g)^{x}}{1}\ln^{-(k-g)}(k+a-g)\ln^{k}(k+a-g) $$ $$ = \frac{b^{k}}{k!}\ln^{k}(a)\sum_{g=0}^{k}\frac{1}{g!}\binom{k}{g}(k+a-g)^{x}\ln^{-(k-g)}(k+a-g) $$ $$ -\sum_{n=0}^{k-1}(\frac{b^{n+1}}{(n+1)!}\ln^{n+1}(a+1) - \frac{b^{n}}{n!}\ln^{n}(a))\sum_{g=0}^{n}\frac{1}{g!}\binom{k}{g}(k+a-g)^{x}\ln^{-(k-g)}(k+a-g). $$
I now substitute that result into the equation at the top, set $b=0$ and obtain
$$\tag{2}\boxed{
 (\sum_{a=1}^{\infty}\sum_{k=0}^{\infty}\frac{(k+a)^{x+b}}{a}) - \zeta(-x-b+1) = \sum_{a=1}^{\infty}\sum_{k=1}^{\infty}\frac{(k+a)^{x+b}}{a\ln^{k}(k+a)}. }$$
For $x+b=-2$ the left-hand side of the equation yields $\zeta(3)$. However, the right-hand side of the equation is, if at all, getting there so slowly that a C++ program I wrote never arrives close to that value for quite large upper limits of those sums.
Is it possible for the last equation to be valid? Notice that as $x$ goes to infinity, the equation goes to $0=0$. Moreover, both sides are always positive.

A: Not an answer, but I've done a bit of work on the last proposed formula.

The last formula you wrote is essentially
$$-\zeta(1-s)+\sum_{m=1}^\infty\sum_{n=0}^\infty\frac{(m+n)^s}{m}=\sum_{m=1}^\infty\sum_{n=1}^\infty \frac{(m+n)^s}{m\log(m+n)^n}$$
Rewrite the LHS slightly as
$$-\zeta(1-s)+\sum_{m=1}^\infty \frac{m^s}{m}+\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{(m+n)^s}{m}=\sum_{m=1}^\infty\sum_{n=1}^\infty \frac{(m+n)^s}{m\log(m+n)^n}$$
Recognize the new sum as $\zeta(1-s)$ and combine the remaining bits:
$$\sum_{m=1}^\infty\sum_{n=1}^\infty \frac{(m+n)^s}{m}\left(1-\frac{1}{\log(m+n)^n}\right)=0$$
When $s\in \Bbb{R}$ all of the terms are real. Further, all of the terms are positive, except for $m=n=1$. So now, it remains to show that
$$2^s\left(\frac{1}{\log(2)}-1\right)=\sum_{n=2}^\infty (n+1)^s\left(1-\frac{1}{\log(n+1)^n}\right)+\sum_{m=2}^\infty \frac{(m+1)^s}{m}\left(1-\frac{1}{\log(m+1)}\right)+\sum_{m=2}^\infty\sum_{n=2}^\infty \frac{(m+n)^s}{m}\left(1-\frac{1}{\log(m+n)^n}\right)$$


text:
Q: Sitecore: Get context item from rendering parameters I've a custom treelist field type that can resolve its datasource context item by following code.
Item contextItem = Sitecore.Context.ContentDatabase.Items[ItemID];
Item queryItem = contextItem.Axes.SelectSingleItem(qs);

But a mishap happens when the context item is a rendering parameter. Because then the datasource context item is out of sitecore root. I could start my datasource query from sitecore root sure but its a multisite solution so, that won't be a good solution.
Is there any way I can resolve the context item (which is a page item in this case) from my custom treelist?
The solution is in sitecore 7.2.


text:
Q: Decoding a request body in Go -- Why am I getting an EOF? I'm using the Beego framework to build a web application, and I'm trying to hand it some JSON encoded data. Roughly, this is what I have:
import (
"github.com/astaxie/beego"
)

type LoginController struct {
beego.Controller
}

func (this *LoginController) Post() {
  request := this.Ctx.Request
  length := request.ContentLength
  p := make([]byte, length)
  bytesRead, err := this.Ctx.Request.Body.Read(p)
  if err == nil{
    //blah
  } else {
    //tell me the length, bytes read, and error
  }
}

Per this tutorial, the above Should Just Work (tm).
My problem is this: bytesRead, err := this.Ctx.Request.Body.Read(p) is returning 0 bytes read and the err.Error() is EOF.
The request.ContentLength, however, is a sane number of bytes (19 or more, depending on what data I type in).
I can't figure out why the request would appear to have some length, but would fail on Read. Any ideas?

A: If you are trying to reach a JSON payload in Beego, you'll want to call
this.Ctx.Input.RequestBody

That returns a []byte array of the sent payload. You can then pass it to a function like:
var datapoint Datapoint
json.Unmarshal(this.Ctx.Input.RequestBody, &datapoint)

Where datapoint is the struct you are attempting to unmarshall your data into.


text:
Q: Why deleting big files from tmpfs is not instantaneous? $ cat /proc/mounts | egrep ' /tmp '
tmpfs /tmp tmpfs rw,nosuid,nodev,relatime 0 0
$ dd if=/dev/zero bs=1M count=3000 of=/tmp/q
3000+0 records in
3000+0 records out
3145728000 bytes (3.1 GB) copied, 1.04961 s, 3.0 GB/s
$ time rm /tmp/q

real    0m0.296s
user    0m0.000s
sys     0m0.290s

Why not 0.000s? There is no disk involved, just marking that memory is not used anymore.

A: The "marking that memory as unused" is a function of how much work the unlinkat(2) system call has to do, which in turn scales linearly with the size of the file. For a default tmpfs on a RHEL 6 system with ~4G of memory, this can be demonstrated as follows.
$ sudo mkdir /tmpfs; sudo mount -t tmpfs -o size=75% tmpfs /tmpfs; cd /tmpfs
$ dd if=/dev/zero bs=1M of=blah count=2859
...
$ strace -c rm blah 2>&1 | head -3
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00    0.241964      241964         1           unlinkat
$ for c in 500 1000 1500 2000 2500; do dd if=/dev/zero bs=1M of=blah count=$c 2>/dev/null; echo -n "$c "; strace -c rm blah 2>&1 | awk '/unlinkat/{print $3}'; done
500 53992
1000 88986
1500 135980
2000 174974
2500 222966

As to what the unlinkat(2) system call is doing in particular, that would require digging around in the source code; my guess is that the data structure that represents the file in memory (a linked list?) is being looped over as the file is removed, thus accounting for the linear growth of operation time with file size.


text:
Q: Ansible to register to a dictionary or dynamic variable for several tasks In Ansible I have two separate tasks to get the list of existing services for redhat 6 and 7, they register to a variable, then I have another task that stops those services, if I use the same variable it gets overwritten by the last task, so it does not stop anything.
Is there  a way of distinguishing between the two results? and yet only use one task to stop the services? I tried dynamic var names or creating a dictionary, but none work.
thanks
  - name: Get registered services
      command: bash -c "chkconfig --list | awk '{print $1}'"
      register:  loaded_services_{{ansible_distribution_major_version}}
      when: (( ansible_os_family == "RedHat" ) and ( ansible_distribution_major_version == "6" ))
      changed_when: False
      tags: test

    - name: Get registered services
      command: bash -c "systemctl list-unit-files | grep enabled | cut -d. -f1"
      register: loaded_services_{{ansible_distribution_major_version}}
      when: (( ansible_os_family == "RedHat" ) and ( ansible_distribution_major_version == "7" ))
      changed_when: False
      tags: test

    - name: shutdown unnecessary services
      service: name={{ item }} enabled=no state=stopped
      with_items: "{{ disable_services | intersect(loaded_services_{{ansible_distribution_major_version}}.stdout_lines)}}"
      when: ansible_os_family == "RedHat" and  ansible_distribution_major_version == "6"
      tags:
        - harden
        - test
      ignore_errors: yes

A: Try with blocks, first in this way:
  - block:
    - name: Get registered services
      command: bash -c "chkconfig --list | awk '{print $1}'"
      register:  loaded_services
      changed_when: False
      tags: test
    when: (( ansible_os_family == "RedHat" ) and ( ansible_distribution_major_version == "6" ))

  - block:
    - name: Get registered services
      command: bash -c "systemctl list-unit-files | grep enabled | cut -d. -f1"
      register: loaded_services
      changed_when: False
      tags: test
    when: (( ansible_os_family == "RedHat" ) and ( ansible_distribution_major_version == "7" ))

  - name: shutdown unnecessary services
    service: name={{ item }} enabled=no state=stopped
    with_items: "{{ disable_services | intersect(loaded_services.stdout_lines)}}"
    when: ansible_os_family == "RedHat" and  ansible_distribution_major_version == "6"
    tags:
      - harden
      - test
    ignore_errors: yes

And if doesn´t work, try in this other way:
  - block:
    - name: Get registered services
      command: bash -c "chkconfig --list | awk '{print $1}'"
      register:  loaded_services
      changed_when: False
      tags: test

    - name: shutdown unnecessary services
      service: name={{ item }} enabled=no state=stopped
      with_items: "{{ disable_services | intersect(loaded_services.stdout_lines)}}"
      tags:
        - harden
        - test
      ignore_errors: yes

    when: (( ansible_os_family == "RedHat" ) and ( ansible_distribution_major_version == "6" ))

  - block:
    - name: Get registered services
      command: bash -c "systemctl list-unit-files | grep enabled | cut -d. -f1"
      register: loaded_services
      changed_when: False
      tags: test

    - name: shutdown unnecessary services
      service: name={{ item }} enabled=no state=stopped
      with_items: "{{ disable_services | intersect(loaded_services.stdout_lines)}}"
      tags:
        - harden
        - test
      ignore_errors: yes

    when: (( ansible_os_family == "RedHat" ) and ( ansible_distribution_major_version == "7" ))


text:
Q: Why is Logcat output in Android studio different in two similar cases? Why is the output different in the below cases?
   public void onResponse(Call call, Response response){

      //first line...
      Log.i("Body", "" + (response.body().toString()));

     String mMessage = response.body().string();
      //second line
      Log.i("Message", "" + mMessage);

    }

I got two different Logcat output

I/Body: okhttp3.internal.http.RealResponseBody@387ce26
  I/Message{"name":"mohamed3@gmail.com","email":"mohamed3@gmail.com","type":"1","msg":"sucessfully"}

is there any explanation for that?

A: response.body().toString() is a reference to an instanceof String -
while response.body().string() is obtaining it's String value.


text:
Q: Intercept type error Is there a way to intercept type error and return own value ?
Consider scenario:
I have my own lib that in case of undefined or null returns some value
if (typeof value === 'undefined' || value === null) return Nothing;

so if you use this
mylib(null) // -> Nothing
mylib(1) // -> Just(1)

That is all good but if I pass in object with un-existing property like this
var a = {};
a.b = {};
mylib(a.b.c.d) // -> c is not an Object and does not have property d
// Uncaught TypeError: Cannot read property 'd' of undefined

So what I would like is to intercept type errors and return Nothing instead and I want to do it in native js and I don't want to pass in properties to check in array or delimited string or something. So far I didn't find a way to do it.
I saw some examples of redefining window.onerror() but wondering if there is elegant way of preventing type errors dynamically.

A: With ES6 you can use ES6Proxies to achieve that.
This is especially useful if you want to apply your logic to only few objets.
NOTE that ES6 proxies are not supported by most of the browsers but you can try some shims.
Unfortunatelly you can't handle it globally since:

*

*window.onerror is called when an error is thrown. If an error is thrown you can't go back to the line of code where error was thrown and run it again.

*ES6 Proxy got some limitations. I highly recommend to read about it:  http://exploringjs.com/es6/ch_proxies.html
The only option you can do for your library is to do something like this:
Option.getProperty(object, 'a.b.c.d') // returns Nothing or Just instance


text:
Q: IIS can't connect to SQL Server using SQL Server authentication I have a very strange problem that I have tried to figure out for some time now but unsuccessfully. At work I am using a laptop for development. We have our application run locally on each developer's laptop, but we all use the same dev database. So when I take my work laptop home and connect it to our vpn, my laptop's IIS connects to SQL Server and everything works just fine.
The problem is when I try to use my personal desktop for work I connect it to the same vpn I connect my laptop to run the same code that is on the laptop with the same connection strings, but IIS can't connect to SQL Server and I get this error:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

On both computers I am able to connect to SQL Server using SSMS with no problem. On both computers I can run Integration Tests that hit the database just fine (integration tests use the exact same connection string that the application is using), but if I try to run the application it can't connect. I have tried changing all sorts of settings in IIS but to no avail.
Thanks for your help in advance.

A: *

*Make sure SQL Server Service is running

*If a named instance, make sure SQL Server browser service is running

*Make sure SQL Server is configured to allow remote connections

*Examine the SQL Server error log for messages confirming that SQL is listening on the expected network interfaces and ports

*Test server connectivity with PING from the client machine

*Test port connectivity using TELNET or PowerShell to the server and port (from step 4) from the client machine.  For example
a. TELNET  1433
b. PowerShell: 1433 | % { echo ((new-object Net.Sockets.TcpClient).Connect("YourServerName",$)) "server listening on TCP port $" }

*Check firewall settings if step 5 or 6 connectivity test fails


text:
Q: ER_ACCESS_DENIED_ERROR: When i try to connect to the database on remote server - Node.js I have issue when i try to connect to the database on remote server.
My code:
const mysql = require('mysql');
const database = mysql.createPool({
    host: 'localhost',
    user: 'user',
    password: 'pass',
    database: 'db'
});

database.getConnection(function (err, connection) {
    if (!err) {
        console.log('Database is connected ...');
    } else {
        console.log('Error connecting database ...');
    }
});

The credentials for connection in code is faked. With the right credentials  I have, I login successfully on phpMyAdmin on remote server, on datebase that I want to connect. Credentials is good.
When I run script, return this error:
view error
Also, when I input credentials for connection with my local database, everything work perfect.

A: As pointed out by Luuk, you need to replace the localhost with the actual IP address of the remote database server and the port on which the database server is running.
For example -
const database = mysql.createPool({
    host: '123.234.121.234',
    port : '3306',
    user: 'user',
    password: 'pass',
    database: 'db'
});

Also, make sure the port is whitelisted and can be accessed over the network. Heres a tiny little diagram for explanation.

A: phpmyadmin runs on the same machine as your MySQL server, so it can connect to the server using the generic host name localhost.
I guess, from your question, that your nodejs program runs on some other machine (your personal machine, maybe?). That takes some special-purpose setup to do.

*

*You must use the server's actual hostname in your host: property, not localhost.

*MySQL login credentials aren't just username/password. They are host/username/password. You may need to create a new set of credentials for remote access so your nodejs program can get in. Read this: https://webmasters.stackexchange.com/questions/2242/how-to-create-separate-users-in-phpmyadmin-each-one-cant-see-others-databases

*If your MySQL server runs on a rented server at some cloud or hosting service, you may need to open up a firewall to allow your machine to connect. If you're on a hosting service, ask their customer support krewe about that. On a cloud service, you want to open port 3306. Look up how to do that in their documentation. (It may be a gnarly configuration task).
Your easiest way of troubleshooting this is to use some MyQSL client program (like MySQL Workbench or HeidiSQL) on your own machine. when you get that to connect, you can use the same credentials in your createPool() call.


text:
Q: Is it possible to define generic index in elastic search using nest? How can i generate index of generic type.This is my code to insert document into generic index which is defined by .I get error in the Tres emp section saying "Tres is a type, which is not valid in the given context"
 public void InsertDocument<Tres>(ElasticClient es, Tres emp,IndexName name) where Tres: new()
    {
        es.Index<Tres>(**Tres emp**, x => x.Index(name).Type("logs"));
    }

A: You have to define a reference for generic "Tres" type. To perform functionality of generic type as you expected you should create a base class which other elasticsearch index classes derived from it. So, you can pass the custom elasticsearch index classes in that way.
Firstly, create a base class for Elasticsearch index classes.
public class EsIndicesBaseClass
{

}

And I provided a sample Elasticsearch index model;
public class EsSampleIndexModel : EsIndicesBaseClass
{
    public string SampleProperty{get;set;}
}

And change your generic method to
public void InsertDocument<Tres>(ElasticClient es, Tres emp,IndexName name) where Tres: EsIndicesBaseClass
    {
        es.Index<Tres>(emp, x => x.Index(name).Type("logs"));
    }

Usage;
var esSampleIndexData = new EsSampleIndexModel();

InsertDocument<EsSampleIndexModel>(es, esSampleIndexData , name);


text:
Q: Ruby gem error while trying to login to openshift via terminal I tried installing ruby and rails which did work. But now that I am trying to get openshift to work. In openshift, I have created the application and Now I just want to transfer all the files the git hub. So according to my understanding, I have to login into openshift then I can use git commands to transfer the updated files onto the server.
I run into following error message[The operating system I am using is Mac OS X] :
Spartons:JavaTutorials ripudamanflora$ rhc apps
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'rhc' (>= 0) among 60 total gem(s) (Gem::LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
    from /usr/bin/rhc:22:in `<main>'

I can't even login into my openshift application via terminal:
Spartons:peel ripudamanflora$  rhc setup -l eripflo@gmail.com
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'rhc' (>= 0) among 60 total gem(s) (Gem::LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
    from /usr/bin/rhc:22:in `<main>'

All I am trying to do is login to my application and update it. Please let me know if anything is not clear or more information is required.

A: First verify ruby is correctly installed:
$ ruby -e 'puts "Testing Ruby"'

From the error, it seems like you haven't installed the rhc gem. First check if it's installed:
$ which rhc

If rhc isn't installed, try this:
$ sudo gem install rhc
$ rhc setup

And try again. (If you're using Ruby Version Manager rvm, use this).

Source: Installing the OpenShift Client Tools - MacOS X


text:
Q: OpenGL ES in another thread is not drawing on physical device I have put my OpenGL ES initialization in another thread with CAEAGLLayer.
    context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1 sharegroup:group];
if (!context || ![EAGLContext setCurrentContext:context])
{
    [self release];
}

// Create system framebuffer object. The backing will be allocated in -reshapeFramebuffer
glGenFramebuffersOES(1, &viewFramebuffer);
glGenRenderbuffersOES(1, &viewRenderbuffer);
glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
[context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:eaglLayer];
glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, viewRenderbuffer);

and then draw it to screen
    BOOL rel = [EAGLContext setCurrentContext:context];
drawPixels(backingWidth, backingHeight, framebuf1, texID);
rel = [context presentRenderbuffer:GL_RENDERBUFFER_OES];

the buffer is displaying in simulator, but on a device, all I get is a black screen.
do I need to configure something else?

A: OpenGL contexts can be active in only one thread on a time. So you've first to detach the context from one thread and reattach it in another one. It looks like your code lacks the detaching.


text:
Q: Error occurring while evaluation of expression in prolog I am very new to Prolog. I need to find all the paths from Source to Destination in a maze.
I wrote the following clause so that I do not have to write all the edge relations explicitly:
neighbour(X,Y) :-
   (  X =:= Y+1
   ;  Y =:= X+1
   ;  X =:= Y+6
   ;  Y =:= X+6
   ).

Next, for finding path I do the following:
path(Source,Source,_).
path(Source,Destination,PathList) :-
    neighbour(Source,Z),                % find a neighbour of Source
    not(member(Z,PathList)),            % that is not already in the list
    % and see if there is a path from Z to Destination
    path(Z,Destination,[Source|PathList]).

While running it I queried the following:
?- path(1,2,[]).    % "Is there a path from 1 to 2?"

This gives me the following error:
ERROR: Arguments are not sufficiently instantiated
ERROR: In:
ERROR:   [10] 1=:=_26424+1
ERROR:    [9] neighbour(1,_26452) at /Users/sujitkumar/Desktop/this sem/PL/2.pl:3
ERROR:    [8] path(1,2,[]) at /Users/sujitkumar/Desktop/this sem/PL/2.pl:30
ERROR:    [7] <user>

I do not understand why the expression is not getting evaluated.


text:
Q: mean line to interaction plot Does anyone know how to add mean line on interaction plot? My code goes like this:
#interaction plot
with(datascen_2minBL, interaction.plot(scenario, role, cw2_sum_ampl_per_min, xlab = "baselines", ylab = "2min sumAmplPerMin"))

I have multiple responses from each participant measured at different time points. Each participant has different roles "AO", "RO", "TO" and "AO". My interaction lines represent means per each role. Now I would like to add grand mean line. How could I achieve that?
THANK YOU!

A: Using lines, the mean without the interaction variable using tapply should give you the needed values. Example:
with(ToothGrowth, interaction.plot(dose, supp, len, fixed=TRUE, legend=F))
lines(with(ToothGrowth, tapply(len, dose, mean)), col=2)
legend("topleft", lty=1:2, col=c(1, 1, 2), legend=c("OJ", "VC", "grand mean"),
       title="supp", bty="n", cex=.9)


text:
Q: Variable Dumping in C++ Is it possible to do a 'dump' on complex structures or even arrays in C++, in order to visually be able to check out what they've got inside them?
I'm thinking of something similar to print_r() or var_dump() in PHP.
Cheers,
-Fin

A: The short answer is: no, unless you manually write such a routine yourself.
Which is often not a bad idea, but it has the usual problems of getting out of sync with the class if you are adding/changing members often.  This is unavoidable because C++ lacks any form of introspection into structs.
If you decide to go that way, the best thing to do is to write an overload for std::ostream& operator<<(std::ostream& os, MyClass const&), which will enable your class to be printed to any IOStreams output stream.

A: Usually debuggers are smart enough to do this.
In GDB you can use:
print structure

and in NTSD you can do the uber-cool:
dt -r structure

If you're just using this for debugging purposes, I highly recommend learning to use the debuggers.  Even if its something you want to log as you (i.e. print a zillion times) you can set a breakpoint macro.
In NTSD:
bp yourdll!yourobject::yourfunction "dt -r structure;g"

And I'm sure there is a way to do it in GDB as well

A: In addition to the other answers, depending on what you want it for and whether you care about portability, you can potentially look at getting the information you need from the debugging information that your compiler generates. You can parse the COFF/ELF/whatever format file from the build and this gives you the information you need to work out the names and types of the variables in your object.

A: If you add reflection to C++ (using a third-party library or vendor extensions), you can write a routine to use that reflection data to dump arbitrary structures.  For example, I have some code that uses CERN's Reflex library to iterate over a class or structure's members and dump them to YAML.

A: Not generally possible in C++ as it requires the use of reflection, which C++ does not have. You can of course write your own function to dump specific data structures.

A: Indeed, in an environment where you have gdb at your disposal and you compile your sources with debugging symbols enabled (e.g -ggdb) you can have your debugger (e.g. gdb from commandline or ddd when you want something graphically).
Consider this piece of code:
#include <string>
#include <vector>

struct test
{
    int a;
    float b;
    std::string c;
};

int main()
{
    std::vector<int> v;

    test t;
    t.a=1;
    t.b=2.0;
    t.c="hello there";

    return 0;
}

When asking gdb politely it can give me the following output:

(gdb) break 20
Breakpoint 1 at 0x8048622: file bla.cpp, line 20.
(gdb) run
Starting program: /home/edb/a.out

Breakpoint 1, main () at bla.cpp:21
21      return 0;
(gdb) print t
$1 = {a = 1, b = 2, c = {static npos = 4294967295,
    _M_dataplus = {> = {> = {}, }, _M_p = 0x96b6014 "hello there"}}}
(gdb) ping v
Undefined command: "ping".  Try "help".
(gdb) print v
$2 = { >> = {
    _M_impl = {> = {> = {}, }, _M_start = 0x0, _M_finish = 0x0,
      _M_end_of_storage = 0x0}}, }

Edit: note that this data is available from a debugger context, for generating these dumps at runtime you will need to foresee your own dumping/formatting function, typically done by overloading the << operator in C++.

A: Why dont you use binary files?
fstream has binary mode,and you can dump any type except struct,class,namespace or STL lists(like vector,queue).
Wanna dump struct,class,namespace(or STL list) to binary? Make a function,and dump each variable in the file! The end! That would not be that hard...
but want more help?see this code snippet!
#include <iostream>
#include <fstream>//ofstream,ifstream
using namespace std;
ifstream myBdumpin ("data.bin"/*filename*/, ios::in);//ifstream = input
ofstream myBdumpout ("data.bin"/*filename*/, ios::out);//ofstream = output
int main()
{
    char a[8]="Binary!"
    myBdumpout << a;
    char b[8];
    myBdumpin >> b;
    if(a == b)cout << "It worked!" << endl;
    else cout << "It failed..." << endl;
    return 0;
}

It should work...


text:
Q: Accessing all methods from es6 class from another one I have 2 classes: MyClass and CBook. I would like to have access to all functions and variables of MyClass class from the CBook class. How can i do that ?
MyClass
import $ from 'jquery';
import {CBook} from './book';

const path = "http://www.mypage.com";

class MyClass {

    constructor() {
        let _summaryPageUI = new CBook(this);
    }

    describeBook() {
        console.log('test');
    }

}

new MyClass();

export {MyClass};

I would like to have access to all methods from MyClass in CBook:
CBook
class CBook {
    constructor(myClass) {
        console.log(myClass);
    }
}

export {CBook};

A: I think you are looking for the extends property.  See documentation at: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/extends
or
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
class myClass extends CBook {
  ....
}

A: class MyClass {
  constructor() {
    console.log("MyClass instantiated");
  }
  describeBook() {
    console.log("book described");
  }
}

class CBook extends MyClass {
  constructor() {
    super();
    console.log("CBook instantiated");
  }
}

You then will be able to do:
const book = new CBook();
book.describeBook();

You will get output:
MyClass instantiated
CBook instantiated
book described

A: The constructor is a function that is immediately called when a new instance of the class (object) is created. This initializes the objects initial properties and state. As XPX-Gloom noted, you use the extends keyword to implicitly say "CBook object, take either all or some of the properties of MyClass when instantiated". By using super(), you are calling the constructor of MyClass. This 'super' keyword is for making super-constructor calls and allows access to parent methods.
example

A: In ES6 all class instance methods are public so you can access them all by creating an instance of MyClass and calling it's methods like this:
class CBook {
  constructor(myClass) {
    this.myClass = myClass;
  }

  someMethod() {
    this.myClass.describeBook()
  }
}

A: based on the terminology you are using "function" - i think you want to define your functions as static,  so that can be called on the class rather than the instance:
define:
class foo {
    static someFunc() { console.log("foo:someFunc") }
}

Call:
foo.someFunc();

console out:
foo:someFunc

for values
add after class definition
foo.someValue = "myValue";

then:
console.log(foo.someValue)

will output: myValue


text:
Q: Object.keys behaving unexpectedly I have a script that console logs the following:
 console.log(this.props.comments);
 console.log(Object.keys(this.props.comments)); //why length 0???

The output:

If this.props.comments has a child node and that it console.logs correctly, why does Object.keys console log an empty array? This is really stumping me. I use Object.keys quite a lot and I have never come across this before. I am expecting the second console.log to output: ["AFIFAIFJJ"]
I am hoping that I am doing something rather stupid! All help is appreciated.
Thanks in advance.
p.s. I am using React-Native although, the question is just regarding Javascript I believe.


text:
Q: triple error when trying to execute SQL query This is the code I am trying to execute.
SELECT * Catagory
FROM Catagory
LEFT JOIN products.Price
ON Catagory.Category=products.Price
WHERE ((Catagory.Category='Ring' OR Catagory.Category='Earings') AND(products.Price<=30))
ORDER BY products.Price

I'm not sure if it's the fact that I'm trying to do a join or maybe the permissions need to be reset or something.
The code seems to work when using other tables in the database and I'm pretty sure that this one has all the same settings.
SELECT * Catagory
FROM Catagory
LEFT JOIN products.Price
ON Catagory.Category=products.Price
WHERE ((Catagory.Category='Ring' OR Catagory.Category='Earings') AND(products.Price<=30))
ORDER BY products.Price LIMIT 0, 25
MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Catagory
FROM Catagory
LEFT JOIN products.Price
ON Catagory.Category=products' at line 1

Warning in ./libraries/DbQbe.php#1669
array_map() expects parameter 1 to be a valid callback, class 'Util' not found

Backtrace

./libraries/DbQbe.php#1669: array_map(
string 'Util::backquote',
array,
)
./libraries/DbQbe.php#1556: PMA\libraries\DbQbe->_getJoinForFromClause( array,
array,
)
./libraries/DbQbe.php#1789: PMA\libraries\DbQbe->_getFromClause(array)
./libraries/DbQbe.php#1857: PMA\libraries\DbQbe->_getSQLQuery(array)
./db_qbe.php#153: PMA\libraries\DbQbe->getSelectionForm()

Warning in ./libraries/DbQbe.php#1670
implode(): Invalid arguments passed

Backtrace

./libraries/DbQbe.php#1670: implode(
string ', ',
NULL,
)
./libraries/DbQbe.php#1556: PMA\libraries\DbQbe->_getJoinForFromClause(
array,
array,
)
./libraries/DbQbe.php#1789: PMA\libraries\DbQbe->_getFromClause(array)
./libraries/DbQbe.php#1857: PMA\libraries\DbQbe->_getSQLQuery(array)
./db_qbe.php#153: PMA\libraries\DbQbe->getSelectionForm()

A: Your query is wrong it should be something like
SELECT *
FROM Catagory c
LEFT JOIN products p
ON c.Category=p.Price
WHERE ((c.Category='Ring' OR c.Category='Earings') AND(p.Price<=30))
ORDER BY p.Price;

A: You have multiple wrong in the statement
1)
SELECT * Catagory FROM Catagory

Shloud be
SELECT * FROM Catagory

or
SELECT Catagory FROM Catagory

2)
LEFT JOIN products.Price ON Catagory.Category=products.Price

You can not use this as the data in those links are not the same.
For ex. you can link two columns that have numbers or two columns that have names but you can not link a number to a name.
The second one is not an error it is more like a wrong doing