Creating PNR with SOAP webservices in SABRE

Question: i'm trying to create a new Booking using OTa Sabre Webservices, in some cases i got my ItineraryRef, but in some other cases i got a Warning from EnhancedAirBook, btw i order to complete booking i use this workflow, BargainFinderMax + EnhancedAirBook + PassengerDetails
In this particular case i'm trying to Book for two ADTS, can some body tell me or at least be light in darkness for me.
Thank you!
Request to EnhancedAirBook:
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
    <MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader">
        <From>
            <PartyId>sample.url.of.sabre.client.com</PartyId>
        </From>
        <To>
            <PartyId>webservices.sabre.com</PartyId>
        </To>
        <CPAId>7TZA</CPAId>
        <ConversationId>convId</ConversationId>
        <Service>EnhancedAirBookRQ</Service>
        <Action>EnhancedAirBookRQ</Action>
        <MessageData>
            <MessageId>1000</MessageId>
            <Timestamp>2001-02-15T11:15:12Z</Timestamp>
            <TimeToLive>2001-02-15T11:15:12Z</TimeToLive>
        </MessageData>
    </MessageHeader>
    <Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">
        <BinarySecurityToken EncodingType="Base64Binary" valueType="String">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</BinarySecurityToken>
    </Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
    <EnhancedAirBookRQ xmlns="http://services.sabre.com/sp/eab/v3_2" HaltOnError="false" version="3.2.0">
        <OTA_AirBookRQ>
            <OriginDestinationInformation>
                <FlightSegment ArrivalDateTime="2017-04-13T13:02:00" DepartureDateTime="2017-04-13T11:52:00" FlightNumber="69" NumberInParty="2" ResBookDesigCode="T" Status="NN">
                    <DestinationLocation LocationCode="BOG" />
                    <MarketingAirline Code="AV" FlightNumber="69" />
                    <OriginLocation LocationCode="CCS" />
                </FlightSegment>
                <FlightSegment ArrivalDateTime="2017-04-13T15:53:00" DepartureDateTime="2017-04-13T14:15:00" FlightNumber="8372" NumberInParty="2" ResBookDesigCode="T" Status="NN">
                    <DestinationLocation LocationCode="PTY" />
                    <MarketingAirline Code="AV" FlightNumber="8372" />
                    <OriginLocation LocationCode="BOG" />
                </FlightSegment>
                <FlightSegment ArrivalDateTime="2017-04-19T06:40:00" DepartureDateTime="2017-04-19T05:10:00" FlightNumber="8371" NumberInParty="2" ResBookDesigCode="T" Status="NN">
                    <DestinationLocation LocationCode="BOG" />
                    <MarketingAirline Code="AV" FlightNumber="8371" />
                    <OriginLocation LocationCode="PTY" />
                </FlightSegment>
                <FlightSegment ArrivalDateTime="2017-04-19T11:07:00" DepartureDateTime="2017-04-19T08:08:00" FlightNumber="66" NumberInParty="2" ResBookDesigCode="T" Status="NN">
                    <DestinationLocation LocationCode="CCS" />
                    <MarketingAirline Code="AV" FlightNumber="66" />
                    <OriginLocation LocationCode="BOG" />
                </FlightSegment>
            </OriginDestinationInformation>
        </OTA_AirBookRQ>
        <OTA_AirPriceRQ>
            <PriceRequestInformation Retain="true">
                <OptionalQualifiers>
                    <PricingQualifiers>
                        <ItineraryOptions>
                            <SegmentSelect Number="1" RPH="1" />
                            <SegmentSelect Number="2" RPH="2" />
                            <SegmentSelect Number="3" RPH="3" />
                            <SegmentSelect Number="4" RPH="4" />
                        </ItineraryOptions>
                        <PassengerType Code="ADT" Quantity="2" />
                    </PricingQualifiers>
                </OptionalQualifiers>
            </PriceRequestInformation>
        </OTA_AirPriceRQ>
        <PostProcessing IgnoreAfter="false">
            <RedisplayReservation WaitInterval="2000" />
        </PostProcessing>
        <PreProcessing IgnoreBefore="false" />
    </EnhancedAirBookRQ>
</SOAP-ENV:Body>

Response from EnhancedAirBook:
<?xml version="1.0" encoding="UTF-8"?><soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
    <eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" eb:version="1.0" soap-env:mustUnderstand="1">
        <eb:From>
            <eb:PartyId eb:type="URI">webservices.sabre.com</eb:PartyId>
        </eb:From>
        <eb:To>
            <eb:PartyId eb:type="URI">sample.url.of.sabre.client.com</eb:PartyId>
        </eb:To>
        <eb:CPAId>7TZA</eb:CPAId>
        <eb:ConversationId>convId</eb:ConversationId>
        <eb:Service>EnhancedAirBookRQ</eb:Service>
        <eb:Action>EnhancedAirBookRS</eb:Action>
        <eb:MessageData>
            <eb:MessageId>1lsj6e9zy</eb:MessageId>
            <eb:Timestamp>2017-04-13T02:22:10</eb:Timestamp>
            <eb:RefToMessageId>1000</eb:RefToMessageId>
        </eb:MessageData>
    </eb:MessageHeader>
    <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
        <wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">XXXXXXXXXXXXXXXXXX</wsse:BinarySecurityToken>
    </wsse:Security>
</soap-env:Header>
<soap-env:Body>
    <EnhancedAirBookRS xmlns="http://services.sabre.com/sp/eab/v3_2">
        <ApplicationResults xmlns="http://services.sabre.com/STL_Payload/v02_01" status="Complete">
            <Success timeStamp="2017-04-12T21:22:10.870-05:00" />
            <Warning type="BusinessLogic" timeStamp="2017-04-12T21:22:08.607-05:00">
                <SystemSpecificResults>
                    <Message code="WARN.SWS.HOST.ERROR_IN_RESPONSE">NO COMBINABLE FARES FOR CLASS USED53</Message>
                </SystemSpecificResults>
            </Warning>
        </ApplicationResults>
        <OTA_AirBookRS>
            <OriginDestinationOption>
                <FlightSegment ArrivalDateTime="04-13T13:02" DepartureDateTime="04-13T11:52" FlightNumber="0069" NumberInParty="002" ResBookDesigCode="T" Status="NN" eTicket="true">
                    <DestinationLocation LocationCode="BOG" />
                    <MarketingAirline Code="AV" FlightNumber="0069" />
                    <OriginLocation LocationCode="CCS" />
                </FlightSegment>
                <FlightSegment ArrivalDateTime="04-13T15:53" DepartureDateTime="04-13T14:15" FlightNumber="8372" NumberInParty="002" ResBookDesigCode="T" Status="NN" eTicket="true">
                    <DestinationLocation LocationCode="PTY" />
                    <MarketingAirline Code="AV" FlightNumber="8372" />
                    <OriginLocation LocationCode="BOG" />
                </FlightSegment>
                <FlightSegment ArrivalDateTime="04-19T06:40" DepartureDateTime="04-19T05:10" FlightNumber="8371" NumberInParty="002" ResBookDesigCode="T" Status="NN" eTicket="true">
                    <DestinationLocation LocationCode="BOG" />
                    <MarketingAirline Code="AV" FlightNumber="8371" />
                    <OriginLocation LocationCode="PTY" />
                </FlightSegment>
                <FlightSegment ArrivalDateTime="04-19T11:07" DepartureDateTime="04-19T08:08" FlightNumber="0066" NumberInParty="002" ResBookDesigCode="T" Status="NN" eTicket="true">
                    <DestinationLocation LocationCode="CCS" />
                    <MarketingAirline Code="AV" FlightNumber="0066" />
                    <OriginLocation LocationCode="BOG" />
                </FlightSegment>
            </OriginDestinationOption>
        </OTA_AirBookRS>
        <TravelItineraryReadRS>
            <TravelItinerary>
                <CustomerInfo />
                <ItineraryInfo>
                    <ReservationItems>
                        <Item RPH="1">
                            <FlightSegment AirMilesFlown="0636" ArrivalDateTime="04-13T13:02" DayOfWeekInd="4" DepartureDateTime="2017-04-13T11:52" ElapsedTime="02.10" FlightNumber="0069" NumberInParty="02" ResBookDesigCode="T" SegmentNumber="0001" SmokingAllowed="false" SpecialMeal="false" Status="UC" StopQuantity="00" eTicket="false">
                                <DestinationLocation LocationCode="BOG" Terminal="TERMINAL 1" TerminalCode="1" />
                                <Equipment AirEquipType="321" />
                                <MarketingAirline Code="AV" FlightNumber="0069" />
                                <Meal Code="S" />
                                <OperatingAirline Code="AV" CompanyShortName="/AVIANCA" />
                                <OriginLocation LocationCode="CCS" />
                                <SupplierRef ID="DCAV" />
                                <Text>OPERATED BY /AVIANCA</Text>
                                <UpdatedArrivalTime>04-13T13:02</UpdatedArrivalTime>
                                <UpdatedDepartureTime>04-13T11:52</UpdatedDepartureTime>
                            </FlightSegment>
                        </Item>
                        <Item RPH="2">
                            <FlightSegment AirMilesFlown="0468" ArrivalDateTime="04-13T15:53" DayOfWeekInd="4" DepartureDateTime="2017-04-13T14:15" ElapsedTime="01.38" FlightNumber="8372" NumberInParty="02" ResBookDesigCode="T" SegmentNumber="0002" SmokingAllowed="false" SpecialMeal="false" Status="UC" StopQuantity="00" eTicket="false">
                                <DestinationLocation LocationCode="PTY" />
                                <Equipment AirEquipType="320" />
                                <MarketingAirline Code="AV" FlightNumber="8372" />
                                <Meal Code="S" />
                                <OperatingAirline Code="AV" CompanyShortName="/AEROGAL" />
                                <OriginLocation LocationCode="BOG" Terminal="TERMINAL 1" TerminalCode="1" />
                                <SupplierRef ID="DCAV" />
                                <Text>OPERATED BY /AEROGAL</Text>
                                <UpdatedArrivalTime>04-13T15:53</UpdatedArrivalTime>
                                <UpdatedDepartureTime>04-13T14:15</UpdatedDepartureTime>
                            </FlightSegment>
                        </Item>
                        <Item RPH="3">
                            <FlightSegment AirMilesFlown="0468" ArrivalDateTime="04-19T06:40" DayOfWeekInd="3" DepartureDateTime="2017-04-19T05:10" ElapsedTime="01.30" FlightNumber="8371" NumberInParty="02" ResBookDesigCode="T" SegmentNumber="0003" SmokingAllowed="false" SpecialMeal="false" Status="UC" StopQuantity="00" eTicket="false">
                                <DestinationLocation LocationCode="BOG" Terminal="TERMINAL 1" TerminalCode="1" />
                                <Equipment AirEquipType="320" />
                                <MarketingAirline Code="AV" FlightNumber="8371" />
                                <Meal Code="S" />
                                <OperatingAirline Code="AV" CompanyShortName="/AEROGAL" />
                                <OriginLocation LocationCode="PTY" />
                                <SupplierRef ID="DCAV" />
                                <Text>OPERATED BY /AEROGAL</Text>
                                <UpdatedArrivalTime>04-19T06:40</UpdatedArrivalTime>
                                <UpdatedDepartureTime>04-19T05:10</UpdatedDepartureTime>
                            </FlightSegment>
                        </Item>
                        <Item RPH="4">
                            <FlightSegment AirMilesFlown="0636" ArrivalDateTime="04-19T11:07" DayOfWeekInd="3" DepartureDateTime="2017-04-19T08:08" ElapsedTime="01.59" FlightNumber="0066" NumberInParty="02" ResBookDesigCode="T" SegmentNumber="0004" SmokingAllowed="false" SpecialMeal="false" Status="UC" StopQuantity="00" eTicket="false">
                                <DestinationLocation LocationCode="CCS" />
                                <Equipment AirEquipType="321" />
                                <MarketingAirline Code="AV" FlightNumber="0066" />
                                <Meal Code="S" />
                                <OperatingAirline Code="AV" CompanyShortName="/AVIANCA" />
                                <OriginLocation LocationCode="BOG" Terminal="TERMINAL 1" TerminalCode="1" />
                                <SupplierRef ID="DCAV" />
                                <Text>OPERATED BY /AVIANCA</Text>
                                <UpdatedArrivalTime>04-19T11:07</UpdatedArrivalTime>
                                <UpdatedDepartureTime>04-19T08:08</UpdatedDepartureTime>
                            </FlightSegment>
                        </Item>
                    </ReservationItems>
                </ItineraryInfo>
                <ItineraryRef AirExtras="false" InhibitCode="U" PartitionID="AA" PrimeHostID="1S">
                    <Source PseudoCityCode="4Q0H" />
                </ItineraryRef>
            </TravelItinerary>
        </TravelItineraryReadRS>
    </EnhancedAirBookRS>
</soap-env:Body>

Then when i call PassengerDetails with this
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
    <MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader">
        <From>
            <PartyId>sample.url.of.sabre.client.com</PartyId>
        </From>
        <To>
            <PartyId>webservices.sabre.com</PartyId>
        </To>
        <CPAId>7TZA</CPAId>
        <ConversationId>convId</ConversationId>
        <Service>PassengerDetailsRQ</Service>
        <Action>PassengerDetailsRQ</Action>
        <MessageData>
            <MessageId>1000</MessageId>
            <Timestamp>2001-02-15T11:15:12Z</Timestamp>
            <TimeToLive>2001-02-15T11:15:12Z</TimeToLive>
        </MessageData>
    </MessageHeader>
    <Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">
        <BinarySecurityToken EncodingType="Base64Binary" valueType="String">XXXXXXXXXXXXXXXXXXXXXXXXXXX</BinarySecurityToken>
    </Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
    <PassengerDetailsRQ xmlns="http://services.sabre.com/sp/pd/v3_3" version="3.3.0">
        <PostProcessing>
            <EndTransactionRQ>
                <EndTransaction Ind="true" />
                <Source ReceivedFrom="TARA TESTING" />
            </EndTransactionRQ>
        </PostProcessing>
        <PriceQuoteInfo>
            <Link NameNumber="1.1" Record="1" />
            <Link NameNumber="2.1" Record="1" />
        </PriceQuoteInfo>
        <SpecialReqDetails>
            <AddRemarkRQ>
                <RemarkInfo>
                    <FOP_Remark Type="CASH" />
                    <Remark Type="General">
                        <Text>TEST GENERAL REMARK</Text>
                    </Remark>
                </RemarkInfo>
            </AddRemarkRQ>
            <SpecialServiceRQ>
                <SpecialServiceInfo>
                    <AdvancePassenger SegmentNumber="A">
                        <Document ExpirationDate="2018-05-26" Number="288282822" Type="P">
                            <IssueCountry>VE</IssueCountry>
                            <NationalityCountry>VE</NationalityCountry>
                        </Document>
                        <PersonName DateOfBirth="1989-01-20" Gender="M" NameNumber="1.1" DocumentHolder="true">
                            <GivenName>Mariscal</GivenName>
                            <Surname>De Campo</Surname>
                        </PersonName>
                        <VendorPrefs>
                            <Airline Hosted="false" />
                        </VendorPrefs>
                    </AdvancePassenger>
                    <SecureFlight SegmentNumber="A">
                        <PersonName DateOfBirth="1979-01-20" Gender="M" NameNumber="2.1">
                            <GivenName>Mariscal</GivenName>
                            <Surname>De Guertra</Surname>
                        </PersonName>
                        <VendorPrefs>
                            <Airline Hosted="false" />
                        </VendorPrefs>
                    </SecureFlight>
                </SpecialServiceInfo>
            </SpecialServiceRQ>
        </SpecialReqDetails>
        <TravelItineraryAddInfoRQ>
            <AgencyInfo>
                <Address>
                    <AddressLine>DIRECCION</AddressLine>
                    <CityName>CARACAS</CityName>
                    <CountryCode>VE</CountryCode>
                    <PostalCode>1071</PostalCode>
                    <StateCountyProv StateCode="MI" />
                    <StreetNmbr>OFIC 18</StreetNmbr>
                    <VendorPrefs>
                        <Airline Hosted="true" />
                    </VendorPrefs>
                </Address>
                <Ticketing TicketType="7TAW" />
            </AgencyInfo>
            <CustomerInfo>
                <ContactNumbers>
                    <ContactNumber LocationCode="KTM" NameNumber="1.1" Phone="817-555-1212" PhoneUseType="H" />
                    <ContactNumber LocationCode="KTM" NameNumber="2.1" Phone="817-777-1212" PhoneUseType="H" />
                </ContactNumbers>
                <Email Address="firstname.lastname@example.com" NameNumber="1.1" />
                <PersonName NameNumber="1.1" PassengerType="ADT">
                    <GivenName>Mariscal</GivenName>
                    <Surname>De Campo</Surname>
                </PersonName>
                <PersonName NameNumber="2.1" PassengerType="ADT">
                    <GivenName>Mariscal</GivenName>
                    <Surname>De Guertra</Surname>
                </PersonName>
            </CustomerInfo>
        </TravelItineraryAddInfoRQ>
    </PassengerDetailsRQ>
</SOAP-ENV:Body>

I got this response showing this warning WARN.SWS.HOST.ERROR_IN_RESPONSE - CHECK ITINERARY I think this error comes from the fact that there was a problem in the first call to EnhancedAirBook
<?xml version="1.0" encoding="UTF-8"?><soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
    <eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" eb:version="1.0" soap-env:mustUnderstand="1">
        <eb:From>
            <eb:PartyId eb:type="URI">webservices.sabre.com</eb:PartyId>
        </eb:From>
        <eb:To>
            <eb:PartyId eb:type="URI">sample.url.of.sabre.client.com</eb:PartyId>
        </eb:To>
        <eb:CPAId>7TZA</eb:CPAId>
        <eb:ConversationId>convId</eb:ConversationId>
        <eb:Service>PassengerDetailsRQ</eb:Service>
        <eb:Action>PassengerDetailsRS</eb:Action>
        <eb:MessageData>
            <eb:MessageId>qpmyhopy9</eb:MessageId>
            <eb:Timestamp>2017-04-13T02:22:12</eb:Timestamp>
            <eb:RefToMessageId>1000</eb:RefToMessageId>
        </eb:MessageData>
    </eb:MessageHeader>
    <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
        <wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">XXXXXXXXXXXXXXXXXXXXXXXX</wsse:BinarySecurityToken>
    </wsse:Security>
</soap-env:Header>
<soap-env:Body>
    <PassengerDetailsRS xmlns="http://services.sabre.com/sp/pd/v3_3">
        <ApplicationResults xmlns="http://services.sabre.com/STL_Payload/v02_01" status="Complete">
            <Success timeStamp="2017-04-12T21:22:12.201-05:00" />
            <Warning type="BusinessLogic" timeStamp="2017-04-12T21:22:12.048-05:00">
                <SystemSpecificResults>
                    <Message code="WARN.SWS.HOST.ERROR_IN_RESPONSE">CHECK ITINERARY</Message>
                </SystemSpecificResults>
            </Warning>
            <Warning type="BusinessLogic" timeStamp="2017-04-12T21:22:12.125-05:00">
                <SystemSpecificResults>
                    <Message code="WARN.SP.PROVIDER_ERROR">ÂPQ RECORD NUMBER NOT VALIDÂ</Message>
                </SystemSpecificResults>
            </Warning>
            <Warning type="BusinessLogic" timeStamp="2017-04-12T21:22:12.156-05:00">
                <SystemSpecificResults>
                    <Message code="WARN.SP.PROVIDER_ERROR">ÂPQ RECORD NUMBER NOT VALIDÂ</Message>
                </SystemSpecificResults>
            </Warning>
            <Warning type="BusinessLogic" timeStamp="2017-04-12T21:22:12.199-05:00">
                <SystemSpecificResults>
                    <Message code="WARN.SWS.HOST.ERROR_IN_RESPONSE">*IM AND CANCEL UNABLE SEGMENTS</Message>
                </SystemSpecificResults>
            </Warning>
        </ApplicationResults>
    </PassengerDetailsRS>
</soap-env:Body>

I really hope anyone can help me, thanks for your time.
EDIT 13/04/2017
I have changed my request to EnhancedAirBook, i have added HaltOnStatus tags, like suggest Wisdoom in this Question
Request to EnhancedAirBook:
<EnhancedAirBookRQ xmlns="http://services.sabre.com/sp/eab/v3_2" HaltOnError="false" version="3.2.0">
        <OTA_AirBookRQ>
            <HaltOnStatus Code="UC" />
            <HaltOnStatus Code="LL" />
            <HaltOnStatus Code="UN" />
            <HaltOnStatus Code="NO" />
            <HaltOnStatus Code="HL" />
            <OriginDestinationInformation>
                <FlightSegment ArrivalDateTime="2017-04-13T19:03:00" DepartureDateTime="2017-04-13T15:26:00" FlightNumber="914" NumberInParty="2" ResBookDesigCode="N" Status="NN">
                    <DestinationLocation LocationCode="MIA" />
                    <MarketingAirline Code="AA" FlightNumber="914" />
                    <OriginLocation LocationCode="CCS" />
                </FlightSegment>
                <FlightSegment ArrivalDateTime="2017-04-14T11:23:00" DepartureDateTime="2017-04-14T06:25:00" FlightNumber="148" NumberInParty="2" ResBookDesigCode="N" Status="NN">
                    <DestinationLocation LocationCode="JFK" />
                    <MarketingAirline Code="AA" FlightNumber="148" />
                    <OriginLocation LocationCode="MIA" />
                </FlightSegment>
                <FlightSegment ArrivalDateTime="2017-04-19T09:37:00" DepartureDateTime="2017-04-19T06:30:00" FlightNumber="2230" NumberInParty="2" ResBookDesigCode="N" Status="NN">
                    <DestinationLocation LocationCode="MIA" />
                    <MarketingAirline Code="AA" FlightNumber="2230" />
                    <OriginLocation LocationCode="JFK" />
                </FlightSegment>
                <FlightSegment ArrivalDateTime="2017-04-19T14:31:00" DepartureDateTime="2017-04-19T11:04:00" FlightNumber="979" NumberInParty="2" ResBookDesigCode="N" Status="NN">
                    <DestinationLocation LocationCode="CCS" />
                    <MarketingAirline Code="AA" FlightNumber="979" />
                    <OriginLocation LocationCode="MIA" />
                </FlightSegment>
            </OriginDestinationInformation>
            <RedisplayReservation NumAttempts="10" WaitInterval="500" />
        </OTA_AirBookRQ>
        <OTA_AirPriceRQ>
            <PriceRequestInformation Retain="true">
                <OptionalQualifiers>
                    <PricingQualifiers>
                        <ItineraryOptions>
                            <SegmentSelect Number="1" RPH="1" />
                            <SegmentSelect Number="2" RPH="2" />
                            <SegmentSelect Number="3" RPH="3" />
                            <SegmentSelect Number="4" RPH="4" />
                        </ItineraryOptions>
                        <PassengerType Code="ADT" Quantity="2" />
                    </PricingQualifiers>
                </OptionalQualifiers>
            </PriceRequestInformation>
        </OTA_AirPriceRQ>
        <PostProcessing IgnoreAfter="false">
            <RedisplayReservation WaitInterval="500" />
        </PostProcessing>
        <PreProcessing IgnoreBefore="false" />
    </EnhancedAirBookRQ>

And this is the response:
<EnhancedAirBookRS xmlns="http://services.sabre.com/sp/eab/v3_2">
        <ApplicationResults xmlns="http://services.sabre.com/STL_Payload/v02_01" status="Complete">
            <Success timeStamp="2017-04-13T12:21:46.907-05:00" />
            <Warning type="BusinessLogic" timeStamp="2017-04-13T12:21:45.187-05:00">
                <SystemSpecificResults>
                    <Message code="WARN.SWS.HOST.ERROR_IN_RESPONSE">UNABLE 00 AVAILABLE</Message>
                    <Message code="0293">UNABLE 00 AVAILABLE</Message>
                    <Message code="0118">SYSTEM UNABLE TO PROCESS</Message>
                </SystemSpecificResults>
            </Warning>
            <Warning type="Application" timeStamp="2017-04-13T12:21:45.774-05:00">
                <SystemSpecificResults>
                    <Message code="WARN.SP.PROVIDER_ERROR">No PNR in AAA, caused by [No PNR in AAA, code: 500306, severity: WARNING]</Message>
                    <Message code="700408">No PNR in AAA, caused by [No PNR in AAA, code: 500306, severity: WARNING]</Message>
                </SystemSpecificResults>
            </Warning>
            <Warning type="BusinessLogic" timeStamp="2017-04-13T12:21:46.348-05:00">
                <SystemSpecificResults>
                    <Message code="WARN.SWS.HOST.ERROR_IN_RESPONSE">FORMAT, CHECK SEGMENT NUMBER-0003</Message>
                </SystemSpecificResults>
            </Warning>
            <Warning type="Application" timeStamp="2017-04-13T12:21:46.905-05:00">
                <SystemSpecificResults>
                    <Message code="WARN.SP.PROVIDER_ERROR">No PNR in AAA, caused by [No PNR in AAA, code: 500306, severity: WARNING]</Message>
                    <Message code="700408">No PNR in AAA, caused by [No PNR in AAA, code: 500306, severity: WARNING]</Message>
                </SystemSpecificResults>
            </Warning>
        </ApplicationResults>
    </EnhancedAirBookRS>

Thanks to everyone who take 5 mins lo read this questions, i need to solve this issue with my Travel Tool, the support from Sabre it's really bad.
Answer: You can look into using CreatePassengerNameRQ, which simplifies even more the consumption and more advanced error handling.
https://developer.sabre.com/docs/soap_apis/air/book/create_passenger_name_record/
Answer: For the NO COMBINABLE FARES FOR CLASS USED, that is because you tried to price an itinerary that could not be priced.
When you request NN, that request is sent to the airline, so before they respond you don't have a confirmed itinerary, which is a requirement for most fares and that is likely the situation here.
Now, if you see the service response, you'll see that the status all segments have is UC, which is unable to confirm. This would trigger another error at the time of pricing, something line UC STATUS NOT ALLOWED.
Please check what I mentioned about HaltOnStatus in this other thread:
https://stackoverflow.com/a/42250758/3701641
The CHECK ITINERARY error is likely related to the same situation, the UC status on the itinerary.
Comment: Hello Wisdoom, i have changed my request to EnhancedAirBook using HaltOnStatus in order to wait airline response, may i share with you this new information trough pastebin?? Or may be i need to edit may question?? In this case i'm getting other errors...
Comment: If you are getting other errors, then it might be better to ask another question with that error.


(VMware) esxcli software vib update -n xxx, which vib version is selected for the module xxx

Question: Although I have read VMware's official blog post http://blogs.vmware.com/vsphere/2013/10/are-esxi-patches-cumulative.html very carefully, there is still quite some mist.
Now I ask one concise question here. On a pristine ESXi 5.0 machine, I update it like this:
$ esxcli software vib update -n esx-base -d /vmfs/volumes/chj1-datastore1/esxi-patch/update-from-esxi5.0-5.0_update03.zip
Installation Result
   Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
   Reboot Required: true
   VIBs Installed: VMware_bootbank_esx-base_5.0.0-3.41.1311175
   VIBs Removed: VMware_bootbank_esx-base_5.0.0-0.0.469512
   VIBs Skipped:

My question is: There are two versions for esx-base module inside patch archive update-from-esxi5.0-5.0_update03.zip ,

VMware_bootbank_esx-base_5.0.0-3.41.1311175.vib
VMware_bootbank_esx-base_5.0.0-2.38.1311177.vib

Then why is the 1311175 one used instead of the 1311177 one?
I know I can use esxcli software profile update to explicitly select the 1311177 one, however, I just want to know how esxcli software vib update deals with different profiles defined inside the patch archive.
Answer: The "esxcli software vib update" command will by default pick the latest version of a VIB package, and if you carefully look at the full version number (not only the last segment that is the build number) then you will see that 5.0.0-3.41.1311175 is really a higher version than 5.0.0-2.38.1311177 (because 5.0.0-3... > 5.0.0-2...).
The reason why there are two different versions of esx-base in the U3 bundle is that VMware differentiates between security-only bug fixes and functional bug fixes. The version 5.0.0-2.38.1311177 of esx-base includes only the security fixes whereas 5.0.0-3.41.1311175 includes both functional and security fixes. So, you will want to install the latter!
BTW, you really should not update ESXi by applying individual VIBs, but use
esxcli software profile update ...

With
esxcli software sources profile list -d /path/to/bundle.zip

you can check what image profiles are in the bundle. In your case there is

ESXi-5.0.0-20131002001-standard (with functional and security fixes) and
ESXi-5.0.0-20131001001s-standard (with security-only fixes)

and you want to install the first one with
esxcli software profile update -d /path/to/bundle.zip -p ESXi-5.0.0-20131002001-standard

This will ensure that you do not only get the esx-base package updated, but also all other VIBs that are updated with the U3 bundle.
You can check what VIBs are updated with each VMware patch bundle by looking at my spreadsheet at http://vibmatrix.v-front.de.
Comment: Thank you for your great explanation on your website which even surpasses the VMware official blog on this topic. But could you tell me how do you get that conclusion 5.0.0-3.41 will be preferred over 5.0.0-3.38(due to 41>38), I mean, any VMware official info documenting this?
Comment: Please note it's 5.0.0-**3**.41 vs. 5.0.0-**2**.38. I'm not aware of a VMware document about these version strings, just about general info on this topic (e.g. http://en.wikipedia.org/wiki/Software_versioning). The scheme here obviously is ESXiVersion-PackageVersion. ESXiVersion has the format major.minor.maintenance (5.0.0) and PackageVersion is major.minor.buildno (3.41.1311175 vs. 2.38.1311177), but this is not really uniform across all vendors and VIBs. As a general guide line you just read the version strings from left to right and compare the first section that differs (here: 3 > 2).


Spring cloud stream not send message to Kafka when declare producer and consumer in the same application

Question: Currently i'm have producer and consumer configure in the same Spring Boot Application, but it very weird that the Spring cloud stream firing the message not go through the Kafka (I'm monitor the message with kafka-console-consumer), but the consumer still receive the message (using same thread as producer).
And if i remove the consumerHandler (@StreamListener) in the Application, the producer successfully send the message to the Kafka.
Is there any configuration for this? I need the Spring cloud stream send message to the Kafka by default.
Producer and Consumer Configure:
<code>@Component
public interface NotificationProcessor {

    String EMAIL_NOTIFICATION = "email-notification";
    @Input(EMAIL_NOTIFICATION)
    SubscribableChannel receiveEmail();
    @Output(EMAIL_NOTIFICATION)
    MessageChannel sendEmail();
}
</code>
Here is some of my configuration:
<code>spring:
  cloud:
    stream:
      kafka:
        binder:
          autoAddPartitions: true
          brokers: ${KAFKA_BROKERS:localhost:9092}
          auto-create-topics: true
          configuration:
            auto.offset.reset: latest
      bindings:
        email-notification:
          group: ${EMAIL_GROUP:email-group-notification}
          destination: ${EMAIL_TOPIC:email-notification}
          contentType: application/json
          producer:
            partitionCount: 9
          consumer:
            partitioned: true
            concurrency: 3
      instance-count: 1
      instance-index: 0
</code>
An API To Trigger Send Message:
<code>@RestController
@RequestMapping("/api")
public class TestResource {
    private final Logger log = LoggerFactory.getLogger(TestResource.class);

    private final NotificationProcessor notificationProcessor;
    public TestResource(NotificationProcessor notificationProcessor) {
        this.notificationProcessor = notificationProcessor;
    }

    @ApiOperation(value = "Test api")
    @GetMapping(value = "/send-email2", produces = APPLICATION_JSON_VALUE)
    public ResponseEntity<Boolean> test2() {
        EmailMessage test =  EmailMessage.builder()
                .to(Arrays.asList(Receiver.builder().email("email@example.com").build())
                ).type(EContentType.JSON)
                .build();
        log.info("send email message to kafka");
        notificationProcessor.sendEmail().send(MessageBuilder.withPayload(test).build());
        return ResponseEntity.ok(Boolean.TRUE);
    }
}
</code>
And Consumer Handler:
<code>@EnableBinding(NotificationProcessor.class)
public class NotificationProducer {

    private final Logger log = LoggerFactory.getLogger(NotificationProducer.class);

    public NotificationProducer(){}

    @StreamListener(NotificationProcessor.EMAIL_NOTIFICATION)
    public void receiveEmail(@Payload Message<EmailMessage> message)  {
        log.info("Receive email message from kafka");
        EmailMessage emailMessage = message.getPayload();
    }
}
</code>
Comment: how many partitions do you have? while connecting to kafka-console-consumer are you using the same consumer group?
Comment: as my config, i have 9 partitions for this topic, when i use kafka-console-consumer, i only view the message in the topic, im not define consumer group in it. "kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic email-notification --from-beginning" here is the cmd to view the message in topic
Comment: Why are you double posting - https://stackoverflow.com/questions/66719243/send-message-with-spring-cloud-stream-kafka-not-async?
Answer: It is not clear from the provided information where are you sending message to. . . what channel? Channels are internal and direct by default so if you are sending to the same channel to which you are subscribing you completely bypassing the message broker (i.e., Kafka). That would explain both symptoms (no broker and the same thread).
That said, the annotation-based configuration model has been deprecated. For the past several years we're fully migrated to functional programming model which is much simpler and also designed to help you to not think about internal implementation such as channels, since they are really for internal use (bridge between your code and the broker adapters).
There is also a new component that would allow you to send messages to a broker specifically designed for scenarios like the one you have - StreamBridge.
Anyway, give it a look and consider refactor your application. At the very least make sure you are sending to the channel that is bound to a broker destination and subscribe to another channel that is bound to the same destination, thus ensuring that roundtrip to the broker happens.
Last but not least, I am still puzzled as to why you need to send to the broker and then subscribe to it in the same application? Why the overhead of networking?


What is the function of C#7 in the key of D?

Question: I'm trying to understand function of a chord in Miguel Llobet's arrangement of Canço del Lladre. I marked my interpretation of the chords in the excerpt below. The chord symbols in parenthesis are signalized just by a single note, so they are not really played, they are rather the chords I would imagine there to be if I were to harmonize it (though I'm really unsure about G).
My question is about the chord C# in measure 5. It appears to me a dominant chord (I could easily extend it to C#7, or maybe even C#7b9). What is its harmonic function?
By ear I recognize a similarity to diminished common tone resolution, but the played chord is a C# triad, not a diminished one! Perhaps the spelling of F instead of E# is some hint, but I fail to recognize it.

The respective fragment can be found at 0:11 in this recording
Comment: @piiperiReinstateMonica I actually found that various recordings vary at this very place, but the way shown in my score is the most frequent. I changed the recording example to Bream's.
Comment: If we leave out the D note from the chord, that changes the canonical stack-of-thirds naming from "D dim (maj7) / F" to "C# / E#". But do you really need a "function", can't you invent your own concepts for your own needs? What does the chord feel like doing to you, what does it seem to do? It leads very nicely to the Em7, doesn't it? Where else could it have lead - have you tried replacing the Em7 with different alternatives? If your role in this is only to mechanically play it, you don't need to know a "function". So I suppose you want to do something more.
Comment: It doesn't sound like C#7, it sounds like a dim chord. It sounds like a C# melody note is being accompanied by a chord progression D/F# - Ddim/F - Em7 - A7. There is a voice leading perspective, with a descending bass F# - F - E. If you make all chord have four notes, it's F#-(D)-A-D to F-D-Ab-C# to E-D-G-B. Didn't we just have a question about something like this,  _planing_ was suggested as one possible official world view, maybe _tritone substitution_ or _secondary dominant_, etc. the same thing as always, "whose subjective perspective gets declared as the real correct only truth".
Comment: @piiperiReinstateMonica hmm, that would make it Domaj7, what a chord! But yes, then it can be then interpret as some form of V/V.
Comment: I tried to say that if we're talking about the sound on the video, the question is based on the wrong assumption, you could transcribe the chord under the melody note as a dim chord, but calling it C#7 is just wrong IMO. And if you want to see it as a V of something, it would be like a V of _ii_ if it's in D, because it leads to Em. But substituting it with B7 doesn't give the same feeling IMO. If you want to see a stack of thirds, then it would be an inversion of a D dim maj7. The guitar isn't playing all the notes at the same time anyway, so it leaves something for imagination.
Comment: @piiperiReinstateMonica ah, now I notice the recording is slightly different from the score (she plays D in the middle voice, while the score has C#). I need to look for more sources. No, indeed it doesn't sound to me like V/ii.
Comment: The fact that the chord CAN be replaced with "D dim (maj7) / F" without anyone noticing, doesn't that tell something about this situation? How can leaving out the D note change the enharmonic spelling from F to E#? Theory is just talking about music, theory is not music itself. Music itself is ambiguous, subjective, culturally dependent, and its descriptions are approximations for purposes of communication, reasoning and handling practical situations. What is your practical situation - what do you want to be able to do, and how should these theoretical descriptions help in doing it?
Comment: @piiperiReinstateMonica Thanks, good questions: 1. _What do you want to be able to do_ – I want to understand what's going on there to easier recognize similar progressions in other compositions, and to apply it in my own. 2. _culturally dependent/Do you really need a function?/Can't you invent your own concepts?_ – this harmony appears to me like well fitting in western functional harmony, and I expect it to be explainable with its language. Yes, I could invent my own way to describe it, but it would feel like throwing away several hundreds years of development of theory for this style of mus
Answer: The performance is different than the notated score, but the question in the title likely remains.
This C♯7 points suggests a resolution to F♯. In the key of D, that F♯m chord is iii, so this C♯7 is conceptualized as a V7/iii.
But the C♯7 doesn't resolve to F♯m, it resolves to D instead. This is because, instead of this being a brief V–i resolution towards F♯, it's actually a deceptive resolution from V to VI in the orbit of F♯.
In other words, the C♯7 is V of F♯, and the Ds (suggesting a DM chord) is VI of F♯. Thus these two chords are V–VI in the temporary key of iii (F♯).
Comment: I realize the performance is probably not the standard one, I updated the recording example, though I don't think it matters. With the D note it is C#(add b9), without it it's just C#, but it's essentially the same dominant chord.
Answer: If the notation is correct, it's D major down a semitone. A literal transposition of the D chord that starts the bar.  It planes nicely up to D major (surely a better interpretation of the octave D notes than G major?)  The chordal equivalent of an unprepared appoggiatura.  As it contains the leading note, there's something of a dominant-tonic feel - it has much of the function of an A7 dominant - but it ISN'T an A7, and we shouldn't force an analysis that tries to make it be one!


Swing-Identify a line from multiple lines

Question: I am drawing lots of lines which can move,resize.But,once I click on previously created lines its not moving.Only the latest line created is moving.Any suggestions so that all of my lines move at anytime.
MouseAdapter mouseAdapter = new MouseAdapter() {

        public void mousePressed(MouseEvent e) {
            Rectangle rec = new Rectangle(e.getX(), e.getY(), 50, 50);
            prevPoint = e.getPoint();
            updateAction(e);
            ignoreMoves = true;

            System.out.println("Size:"+shapes.size());

            for (Shape shape : shapes) {
                if(shape.contains(prevPoint)){
                    System.out.println("Clicked Position is within a shape");
                    currentShape=shape;
                }
                else{
                    System.out.println("Clicked Position NOT within a shape");
                }
            }
            repaint();
        }

        public void mouseDragged(MouseEvent e) {
            System.out.println("mouseDragged action:" + action);
            if (action != null) {
                switch (action) {
                case Move: {
                    //System.out.println("Move");
                    int dx = 0;
                    int dy = 0;

                    dx = (int) (prevPoint.x - e.getPoint().getX());
                    dy = (int) (prevPoint.y - e.getPoint().getY());

                    Line2D shape = ( Line2D ) currentShape;

                    int x1 = (int) (shape.getX1() - dx);
                    int y1 = (int) (shape.getY1() - dy);

                    int x2 = (int) (shape.getX2() - dx);
                    int y2 = (int) (shape.getY2() - dy);

                    Point startPoint = new Point(x1, y1);
                    Point endPoint = new Point(x2, y2);

                    if (shape != null) {
                        shape.setLine(startPoint, endPoint);
                        prevPoint = e.getPoint();
                        repaint();
                    }
                }
                    break;
                case ResizeEast: {
                      Line2D shape = ( Line2D ) currentShape;
                    Point endPointLine = e.getPoint();
                    shape.setLine(shape.getP1(), endPointLine);
                    repaint();
                }
                    break;
                }
            }
        }

        public void mouseMoved(MouseEvent e) {
            if (!ignoreMoves) {
                updateAction(e);
            }
        };

        protected void updateAction(MouseEvent e) {
            int x = e.getX();
            int y = e.getY();

            Point clickedPoint = new Point(x, y);

            int width = 0;
            int height = 0;

            double startPointX = 0;
            double startPointY = 0;
            double endPointX = 0;
            double endPointY = 0;

            if (shapes != null && shapes.size() > 0) {
                  Line2D shape = ( Line2D ) currentShape;

                Line2D line = (Line2D) shape;
                startPointX = line.getX1();
                startPointY = line.getY1();
                endPointX = line.getX2();
                endPointY = line.getY2();

                Rectangle rect = shape.getBounds();
                width = rect.width;
                height = rect.height;

                if (x > endPointX - 5) {
                    action = MouseAction.ResizeEast;
                } else if (rect.contains(clickedPoint)) {
                    action = MouseAction.Move;
                } else {
                    action = null;
                }
            }

            if (action != null) {
                setCursor(action.getCursor());
            } else {
                setCursor(null);
            }
        }

    };
    protected void paintComponent(Graphics g) {
        //System.out.println("Paint");

        Graphics2D g2d = (Graphics2D) g;
        g2d.setPaint(Color.BLACK);

        if (shapes != null && shapes.size() > 0) {

            for (Shape shape : shapes) {
                g2d.draw(shape);
            }
        } else {
            System.out.println("Shapes is Null");
        }
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        Point startPoint = new Point(50, 200);
        Point endPoint = new Point(100, 200);
        currentShape = new Line2D.Double(startPoint, endPoint);
        shapes.add(currentShape);
        repaint();
    }

Answer: Your problem is with Line2D.contains
If you read the documentation, it says:

Returns: false because a Line2D contains no area.

My recommended solution would be to create rectangle2D's instead of Line2Ds, where the width or height is essentially the Stroke size (see Stroke). Also, you've have to rotate your Rectangle2Ds. The easiest way to do that may be to transform them into Areas (see Area), which was what I used when I created a similar type of shape container
Comment: I also want to vary the width of the Line with the motion of the mouse in addition to rotation..can this also be achieved with your approach...?also,what would be the best approach for all this..viz rotation and varying width (with mouse) and setting properties on each line.
Comment: @RajTrivedi why don't you stick to your original objectives until you get that working?
Comment: Rectangle2D I cannot use as I need to draw an edge between 2 points...Rectangle2D takes one point and width which does not help my cause..


JSP exception in WSO2 IS 5.1.0

Question: I tried following this link.
http://wso2.com/library/tutorials/2016/02/tutorial-how-to-enable-role-based-access-control-for-wso2-api-manager-using-xacml/
I am stuck at a place where there is figure 6 shown.
I am using IS 5.1.0
When I click on this search button there is an exception thrown in the backend on the jsp page.
<code>[2016-05-27 11:18:17,262] ERROR {org.apache.catalina.core.ApplicationDispatcher} -  Servlet.service() for servlet bridgeservlet threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 384 in the jsp file: /entitlement/select-attribute.jspStacktrace:
        at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
        at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
        at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:485)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:379)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)
        at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.wso2.carbon.ui.JspServlet.service(JspServlet.java:155)
        at org.wso2.carbon.ui.TilesJspServlet.service(TilesJspServlet.java:80)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.eclipse.equinox.http.helper.ContextPathServletAdaptor.service(ContextPathServletAdaptor.java:37)
        at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:604)
        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:543)
        at org.eclipse.equinox.http.servlet.internal.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:37)
        at org.eclipse.equinox.http.helper.ContextPathServletAdaptor$RequestDispatcherAdaptor.include(ContextPathServletAdaptor.java:369)
        at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954)
        at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:688)
        at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:682)
        at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.apache.tiles.jsp.context.JspUtil.doInclude(JspUtil.java:87)
        at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:88)
        at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:82)
        at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:465)
        at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:140)
        at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:117)
        at org.apache.tiles.jsp.taglib.RenderTagSupport.execute(RenderTagSupport.java:171)
        at org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(RoleSecurityTagSupport.java:75)
        at org.apache.tiles.jsp.taglib.ContainerTagSupport.doEndTag(ContainerTagSupport.java:80)
        at org.apache.jsp.admin.layout.template_jsp._jspx_meth_tiles_005finsertAttribute_005f7(template_jsp.java:640)
        at org.apache.jsp.admin.layout.template_jsp._jspService(template_jsp.java:356)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.wso2.carbon.ui.JspServlet.service(JspServlet.java:155)
        at org.wso2.carbon.ui.TilesJspServlet.service(TilesJspServlet.java:80)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.eclipse.equinox.http.helper.ContextPathServletAdaptor.service(ContextPathServletAdaptor.java:37)
        at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
        at org.eclipse.equinox.http.servlet.internal.RequestDispatcherAdaptor.forward(RequestDispatcherAdaptor.java:30)
        at org.eclipse.equinox.http.helper.ContextPathServletAdaptor$RequestDispatcherAdaptor.forward(ContextPathServletAdaptor.java:362)
        at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:198)
        at org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:185)
        at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:419)
        at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:370)
        at org.wso2.carbon.ui.action.ActionHelper.render(ActionHelper.java:52)
        at org.wso2.carbon.ui.TilesJspServlet.service(TilesJspServlet.java:101)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.eclipse.equinox.http.helper.ContextPathServletAdaptor.service(ContextPathServletAdaptor.java:37)
        at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.wso2.carbon.ui.filters.CSRFPreventionFilter.doFilter(CSRFPreventionFilter.java:88)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.wso2.carbon.ui.filters.CRLFPreventionFilter.doFilter(CRLFPreventionFilter.java:59)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99)
        at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47)
        at org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:57)
        at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47)
        at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62)
        at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:159)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
        at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1739)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1698)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
[2016-05-27 11:18:17,503] ERROR {org.apache.catalina.core.ApplicationDispatcher} -  Servlet.service() for servlet bridgeservlet threw exception
java.lang.ClassNotFoundException: org.apache.jsp.entitlement.select_002dattribute_jsp
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
        at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
        at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:121)
        at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:172)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.wso2.carbon.ui.JspServlet.service(JspServlet.java:155)
        at org.wso2.carbon.ui.TilesJspServlet.service(TilesJspServlet.java:80)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.eclipse.equinox.http.helper.ContextPathServletAdaptor.service(ContextPathServletAdaptor.java:37)
        at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:604)
        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:543)
        at org.eclipse.equinox.http.servlet.internal.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:37)
        at org.eclipse.equinox.http.helper.ContextPathServletAdaptor$RequestDispatcherAdaptor.include(ContextPathServletAdaptor.java:369)
        at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954)
        at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:656)
        at org.apache.tiles.jsp.context.JspUtil.doInclude(JspUtil.java:98)
        at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:88)
        at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:82)
        at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:465)
        at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:140)
        at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:117)
        at org.apache.tiles.jsp.taglib.RenderTagSupport.execute(RenderTagSupport.java:171)
        at org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(RoleSecurityTagSupport.java:75)
        at org.apache.tiles.jsp.taglib.ContainerTagSupport.doEndTag(ContainerTagSupport.java:80)
        at org.apache.jsp.admin.layout.template_jsp._jspx_meth_tiles_005finsertAttribute_005f7(template_jsp.java:640)
        at org.apache.jsp.admin.layout.template_jsp._jspService(template_jsp.java:356)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.wso2.carbon.ui.JspServlet.service(JspServlet.java:155)
        at org.wso2.carbon.ui.TilesJspServlet.service(TilesJspServlet.java:80)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.eclipse.equinox.http.helper.ContextPathServletAdaptor.service(ContextPathServletAdaptor.java:37)
        at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
        at org.eclipse.equinox.http.servlet.internal.RequestDispatcherAdaptor.forward(RequestDispatcherAdaptor.java:30)
        at org.eclipse.equinox.http.helper.ContextPathServletAdaptor$RequestDispatcherAdaptor.forward(ContextPathServletAdaptor.java:362)
        at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:198)
        at org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:185)
        at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:419)
        at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:370)
        at org.wso2.carbon.ui.action.ActionHelper.render(ActionHelper.java:52)
        at org.wso2.carbon.ui.TilesJspServlet.service(TilesJspServlet.java:101)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.eclipse.equinox.http.helper.ContextPathServletAdaptor.service(ContextPathServletAdaptor.java:37)
        at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
        at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.wso2.carbon.ui.filters.CSRFPreventionFilter.doFilter(CSRFPreventionFilter.java:88)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.wso2.carbon.ui.filters.CRLFPreventionFilter.doFilter(CRLFPreventionFilter.java:59)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99)
        at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47)
        at org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:57)
        at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47)
        at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62)
        at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:159)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
        at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1739)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1698)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
</code>
Comment: This is fixed in IS 5.2.0-beta
Answer: I solved the issue repacking the bugged jar.
Download it from here
You have to put the linked jar in this path: $wso2is-5.1.0/repository/components/plugins
Stop the WSO2 carbon server, put the jar and clean the working dir. At the end you'll be free of the bug!

JSP exception in WSO2 IS 5.1.0


How to change a boolean value without knowing what it is

Question: I am practicing Mongoose after learning SQL
Ask me a boolean value that I want to change, for example status
from false to true and vice versa.
I want the move to be dynamic
In SQL I would do this:
update somting set status = !status where id ....

How am I supposed to do this in Mongoose
In the meantime, what I tried is:
const task = await Task.findByIdAndUpdate(id, {
            $set: { status : !status }
        })

For very obvious reasons this will not work
Comment: It should work, because your requirement is same, see [this answer](https://stackoverflow.com/a/66932921/8987128) in same question, there is playground also you can run and check the query.
Comment: No, I tried what's in the solution you sent, but it doesn't work, the server just crashes
Comment: Yes, that solved the problem for me. Thank you very much, but there are many things that are not understood
Answer: you can use $not operator to invert the boolean values.
Query to invert the boolean value is,
db.collection.findOneAndUpdate({_id:id},[{$set:{bool:{$not:"$bool"}}}])`


Dashboard display two blocks pagination

Question: I have two block views in my Drupal 7 site dashboard: One is a custom module and one is a normal views block. Both are assigned to the dashboard.
The custom module has a table in the block_view hook. It also has a pagination in it. The second one is generated via the Views module, and also has a table with pagination.
When I go to the second page or to any page of the first table, the second table is updated too.

I made the view based table's pagination AJAX based, but I suppose it is not to right way.
How do I solve this problem?
Comment: May be useful: http://drupal.stackexchange.com/questions/26670/multiple-blocks-on-single-page-pager-issue
Answer: You have to change the ID of one of the pagers. For the Views module is under Pager setting, Field pager ID.
The description for that field says:

Unless you're experiencing problems with pagers related to this view, you should leave this at 0. If using multiple pagers on one page you may need to set this number to a higher value so as not to conflict within the ?page= array. Large values will add a lot of commas to your URLs, so avoid if possible.

Dashboard display two blocks pagination


How to print url arguments in headers view

Question: I have a View and inside it I have and Attachment display. In this attachment I set a Header where I need to print the 2nd url argument. How can I do this? With globals?

Thanks
Answer: <?php print arg(1); ?>

See: arg
Arg can be used to get the url arguments. It's 0 indexed, so 0 will give the first url argument.
Notice, when using url aliases that arg will bring the internal url arguments (the original path).


How do I programmatically load a custom block?

Question: I created a new custom block type in /admin/structure/block/block-content/types to which I added two fields. Then, I created a block with that block type.
How can I programmatically load this block via code?
How do I get the values of its fields (x, an image field, and y, a text field)?
I tried this code, but it didn't work.
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityManager()->getViewBuilder('block_content')->view($block);

Answer: Place the block in the disabled section at admin/structure/block, this creates a block instance with your block_content type, give it a nice easy machine name to remember.

By placing it in the disabled section, it won't show up, until you load it programatically.
Then using your machine name:
$machine_name = 'myblock';

$block = \Drupal::entityTypeManager()
  ->getStorage('block')
  ->load($machine_name);
if (!empty($block)) {
  $block_content = \Drupal::entityTypeManager()
    ->getViewBuilder('block')
    ->view($block);

  $pre_render = $block_content;
}

If you really want to get the rendered fields, you can do:
$render = \Drupal::entityTypeManager()
  ->getViewBuilder('block')
  ->build($pre_render);

But it is more standard practice to use Drupal's formatters and such and perhaps a custom template, rather than building the block and extracting elements from the rendered render array.
Answer: There are two questions. How to load and render a configured block  is answered perfectly by @oknate.
For the second question, How do I get the values of its fields (x, an image field, and y, a text field)? That's easy, because you've already loaded the block content entity, where the fields are stored in the database.
$block = \Drupal\block_content\Entity\BlockContent::load($bid);

You can access the value from the text field
$text = $block->field_y->value;

and get the url from the image field.
$image_url = file_create_url($block->field_x->entity->uri->value);

Comment: $bid is the block content id. You see this in the url: /block/[bid]. This is the same as $nid is for a node: /node/[nid]
Comment: See http://drupal.stackexchange.com/questions/216672/how-to-get-a-field-value-of-custom-block
Answer: Try this code by including EntityInterface:
// Block
use Drupal\Core\Entity\EntityInterface;
// the last part of the parameter is the block id
$block = \Drupal\block\Entity\Block::load('yourblockid');
$block_content = \Drupal::entityManager()
  ->getViewBuilder('block')
  ->view($block);
\Drupal::service('renderer')->renderRoot($block_content);

Answer: $block = \Drupal::service('entity.repository')->loadEntityByUuid('block_content', $uuid);
      if (!empty($block)) {
        $recArticleAdView = \Drupal::entityTypeManager()
          ->getViewBuilder('block_content')
          ->view($block);
        $rendered = \Drupal::service('renderer')->render($recArticleAdView);
        $response = new CacheableResponse($rendered);
        $response->addCacheableDependency(CacheableMetadata::createFromRenderArray($recArticleAdView));
        $variables['content']['sponsored_content'] = Markup::create(trim(strip_tags($response->getContent(), '
')));
      }


RAID 1, mixed size drives?

Question: Hi I have a couple of windows systems that I wanted to install RAID 1 onto, I have purchased PCI express controller cards and extra drives, but here I made a mistake, one PC has an existing 3.5" 160Gb SATA drive, and by mistake I bought a 2.5" 160Gb SATA to pair with this disk.
Does anyone know if this will work? or will the different disk sizes cause an issue with the RAID any comments will be much appreciated.
Comment: They're both 160GB drives...why would the OS or controller care if they're 3.5 or 2.5 inch drives physically? If anything you should worry about the drive speed and formatting.
Comment: I will format the drives the same, would different drive speeds cause an issue?
Comment: well, your performance could obviously suffer.
Answer: It will work normally. But it is preferred that your disks as similar as possible.
Answer: RAID-1 will work, but you will only be able to make a RAID volume up to the size of the smallest drive (or probably slightly smaller).
In practice, it's generally worth making RAID volumes slightly smaller than the drive itself.  I had one issue where I had to replace a Fujitsu MAU3147NP with a MAX3147NP and the MAX3147 was slightly too small to add to the RAID group.  I had to back up and rebuild the entire array.

RAID 1, mixed size drives?


Difference of two dates

Question: I need to get difference between below 2 dates. Both dates are in String format.
String sDate1 = Thu Jun 26 13:45:32 IST 2018;
String sDate2 = Thu Jul 16 03:25:37 IST 2018;

Date date1 = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy").parse(sDate1);
Date date2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy").parse(sDate2)
long dateDiff2 = date2.getTime() - date1.getTime();

Comment: And your question is?
Comment: And what is your problem? It looks like you already have a difference in milliseconds.
Comment: @TimBiegeleisen The primary reasons for the downvotes come down to the fact that the question is common enough to have a number of available answers AND you should NEVER do simply mathematical calculations on date/time values, there are too many rules governing how these calculations should be done not to use an appropriate API or library
Comment: @Samankumara *is not working* is not an error description. Add the result you get and the expected result
Comment: @Samankumara So, you have two questions.  1- How to convert a string value to a date value and 2- How to calculate the difference between those date values. Both questions are common and have been asked before
Comment: Possible duplicate of [Difference between two DateTime objects in minutes](https://stackoverflow.com/questions/50884294/difference-between-two-datetime-objects-in-minutes)
Comment: Possible duplicate [Difference between two DateTime objects in minutes](https://stackoverflow.com/questions/50884294/difference-between-two-datetime-objects-in-minutes/50884318#50884318); [Java SimpleDateFormat format issue with yyyy](https://stackoverflow.com/questions/25776787/java-simpledateformat-format-issue-with-yyyy/25777559#25777559); [Java finding difference between times](https://stackoverflow.com/questions/32961391/java-finding-difference-between-times/32961667#32961667)
Comment: I don't see the reasons for the downvotes, but what is your question?  Your code actually looks fine to me.  There is also a Java 8 way of doing this now.
Comment: -2
down vote
favorite

I need to get difference between below 2 dates. Both dates are in String format.
Comment: but it is not working
Comment: @Samankumara in what way is it not working?
Comment: @MadProgrammer I'll agree with you on the grounds that the question shows zero research on SO.  But, maybe the OP wrote that code himself.  Oh well, water under the bridge :-)
Comment: It's working now, thank you
Comment: You should migrate to the newer date and time classes available in the `java.time` package. [Read more about it here.](https://docs.oracle.com/javase/tutorial/datetime/iso/legacy.html)
Comment: @Moia Not a duplicate of that. This Question is about moments, that Question is about `LocalDateTime` values (not moments).
Answer: Quote marks
You forgot the double-quote marks around your input strings.
java.time
You are using terrible old classes that were outmoded years ago by the java.time classes.
Parsing
Parse your input strings using DateTimeFormatter to get ZonedDateTime objects. Search Stack Overflow as this has been covered many times.
Elapsed
To calculate elapsed hours, minutes, and seconds, pass those ZonedDateTime objects to the Duration.between method. For years-months-days, use Period. Search Stack Overflow as this has been covered many times.
Answer: Try this:-
String sDate1 = Thu Jun 26 13:45:32 IST 2018;
String sDate2 = Thu Jul 16 03:25:37 IST 2018;

Date d1= new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy").parse(sDate1);
Date d2= new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy").parse(sDate2);
long diff = d2.getTime() - d1.getTime();
long diffSeconds = diff / 1000 % 60;
long diffMinutes = diff / (60 * 1000) % 60;
long diffHours = diff / (60 * 60 * 1000);
System.out.println("Time in seconds: " + diffSeconds + " seconds.");
System.out.println("Time in minutes: " + diffMinutes + " minutes.");
System.out.println("Time in hours: " + diffHours + " hours.");

Or you can use TimeUnit:-
long diffInSeconds = TimeUnit.MILLISECONDS.toSeconds(diff );
long diffInMinutes = TimeUnit.MILLISECONDS.toMinutes(diff );
long diffInHours = TimeUnit.MILLISECONDS.toHours(diff );

Comment: These terrible classes were supplanted years ago by the *java.time* classes. Poor advice in 2018.
Comment: I am agree with you but for bigners it is right way to do other wise he can use jodaTime also.
Comment: No, those classes are a *terrible* thing to show beginners, with a wretched design and awful hacks that will confound anyone trying to learn programming and OOP. And the *Joda-Time* project is now in maintenance mode, with its inventor having moved on to create *java.time*.

Difference of two dates


Interpreting bias variance with accuracy in learning curves

Question: I plotted the accuracy of a Decision Tree model with varying depths.
I see that as the depth increases, the delta between the training and test set starts to increase to a point where they never touch.
I'm confused about how I interpret this in terms of bias/variance. Specifically, I think the bias increases because the tree is overfitting. But variance would stay the same because the test curve plateaus.
Answer: As the depth increases the bias is low, but the variance increases as the tree is particularly suited for the training data. The variance on the training data is less (as you trained for that). So you see for the training, accuracy is close to 1 always, but due to low bias and high variance for the test, the accuracy is stagnating at 0.8 and they never meet.


How can i create a view of all drupal commerce products with the orders they appear in?

Question: I try to create an administrative view which lists all products in my drupal commerce installation, where some cols should contain data from the orders in which they appear:
<code>PROD | PRICE | ORDERED
----------------------
one  | 12.-  | -
----------------------
two  | 10.-  | Pete P.
     |       | Anna D.
-----------------------
three ...
</code>
But as far as i can see, if i start a view of products, i have no relation to referencing line-items.
If i would start with line-items, i could not have products in my list, which appear in no orders...
Answer: Drupal Commerce does support some reverse reference relationships, but currently there is only a reverse relationship from products to nodes that reference them, not from products to line items that reference them. If I were you, I'd instead make the base table orders, because you can more easily establish relationships from orders to line items to products and get at the same fields that way. We use commerce_order as the base table for shopping cart Views, for example.
Comment: Yes, i thought about starting with orders, but that way i can't list the products that are in NO orders, see my example...
Maybe i can do a view of products, where one field is a view of orders?


How to redirect anonymous users to login page using Rules module?

Question: I'm using rules module with drupal 7 in order to redirect anonymous users to the login page, so I created a rule with react on event "Drupal is initializing", condition "User has role" with anonymous user and "Not site login url", then added an action "Page redirect" to site login url. When I tried to test the rule; drupal kept redirecting to the login page over over and over until apache server stopped working. Any recommendations.
Comment: can anonymous user explore site content? for what reason need to redirect login page?
Comment: anonymous users are not allowed to explore any site content and not allowed to register except with an invitation. Users have to login to use the site.
Comment: I don't understand this part "rule drupal kept redirecting to the login page without showing it."  Could you explain what you mean?  Otherwise I'm not sure I understand which part isn't working.
Comment: Well when I go to the homepage or any other page but not login page the rule works fine; its redirecting the user to the login page, however the browser keeps redirecting to login page over and over until apache stops working.
Comment: if anonymous users are not allowed to explore any site content, then remove permission to view content
Comment: @monymirza I didn't get what you mean by "remove permission to view content" I just want anonymous users to be redirected to login page every time they access the website
Comment: It sounds like the test in the rule for not being on the login page already is not working. Disable the rule and make a copy of it that instead of redirecting does some other action such as displaying a message, and see if the condition is working correctly.
Comment: Try to add "site:current-user:uid == 0" condition instead of checking a role.
Comment: @Leksat, thanks for you comment. Your solution will not change anything.
Answer: The way I solved it as follow:

Events: Drupal is initializing
Conditions:

User has role(s) - Parameter: User: [site:current-user], Roles: anonymous user
NOT Text comparison - Parameter: Text: [site:current-page:url], Matching text: user/login

Actions: Page redirect - Parameter: URL: user/login

Export rule as follow:
{ "rules_login" : {
    "LABEL" : "login",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "TAGS" : [ "login" ],
    "REQUIRES" : [ "rules" ],
    "ON" : { "init" : [] },
    "IF" : [
      { "user_has_role" : {
          "account" : [ "site:current-user" ],
          "roles" : { "value" : { "1" : "1" } }
        }
      },
      { "NOT text_matches" : { "text" : [ "site:current-page:url" ], "match" : "user\/login" } }
    ],
    "DO" : [ { "redirect" : { "url" : "user\/login" } } ]
  }
}

Comment: @TopTomato this is for drupal 7
Comment: i made an error and it is working.
Comment: @TopTomato Awesome! Glad it worked for you.
Answer: Go to /admin/people/permissions uncheck View published content for anonymous users

now go to /admin/config/system/site-information add 'user' in (access denied) page field
Comment: If someone has access denied does not mean they are not logged in.[See This Answer](http://drupal.stackexchange.com/a/224407/20563)
Comment: good work around, but I still need to show access denied page because not all users have the same permissions. I appreciate your help.
Comment: then remove 'user' from (access denied) page field at 2nd step
Comment: if I remove it; anonymous users can only see access denied without redirecting to the login page. I'm sure that there's a way I can do it in rules module
Comment: yes. further can be done by rules module. you can also do it via trigger core module.
Comment: I will look into trigger module, thanks for your help
Answer: I'm sure you can pull this off with rules, but it would be easy to do in your theme's template.php file as well.
Something like this should work:
global $user;
if ($user->uid == 0 && arg(0) != 'user' && arg(1) != 'login'){
  drupal_goto('user/login');
}

Or, if access to the user/registration & user/password pages is still wanted:
global $user;
if ($user->uid == 0 && arg(0) != 'user'){
  drupal_goto('user/login');
}

Comment: Thanks @Chance I already found this solution before I posted my question. I want to use rules module or at least understand why its not working with "Drupal is initializing"
Comment: @Chance, I'm curious. Where would this live within the .theme file?
Answer: The problem here is the event in question. Instead of Drupal is initializing, try Content is viewed.
Comment: I tried it before I post this question and it worked fine with me except with view pages, registration page, basically any page that is not node.
Answer: I know this is a post from two years ago.  However, the solution for redirecting an anonymous user to the user login page with rules is as follows:

event: System log entry is created
condition: User has role(s): anonymous
action: page redirect value: user

Hope this will help someone.
Comment: have you tried your solution before you post it here?


The jQuery file not getting loaded in Django

Question: I am trying to load the jQuery files to the Django. But its not working for me. When I write the code inside the script tag inside the Head it works perfectly. I wrote the code in a file called main.js

  <link rel="text/javascript" href="{% static 'js/main.js' %}">

This is my static path in settings
 STATIC_URL = '/static/'

How can I load the jQuery file in django?
Answer: HTML's link is used to load stylesheet -- CSS not JavaScript file.
You have to load javascript with script tag.
so like this:

REF: https://developer.mozilla.org/en/docs/Web/HTML/Element/script


How do I record Keyboard or guitar in Studio One?

Question: How can I record an instrument such as guitar or keyboard in Studio One? Not with a microphone but with a cable. I have a Rocksmith tone cable but would I need something like a MIDI
Comment: Not sure if this is a duplicate, but you can check ( https://music.stackexchange.com/search?q=DAW+ASIO4All ) for lots of discussion regarding recording interfaces and workflow
Answer: This will all depend on your hardware. For guitar you would connect to an audio port (or line in if you are amplifying before you get to your DAW platform) and for a keyboard you could use either audio or MIDI, depending on what you plan on doing.
The Rocksmith cable Is different again - it is a full audio to USB interface, and as long as you have the drivers, it can be used for your DAW.
Studio One can cope with all the audio or midi interfaces you are likely to come across, but this is dependent on the hardware platform you are using.


Integration using hyperbolic substitution

Question: I'm asked to integrate $\int{dx\over x^2 - 9}$ using hyperbolic substitution. Using the relation cosh^2-1 = sinh^2, I let x = 3cosh(u), and through simplification, arrived at $\int$ ${1\over 3 csch(u)}du$. I integrated and got $1\over 3$ln(tanh(${u \over 2}$)+c. This is where I'm stuck, as I don't know how to convert back into terms of 'x' from 'u'. If anyone could help me out, it would be much appreciated!
Thank you!
Comment: Look [here](http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference) to learn
Comment: you almost have it, but you have to enclose mathjax in dollar signs, for example `$1+1\ne2$` shows up as $1+1\ne2$
Comment: I think I've got it now, I was testing it to see if clicking "save" applied the edits (I quickly learned it did not haha)
Answer: best method is to use partial fractions
$$\begin{align}
\int\frac{dx}{x^2-9}dx\\=\frac{1}{6}\int\left(\frac{1}{x-3}-\frac{1}{x+3}\right)dx\\
=\frac{1}{6}(\ln|x-3|-\ln|x+3|)\\
=\frac{1}{6}\ln|(x-3)/(x+3)|+C
\end{align}$$
Comment: I realize that, this question requires me to use hyperbolic substitution for practice. Thank you though!
Answer: The most straightforward way to go is to apply inverse hyperbolic functions (similar to arcsine and friends).  Then \begin{align}
x &= 3 \cosh u  \\
\frac{x}{3} &= \cosh u  \\
\cosh^{-1} \left( \frac{x}{3} \right) &= u  \text{.}
\end{align}
Analogous to the inverse (circular) trigonometric functions, one should remember that this inverse function has a restricted domain, $[1,\infty)$, which can cause similar surprises.
Then it's useful to know the alternative forms of the arc-hyperbolic functions.  For arc hyperbolic cosine, you want $$ \cosh^{-1} \alpha = \ln(\alpha + \sqrt{\alpha^2 - 1})  $$
Comment: That makes sense, thank you so much!
Comment: I've followed your steps to the tee and understand all of them, but I'm not sure how to tie it in to tan(${u\over 2]
Comment: ** tanh(${u \over 2}$ sorry. Could you explain that to me?
Comment: Actually, I'm thinking I could use a hyperbolic half angle ID to pull it out of tanh and into cosh. Then, I could use the cosh value to relate it back into x. Does that seem logical?
Comment: You seem to be asking for $\tanh \frac{u}{2} = \tanh \frac{\cosh^{-1} (x/3)}{2}$.  Perhaps you mean to ask about half angle formulas for hyperbolic functions, for instance $\tanh \frac{u}{2} = \frac{\sinh u}{\cosh(u)+1} = \frac{\sinh(\cosh^{-1} (x/3))}{\cosh(\cosh^{-1} (x/3))+1}$.  Now set up your triangles the same way you would in trigonometry to deal with the analogous expressions $\sin \cos^{-1}(x/3)$ and $\cos \cos^{-1}(x/3)$.  (Note that these triangles have a point on a hyperbola, not on the unit circle.)
Comment: Will do, thanks for the guidance!


creating dynamic menu in JSF according to user credentials

Question: My question is how to dynamically create menu bar from the database according to user credential using JSF 2.0 ? kindly provide me some hints or links which can be of help. Thanks
Comment: @awesum, have you tried something?
Comment: There's plenty of help on this topic. Try reading this [post](http://stackoverflow.com/questions/4747321/render-jsf-component-based-on-user-role). User roles are your friends in this case.
Comment: Simply using the `rendered` attribute with one bean managing the user roles?
Comment: @Alexandre Lavoie How to do it? I have three tables in database

1)Menu

2)Users

3)menu_users
Answer: Have you considered using Third party component libraries with JSF.
You could go for Primefaces.
It has a different varieties of Menu Bars here.
Here using p:menu, you can create menu using Menumodel. that model can be changed from ManagedBean based on the user Privileges.
Here is the Primefaces Menu Model Example,where last Programmatic Menu is created using MenuModel.
Here is the Primefaces Blog Link.
Comment: @BalusC can u provide any help in this regard?
Comment: By dynamic menu , I mean a particular user should be shown some menu items or in other words he can navigate to some of the pages using menu bar
Comment: See the left correct symbol on the answer? @awesum click that. Accepting answer which helped you, will increase your reputation, too. You have 0% acceptance ratio, so improve it :)


Como verificar se um item já foi introduzido numa lista em c#

Question:
Existe a lista turmas
Dentro dessa lista eu coloco objectos do tipo turma
Cada objecto possui (string)nomeTurma.Text & um valor numérico (int)numericUpDown1.Value
Utilizo o método addTurma para colocar os objectos na lista turmas

<code>    public static List<turma> turmas = new List<turma>();

    public static void addTurma(turma x)
    {

        turmas.Add(x);

    }
 turma x = new turma(nomeTurma.Text,(int)numericUpDown1.Value);
 //Se nomeTurma.Text não exite na lista turmas
  {
  turma.addTurma(x);
  }
</code>

Quero apenas adicionar objectos do tipo turma que não tenham o mesmo nome ou seja, verificar se  (string)nomeTurma.Text já existe na lista turmas
Comment: Tem, use o .Any().
Comment: Vai ser algo assim: `bool existeNome = turmas.Any(p => p.Nome == nomeTurma.Text);`
Comment: Faz um for na lista e vê se existe comparando os dois, ve se existe se algum igual e controla com uma bool
Comment: Você pode também fazer um `If` caso não exista você adiciona, tipo:`if(!turmas.Any(p => p.Nome == nomeTurma.Text){...})`
Comment: @BrunoH. Não existe nenhuma outra forma, não tem tipo um metodo que já faça isso proprio das listas ?
Comment: @Francisco como uso o .Any ?
Comment: @AmadeuAntunes Linq para mim é igual regex, sei como funciona, mas não faço nem ideia de como usa kkkkkk De qualquer forma, você pode ver na documentação e talvez achar a expressão que precisa para fazer essa verificação: https://msdn.microsoft.com/pt-br/library/bb534972(v=vs.110).aspx
Comment: https://stackoverflow.com/questions/45400646/how-to-check-if-item-already-is-in-list-c-sharp/45400737#45400737  ajudaram me assim
Comment: Já esta aberta a pergunta ^^
Answer: <code>if(turmas.Any(t => t.Text == text))
{

}
</code>


How can I ensure that availability calendar only show one month at a time?

Question: I'm displaying a calendar on a basic page and I have specified that I want the monthly views to show only 1 at a time.  1 per col / 1 per row.
For some reason 3 are displayed.
my calendar can be seen at seosolutions.london

How can I only display 1 month at a time? can I hard code this anywhere?
Answer: I found a css fix for this:
availability_calendar.base.css
adding
.cal-viewport { width: 220px !important; }