text:
Q: Sabre AirTicketLLSRQ error: PNR HAS BEEN UPDATED-IGN AND RETRY-0049 I'm trying to do Issue Air Ticket workflow, but AirTicketLLSRQ returns error:
PNR HAS BEEN UPDATED-IGN AND RETRY-0049

Before this, I'm creating PNR with PassengerDetailsRQ method.
Request:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Header>
        <MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader">
            <From>
                <PartyId>WebServiceClient</PartyId>
            </From>
            <To>
                <PartyId>WebServiceSupplier</PartyId>
            </To>
            <CPAId>4PFI</CPAId>
            <ConversationId>SWS-Test-4PFI</ConversationId>
            <Service>PassengerDetails</Service>
            <Action>PassengerDetailsRQ</Action>
            <MessageData>
                <MessageId>9314594d-6c40-406b-9029-b887b13906b6</MessageId>
                <Timestamp>2017-07-11T08:57:38Z</Timestamp>
            </MessageData>
        </MessageHeader>
        <Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">
            <BinarySecurityToken>
                Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/CERTG!ICESMSLB\/CRT.LB!-3255696707179766905!1188118!0
            </BinarySecurityToken>
        </Security>
    </soap:Header>
    <soap:Body>
        <PassengerDetailsRQ xmlns="http://services.sabre.com/sp/pd/v3_3" version="3.3.0" IgnoreOnError="false"
                            HaltOnError="false">
            <PostProcessing IgnoreAfter="false" RedisplayReservation="true">
                <EndTransactionRQ>
                    <EndTransaction Ind="true">
                        <Email Ind="true">
                            <Itinerary Ind="true">
                                <PDF Ind="true"/>
                                <Segment Number="1"/>
                            </Itinerary>
                        </Email>
                    </EndTransaction>
                    <Source ReceivedFrom="TEST"/>
                </EndTransactionRQ>
            </PostProcessing>
            <SpecialReqDetails>
                <AddRemarkRQ>
                    <RemarkInfo>
                        <Remark Code="H" SegmentNumber="1" Type="General">
                            <Text>TEXT</Text>
                        </Remark>
                    </RemarkInfo>
                </AddRemarkRQ>
                <SpecialServiceRQ>
                    <SpecialServiceInfo>
                        <AdvancePassenger SegmentNumber="A">
                            <!--  2. a legal LLS request  -->
                            <Document ExpirationDate="2018-05-26" Number="1234567890" Type="P">
                                <IssueCountry>FR</IssueCountry>
                                <NationalityCountry>FR</NationalityCountry>
                            </Document>
                            <PersonName DateOfBirth="1980-12-02" Gender="M" NameNumber="1.1" DocumentHolder="true">
                                <GivenName>JAMES</GivenName>
                                <MiddleName>MALCOLM</MiddleName>
                                <Surname>GREEN</Surname>
                            </PersonName>
                            <VendorPrefs>
                                <Airline Hosted="false"/>
                            </VendorPrefs>
                        </AdvancePassenger>
                        <SecureFlight SegmentNumber="A">
                            <PersonName DateOfBirth="1980-12-02" Gender="M" NameNumber="1.1">
                                <GivenName>JAMES</GivenName>
                                <Surname>GREEN</Surname>
                            </PersonName>
                        </SecureFlight>
                    </SpecialServiceInfo>
                </SpecialServiceRQ>
            </SpecialReqDetails>
            <TravelItineraryAddInfoRQ>
                <AgencyInfo>
                    <Address>
                        <AddressLine>SABRE TRAVEL</AddressLine>
                        <CityName>SOUTHLAKE</CityName>
                        <CountryCode>US</CountryCode>
                        <PostalCode>76092</PostalCode>
                        <StateCountyProv StateCode="TX"/>
                        <StreetNmbr>3150 SABRE DRIVE</StreetNmbr>
                        <VendorPrefs>
                            <Airline Hosted="true"/>
                        </VendorPrefs>
                    </Address>
                    <Ticketing TicketType="7T-"/>
                </AgencyInfo>
                <CustomerInfo>
                    <ContactNumbers>
                        <ContactNumber Phone="817-555-1212" PhoneUseType="A"/>
                    </ContactNumbers>
                    <Email Address="yury.patrin@gmail.com" NameNumber="1.1"/>
                    <PersonName NameNumber="1.1">
                        <GivenName>JAMES</GivenName>
                        <Surname>GREEN</Surname>
                    </PersonName>
                </CustomerInfo>
            </TravelItineraryAddInfoRQ>
        </PassengerDetailsRQ>
    </soap:Body>
</soap:Envelope>

Response:
<?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">WebServiceSupplier</eb:PartyId>
            </eb:From>
            <eb:To>
                <eb:PartyId eb:type="URI">WebServiceClient</eb:PartyId>
            </eb:To>
            <eb:CPAId>4PFI</eb:CPAId>
            <eb:ConversationId>SWS-Test-4PFI</eb:ConversationId>
            <eb:Service>PassengerDetails</eb:Service>
            <eb:Action>PassengerDetailsRS</eb:Action>
            <eb:MessageData>
                <eb:MessageId>1i9226s68</eb:MessageId>
                <eb:Timestamp>2017-07-11T08:50:23</eb:Timestamp>
                <eb:RefToMessageId>9314594d-6c40-406b-9029-b887b13906b6</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">
                Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/CERTG!ICESMSLB\/CRT.LB!-3255696707179766905!1188118!0
            </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-07-11T03:50:23.635-05:00"/>
                <Warning type="BusinessLogic" timeStamp="2017-07-11T03:50:23.469-05:00">
                    <SystemSpecificResults>
                        <Message code="WARN.SWS.HOST.WARNING_RESPONSE">EndTransactionLLSRQ: TTY REQ PEND</Message>
                    </SystemSpecificResults>
                </Warning>
            </ApplicationResults>
            <ItineraryRef ID="PGAAHT"/>
            <TravelItineraryReadRS>
                <TravelItinerary>
                    <CustomerInfo>
                        <Address>
                            <AddressLine type="N">SABRE TRAVEL</AddressLine>
                            <AddressLine type="A">3150 SABRE DRIVE</AddressLine>
                            <AddressLine type="C">SOUTHLAKE, TX US</AddressLine>
                            <AddressLine type="Z">76092</AddressLine>
                        </Address>
                        <ContactNumbers>
                            <ContactNumber LocationCode="IEV" Phone="817-555-1212-A" RPH="001"/>
                        </ContactNumbers>
                        <PersonName NameNumber="01.01" RPH="1" WithInfant="false">
                            <Email>YURY.PATRIN@GMAIL.COM</Email>
                            <GivenName>JAMES</GivenName>
                            <Surname>GREEN</Surname>
                        </PersonName>
                    </CustomerInfo>
                    <ItineraryInfo>
                        <ReservationItems>
                            <Item RPH="1">
                                <FlightSegment AirMilesFlown="0484" ArrivalDateTime="08-13T08:45" DayOfWeekInd="7" DepartureDateTime="2017-08-13T07:05" ElapsedTime="01.40" FlightNumber="0465" IsPast="false" NumberInParty="01" ResBookDesigCode="Y" SegmentNumber="0001" SmokingAllowed="false" SpecialMeal="false" Status="HK" StopQuantity="00" eTicket="false">
                                    <DestinationLocation LocationCode="HKG" Terminal="TERMINAL 1" TerminalCode="1"/>
                                    <Equipment AirEquipType="773"/>
                                    <MarketingAirline Code="CX" FlightNumber="0465"/>
                                    <Meal Code="B"/>
                                    <OriginLocation LocationCode="TPE" Terminal="TERMINAL 1" TerminalCode="1"/>
                                    <SupplierRef ID="DCCX"/>
                                    <UpdatedArrivalTime>08-13T08:45</UpdatedArrivalTime>
                                    <UpdatedDepartureTime>08-13T07:05</UpdatedDepartureTime>
                                </FlightSegment>
                            </Item>
                        </ReservationItems>
                        <Ticketing RPH="01" TicketTimeLimit="T-"/>
                    </ItineraryInfo>
                    <ItineraryRef AirExtras="false" ID="PGAAHT" InhibitCode="U" PartitionID="AA" PrimeHostID="1S">
                        <Source AAA_PseudoCityCode="4PFI" CreateDateTime="2017-07-11T03:50" CreationAgent="AWS" HomePseudoCityCode="4PFI" LastUpdateDateTime="2017-07-11T03:50" PseudoCityCode="4PFI" ReceivedFrom="TEST" SequenceNumber="1"/>
                    </ItineraryRef>
                    <RemarkInfo>
                        <Remark RPH="001" Type="General">
                            <Text>TEXT</Text>
                        </Remark>
                    </RemarkInfo>
                    <SpecialServiceInfo RPH="001" Type="GFX">
                        <Service SSR_Code="SSR" SSR_Type="DOCS">
                            <Airline Code="CX"/>
                            <PersonName NameNumber="01.01">GREEN/JAMES</PersonName>
                            <Text>
                                HK1/P/FR/1234567890/FR/02DEC1980/M/26MAY2018/GREEN/JAMES/MALCOLM/H
                            </Text>
                        </Service>
                    </SpecialServiceInfo>
                </TravelItinerary>
            </TravelItineraryReadRS>
        </PassengerDetailsRS>
    </soap-env:Body>
</soap-env:Envelope>

After this request I recieved booking confirmation on my email. Then, I do DesignatePrinterLLSRQ and TravelItineraryReadRQ.
TravelItineraryReadRQ Request:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Header>
        <MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader">
            <From>
                <PartyId>WebServiceClient</PartyId>
            </From>
            <To>
                <PartyId>WebServiceSupplier</PartyId>
            </To>
            <CPAId>4PFI</CPAId>
            <ConversationId>SWS-Test-4PFI</ConversationId>
            <Service>TravelItineraryRead</Service>
            <Action>TravelItineraryReadRQ</Action>
            <MessageData>
                <MessageId>9314594d-6c40-406b-9029-b887b13906b6</MessageId>
                <Timestamp>2017-07-11T08:36:19Z</Timestamp>
            </MessageData>
        </MessageHeader>
        <Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">
            <BinarySecurityToken>
                Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/CERTG!ICESMSLB\/CRT.LB!-3255700571383677304!1140614!0
            </BinarySecurityToken>
        </Security>
    </soap:Header>
    <soap:Body>
        <TravelItineraryReadRQ xmlns="http://services.sabre.com/res/tir/v3_9"
                               xmlns:xs="http://www.w3.org/2001/XMLSchema"
                               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                               xmlns:dd="http://webservices.sabre.com/dd2" Version="3.9.0">
            <MessagingDetails>
                <SubjectAreas>
                    <SubjectArea>FULL</SubjectArea>
                </SubjectAreas>
            </MessagingDetails>
            <UniqueID ID=""/>
            <EchoToken/>
        </TravelItineraryReadRQ>
    </soap:Body>
</soap:Envelope>

Response:
<?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">WebServiceSupplier</eb:PartyId>
            </eb:From>
            <eb:To>
                <eb:PartyId eb:type="URI">WebServiceClient</eb:PartyId>
            </eb:To>
            <eb:CPAId>4PFI</eb:CPAId>
            <eb:ConversationId>SWS-Test-4PFI</eb:ConversationId>
            <eb:Service>TravelItineraryRead</eb:Service>
            <eb:Action>TravelItineraryReadRS</eb:Action>
            <eb:MessageData>
                <eb:MessageId>2506522311129290610</eb:MessageId>
                <eb:Timestamp>2017-07-11T08:38:33</eb:Timestamp>
                <eb:RefToMessageId>9314594d-6c40-406b-9029-b887b13906b6</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">
                Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/CERTG!ICESMSLB\/CRT.LB!-3255700571383677304!1140614!0
            </wsse:BinarySecurityToken>
        </wsse:Security>
    </soap-env:Header>
    <soap-env:Body>
        <tir39:TravelItineraryReadRS xmlns:tir39="http://services.sabre.com/res/tir/v3_9"
                                     xmlns:or8="http://services.sabre.com/res/or/v1_8"
                                     xmlns:stl="http://services.sabre.com/STL/v01"
                                     xmlns:or19="http://services.sabre.com/res/or/v1_9" Version="3.9.0">
            <stl:ApplicationResults status="Complete">
                <stl:Success timeStamp="2017-07-11T03:38:33.392-05:00"/>
            </stl:ApplicationResults>
            <tir39:TravelItinerary>
                <tir39:CustomerInfo>
                    <tir39:Address>
                        <tir39:AddressLine Id="8" type="N">SABRE TRAVEL</tir39:AddressLine>
                        <tir39:AddressLine Id="9" type="A">3150 SABRE DRIVE</tir39:AddressLine>
                        <tir39:AddressLine Id="10" type="C">SOUTHLAKE, TX US</tir39:AddressLine>
                        <tir39:AddressLine Id="11" type="Z">76092</tir39:AddressLine>
                    </tir39:Address>
                    <tir39:ContactNumbers>
                        <tir39:ContactNumber LocationCode="IEV" Phone="817-555-1212-A" RPH="001" Id="7"/>
                    </tir39:ContactNumbers>
                    <tir39:PersonName WithInfant="false" NameNumber="01.01" RPH="1" elementId="pnr-4.1">
                        <tir39:Email Id="6">YURY.PATRIN@GMAIL.COM</tir39:Email>
                        <tir39:GivenName>JAMES</tir39:GivenName>
                        <tir39:Surname>GREEN</tir39:Surname>
                    </tir39:PersonName>
                </tir39:CustomerInfo>
                <tir39:ItineraryInfo>
                    <tir39:ReservationItems>
                        <tir39:Item RPH="1">
                            <tir39:FlightSegment AirMilesFlown="0484" ArrivalDateTime="08-13T08:45" DayOfWeekInd="7"
                                                 DepartureDateTime="2017-08-13T07:05"
                                                 SegmentBookedDate="2017-07-11T03:34:00" ElapsedTime="01.40"
                                                 eTicket="false" FlightNumber="0465" NumberInParty="01"
                                                 ResBookDesigCode="Y" SegmentNumber="0001" SmokingAllowed="false"
                                                 SpecialMeal="false" Status="HK" StopQuantity="00" IsPast="false"
                                                 CodeShare="false" Id="3">
                                <tir39:DestinationLocation LocationCode="HKG" Terminal="TERMINAL 1" TerminalCode="1"/>
                                <tir39:Equipment AirEquipType="773"/>
                                <tir39:MarketingAirline Code="CX" FlightNumber="0465">
                                    <tir39:Banner>MARKETED BY CATHAY PACIFIC AIRWAYS</tir39:Banner>
                                </tir39:MarketingAirline>
                                <tir39:Meal Code="B"/>
                                <tir39:OperatingAirline Code="CX" FlightNumber="0465" ResBookDesigCode="Y">
                                    <tir39:Banner>OPERATED BY CATHAY PACIFIC AIRWAYS</tir39:Banner>
                                </tir39:OperatingAirline>
                                <tir39:OperatingAirlinePricing Code="CX"/>
                                <tir39:DisclosureCarrier Code="CX" DOT="false">
                                    <tir39:Banner>CATHAY PACIFIC AIRWAYS</tir39:Banner>
                                </tir39:DisclosureCarrier>
                                <tir39:OriginLocation LocationCode="TPE" Terminal="TERMINAL 1" TerminalCode="1"/>
                                <tir39:SupplierRef ID="DCCX"/>
                                <tir39:UpdatedArrivalTime>08-13T08:45</tir39:UpdatedArrivalTime>
                                <tir39:UpdatedDepartureTime>08-13T07:05</tir39:UpdatedDepartureTime>
                            </tir39:FlightSegment>
                        </tir39:Item>
                    </tir39:ReservationItems>
                    <tir39:Ticketing RPH="01" TicketTimeLimit="T-"/>
                </tir39:ItineraryInfo>
                <tir39:ItineraryRef AirExtras="false" ID="UJUDSY" InhibitCode="U" PartitionID="AA" PrimeHostID="1S">
                    <tir39:Source AAA_PseudoCityCode="4PFI" CreateDateTime="2017-07-11T03:34" CreationAgent="AWS"
                                  HomePseudoCityCode="4PFI" PseudoCityCode="4PFI" ReceivedFrom="TEST"
                                  LastUpdateDateTime="2017-07-11T03:34" SequenceNumber="1"/>
                </tir39:ItineraryRef>
                <tir39:RemarkInfo>
                    <tir39:Remark RPH="001" Type="General" Id="14">
                        <tir39:Text>TEXT</tir39:Text>
                    </tir39:Remark>
                </tir39:RemarkInfo>
                <tir39:SpecialServiceInfo RPH="001" Type="GFX" Id="12">
                    <tir39:Service SSR_Code="SSR" SSR_Type="DOCS">
                        <tir39:Airline Code="CX"/>
                        <tir39:PersonName NameNumber="01.01">GREEN/JAMES</tir39:PersonName>
                        <tir39:Text>
                            HK1/P/FR/1234567890/FR/02DEC1980/M/26MAY2018/GREEN/JAMES/MALCOLM/H
                        </tir39:Text>
                    </tir39:Service>
                </tir39:SpecialServiceInfo>
                <tir39:SpecialServiceInfo RPH="002" Type="GFX" Id="13">
                    <tir39:Service SSR_Code="SSR" SSR_Type="DOCS">
                        <tir39:Airline Code="CX"/>
                        <tir39:PersonName NameNumber="01.01">GREEN/JAMES</tir39:PersonName>
                        <tir39:Text>HK1/DB/02DEC1980/M/GREEN/JAMES</tir39:Text>
                    </tir39:Service>
                </tir39:SpecialServiceInfo>
            </tir39:TravelItinerary>
        </tir39:TravelItineraryReadRS>
    </soap-env:Body>
</soap-env:Envelope>

And then I do AirTicketLLSRQ.
Request:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Header>
        <MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader">
            <From>
                <PartyId>WebServiceClient</PartyId>
            </From>
            <To>
                <PartyId>WebServiceSupplier</PartyId>
            </To>
            <CPAId>4PFI</CPAId>
            <ConversationId>SWS-Test-4PFI</ConversationId>
            <Service>AirTicketRQ</Service>
            <Action>AirTicketLLSRQ</Action>
            <MessageData>
                <MessageId>9314594d-6c40-406b-9029-b887b13906b6</MessageId>
                <Timestamp>2017-07-11T08:39:43Z</Timestamp>
            </MessageData>
        </MessageHeader>
        <Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">
            <BinarySecurityToken>
                Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/CERTG!ICESMSLB\/CRT.LB!-3255700571383677304!1140614!0
            </BinarySecurityToken>
        </Security>
    </soap:Header>
    <soap:Body>
        <AirTicketRQ xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" NumResponses="1" Version="2.10.0"
                     ReturnHostCommand="true">
            <OptionalQualifiers>
                <FlightQualifiers>
                    <VendorPrefs>
                        <Airline Code="CX"/>
                    </VendorPrefs>
                </FlightQualifiers>
                <MiscQualifiers>
                    <Ticket Type="ETR"/>
                </MiscQualifiers>
                <PricingQualifiers>
                    <PriceQuote>
                        <Record Number="1"/>
                    </PriceQuote>
                </PricingQualifiers>
            </OptionalQualifiers>
        </AirTicketRQ>
    </soap:Body>
</soap:Envelope>

Response:
<?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">WebServiceSupplier</eb:PartyId>
            </eb:From>
            <eb:To>
                <eb:PartyId eb:type="URI">WebServiceClient</eb:PartyId>
            </eb:To>
            <eb:CPAId>4PFI</eb:CPAId>
            <eb:ConversationId>SWS-Test-4PFI</eb:ConversationId>
            <eb:Service>AirTicketRQ</eb:Service>
            <eb:Action>AirTicketLLSRS</eb:Action>
            <eb:MessageData>
                <eb:MessageId>393675312556970611</eb:MessageId>
                <eb:Timestamp>2017-07-11T08:40:56</eb:Timestamp>
                <eb:RefToMessageId>9314594d-6c40-406b-9029-b887b13906b6</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">
                Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/CERTG!ICESMSLB\/CRT.LB!-3255700571383677304!1140614!0
            </wsse:BinarySecurityToken>
        </wsse:Security>
    </soap-env:Header>
    <soap-env:Body>
        <AirTicketRS xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:stl="http://services.sabre.com/STL/v01"
                     Version="2.10.0">
            <stl:ApplicationResults status="NotProcessed">
                <stl:Error type="BusinessLogic" timeStamp="2017-07-11T03:40:56-05:00">
                    <stl:SystemSpecificResults>
                        <stl:HostCommand LNIATA="757110">W¥PQ1¥ETR¥ACX</stl:HostCommand>
                        <stl:Message>PNR HAS BEEN UPDATED-IGN AND RETRY-0049</stl:Message>
                        <stl:ShortText>ERR.SWS.HOST.ERROR_IN_RESPONSE</stl:ShortText>
                    </stl:SystemSpecificResults>
                </stl:Error>
            </stl:ApplicationResults>
        </AirTicketRS>
    </soap-env:Body>
</soap-env:Envelope>

How can I fix this error? Maybe I am doing something wrong?

A: What you encountered is quite a normal situation (but unwanted).
Solution to this is to run (but only after you detect PNR HAS BEEN UPDATED-IGN AND RETRY error)

*

*ignore command

*rerun AirTicketRQ (exactly the same that failed in the first run)

As far as Ignore command is concerned what you should know is that it will ignore (cancel) all your PNR changes since the last successful EndTransactionRQ, so it's best to have everything saved before AirTicketRQ is expected to be run
Example of ignore command (IR in HostCommand will trigger ignore transaction) :
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <ns4:MessageHeader xmlns:ns8="http://www.w3.org/2000/09/xmldsig#" xmlns:ns7="http://www.opentravel.org/OTA/2002/11" xmlns:ns6="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ns5="http://www.w3.org/1999/xlink" xmlns:ns4="http://www.ebxml.org/namespaces/messageHeader">
      <ns4:ConversationId> CONVERSATION_ID </ns4:ConversationId>
      <ns4:From>
        <ns4:PartyId ns4:type="urn:x12.org:IO5:01"> PARTY_ID_FROM </ns4:PartyId>
        <ns4:Role></ns4:Role>
      </ns4:From>
      <ns4:To>
        <ns4:PartyId ns4:type="urn:x12.org:IO5:01"> PARTY_ID_TO </ns4:PartyId>
        <ns4:Role></ns4:Role>
      </ns4:To>
      <ns4:CPAId>GF</ns4:CPAId>
      <ns4:Service ns4:type="OTA"></ns4:Service>
      <ns4:Action>SabreCommandLLSRQ</ns4:Action>
    </ns4:MessageHeader>
    <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
      <wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary"> BOOKING_PROVIDER_SESSION </wsse:BinarySecurityToken>
    </wsse:Security>
  </soap:Header>
  <soap:Body>
    <SabreCommandLLSRQ xmlns="http://webservices.sabre.com/sabreXML/2003/07" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" TimeStamp="2014-03-04T14:00:00" Version="1.8.1">
      <Request Output="SCREEN" CDATA="true">
        <HostCommand>IR</HostCommand>
      </Request>
    </SabreCommandLLSRQ>
  </soap:Body>
</soap:Envelope>

A: Sabre is launching a new Orchestrated AirTicketRQ service that will automate and simplify many of these items, and much much more magic. If you are interested, please let us know...


text:
Q: Alert message will show up after the submission My alert message pop ups before the loading/submission of a record, so if the user didn't input any data. It still pops up. What additional javascript function should I use for my alert box?
Here's my code

function myFunction() {
    alert("Adding Succesful!");
}

Brand Name

 <input name="bName" class="form-control req" required/>

<button type="submit" class="btn btn-default bt"  onclick="myFunction()" style="align:right;">ADD</button>

A: Use HTML5 validity checks to see if the form is valid or not.

var form = document.getElementById('f');

function myFunction() {
  if (form.checkValidity()) {
    alert("Adding Succesful!");
  }
}
<form id="f">

Brand Name

  <input name="bName" class="form-control req" required/>

  <button type="submit" class="btn btn-default bt" onclick="myFunction()" style="align:right;">ADD</button>
</form>

A: Try using:

Brand Name

 <input name="bName" class="form-control req" required/>

<button type="submit" class="btn btn-default bt"  onclick="return myFunction(this)" style="align:right;">ADD</button>

(note I changed the onclick to include a return and a this)
And use it with the JavaScript:
function myFunction(t)
{
    if($(t).prev().val())
    {
        alert('Adding Succesful!')
        return true;
    }else{
        return false;
    }
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: Embed Python code on a webpage Is there an easy, simple way to embed python code in a webpage; i.e., have an embedded app where viewers input numbers and a python code is run and an output is spit out? I don't really want to learn Django just for one project, but if there's no other way, I might have to.

A: You can use Flask. It only takes a few minutes to set up.
http://flask.pocoo.org/docs/0.10/quickstart/#quickstart

A: Recommend flask. I've just done something like this. Only need a few lines of python code and a few lines of html code. No more than 30 lines.
Write a html page which has an input and a button. When the page gets an input and the button gets hit, a python script will be invoked. And then result will be rendered to a new page.


text:
Q: Is it possible to hide the Digital Crown indicator on watchOS with swiftUI I have been fideling with the Apple Watch and swiftUI for a while now and I'm facing a bit of an issue.
I'm hopping to access the Digital Crown rotation values without having the indicator show up on the watch screen. I have no problem connecting to the crown with swiftUI but I don't seem to be able to hide or remove the indicator it is linked to.
As of today my code is:
struct TestView: View {
@State var scrollAmount = 0.0

var body: some View {
            containerView
                .focusable(true)
                .digitalCrownRotation($scrollAmount,
                                      from: 0,
                                      through: 1,
                                      by: 0.05,
                                      sensitivity: .low,
                                      isContinuous: false,
                                      isHapticFeedbackEnabled: true)
       }
    }

Container view is a generic name for a view but not a scrollviews so I can't apply the (showsIndicators: false).
As I said no problem receiving the values on scrollAmount. But everytime the crown is rotated the indicator pops up on the screen.
I try to set .accentColor(.clear) but it does nothing and the indicator still appears in green.
Am I missing something or doing something wrong? I'm out of idea on how I could tell the system not to show the crown indicator.
Any help or tips is welcome.


text:
Q: Writing: Word vs. Character Count I am writing a thesis right now, and I noticed that in my writing software (Scrivener), there's a "word" and a "character" count.
I understand that this is not Literature & Latte's support site, but I wanted to ask a question more generally than about Scrivener.
Why would one want to think in terms of character counts, as opposed to word counts? I understand that neither are perfect proxies for getting content down, but I was curious as to the reason why one would want to think in terms of characters as opposed to words, as I thought that words would be a better measure of progress, or am I wrong about that?

A: I can't speak for Scrivener because I've never used it, but I can tell you that in the 1990s some popular word processor packages offered statistics such as character, word and sentence count, and used them to calculate "readability" scores.
And, according to Wikipedia, research in the year 2000 concluded that words-per-sentence and characters-per-word are two of the three metrics which were found to most strongly correspond to the ease with which people read a text.
So it could be that Scrivener is offering data for people who consider readability while they compose their text.


text:
Q: Writing to an Existing Excel File  package jexcel.jxl.nimit;

    import java.awt.Label;
    import java.io.File;
    import java.io.IOException;

    import jxl.Cell;
    import jxl.CellType;
    import jxl.LabelCell;
    import jxl.NumberCell;
    import jxl.Sheet;
    import jxl.Workbook;
    import jxl.read.biff.BiffException;
    import jxl.write.WritableCell;
    import jxl.write.WritableSheet;
    import jxl.write.WritableWorkbook;
    import jxl.write.WriteException;
    import jxl.write.biff.RowsExceededException;

    public class ExcelJxl {

    /**
     * @param args
     * @throws IOException
     * @throws BiffException
     * @throws WriteException
     * @throws RowsExceededException
     */
    public static void main(String[] args) throws BiffException, IOException, RowsExceededException, WriteException {
        // TODO Auto-generated method stub
             ExcelJxl.WriteFile("D:\nimit.xls");
    }

    public static void WriteFile(String path) throws BiffException, IOException, RowsExceededException, WriteException{

    Workbook wb=Workbook.getWorkbook(new File(path));

    WritableWorkbook copy=Workbook.createWorkbook(new File("D:\temp.xls"),wb);
    WritableSheet sheet = copy.getSheet(1);
    WritableCell cell = sheet.getWritableCell(0,0);
    String S="nimit";
    if (cell.getType() == CellType.LABEL)
    {
      LabelCell l = (LabelCell) cell;
      l.setString(S);
    }
    copy.write();
    copy.close();
    wb.close();

    }
   }

I have edited my program, and now it says that setString() The method setString(String) is undefined for the type LabelCell I read the Documentation, there is a method setString in the LabelCell type.

A: LabelCell is just an interface with only one method i.e getString() you can learn more about it here
You should use jxl.write.Label instead.
What you should exactly do is as follows
You should import the following file
import jxl.write.Label

Then following is the code for adding a cell at desired location to an excel file
Workbook existingWorkbook = Workbook.getWorkbook(new File(fileToEdit.getAbsolutePath()));
WritableWorkbook workbookCopy = Workbook.createWorkbook(new File("output.xls"), existingWorkbook);
WritableSheet sheetToEdit = workbookCopy.getSheet(sheetName);
WritableCell cell;
Label l = new Label(currentColumn, currentRow, value);
cell = (WritableCell) l;
sheetToEdit.addCell(cell);
 workbookCopy.write();
 workbookCopy.close();
 existingWorkbook.close();

currentColumn and currentRow define the index and value contains the String to be placed in that cell.
Hope it helps


text:
Q: PHP: Disable Enable text box on the basis of dropdown I'm new to PHP. i am trying to create some html code within a php function as below.

$str .="

                    <form method='get' action='homepage.php'>

                        <select name='test'>
                            <option value='allcaller'>".getResourceStrings('msg_allcaller',$lng)."</option>
                            <option value='specialcaller'>".getResourceStrings('msg_splcaller',$lng)."</option>
                        </select>

";
        $str .=      getResourceStrings('msg_spcallaer',$lng);
        $str .="

                    <input type='hidden' name='function' value='Buysuccess' />
                    <input type='hidden' name='vcode' value='".$vcode."' />";
                    if($testmsisdnheader != ""){
                        $msisdn_header = getheader();
                        $str .="<input type='hidden' name='".$msisdn_header."' value='".$msisdn."' />";
                    }

        $str .="    <input type='text' onkeydown='return ( event.ctrlKey || event.altKey
                    || (47<event.keyCode && event.keyCode<58 && event.shiftKey==false)
                    || (95<event.keyCode && event.keyCode<106)
                    || (event.keyCode==8) || (event.keyCode==9)
                    || (event.keyCode>34 && event.keyCode<40)
                    || (event.keyCode==46) )' name='cbsmsisdn' maxlength='12' disabled='true'/>

                    <input type='submit' value='Submit' />

                </form>

";

Now I want to enable/disable the text box on the basis of value selected in drop down.
Here i like to put a condition where if the option value equals 'allcaller' the text box should be disabled which is actually happening.
But I want to enable the same text box in case option value equals to 'specialcaller'.
I wasn't able to enable the text box on the basis of value selected in drop down.
Any help would be highly appreciated.
Thanks!
Bobby.

A: I have two possible solutions for you.

*

*As you have mentioned in comment that you dont want to use java script, as its a WAP Portal, but their is no other way to do this without using javascript. I can recommend you a one way where you can ask user to submit his drop down result. And on the basis of that result you can enable or disable you text box on next page.

*Otherwise go for javascript.


text:
Q: Change multiple properties with single ObjectAnimator? I have a pretty complex animation I need to code and I'm using a bunch of ObjectAnimators like the following:
ObjectAnimator objectAnimator1 = ObjectAnimator.ofFloat(view, TRANSLATION_X, value).setDuration(BASE_DURATION * 2);
ObjectAnimator objectAnimator2 = ObjectAnimator.ofFloat(view, TRANSLATION_Y, value).setDuration(BASE_DURATION * 2);

Is it possible to group the X and Y translations into the same ObjectAnimator rather than creating a bunch of them then adding them all into an AnimatorSet?
Thanks!

A: PropertyValuesHolder pvhX = PropertyValuesHolder.ofFloat(TRANSLATION_X, value);
PropertyValuesHolder pvhY = PropertyValuesHolder.ofFloat(TRANSLATION_Y, value);
ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(view, pvhX, pvhY);
animator.setDuration(BASE_DURATION * 2);
animator.start();

http://developer.android.com/guide/topics/graphics/prop-animation.html#views
 One ObjectAnimator

A: If you are animating a view (like your example suggests), you could use a ViewPropertyAnimator:
view.animate().translationX(value_x).translationY(value_y).setDuration(duration).start();

A: An alternative approach I've used to add multiple properties to an object's animation is to use a mix of code and XML to define the animation. This is based on this documentation
For example, in XML I can setup AnimatorSets and ObjectAnimators for a single object with static values, and define a sequential sequence of changes (res/animator/moveout.xml)
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:ordering="sequentially">
    <set>
        <objectAnimator
            android:propertyName="scaleX"
            android:duration="2000"
            android:valueTo="0.8"
            android:interpolator="@android:anim/decelerate_interpolator"/>
        <objectAnimator
            android:propertyName="scaleY"
            android:duration="2000"
            android:valueTo="0.8"
            android:interpolator="@android:anim/decelerate_interpolator"/>
        <objectAnimator
            android:propertyName="alpha"
            android:duration="2000"
            android:valueTo="0"
            android:interpolator="@android:anim/decelerate_interpolator"/>
    </set>
    <set>
        <objectAnimator
            android:propertyName="scaleX"
            android:duration="2000"
            android:valueTo="1.2"
            android:interpolator="@android:anim/accelerate_interpolator"/>
        <objectAnimator
            android:propertyName="scaleY"
            android:duration="2000"
            android:valueTo="1.2"
            android:interpolator="@android:anim/accelerate_interpolator"/>
        <objectAnimator
            android:propertyName="alpha"
            android:duration="2000"
            android:valueTo="1"
            android:interpolator="@android:anim/accelerate_interpolator"/>
    </set>
</set>

Then I can load these AnimatorSets/ObjectAnimators at runtime and modify their values with dynamically generated values:
    AnimatorSet firstSet = (AnimatorSet) AnimatorInflater.loadAnimator(this,
            R.animator.moveout);

    AnimatorSet secondSet = firstSet.clone();
    firstSet.setTarget(button);
    secondSet.setTarget(anotherButton);

    // Choreograph the animations
    // Change the duration of all child elements in the set
    firstSet.setDuration(1000);
    secondSet.setDuration(200);

    // Set start delay so second set plays after the first set
    secondSet.setStartDelay(2000);
    AnimatorSet anim = new AnimatorSet();
    anim.playTogether(firstSet,secondSet);
    anim.start();

A: Animating view could be done even easier:
v.animate().x(valueX).y(valueY).setDuration(500).start();

(In this snippet ViewPropertyAnimator has been used).

A: I think you should be using an AnimationSet.
It practically does what you want and is the nice way of doing it because when I think of PropertyValuesHolder I don't think of Keyframes.
So yeah:
ObjectAnimator objectAnimator1 = ObjectAnimator.ofFloat(view, TRANSLATION_X, value);
ObjectAnimator objectAnimator2 = ObjectAnimator.ofFloat(view, TRANSLATION_Y, value);

AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(objectAnimator1, objectAnimator2);
animatorSet.setDuration(BASE_DURATION * 2);

animatorSet.start();

You can add as many ObjectAnimators as you want.


text:
Q: Set performance counter value with PowerShell Is there a way to set the value of a performance counter using PowerShell?

A: Yep.
$counter = (New-Object -TypeName System.Diagnostics.PerformanceCounter -ArgumentList ("CategoryName", "CounterName", "InstanceName", $false))
$counter.RawValue = 0


text:
Q: ReactJS Accordion For loop Key Undefined? I have the following function.
accordianRecentActivity() {
    let div = [];
    const grouped = this.groupBy(this.state.filtered, date => getDateServiceTab(date.date));
    div.push(<Accordion>)

    for (const [key, value] of grouped.entries()) {
        div.push(
{key}
)
    }
    div.push(</Accordion>)

    return div;

  }

I am using this component tutorial to build it out.
https://alligator.io/react/react-accordion-component/
I then get the following...

Line 152:  'key' is not defined  no-undef
Line 152:  'key' is not defined  no-undef

EDIT
If I do this...
    accordianRecentActivity() {
        let div = [];
        const grouped = this.groupBy(this.state.filtered, date => getDateServiceTab(date.date));
//      div.push(<Accordion>)
//
//
//      for (const [key, value] of Object.entries(grouped)) {
//          div.push(
{key}
)
//      }
//      div.push(</Accordion>)
//
//
//      return div;
//

        for (const [key, value] of grouped.entries()) {
          console.log(key, value);
        }
      }

I will get the following in the console.

printing out grouped.entries()


text:
Q: Using Linear Discriminant Analysis to perform feature extraction class labels of observations are changed I'm looking at different methods to classify email in the UCI spambase dataset as spam or not spam.
https://archive.ics.uci.edu/ml/datasets/spambase
As there are 58 variables (including the dependent) I thought to use Linear Discriminant Analysis(LDA) for dimension reduction and then the other classifiers such as SVM etc. to check for any improvement in classification accuracy.
However, while the accuracy did increase the class labels( what denotes each email as spam or not spam) of some of the observations change.
Before I run the LDA I have:
In the training_set
nonspam 1952
spam 1269
In the test_set
nonspam 836
spam 544
After I run the LDA I have:
In the training_set
nonspam 2131
spam 1090
In the test_set
nonspam 919
spam 461
this is before I before the actual classification(SVM). How do I stop this? Thx in advance.
#Linear Discriminant Analysis
setseed = 100
kfolds = 10

# Importing the dataset
dataset = read.csv('spambase.csv')

# Encoding the target feature as factor
dataset$factor = as.factor(dataset$factor)

# Splitting the dataset into the Training set and Test set
library(caTools)
set.seed(setseed)
split = sample.split(dataset$factor, SplitRatio = 0.7)
training_set = subset(dataset, split == TRUE)
test_set = subset(dataset, split == FALSE)

# Feature Scaling
training_set[-58] = scale(training_set[-58])
test_set[-58] = scale(test_set[-58])

sum(training_set[,58]==0)
sum(training_set[,58]==1)

sum(test_set[,58]==0)
sum(test_set[,58]==1)

# Fitting classifier to the Training set
library(MASS)
library(e1071)
LDA =lda(formula = factor ~ ., data = training_set)

training_set = as.data.frame(predict(LDA, training_set))
training_set = training_set[c(4, 1)]
test_set = as.data.frame(predict(LDA, test_set))
test_set = test_set[c(4, 1)]

sum(training_set[,2]==0)
sum(training_set[,2]==1)

sum(test_set[,2]==0)
sum(test_set[,2]==1)

classifier = svm(formula = class ~ ., data = training_set,
                 type = 'C-classification', kernel = 'linear')

# Predicting the Test set results
pred = predict(classifier, newdata = test_set[-58])

# Making the Confusion Matrix
cm = table(test_set$class,pred)


text:
Q: How to find the sum of number layer in ndarray I have a 10*10 array. I need to find the sum of all layer. Following figure will clear my question:

How can i do this easily?

A: Just to add another answer... While the general idea of subtracting inner squares from outer ones is probably the best approach, if you wanted performance none of the implementations presented would do too good, since they keep adding the same numbers over and over. To speed this calculation up, you could use what in image processing is called an integral image:
>>> int_arr = np.cumsum(np.cumsum(arr, axis=0), axis=1)
>>> int_arr
array([[  8,   8,  15,  19,  22,  22,  22,  29,  35,  44],
       [ 16,  17,  24,  34,  40,  44,  46,  54,  64,  79],
       [ 24,  30,  46,  62,  76,  80,  82,  91, 104, 119],
       [ 27,  35,  59,  84, 103, 115, 123, 137, 156, 178],
       [ 33,  48,  77, 103, 123, 135, 148, 163, 191, 213],
       [ 41,  65,  98, 129, 158, 177, 190, 205, 233, 259],
       [ 48,  81, 120, 158, 191, 217, 235, 251, 286, 316],
       [ 54,  95, 136, 180, 214, 249, 275, 296, 333, 364],
       [ 63, 105, 147, 194, 235, 276, 310, 331, 376, 414],
       [ 65, 115, 163, 213, 260, 306, 340, 364, 410, 456]])

From this helper array you can compute the area of any rectangular subarray adding two entries and subtracting two others, e.g.:
>>> np.sum(arr[1:-1, 1:-1])
286
>>> int_arr[-2,-2] + int_arr[0, 0] - int_arr[-2, 0] - int_arr[0, -2]
286

With this, you could compute your sums easily as, e.g.:
sums = [int_arr[-1, -1]]
top = 0
bot = len(arr) - 2
while top < bot:
    new_sum = (int_arr[bot, bot] + int_arr[top, top] -
               int_arr[top, bot] - int_arr[bot, top])
    sums[-1] -= new_sum
    sums.append(new_sum)
    top += 1
    bot -= 1

>>> sums
[170, 122, 85, 62, 17]

A: If you know how to get the sum of a (2n)*(2n) square in the middle, then it is very easy: take the sum of the (2n)*(2n) square, then subtract the sum of the (2n-2)*(2n-2) square inside it; the difference is the sum of the elements on the border (that is, are in the outer square but not the inner):
import numpy

# let x be a 10 * 10 array
x = numpy.array([
  [8, 0, 7, 4, 3, 0, 0, 7, 6, 9],
  [8, 1, 0, 6, 3, 4, 2, 1, 4, 6],
  [8, 5, 9, 6, 8, 0, 0, 1, 3, 0],
  [3, 2, 8, 9, 5, 8, 6, 5, 6, 7],
  [6, 7, 5, 1, 1, 0, 5, 1, 9, 0],
  [8, 9, 4, 5, 9, 7, 0, 0, 0, 4],
  [7, 9, 6, 7, 4, 7, 5, 1, 7, 4],
  [6, 8, 2, 6, 1, 9, 8, 5, 2, 1],
  [9, 1, 1, 3, 7, 6, 8, 0, 8, 7],
  [2, 8, 6, 3, 6, 5, 0, 3, 1, 8],
])

for i in xrange(1, 6): # loop with i = 1,...,5
  # find the sum of the (2i)*(2i) square in the middle
  a = numpy.sum(x[5-i:5+i, 5-i:5+i])

  # find the sum of the (2i-2)*(2i-2) square in the middle
  b = numpy.sum(x[6-i:4+i, 6-i:4+i])

  # the difference gives the sum of the elements on the border
  s = a - b
  print s

17
  62
  85
  122
  170

A: The code below calculate each layer and then subtracts the smaller layer from it. It's quite general, and so any array of size N*N should be able to be passed to it, as long as N is even (I think).
import numpy as np

arr = np.array([[8, 0, 7, 4, 3, 0, 0, 7, 6, 9],
                [8, 1, 0, 6, 3, 4, 2, 1, 4, 6],
                [8, 5, 9, 6, 8, 0, 0, 1, 3, 0],
                [3, 2, 8, 9, 5, 8, 6, 5, 6, 7],
                [6, 7, 5, 1, 1, 0, 5, 1, 9, 0],
                [8, 9, 4, 5, 9, 7, 0, 0, 0, 4],
                [7, 9, 6, 7, 4, 7, 5, 1, 7, 4],
                [6, 8, 2, 6, 1, 9, 8, 5, 2, 1],
                [9, 1, 1, 3, 7, 6, 8, 0, 8, 7],
                [2, 8, 6, 3, 6, 5, 0, 3, 1, 8]])

N = len(arr)

def sum_layer(arr, M, N=N):
    """Function to return the sum of a layer."""
    return arr[M:N-M, M:N-M].sum()

# Each of the layers.
layers = [sum_layer(arr, i) for i in range(N - N//2)]

# Subtract the smaller areas from the larger, to get the margins.
result = [layers[i] - layers[i+1] for i in range(N//2 - 1)]

# Need to add the final, smallest layer on.
result.append(layers[-1])

print(result)
# [170, 122, 85, 62, 17]

A: Here's a solution without repeated summation of the same elements and without an intermediate array (just brute-force indexing fun) which works for square n by n arrays for odd or even n:
import numpy as np

def sum_shells(a):
    n = len(a)
    no2 = n // 2
    shell_sums = []
    for i in range(no2):
        shell_sums.append(np.sum(a[i,i:n-i]) + np.sum(a[n-i-1,i:n-i]) +
                          np.sum(a[i+1:n-i-1,i]) + np.sum(a[i+1:n-i-1,n-i-1]))
    if n % 2:
        shell_sums.append(a[no2, no2])
    return shell_sums

a = np.array([
  [8, 0, 7, 4, 3, 0, 0, 7, 6, 9],
  [8, 1, 0, 6, 3, 4, 2, 1, 4, 6],
  [8, 5, 9, 6, 8, 0, 0, 1, 3, 0],
  [3, 2, 8, 9, 5, 8, 6, 5, 6, 7],
  [6, 7, 5, 1, 1, 0, 5, 1, 9, 0],
  [8, 9, 4, 5, 9, 7, 0, 0, 0, 4],
  [7, 9, 6, 7, 4, 7, 5, 1, 7, 4],
  [6, 8, 2, 6, 1, 9, 8, 5, 2, 1],
  [9, 1, 1, 3, 7, 6, 8, 0, 8, 7],
  [2, 8, 6, 3, 6, 5, 0, 3, 1, 8] ])

b = np.array([[9, 5, 8, 6, 5],
              [1, 1, 0, 5, 1],
              [5, 9, 7, 0, 0],
              [7, 4, 7, 5, 1],
              [9, 5, 0, 2, 3] ])
print(sum_shells(a))
print(sum_shells(b))

Produces:
[170, 122, 85, 62, 17]
[67, 31, 7]

A: I have an idea. 1st find the sum of whole 10*10 array, then find the sum of inner 9*9 array. Then subtraction is the result of sum of outer layer.
for i in range(len(A)/2):
    B = A[1:-1, 1:-1]
    print sum(A)-sum(B)
    A = B

A loop will find all sum.
May be there is better way to do this..


text:
Q: How to log all rest api calls in magento2? Is there any way to log all the requested rest API with details (requested URL, methods, parameters, time, etc.,) in Magento2?
earlier I have logged all the rest of the API which was related to products using the model (V1.php) in Magento 1. but in magento2 all the methods called in the same location for both API and backend usage to create/update/get.
here how can I know if the request from API?
Please suggest any solution to log APIs.
Thanks

A: [This may not be a good way to log the Rest API]
We should try with Plugin - Magento\Webapi\Controller\Rest::dispatch():
app/code/Vendor/WebApiLog/etc/frontend/di.xml
<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Webapi\Controller\Rest">
        <plugin name="rest-api-log"
                type="Vendor\WebApiLog\Model\Plugin\RestApiLog"/>
    </type>
</config>

app/code/Vendor/WebApiLog/Model/Plugin/RestApiLog.php
<?php

namespace Vendor\WebApiLog\Model\Plugin;

class RestApiLog
{
    public function beforeDispatch(
        \Magento\Webapi\Controller\Rest $subject,
        \Magento\Framework\App\RequestInterface $request
    )
    {
        $request->getModuleName();
        $request->getActionName();
        $request->getPathInfo();

    }
}

A: You can use the following FOSS module:
https://github.com/vladflonta/magento2-webapi-log

A: Check this out, under MIT license:
https://github.com/ghostunicorns/module-webapi-logs

A: You can also check this light weight API logging module
https://github.com/mosesdinakaran/magento-log

It has the below features

*

*Able to log all the API logs

*Able to log logged in users API calls

*Able to log guest user API calls

*Able to log only a specific api calls such as custom api call, cart, CMS, Product, Order etc

*Able to log a specific user api calls.

*The API logs contain both the request and Response

*The logs are made in a separate file

*This extension doesn't override any CORE Api class.


text:
Q: LXC: How do I mount a folder from the host to the container? I'm trying to mount a folder on the host to an LXC container.
The host has a folder /mnt/ssd/solr_data created (this is currently on the root filesystem, but later I'll mount an SSD drive there, so I'm prepping for that).
I want that folder to mount as /data in the container.
So in the containers fstab file I have the following:
/mnt/ssd/solr_data      /var/lib/lxc/Solr4StandAlone/rootfs/data        ext4    defaults,noatime        0       0

But that's a no-go, I get this error starting the container:
lxc-start: No such file or directory - failed to mount '/mnt/ssd/solr_data' on '/usr/lib/x86_64-linux-gnu/lxc//data'
lxc-start: failed to setup the mounts for 'Solr4StandAlone'
lxc-start: failed to setup the container
lxc-start: invalid sequence number 1. expected 2
lxc-start: failed to spawn 'Solr4StandAlone'

A: As LXC has changed over time this can be very simple, but it stumped me for a bit, so wanted to contribute.  I also created a gist for this so i can remember myself, but simply using lxc config device will do the trick.
sudo lxc config device add Solr4StandAlone sdb disk source=/var/lib/lxc/Solr4StandAlone/rootfs/data path=mnt/ssd/solr_data

Note It is important to leave the front slash off the path argument due to a change mentioned by @biscuitNinja
Mounting directories from container to host

A: To create the directory automatically in the container, you can also add the create=dir option in the fstab :
/mnt/ssd/solr_data      /var/lib/lxc/Solr4StandAlone/rootfs/data        none   bind,create=dir

Edit : this is specific to LXC. See this thread

Just like we already had "optional", this adds two new LXC-specific mount flags:

*

*create=dir (will do a mkdir_p on the path)

*create=file (will do a mkdir_p on the dirname + a fopen on the path)
This was motivated by some of the needed bind-mounts for the unprivileged containers.

A: In /var/lib/lxc/Solr4StandAlone/config add a line reading:
lxc.mount.entry = /mnt/ssd/solr_data  /var/lib/lxc/Solr4StandAlone/rootfs/data none bind 0 0

Then lxc-stop stop your container and lxc-start your container again.
That is all that is needed.
ref: reference link

A: As of 2015/09/30 a change resulting from a security patch breaks mounting to an absolute path with lxc.mount.entry in the config file.
Instead you can use a relative path
 lxc.mount.entry = /mnt/ssd/solr_data data none bind 0 0

See: https://wiki.debian.org/LXC#Bind_mounts_inside_the_container

A: I had to create the /data folder in the local container before the mount would work properly.
I also used this fstab entry:
/mnt/ssd/solr_data      /var/lib/lxc/Solr4StandAlone/rootfs/data        none   bind     0       0

A: If you are using libvirt to create your lxc container, you can make the directory on the host to be passthrough as shown here:
root@localhost:/# cat /etc/libvirt/lxc/my_container.xml
...
 <filesystem type='mount' accessmode='passthrough'>
    <source dir='<dir on host>'/>
    <target dir='<dir on container>'/>
 </filesystem>
....


text:
Q: Thingsboard dynamically create devices Is there any way of creating devices programmatically and get their tokens.
I have a project where I need to create "entities" in my application side dynamically. I want these to be able to send data to a dashboard where I want to see some features of these "entities".
Since they are created on-the-fly during runtime, I was wondering if there's any way to create devices (or even other option) programmatically in order to allow this "entities" (that can be 1000s) to send data (over MQTT or REST) to Thingsboard.
Thanks...

A: You can use a gateway with Thingsboard gateway API to create devices using MQTT with a single token (the one of the gateway, declared in devices a "is GATEWAY")


text:
Q: docker cli swarm package import issues Im trying to utilise docker/cli client library in my own project to create/manage stacks.
I am however facing issues building the project.

Code below:
package main

import (
    "fmt"
    "log"

    "github.com/docker/cli/cli/command"
    "github.com/docker/cli/cli/command/stack"
    "github.com/docker/cli/cli/flags"
)

func main() {

    cli, err := command.NewDockerCli(command.WithStandardStreams())
    if err != nil {
        log.Fatal(err)
    }

    cli.Initialize(flags.NewClientOptions())

    cmd := stack.NewStackCommand(cli)
    cmd.SetArgs([]string{"deploy", "--compose-file", "docker-compose.yml", "test"})

    err = cmd.Execute()
    if err != nil {
        log.Fatal(err)
    }

    fmt.Println("success!")
}

I have setup a minimal go.mod:
module github.com/dev/test

go 1.16

When i run go get; i get the following errors:
github.com/dev/test imports
        github.com/docker/cli/cli/command/stack imports
        github.com/docker/cli/cli/command/service imports
        github.com/docker/swarmkit/api/defaults: cannot find module providing package github.com/docker/swarmkit/api/defaults
github.com/dev/test imports
        github.com/docker/cli/cli/command/stack imports
        github.com/docker/cli/cli/command/service imports
        github.com/docker/swarmkit/api/genericresource: cannot find module providing package github.com/docker/swarmkit/api/genericresource
github.com/dev/test imports
        github.com/docker/cli/cli/command/stack imports
        github.com/docker/cli/cli/command/service imports
        github.com/docker/swarmkit/api imports
        google.golang.org/grpc/transport: cannot find module providing package google.golang.org/grpc/transport

I have had a deeper look into the docker/cli repo and it appears that the project does not use go modules; instead its using the older vendor dir approach.
I was wondering how i can get the project to compile. Is there a way for go get to automatically reference the packages in the vendor directory of the imported docker/cli project?

A: By default, the go command will only add the newest tagged release of a module in order to resolve a missing dependency.
According to https://github.com/docker/swarmkit/tags, the latest (and only) tagged release of github.com/docker/swarmkit was v1.12.0, back in 2016(!), and at that point in time the api/defaults and api/genericresource packages did not yet exist.
You can ask the go command for a newer-than-tagged version of a dependency by passing the commit hash or branch name explicitly for the version. For example, the latest commit as of when I am writing this comment is 2dcf70aafdc9ea55af3aaaeca440638cde0ecda6, so you could pass that commit to go get, and it seems to build properly from that point:
$ go get -d github.com/docker/swarmkit/api/...@2dcf70aafdc9ea55af3aaaeca440638cde0ecda6
go: downloading github.com/docker/swarmkit v1.12.1-0.20210611195518-2dcf70aafdc9
go: downloading github.com/coreos/etcd v0.5.0-alpha.5
go: downloading github.com/gogo/protobuf v1.3.2
go: downloading github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c
go: downloading github.com/coreos/etcd v3.3.25+incompatible
go: downloading google.golang.org/grpc v1.38.0
go: downloading github.com/golang/protobuf v1.4.2
go: downloading golang.org/x/net v0.0.0-20201021035429-f5854403a974
go: downloading google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013
go: downloading golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f
go: downloading google.golang.org/protobuf v1.25.0
go: downloading golang.org/x/text v0.3.3
go: downloading github.com/sirupsen/logrus v1.8.1
go get: added github.com/coreos/etcd v3.3.25+incompatible
go get: added github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c
go get: added github.com/docker/swarmkit v1.12.1-0.20210611195518-2dcf70aafdc9
go get: added github.com/gogo/protobuf v1.3.2
go get: added github.com/golang/protobuf v1.4.2
go get: added github.com/sirupsen/logrus v1.8.1
go get: added golang.org/x/net v0.0.0-20201021035429-f5854403a974
go get: added golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f
go get: added golang.org/x/text v0.3.3
go get: added google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013
go get: added google.golang.org/grpc v1.38.0
go get: added google.golang.org/protobuf v1.25.0

$ go build github.com/docker/swarmkit/api/...

$


text:
Q: Perl capture variables in multiple binding operators Is there a way to use capture groups in more than binding expression and capture all the groups?
#!/usr/bin/perl

use strict;
use warnings;

countDays(1,"2015-3-21","2016-3-24");

sub countDays {
    die "Check formatting"
        unless ($_[0] =~ m/([1-7])/ &&
                $_[1] =~ m/^(\d{4})-(\d{1,2})-(\d{1,2})$/ &&
                $_[2] =~ m/^(\d{4})-(\d{1,2})-(\d{1,2})$/);

            # testing
            print "$1\n$2\n$3\n$4\n$5\n$6\n$6\n";

}

This only captures the last three groups: $1, $2, and $3.
Edit for expected output as Avinash Raj suggested:
1
2015
3
21
2016
3
24

A: No, every successful match resets all capture variables. But you can do this:
sub countDays {
    my @match1 = $_[0] =~ m/([1-7])/
        and
    my @match2 = $_[1] =~ m/^(\d{4})-(\d{1,2})-(\d{1,2})$/
        and
    my @match3 = $_[2] =~ m/^(\d{4})-(\d{1,2})-(\d{1,2})$/
        or die "Check formatting";

    print "@match1\n@match2\n@match3\n";
}

A: #!/usr/bin/env perl
use strict;
use warnings;

countDays(1,"2015-3-21","2016-3-24");

sub countDays {
    my $countDays = join ',', @_;

    die "Check formatting"
        unless $countDays =~
            m/([1-7]),(\d{4})-(\d{1,2})-(\d{1,2}),(\d{4})-(\d{1,2})-(\d{1,2})/;

    # testing
    print "$1\n$2\n$3\n$4\n$5\n$6\n$7\n";
}


text:
Q: Android Uri from Xamarin Forms FilePicker FileResult I am using following code to pick a file using FilePicker in xamarin forms. End goal is to give Android Uri to a service in Xamarin.Android project, the service transfers the file to somewhere.
How do I get Android Uri(Android.Net.Uri )from FilePicker result in xamarin forms? Android service only accepts Android.Net.Uri type.
try
        {
            var result = await FilePicker.PickAsync(new PickOptions {

                PickerTitle = "Select zip file"
            });

            if (result != null)
            {
                FileNameLabel.Text = $"File Name: {result.FileName}";
                if (!result.FileName.EndsWith("zip", StringComparison.OrdinalIgnoreCase))
                {
                   await DisplayAlert("Wrong File", "Selected file is not right", "Ok");
                }

            }
        }
        catch (Exception ex)
        {
            // The user canceled or something went wrong
        }

I tried the following:
firmwareFullPath = result.FullPath;
Android.Net.Uri FirmwareUri = Android.Net.Uri.Parse(firmwareFullPath);

But the service gives file not found error.
The service works fine in Xamarin.Android project with the same file with native file picker activity where I get the Uri from intent returned after file selection.
Below is the comparison on Uri objects, one object generated using :
Android.Net.Uri.Parse(firmwareFullPath);

The other from
 protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
    {
        base.OnActivityResult(requestCode, resultCode, data);
            if ((resultCode == Result.Ok) && (data != null))
            {
                Android.Net.Uri FirmwareUri = data.Data;

            }

    }

Uri Object from Xamarin.Form FilePicker

Uri Object from Xamarin.Andriod

**Major difference is Authority and EncodedAuthority are null in case of xamarin forms filepicker **

A: The easiest way would be to use the path of this and create URI,
I am not sure what the response of PickAsync is but if I am not wrong you should be getting a Path.
var filePath = result.Path;

Now to convert this to Android URI just pass in the path as Parameter and you're done
var fileUri = Android.Net.Uri.Parse(filePath);

Goodluck!
Feel free to get back if you have queries

A: About getting picker uri file path in Forms and Android, I do one sample that you can take a look.
In Forms, using dependencyservice to get uri path.
Creating interface in Forms:
public  interface IFileChanged
{
    object filepath(string path);
}

In Android, to implement this interface:
[assembly: Dependency(typeof(FileChanged))]

namespace demo3.Droid
{
class FileChanged : IFileChanged
{
Android.Net.Uri uri;
    object IFileChanged.filepath(string path)
    {
        Java.IO.File file = new Java.IO.File(path);
        uri = Android.Net.Uri.FromFile(file);
        return uri;
    }
}}

private async void btn3_Clicked(object sender, EventArgs e)
    {
        var file = await CrossFilePicker.Current.PickFile();
        string path = file.FilePath;
        var fileuri = DependencyService.Get<IFileChanged>().filepath(path);

    }

The path like {file:///storage/emulated/0/Download/a5.jpg}
If you get picker file path in Android, the path like /document/raw:/storage/emulated/0/Download/a5.jpg, but it is the same file.
private void Filepicker_Click(object sender, System.EventArgs e)
    {
        Intent intent = new Intent(Intent.ActionGetContent);
        intent.SetType("*/*");

        try
        {
            StartActivityForResult(Intent.CreateChooser(intent, "Select a file"), 0);
        }
        catch (System.Exception exAct)
        {
            System.Diagnostics.Debug.Write(exAct);
        }

    }
    protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
    {
        base.OnActivityResult(requestCode, resultCode, data);
        if ((resultCode == Result.Ok) && (data != null))
        {
            Android.Net.Uri FirmwareUri = data.Data;
            string path = FirmwareUri.Path;
        }

    }


text:
Q: Inconsistent output of word frequency count in column pandas dataframe python So I have a simple dataframe in pandas, where one of the column consist of tweet messages. Each cell or row contains a tweet message. I am trying to do a word frequency count to detect what are the top 10 words in my dataframe. Reason being to remove them from my dataset by adding them to my list of stopwords.
Tried a few code snippets on my dataset, however confused as to why it yields different results when it comes to the count of frequency. Below comparison of codes.
Code 1
top_N = 10
a = train_data['tweet'].str.cat(sep='')
words = nltk.tokenize.word_tokenize(a)
word_dist = nltk.FreqDist(words)

Code 2
word_dist = pd.Series(' '.join(train_data['tweet']).lower().split()).value_counts()[:10]

The top 10 most frequent words are the same in both codes but the values or count of word distribution/frequency differed slightly i.e Code 1 had a slightly lower count for the same list of words in Code 2. They are both analyzing the same dataset. The difference is around 100 words. The only difference I see is that Code 1 tokenizes the words where as Code 2 splits the words, but they are essentially the same thing so what am I missing here? I realized that Code 1 yields nltk.probability.FreqDist whereas Code 2 pandas.core.series.Series. Can someone kindly break this down to me and explain the difference please ?

A: So apparently .word_tokenize() and .lower().split() do not yield the exact same results. What I can gather from the docs is that .word_tokenize() actually uses TreebankWordTokenizer which is based on regex. It is way more advanced than just splitting on whitespace and will to my estimation deal better with stuff like punctuation for example.


text:
Q: Rings whose spectrum is Hausdorff
Let $A$ be a commutative ring with $1$ and consider the Zariski topology on $\operatorname{Spec}(A)$. When will $\operatorname{Spec}(A)$ be a Hausdorff space?

If $A$ has positive or infinite Krull dimension, this can never happen because there are points which will be a proper subset of their closure. In dimension $0$, any Noetherian ring is also Artinian and thus has a discrete spectrum, which is therefore Hausdorff.
What about the non-Noetherian, zero-dimensional case? I suspect that there are such rings with a non-Hausdorff spec, but I failed to find an example.

A: For an affine scheme $S=\operatorname{Spec}(A)$ the following are equivalent:
1)   $A$ is zero-dimensional
2) $S$ has all its points closed (i.e. $S$ is $T_1$)
3)  $S$ is Hausdorff
4)  $S$ is compact Hausdorff
If moreover the ring $A$ is noetherian  the above are also equivalent to:
5) $A$ is Artinian
6) $S$ has the discrete topology
7) $S$ is finite and has the discrete topology
If moreover the ring $A$ is finitely generated over a field $k$ (and thus noetherian) the above are also equivalent to:
8)  $A$ is algebraic over $k$
9) $ \text {dim}_k(A)\lt \infty$
10) $\text {Card}(S)\lt \infty$
Examples of non-noetherian rings satisfying 1) to 4):
Any infinite product of any fields $A=\Pi_{i\in I} K_i$ ($I$ infinite)
Examples of noetherian rings which are not algebras over a field but satisfy 1) to 7):
$\mathbb Z/(n)$ with $n\gt 1$ and not prime.

A: The accepted answer is very satisfactory, but I realized that it was not that easy to find a reference that contains an actual proof of the equivalence between "$A$ is zero-dimensional" and "$\operatorname{Spec}(A)$ is Hausdorff". The reference given in one of the previous comments gives a completely broken proof, and it seems that the best option is to go back to Hochster's original article on the topology of spectral spaces. But that article is written in a purely topological language, and it can take a little work to translate everything in the language of rings, so I'm writing a self-contained proof here that can serve as a reference.

Theorem 1: Let $R$ be a commutative ring. Then $\operatorname{Spec}(R)$ is Hausdorff if and only if $R$ is zero-dimensional, in other words when every prime ideal of $R$ is maximal.

Obviously, only the direction "zero-dimensional implies Hausdorff" is non-trivial, since $R$ being zero-dimensional is equivalent to all prime ideals being maximal, in other words to all points in $\operatorname{Spec}(R)$ being closed, that is to $\operatorname{Spec}(R)$ satisfying the $T_1$ separation axiom, which is obviously weaker that the $T_2$ (Hausdorff) axiom.
It's actually not much harder to prove a deeper fact about separation in ring spectra:

Theorem 2: Let $R$ be a commutative ring, and let $p,q\in \operatorname{Spec}(R)$. Then exactly one of those two things holds:

*

*$p$ and $q$ admit disjoint neighborhoods in $\operatorname{Spec}(R)$;

*$p$ and $q$ both belong to the closure of a third point.

It is easy to see that Theorem 2 implies Theorem 1: indeed, if $\operatorname{Spec}(X)$ is $T_1$, then the closure of a point is just that point, so the second case in Theorem 2 happens iff $p=q$, and therefore distinct points have disjoint neighborhoods.
Now let us translate those two topological statements. If $x,y\in \operatorname{Spec}(R)$, then $y$ is in the closure of $x$ (one also says that $y$ is a specialization of $x$) if and only if $x\subset y$ as ideals. This is because the closure of $x$ (or rather of $\{x\}$) is the smallest $V(I)$, with $I$ an ideal, such that $x\in V(I)$, so $I$ is the largest ideal such that $I\subset x$, and obviously that is $I=x$; therefore $\overline{\{x\}} = V(x)$.
For the second statement, note that $\operatorname{Spec}(R)$ has an open basis given by the $D(f)=\{x\in \operatorname{Spec}(R) | f\not\in x\}$. So saying that $p$ and $q$ admit disjoint neighborhoods amounts to finding $f,g\in R$ such that $f\not\in p$ (ie $p\in D(f)$), $g\not\in q$ (ie $q\in D(g)$), and any prime ideal of $R$ contains at least one of $f$ or $g$ (ie $D(f)\cap D(g)=\emptyset$).
So we can reformulate Theorem 2 with an equivalent statement:

Theorem 3: Let $R$ be a commutative ring, and let $p,q\subset R$ be prime ideals. Then exactly one of those two things holds:

*

*there exist $f,g\in R$ with $f\not\in p$, $g\not\in q$, and every prime ideal of $R$ contains $f$ or $g$;

*there exists a prime ideal contained in $p\cap q$.

Topology put aside, it is very clear that those two things are incompatible: if $I\subset p\cap q$ is prime, $f\not\in p$ and $g\not\in q$, then clearly $I$ contains neither $f$ nor $g$. So to prove Theorem 3 we will assume that the first alternative fails, and show that the second holds.
Let us then assume that for all $f,g\in R$ such that $f\not\in p$ and $g\not\in q$, there exists a prime ideal $I\subset R$ which contains neither $f$ nor $g$. We will construct a prime ideal $J$ such that $J\subset p\cap q$.
Let $X = \operatorname{Spec}(R)\setminus (p\cap q)$. We want a prime ideal $J$ such that $J\cap X=\emptyset$. Of course, such a $J$ satisfies the weaker property that for any finite $A\subset X$, there is a prime ideal $I$ with $J\subset I$ and $I\cap A=\emptyset$ (just take $I=J$). Let us say that some subset $Y\subset R$ is a candidate if it satisfies this weaker property.
From the hypothesis, we can already see there is at least one candidate: $Y=\emptyset$. Indeed, by definition of $X$ the elements of some finite $A\subset X$ can be divided in some $f_i$ with $f_i\not\in p$ and some $g_i$ with $g_i\not\in q$. Then $f=\prod_i f_i$ is not in $p$ (since $p$ is prime) and $g= \prod_i g_i$ is not in $q$, so there exists a prime $I$ which contains neither $f$ nor $g$, and therefore $I\cap A=\emptyset$ (and of course $Y=\emptyset \subset I$).
Now by Zorn's lemma we can take a maximal candidate (for inclusion), and call it $J$. We then show that $J$ is a prime ideal contained in $p\cap q$. First note that by construction any candidate is disjoint with $X$, and therefore is contained in $p\cap q$. Also, it is trivial to see that if $Y$ is a candidate, then the ideal generated by $Y$ is also a candidate; therefore by maximality $J$ must be an ideal.
It remains to show that $J$ is prime. Let $f,g\in J$ such that $fg\in J$ but $g\not\in J$. We show that $J\cup \{f\}$ is a candidate, which by maximality will mean that $f\in J$. By maximality, $J\cup \{g\}$ is not a candidate, which means there exists a finite $A_0\subset X$ such that for any prime ideal $I$, if $J\subset I$ and $g\in I$ then $I\cap A_0\neq \emptyset$. Now let $A\subset X$ be finite. By hypothesis we have a prime $I$ such that $J\subset I$ and $I\cap (A\cup A_0)=\emptyset$. By choice of $A_0$, it is then not possible that $g\in I$. But since $fg\in J$, we have $fg\in I$, so since $I$ is prime we must have $f\in I$. This shows that $J\cup\{f\}\subset I$, and $I\cap A=\emptyset$, so $J\cup \{f\}$ is indeed a candidate, and we are done.


text:
Q: Rearrange xml node in xml file I have xml file like this
<?xml version="1.0" encoding="utf-8"?>
<TestSuite name="TestSuite1" UID="0" State="Indeterminate">
  <TestCase name="TestCase1" UID="1" State="Indeterminate" DataSourceId="1">
    <TestModule name="1" State="Unchecked" UID="1">
    </TestModule>
    <TestModule name="2" State="Unchecked" UID="2">
    </TestModule>
    <TestModule name="3" State="Unchecked" UID="3">
    </TestModule>
  </TestCase>
  <TestCase name="TestCase2" UID="33" State="Indeterminate" DataSourceId="1">
    <TestModule name="4" State="Unchecked" UID="4">
    </TestModule>
    <TestModule name="5" State="Unchecked" UID="5">
    </TestModule>
    <TestModule name="6" State="Unchecked" UID="6">
    </TestModule>
  </TestCase>
</TestSuite>

I have to remove TestModule name="3" to above or below TestModule name="1" node.
Updated file will be like this
<?xml version="1.0" encoding="utf-8"?>
<TestSuite name="TestSuite1" UID="0" State="Indeterminate">
  <TestCase name="TestCase1" UID="1" State="Indeterminate" DataSourceId="1">
    <TestModule name="3" State="Unchecked" UID="4bdb93ca-4f76-4709-ab88-13297def827b">
    </TestModule>
    <TestModule name="1" State="Unchecked" UID="5aa80bb6-9616-458c-b095-d6a0edbaf95b">
    </TestModule>
    <TestModule name="2" State="Unchecked" UID="2">
    </TestModule>
  </TestCase>
</TestSuite>

I have written below code for that
XmlDocument xDoc = new XmlDocument();
xDoc.Load(Path.Combine(@"D:\Test Suite\TestSuite.xml"));

///////////////////
XmlNode l_NodeToAppend = null;
foreach (XmlNode i in e.SourceModels)
{
    l_NodeToAppend = xDoc.SelectSingleNode(String.Format("//*[@UID='{0}']", ((XmlNode)i).Attributes["UID"].Value));//1
    if (l_NodeToAppend != null)
        break;
}

XmlNode l_targteNode = xDoc.SelectSingleNode(String.Format("//*[@UID='{0}']", ((XmlNode)e.TargetModel).Attributes["UID"].Value));//3

bool flag = false;
l_NodeToAppend.InsertBefore(l_NodeToAppend, l_targteNode);

It is giving error "Cannot insert a node or any ancestor of that node as a child of itself."

A: You must specify concrete node name as TestModule.
XmlNode l_NodeToAppend = null;
foreach (XmlNode i in e.SourceModels)
{
    l_NodeToAppend = xDoc.SelectSingleNode(string.Format("//TestModule[@UID='{0}']", i.Attributes["UID"].Value));
    if (l_NodeToAppend != null)
        break;
}

XmlNode l_targetNode = xDoc.SelectSingleNode(string.Format("//TestModule[@UID='{0}']", e.TargetModel.Attributes["UID"].Value));

l_targetNode.ParentNode.InsertBefore(l_NodeToAppend, l_targetNode);

And as already mentioned in another answer, you need to use the parent node

A: This worked.
The Xpath expressions must use the "name" attribute, since these children don't have numeric UID.
Also the InsertBefore is executed from the parent of the children, first argument is the child to be rearranged, second argument is the child used as a reference for the rearrangement.
        XmlNode l_NodeToAppend = l_NodeToAppend = xDoc.SelectSingleNode(String.Format("//*[@name='{0}']", 1));//1

        XmlNode l_targteNode = xDoc.SelectSingleNode(String.Format("//*[@name='{0}']", 3));//3

        bool flag = false;
        l_NodeToAppend.ParentNode.InsertBefore(l_targteNode,l_NodeToAppend);


text:
Q: click event is not working for dynamically created button I am using google translator which creates dynamically translator bar,it has show original button (click on below image link).
I want to fire click event of "show original" button manually using javascript or jquery but is is not working, see some of the code snippets that i tried.
$("#myBtn").click(function(){
    $("#\\:1\\.restore").click();
    //or
    $("#\\:1\\.restore").on('click');
    //or
    $("#\\:1\\.restore").trigger('click',jQuery.Event( "click" ));
    //or
    document.getElementById(':1.restore').click();
})

imageURL: http://1drv.ms/1KhfLbo

A: The event on myBtn is not fired and your event handler is not working.
For dynamically added elements use event delegation.
$(document).on('click', '#myBtn', function() {
    // Your Code Here
});

To trigger event:
$("#\\:1\\.restore").trigger('click');

A: You need delegate from a container such as document
$(document).on('click', '#\\:1\\.restore', function(){...}));

I want to fire click event of "show original" button manually

Use
$('#\\:1\\.restore').trigger('click')

or
$('#\\:1\\.restore').click();//with no parameters

A: I got the answer.
Actually translate bar was inside iframe tag, so we need to select iframe (container) then any element inside that.
$("#myBtn").click(function(){
    $('#\\:1\\.container').contents().find('#\\:1\\.restore').click();
});


text:
Q: Trying to use my iPhone to debug my apps from Xcode When I try to add my iPhone by

*

*List item

*plugging it in

*open the organizer window from Xcode

*click the + button (add to member center).

*I now get the following error saying my iPhone sdk does not match the Xcode's

installation of the iOS SDK. Please restore the device to a version of the OS listed below, or update to the latest version of the iOS SDK; which is available here.
Iphone model 4
OS Installed on Ted's iPhone
7.1.1 (11D201)
iPhone 4
Xcode Supported iOS Versions
(nothing listed)
When I go to the download button for Xcode I do not see anything for upgrade and the Xcode is the same version I have
5.1.1
I did notice that on the right it says the Xcode is using 7.1  while my iPhone has 7.1.1 is this the reason?
How can I get my iPhone sdk to be compatible with Xcode so I can start debugging my program?????

A: You need to check the iOS SDK for simulator in xcode. On xcode toolbar, click on the simulator list and then check list of available iOS SDK.

If iOS 7.1 is not present there, then you need to have updated xcode. Latest version of xcode is 5.1.1.
UPDATED:
If u didnot find any arrow after iPhone then open Preferences. Click on Xcode on top bar then select Preferences and then click on Download tab and then click on "Check and Install" button.


text:
Q: Evaluate sum of integral numerically with Matlab using for loops I'm trying to evaluate the following type of problem with Matlab.

where the summation is taken over wn which is a vector, and the variable of integration is wPrime. w, wn and Ri are given vectors.
What I've tried is the following: using two for-loops.
integral = zeros(size(wn));
sumF = zeros(size(w));

for j = 1:length(w);
    for k = 1:length(wn);
        integral(k) = trapz(wPrime,1./(w(j)-1i*wn(k)-wPrime));
    end
    sumF(j) = sum(integral.*wn./sqrt(Ri));
end

but I've understood that for loops are very slow in Matlab, so I´m wondering if there is a better approach to this problem?


text:
Q: Java Maps of Lamda Требуется перевести оператор switch в лямбда-выражения.
Для этого нужно сделать Map(у) с возможными командами, и в зависимости от символа сделать нужную операцию.
Вот моя неработающая попытка:

List<Operation> retValue2 = new ArrayList<>();
Map<String, Consumer<String>> activityMap = new HashMap<>();
Consumer<Integer> add = () -> {retValue2.add(new Operation(Operation.Type.ADD, +1));};
activityMap.put("+", add.accept());
Consumer<Integer> shift = () -> {retValue2.add(new Operation(Operation.Type.SHIFT, +1));};
activityMap.put(">", shift.accept());

Я пытался сделать это без Consumer, но я не понимаю, какой тип указать тогда в Map.
После нескольких попыток, решил, что нужно прийти к этому
List<Operation> retValue2 = new ArrayList<>();
        Map<String, ТУТ НУЖНО ЧТО-то вставить> activityMap = new HashMap<>();
        activityMap.put("+", () -> retValue2.add(new Operation(Operation.Type.ADD, +1));
        activityMap.put(">", () -> retValue2.add(new Operation(Operation.Type.SHIFT, +1));

A: Кажется вам нужно использовать интерфейс Runnable.
Пример:
public static void main(String[] args) {

   List<String> retValue2 = new ArrayList<>();
   Map<String, Runnable> activityMap = new HashMap<>();
   activityMap.put("+", () -> retValue2.add("new Object()"));
   activityMap.put(">", () -> retValue2.add("124"));

   activityMap.forEach((key, value) -> value.run());

   System.out.println(retValue2.toString());
}

Вывод в консоли:
[new Object(), 124]


text:
Q: show an element when another is out of viewport for mobile In vanilla Javascript how to show a "cart" button on the bottom of the page but only when the original "cart" button is out of viewport?
I don't understand how to check when an element goes out of viewport
It would be great if someone could point me in the right direction
*{
    box-sizing: border-box;
}

header{
    font-size:20px;
}
.sticky{
    background-color: rgb(144, 148, 144);
    padding:10px;

    text-align: center;
    position:sticky;
    width:100%;
}

.sticky button{
    padding: 10px;
    width: 80vw;
    font-size: 24px;
}

html
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <link rel="stylesheet" href="styles.css">

        Cart

        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's
        standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make
        a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting,
        remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing
        Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions
        of Lorem Ipsum

        <button >
            Add To cart
        </button>

Js
window.addEventListener('scroll',()=>{
    const scrollable = document.documentElement.scrollHeight - window.innerHeight
    const scrolled = window.scrollY;
    if(scrolled === scrollable) {
        console.log('bottom')
    }
});

A: This does the trick...
change .sticky to..
.sticky {
    background-color: rgb(144, 148, 144);
    padding:10px;
    text-align: center;
    width: 100%;
    position: relative;
}

Give sticky an id....

    <button >
        Add To cart
    </button>

And here is the JS...
var cartTop = document.getElementById('cartDiv').getBoundingClientRect().top;

window.addEventListener('scroll',()=>{
    if(window.scrollY > cartTop) {
        console.log('bottom');
        document.getElementById('cartDiv').style.position = 'fixed';
        document.getElementById('cartDiv').style.bottom = '0';
    } else {
        document.getElementById('cartDiv').style.position = 'relative';
        document.getElementById('cartDiv').style.bottom = '';
    }
});

https://jsfiddle.net/wz0mp3nc/1/


text:
Q: Module Controller redirects to 404 Prestashop I have a problem with my Prestashop, i would like to create a webpage in a module without using the CMS.
But when I want to access the controller by using this Url : http://example.com/comparateur/module/ProduitsMarchand/ProductList
I have that message & when i click on the link, i have a 404 error
[Debug] This page has moved
Please use the following URL instead: http://example.com/comparateur/index.php?controller=ProductList&module=ProduitsMarchand

My controller looks like this
class ProduitsMarchandProductListModuleFrontController extends ModuleFrontController {

    public $php_self ="ProductList";
    /**
     *  Initialize controller
     *  @see FrontController::init()
     */
    public function init() {
        parent::init();
    }

    /**
     *  Assign template vars related to page content
     *  @see FrontController::initContent()
     */
    public function initContent() {
        parent::initContent();

        $this->setTemplate("ProductList.tpl");
    }
}

Preferences  > SEO & URLs
Page: produitsmarchands - productlist
URL: product-list

A: You got a few fundamental mistakes.
First of all you should'nt be using FrontController but rather ModuleFrontController. Since you are extending a module not a fully sepearate new controller.
Next thing is that your class is wrong. It should be something similar to this.
YourModuleNameYourControllerNameModuleFrontcontroller
YourModuleName = name of your module
YourControllername = name of your controller and should be located in yourmodule/controllers/front
And last but not least this is completely wrong
$this->setTemplate(__FILE__.'/../../../views/templates/front/ProductList.tpl');

You should use this
$this->setTemplate('ProductList.tpl');

That way your file will be located in yourmodule/views/templates/front
And if you have followed all of those guidelines you should be able to set a friendly url for your moduelController in Preferences -> SEO & URL
BR's


text:
Q: Mass Deploy Outlook Plug-in I am developing a VSTO plug-in for Outlook so far so good. What is worrying me is how to deploy updated versions of the plug-in.
Since we have some policies I can only deploy manually on the PCs I do not wish to have to visit each PC on each update. So I was wondering if I can somehow put this plug-in in a shared drive and somehow deploy the new files next time outlook is opened.
Any ideas ? Any other solution?

A: I'm not quite sure on the exact policies which let you deploy the the updated versions only manually, but have you already looked into ClickOnce deployment? You would be able to update all addins centrally:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/1666d2b0-a4d0-41e8-ad86-5eab3542de1e/deploying-office-solutions-to-end-user-computers
As far as I know ClickOnce can also be used from a network share, but I've never tested this by myself:
http://msdn.microsoft.com/en-us/library/71baz9ah.aspx