问:
Unexpected response 408 log in cometd client side
I am using a java cometd client. It was connected for several minutes, but after sometime it logged following error. What I should do on error 408? Should I disconnect, terminate, abort or just ignore, call Java GC?

java.net.ProtocolException: Unexpected response 408 HTTP Error 408 Request timeout

The Web server (running the Web site) thinks that there has been too long an interval of time between

the establishment of an IP connection (socket) between the client (e.g. your Web browser or our CheckUpDown robot) and the server and

the receipt of any data on that socket, so the server has dropped the connection.

The socket connection has actually been lost - the Web server has timed out on that particular socket connection. The request from the client must be repeated - in a timely manner.

extended BayeuxClient

```<code>    public class EventHostClient extends BayeuxClient {
        private final Logger logger = LoggerFactory.getLogger(EventHostClient.class);

        public EventHostClient(String url, ClientTransport transport, ClientTransport... transports) {
            super(url, transport, transports);
        }

        @Override
        public void onFailure(Throwable x, Message[] messages) {
            logger.info("Messages failed "+ x.getMessage());
            logger.debug("Messages failed. Reason : " + Arrays.toString(messages), x);
        }
}
</code>```

Here is the log messages

```<code>2017-06-22 17:59:37.221 [HttpClient-2123] DEBUG c.q.q.n.i.eventhost.EventHostClient - Messages failed. Reason : [{id=4681, connectionType=long-polling, channel=/meta/connect, clientId=btom76smmlh9g4dyq2fkcd61}]
java.net.ProtocolException: Unexpected response 408: TransportExchange@5332249c=POST//10.2.2.250:18080/cometd/connect#CONTENT(0ms)->COMPLETED(0ms)sent=1012ms
    at org.cometd.client.BayeuxClient$PublishTransportListener.onProtocolError(BayeuxClient.java:1161) [cometd-java-client-2.5.0.jar:na]
    at org.cometd.client.transport.LongPollingTransport$TransportExchange.onResponseComplete(LongPollingTransport.java:324) [cometd-java-client-2.5.0.jar:na]
    at org.eclipse.jetty.client.HttpExchange$Listener.onResponseComplete(HttpExchange.java:1158) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.HttpExchange.setStatus(HttpExchange.java:305) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.AbstractHttpConnection$Handler.messageComplete(AbstractHttpConnection.java:337) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:637) [jetty-http-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) [jetty-http-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.AsyncHttpConnection.handle(AsyncHttpConnection.java:133) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627) [jetty-io-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51) [jetty-io-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) [jetty-util-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) [jetty-util-7.6.7.v20120910.jar:7.6.7.v20120910]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67]
2017-06-22 17:59:37.221 [HttpClient-2123] DEBUG c.q.q.n.i.sms.ChannelSubscriber - Recieved connection FAILED | {"message":{"id":"4681","connectionType":"long-polling","channel":"/meta/connect","clientId":"btom76smmlh9g4dyq2fkcd61"},"id":"4681","org.cometd.client.publishCallback":null,"exception":"java.net.ProtocolException: Unexpected response 408: TransportExchange@5332249c=POST//10.2.2.250:18080/cometd/connect#CONTENT(0ms)->COMPLETED(0ms)sent=1012ms","successful":false,"channel":"/meta/connect"} to subscriber id : 1
2017-06-22 17:59:37.221 [pool-513-thread-1] DEBUG c.q.q.n.i.e.E.1264409962 - Connecting, transport org.cometd.client.transport.LongPollingTransport@43e7229c
2017-06-22 17:59:37.221 [pool-513-thread-1] DEBUG c.q.q.n.i.e.E.1264409962 - Sending messages [{id=4683, connectionType=long-polling, channel=/meta/connect, clientId=btom76smmlh9g4dyq2fkcd61}]
2017-06-22 17:59:39.221 [pool-513-thread-1] DEBUG c.q.q.n.i.e.E.1264409962 - Connecting, transport org.cometd.client.transport.LongPollingTransport@43e7229c
2017-06-22 17:59:39.225 [pool-513-thread-1] DEBUG c.q.q.n.i.e.E.1264409962 - Sending messages [{id=4684, connectionType=long-polling, channel=/meta/connect, clientId=btom76smmlh9g4dyq2fkcd61}]
2017-06-22 17:59:39.230 [HttpClient-2123] DEBUG c.q.q.n.i.e.E.1264409962 - State update: CONNECTED -> UNCONNECTED
2017-06-22 17:59:39.230 [HttpClient-2123] INFO  c.q.q.n.i.eventhost.EventHostClient - Messages failed Unexpected response 408: TransportExchange@101a870=POST//10.2.2.250:18080/cometd/connect#CONTENT(0ms)->COMPLETED(0ms)sent=2009ms
2017-06-22 17:59:39.230 [HttpClient-2123] DEBUG c.q.q.n.i.eventhost.EventHostClient - Messages failed. Reason : [{id=4683, connectionType=long-polling, channel=/meta/connect, clientId=btom76smmlh9g4dyq2fkcd61}]
java.net.ProtocolException: Unexpected response 408: TransportExchange@101a870=POST//10.2.2.250:18080/cometd/connect#CONTENT(0ms)->COMPLETED(0ms)sent=2009ms
    at org.cometd.client.BayeuxClient$PublishTransportListener.onProtocolError(BayeuxClient.java:1161) [cometd-java-client-2.5.0.jar:na]
    at org.cometd.client.transport.LongPollingTransport$TransportExchange.onResponseComplete(LongPollingTransport.java:324) [cometd-java-client-2.5.0.jar:na]
    at org.eclipse.jetty.client.HttpExchange$Listener.onResponseComplete(HttpExchange.java:1158) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.HttpExchange.setStatus(HttpExchange.java:305) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.AbstractHttpConnection$Handler.messageComplete(AbstractHttpConnection.java:337) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:637) [jetty-http-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) [jetty-http-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.AsyncHttpConnection.handle(AsyncHttpConnection.java:133) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627) [jetty-io-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51) [jetty-io-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) [jetty-util-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) [jetty-util-7.6.7.v20120910.jar:7.6.7.v20120910]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67]
2017-06-22 17:59:39.230 [HttpClient-2123] DEBUG c.q.q.n.i.sms.ChannelSubscriber - Recieved connection FAILED | {"message":{"id":"4683","connectionType":"long-polling","channel":"/meta/connect","clientId":"btom76smmlh9g4dyq2fkcd61"},"id":"4683","org.cometd.client.publishCallback":null,"exception":"java.net.ProtocolException: Unexpected response 408: TransportExchange@101a870=POST//10.2.2.250:18080/cometd/connect#CONTENT(0ms)->COMPLETED(0ms)sent=2009ms","successful":false,"channel":"/meta/connect"} to subscriber id : 1
2017-06-22 17:59:40.231 [pool-513-thread-1] DEBUG c.q.q.n.i.e.E.1264409962 - Connecting, transport org.cometd.client.transport.LongPollingTransport@43e7229c
2017-06-22 17:59:40.231 [pool-513-thread-1] DEBUG c.q.q.n.i.e.E.1264409962 - Sending messages [{id=4685, connectionType=long-polling, advice={timeout=0}, channel=/meta/connect, clientId=btom76smmlh9g4dyq2fkcd61}]
2017-06-22 17:59:40.236 [HttpClient-2120] DEBUG c.q.q.n.i.e.E.1264409962 - State update: UNCONNECTED -> UNCONNECTED
2017-06-22 17:59:40.236 [HttpClient-2124] DEBUG c.q.q.n.i.e.E.1264409962 - Processing meta connect {id=4685, successful=true, channel=/meta/connect, advice={interval=0, reconnect=retry, timeout=30000}}
2017-06-22 17:59:40.236 [HttpClient-2120] INFO  c.q.q.n.i.eventhost.EventHostClient - Messages failed Unexpected response 408: TransportExchange@13d95194=POST//10.2.2.250:18080/cometd/connect#CONTENT(0ms)->COMPLETED(0ms)sent=1010ms
2017-06-22 17:59:40.236 [HttpClient-2124] DEBUG c.q.q.n.i.e.E.1264409962 - State update: UNCONNECTED -> CONNECTED
2017-06-22 17:59:40.236 [HttpClient-2124] DEBUG c.q.q.n.i.sms.ChannelSubscriber - Recieved connection confirmed | {"id":"4685","successful":true,"channel":"/meta/connect","advice":{"interval":0,"reconnect":"retry","timeout":30000}} to subscriber id : 1
2017-06-22 17:59:40.236 [HttpClient-2120] DEBUG c.q.q.n.i.eventhost.EventHostClient - Messages failed. Reason : [{id=4684, connectionType=long-polling, channel=/meta/connect, clientId=btom76smmlh9g4dyq2fkcd61}]
java.net.ProtocolException: Unexpected response 408: TransportExchange@13d95194=POST//10.2.2.250:18080/cometd/connect#CONTENT(0ms)->COMPLETED(0ms)sent=1010ms
    at org.cometd.client.BayeuxClient$PublishTransportListener.onProtocolError(BayeuxClient.java:1161) [cometd-java-client-2.5.0.jar:na]
    at org.cometd.client.transport.LongPollingTransport$TransportExchange.onResponseComplete(LongPollingTransport.java:324) [cometd-java-client-2.5.0.jar:na]
    at org.eclipse.jetty.client.HttpExchange$Listener.onResponseComplete(HttpExchange.java:1158) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.HttpExchange.setStatus(HttpExchange.java:305) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.AbstractHttpConnection$Handler.messageComplete(AbstractHttpConnection.java:337) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:637) [jetty-http-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) [jetty-http-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.AsyncHttpConnection.handle(AsyncHttpConnection.java:133) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627) [jetty-io-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51) [jetty-io-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) [jetty-util-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) [jetty-util-7.6.7.v20120910.jar:7.6.7.v20120910]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67]
</code>```

答:
I raised the question in the github where the project is hosted. The author(Mr. Simone Bordet) of the cometd said that I am using a very old cometd version. He asked me to upgrade to the cometd 3.1.2. Currently we are upgrading our app with cometd.

https://github.com/cometd/cometd/issues/730

Body:
I am using a java cometd client. It was connected for several minutes, but after sometime it logged following error. What I should do on error 408? Should I disconnect, terminate, abort or just ignore, call Java GC?

java.net.ProtocolException: Unexpected response 408 HTTP Error 408 Request timeout

The Web server (running the Web site) thinks that there has been too long an interval of time between

the establishment of an IP connection (socket) between the client (e.g. your Web browser or our CheckUpDown robot) and the server and

the receipt of any data on that socket, so the server has dropped the connection.

The socket connection has actually been lost - the Web server has timed out on that particular socket connection. The request from the client must be repeated - in a timely manner.

extended BayeuxClient

    public class EventHostClient extends BayeuxClient {
        private final Logger logger = LoggerFactory.getLogger(EventHostClient.class);

        public EventHostClient(String url, ClientTransport transport, ClientTransport... transports) {
            super(url, transport, transports);
        }

        @Override
        public void onFailure(Throwable x, Message[] messages) {
            logger.info("Messages failed "+ x.getMessage());
            logger.debug("Messages failed. Reason : " + Arrays.toString(messages), x);
        }
}

Here is the log messages

2017-06-22 17:59:37.221 [HttpClient-2123] DEBUG c.q.q.n.i.eventhost.EventHostClient - Messages failed. Reason : [{id=4681, connectionType=long-polling, channel=/meta/connect, clientId=btom76smmlh9g4dyq2fkcd61}]
java.net.ProtocolException: Unexpected response 408: TransportExchange@5332249c=POST//10.2.2.250:18080/cometd/connect#CONTENT(0ms)->COMPLETED(0ms)sent=1012ms
    at org.cometd.client.BayeuxClient$PublishTransportListener.onProtocolError(BayeuxClient.java:1161) [cometd-java-client-2.5.0.jar:na]
    at org.cometd.client.transport.LongPollingTransport$TransportExchange.onResponseComplete(LongPollingTransport.java:324) [cometd-java-client-2.5.0.jar:na]
    at org.eclipse.jetty.client.HttpExchange$Listener.onResponseComplete(HttpExchange.java:1158) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.HttpExchange.setStatus(HttpExchange.java:305) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.AbstractHttpConnection$Handler.messageComplete(AbstractHttpConnection.java:337) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:637) [jetty-http-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) [jetty-http-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.AsyncHttpConnection.handle(AsyncHttpConnection.java:133) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627) [jetty-io-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51) [jetty-io-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) [jetty-util-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) [jetty-util-7.6.7.v20120910.jar:7.6.7.v20120910]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67]
2017-06-22 17:59:37.221 [HttpClient-2123] DEBUG c.q.q.n.i.sms.ChannelSubscriber - Recieved connection FAILED | {"message":{"id":"4681","connectionType":"long-polling","channel":"/meta/connect","clientId":"btom76smmlh9g4dyq2fkcd61"},"id":"4681","org.cometd.client.publishCallback":null,"exception":"java.net.ProtocolException: Unexpected response 408: TransportExchange@5332249c=POST//10.2.2.250:18080/cometd/connect#CONTENT(0ms)->COMPLETED(0ms)sent=1012ms","successful":false,"channel":"/meta/connect"} to subscriber id : 1
2017-06-22 17:59:37.221 [pool-513-thread-1] DEBUG c.q.q.n.i.e.E.1264409962 - Connecting, transport org.cometd.client.transport.LongPollingTransport@43e7229c
2017-06-22 17:59:37.221 [pool-513-thread-1] DEBUG c.q.q.n.i.e.E.1264409962 - Sending messages [{id=4683, connectionType=long-polling, channel=/meta/connect, clientId=btom76smmlh9g4dyq2fkcd61}]
2017-06-22 17:59:39.221 [pool-513-thread-1] DEBUG c.q.q.n.i.e.E.1264409962 - Connecting, transport org.cometd.client.transport.LongPollingTransport@43e7229c
2017-06-22 17:59:39.225 [pool-513-thread-1] DEBUG c.q.q.n.i.e.E.1264409962 - Sending messages [{id=4684, connectionType=long-polling, channel=/meta/connect, clientId=btom76smmlh9g4dyq2fkcd61}]
2017-06-22 17:59:39.230 [HttpClient-2123] DEBUG c.q.q.n.i.e.E.1264409962 - State update: CONNECTED -> UNCONNECTED
2017-06-22 17:59:39.230 [HttpClient-2123] INFO  c.q.q.n.i.eventhost.EventHostClient - Messages failed Unexpected response 408: TransportExchange@101a870=POST//10.2.2.250:18080/cometd/connect#CONTENT(0ms)->COMPLETED(0ms)sent=2009ms
2017-06-22 17:59:39.230 [HttpClient-2123] DEBUG c.q.q.n.i.eventhost.EventHostClient - Messages failed. Reason : [{id=4683, connectionType=long-polling, channel=/meta/connect, clientId=btom76smmlh9g4dyq2fkcd61}]
java.net.ProtocolException: Unexpected response 408: TransportExchange@101a870=POST//10.2.2.250:18080/cometd/connect#CONTENT(0ms)->COMPLETED(0ms)sent=2009ms
    at org.cometd.client.BayeuxClient$PublishTransportListener.onProtocolError(BayeuxClient.java:1161) [cometd-java-client-2.5.0.jar:na]
    at org.cometd.client.transport.LongPollingTransport$TransportExchange.onResponseComplete(LongPollingTransport.java:324) [cometd-java-client-2.5.0.jar:na]
    at org.eclipse.jetty.client.HttpExchange$Listener.onResponseComplete(HttpExchange.java:1158) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.HttpExchange.setStatus(HttpExchange.java:305) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.AbstractHttpConnection$Handler.messageComplete(AbstractHttpConnection.java:337) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:637) [jetty-http-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) [jetty-http-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.AsyncHttpConnection.handle(AsyncHttpConnection.java:133) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627) [jetty-io-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51) [jetty-io-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) [jetty-util-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) [jetty-util-7.6.7.v20120910.jar:7.6.7.v20120910]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67]
2017-06-22 17:59:39.230 [HttpClient-2123] DEBUG c.q.q.n.i.sms.ChannelSubscriber - Recieved connection FAILED | {"message":{"id":"4683","connectionType":"long-polling","channel":"/meta/connect","clientId":"btom76smmlh9g4dyq2fkcd61"},"id":"4683","org.cometd.client.publishCallback":null,"exception":"java.net.ProtocolException: Unexpected response 408: TransportExchange@101a870=POST//10.2.2.250:18080/cometd/connect#CONTENT(0ms)->COMPLETED(0ms)sent=2009ms","successful":false,"channel":"/meta/connect"} to subscriber id : 1
2017-06-22 17:59:40.231 [pool-513-thread-1] DEBUG c.q.q.n.i.e.E.1264409962 - Connecting, transport org.cometd.client.transport.LongPollingTransport@43e7229c
2017-06-22 17:59:40.231 [pool-513-thread-1] DEBUG c.q.q.n.i.e.E.1264409962 - Sending messages [{id=4685, connectionType=long-polling, advice={timeout=0}, channel=/meta/connect, clientId=btom76smmlh9g4dyq2fkcd61}]
2017-06-22 17:59:40.236 [HttpClient-2120] DEBUG c.q.q.n.i.e.E.1264409962 - State update: UNCONNECTED -> UNCONNECTED
2017-06-22 17:59:40.236 [HttpClient-2124] DEBUG c.q.q.n.i.e.E.1264409962 - Processing meta connect {id=4685, successful=true, channel=/meta/connect, advice={interval=0, reconnect=retry, timeout=30000}}
2017-06-22 17:59:40.236 [HttpClient-2120] INFO  c.q.q.n.i.eventhost.EventHostClient - Messages failed Unexpected response 408: TransportExchange@13d95194=POST//10.2.2.250:18080/cometd/connect#CONTENT(0ms)->COMPLETED(0ms)sent=1010ms
2017-06-22 17:59:40.236 [HttpClient-2124] DEBUG c.q.q.n.i.e.E.1264409962 - State update: UNCONNECTED -> CONNECTED
2017-06-22 17:59:40.236 [HttpClient-2124] DEBUG c.q.q.n.i.sms.ChannelSubscriber - Recieved connection confirmed | {"id":"4685","successful":true,"channel":"/meta/connect","advice":{"interval":0,"reconnect":"retry","timeout":30000}} to subscriber id : 1
2017-06-22 17:59:40.236 [HttpClient-2120] DEBUG c.q.q.n.i.eventhost.EventHostClient - Messages failed. Reason : [{id=4684, connectionType=long-polling, channel=/meta/connect, clientId=btom76smmlh9g4dyq2fkcd61}]
java.net.ProtocolException: Unexpected response 408: TransportExchange@13d95194=POST//10.2.2.250:18080/cometd/connect#CONTENT(0ms)->COMPLETED(0ms)sent=1010ms
    at org.cometd.client.BayeuxClient$PublishTransportListener.onProtocolError(BayeuxClient.java:1161) [cometd-java-client-2.5.0.jar:na]
    at org.cometd.client.transport.LongPollingTransport$TransportExchange.onResponseComplete(LongPollingTransport.java:324) [cometd-java-client-2.5.0.jar:na]
    at org.eclipse.jetty.client.HttpExchange$Listener.onResponseComplete(HttpExchange.java:1158) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.HttpExchange.setStatus(HttpExchange.java:305) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.AbstractHttpConnection$Handler.messageComplete(AbstractHttpConnection.java:337) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:637) [jetty-http-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) [jetty-http-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.client.AsyncHttpConnection.handle(AsyncHttpConnection.java:133) [jetty-client-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627) [jetty-io-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51) [jetty-io-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) [jetty-util-7.6.7.v20120910.jar:7.6.7.v20120910]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) [jetty-util-7.6.7.v20120910.jar:7.6.7.v20120910]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67]


来源: stackexchange

问:
Reference generated primary key in SQL script
I'm trying to create a bunch of entries in a database with a single script and the problem I'm encountering is how to reference the generated primary key of the previous entry I created.

For example if I created a customer, then tried to create an order for that customer, how do I get the primary key generated for the customer?

I'm using SQLServer.

答:
If you are inserting multiple rows at once, you can get all the identities (for use in, say, creating related records) by using the OUTPUT INTO feature of SQL Server 2005 or later.

This could avoid you having to write loops and cursors etc.

OwnerDisplayName: Kenny

ContentLicense: CC BY-SA 2.5

OwnerDisplayName: Cade Roux


问:
Include CSS and JS in PHP based on condition
Is there a way to search the PHP content body while it is being parsed by PHP for certain keywords, so I can include CSS and JS files based on the presence of those keywords before the page is being served?

If PHP would have a variable like $_CONTENT_BODY where it outputs the parsed page into, then I could search for keywords like in this example:

if(stripos($_CONTENT_BODY, 'usetinymce') !== false)) echo '';

答:
You can include another php file and get the results with ob_start/ob_get_clean()

```<code>ob_start();
include 'myfile.php';
$_CONTENT_BODY = ob_get_clean();
</code>```

But you will encounters some problems, like white pages on some php errors.
It is better to build your app more logicaly instead of doing some dirty search & replace.

ContentLicense: CC BY-SA 3.0

Body:
You can include another php file and get the results with ob_start/ob_get_clean()

ob_start();
include 'myfile.php';
$_CONTENT_BODY = ob_get_clean();

But you will encounters some problems, like white pages on some php errors.
It is better to build your app more logicaly instead of doing some dirty search & replace.


问:
php - deep search array of arrays and return only matching elements
I am looking for a solution in php as mentioned in the accepted answer of this question:

javascript - return parent with only child that matches given search string in array of objects with nested object

Please find below code:

```<code><?php
    $items = array(
        'tableData' => array
        (
            array
            (
                'booking_name' => 'abc/xyz/123',
                'pdg' => 'assure',
                'user_area' => 'es st1',
                'release' => 'oss72',
                'start_date' => '2017-06-20 00:00:00',
                'end_date' => '2017-06-23 00:00:00',
                'asset_info' => array
                    (
                        array
                            (
                                'status' => 10,
                                'manufacturer' => 'Oracle',
                                'model' => 'HP BL460C GEN8',
                                'hardware_color' => '#0066b3',
                            ),
                        array
                            (
                                'status' => 11,
                                'manufacturer' => 'HP',
                                'model' => 'HP BL460C GEN81',
                                'hardware_color' => '#0066b3',
                            )

                    ),

                'full_name' => 'Valay Desai',
                'email_address' => 'valay@xyz.com',
            ),

            array
            (
                'booking_name' => 'abc/xyz/123',
                'pdg' => 'enm',
                'user_area' => 'es st',
                'release' => 'oss72',
                'start_date' => '2017-06-20 00:00:00',
                'end_date' => '2017-06-23 00:00:00',
                'asset_info' => array
                    (
                        array
                            (
                                'status' => 10,
                                'manufacturer' => 'HP',
                                'model' => 'HP BL460C GEN8',
                                'hardware_color' => '#0066b3',
                            )

                    ),

                'full_name' => 'Valay Desai',
                'email_address' => 'valay@xyz.com',
            )
        )
    );

function getParentStackComplete($child, $stack) {
    $return = array();
    foreach ($stack as $k => $v) {
        if (is_array($v)) {
            // If the current element of the array is an array, recurse it
            // and capture the return stack
            $stack = getParentStackComplete($child, $v);

            // If the return stack is an array, add it to the return
            if (is_array($stack) && !empty($stack)) {
                $return[] = $v;
            }
        } else {
            // Since we are not on an array, compare directly
            if(strpos($v, $child) !== false){
                // And if we match, stack it and return it
                $return[] = $v;
            }
        }
    }

    // Return the stack
    return empty($return) ? false: $return;
}

echo "```";
print_r(getParentStackComplete('Oracle', $items['tableData']));
echo "```";

?>
</code>```

This code works fine. I found the function getParentStackComplete online, modified it to return the whole matching element. It search the array recursively and return matching items.

For example, as given in the code, If I search for a string 'Oracle', it should return an array with one item which has only one child(matching element) in asset_info. The output I am looking for is:

```<code>Array
(
    [0] => Array
        (
            [booking_name] => abc/xyz/123
            [pdg] => assure
            [user_area] => es st1
            [release] => oss72
            [start_date] => 2017-06-20 00:00:00
            [end_date] => 2017-06-23 00:00:00
            [asset_info] => Array
                (
                    [0] => Array
                        (
                            [status] => 10
                            [manufacturer] => Oracle
                            [model] => HP BL460C GEN8
                            [hardware_color] => #0066b3
                        )
                )

            [full_name] => Valay Desai
            [email_address] => valay@xyz.com
        )

)
</code>```

If I search for a string HP BL460C GEN8, it should return as below:

```<code>Array
(
    [0] => Array
        (
            [booking_name] => abc/xyz/123
            [pdg] => assure
            [user_area] => es st1
            [release] => oss72
            [start_date] => 2017-06-20 00:00:00
            [end_date] => 2017-06-23 00:00:00
            [asset_info] => Array
                (
                    [0] => Array
                        (
                            [status] => 10
                            [manufacturer] => Oracle
                            [model] => HP BL460C GEN8
                            [hardware_color] => #0066b3
                        )
                )

            [full_name] => Valay Desai
            [email_address] => valay@xyz.com
        )
       [1] => Array
       (
          'booking_name' => 'abc/xyz/123',
                'pdg' => 'enm',
                'user_area' => 'es st',
                'release' => 'oss72',
                'start_date' => '2017-06-20 00:00:00',
                'end_date' => '2017-06-23 00:00:00',
                'asset_info' => array
                    (
                        array
                            (
                                'status' => 10,
                                'manufacturer' => 'HP',
                                'model' => 'HP BL460C GEN8',
                                'hardware_color' => '#0066b3',
                            )

                    ),

                'full_name' => 'Valay Desai',
                'email_address' => 'valay@xyz.com'
       )

)
</code>```

How do I return matching child with parent in nested array search ?

答:
Try this code.</p>

```<code>function getParentStackComplete( $search, $stack ){

    $results = array();

    foreach( $stack as $item ){

        if( is_array( $item ) ){

            if( array_filter($item, function($var) use ($search) { return ( !is_array( $var ) )? stristr( $var, $search ): false; } ) ){
                //echo 'test';
                $results[] = $item;
                continue;
            }else if( array_key_exists('asset_info', $item) ){
                $find_assets = array();
                foreach( $item['asset_info'] as $k=>$v ){
                    //echo 'abc ';

                    if( is_array( $v ) && array_filter($v, function($var) use ($search) { return stristr($var, $search); }) ){
                        $find_assets[] = $v;
                    }
                }
                if( count( $find_assets ) ){
                    $temp = $item;
                    $temp['asset_info'] = $find_assets;
                    $results[] = $temp;
                }
            }
        }
    }

    return $results;
}
</code>```

Body:
I am looking for a solution in php as mentioned in the accepted answer of this question:

javascript - return parent with only child that matches given search string in array of objects with nested object

Please find below code:

<?php
    $items = array(
        'tableData' => array
        (
            array
            (
                'booking_name' => 'abc/xyz/123',
                'pdg' => 'assure',
                'user_area' => 'es st1',
                'release' => 'oss72',
                'start_date' => '2017-06-20 00:00:00',
                'end_date' => '2017-06-23 00:00:00',
                'asset_info' => array
                    (
                        array
                            (
                                'status' => 10,
                                'manufacturer' => 'Oracle',
                                'model' => 'HP BL460C GEN8',
                                'hardware_color' => '#0066b3',
                            ),
                        array
                            (
                                'status' => 11,
                                'manufacturer' => 'HP',
                                'model' => 'HP BL460C GEN81',
                                'hardware_color' => '#0066b3',
                            )

                    ),

                'full_name' => 'Valay Desai',
                'email_address' => 'valay@xyz.com',
            ),

            array
            (
                'booking_name' => 'abc/xyz/123',
                'pdg' => 'enm',
                'user_area' => 'es st',
                'release' => 'oss72',
                'start_date' => '2017-06-20 00:00:00',
                'end_date' => '2017-06-23 00:00:00',
                'asset_info' => array
                    (
                        array
                            (
                                'status' => 10,
                                'manufacturer' => 'HP',
                                'model' => 'HP BL460C GEN8',
                                'hardware_color' => '#0066b3',
                            )

                    ),

                'full_name' => 'Valay Desai',
                'email_address' => 'valay@xyz.com',
            )
        )
    );

function getParentStackComplete($child, $stack) {
    $return = array();
    foreach ($stack as $k => $v) {
        if (is_array($v)) {
            // If the current element of the array is an array, recurse it
            // and capture the return stack
            $stack = getParentStackComplete($child, $v);

            // If the return stack is an array, add it to the return
            if (is_array($stack) && !empty($stack)) {
                $return[] = $v;
            }
        } else {
            // Since we are not on an array, compare directly
            if(strpos($v, $child) !== false){
                // And if we match, stack it and return it
                $return[] = $v;
            }
        }
    }

    // Return the stack
    return empty($return) ? false: $return;
}

echo "
";
print_r(getParentStackComplete('Oracle', $items['tableData']));
echo "
";

?>

This code works fine. I found the function getParentStackComplete online, modified it to return the whole matching element. It search the array recursively and return matching items.

For example, as given in the code, If I search for a string 'Oracle', it should return an array with one item which has only one child(matching element) in asset_info. The output I am looking for is:

Array
(
    [0] => Array
        (
            [booking_name] => abc/xyz/123
            [pdg] => assure
            [user_area] => es st1
            [release] => oss72
            [start_date] => 2017-06-20 00:00:00
            [end_date] => 2017-06-23 00:00:00
            [asset_info] => Array
                (
                    [0] => Array
                        (
                            [status] => 10
                            [manufacturer] => Oracle
                            [model] => HP BL460C GEN8
                            [hardware_color] => #0066b3
                        )
                )

            [full_name] => Valay Desai
            [email_address] => valay@xyz.com
        )

)

If I search for a string HP BL460C GEN8, it should return as below:

Array
(
    [0] => Array
        (
            [booking_name] => abc/xyz/123
            [pdg] => assure
            [user_area] => es st1
            [release] => oss72
            [start_date] => 2017-06-20 00:00:00
            [end_date] => 2017-06-23 00:00:00
            [asset_info] => Array
                (
                    [0] => Array
                        (
                            [status] => 10
                            [manufacturer] => Oracle
                            [model] => HP BL460C GEN8
                            [hardware_color] => #0066b3
                        )
                )

            [full_name] => Valay Desai
            [email_address] => valay@xyz.com
        )
       [1] => Array
       (
          'booking_name' => 'abc/xyz/123',
                'pdg' => 'enm',
                'user_area' => 'es st',
                'release' => 'oss72',
                'start_date' => '2017-06-20 00:00:00',
                'end_date' => '2017-06-23 00:00:00',
                'asset_info' => array
                    (
                        array
                            (
                                'status' => 10,
                                'manufacturer' => 'HP',
                                'model' => 'HP BL460C GEN8',
                                'hardware_color' => '#0066b3',
                            )

                    ),

                'full_name' => 'Valay Desai',
                'email_address' => 'valay@xyz.com'
       )

)

How do I return matching child with parent in nested array search ?

Body:
Try this code.

function getParentStackComplete( $search, $stack ){

    $results = array();

    foreach( $stack as $item ){

        if( is_array( $item ) ){

            if( array_filter($item, function($var) use ($search) { return ( !is_array( $var ) )? stristr( $var, $search ): false; } ) ){
                //echo 'test';
                $results[] = $item;
                continue;
            }else if( array_key_exists('asset_info', $item) ){
                $find_assets = array();
                foreach( $item['asset_info'] as $k=>$v ){
                    //echo 'abc ';

                    if( is_array( $v ) && array_filter($v, function($var) use ($search) { return stristr($var, $search); }) ){
                        $find_assets[] = $v;
                    }
                }
                if( count( $find_assets ) ){
                    $temp = $item;
                    $temp['asset_info'] = $find_assets;
                    $results[] = $temp;
                }
            }
        }
    }

    return $results;
}


问:
How can I opt for React Styled-Components to generate a physical CSS file?
I need the CSS that is provided to styled-components to be output to a physical CSS file inside of my public/css directory.

```<code>export const MyComp = styled.div`
  width: 100%;
  height: 500px;
`
</code>```

Along with styles from all other styled-components, the above component would output into public/css/styled.css:

```<code>.Components_MyComp__a39t9ag0248f {
  width: 100%;
  height: 500px;
}
</code>```

I am using:

```<code>"webpack": "^2.6.1",
"styled-components": "^2.0.1",
</code>```

答:
This is currently not possible/supported. Doing extraction of static styles is very hard, for example consider a function interpolation:

```<code>const Test = styled.div`
  color: ${props => props.color};
`
</code>```

How are we going to extract this? We could only extract the static parts of the CSS, but there's a lot of edge cases and constraints that make this hard to build.

We're currently investigating and experimenting to figure out what the best approach might be. For now check out our Babel plugin to see some things were working on at the compile time step!

Body:
I need the CSS that is provided to styled-components to be output to a physical CSS file inside of my public/css directory.

export const MyComp = styled.div`
  width: 100%;
  height: 500px;
`

Along with styles from all other styled-components, the above component would output into public/css/styled.css:

.Components_MyComp__a39t9ag0248f {
  width: 100%;
  height: 500px;
}

I am using:

"webpack": "^2.6.1",
"styled-components": "^2.0.1",

Body:
This is currently not possible/supported. Doing extraction of static styles is very hard, for example consider a function interpolation:

const Test = styled.div`
  color: ${props => props.color};
`

How are we going to extract this? We could only extract the static parts of the CSS, but there's a lot of edge cases and constraints that make this hard to build.

We're currently investigating and experimenting to figure out what the best approach might be. For now check out our Babel plugin to see some things were working on at the compile time step!


问:
Email validation not stopping the web page from submitting the form php
```<code><?php
    var_dump($_POST);
    if(isset($_POST['email'])
        && isset($_POST['name'])) {

            if (empty($_POST["name"])) {
                    $nameErr = "Name is required";
            }
            else {
                    $name = $_POST["name"];
                    var_dump($name);
     // check if name only contains letters and whitespace  for first name
                    if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
                            $nameErr = "Only letters and white space
                                         allowed";
                    }
            }

            if (empty($_POST["email"])) {
                    $emailErr = "Email is required";
            }
            else {
                    $email = $_POST["email"];
                    var_dump($email);
                    // check if e-mail address is well-formed
                    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
                            $emailErr = "Invalid email format";
                    }
            }

            if($data = $_POST['name'] . "\n" .
                   $_POST['email'] . "\n" .
                   $_POST['phone'] . "\n" .
                   $_POST['county'] . "\n" .
                   $_POST['floor'] . "\n" .
                   $_POST['descr'] . "\n"){

                    echo "Thank you for your inquery!" . "<br/>" .
                            "an estimator will be with you shortly.";

                    mail('myemail@gmail.com', 'Estimation Request',
                         $data);
            }
    }

    else {
            die('no post data to process');
    }

?>
</code>```

The output:

array(5) { ["name"]=> string(12) "Nicholas Cox" ["email"]=> string(6)
  "######" ["phone"]=> string(10) "0000000000" ["county"]=> string(8)
  "Pinellas" ["descr"]=> string(15) "Thesh " }

string(12) "Nicholas Cox" string(6) "######"

Thank you for your inquery!
an estimator will be with you shortly.\n\nInvalid email format\n

Note: if i missed taking out some of my troubleshooting steps like the random echos or die functions please let me know so i can edit to
  help you be able to read it easier

I have not added validation on the other fields. I'm just trying to get the email and name to work before i add to the others.

Right now, when i add random stuff it will still prompt me with my error message but it still allows anything to be put in the text field AND sends the email. I've watched a few tutorials on youtube and i still can't get it right.

答:
Example what you can do with validation with your code.</p>

```<code><?php
            var_dump($_POST);
        $errorArr = array(); //Error Messages in array
            if(isset($_POST['email'])
                && isset($_POST['name'])) {

                    if (empty($_POST["name"])) {
                            $errorArr['nameErr'] = "Name is required"; //Error Messages in array
                    }
                    else {
                            $name = $_POST["name"];
                            var_dump($name); // This should be commented
             // check if name only contains letters and whitespace  for first name
                            if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
                                    $errorArr['nameErr'] = "Only letters and white space
                                                 allowed";//Error Messages in array
                            }
                    }

                    if (empty($_POST["email"])) {
                            $errorArr['emailErr'] = "Email is required";
                    }
                    else {
                            $email = $_POST["email"];
                            var_dump($email); // This should be commented
                            // check if e-mail address is well-formed
                            if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
                                    $errorArr['emailErr'] = "Invalid email format";
                            }
                    }

        //Check Condition for any error
                    if(empty($errorArr)){

                           $data = $_POST['name'] . "\n" .
                           $_POST['email'] . "\n" .
                           $_POST['phone'] . "\n" .
                           $_POST['county'] . "\n" .
                           $_POST['floor'] . "\n" .
                           $_POST['descr'] . "\n"

                            echo "Thank you for your inquery!" . "<br/>" .
                                    "an estimator will be with you shortly.";

                            mail('theshadowcallsu@gmail.com', 'Estimation Request',
                                 $data);
                    } else {
    var_dump($errorArr); //Show Error Message
                    }
            }

            else {
                    die('no post data to process');
            }

        ?>
</code>```

Body:
<?php
    var_dump($_POST);
    if(isset($_POST['email'])
        && isset($_POST['name'])) {

            if (empty($_POST["name"])) {
                    $nameErr = "Name is required";
            }
            else {
                    $name = $_POST["name"];
                    var_dump($name);
     // check if name only contains letters and whitespace  for first name
                    if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
                            $nameErr = "Only letters and white space
                                         allowed";
                    }
            }

            if (empty($_POST["email"])) {
                    $emailErr = "Email is required";
            }
            else {
                    $email = $_POST["email"];
                    var_dump($email);
                    // check if e-mail address is well-formed
                    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
                            $emailErr = "Invalid email format";
                    }
            }

            if($data = $_POST['name'] . "\n" .
                   $_POST['email'] . "\n" .
                   $_POST['phone'] . "\n" .
                   $_POST['county'] . "\n" .
                   $_POST['floor'] . "\n" .
                   $_POST['descr'] . "\n"){

                    echo "Thank you for your inquery!" . "
" .
                            "an estimator will be with you shortly.";

                    mail('myemail@gmail.com', 'Estimation Request',
                         $data);
            }
    }

    else {
            die('no post data to process');
    }

?>

The output:

array(5) { ["name"]=> string(12) "Nicholas Cox" ["email"]=> string(6)
  "######" ["phone"]=> string(10) "0000000000" ["county"]=> string(8)
  "Pinellas" ["descr"]=> string(15) "Thesh " }

string(12) "Nicholas Cox" string(6) "######"

Thank you for your inquery!
an estimator will be with you shortly.\n\nInvalid email format\n

Note: if i missed taking out some of my troubleshooting steps like the random echos or die functions please let me know so i can edit to
  help you be able to read it easier

I have not added validation on the other fields. I'm just trying to get the email and name to work before i add to the others.

Right now, when i add random stuff it will still prompt me with my error message but it still allows anything to be put in the text field AND sends the email. I've watched a few tutorials on youtube and i still can't get it right.

Body:
Example what you can do with validation with your code.

<?php
            var_dump($_POST);
        $errorArr = array(); //Error Messages in array
            if(isset($_POST['email'])
                && isset($_POST['name'])) {

                    if (empty($_POST["name"])) {
                            $errorArr['nameErr'] = "Name is required"; //Error Messages in array
                    }
                    else {
                            $name = $_POST["name"];
                            var_dump($name); // This should be commented
             // check if name only contains letters and whitespace  for first name
                            if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
                                    $errorArr['nameErr'] = "Only letters and white space
                                                 allowed";//Error Messages in array
                            }
                    }

                    if (empty($_POST["email"])) {
                            $errorArr['emailErr'] = "Email is required";
                    }
                    else {
                            $email = $_POST["email"];
                            var_dump($email); // This should be commented
                            // check if e-mail address is well-formed
                            if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
                                    $errorArr['emailErr'] = "Invalid email format";
                            }
                    }

        //Check Condition for any error
                    if(empty($errorArr)){

                           $data = $_POST['name'] . "\n" .
                           $_POST['email'] . "\n" .
                           $_POST['phone'] . "\n" .
                           $_POST['county'] . "\n" .
                           $_POST['floor'] . "\n" .
                           $_POST['descr'] . "\n"

                            echo "Thank you for your inquery!" . "<br/>" .
                                    "an estimator will be with you shortly.";

                            mail('theshadowcallsu@gmail.com', 'Estimation Request',
                                 $data);
                    } else {
    var_dump($errorArr); //Show Error Message
                    }
            }

            else {
                    die('no post data to process');
            }

        ?>


问:
Why can't I set x and y labels as arguments to pd.plot(), whereas I can easily set similar stuff, such as title?
I'm printing various things with pandas, using the inbuilt plot command, such as my_dataframe.plot() followed by plt.show() in ipython.

Now this is a very easy and convenient way to visualize stuff, and given that I do postprocessing on the SVG file anyways, I don't care too much about details of the plot.

However, I need a title, a legend and labels for the x and y axis on the plot, both as a reminder to myself about what is what, and for quickly sending some stuff to other folks, without having to add a "Oh, and BTW, the x axis is hours this time, y is meters as always, but blue now is sample B…" line to the email.

I figured out how to do this in an easy way (see below) and I'm also aware about the various powerful things I could do with ax, but it took me a while to get to my "easy" solution, and I'm staying away from ax because there is way too much stuff going on that I neither need nor understand.

I do understand why one would want all the powerful options of ax, but I do not understand why such a simply option is not included in pandas plotting function. And it seems like I'm not the only one. User Chrispy for example posted this highly rated comment:

is there a particular reason why x and y labels can't be added as arguments to pd.plot()? Given the additional concision of pd.plot() over plt.plot() it seems it would make sense to make it even more succinct instead of having to call ax.set_ylabel()

on the answer to this question, but got no further comments. Hence I'm blatantly stealing this question.

Why does plt.plot() include legends by default and also easily lets me add a title (my_df.plot(title = 'check out my cool plot')), but the logical next step (my_df.plot(ylabel = 'size in meters')) results in TypeError: There is no Line2D property "ylabel"?

Am I missing something or is there a reason for this oversight?

Example code:

This works when I implement it in my real file and run it with run workflow.py in ipython, but I cant reproduce it when copy-pasting the code. Either my labels get ignored, or it downright fails:

EDIT:

Originally I had plt.xlabel = 'time in seconds' in my example here, which did not work, but I had the correct plt.xlabel('time in seconds') in my real code, which of course did work.

```<code>times = np.arange(0,43200,60)
my_df = pd.DataFrame(np.random.randn(len(times)), index = times)
my_df.plot(title = 'just some random data')    #this works
#my_df.plot(title = 'just some random data', ylabel = 'size in meters', xlabel = 'time in seconds')    #this seems like the logical next step, but it errors
plt.ylabel('size in meters')
plt.xlabel('time in seconds')
</code>```

This seems like the most easy/minimal solution with axes, using @Johannes solution, but I think this (see comments to the answer) is also a good illustration why I would like to not having to bother myself with axes:

```<code>axes = my_df.plot(title = 'just some random data')
axes.set_ylabel('size in meters')
axes.set_xlabel('time in seconds')
</code>```

Also, I can set the title another way, but there is only one option for the labels, which is what's confusing me:

```<code>axes = my_df.plot()
axes.set_title('just some random data')
axes.set_ylabel('size in meters')
axes.set_xlabel('time in seconds')
</code>```

答:
df.plot() returns a list of Axes objects (one for each subplot). Those have .set_xlabel() and .set_ylabel() methods.

Do something like this:

```<code>times = np.arange(0,43200,60)
my_df = pd.DataFrame(np.random.randn(len(times)), index = times)
axes = my_df.plot(title = 'just some random data')
axes[0].ylabel('size in meters')
axes[0].xlabel('time in seconds')
</code>```

Plots are no objects, instead the plot function just creates Line objects. Since you can have multiple lines in a single Axes object but only one pair of labels, it makes sense that the labels are properties of the axes and not of the lines.

Body:
I'm printing various things with pandas, using the inbuilt plot command, such as my_dataframe.plot() followed by plt.show() in ipython.

Now this is a very easy and convenient way to visualize stuff, and given that I do postprocessing on the SVG file anyways, I don't care too much about details of the plot.

However, I need a title, a legend and labels for the x and y axis on the plot, both as a reminder to myself about what is what, and for quickly sending some stuff to other folks, without having to add a "Oh, and BTW, the x axis is hours this time, y is meters as always, but blue now is sample B…" line to the email.

I figured out how to do this in an easy way (see below) and I'm also aware about the various powerful things I could do with ax, but it took me a while to get to my "easy" solution, and I'm staying away from ax because there is way too much stuff going on that I neither need nor understand.

I do understand why one would want all the powerful options of ax, but I do not understand why such a simply option is not included in pandas plotting function. And it seems like I'm not the only one. User Chrispy for example posted this highly rated comment:

is there a particular reason why x and y labels can't be added as arguments to pd.plot()? Given the additional concision of pd.plot() over plt.plot() it seems it would make sense to make it even more succinct instead of having to call ax.set_ylabel()

on the answer to this question, but got no further comments. Hence I'm blatantly stealing this question.

Why does plt.plot() include legends by default and also easily lets me add a title (my_df.plot(title = 'check out my cool plot')), but the logical next step (my_df.plot(ylabel = 'size in meters')) results in TypeError: There is no Line2D property "ylabel"?

Am I missing something or is there a reason for this oversight?

Example code:

This works when I implement it in my real file and run it with run workflow.py in ipython, but I cant reproduce it when copy-pasting the code. Either my labels get ignored, or it downright fails:

EDIT:

Originally I had plt.xlabel = 'time in seconds' in my example here, which did not work, but I had the correct plt.xlabel('time in seconds') in my real code, which of course did work.

times = np.arange(0,43200,60)
my_df = pd.DataFrame(np.random.randn(len(times)), index = times)
my_df.plot(title = 'just some random data')    #this works
#my_df.plot(title = 'just some random data', ylabel = 'size in meters', xlabel = 'time in seconds')    #this seems like the logical next step, but it errors
plt.ylabel('size in meters')
plt.xlabel('time in seconds')

This seems like the most easy/minimal solution with axes, using @Johannes solution, but I think this (see comments to the answer) is also a good illustration why I would like to not having to bother myself with axes:

axes = my_df.plot(title = 'just some random data')
axes.set_ylabel('size in meters')
axes.set_xlabel('time in seconds')

Also, I can set the title another way, but there is only one option for the labels, which is what's confusing me:

axes = my_df.plot()
axes.set_title('just some random data')
axes.set_ylabel('size in meters')
axes.set_xlabel('time in seconds')

Body:
df.plot() returns a list of Axes objects (one for each subplot). Those have .set_xlabel() and .set_ylabel() methods.

Do something like this:

times = np.arange(0,43200,60)
my_df = pd.DataFrame(np.random.randn(len(times)), index = times)
axes = my_df.plot(title = 'just some random data')
axes[0].ylabel('size in meters')
axes[0].xlabel('time in seconds')

Plots are no objects, instead the plot function just creates Line objects. Since you can have multiple lines in a single Axes object but only one pair of labels, it makes sense that the labels are properties of the axes and not of the lines.


问:
Difference between "None" end "pass" in a try/except statement in terms of calculation time
I'm using and try/except statement in python inside a very long loop. If the exception is raised, it should do nothing.

```<code>try :
  *Some Code*
except :
  pass
</code>```

If i use this first proposition, the total time of calculation for the loop is about 10 minutes.

```<code>try :
  *Some Code*
except :
  None
</code>```

If i use this second propositon, the total time of calculation for the loop is about 2 minutes.

Why is it so different, and why is the second one faster as, logically for me, pass is a better solution than None ?

The exact code is :

```<code>try:
 indexes = peakutils.peak.interpolate(self.list_height, input_1, ind=indexes, width=self.gauss_width)
except:
 None / Pass
</code>```

I made several tests with both propisitons and it's always the same.

How time is calculated :

```<code>start = default_timer()
im.get_events() #The loop where the try/except statement appears
finish = default_timer()
print('ELAPSED TIME : %s'%(finish - start))
</code>```

答:
Given two functions:

```<code>def func_none():
  return None

def func_pass():
  pass
</code>```

They are doing exactly the same thing, the proof using dis:

```<code>>>> import dis
>>> dis.dis(func_none)
# 0 LOAD_CONST               0 (None)
# 3 RETURN_VALUE

>>> dis.dis(func_pass)
# 0 LOAD_CONST               0 (None)
# 3 RETURN_VALUE
</code>```

Indeed, here is the definition of pass:

pass is a null operation — when it is executed, nothing happens. It is
  useful as a placeholder when a statement is required syntactically,
  but no code needs to be executed, for example:

Conclusion: pass statement is as fast as Nonein theory.

Edit: why it may be a slower time using None instead of return None (like in OP example).

Given two functions:

```<code>def func_none():
  try:
    1/0
  except:
    None

def func_pass():
  try:
    1/0
  except:
    pass
</code>```

The difference using dis:

```<code>>>> import dis
>>> dis.dis(func_none)
# Skip to expect part

  18 LOAD_CONST               0 (None)
  21 POP_TOP
  22 JUMP_FORWARD             1 (to 26)
  25 END_FINALLY
  26 LOAD_CONST               0 (None)
  29 RETURN_VALUE

dis.dis(func_pass)

# Skip to expect part

  18 JUMP_FORWARD             1 (to 22)
  21 END_FINALLY
  22 LOAD_CONST               0 (None)
  25 RETURN_VALUE
</code>```

So it is clear that using None instead of pass will add two extra operation LOAD_CONST and POP_TOP. It shouldnt add 8 minutes though, so I'm sure this isn't the real reason.

Body:
I'm using and try/except statement in python inside a very long loop. If the exception is raised, it should do nothing.

try :
  *Some Code*
except :
  pass

If i use this first proposition, the total time of calculation for the loop is about 10 minutes.

try :
  *Some Code*
except :
  None

If i use this second propositon, the total time of calculation for the loop is about 2 minutes.

Why is it so different, and why is the second one faster as, logically for me, pass is a better solution than None ?

The exact code is :

try:
 indexes = peakutils.peak.interpolate(self.list_height, input_1, ind=indexes, width=self.gauss_width)
except:
 None / Pass

I made several tests with both propisitons and it's always the same.

How time is calculated :

start = default_timer()
im.get_events() #The loop where the try/except statement appears
finish = default_timer()
print('ELAPSED TIME : %s'%(finish - start))

Body:
Given two functions:

def func_none():
  return None

def func_pass():
  pass

They are doing exactly the same thing, the proof using dis:

>>> import dis
>>> dis.dis(func_none)
# 0 LOAD_CONST               0 (None)
# 3 RETURN_VALUE

>>> dis.dis(func_pass)
# 0 LOAD_CONST               0 (None)
# 3 RETURN_VALUE

Indeed, here is the definition of pass:

pass is a null operation — when it is executed, nothing happens. It is
  useful as a placeholder when a statement is required syntactically,
  but no code needs to be executed, for example:

Conclusion: pass statement is as fast as Nonein theory.

Edit: why it may be a slower time using None instead of return None (like in OP example).

Given two functions:

def func_none():
  try:
    1/0
  except:
    None

def func_pass():
  try:
    1/0
  except:
    pass

The difference using dis:

>>> import dis
>>> dis.dis(func_none)
# Skip to expect part

  18 LOAD_CONST               0 (None)
  21 POP_TOP
  22 JUMP_FORWARD             1 (to 26)
  25 END_FINALLY
  26 LOAD_CONST               0 (None)
  29 RETURN_VALUE

dis.dis(func_pass)

# Skip to expect part

  18 JUMP_FORWARD             1 (to 22)
  21 END_FINALLY
  22 LOAD_CONST               0 (None)
  25 RETURN_VALUE

So it is clear that using None instead of pass will add two extra operation LOAD_CONST and POP_TOP. It shouldnt add 8 minutes though, so I'm sure this isn't the real reason.


问:
Boost 1.64 build error on solaris
```<code><built-in>: note: this is the location of the previous definition
In file included from /usr/include/limits.h:12:0,
                 from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/limits.h:168,
                 from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/syslimits.h:7,
                 from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/limits.h:34,
                 from ./boost/log/detail/config.hpp:33,
                 from libs/log/src/attribute_set.cpp:16:
/export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/sys/feature_tests.h:363:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications       and pre-2001 POSIX applications"
 #error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
  ^~~~~

"g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -march=i686 -pthreads -m32 -fno-strict-aliasing -ftemplate-depth-1024 -fvisibility=hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_STATIC_LINK=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_FILESYSTEM_STATIC_LINK=1 -DBOOST_LOG_BUILDING_THE_LIB=1 -DBOOST_LOG_USE_AVX2 -DBOOST_LOG_USE_SSSE3 -DBOOST_LOG_WITHOUT_DEBUG_OUTPUT -DBOOST_LOG_WITHOUT_EVENT_LOG -DBOOST_LOG_WITHOUT_IPC -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_DONT_USE_CHRONO=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_LIB=1 -DDATE_TIME_INLINE -DNDEBUG -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -D__STDC_CONSTANT_MACROS  -I"." -I"libs/log/src" -c -o "bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/attribute_set.o" "libs/log/src/attribute_set.cpp"

...failed gcc.compile.c++ bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/attribute_set.o...
gcc.compile.c++ bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/attribute_value_set.o
<command-line>:0:0: warning: "_XOPEN_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
In file included from /usr/include/limits.h:12:0,
                 from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/limits.h:168,
                 from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/syslimits.h:7,
                 from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/limits.h:34,
                 from ./boost/log/detail/config.hpp:33,
                 from libs/log/src/attribute_value_set.cpp:16:
/export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/sys/feature_tests.h:363:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications       and pre-2001 POSIX applications"
 #error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
  ^~~~~

"g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -march=i686 -pthreads -m32 -fno-strict-aliasing -ftemplate-depth-1024 -fvisibility=hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_STATIC_LINK=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_FILESYSTEM_STATIC_LINK=1 -DBOOST_LOG_BUILDING_THE_LIB=1 -DBOOST_LOG_USE_AVX2 -DBOOST_LOG_USE_SSSE3 -DBOOST_LOG_WITHOUT_DEBUG_OUTPUT -DBOOST_LOG_WITHOUT_EVENT_LOG -DBOOST_LOG_WITHOUT_IPC -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_DONT_USE_CHRONO=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_LIB=1 -DDATE_TIME_INLINE -DNDEBUG -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -D__STDC_CONSTANT_MACROS  -I"." -I"libs/log/src" -c -o "bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/attribute_value_set.o" "libs/log/src/attribute_value_set.cpp"

...failed gcc.compile.c++ bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/attribute_value_set.o...
gcc.compile.c++ bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/code_conversion.o
<command-line>:0:0: warning: "_XOPEN_SOURCE" redefined

...skipped <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>libboost_log.so.1.64.0 for lack of <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>attribute_name.o...
...skipped <pstage/lib>libboost_log.so.1.64.0 for lack of <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>libboost_log.so.1.64.0...
...skipped <pstage/lib>libboost_log.so for lack of <pstage/lib>libboost_log.so.1.64.0...
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
...skipped <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>libboost_log_setup.so.1.64.0 for lack of <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>setup/parser_utils.o...
...skipped <pstage/lib>libboost_log_setup.so.1.64.0 for lack of <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>libboost_log_setup.so.1.64.0...
...skipped <pstage/lib>libboost_log_setup.so for lack of <pstage/lib>libboost_log_setup.so.1.64.0...
</code>```

There are some error logs in building Boost C ++ Libraries 1.64 with GCC 6.2 version . What's the problem?
It is one of the many error logs.

```<code>$b2
</code>```

This occurred during execution of the above command. Logs and python libraries have had intensive error logs.

I wonder why this error occurred.

Build environment

Oracle Solaris 11.2 x86 23 June 2014

GCC 6.2

Build target

Boost C ++ Libraries 1.64

答:
As was discovered in the discussion following the Paul Floyd's answer, Solaris headers are incompatible with C++, which results in the errors you're seeing.

This can be worked around by modifying Boost.Log sources, libs/log/build/Jamfile.v2, line 256. Change it from this:

```<code><target-os>solaris:<define>_XOPEN_SOURCE=500
</code>```

to this:

```<code><target-os>solaris:<define>_XOPEN_SOURCE=600
</code>```

(I stripped the comment for brevity).

In Boost 1.65 the library should try to work around the problem automatically, so this modification should not be needed.

Title: Boost 1.64 build error on solaris

Body:
<built-in>: note: this is the location of the previous definition
In file included from /usr/include/limits.h:12:0,
                 from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/limits.h:168,
                 from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/syslimits.h:7,
                 from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/limits.h:34,
                 from ./boost/log/detail/config.hpp:33,
                 from libs/log/src/attribute_set.cpp:16:
/export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/sys/feature_tests.h:363:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications       and pre-2001 POSIX applications"
 #error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
  ^~~~~

"g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -march=i686 -pthreads -m32 -fno-strict-aliasing -ftemplate-depth-1024 -fvisibility=hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_STATIC_LINK=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_FILESYSTEM_STATIC_LINK=1 -DBOOST_LOG_BUILDING_THE_LIB=1 -DBOOST_LOG_USE_AVX2 -DBOOST_LOG_USE_SSSE3 -DBOOST_LOG_WITHOUT_DEBUG_OUTPUT -DBOOST_LOG_WITHOUT_EVENT_LOG -DBOOST_LOG_WITHOUT_IPC -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_DONT_USE_CHRONO=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_LIB=1 -DDATE_TIME_INLINE -DNDEBUG -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -D__STDC_CONSTANT_MACROS  -I"." -I"libs/log/src" -c -o "bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/attribute_set.o" "libs/log/src/attribute_set.cpp"

...failed gcc.compile.c++ bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/attribute_set.o...
gcc.compile.c++ bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/attribute_value_set.o
<command-line>:0:0: warning: "_XOPEN_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
In file included from /usr/include/limits.h:12:0,
                 from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/limits.h:168,
                 from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/syslimits.h:7,
                 from /export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/limits.h:34,
                 from ./boost/log/detail/config.hpp:33,
                 from libs/log/src/attribute_value_set.cpp:16:
/export/home/user/gcc-6.2.0.bin/lib/gcc/i386-pc-solaris2.11/6.2.0/include-fixed/sys/feature_tests.h:363:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications       and pre-2001 POSIX applications"
 #error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
  ^~~~~

"g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -march=i686 -pthreads -m32 -fno-strict-aliasing -ftemplate-depth-1024 -fvisibility=hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_STATIC_LINK=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_FILESYSTEM_STATIC_LINK=1 -DBOOST_LOG_BUILDING_THE_LIB=1 -DBOOST_LOG_USE_AVX2 -DBOOST_LOG_USE_SSSE3 -DBOOST_LOG_WITHOUT_DEBUG_OUTPUT -DBOOST_LOG_WITHOUT_EVENT_LOG -DBOOST_LOG_WITHOUT_IPC -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_DONT_USE_CHRONO=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_LIB=1 -DDATE_TIME_INLINE -DNDEBUG -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -D__STDC_CONSTANT_MACROS  -I"." -I"libs/log/src" -c -o "bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/attribute_value_set.o" "libs/log/src/attribute_value_set.cpp"

...failed gcc.compile.c++ bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/attribute_value_set.o...
gcc.compile.c++ bin.v2/libs/log/build/gcc-6.2.0/release/link-static/threading-multi/code_conversion.o
<command-line>:0:0: warning: "_XOPEN_SOURCE" redefined

...skipped <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>libboost_log.so.1.64.0 for lack of <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>attribute_name.o...
...skipped <pstage/lib>libboost_log.so.1.64.0 for lack of <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>libboost_log.so.1.64.0...
...skipped <pstage/lib>libboost_log.so for lack of <pstage/lib>libboost_log.so.1.64.0...
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
                 from ./boost/log/detail/config.hpp:33,
                 from ./boost/log/detail/setup_config.hpp:20,
...skipped <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>libboost_log_setup.so.1.64.0 for lack of <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>setup/parser_utils.o...
...skipped <pstage/lib>libboost_log_setup.so.1.64.0 for lack of <pbin.v2/libs/log/build/gcc-6.2.0/release/threading-multi>libboost_log_setup.so.1.64.0...
...skipped <pstage/lib>libboost_log_setup.so for lack of <pstage/lib>libboost_log_setup.so.1.64.0...

There are some error logs in building Boost C ++ Libraries 1.64 with GCC 6.2 version . What's the problem?
It is one of the many error logs.

$b2

This occurred during execution of the above command. Logs and python libraries have had intensive error logs.

I wonder why this error occurred.

Build environment

Oracle Solaris 11.2 x86 23 June 2014

GCC 6.2

Build target

Boost C ++ Libraries 1.64

Body:
As was discovered in the discussion following the Paul Floyd's answer, Solaris headers are incompatible with C++, which results in the errors you're seeing.

This can be worked around by modifying Boost.Log sources, libs/log/build/Jamfile.v2, line 256. Change it from this:

<target-os>solaris:<define>_XOPEN_SOURCE=500

to this:

<target-os>solaris:<define>_XOPEN_SOURCE=600

(I stripped the comment for brevity).

In Boost 1.65 the library should try to work around the problem automatically, so this modification should not be needed.


问:
How exactly does a WSP deploy a dll internally
i am facing a problem with deploying dlls with a WSP. After deploying the first version of the dll using a WSP, if I want to change the dll and redeploy after retracting, it is still referring to the old assembly, even though it is no longer there in GAC. Is there any caching feature in Sharepoint that is not very obvious?

Thanks in advance!

答: Deployed code will not reload. On a similar issue when deploying to the Bin. Although a WSP project may be directed (in the Manifest) to only install and load from the BIN, if an old copy of the given DLL also exist in the GAC - it gets loaded first. Deleting the GAC DLL, and doing an IISReset resolves the issue. Redirecting the load back to the Bin. This can easily occur when using WSPBuilder if you hit the 'Copy to GAC' option. Oops.


问:
I am adding loading effects on ajax processing.. its working fine in mozilla but css not working in chrome
I am adding loading effects through css.. its working properly for mozilla but not working for chrome.. effects are not looking during page load for chrome.

My css code snippet:

```<code>.loadersmall {
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    animation: 1s linear 0s normal none infinite running spin;
    border-color: #B6E8FA #00ADEE #00ADEE;
    border-image: none;
    border-radius: 50%;
    border-style: solid;
    border-width: 5px;
    height: 50px;
    width: 50px;
    margin-left: 251px;
    margin-bottom: 10px;
}
</code>```

Use In jQuery:

```<code>$("form#photodata").submit(function(e){
         $('.loadersmall').show();
         $.ajax({
               ................
               success: function (data1) {
                  $('.loadersmall').hide();
               }
         })
});
</code>```

please suggest the changes to work loading css in chrome also.

答:
Use the below modified styles. You need to use prefixes for chrome.

.loadersmall,
.loadersmall:after {
  border-radius: 50%;
  width: 50px;
  height: 50px;
}
.loadersmall {
  margin: 60px auto;
  font-size: 10px;
  position: relative;
  text-indent: -9999em;
  border-top: 5px solid #00ADEE;
  border-right: 5px solid #00ADEE;
  border-bottom: 5px solid #00ADEE;
  border-left: 5px solid #B6E8FA;
  -webkit-transform: translateZ(0);
  -ms-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-animation: 1s linear 0s normal none infinite running spin;
  animation: 1s linear 0s normal none infinite running spin;
}
@-webkit-keyframes spin {
  0% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}
@keyframes spin {
  0% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="loadersmall"></div></code>```

Body:
I am adding loading effects through css.. its working properly for mozilla but not working for chrome.. effects are not looking during page load for chrome.

My css code snippet:

.loadersmall {
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    animation: 1s linear 0s normal none infinite running spin;
    border-color: #B6E8FA #00ADEE #00ADEE;
    border-image: none;
    border-radius: 50%;
    border-style: solid;
    border-width: 5px;
    height: 50px;
    width: 50px;
    margin-left: 251px;
    margin-bottom: 10px;
}

Use In jQuery:

$("form#photodata").submit(function(e){
         $('.loadersmall').show();
         $.ajax({
               ................
               success: function (data1) {
                  $('.loadersmall').hide();
               }
         })
});

please suggest the changes to work loading css in chrome also.

Body:
Use the below modified styles. You need to use prefixes for chrome.

.loadersmall,
.loadersmall:after {
  border-radius: 50%;
  width: 50px;
  height: 50px;
}
.loadersmall {
  margin: 60px auto;
  font-size: 10px;
  position: relative;
  text-indent: -9999em;
  border-top: 5px solid #00ADEE;
  border-right: 5px solid #00ADEE;
  border-bottom: 5px solid #00ADEE;
  border-left: 5px solid #B6E8FA;
  -webkit-transform: translateZ(0);
  -ms-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-animation: 1s linear 0s normal none infinite running spin;
  animation: 1s linear 0s normal none infinite running spin;
}
@-webkit-keyframes spin {
  0% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}
@keyframes spin {
  0% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

<div class="loadersmall"></div>


问:
PHP Regex explode the string using ',' except ',' inside quote and double qoute
How to do explode except using ',' but not inside quote and double quote?

This is the string i want to explode:

```<code>`ot_request_id` int(11) NOT NULL,`ot_hours` int(11) NOT NULL,`ot_timelog_id` int(11) NOT NULL,`ot_user_id` int(11) NOT NULL,`ot_filing_date` datetime NOT NULL,`ot_approveby_id` int(11) NOT NULL,`final_approved` int(11) NOT NULL DEFAULT '0' , `ot_token` varchar(100) DEFAULT 'Your, name, here' NOT NULL,`startTime` datetime NOT NULL,`endTime` datetime NOT NULL
</code>```

I want the output to become

```<code>`ot_request_id` int(11) NOT NULL `ot_request_id` int(11) NOT NULL,
`ot_hours` int(11) NOT NULL ,
`ot_timelog_id` int(11) NOT NULL,
`ot_user_id` int(11) NOT NULL,
`ot_filing_date` datetime NOT NULL,
`ot_approveby_id` int(11) NOT NULL,
`final_approved` int(11) NOT NULL DEFAULT '0' ,
`ot_token` varchar(100) DEFAULT 'Your, name, here' NOT NULL,
`startTime` datetime NOT NULL,
`endTime` datetime NOT NULL
</code>```

here is my code:

```<code>$array = explode(",",$str);// change to Regex
foreach($array as $m){
    echo "<br>$m";
}
</code>```

答:
It's a matter of identifying the correct pattern-matching logic to achieve the desired result.

Using REGEX (explode() does not use REGEX - it splits on a string token), we can target only those commas which are proceeded by `.

```<code>$array = preg_split('/,(?= ?`)/', $str);
</code>```

Note we also allow for an optional space between , and `.

Body:
How to do explode except using ',' but not inside quote and double quote?

This is the string i want to explode:

`ot_request_id` int(11) NOT NULL,`ot_hours` int(11) NOT NULL,`ot_timelog_id` int(11) NOT NULL,`ot_user_id` int(11) NOT NULL,`ot_filing_date` datetime NOT NULL,`ot_approveby_id` int(11) NOT NULL,`final_approved` int(11) NOT NULL DEFAULT '0' , `ot_token` varchar(100) DEFAULT 'Your, name, here' NOT NULL,`startTime` datetime NOT NULL,`endTime` datetime NOT NULL

I want the output to become

`ot_request_id` int(11) NOT NULL `ot_request_id` int(11) NOT NULL,
`ot_hours` int(11) NOT NULL ,
`ot_timelog_id` int(11) NOT NULL,
`ot_user_id` int(11) NOT NULL,
`ot_filing_date` datetime NOT NULL,
`ot_approveby_id` int(11) NOT NULL,
`final_approved` int(11) NOT NULL DEFAULT '0' ,
`ot_token` varchar(100) DEFAULT 'Your, name, here' NOT NULL,
`startTime` datetime NOT NULL,
`endTime` datetime NOT NULL

here is my code:

$array = explode(",",$str);// change to Regex
foreach($array as $m){
    echo "
$m";
}

Body:
It's a matter of identifying the correct pattern-matching logic to achieve the desired result.

Using REGEX (explode() does not use REGEX - it splits on a string token), we can target only those commas which are proceeded by `.

$array = preg_split('/,(?= ?`)/', $str);

Note we also allow for an optional space between , and `.


问:
Statistic counter auto refresh div and mysql query
We are building live statistics counter, refreshing numbers every 10sec. (similar like stackoverflow questions counter). We have simple html page, we tried to embed php and tried to use jquery, but no success. Any help? Thanks</p>

```<code><html>
    <script>
        var auto_refresh = setInterval(
            function() {
                $('#stats').fadeOut('fast').fadeIn("fast");
            },
            10000
        );
    </script>
    <div id="stats">
        <?php
            global $conn;
            $query="SELECT count(*) as total FROM posts WHERE type='update'";
            $query2="SELECT count(*) as total FROM members WHERE USERID>0";
            $postnum = mysql_query($query);
            $posts = mysql_result($postnum,0);
            $chanid = mysql_query($query2);
            $channels = mysql_result($chanid,0);
            print "<div id='statnr'><h6> $channels </h6><h1>channels </h1> </div>";
            print "<div id='statnr'><h6> $posts </h6><h1>posts </h1> </div>";
        ?>
    </div>
</html>
</code>```

答:
you're only fading the stats div out an in again. you have to make an ajax call to the php file getting the new data.</p>

```<code>var auto_refresh = setInterval(
    function() {
        $.ajax(
            url:"counter.php",
            success:function(data){
                $('#stats').fadeOut('fast', function(){
                    $(this).html(data).fadeIn('fast');
                });
            }
        )
    },
    10000
);
</code>```

Body:
We are building live statistics counter, refreshing numbers every 10sec. (similar like stackoverflow questions counter). We have simple html page, we tried to embed php and tried to use jquery, but no success. Any help? Thanks

        <?php
            global $conn;
            $query="SELECT count(*) as total FROM posts WHERE type='update'";
            $query2="SELECT count(*) as total FROM members WHERE USERID>0";
            $postnum = mysql_query($query);
            $posts = mysql_result($postnum,0);
            $chanid = mysql_query($query2);
            $channels = mysql_result($chanid,0);
            print "

 $channels

channels

";
            print "

 $posts

posts

";
        ?>

Body:
you're only fading the stats div out an in again. you have to make an ajax call to the php file getting the new data.

var auto_refresh = setInterval(
    function() {
        $.ajax(
            url:"counter.php",
            success:function(data){
                $('#stats').fadeOut('fast', function(){
                    $(this).html(data).fadeIn('fast');
                });
            }
        )
    },
    10000
);


问:
AutoMapper requires Get Accessor to Set. CS0154 The property or indexer 'Id' cannot be used in this context because it lacks the get accessor
The Id property in my ViewModel class can be set, but not gotten as the setter encrypts the value.  To get the value I have to use a either GetEncryptedId() or GetDecryptedId().

The ViewModel

```<code>public ViewModel
{
    public int _id;
    public int Id { set { _id = Encrypt(value); }
    public Child ChildProperty {get; set; }
}

public Child
{
    public int Id {get; set;}
    public string Name {get; set; }
}
</code>```

The problem here is that for some reason Auto Mapper wants a get accessor so it can set a value.

```<code>public ViewModelProfile()
{
    CreateMap<Model, ViewModel>().ForMember(vm => vm.Id, opt => opt.MapFrom(m => m.ChildProperty.Id))
}
</code>```

This throws and error stating:

```<code>CS0154 The property or indexer 'Id' cannot be used in this context because it lacks the get accessor.
</code>```

Why does Auto Mapper require a 'Get Accessor' to set a value.

Is there a configuration option to force a set and no get?

As a work around I've added a Get { return -1; }, but that is far from ideal.

答:
This is how i did it:</p>

```<code> //Mapper Class

 public partial class AutoMapperConfig
 {
  public static MapperConfiguration UserLoginTovmLogin = null;

  public static void Mappings()
    {
        UserLoginTovmLogin = new MapperConfiguration(cfg =>
        cfg.CreateMap<User_Login, VmLogin>()
        .ForMember(conf => conf.LoginId, dto => dto.MapFrom(src => src.Login_Id))
        .ForMember(conf => conf.Passsword, dto => dto.MapFrom(src => src.Passsword)));
    }
  }
   //In your Data login class
   VmLogin IAuthRepository.Login(string loginId)
    {
        VmLogin login = new VmLogin();
        var result = //Your Data Logic
        AutoMapperConfig.UserLoginTovmLogin.CreateMapper().Map(result, login);
        return login;
    }
</code>```

Body:
The Id property in my ViewModel class can be set, but not gotten as the setter encrypts the value.  To get the value I have to use a either GetEncryptedId() or GetDecryptedId().

The ViewModel

public ViewModel
{
    public int _id;
    public int Id { set { _id = Encrypt(value); }
    public Child ChildProperty {get; set; }
}

public Child
{
    public int Id {get; set;}
    public string Name {get; set; }
}

The problem here is that for some reason Auto Mapper wants a get accessor so it can set a value.

public ViewModelProfile()
{
    CreateMap<Model, ViewModel>().ForMember(vm => vm.Id, opt => opt.MapFrom(m => m.ChildProperty.Id))
}

This throws and error stating:

CS0154 The property or indexer 'Id' cannot be used in this context because it lacks the get accessor.

Why does Auto Mapper require a 'Get Accessor' to set a value.

Is there a configuration option to force a set and no get?

As a work around I've added a Get { return -1; }, but that is far from ideal.

Body:
This is how i did it:

 //Mapper Class

 public partial class AutoMapperConfig
 {
  public static MapperConfiguration UserLoginTovmLogin = null;

  public static void Mappings()
    {
        UserLoginTovmLogin = new MapperConfiguration(cfg =>
        cfg.CreateMap<User_Login, VmLogin>()
        .ForMember(conf => conf.LoginId, dto => dto.MapFrom(src => src.Login_Id))
        .ForMember(conf => conf.Passsword, dto => dto.MapFrom(src => src.Passsword)));
    }
  }
   //In your Data login class
   VmLogin IAuthRepository.Login(string loginId)
    {
        VmLogin login = new VmLogin();
        var result = //Your Data Logic
        AutoMapperConfig.UserLoginTovmLogin.CreateMapper().Map(result, login);
        return login;
    }


问:
Vue.js passing event from grandchildren inside slot
I just started learning Vue and I got some problems with passing events through different components.
I'm building a simple todo list app with basic functionalities like adding new tasks and deleting them.
This is the link to the repo https://github.com/Polenj86/vue-taskmanager.

The tree structure of my app is:

```<code>-root //App.vue
-- childcomponent // NewTask.vue
-- childcomponent // TasksWrapper.vue
   -- grandchildcomponent //Task.vue
</code>```

What I'm trying to achieve is to give a button to Task.vue that let me delete a task from the tasks array in the root.
By now I only managed to delete the task by clicking on the entire element with this method:

```<code><app-component @click.native="deleteTask"></app-component>

methods: {
  deleteTask(index) {
    this.tasks.splice(index, 1)
  }
}
</code>```

What I want is to give this method to the button inside the component and not to the entire component.

This is the grandchildren code:

```<code><template lang="pug">
.panel.panel-default
    .panel-body
        slot(name="task-content")
    .panel-footer
        button.btn.btn-sm.btn-primary(@click="deleteTask") Delete task

</template>
</code>```

How can I inform the root I want to delete this?
I tried to use an event emitter but I don't get what should I pass as a second argument in the emitter.

```<code>export default {
    methods: {
        deleteTask() {
            this.$emit('taskWasDeleted', ???);
        }
    }
}
</code>```

Thanks for help

答:
Since the Task,vue is not a direct child of App.vue you can use a global EventBus

In your main.js file create an empty Vue instance as a central event bus:

```<code>export const EventBus = new Vue();
</code>```

Now pass the index from v-for to Task.vue component as a prop

```<code>//grandChild component or Task.vue
<app-component :taskIndex="index" :key="index"></app-component>
</code>```

in your Task.vue emit an event passing the index as second paramater that you received as a prop

```<code><template lang="pug">
.panel.panel-default
    .panel-body
        slot(name="task-content")
    .panel-footer
        button.btn.btn-sm.btn-primary(@click="deleteTask") Delete task

</template>

import {EventBus} from './main.js'
export default {
    proos: ['tabIndex'],
    methods: {
        deleteTask() {
            EventBus.$emit('deleteTask', this.tabIndex);
        }
    }
}
</code>```

Now in the App.vue in the created hook listeb for the deleteTask event

```<code>//App.vue
<script>
import {EventBus} from './main.js'
export default{
    created(){
        EventBus.$on('deleteTask', (taskIndex) => {
            this.tasks.splice(taskIndex, 1)
        });
    }
}
</script>
</code>```

`
Here is the fiddle

Body:
I just started learning Vue and I got some problems with passing events through different components.
I'm building a simple todo list app with basic functionalities like adding new tasks and deleting them.
This is the link to the repo https://github.com/Polenj86/vue-taskmanager.

The tree structure of my app is:

-root //App.vue
-- childcomponent // NewTask.vue
-- childcomponent // TasksWrapper.vue
   -- grandchildcomponent //Task.vue

What I'm trying to achieve is to give a button to Task.vue that let me delete a task from the tasks array in the root.
By now I only managed to delete the task by clicking on the entire element with this method:

<app-component @click.native="deleteTask"></app-component>

methods: {
  deleteTask(index) {
    this.tasks.splice(index, 1)
  }
}

What I want is to give this method to the button inside the component and not to the entire component.

This is the grandchildren code:

<template lang="pug">
.panel.panel-default
    .panel-body
        slot(name="task-content")
    .panel-footer
        button.btn.btn-sm.btn-primary(@click="deleteTask") Delete task

</template>

How can I inform the root I want to delete this?
I tried to use an event emitter but I don't get what should I pass as a second argument in the emitter.

export default {
    methods: {
        deleteTask() {
            this.$emit('taskWasDeleted', ???);
        }
    }
}

Thanks for help

Body:
Since the Task,vue is not a direct child of App.vue you can use a global EventBus

In your main.js file create an empty Vue instance as a central event bus:

export const EventBus = new Vue();

Now pass the index from v-for to Task.vue component as a prop

//grandChild component or Task.vue
<app-component :taskIndex="index" :key="index"></app-component>

in your Task.vue emit an event passing the index as second paramater that you received as a prop

<template lang="pug">
.panel.panel-default
    .panel-body
        slot(name="task-content")
    .panel-footer
        button.btn.btn-sm.btn-primary(@click="deleteTask") Delete task

</template>

import {EventBus} from './main.js'
export default {
    proos: ['tabIndex'],
    methods: {
        deleteTask() {
            EventBus.$emit('deleteTask', this.tabIndex);
        }
    }
}

Now in the App.vue in the created hook listeb for the deleteTask event

//App.vue
<script>
import {EventBus} from './main.js'
export default{
    created(){
        EventBus.$on('deleteTask', (taskIndex) => {
            this.tasks.splice(taskIndex, 1)
        });
    }
}
</script>

`
Here is the fiddle

ContentLicense: CC BY-SA 4.0


问:
If an updated object in S3 serves as a lambda trigger, is there an inherent race condition?
If I update an object in an S3 Bucket, and trigger on that S3 PUT event as my Lambda trigger, is there a chance that the Lambda could operate on the older version of that object given S3’s eventual consistency model?

I’m having a devil of a time parsing out an authoritative answer either way...

答:
Yes, there is a possibility that a blind GET of an object could fetch a former version.

There are at least two solutions that come to mind.

Weak: the notification event data contains the etag of the newly-uploaded object.  If the object you fetch doesn't have this same etag in its response headers, then you know it isn't the intended object.

Strong: enable versioning on the bucket.  The event data then contains the object versionId.  When you download the object from S3, specify this exact version in the request.  The consistency model is not as well documented when you overwrite an object and then download it with a specific version-id, so it is possible that this might result in an occasional 404 -- in which case, you almost certainly just spared yourself from fetching the old object -- but you can at least be confident that S3 will never give you a version other than the one explicitly specified.

If you weren't already using versioning on the bucket, you'll want to consider whether to keep old versions around, or whether to create a lifecycle policy to purge them... but one brilliantly-engineered feature about versioning is that the parts of your code that were written without awareness of versioning should still function correctly with versioning enabled -- if you send non-versioning-aware requests to S3, it still does exactly the right thing... for example, if you delete an object without specifying a version-id and later try to GET the object without specifying a version-id, S3 will correctly respond with a 404, even though the "deleted" version is actually still in the bucket.