text:
Q: How do I work around closures causing error[E0495]: cannot infer an appropriate lifetime I have this "simplified" code to demonstrate a problem I am having with a more complicated project.
I have created a closure to capture some parameters so I can invoke a small function in two places without repeating the code.  Unfortunately, lifetimes are now involved, and I am having difficulty understanding what exactly has the compiler confused:
use std::io::Write;

pub struct X<'c>
{
    maybe_file: Option<Box<dyn Write+'c>>,
}

impl<'c> X<'c>
{
    pub fn wrap<'a:'c,'b:'c> (prefix:&'a str, base: &'b mut X<'b>) ->X<'c>
    {
        return X::<'c> {
            maybe_file: Some(Box::new(X::wrapper(prefix, base))),
        }
    }
    pub fn wrapper<'a, 'b>(prefix:&'a str, base:&'b mut X<'b>) -> Wrapper<'a,'b>
    {
        Wrapper {
            prefix:prefix, base:base
        }
    }

    pub fn boop_the_snoot(&self) {}
}

//

pub struct Wrapper<'a,'b>
{
    pub prefix: &'a str,
    pub base: &'b X<'b>,
}

impl<'a,'b> Write for Wrapper<'a,'b>
{
    fn write(&mut self, buf:&[u8]) ->Result<usize, std::io::Error> { Ok(0) }
    fn flush(&mut self) ->Result<(), std::io::Error> { Ok(()) }
}

pub fn bacon(x:&mut X, scale:f32)
{

}

pub fn eggs<'c>(x:&'c mut X<'c>, scale:f32)
{
    bacon( & mut X::wrap("A:\t", x), scale);

    let f = |x:& mut X| {
        bacon(& mut X::wrap("B:\t", x), scale);
    };

    f(x);

    f(x);
}

This gives me the following compile error:
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements
  --> /home/thoth/src/embroidery/filler/src/lifetimes_shenanigans.rs:68:19
   |
68 |       bacon(& mut X::wrap("B:\t", x), scale);
   |                   ^^^^^^^
   |
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the body at 67:13...
  --> /home/thoth/src/embroidery/filler/src/lifetimes_shenanigans.rs:67:13
   |
67 |       let f = |x:&mut X| {
   |  _____________^
68 | |       bacon(& mut X::wrap("B:\t", x), scale);
69 | |     };
   | |_____^
note: ...so that reference does not outlive borrowed content
  --> /home/thoth/src/embroidery/filler/src/lifetimes_shenanigans.rs:68:35
   |
68 |       bacon(& mut X::wrap("B:\t", x), scale);
   |                                   ^
note: but, the lifetime must be valid for the anonymous lifetime #2 defined on the body at 67:13...
  --> /home/thoth/src/embroidery/filler/src/lifetimes_shenanigans.rs:67:13
   |
67 |       let f = |x:&mut X| {
   |  _____________^
68 | |       bacon(& mut X::wrap("B:\t", x), scale);
69 | |     };
   | |_____^
   = note: ...so that the expression is assignable:
           expected &mut lifetimes_shenanigans::X<'_>
              found &mut lifetimes_shenanigans::X<'_>

What sort of lifetime crimes is this logic protecting me from?
What should I add to this code to enable the rust compiler to understand the lifetimes of the various objects?

A: I was able to get the code to compile by replacing the declarations of the form &'b mut X<'b> with &'z mut X<'b> , basically decoupling the lifetime of the reference from the lifetime of the field inside X.
Another important change was to remove all lifetimes from the eggs() function.  This actually raises its own question:  Is it possible to explcitly declare the lifetimes in the eggs function and still get it to compile?  I have made a few clumsy attempts and ended up with [E0502]: cannot borrow*xas immutable because it is also borrowed as mutable which confirms there are subtleties I do not yet understand.
The patch looks like this:
@@ -7,13 +7,13 @@

 impl<'c> X<'c>
 {
-    pub fn wrap<'a:'c,'b:'c> (prefix:&'a str, base: &'b mut X<'b>) ->X<'c>
+    pub fn wrap<'a:'c,'b:'c,'z:'c> (prefix:&'a str, base: &'z mut X<'b>) ->X<'c>
     {
         return X::<'c> {
             maybe_file: Some(Box::new(X::wrapper(prefix, base))),
         }
     }
-    pub fn wrapper<'a, 'b>(prefix:&'a str, base:&'b mut X<'b>) -> Wrapper<'a,'b>
+    pub fn wrapper<'a, 'b, 'z>(prefix:&'a str, base:&'z mut X<'b>) -> Wrapper<'a,'b, 'z>
     {
         Wrapper {
             prefix:prefix, base:base
@@ -25,13 +25,13 @@

 //

-pub struct Wrapper<'a,'b>
+pub struct Wrapper<'a,'b, 'z>
 {
     pub prefix: &'a str,
-    pub base: &'b X<'b>,
+    pub base: &'z X<'b>,
 }

-impl<'a,'b> Write for Wrapper<'a,'b>
+impl<'a,'b,'z> Write for Wrapper<'a,'b,'z>
 {
     fn write(&mut self, buf:&[u8]) ->Result<usize, std::io::Error> { Ok(0) }
     fn flush(&mut self) ->Result<(), std::io::Error> { Ok(()) }
@@ -43,7 +43,7 @@

 }

-pub fn eggs<'c>(x:&'c mut X<'c>, scale:f32)
+pub fn eggs(x:& mut X, scale:f32)
 {
     bacon( & mut X::wrap("A:\t", x), scale);

@@ -53,5 +53,7 @@

     f(x);

+    x.boop_the_snoot();
+
     f(x);
 }

And the complete "fixed" source code is
use std::io::Write;

pub struct X<'c>
{
    maybe_file: Option<Box<dyn Write+'c>>,
}

impl<'c> X<'c>
{
    pub fn wrap<'a:'c,'b:'c,'z:'c> (prefix:&'a str, base: &'z mut X<'b>) ->X<'c>
    {
        return X::<'c> {
            maybe_file: Some(Box::new(X::wrapper(prefix, base))),
        }
    }
    pub fn wrapper<'a, 'b, 'z>(prefix:&'a str, base:&'z mut X<'b>) -> Wrapper<'a,'b, 'z>
    {
        Wrapper {
            prefix:prefix, base:base
        }
    }

    pub fn boop_the_snoot(&self) {}
}

//

pub struct Wrapper<'a,'b, 'z>
{
    pub prefix: &'a str,
    pub base: &'z X<'b>,
}

impl<'a,'b,'z> Write for Wrapper<'a,'b,'z>
{
    fn write(&mut self, buf:&[u8]) ->Result<usize, std::io::Error> { Ok(0) }
    fn flush(&mut self) ->Result<(), std::io::Error> { Ok(()) }
}

pub fn bacon(x:&mut X, scale:f32)
{

}

pub fn eggs(x:& mut X, scale:f32)
{
    bacon( & mut X::wrap("A:\t", x), scale);

    let f = |x:&mut X| {
        bacon(& mut X::wrap("B:\t", x), scale);
    };

    f(x);

    x.boop_the_snoot();

    f(x);
}

So, this is basically half an answer: the code compiles and I can continue with my project using this pattern; However it relies on the rust compiler to do some lifetime inferences while compiling eggs().  What would the code look like if we were to annotate eggs() with lifetime information that matches what the compiler infers?  The answer to that would be educational.


text:
Q: On Java8 I cannot inherit an overriden inherited annotation I have an annotation
@Qualifier
@Inherited
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface InheritedQualifier {
     public String value();
}

and I have four classes that make use of it.

*

*Parent which has @InheritedQualifier("original")

*Child which extends Parent but makes no modification

*GrandChild which extends Parent and has @InheritedQualifier("override")

*GreatGrandChild which extends GrandChild but makes no modification

All four classes also implement @Named with unique Names. Finally I have a fifth class with the following injection:
@Inject @InheritedQualifier("original") @Named("parent") Parent parent;
@Inject @InheritedQualifier("original") @Named("child") Child child;
@Inject @InheritedQualifier("override") @Named("grandChild") GrandChild grandChild;
@Inject @InheritedQualifier("override") @Named("greatGrandChild") GreatGrandChild greatGrandChild;

Now here's the weird thing. When I run this on Oracle's Java7 it works fine. When I run it on Java8 it fails to inject GreatGrandChild. Here's the error message:
javax.enterprise.inject.UnsatisfiedResolutionException: Api type [com.ibm.ws.fat.jcdi.inheritance.GreatGrandChild] is not found with the qualifiers
Qualifiers:[@javax.inject.Named(value=greatGrandChild),@com.ibm.ws.fat.jcdi.inheritance.InheritedQualifier(value=override)]
for injection into Field Injection Point, field name :  greatGrandChild, Bean Owner : [MyBean, Name:myBean, WebBeans Type:MANAGED, API Types:[com.ibm.ws.fat.jcdi.inheritance.MyBean,java.lang.Object], Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any,javax.inject.Named]]
at org.apache.webbeans.util.InjectionExceptionUtils.throwUnsatisfiedResolutionException(InjectionExceptionUtils.java:77)
at org.apache.webbeans.container.InjectionResolver.checkInjectionPoints(InjectionResolver.java:193)
at org.apache.webbeans.container.BeanManagerImpl.validate(BeanManagerImpl.java:1031)
at org.apache.webbeans.config.BeansDeployer.validate(BeansDeployer.java:444)
at org.apache.webbeans.config.BeansDeployer.validateInjectionPoints(BeansDeployer.java:383)
at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:184)
at org.apache.webbeans.lifecycle.AbstractLifeCycle.startApplication(AbstractLifeCycle.java:155)
at org.apache.webbeans.web.lifecycle.WebContainerLifecycle.startApplication(WebContainerLifecycle.java:97)
at com.ibm.ws.webbeans.WebBeansInitializer.onStartup(WebBeansInitializer.java:70)
at com.ibm.ws.webcontainer.webapp.WebApp.initializeServletContainerInitializers(WebApp.java:2485)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:1038)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:6404)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp(DynamicVirtualHost.java:446)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:248)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:313)
at com.ibm.ws.http.internal.VirtualHostImpl.discriminate(VirtualHostImpl.java:251)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:306)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:449)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:383)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:283)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:254)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:174)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:83)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:504)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:574)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:929)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1018)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:744)

The other three injection's work fine.
I'm running this application on IBM Websphere Liberty Profile.
Does anyone have any idea why this code isn't portable from Java7 to Java8?

A: This link Troubleshooting contexts and dependency injection
suggests you have some kind of class-path problem. You've said that when you run in java 7 the application works fine, but with java 8 it does not. Is the execution environment difference only the JVM used? For example, the only change you did to run the program with java 8 was to point the same Liberty Profile to a different JVM?
If that is not the case, there is a big chance that the difference is between two execution environments instead of two different JVMs.
However, you mention in the comments that the only change is the JAVA_HOME environment variable. So, you may have struck just a possible application framework bug, or a bug within java itself.
My suggestions now is:
If it don't work with java 8, avoid using it. Java 8 is kind of new, it's less than one year old. For server usage, it is a baby... BY the way, the latest Websphere specification only supports java 6 or 7... Check it out: Websphere 8.5.5 requirements - java
There are known incompatibilities between java 7 and java 8, and maybe you have just struck one of them, indirectly:
incompatibilities between java 7 and 8- oracle doc

A: It turns out this was a bug in the application server; it has now been patched.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Is there a countable discrete infinite group $G$ over which the group algebra $\mathbb{C} G$ is semisimple? I am seeking for an Artin $k$-algebra (especially for group algebra) which is infinite-dimensional over some field $k$. It's known that any complex group algebra has trivial Jacobson radical. So I have the following question:
Is there a countable discrete infinite group $G$ over which the group algebra $\mathbb{C} G$ is semisimple?

A: The answer is negative as any semisimple Hopf algebra is finite-dimensional. More generally, the same conclusion is true for all Artinian Hopf algebras. See e.g. Liu and Zhang - Artinian Hopf algebras are finite dimensional.

A: No: if the discrete group algebra $\mathbb C G$ is semisimple, then $G$ is finite.
Consider the trivial $G$-module $\mathbb C$ and the quotient map of $G$-modules $\mathbb C G \to \mathbb C$ which sends $g \mapsto 1$ for all $g \in G$. If $\mathbb C G$ is semisimple, then this map splits, giving a nonzero $G$-invariant element $$e = \sum_{g \in G} a_g g \in \mathbb C G$$ where $a_g \in \mathbb C$ are almost all zero and $$\sum_{g\in G} a_g = 1.$$
The element $e$ is invariant if and only if $a_g = a_1$ for all $g \in G$, hence such $e$ exists if and only if $G$ is finite.


text:
Q: About tensorboard name_scope I use name_scope to manage namepsace of variables, so it can show well by tensorboard. But I find something strange, name_scope don't add prefix to variables created by tf.get_variable.
So the code raise a error:
with tf.name_scope(self.networkName + '/conv1'):
    self.conv1_w = tf.get_variable(shape = [8, 8, 4, 16], name = 'w', initializer=tf.contrib.layers.xavier_initializer())
    self.conv1_b = tf.get_variable(shape = [16], name = 'b', initializer=tf.contrib.layers.xavier_initializer())
    self.conv1_o = tf.nn.relu(tf.nn.conv2d(self.states, self.conv1_w, [1, 4, 4, 1], 'SAME') + self.conv1_b)

with tf.name_scope(self.networkName + '/conv2'):
    self.conv2_w = tf.get_variable(shape = [4, 4, 16, 32], name = 'w', initializer=tf.contrib.layers.xavier_initializer())
    self.conv2_b = tf.get_variable(shape = [32], name = 'b', initializer=tf.contrib.layers.xavier_initializer())
    self.conv2_o = tf.nn.relu(tf.nn.conv2d(self.conv1_o, self.conv2_w, [1, 2, 2, 1], 'SAME') + self.conv2_b)

ValueError: Variable w already exists, disallowed.

Can I use variable_scope instead of name_scope? And tensorboard can work on variable_scope?

A: tf.name_scope defines a prefix for the operations defined within the scope.
tf.variable_scope defines a prefix for the operations and variables defined within the scope.
You have to use tf.variable_scope if you want to create a variable with the same name of another variable but in a different scope.
tf.name_scope is used to define custom operations in order to well define the context.
Personally, I use tf.variable_scope almost always.
Moreover, yes, tf.variable_scope creates good looking graph in tensorboard exactly as tf.named_scope


text:
Q: Responsive table design by cell I have this table with three cells in the first row. I'm trying to create a design that will bring down the last cell if there is no space. So something like 2 on top, 1 below. And as the window gets even small 1 on each row. I'm having trouble finding anything like this.
I was able to get a responsive design to stack all cells on top of each other depending on size but if I could find a better solution that would be nicer.
HTML:

Loading chart please be patient...

Loading chart please be patient...

Loading chart please be patient...

CSS:
#dashboard{
    border-collapse: separate;
    border-spacing: 5px 5px;
    border: 5px solid red;
    background-color: blue;
}

div.chartLoadingOverlay{
    font-style:italic;
    color:gray;
    border:1px silver solid;
    background-color:#F5F5F5;
    line-height:250px;
    height:250px;
    width:500px;
    text-align:center;
    margin:2px;
}

@media only screen and (max-width: 1000px){
    /* Force table to not be like tables anymore */
    #dashboard table{
         width: 100%;
         border-collapse: collapse;
         border-spacing: 0;
         display: block;
         position: relative;
         width: 100%;
    }

    #dashboard tbody {
        /*display: block;*/
        width: auto; position: relative;
        overflow-x: auto;
        white-space: nowrap;
    }

    #dashboard tbody tr {
        display: inline-block;
        vertical-align: top;
    }

    #dashboard td {
        display: block;
    }
}

A: That's not possible. But even if it were doable, a more elegant solution would be to stack 3 divs side-by-side and responsively put them one below the other. Check this Bootstrap example  for something quite similar to what you want.

A: Tables should not be used for responsive design...
Store this to make it a thumb rule  : http://shouldiusetablesforlayout.com/
You can try something like this to make DIV structure and make that responsive:

  something here

  something here

  something here

CSS:
#container
{
width: 100 %;
clear: both;
border: 1px solid #CCC;
}
#col_left
{
float: left;
width: 20%;
margin: 0 5px 0 0;
border: 1px solid #CCC;
}
#col_mid
{
float: left;
width: 20%
margin: 0 5px 0 0;
border: 1px solid #CCC;
}
#col_right
{
float: right;
width; 35%;
margin: 5px;
border: 1px solid #CCC;
}

you can refer this http://jsfiddle.net/aasthatuteja/awvck/

A: You can change display like this http://jsfiddle.net/Yr22s/1/
BUT, it effectively changes your table to be div

A: sorry i dont think this is  possible ..actually its not posiible...you cant break a tabular design...
what does a row mean???its a collection of cells...so one row will always contain a particular number of cells...you cant change number of cells in a row depending on screen width..its fixed...
for example consider this table in image

now if your screen width gets too small to accommodate its total width then it will overflow horizontally and horizontal scroll bar will be introduced...and if one cell gets too tall then row size will take the height of tallest cell and rest of the cell will be aligned vertically middle by default...you cant change this property dynamically depending on screen size
what you can do is ..define there width using %..so it wil grow or shrink according to screen width...
this is one reason(actually there are many) why you should avoid tabular design..use container(
) to design your website


text:
Q: Jetty 9 Error: Suppressed: java.lang.Throwable: HttpInput failure I am using the Jetty 9.4.15 server to deploy the war in a standalone mode with the Http2.
The number of concurrent streams configured are jetty.http2.maxConcurrentStreams=1000 instead of default 128. This is because I am getting too many concurrent streams error as the client is having more streams.
The application is working fine, except some sporadic errors as shown below in the server logs.
org.eclipse.jetty.io.EofException: Reset cancel_stream_error
    at org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory$HTTPServerSessionListener.onReset(HTTP2ServerConnectionFactory.java:156) ~[?:?]
    at org.eclipse.jetty.http2.HTTP2Stream.notifyReset(HTTP2Stream.java:574) ~[?:?]
    at org.eclipse.jetty.http2.HTTP2Stream.onReset(HTTP2Stream.java:343) ~[?:?]
    at org.eclipse.jetty.http2.HTTP2Stream.process(HTTP2Stream.java:252) ~[?:?]
    at org.eclipse.jetty.http2.HTTP2Session.onReset(HTTP2Session.java:294) ~[?:?]
    at org.eclipse.jetty.http2.parser.Parser$Listener$Wrapper.onReset(Parser.java:368) ~[?:?]
    at org.eclipse.jetty.http2.parser.BodyParser.notifyReset(BodyParser.java:139) ~[?:?]
    at org.eclipse.jetty.http2.parser.ResetBodyParser.onReset(ResetBodyParser.java:97) ~[?:?]
    at org.eclipse.jetty.http2.parser.ResetBodyParser.parse(ResetBodyParser.java:66) ~[?:?]
    at org.eclipse.jetty.http2.parser.Parser.parseBody(Parser.java:194) ~[?:?]
    at org.eclipse.jetty.http2.parser.Parser.parse(Parser.java:123) ~[?:?]
    at org.eclipse.jetty.http2.parser.ServerParser.parse(ServerParser.java:115) ~[?:?]
    at org.eclipse.jetty.http2.HTTP2Connection$HTTP2Producer.produce(HTTP2Connection.java:248) ~[?:?]
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produceTask(EatWhatYouKill.java:357) ~[?:?]
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:181) ~[?:?]
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) ~[?:?]
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) ~[?:?]
    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) ~[?:?]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765) ~[?:?]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683) ~[?:?]
    at java.base/java.lang.Thread.run(Thread.java:834) [?:?]
    Suppressed: java.lang.Throwable: HttpInput failure
        at org.eclipse.jetty.server.HttpInput.failed(HttpInput.java:831) ~[?:?]
        at org.eclipse.jetty.http2.server.HttpChannelOverHTTP2.onFailure(HttpChannelOverHTTP2.java:323) ~[?:?]
        at org.eclipse.jetty.http2.server.HTTP2ServerConnection.onStreamFailure(HTTP2ServerConnection.java:219) ~[?:?]
        at org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory$HTTPServerSessionListener.onReset(HTTP2ServerConnectionFactory.java:156) ~[?:?]
        at org.eclipse.jetty.http2.HTTP2Stream.notifyReset(HTTP2Stream.java:574) ~[?:?]
        at org.eclipse.jetty.http2.HTTP2Stream.onReset(HTTP2Stream.java:343) ~[?:?]
        at org.eclipse.jetty.http2.HTTP2Stream.process(HTTP2Stream.java:252) ~[?:?]
        at org.eclipse.jetty.http2.HTTP2Session.onReset(HTTP2Session.java:294) ~[?:?]
        at org.eclipse.jetty.http2.parser.Parser$Listener$Wrapper.onReset(Parser.java:368) ~[?:?]
        at org.eclipse.jetty.http2.parser.BodyParser.notifyReset(BodyParser.java:139) ~[?:?]
        at org.eclipse.jetty.http2.parser.ResetBodyParser.onReset(ResetBodyParser.java:97) ~[?:?]
        at org.eclipse.jetty.http2.parser.ResetBodyParser.parse(ResetBodyParser.java:66) ~[?:?]
        at org.eclipse.jetty.http2.parser.Parser.parseBody(Parser.java:194) ~[?:?]
        at org.eclipse.jetty.http2.parser.Parser.parse(Parser.java:123) ~[?:?]
        at org.eclipse.jetty.http2.parser.ServerParser.parse(ServerParser.java:115) ~[?:?]
        at org.eclipse.jetty.http2.HTTP2Connection$HTTP2Producer.produce(HTTP2Connection.java:248) ~[?:?]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produceTask(EatWhatYouKill.java:357) ~[?:?]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:181) ~[?:?]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) ~[?:?]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) ~[?:?]
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) ~[?:?]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765) ~[?:?]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683) ~[?:?]
        at java.base/java.lang.Thread.run(Thread.java:834) [?:?]

`
The client logs shows the below error.
Client.Timeout exceeded while awaiting headers.
The client is using streaming instead of waiting for complete response. I am not sure why this error is occurring some times. The client timeout is configured as 30 Seconds, I checked the application logs, where the application processing logic never exceeded 2 seconds.
Could someone help me in finding the root cause for this issue?


text:
Q: Install SharePoint 2010 on which servers of farm? I was a little confused on this. Our SharePoint 2007 has SharePoint on the backend for some reason? Is this right?
This leads me to believe that I need to install SharePoint 2010 on the backend/database server as well as the web server. Is this true?

A: If you have SQL Server Reporting Services in SharePoint 2007 Native Mode, this would have required SharePoint installed on the SSRS server. This is probably why your set up looks like it does - it's much cheaper to install a non-accessible SharePoint instance on your DB server than it is to install a DB instance on one of your WFE machines.
It's just a result of licensing, costs, etc. I'm not entirely sure what the required set up is for using SSRS in SharePoint 2010 so I don't know if this same configuration is required.
*Note that SSRS can really drag down your farm performance if you are using only 1 SQL Server to host the SharePoint Content Databases AND your SSRS instance. It's better to set up a server just to handle the SSRS stuff and leave your other server(s) to handle just SharePoint related tasks. Just a random aside based on observations.
This blog post discusses the server configuration for Report Services and SharePoint. Look at 03 - Available Server.
http://mosshowto.blogspot.com/2009/03/reporting-services-sharepoint-multiple.html

A: No, you don't need to install anything to do with SharePoint on your database tier (nor should you). It just needs to be running SQL Server and have good network bandwidth and latency to the other servers in your farm.
This is true for both 2007 and 2010 versions of SharePoint.

A: If the database server is also going to be included in serving content and or serve in an application role, then you'd install SharePoint on that as well.  Otherwise, no, you shouldn't be needing to install it on the DB server.

A: Did your devs mean the following?
install just the central admin and application servers on the backend (not being accessible by inter/intranet).
Only make the web frontends publicly available. This is security-wise smart to do. SharePoint is not needed on the database server, if the the database server's only role is to, euh, be a database server :)


text:
Q: Why `--exclude-dir "_book"` works but `--exclude-dir={_book}` failed when using BSD grep? My grep version is grep (BSD grep) 2.5.1-FreeBSD and my operating system is OSX 10.13.3 (17D47)
I have a gitbook repo, and there is a temporary directory named _book which I want to ignore while using grep.
When I used grep -Fnrl mysql ./ --exclude-dir={_book}, it didn't exclude the _book directory. The result looks like
...
.//UTILITIES/my_utils/shell_scripts/get_several_days_mysql_data_log.sh
.//_book/search_jieba_index.dat
.//_book/LANGUAGES/awk/awk_magic.html

But the command grep -Fnrl mysql ./ --exclude-dir "_book" has gave me what I expected, the result looks like
...
.//UTILITIES/my_utils/shell_scripts/get_several_days_mysql_data_log.sh

I've searched on stackoverflow, and find a question which mentions the first command style and get 3 upvotes, so I guess it works under certain circumstances.
The question link is: Using grep with the --exclude-dir flag to exclude multiple directories
Why did this happen?
What should I do if I want to use the first command style to exclude _book successfully?

A: That post is taking advantage of bash's brace expansion:
$ printf "%s\n" --exclude-dir={a,b,c}
--exclude-dir=a
--exclude-dir=b
--exclude-dir=c

However, brace expansion is not applied when there is only one element, and the braces are left as-is:
$ printf "%s\n" --exclude-dir={a}
--exclude-dir={a}

Since the brace expansion is a feature of bash (and some other shells) but not grep, to grep it looks like you told it to exclude a directory named {_book}.

A: These aren't different "command styles."  They're making use of a bash feature, not a grep feature.
Read up on it by running:
LESS='+/Brace Expansion' man bash

When you have comma-separated values inside of the braces, your shell expands them to multiple arguments before grep ever sees them.
Since you are only passing a single directory, you don't need brace expansion.
When you use braces with only a single item in between (no commas and no double periods to indicate range), your shell leaves the braces alone.  You're left passing to grep the literal name {_book}, which is not the directory you want to exclude.

It's worth mentioning that you don't need the double quotes, either.
grep -Fnrl mysql ./ --exclude-dir _book

...will work just fine.
The double quotes don't hurt anything, but they aren't necessary either.  You could use them on all arguments with the same result, as the quotes are removed by the shell—before grep ever sees them.
grep '-Fnrl' "mysql" './' "--exclude-dir" \_\b\o\o\k

You can even quote the command name itself 'grep', although this has a slightly different meaning.  Specifically, it suppresses alias lookup.  On Ubuntu systems, for instance, grep is usually aliased to grep --color=auto.  Quoting "grep" (or any part of it) will bypass this alias.
gr\ep -Fnrl mysql ./ --exclude-dir _book

The moral of the story is, understand the quoting rules for the language you're writing in.
Or you can "make" errors with confusing results.


text:
Q: How to set up package-building? Though we are largely satisfied with the official packages provided by Ubuntu, some times we'd like to make a change (like adding a patch or upgrade version) to an existing package or even add a package of our own.
I come from the FreeBSD world, where this is handled by "ports" -- is there anything like it for Ubuntu?

A: It's not a good idea to try and start patching official Ubuntu software packages yourself. You'll end up with an unsupportable configuration.
Best to check the backports repository, or the proposed repository, for updated packages that may include a fix that you require.
If you have a specific fix or patch suggestion, it's best to submit it, and let them implement/test it, and then submit it upstream.


text:
Q: Delete 2 Rows above if specific cell is blank [Loop] I have a hard coded report that generates about 10 sections. After running the report some sections may not contain data. I want to search for those specific cells and delete the two rows (saection headers) above if that cell is blank (no data).
For example:
If cell B586 is blank, delete rows 584:585.
and then...
If cell B505 is blank, delete rows 503:504
etc..

A: One way to achieve this would be as follows, the reason I delete the rows below (586) before checking the rows above (505) is because once you delete the row, the rows shift up, in essence changing the row numbers:
Sub foo()
Dim ws As Worksheet: Set ws = Sheets("Sheet1")
    If ws.Range("B586").Value = "" Then ws.Rows("584:585").Delete
    If ws.Range("B505").Value = "" Then ws.Rows("503:504").Delete
End Sub


text:
Q: Is there a better, 3rd party "Find" / "Search" add-on for Visual Studio 2008? I can't stand Visual Studio 2008's "Find" or "Find and replace" functionality, does anyone know of a better 3rd party solution that integrates into visual studio?  At this point, I'd gladly take any "Find" utility, visual studio integration or not.
Some of the things VS.net 08 wont do that I'd like to do:

*

*let you specify the file type ("*.sql" would be nice)

*let you specify which solution or folder, "Current Project" seems like a waste or after thought

If anything else, just post your favorite "Find" app and I'll check them out

A: Entrian Source Search http://entrian.com/source-search/ is a Search addin for Visual Studio.  It builds a full-text index of your files, so searching is always near-instant.  The results are syntax-highlighted, and it supports filtering by file type, filename and directory.
Full disclosure: I'm the author (and I wrote it because I too was frustrated by Visual Studio's own search features ;-).

A: The "Find in Files" command allows you to specify the file type, and allows you to specify exactly which folders to search in. It even allows the use of regular expressions.
Please try it out, and edit your question accordingly.

A: Resharper.

A: The Sando Code Search Tool is a free, open-source Visual Studio extension that searches your C, C++, and C# code.  It returns results as a list of program elements (e.g., methods, elements, fields, enums, etc), using a Google-like search engine to identify relevant results instead of the typical regular expression based approach. It supports exclusions (e.g., 'add file -test'), limit by filetype (e.g., 'add file filetype:cs'), and exact matching (e.g., '"AddFile(File);"') and includes conceptual autocomplete.
Sando searching a roguelike game for "add weapon".

Sando searching for an exact match using quotes and reviewing results with code snippet preview.

Supports: VS2010 (all versions), VS2012 (all versions)
Languages: C, C++, C#
Full Disclosure: I am the project lead for this extension and so I may be biased :)

A: Find is brilliant in VS 2008.
Do CTRL+SHIFT+F to bring up the advanced find window.
Then you can do everything you asked about and more.

A: SonicFileFinder is pretty handy to use, if you want to search by filename. Allows you to type partial file name, and see all the matching filenames.

A: I'm using VS2008 Standard Edition,and "Find In Files" did not appear as one of the choices in the Edit menu!
I had to add it via "Customize...".  Had to add the Ctrl+Shift+F shortcut via "Keyboard..." too.


text:
Q: How can I set a minimum threshold for my LUISDialog to go to None Intent in .NET? I have a LuisDialog as such:
[LuisModel("...", "...", domain: "...")]
[Serializable]
public class MainLUISDialog : LuisDialog<object>
{

   [LuisIntent("None")]
   public async Task Default(IDialogContext context, LuisResult result)
   {
      await context.PostAsync("Não percebi, podes ser mais claro se faz favor?");
      context.Wait(MessageReceived);
   }

   [LuisIntent("Service.Cancel")]
   public async Task CancelService(IDialogContext context, LuisResult result)
   {
      await context.PostAsync("Queres cancelar um serviço.");
      await context.PostAsync("Entities:");
      foreach (var entity in result.Entities)
      {
         await context.PostAsync($"{entity.Type}: {entity.Entity}");
      }
      context.Wait(MessageReceived);
   }
...

I wanted to know how I can set so that for example all utterances that have an intent score lower than 0.7 will go to the None intent, is there any way to programmatically in my code add this threshold? I can't seem to find any way to do this with the code I have.

A: One way could be inheriting from LuisDialog and override one of these functions:

*

*BestIntentFrom

*BestResultFrom

*DispatchToIntentHandler
In any of those functions, you should be able to do your logic to discard the intent detected and replace it with None.
If this is just for 1-2 intents, then it might not be worthy to do the overrides and instead, you can just check it in all the intent methods as:
 if (result.TopScoringIntent.Score < threshold)
 {
     return Default(context, result);
 }


text:
Q: For $z=x\sin (y/x)$ with $x=r+s$ and $y=r-3s$ find $\frac{\partial^2 z}{\partial r \partial s}$ For $z=x\sin (y/x)$ with $x=r+s$ and $y=r-3s$ find $$\frac{\partial^2 z}{\partial r \partial s}$$

My try:
$$\frac{\partial^2 z}{\partial r \partial s}=\frac{\partial }{\partial r }\frac{\partial z}{\partial s }$$
$$=\frac{\partial }{\partial r }(\frac{\partial z}{\partial x }\frac{\partial x}{\partial s }+\frac{\partial z}{\partial y }\frac{\partial y}{\partial s })$$
$$\frac{\partial }{\partial r }(\sin(y/x)+(-y/x-3)\cos(y/x))$$
$$=\color{red}{\frac{\partial }{\partial r }\sin(y/x)}+\color{blue}{\cos(y/x)\frac{\partial }{\partial r }(-y/x-3)}+\color{green}{(-y/x-3)\frac{\partial }{\partial r }\cos(y/x)}$$
$$=\color{red}{-y/x^2\cos(y/x)+1/x\cos(y/x)}$$$$+\color{blue}{(y/x^2-1/x)\cos(y/x)}$$$$+\color{green}{(y/x^2\sin(y/x)-1/x\sin(y/x))(-y/x-3)}$$

A: A possibility since the $(x,y)\to(r,s)$ map is quite simple (and easily invertible)
is to express $z=(r+s)\sin(\frac{r-3s}{r+s})$ and calculate directly in $r,s$.
It is a bit messy because there are a lot of terms, but the chain rule goes more smoothly, anyway you get a lot of simplifications in the end, I arrived to:
$$\dfrac{\partial^2z}{\partial r\partial s}=16\,rs\,\dfrac{\sin\left(\frac{r-3s}{r+s}\right)}{(r+s)^3}=\dfrac{(3x+y)(x-y)}{x^3}\sin\left(\frac yx\right)$$


text:
Q: Limit the data points in Highchart I have a following statement and it generates the mentioned output by averaging data within every 20 minutes of range.
Statement :
SELECT record_no, date_time,
ROUND(AVG(UNIX_TIMESTAMP(date_time))) AS time_value,
ROUND(AVG(ph1_active_power),4) AS p1,
ROUND(AVG(ph2_active_power),4) AS p2,
ROUND(AVG(ph3_active_power),4) AS p3
FROM powerpro1
GROUP BY date_time DIV 2000

Portion of the output
+-----------+---------------------+------------+---------+----------+----------+
| record_no |      date_time      | time_value |   p1    |    p2    |    p3    |
+-----------+---------------------+------------+---------+----------+----------+
|         1 | 2014-12-01 00:00:00 | 1417372770 | 72.6242 | -68.7428 | -72.6242 |
|        21 | 2014-12-01 00:20:00 | 1417373970 | 71.6624 | -69.7448 | -71.6624 |
|        41 | 2014-12-01 00:40:00 | 1417375170 | 70.6869 | -70.7333 | -70.6869 |
|        61 | 2014-12-01 01:00:00 | 1417376370 | 69.6977 | -71.7082 | -69.6977 |
|        81 | 2014-12-01 01:20:00 | 1417377570 | 68.6952 | -72.6692 | -68.6952 |
|       101 | 2014-12-01 01:40:00 | 1417378770 | 67.6794 | -73.6162 | -67.6794 |
|       121 | 2014-12-01 02:00:00 | 1417379970 | 66.6505 | -74.549  | -66.6505 |
|       141 | 2014-12-01 02:20:00 | 1417381200 | 65.5825 | -75.4901 | -65.5825 |
+-----------+---------------------+------------+---------+----------+----------+

According to the no of records in the table named "powerpro1", the above query selects 1368 records when the executing. (May be increased in the future when receiving new records)
My requirement is to create a highchart using time_value for the x-axis and p1, p1 and p3 for the y-axis. But I needs to limit the no of points in the x-axis.
Can anyone like to help me to show this 1368 points by 1000 points in the chart

A: Unfortunately have no this kind of apporixmation, only in reverse order (I mean datagrouping, if you have 100 points, return i.e 10). So you need to calcualte it on your own and push to your data all 1000 points.


text:
Q: Binding a Distinction basedon Actual Width to Visibility Is it possible to bind an ActualWidth or Width property of a Control to the Visibility of another Control with a distinction about value (like <200)? In my Opinion it is only possible with a converter because a DataTrigger can not work with > or <.
So I tried it with a Converter but it didn't work. I'm not sure which BindingMode is necessary and which kind of converter I need for such a solution.
The xaml code:
<StackPanel>
    <Slider x:Name="slider" Height="36" Width="220" Maximum="500"/>
    <Rectangle x:Name="mover"  Height="12" Stroke="Black" Width="{Binding Value, ElementName=slider}"/>
    <Rectangle x:Name="rectangle" Fill="#FFFF9E0E" Height="34" Width="112" Visibility="{Binding ActualWidth, Converter={StaticResource umkehr}, ElementName=rectangle, Mode=OneWay}"/>
</StackPanel>

and the idea for the converter:
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
   if (value != null) {
       var val = System.Convert.ToDouble(value);
        if (val > 100)
            return Visibility.Visible;
        return Visibility.Collapsed;
    }
        return Visibility.Collapsed;
}

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
    throw new NotImplementedException();
}

A: It is likely not working because you are binding your Rectangle's Visibility to the same rectangle's ActualWidth, and an invisible rectangle will always have a width of 0, so will never be visible.
Here's some examples. One binds to the other rectangle's ActualWidth, and the other binds to your Slider's Value
<Rectangle x:Name="rectangle"
           Visibility="{Binding ActualWidth, ElementName=mover,
               Converter={StaticResource umkehr}}"/>

or
<Rectangle x:Name="rectangle"
           Visibility="{Binding Value, ElementName=slider,
               Converter={StaticResource umkehr}}"/>

And as far as I know, there's no easy way of basing a value off of  if something is greater than or less than a value. Coverters are your best option.

A: ActualWidth is a readonly property exposed by FrameworkElement class -
public double ActualWidth { get; }

It is get only property hence you can't set it to other value from code. You can bind to Width of your control instead to make it work.
EDIT
This works for me, may be this is what you want -
Converter
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
    if (value is double)
    {
       return ((double)value > 100) ? Visibility.Visible : Visibility.Collapsed;
    }
    return Visibility.Collapsed;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
   throw new NotImplementedException();
}

XAML
<StackPanel>
   <Slider x:Name="slider" Height="36" Width="220" Maximum="500"/>
   <Rectangle x:Name="mover"  Height="12" Stroke="Black" Width="{Binding Value, ElementName=slider}"/>
    <Rectangle x:Name="rectangle" Fill="#FFFF9E0E" Height="34" Width="112" Visibility="{Binding ActualWidth, Converter={StaticResource MyConverter}, ElementName=mover, Mode=OneWay}"/>
</StackPanel>

A: If you're attempting to change the Visibility of a control based on the ActualWidth of another control, you'll either need to use a IValueConverter or you're own type of MarkupExtension (inherit from Binding or BindingBase).
Converter Option:
[ValueConversion(typeof(Double), typeof(Visibility))]
[ValueConversion(typeof(Double?), typeof(Visibility))]
public class MinimumLengthToVisibilityConverter : IValueConverter
{
    public Double MinLength { get; set; }

    public override Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture)
    {
        if ((value == null) || !(value is Double))
        {
            return DependencyProperty.UnsetValue;
        }

        return (((Double)value) > MinLength) ? Visibility.Visible : Visibility.Collapsed;
    }

    public override Object ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture)
    {
        return DependencyProperty.UnsetValue;
    }
}

MarkupExtension Option:
Read this blog post to get a better feel for how to implement this...

A: You can actually have the value in a parameter, so you can re-use the converter if you need to:
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            double cutoff = 0.0;

            if(parameter is double)
            {
                cutoff = (double)parameter;
            }

            if (parameter is string)
            {
                Double.TryParse(parameter.ToString(), out cutoff);
            }

            if (value is double)
            {
                return ((double)value > cutoff) ? Visibility.Visible : Visibility.Collapsed;
            }
            return Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

And the XAML:
<StackPanel>
    <Slider x:Name="slider" Height="36" Width="220" Maximum="500"/>
    <Rectangle x:Name="mover"  Height="12" Stroke="Black" Width="{Binding Value, ElementName=slider}"/>
     <Rectangle x:Name="rectangle" Fill="#FFFF9E0E" Height="34" Width="112"
                Visibility="{Binding ActualWidth, Converter={StaticResource ActualWidthToVisibilityConverter},
                ElementName=mover, Mode=OneWay, ConverterParameter=100}"/>
</StackPanel>


text:
Q: Create 2D matrices from several csv files I'm working with Python3 and I would like to load datas from several CSV files.
Each CSV (one measurement) has 3 columns (3 different physical quantities). I want to load each quantity on 3 separate variables. For one CSV file this is quite simple, I used :
TIME,CH1,CH2 = loadtxt(file_path,usecols=(3,4,5),delimiter=',',skiprows=2,unpack=True)

and it worked fine. Now I would like to extend this procedure so I can load several CSV files. Each array would be 2D, each column representing one CSV file. Instead of having several CSV with three variables, I will have 3 2D arrays, which is much more convenient for data analysis.
I thought I could try something like this :
TIME = matrix(zeros((20480,len(file_path)))) # 20480 length of each column
CH1 = matrix(zeros((20480,len(file_path)))) # len(file_path) number of CSV files
CH2 = matrix(zeros((20480,len(file_path))))
for k in range(0,len(file_path)): # reading each CSV file
    TIME[:,k],CH1[:,k],CH2[:,k] = loadtxt(file_path[k],usecols=(3,4,5),delimiter=',',skiprows=2,unpack=True)

But it's telling me :
ValueError: could not broadcast input array from shape (20480) into shape (20480,1)

In the end I would like variables looking like this :
TIME = matrix([[0., 0., 0.],
               [0., 0., 0.],
               [0., 0., 0.],
               ...,
               [0., 0., 0.],
               [0., 0., 0.],
               [0., 0., 0.]])

Each column is from one different CSV file.
I think this is a quite usual problem, but I don't really get how arrays works in Python. I get this idea from Matlab which is quite straightforward but here I don't know why indexing arrays with TIME[:][:] doesn't work.
Have you any idea how I could do this ?
Thanks.

A: Use np.array, not np.matrix
I can't emphasize this enough. np.matrix exists only for legacy reasons. See this answer for an explanation of the difference. np.matrix requires 2 dimensions, while np.array permits a single dimension when indexing. This seems to be the source of your error.
Here's a minimal example exhibiting the behaviour you are seeing:
A = np.array([[1, 2, 3], [4, 5, 6]])
B = np.matrix(A)

print(A[:, 0].shape)  # (2,)
print(B[:, 0].shape)  # (2, 1)

Therefore, define your resultant arrays as np.array objects:
m = 20480
n = len(file_path)
shape = (m, n)

TIME = np.zeros(shape)
CH1 = np.zeros(shape)
CH2 = np.zeros(shape)


text:
Q: SQL, same column different rows to same row different columns I am trying to make this happen with SQL.
Table looks like this:
SerialNo    part    location
12345       aaa     R1
12345       bbb     R2
67890       ccc     R3
67890       ddd     R4
12345       eee     R5

I want to get:
SerialNo    Part1   Location1   Part2   Location2   Part3   Location3
12345       aaa     R1          bbb     R2          eee     R5
67890       ccc     R3          ddd     R4

Can anyone help?

A: I would say it is impossible in SQL; and it is really bad style.
The main problem is that SQL has predefined count of columns, while your "table" hasn't - there is no upper limit.
So, normally, you would fetch your data ORDER BY sn and then use the executing script/program to format it accordingly.
To help you with that, we would need to know your desired scripting/programming language.

A: you can try pivot. in my example here i have concatenated part and location together because i have no idea how to do this with two columns. the point that this is not good style remains, but maybe this helps you out a little.
i named your table ttt in my example:
select 'serialno' as serialno
     , [1], [2], [3], [4], [5]
from
( select ROW_NUMBER() over (partition by serialno order by part + ' - ' + location) as rn
       , serialno
       , (part + ' - ' + location) as pl
    from ttt ) as sourcetable
  pivot (
    max(pl)
    for rn in ([1], [2], [3], [4], [5])
    )  as pivottable

as you can see there i only provided five slots. you can add more if you like, but there will always be a fixed amount of them


text:
Q: How to detect when Angular Universal switches from SSR content to client content? When an Angular Universal application bootstraps in the browser, it replaces the whole
server-side-rendered page with content generated in the client. Although in many cases it is possible to make this transition seem seamless by employing certain techniques, it is still not hydration.
Here's an example issue that arises from this. Say there's a server-side-rendered input field and I manage to type something into this input before the client app bootstraps. If that happens, I will lose whatever I entered as soon as the client application bootstraps.
While I am not too concerned with this happening to my users, it does cause issues with E2E tests. The driver starts typing as soon as there are input nodes available and then the data entered is lost once the client app is bootstrapped. I would like to force the test driver to wait until the client app is bootstrapped.
My question: how can I detect the moment when Angular has switched it's server-side-rendered content for the client-generated application?
It seems that whenever bootstrapModule() resolves, this has already happened. Am I correct and is this reliable?


text:
Q: How to know version of current-running SAKAI? I need to know the version of the hosted and running SAKAI of my group. How can I know that?
Opening the homepage of SAKAI, aftger logged in, it reads the bottom line as below snapshot saying it is Sakai 1.0 (Kernel 1.3.3)- Server worker1 - does that mean it is version 1?

A: Sakai version 2.9.3 used the kernel version 1.3.3. You can see the versions used for Sakai 2.9.3 in the master pom file:
http://repo1.maven.org/maven2/org/sakaiproject/master/2.9.3/master-2.9.3.pom


text:
Q: How to extract the name of a column from a data frame to be used in the loop? I would like to copy the text of a data frame's column names one-by-one in a for loop. My code seems to return NULL values from the column name argument.
More broadly, I want to create a summary by factor of each of several columns.
# Create an example data frame
df <- data.frame( c( "a", "b", "c", "b", "c"), c( 6, 4, 10, 9, 11), c( 1, 3, 5, 3, 6))

colnames(df) <- c( "Group", "Num.Hats", "Num.Balls")

Now I want to loop over columns two and three, creating a data object storing the summary statistics by Group. The point is to get a look at how groups A, B, and C differ from one another with respect to balls and with respect to hats.
My code looks like this:
# Evaluate stats of each group
for (i in 2:3){
    assign(paste0("Eval.", colnames(df[[i]])), tapply(df[,i], df$Group, summary))
}

I am getting a single object called "Eval." With the summary statistics for Num.Balls. To be clear, I would like two objects, one called Eval.Num.Hats and one called Eval.Num.Balls.
If colnames() cannot be used in this way, is there another function to achieve my desired result? Alternatively, I'd be open to another solution if the loop is not required.

A: The df[[i]] is extracting the column as a vector and there are no colnames.  We can either use df[i] or the correct option is colnames(df)[i]
for (i in 2:3){
    assign(paste0("Eval.", colnames(df)[i]), tapply(df[,i], df$Group, summary))
 }

-output
Eval.Num.Hats
#$a
#   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
#      6       6       6       6       6       6

#$b
#   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
#   4.00    5.25    6.50    6.50    7.75    9.00

#$c
#   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
#  10.00   10.25   10.50   10.50   10.75   11.00

Eval.Num.Balls
#$a
#   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
#      1       1       1       1       1       1

#$b
#   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
#      3       3       3       3       3       3

#$c
#   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
#   5.00    5.25    5.50    5.50    5.75    6.00

A: You can avoid a for-loop altogether.
Explanation:
Here, using lapply I am looping over all columns (using their names) to be summarized, except the first one which is used for grouping (see what names(df1)[-1] returns).
with function basically attaches the dataframe so you don't need to do dataframe$column and you can simply type the column name.
by(variable to function, grouping variable, function) is used to apply summary by group.
We need to use the column name as variable and not character. That's why I am using mget() to convert the character name of the column to the variable.
smry.ls.df1 <- lapply(names(df1)[-1], function(col) with(df1, by(mget(col), Group, summary)))
names(smry.ls.df1) <- paste0("Eval.", names(df1)[-1]) #setting the names as you've shown

smry.list.df1

#> $Eval.Num.Hats
#> Group: a
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
#>       6       6       6       6       6       6
#> --------------------------------------------------------
#> Group: b
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
#>    4.00    5.25    6.50    6.50    7.75    9.00
#> --------------------------------------------------------
#> Group: c
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
#>   10.00   10.25   10.50   10.50   10.75   11.00
#>
#> $Eval.Num.Balls
#> Group: a
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
#>       1       1       1       1       1       1
#> --------------------------------------------------------
#> Group: b
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
#>       3       3       3       3       3       3
#> --------------------------------------------------------
#> Group: c
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
#>    5.00    5.25    5.50    5.50    5.75    6.00

If you want them to be saved as separate objects (not recommended) you can use list2env:
list2env(smry.list.df1, globalenv())

Data:
df1 <- data.frame(Group = c( "a", "b", "c", "b", "c"),
                  Num.Hats = c( 6, 4, 10, 9, 11),
                  Num.Balls = c( 1, 3, 5, 3, 6))

A: Here is another solution without any loops, using tidyr and broom.
library(tidyr)
library(broom)

df %>%
  #Change from wide to long format
  pivot_longer(cols = c("Num.Hats","Num.Balls"),
               names_to = "Var") %>%
  #group by Group (a,b,c) and Var (Num.Hats, Num.Balls)
  group_by(Group, Var) %>%
  #Calculate the summary function for each group
  do(tidy(summary(.$value)))

# A tibble: 6 x 8
# Groups:   Group, Var [6]
#  Group Var    minimum    q1 median  mean    q3 maximum
#  <fct> <chr>    <dbl> <dbl>  <dbl> <dbl> <dbl>   <dbl>
#1 a     Num.B~       1  1       1     1    1          1
#2 a     Num.H~       6  6       6     6    6          6
#3 b     Num.B~       3  3       3     3    3          3
#4 b     Num.H~       4  5.25    6.5   6.5  7.75       9
#5 c     Num.B~       5  5.25    5.5   5.5  5.75       6
#6 c     Num.H~      10 10.2    10.5  10.5 10.8       11


text:
Q: Define plateau of sigmoid function I have a sigmoid function
cycles = seq(1,21)
fluorescence = c(33.41491, 33.41534, 33.42511, 33.49943, 33.701, 33.8777, 33.95081, 33.97527, 33.98374, 33.98695, 33.98827, 33.98886, 33.98914, 33.98928, 33.98936, 33.9894, 33.98942, 33.98944, 33.98945, 33.98945, 33.98946)

And I wonder if there's a reproducible way of defining at which cycle the plateau phase of this function is reached?

A: Usually sigmoid functions will have horizontal asymptotes, and so will never actually "plateau".  Any place you locate the beginning of the plateau will be arbitrary.
But you might be able to define an arbitrary definition of "plateau" that makes sense for your specific case.  For example you could say the plateau begins between cycle 6 and 7 since fluorescence increases < 0.1 units at that point.
If you want to statistically locate the beginning of the plateau, you could use a segmented model, like a quadratic plateau model. Below I have R code for this.  In this case, the model fit isn't perfect, and I could see some theoretical objections to fitting this model to this data.  The predicted break point (clx) is 7.86, and you can get a confidence interval for this value.
### Adapted from: https://rcompanion.org/handbook/I_11.html

if(!require(nlstools)){install.packages("nlstools")}
if(!require(rcompanion)){install.packages("rcompanion")}

cycles = seq(1,21)
fluorescence = c(33.41491, 33.41534, 33.42511, 33.49943, 33.701, 33.8777, 33.95081, 33.97527, 33.98374, 33.98695, 33.98827, 33.98886, 33.98914, 33.98928, 33.98936, 33.9894, 33.98942, 33.98944, 33.98945, 33.98945, 33.98946)

plot(fluorescence ~ cycles)

Data = data.frame(Cycles = cycles[5:21], Fluorescence = fluorescence[5:21])

a.ini     = 0
b.ini     = 1
clx.ini   = 15

quadplat = function(x, a, b, clx) {
  ifelse(x  < clx, a + b * x + (-0.5*b/clx) * x * x,
         a + b * clx + (-0.5*b/clx) * clx * clx)}

model = nls(Fluorescence ~ quadplat(Cycles, a, b, clx),
            data = Data,
            start = list(a   = a.ini,
                         b   = b.ini,
                         clx = clx.ini),
            trace = FALSE,
            nls.control(maxiter = 1000))

summary(model)

library(nlstools)

Boot = nlsBoot(model)

summary(Boot)

library(rcompanion)

plotPredy(data  = Data,
          x     = Cycles,
          y     = Fluorescence,
          model = model,
          xlab  = "Cycles",
          ylab  = "Fluorescence")

hist(resid(model))

plot(resid(model) ~ predict(model))

plot(resid(model) ~ Data$Cycle)

   ### Parameters:
   ###     Estimate  Std. Error  t value  Pr(>|t|)
   ### a   31.85041     0.11334   281.01   < 2e-16 ***
   ### b    0.54367     0.03531    15.40  3.59e-10 ***
   ### clx  7.86128     0.09971    78.84   < 2e-16 ***
   ###
   ### Median of bootstrap estimates and percentile confidence intervals
   ###        Median        2.5%       97.5%
   ### a   31.844684  31.6439560  32.0483756
   ### b    0.545735   0.4818207   0.6057807
   ### clx  7.850955   7.7046871   8.0511236


text:
Q: SQL Optimization to Rotate Table  I need to rotate my table , so I need to make a columns if some field (ID) got some value
I made a custom query :
    SELECT
(DT.[Date]) As RecTime ,
(CASE WHEN DT.ID=51 THEN DT.Value END) AS FlowBSU421,
(CASE WHEN DT.ID=77 THEN DT.Value END) AS TimeAuditBSU331,
(CASE WHEN DT.ID=103 THEN DT.Value END) AS NewValBSU311,
(CASE WHEN DT.ID=129 THEN DT.Value END) AS OldValBSU411,
(CASE WHEN DT.ID=155 THEN DT.Value END) AS CodeAlarmBSU311,
(CASE WHEN DT.ID=181 THEN DT.Value END) AS DataAlarmBSU341,
(CASE WHEN DT.ID=207 THEN DT.Value END) AS DataAlarmBSU441,
(CASE WHEN DT.ID=233 THEN DT.Value END) AS AnalizComp1C6plus_vol,
(CASE WHEN DT.ID=259 THEN DT.Value END) AS AnalizComp2C6plus_mol,
(CASE WHEN DT.ID=285 THEN DT.Value END) AS AnalizComp2Abs_ro,
(CASE WHEN DT.ID=311 THEN DT.Value END) AS Inj_Gas2,
(CASE WHEN DT.ID=312 THEN DT.Value END) AS Inj_mainPower,
(CASE WHEN DT.ID=313 THEN DT.Value END) AS Inj_supPower,
(CASE WHEN DT.ID=314 THEN DT.Value END) AS Inj_PowerSFmain,
(CASE WHEN DT.ID=315 THEN DT.Value END) AS Inj_PowerSFres,
(CASE WHEN DT.ID=316 THEN DT.Value END) AS Inj_PowerCPUmain,
(CASE WHEN DT.ID=317 THEN DT.Value END) AS Inj_PowerCPUres,
(CASE WHEN DT.ID=318 THEN DT.Value END) AS Inj_PowerAnalitikMain,
(CASE WHEN DT.ID=319 THEN DT.Value END) AS Inj_PowerAnalitikRes,
(CASE WHEN DT.ID=320 THEN DT.Value END) AS Inj_PowerDIOmain,
(CASE WHEN DT.ID=321 THEN DT.Value END) AS Inj_PowerDIOres,
(CASE WHEN DT.ID=322 THEN DT.Value END) AS Inj_PowerKong,
(CASE WHEN DT.ID=323 THEN DT.Value END) AS Warning,
(CASE WHEN DT.ID=324 THEN DT.Value END) AS Alarm,
(CASE WHEN DT.ID=286 THEN DT.Value END) AS AnalizComp2Rel_ro,
(CASE WHEN DT.ID=287 THEN DT.Value END) AS AnalizComp2Vobbe_Lo,
(CASE WHEN DT.ID=288 THEN DT.Value END) AS AnalizComp2Vobbe_Hi,
(CASE WHEN DT.ID=289 THEN DT.Value END) AS AnalizComp2An_Num,
(CASE WHEN DT.ID=290 THEN DT.Value END) AS AnalizComp2Status,
(CASE WHEN DT.ID=291 THEN DT.Value END) AS AnalizSeraAnDTS,
(CASE WHEN DT.ID=292 THEN DT.Value END) AS AnalizSeraC2H5SH,
(CASE WHEN DT.ID=293 THEN DT.Value END) AS AnalizSeraCH3SH,
(CASE WHEN DT.ID=294 THEN DT.Value END) AS AnalizSeraH2S,
(CASE WHEN DT.ID=295 THEN DT.Value END) AS AnalizSeraSummMerS,
(CASE WHEN DT.ID=296 THEN DT.Value END) AS AnalizSeraSummAllS,
(CASE WHEN DT.ID=297 THEN DT.Value END) AS AnalizSeraAnNum,
(CASE WHEN DT.ID=298 THEN DT.Value END) AS AnalizSeraStatus,
(CASE WHEN DT.ID=299 THEN DT.Value END) AS KongPrimaDP,
(CASE WHEN DT.ID=300 THEN DT.Value END) AS KongPrimaDPCH,
(CASE WHEN DT.ID=301 THEN DT.Value END) AS P,
(CASE WHEN DT.ID=302 THEN DT.Value END) AS T,
(CASE WHEN DT.ID=303 THEN DT.Value END) AS Warn_Fire,
(CASE WHEN DT.ID=304 THEN DT.Value END) AS Fire,
(CASE WHEN DT.ID=305 THEN DT.Value END) AS Inj_Fire,
(CASE WHEN DT.ID=306 THEN DT.Value END) AS Gas11,
(CASE WHEN DT.ID=307 THEN DT.Value END) AS Gas21,
(CASE WHEN DT.ID=308 THEN DT.Value END) AS Inj_Gas1,
(CASE WHEN DT.ID=309 THEN DT.Value END) AS Gas12,
(CASE WHEN DT.ID=310 THEN DT.Value END) AS Gas22,
(CASE WHEN DT.ID=325 THEN DT.Value END) AS Inj_Fan,
(CASE WHEN DT.ID=401 THEN DT.Value END) AS FlowBSU351_F,
(CASE WHEN DT.ID=402 THEN DT.Value END) AS FlowBSU352_F,
(CASE WHEN DT.ID=403 THEN DT.Value END) AS PBSU311_F,
(CASE WHEN DT.ID=404 THEN DT.Value END) AS PBSU312_F,
(CASE WHEN DT.ID=405 THEN DT.Value END) AS PBSU321_F,
(CASE WHEN DT.ID=406 THEN DT.Value END) AS PBSU322_F,
(CASE WHEN DT.ID=407 THEN DT.Value END) AS PBSU331_F,
(CASE WHEN DT.ID=408 THEN DT.Value END) AS PBSU332_F,
(CASE WHEN DT.ID=409 THEN DT.Value END) AS PBSU341_F,
(CASE WHEN DT.ID=410 THEN DT.Value END) AS PBSU342_F,
(CASE WHEN DT.ID=411 THEN DT.Value END) AS PBSU351_F,
(CASE WHEN DT.ID=412 THEN DT.Value END) AS PBSU352_F,
(CASE WHEN DT.ID=413 THEN DT.Value END) AS TBSU311_F,
(CASE WHEN DT.ID=414 THEN DT.Value END) AS TBSU312_F,
(CASE WHEN DT.ID=415 THEN DT.Value END) AS TBSU321_F,
(CASE WHEN DT.ID=416 THEN DT.Value END) AS TBSU322_F,
(CASE WHEN DT.ID=417 THEN DT.Value END) AS TBSU331_F,
(CASE WHEN DT.ID=418 THEN DT.Value END) AS TBSU332_F,
(CASE WHEN DT.ID=419 THEN DT.Value END) AS TBSU341_F,
(CASE WHEN DT.ID=420 THEN DT.Value END) AS TBSU342_F,
(CASE WHEN DT.ID=421 THEN DT.Value END) AS TBSU351_F,
(CASE WHEN DT.ID=422 THEN DT.Value END) AS TBSU352_F,
(CASE WHEN DT.ID=423 THEN DT.Value END) AS DPBSU411_F,
(CASE WHEN DT.ID=424 THEN DT.Value END) AS DPBSU412_F,
(CASE WHEN DT.ID=425 THEN DT.Value END) AS DPBSU421_F,
(CASE WHEN DT.ID=326 THEN DT.Value END) AS Low_temp,
(CASE WHEN DT.ID=327 THEN DT.Value END) AS IsBSU311_RUN,
(CASE WHEN DT.ID=328 THEN DT.Value END) AS IsBSU312_RUN,
(CASE WHEN DT.ID=329 THEN DT.Value END) AS IsBSU321_RUN,
(CASE WHEN DT.ID=330 THEN DT.Value END) AS IsBSU322_RUN,
(CASE WHEN DT.ID=331 THEN DT.Value END) AS IsBSU331_RUN,
(CASE WHEN DT.ID=332 THEN DT.Value END) AS IsBSU332_RUN,
(CASE WHEN DT.ID=333 THEN DT.Value END) AS IsBSU341_RUN,
(CASE WHEN DT.ID=334 THEN DT.Value END) AS IsBSU342_RUN,
(CASE WHEN DT.ID=335 THEN DT.Value END) AS IsBSU351_RUN,
(CASE WHEN DT.ID=336 THEN DT.Value END) AS IsBSU352_RUN,
(CASE WHEN DT.ID=337 THEN DT.Value END) AS IsBSU411_RUN,
(CASE WHEN DT.ID=338 THEN DT.Value END) AS IsBSU412_RUN,
(CASE WHEN DT.ID=339 THEN DT.Value END) AS IsBSU421_RUN,
(CASE WHEN DT.ID=340 THEN DT.Value END) AS IsBSU422_RUN,
(CASE WHEN DT.ID=341 THEN DT.Value END) AS IsBSU431_RUN,
(CASE WHEN DT.ID=342 THEN DT.Value END) AS IsBSU432_RUN,
(CASE WHEN DT.ID=343 THEN DT.Value END) AS IsBSU441_RUN,
(CASE WHEN DT.ID=344 THEN DT.Value END) AS IsBSU442_RUN,
(CASE WHEN DT.ID=345 THEN DT.Value END) AS IsKongPrimaOn,
(CASE WHEN DT.ID=346 THEN DT.Value END) AS SauGISLinkQuality,
(CASE WHEN DT.ID=347 THEN DT.Value END) AS K42OPEN,
(CASE WHEN DT.ID=348 THEN DT.Value END) AS K42CLOSE,
(CASE WHEN DT.ID=349 THEN DT.Value END) AS K44OPEN,
(CASE WHEN DT.ID=350 THEN DT.Value END) AS K44CLOSE,
(CASE WHEN DT.ID=351 THEN DT.Value END) AS K46OPEN,
(CASE WHEN DT.ID=352 THEN DT.Value END) AS K46CLOSE,
(CASE WHEN DT.ID=353 THEN DT.Value END) AS K424OPEN,
(CASE WHEN DT.ID=354 THEN DT.Value END) AS K424CLOSE,
(CASE WHEN DT.ID=355 THEN DT.Value END) AS K420OPEN,
(CASE WHEN DT.ID=356 THEN DT.Value END) AS K420CLOSE,
(CASE WHEN DT.ID=357 THEN DT.Value END) AS K13OPEN,
(CASE WHEN DT.ID=358 THEN DT.Value END) AS K13CLOSE,
(CASE WHEN DT.ID=359 THEN DT.Value END) AS K33OPEN,
(CASE WHEN DT.ID=360 THEN DT.Value END) AS K33CLOSE,
(CASE WHEN DT.ID=361 THEN DT.Value END) AS K34OPEN,
(CASE WHEN DT.ID=362 THEN DT.Value END) AS K34CLOSE,
(CASE WHEN DT.ID=363 THEN DT.Value END) AS K36OPEN,
(CASE WHEN DT.ID=364 THEN DT.Value END) AS K36CLOSE,
(CASE WHEN DT.ID=365 THEN DT.Value END) AS K38OPEN,
(CASE WHEN DT.ID=366 THEN DT.Value END) AS K38CLOSE,
(CASE WHEN DT.ID=367 THEN DT.Value END) AS K330OPEN,
(CASE WHEN DT.ID=368 THEN DT.Value END) AS K330CLOSE,
(CASE WHEN DT.ID=369 THEN DT.Value END) AS K326OPEN,
(CASE WHEN DT.ID=370 THEN DT.Value END) AS K326CLOSE,
(CASE WHEN DT.ID=371 THEN DT.Value END) AS K42FAULT,
(CASE WHEN DT.ID=372 THEN DT.Value END) AS K44FAULT,
(CASE WHEN DT.ID=373 THEN DT.Value END) AS K46FAULT,
(CASE WHEN DT.ID=374 THEN DT.Value END) AS K424FAULT,
(CASE WHEN DT.ID=375 THEN DT.Value END) AS K420FAULT,
(CASE WHEN DT.ID=426 THEN DT.Value END) AS DPBSU422_F,
(CASE WHEN DT.ID=427 THEN DT.Value END) AS DPBSU431_F,
(CASE WHEN DT.ID=428 THEN DT.Value END) AS DPBSU432_F,
(CASE WHEN DT.ID=429 THEN DT.Value END) AS DPBSU441_F,
(CASE WHEN DT.ID=430 THEN DT.Value END) AS DPBSU442_F,
(CASE WHEN DT.ID=431 THEN DT.Value END) AS FlowBSU411_F,
(CASE WHEN DT.ID=432 THEN DT.Value END) AS FlowBSU412_F,
(CASE WHEN DT.ID=433 THEN DT.Value END) AS FlowBSU421_F,
(CASE WHEN DT.ID=434 THEN DT.Value END) AS FlowBSU422_F,
(CASE WHEN DT.ID=435 THEN DT.Value END) AS FlowBSU431_F,
(CASE WHEN DT.ID=436 THEN DT.Value END) AS FlowBSU432_F,
(CASE WHEN DT.ID=437 THEN DT.Value END) AS FlowBSU441_F,
(CASE WHEN DT.ID=438 THEN DT.Value END) AS FlowBSU442_F,
(CASE WHEN DT.ID=439 THEN DT.Value END) AS PBSU411_F,
(CASE WHEN DT.ID=440 THEN DT.Value END) AS PBSU412_F,
(CASE WHEN DT.ID=441 THEN DT.Value END) AS PBSU421_F,
(CASE WHEN DT.ID=442 THEN DT.Value END) AS PBSU422_F,
(CASE WHEN DT.ID=443 THEN DT.Value END) AS PBSU431_F,
(CASE WHEN DT.ID=444 THEN DT.Value END) AS PBSU432_F,
(CASE WHEN DT.ID=445 THEN DT.Value END) AS PBSU441_F,
(CASE WHEN DT.ID=446 THEN DT.Value END) AS PBSU442_F,
(CASE WHEN DT.ID=447 THEN DT.Value END) AS TBSU411_F,
(CASE WHEN DT.ID=448 THEN DT.Value END) AS TBSU412_F,
(CASE WHEN DT.ID=449 THEN DT.Value END) AS TBSU421_F,
(CASE WHEN DT.ID=450 THEN DT.Value END) AS TBSU422_F,
(CASE WHEN DT.ID=451 THEN DT.Value END) AS TBSU431_F,
(CASE WHEN DT.ID=452 THEN DT.Value END) AS TBSU432_F,
(CASE WHEN DT.ID=453 THEN DT.Value END) AS TBSU441_F,
(CASE WHEN DT.ID=454 THEN DT.Value END) AS TBSU442_F,
(CASE WHEN DT.ID=455 THEN DT.Value END) AS CAM1,
(CASE WHEN DT.ID=456 THEN DT.Value END) AS CAM2,
(CASE WHEN DT.ID=457 THEN DT.Value END) AS CAM3,
(CASE WHEN DT.ID=458 THEN DT.Value END) AS CAM4,
(CASE WHEN DT.ID=459 THEN DT.Value END) AS CAM5,
(CASE WHEN DT.ID=460 THEN DT.Value END) AS CurUser,
(CASE WHEN DT.ID=461 THEN DT.Value END) AS HART311_FAULT,
(CASE WHEN DT.ID=462 THEN DT.Value END) AS HART312_FAULT,
(CASE WHEN DT.ID=463 THEN DT.Value END) AS HART321_FAULT,
(CASE WHEN DT.ID=464 THEN DT.Value END) AS HART322_FAULT,
(CASE WHEN DT.ID=465 THEN DT.Value END) AS HART331_FAULT,
(CASE WHEN DT.ID=466 THEN DT.Value END) AS HART332_FAULT,
(CASE WHEN DT.ID=467 THEN DT.Value END) AS HART341_FAULT,
(CASE WHEN DT.ID=468 THEN DT.Value END) AS HART342_FAULT,
(CASE WHEN DT.ID=469 THEN DT.Value END) AS HART351_FAULT,
(CASE WHEN DT.ID=470 THEN DT.Value END) AS HART352_FAULT,
(CASE WHEN DT.ID=471 THEN DT.Value END) AS HART411_FAULT,
(CASE WHEN DT.ID=472 THEN DT.Value END) AS HART412_FAULT,
(CASE WHEN DT.ID=473 THEN DT.Value END) AS HART421_FAULT,
(CASE WHEN DT.ID=474 THEN DT.Value END) AS HART422_FAULT,
(CASE WHEN DT.ID=475 THEN DT.Value END) AS HART431_FAULT,
(CASE WHEN DT.ID=376 THEN DT.Value END) AS K13FAULT,
(CASE WHEN DT.ID=377 THEN DT.Value END) AS K33FAULT,
(CASE WHEN DT.ID=378 THEN DT.Value END) AS K34FAULT,
(CASE WHEN DT.ID=379 THEN DT.Value END) AS K36FAULT,
(CASE WHEN DT.ID=380 THEN DT.Value END) AS K38FAULT,
(CASE WHEN DT.ID=381 THEN DT.Value END) AS K330FAULT,
(CASE WHEN DT.ID=382 THEN DT.Value END) AS K326FAULT,
(CASE WHEN DT.ID=383 THEN DT.Value END) AS DPBSU311_F,
(CASE WHEN DT.ID=384 THEN DT.Value END) AS DPBSU312_F,
(CASE WHEN DT.ID=385 THEN DT.Value END) AS DPBSU321_F,
(CASE WHEN DT.ID=386 THEN DT.Value END) AS DPBSU322_F,
(CASE WHEN DT.ID=387 THEN DT.Value END) AS DPBSU331_F,
(CASE WHEN DT.ID=388 THEN DT.Value END) AS DPBSU332_F,
(CASE WHEN DT.ID=389 THEN DT.Value END) AS DPBSU341_F,
(CASE WHEN DT.ID=390 THEN DT.Value END) AS DPBSU342_F,
(CASE WHEN DT.ID=391 THEN DT.Value END) AS DPBSU351_F,
(CASE WHEN DT.ID=392 THEN DT.Value END) AS DPBSU352_F,
(CASE WHEN DT.ID=393 THEN DT.Value END) AS FlowBSU311_F,
(CASE WHEN DT.ID=394 THEN DT.Value END) AS FlowBSU312_F,
(CASE WHEN DT.ID=395 THEN DT.Value END) AS FlowBSU321_F,
(CASE WHEN DT.ID=396 THEN DT.Value END) AS FlowBSU322_F,
(CASE WHEN DT.ID=397 THEN DT.Value END) AS FlowBSU331_F,
(CASE WHEN DT.ID=398 THEN DT.Value END) AS FlowBSU332_F,
(CASE WHEN DT.ID=399 THEN DT.Value END) AS FlowBSU341_F,
(CASE WHEN DT.ID=400 THEN DT.Value END) AS FlowBSU342_F,
(CASE WHEN DT.ID=476 THEN DT.Value END) AS HART432_FAULT,
(CASE WHEN DT.ID=477 THEN DT.Value END) AS HART441_FAULT,
(CASE WHEN DT.ID=478 THEN DT.Value END) AS HART442_FAULT,
(CASE WHEN DT.ID=26 THEN DT.Value END) AS PBSU332,
(CASE WHEN DT.ID=27 THEN DT.Value END) AS PBSU341,
(CASE WHEN DT.ID=28 THEN DT.Value END) AS PBSU342,
(CASE WHEN DT.ID=29 THEN DT.Value END) AS PBSU351,
(CASE WHEN DT.ID=30 THEN DT.Value END) AS PBSU352,
(CASE WHEN DT.ID=31 THEN DT.Value END) AS TBSU311,
(CASE WHEN DT.ID=32 THEN DT.Value END) AS TBSU312,
(CASE WHEN DT.ID=33 THEN DT.Value END) AS TBSU321,
(CASE WHEN DT.ID=34 THEN DT.Value END) AS TBSU322,
(CASE WHEN DT.ID=35 THEN DT.Value END) AS TBSU331,
(CASE WHEN DT.ID=36 THEN DT.Value END) AS TBSU332,
(CASE WHEN DT.ID=37 THEN DT.Value END) AS TBSU341,
(CASE WHEN DT.ID=38 THEN DT.Value END) AS TBSU342,
(CASE WHEN DT.ID=39 THEN DT.Value END) AS TBSU351,
(CASE WHEN DT.ID=40 THEN DT.Value END) AS TBSU352,
(CASE WHEN DT.ID=41 THEN DT.Value END) AS DPBSU411,
(CASE WHEN DT.ID=42 THEN DT.Value END) AS DPBSU412,
(CASE WHEN DT.ID=43 THEN DT.Value END) AS DPBSU421,
(CASE WHEN DT.ID=44 THEN DT.Value END) AS DPBSU422,
(CASE WHEN DT.ID=45 THEN DT.Value END) AS DPBSU431,
(CASE WHEN DT.ID=46 THEN DT.Value END) AS DPBSU432,
(CASE WHEN DT.ID=47 THEN DT.Value END) AS DPBSU441,
(CASE WHEN DT.ID=48 THEN DT.Value END) AS DPBSU442,
(CASE WHEN DT.ID=49 THEN DT.Value END) AS FlowBSU411,
(CASE WHEN DT.ID=50 THEN DT.Value END) AS FlowBSU412,
(CASE WHEN DT.ID=52 THEN DT.Value END) AS FlowBSU422,
(CASE WHEN DT.ID=53 THEN DT.Value END) AS FlowBSU431,
(CASE WHEN DT.ID=54 THEN DT.Value END) AS FlowBSU432,
(CASE WHEN DT.ID=55 THEN DT.Value END) AS FlowBSU441,
(CASE WHEN DT.ID=56 THEN DT.Value END) AS FlowBSU442,
(CASE WHEN DT.ID=57 THEN DT.Value END) AS PBSU411,
(CASE WHEN DT.ID=58 THEN DT.Value END) AS PBSU412,
(CASE WHEN DT.ID=59 THEN DT.Value END) AS PBSU421,
(CASE WHEN DT.ID=60 THEN DT.Value END) AS PBSU422,
(CASE WHEN DT.ID=61 THEN DT.Value END) AS PBSU431,
(CASE WHEN DT.ID=62 THEN DT.Value END) AS PBSU432,
(CASE WHEN DT.ID=63 THEN DT.Value END) AS PBSU441,
(CASE WHEN DT.ID=64 THEN DT.Value END) AS PBSU442,
(CASE WHEN DT.ID=65 THEN DT.Value END) AS TBSU411,
(CASE WHEN DT.ID=66 THEN DT.Value END) AS TBSU412,
(CASE WHEN DT.ID=67 THEN DT.Value END) AS TBSU421,
(CASE WHEN DT.ID=68 THEN DT.Value END) AS TBSU422,
(CASE WHEN DT.ID=69 THEN DT.Value END) AS TBSU431,
(CASE WHEN DT.ID=70 THEN DT.Value END) AS TBSU432,
(CASE WHEN DT.ID=71 THEN DT.Value END) AS TBSU441,
(CASE WHEN DT.ID=72 THEN DT.Value END) AS TBSU442,
(CASE WHEN DT.ID=73 THEN DT.Value END) AS TimeAuditBSU311,
(CASE WHEN DT.ID=74 THEN DT.Value END) AS TimeAuditBSU312,
(CASE WHEN DT.ID=75 THEN DT.Value END) AS TimeAuditBSU321,
(CASE WHEN DT.ID=76 THEN DT.Value END) AS TimeAuditBSU322,
(CASE WHEN DT.ID=78 THEN DT.Value END) AS TimeAuditBSU332,
(CASE WHEN DT.ID=79 THEN DT.Value END) AS TimeAuditBSU341,
(CASE WHEN DT.ID=80 THEN DT.Value END) AS TimeAuditBSU342,
(CASE WHEN DT.ID=81 THEN DT.Value END) AS TimeAuditBSU351,
(CASE WHEN DT.ID=82 THEN DT.Value END) AS TimeAuditBSU352,
(CASE WHEN DT.ID=83 THEN DT.Value END) AS ParAuditBSU311,
(CASE WHEN DT.ID=84 THEN DT.Value END) AS ParAuditBSU312,
(CASE WHEN DT.ID=85 THEN DT.Value END) AS ParAuditBSU321,
(CASE WHEN DT.ID=86 THEN DT.Value END) AS ParAuditBSU322,
(CASE WHEN DT.ID=87 THEN DT.Value END) AS ParAuditBSU331,
(CASE WHEN DT.ID=88 THEN DT.Value END) AS ParAuditBSU332,
(CASE WHEN DT.ID=89 THEN DT.Value END) AS ParAuditBSU341,
(CASE WHEN DT.ID=90 THEN DT.Value END) AS ParAuditBSU342,
(CASE WHEN DT.ID=91 THEN DT.Value END) AS ParAuditBSU351,
(CASE WHEN DT.ID=92 THEN DT.Value END) AS ParAuditBSU352,
(CASE WHEN DT.ID=93 THEN DT.Value END) AS OldValBSU311,
(CASE WHEN DT.ID=94 THEN DT.Value END) AS OldValBSU312,
(CASE WHEN DT.ID=95 THEN DT.Value END) AS OldValBSU321,
(CASE WHEN DT.ID=96 THEN DT.Value END) AS OldValBSU322,
(CASE WHEN DT.ID=97 THEN DT.Value END) AS OldValBSU331,
(CASE WHEN DT.ID=98 THEN DT.Value END) AS OldValBSU332,
(CASE WHEN DT.ID=99 THEN DT.Value END) AS OldValBSU341,
(CASE WHEN DT.ID=100 THEN DT.Value END) AS OldValBSU342,
(CASE WHEN DT.ID=101 THEN DT.Value END) AS OldValBSU351,
(CASE WHEN DT.ID=102 THEN DT.Value END) AS OldValBSU352,
(CASE WHEN DT.ID=2 THEN DT.Value END) AS DPBSU312,
(CASE WHEN DT.ID=3 THEN DT.Value END) AS DPBSU321,
(CASE WHEN DT.ID=4 THEN DT.Value END) AS DPBSU322,
(CASE WHEN DT.ID=5 THEN DT.Value END) AS DPBSU331,
(CASE WHEN DT.ID=6 THEN DT.Value END) AS DPBSU332,
(CASE WHEN DT.ID=7 THEN DT.Value END) AS DPBSU341,
(CASE WHEN DT.ID=8 THEN DT.Value END) AS DPBSU342,
(CASE WHEN DT.ID=9 THEN DT.Value END) AS DPBSU351,
(CASE WHEN DT.ID=10 THEN DT.Value END) AS DPBSU352,
(CASE WHEN DT.ID=11 THEN DT.Value END) AS FlowBSU311,
(CASE WHEN DT.ID=12 THEN DT.Value END) AS FlowBSU312,
(CASE WHEN DT.ID=13 THEN DT.Value END) AS FlowBSU321,
(CASE WHEN DT.ID=14 THEN DT.Value END) AS FlowBSU322,
(CASE WHEN DT.ID=15 THEN DT.Value END) AS FlowBSU331,
(CASE WHEN DT.ID=16 THEN DT.Value END) AS FlowBSU332,
(CASE WHEN DT.ID=17 THEN DT.Value END) AS FlowBSU341,
(CASE WHEN DT.ID=18 THEN DT.Value END) AS FlowBSU342,
(CASE WHEN DT.ID=19 THEN DT.Value END) AS FlowBSU351,
(CASE WHEN DT.ID=20 THEN DT.Value END) AS FlowBSU352,
(CASE WHEN DT.ID=21 THEN DT.Value END) AS PBSU311,
(CASE WHEN DT.ID=22 THEN DT.Value END) AS PBSU312,
(CASE WHEN DT.ID=23 THEN DT.Value END) AS PBSU321,
(CASE WHEN DT.ID=24 THEN DT.Value END) AS PBSU322,
(CASE WHEN DT.ID=104 THEN DT.Value END) AS NewValBSU312,
(CASE WHEN DT.ID=105 THEN DT.Value END) AS NewValBSU321,
(CASE WHEN DT.ID=106 THEN DT.Value END) AS NewValBSU322,
(CASE WHEN DT.ID=107 THEN DT.Value END) AS NewValBSU331,
(CASE WHEN DT.ID=108 THEN DT.Value END) AS NewValBSU332,
(CASE WHEN DT.ID=109 THEN DT.Value END) AS NewValBSU341,
(CASE WHEN DT.ID=110 THEN DT.Value END) AS NewValBSU342,
(CASE WHEN DT.ID=111 THEN DT.Value END) AS NewValBSU351,
(CASE WHEN DT.ID=112 THEN DT.Value END) AS NewValBSU352,
(CASE WHEN DT.ID=113 THEN DT.Value END) AS TimeAuditBSU411,
(CASE WHEN DT.ID=114 THEN DT.Value END) AS TimeAuditBSU412,
(CASE WHEN DT.ID=115 THEN DT.Value END) AS TimeAuditBSU421,
(CASE WHEN DT.ID=116 THEN DT.Value END) AS TimeAuditBSU422,
(CASE WHEN DT.ID=117 THEN DT.Value END) AS TimeAuditBSU431,
(CASE WHEN DT.ID=118 THEN DT.Value END) AS TimeAuditBSU432,
(CASE WHEN DT.ID=119 THEN DT.Value END) AS TimeAuditBSU441,
(CASE WHEN DT.ID=120 THEN DT.Value END) AS TimeAuditBSU442,
(CASE WHEN DT.ID=121 THEN DT.Value END) AS ParAuditBSU411,
(CASE WHEN DT.ID=122 THEN DT.Value END) AS ParAuditBSU412,
(CASE WHEN DT.ID=123 THEN DT.Value END) AS ParAuditBSU421,
(CASE WHEN DT.ID=124 THEN DT.Value END) AS ParAuditBSU422,
(CASE WHEN DT.ID=125 THEN DT.Value END) AS ParAuditBSU431,
(CASE WHEN DT.ID=126 THEN DT.Value END) AS ParAuditBSU432,
(CASE WHEN DT.ID=127 THEN DT.Value END) AS ParAuditBSU441,
(CASE WHEN DT.ID=128 THEN DT.Value END) AS ParAuditBSU442,
(CASE WHEN DT.ID=130 THEN DT.Value END) AS OldValBSU412,
(CASE WHEN DT.ID=131 THEN DT.Value END) AS OldValBSU421,
(CASE WHEN DT.ID=132 THEN DT.Value END) AS OldValBSU422,
(CASE WHEN DT.ID=133 THEN DT.Value END) AS OldValBSU431,
(CASE WHEN DT.ID=134 THEN DT.Value END) AS OldValBSU432,
(CASE WHEN DT.ID=135 THEN DT.Value END) AS OldValBSU441,
(CASE WHEN DT.ID=136 THEN DT.Value END) AS OldValBSU442,
(CASE WHEN DT.ID=137 THEN DT.Value END) AS NewValBSU411,
(CASE WHEN DT.ID=138 THEN DT.Value END) AS NewValBSU412,
(CASE WHEN DT.ID=139 THEN DT.Value END) AS NewValBSU421,
(CASE WHEN DT.ID=140 THEN DT.Value END) AS NewValBSU422,
(CASE WHEN DT.ID=141 THEN DT.Value END) AS NewValBSU431,
(CASE WHEN DT.ID=142 THEN DT.Value END) AS NewValBSU432,
(CASE WHEN DT.ID=143 THEN DT.Value END) AS NewValBSU441,
(CASE WHEN DT.ID=144 THEN DT.Value END) AS NewValBSU442,
(CASE WHEN DT.ID=145 THEN DT.Value END) AS TimeAlarmBSU311,
(CASE WHEN DT.ID=146 THEN DT.Value END) AS TimeAlarmBSU312,
(CASE WHEN DT.ID=147 THEN DT.Value END) AS TimeAlarmBSU321,
(CASE WHEN DT.ID=148 THEN DT.Value END) AS TimeAlarmBSU322,
(CASE WHEN DT.ID=149 THEN DT.Value END) AS TimeAlarmBSU331,
(CASE WHEN DT.ID=150 THEN DT.Value END) AS TimeAlarmBSU332,
(CASE WHEN DT.ID=151 THEN DT.Value END) AS TimeAlarmBSU341,
(CASE WHEN DT.ID=152 THEN DT.Value END) AS TimeAlarmBSU342,
(CASE WHEN DT.ID=153 THEN DT.Value END) AS TimeAlarmBSU351,
(CASE WHEN DT.ID=154 THEN DT.Value END) AS TimeAlarmBSU352,
(CASE WHEN DT.ID=156 THEN DT.Value END) AS CodeAlarmBSU312,
(CASE WHEN DT.ID=157 THEN DT.Value END) AS CodeAlarmBSU321,
(CASE WHEN DT.ID=158 THEN DT.Value END) AS CodeAlarmBSU322,
(CASE WHEN DT.ID=159 THEN DT.Value END) AS CodeAlarmBSU331,
(CASE WHEN DT.ID=160 THEN DT.Value END) AS CodeAlarmBSU332,
(CASE WHEN DT.ID=161 THEN DT.Value END) AS CodeAlarmBSU341,
(CASE WHEN DT.ID=162 THEN DT.Value END) AS CodeAlarmBSU342,
(CASE WHEN DT.ID=163 THEN DT.Value END) AS CodeAlarmBSU351,
(CASE WHEN DT.ID=164 THEN DT.Value END) AS CodeAlarmBSU352,
(CASE WHEN DT.ID=165 THEN DT.Value END) AS PointAlarmBSU311,
(CASE WHEN DT.ID=166 THEN DT.Value END) AS PointAlarmBSU312,
(CASE WHEN DT.ID=167 THEN DT.Value END) AS PointAlarmBSU321,
(CASE WHEN DT.ID=168 THEN DT.Value END) AS PointAlarmBSU322,
(CASE WHEN DT.ID=169 THEN DT.Value END) AS PointAlarmBSU331,
(CASE WHEN DT.ID=170 THEN DT.Value END) AS PointAlarmBSU332,
(CASE WHEN DT.ID=171 THEN DT.Value END) AS PointAlarmBSU341,
(CASE WHEN DT.ID=172 THEN DT.Value END) AS PointAlarmBSU342,
(CASE WHEN DT.ID=173 THEN DT.Value END) AS PointAlarmBSU351,
(CASE WHEN DT.ID=174 THEN DT.Value END) AS PointAlarmBSU352,
(CASE WHEN DT.ID=175 THEN DT.Value END) AS DataAlarmBSU311,
(CASE WHEN DT.ID=176 THEN DT.Value END) AS DataAlarmBSU312,
(CASE WHEN DT.ID=177 THEN DT.Value END) AS DataAlarmBSU321,
(CASE WHEN DT.ID=178 THEN DT.Value END) AS DataAlarmBSU322,
(CASE WHEN DT.ID=179 THEN DT.Value END) AS DataAlarmBSU331,
(CASE WHEN DT.ID=180 THEN DT.Value END) AS DataAlarmBSU332,
(CASE WHEN DT.ID=182 THEN DT.Value END) AS DataAlarmBSU342,
(CASE WHEN DT.ID=183 THEN DT.Value END) AS DataAlarmBSU351,
(CASE WHEN DT.ID=184 THEN DT.Value END) AS DataAlarmBSU352,
(CASE WHEN DT.ID=185 THEN DT.Value END) AS CodeAlarmBSU411,
(CASE WHEN DT.ID=186 THEN DT.Value END) AS CodeAlarmBSU412,
(CASE WHEN DT.ID=187 THEN DT.Value END) AS CodeAlarmBSU421,
(CASE WHEN DT.ID=188 THEN DT.Value END) AS CodeAlarmBSU422,
(CASE WHEN DT.ID=189 THEN DT.Value END) AS CodeAlarmBSU423,
(CASE WHEN DT.ID=190 THEN DT.Value END) AS CodeAlarmBSU424,
(CASE WHEN DT.ID=191 THEN DT.Value END) AS CodeAlarmBSU441,
(CASE WHEN DT.ID=192 THEN DT.Value END) AS CodeAlarmBSU442,
(CASE WHEN DT.ID=193 THEN DT.Value END) AS PointAlarmBSU411,
(CASE WHEN DT.ID=194 THEN DT.Value END) AS PointAlarmBSU412,
(CASE WHEN DT.ID=195 THEN DT.Value END) AS PointAlarmBSU421,
(CASE WHEN DT.ID=196 THEN DT.Value END) AS PointAlarmBSU422,
(CASE WHEN DT.ID=197 THEN DT.Value END) AS PointAlarmBSU431,
(CASE WHEN DT.ID=198 THEN DT.Value END) AS PointAlarmBSU432,
(CASE WHEN DT.ID=199 THEN DT.Value END) AS PointAlarmBSU441,
(CASE WHEN DT.ID=200 THEN DT.Value END) AS PointAlarmBSU442,
(CASE WHEN DT.ID=201 THEN DT.Value END) AS DataAlarmBSU411,
(CASE WHEN DT.ID=202 THEN DT.Value END) AS DataAlarmBSU412,
(CASE WHEN DT.ID=203 THEN DT.Value END) AS DataAlarmBSU421,
(CASE WHEN DT.ID=204 THEN DT.Value END) AS DataAlarmBSU422,
(CASE WHEN DT.ID=205 THEN DT.Value END) AS DataAlarmBSU431,
(CASE WHEN DT.ID=206 THEN DT.Value END) AS DataAlarmBSU432,
(CASE WHEN DT.ID=208 THEN DT.Value END) AS DataAlarmBSU442,
(CASE WHEN DT.ID=209 THEN DT.Value END) AS AnalizComp1An_DT1,
(CASE WHEN DT.ID=210 THEN DT.Value END) AS AnalizComp1CH4_mol,
(CASE WHEN DT.ID=211 THEN DT.Value END) AS AnalizComp1C2H6_mol,
(CASE WHEN DT.ID=212 THEN DT.Value END) AS AnalizComp1C3H8_mol,
(CASE WHEN DT.ID=213 THEN DT.Value END) AS AnalizComp1iC4H10_mol,
(CASE WHEN DT.ID=214 THEN DT.Value END) AS AnalizComp1nC4H10_mol,
(CASE WHEN DT.ID=215 THEN DT.Value END) AS AnalizComp1neoC5H12_mol,
(CASE WHEN DT.ID=216 THEN DT.Value END) AS AnalizComp1iC5H12_mol,
(CASE WHEN DT.ID=217 THEN DT.Value END) AS AnalizComp1nC5H12_mol,
(CASE WHEN DT.ID=218 THEN DT.Value END) AS AnalizComp1C6plus_mol,
(CASE WHEN DT.ID=219 THEN DT.Value END) AS AnalizComp1N2_mol,
(CASE WHEN DT.ID=220 THEN DT.Value END) AS AnalizComp1O2_mol,
(CASE WHEN DT.ID=221 THEN DT.Value END) AS AnalizComp1CO2_mol,
(CASE WHEN DT.ID=222 THEN DT.Value END) AS AnalizComp1He_mol,
(CASE WHEN DT.ID=223 THEN DT.Value END) AS AnalizComp1H_mol,
(CASE WHEN DT.ID=224 THEN DT.Value END) AS AnalizComp1H2O_mol,
(CASE WHEN DT.ID=225 THEN DT.Value END) AS AnalizComp1CH4_vol,
(CASE WHEN DT.ID=226 THEN DT.Value END) AS AnalizComp1C2H6_vol,
(CASE WHEN DT.ID=227 THEN DT.Value END) AS AnalizComp1C3H8_vol,
(CASE WHEN DT.ID=228 THEN DT.Value END) AS AnalizComp1iC4H10_vol,
(CASE WHEN DT.ID=229 THEN DT.Value END) AS AnalizComp1nC4H10_vol,
(CASE WHEN DT.ID=230 THEN DT.Value END) AS AnalizComp1neoC5H12_vol,
(CASE WHEN DT.ID=231 THEN DT.Value END) AS AnalizComp1iC5H12_vol,
(CASE WHEN DT.ID=232 THEN DT.Value END) AS AnalizComp1nC5H12_vol,
(CASE WHEN DT.ID=234 THEN DT.Value END) AS AnalizComp1N2_vol,
(CASE WHEN DT.ID=235 THEN DT.Value END) AS AnalizComp1O2_vol,
(CASE WHEN DT.ID=236 THEN DT.Value END) AS AnalizComp1CO2_vol,
(CASE WHEN DT.ID=237 THEN DT.Value END) AS AnalizComp1He_vol,
(CASE WHEN DT.ID=238 THEN DT.Value END) AS AnalizComp1H_vol,
(CASE WHEN DT.ID=239 THEN DT.Value END) AS AnalizComp1H2O_vol,
(CASE WHEN DT.ID=240 THEN DT.Value END) AS AnalizComp1Koeff,
(CASE WHEN DT.ID=241 THEN DT.Value END) AS AnalizComp1Mol_Mass,
(CASE WHEN DT.ID=242 THEN DT.Value END) AS AnalizComp1UTS_Lo,
(CASE WHEN DT.ID=243 THEN DT.Value END) AS AnalizComp1UTS_Hi,
(CASE WHEN DT.ID=244 THEN DT.Value END) AS AnalizComp1Abs_ro,
(CASE WHEN DT.ID=245 THEN DT.Value END) AS AnalizComp1Rel_ro,
(CASE WHEN DT.ID=246 THEN DT.Value END) AS AnalizComp1Vobbe_Lo,
(CASE WHEN DT.ID=247 THEN DT.Value END) AS AnalizComp1Vobbe_Hi,
(CASE WHEN DT.ID=248 THEN DT.Value END) AS AnalizComp1An_Num,
(CASE WHEN DT.ID=249 THEN DT.Value END) AS AnalizComp1Status,
(CASE WHEN DT.ID=250 THEN DT.Value END) AS AnalizComp2An_DT1,
(CASE WHEN DT.ID=251 THEN DT.Value END) AS AnalizComp2CH4_mol,
(CASE WHEN DT.ID=252 THEN DT.Value END) AS AnalizComp2C2H6_mol,
(CASE WHEN DT.ID=253 THEN DT.Value END) AS AnalizComp2C3H8_mol,
(CASE WHEN DT.ID=254 THEN DT.Value END) AS AnalizComp2iC4H10_mol,
(CASE WHEN DT.ID=255 THEN DT.Value END) AS AnalizComp2nC4H10_mol,
(CASE WHEN DT.ID=256 THEN DT.Value END) AS AnalizComp2neoC5H12_mol,
(CASE WHEN DT.ID=257 THEN DT.Value END) AS AnalizComp2iC5H12_mol,
(CASE WHEN DT.ID=258 THEN DT.Value END) AS AnalizComp2nC5H12_mol,
(CASE WHEN DT.ID=260 THEN DT.Value END) AS AnalizComp2N2_mol,
(CASE WHEN DT.ID=261 THEN DT.Value END) AS AnalizComp2O2_mol,
(CASE WHEN DT.ID=262 THEN DT.Value END) AS AnalizComp2CO2_mol,
(CASE WHEN DT.ID=263 THEN DT.Value END) AS AnalizComp2He_mol,
(CASE WHEN DT.ID=264 THEN DT.Value END) AS AnalizComp2H_mol,
(CASE WHEN DT.ID=265 THEN DT.Value END) AS AnalizComp2H2O_mol,
(CASE WHEN DT.ID=266 THEN DT.Value END) AS AnalizComp2CH4_vol,
(CASE WHEN DT.ID=267 THEN DT.Value END) AS AnalizComp2C2H6_vol,
(CASE WHEN DT.ID=268 THEN DT.Value END) AS AnalizComp2C3H8_vol,
(CASE WHEN DT.ID=269 THEN DT.Value END) AS AnalizComp2iC4H10_vol,
(CASE WHEN DT.ID=270 THEN DT.Value END) AS AnalizComp2nC4H10_vol,
(CASE WHEN DT.ID=271 THEN DT.Value END) AS AnalizComp2neoC5H12_vol,
(CASE WHEN DT.ID=272 THEN DT.Value END) AS AnalizComp2iC5H12_vol,
(CASE WHEN DT.ID=273 THEN DT.Value END) AS AnalizComp2nC5H12_vol,
(CASE WHEN DT.ID=274 THEN DT.Value END) AS AnalizComp2C6plus_vol,
(CASE WHEN DT.ID=275 THEN DT.Value END) AS AnalizComp2N2_vol,
(CASE WHEN DT.ID=276 THEN DT.Value END) AS AnalizComp2O2_vol,
(CASE WHEN DT.ID=277 THEN DT.Value END) AS AnalizComp2CO2_vol,
(CASE WHEN DT.ID=278 THEN DT.Value END) AS AnalizComp2He_vol,
(CASE WHEN DT.ID=279 THEN DT.Value END) AS AnalizComp2H_vol,
(CASE WHEN DT.ID=280 THEN DT.Value END) AS AnalizComp2H2O_vol,
(CASE WHEN DT.ID=281 THEN DT.Value END) AS AnalizComp2Koeff,
(CASE WHEN DT.ID=282 THEN DT.Value END) AS AnalizComp2Mol_Mass,
(CASE WHEN DT.ID=283 THEN DT.Value END) AS AnalizComp2UTS_Lo,
(CASE WHEN DT.ID=284 THEN DT.Value END) AS AnalizComp2UTS_Hi
FROM
(SELECT [Date],[ID],[Value] FROM [ArchiveAnalog]) AS DT

Yes ... that should be funny , but it works very slow.
Is it real to optimize this .... ?

A: You can use the PIVOT relational operators
But for full performance you may create a materialized view or create a help table where the data would be copied in rows.

A: Should be slow when you have so many CASE statements...
Is there a reason why you need to build a table rowset with so many columns?  You are probably approaching it wrong...


text:
Q: How to list unique combinations in a pandas dataframe I have dataframe in pandas with columns. I want list only the unique combinations .How can do it.
**Input**

data[['Month','Ratio']]

Month  Ratio
3      0.7169653
3      0.7169653
3      0.7169653
6      0.6789213
6      0.6789213
7      0.2345671
7      0.2345671
7      0.2345671
7      0.2345671
12     0.5623451
12     0.5623451
12     0.5623451
1      0.9808901

**Expected Output**

Month  Ratio
3      0.7169653
6      0.6789213
7      0.2345671
12     0.5623451
1      0.9808901

How to do this in python

A: I used drop_duplicates() function
 Month_unique= data[['Month','Month_Ontime_Delivery_Ratio']].drop_duplicates()

This resolved the issue.


text:
Q: jQuery datatables bundleconfig for MVC4? Nuget installing jQuery DataTables -1.9.4 in separate folders in VS 2012. See pic.
How to bundle up them with existing bundleConfig?
Current bundle I have is
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-{version}.js"));
   bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
                    "~/Scripts/jquery-ui-{version}.js"));
   bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                        "~/Scripts/jquery.unobtrusive*",
                        "~/Scripts/jquery.validate*"));
   bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                        "~/Scripts/modernizr-*"));
   bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
   bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
                        "~/Content/themes/base/jquery.ui.core.css",
                        "~/Content/themes/base/jquery.ui.resizable.css",
                        "~/Content/themes/base/jquery.ui.selectable.css",
                        "~/Content/themes/base/jquery.ui.accordion.css",
                        "~/Content/themes/base/jquery.ui.autocomplete.css",
                        "~/Content/themes/base/jquery.ui.button.css",
                        "~/Content/themes/base/jquery.ui.dialog.css",
                        "~/Content/themes/base/jquery.ui.slider.css",
                        "~/Content/themes/base/jquery.ui.tabs.css",
                        "~/Content/themes/base/jquery.ui.datepicker.css",
                        "~/Content/themes/base/jquery.ui.progressbar.css",
                        "~/Content/themes/base/jquery.ui.theme.css"));

A: You can just add the appropriate lines to the .css bundle and .js bundle
.JS
"~/Scripts/DataTables-1.9.4/media/js/jquery.dataTables.js",

.CSS
"~/Content/DataTables-1.9.4/media/css/jquery.dataTables.css",


text:
Q: cmsis_compiler.h: No such file or directory while compiling Arduino Tensorflow lite library for Arduino Due I am trying to compile the Arduino Tensorflow lite Library example file for Arduino Due board, but at the time of compilation I got error of missing cmsis_compiler.h  file error. I also tried to compile the code for STM32F103C8 board on Arduino version 1.8.12 with the Arduino_TensorFlowLite at version 2.1.0-ALPHA-precompiled library but still the same error. Here is the complete error

                 from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src/third_party/gemmlowp/fixedpoint/fixedpoint.h:24,

                 from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src/tensorflow/lite/kernels/internal/reference/add.h:18,

                 from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src\tensorflow\lite\micro\kernels\cmsis-nn\add.cpp:16:

c:\users\strange lab\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\bits\c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

 #error This file requires compiler and library support for the \

  ^

In file included from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src/tensorflow/lite/micro/tools/make/downloads/cmsis/CMSIS/NN/Include/arm_nnsupportfunctions.h:33:0,

                 from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src/tensorflow/lite/micro/tools/make/downloads/cmsis/CMSIS/NN/Include/arm_nnfunctions.h:163,

                 from C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src\tensorflow\lite\micro\kernels\cmsis-nn\add.cpp:18:

C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite\src/tensorflow/lite/micro/tools/make/downloads/cmsis/CMSIS/DSP/Include/arm_math.h:382:28: fatal error: cmsis_compiler.h: No such file or directory

 #include "cmsis_compiler.h"

                            ^

compilation terminated.

Using library Arduino_TensorFlowLite at version 2.1.0-ALPHA-precompiled in folder: C:\Users\Strange Lab\Documents\Arduino\libraries\Arduino_TensorFlowLite
exit status 1
Error compiling for board Generic STM32F103C series.```

I can understand that may be the Arduino Due is not officially supported but I think the STM32F103C8 board is supported. So is there anything which I am missing here?

A: I hope you have found an answer yourself since posting this question, but for anyone else fumbling their way in here; it seems like the current tensorflow-lite library (as I'm writing this it is: 2.1.0-APLHA-precompiled) only works with MbedOS-boards (Portenta H7 and Nano 33 BLE).
Hope you could use this answer :D


text:
Q: What's the difference between Maximum working current and upper limit of instantaneous current? I am seeking to protect a Mabuchi RS-380-SH4535 motor + battery system using a BMS.   The battery is a single cell 18650 LiIon.
The motor has a stall current of 15 A at maximum battery voltage.
My battery has a maximum discharging current of 20 A.
What design parameters are appropiate to protect the battery and motor in normal operation?
I previously identified 3 potential sets of BMS specifications. I now realise that these are unsuited to my application (due to wrong intended battery chemistry) so rather than asking for a specific BMS
Question:
I'd like to know what technical aspects matter and why when designing or selecting a BMS and/or overcurrent protection system.
What's the relationship between stall current, maximum working current and maximum instantaneous current?
______________
Motor specification.
Stall current shown is at 6V.

____________________________________
NOW  REDUNDANT:
I have found 3 different BMS options:

1. Max. working current: 12 A. Upper limit of instantaneous current: 17 A.

2. Max. working current: 16 A. Upper limit of instantaneous current: 34 A.

3. Max. working current: 24 A. Upper limit of instantaneous current: 42 A.

   Which option should I choose and why?

A: A datasheet, name, brand and related links will always be useful and help people provide a better answer.
But, the terms seem clear enough.
Maximum working current is the long term current that the system can tolerate.
Upper limit of instantaneous current is the current which will not cause damage to the BMS if maintained for a "short" period. The value of 'short' is uncertain and may or may not be in the datasheet.
Factors include:

*

*Thermal overload - noting that thermal dissipation rises approximately with current squared - so
17:12A = 289:144 ~= 2:1 thermally.
34:16A = 4.4:1 thermally
42:24A = 3:1 thermally

*Instantaneous fusing current. Often wire fuses have ~ 2:1 fusing:operating current ratio but this varies very wisely with fuse type and design.
Choosing the BMS with 12A / 17 A working / maximum will be acceptable if the 15A stall current occurs only briefly and operating current is usually at or below 12A.
Choosing the BMS with 16A / 34A working / maximum allows longer stall periods but if a fault occurs that draws a fault current in the 20-34A range the BMS will not protect the battery.
The 34 / 42 A BMS is unsuitable as both the operating and maximum current levels are well above operating or significant battery damage levels.


text:
Q: Overloading Bitwise And(&) Operator and "*this" in Class Functions I have several questions about this particular piece of code. I should first mention that pChar will always be a dynamic character array that is resized when needed by methods I have not listed.  I have scoured my reference manual and this website but cannot seem to gain a clear understanding of how the & operator works in full.  I also do not want to use an alternative as this is an assignment and am not allowed to.  I've been at this for days so any help would be appreciated.

*

*What exactly is *this pointing to when using the & operator?
  I have been assuming it points to the left operand.

*If this is not the case, how do I access the left operand within the & operator method?

*If this is all completely incorrect, how can I reach the desired outcome by using the overloaded operator&?
Method for & operator:
PDS_String & PDS_String::operator & (const PDS_String & Str)const
{
     PDS_String temp(*this);
     strcat(temp.pChar, Str.pChar);
     return temp;
}

Main:
void main ()
{
        PDS_String String1;
        PDS_String String2;
        PDS_String String3;

        String1 = "monkey";
        String2 = "chicken";
        String3 = String1 & String2;
// Desired outcome for String3 is "monkeychicken"
}

Class:
class PDS_String
{
public:
    PDS_String();                       //Default
    PDS_String(const PDS_String &);     //Copy
    ~PDS_String();                      //Destructor

    char *          operator &   (const PDS_String &) const;  // Concatenation
    PDS_String &    operator =   (const char *);    // Assignment

// I haven't listed all methods and operator overloads

private:
    char *      pChar;
    long        NumChars;
    long        NumSlots;
};

Assignment operator method:
    PDS_String & PDS_String::operator = (const char * Str)
    {
        if (pChar == Str)
            return *this;
        else
        {
            if (NumSlots < strlen(Str))
            {
                delete[] pChar;
                pChar = new char[(strlen(Str) + 1)];
                NumSlots = (strlen(Str));
            }
            else;
        }
        strcpy(pChar, Str);
        NumChars = strlen(Str);
         return *this;
    }

Thank you very much Matt McNabb.  I have changed the operator& method to reflect your suggestion:
char * PDS_String::operator & (const PDS_String & Str)const
{
     char * temp;
     temp = new char[strlen(pChar)+strlen(Str.pChar)+1];
     temp = pChar;
     strcat(pChar, Str.pChar);
     return temp;
}

A: *

**this refers to the left-hand operand. this points to the left-hand operand.

*N/A

*Stop returning a reference to a local object. temp ceases to exist when the function ends, so the caller has a dangling reference (causing undefined behaviour).
The normal semantics for a binary operator is to return an object by value. So you could change to PDS_String PDS_String::operator & (const PDS_String & Str)const and everything will be fine.
Usually what's done is that the operator+= function is a member function that changes *this, and then you have a free function X operator+(X x1, X x2) { return x1 += x2; }.  You could do the same thing with operator& and operator&=.
You also have no protection against somebody trying to concatenate a long string and overflowing however much memory is allocated to pChar, you will need to add checks for that.


text:
Q: Post request handling with lua script in nginx I use lua script to generate data from the parameters and bodies, and then send the data to the other server.
When i handle a GET request, nginx returns a normal response.
However, a 404 not found error occurs when handling POST requests.
However, internal operations were normal and sent the data to the other server.
Only the request method has changed.
If i explicitly pass the value to ngx.say or ngx.exit, i get 200 response normally.
Why? Is it necessary to explicitly return a response code when using a post request with a lua script?
In addition, I am using empty_gif.

A: I have searched for the above problem.
empty_gif can only be used to respond to GET and HEAD request methods
so I will use 204 response code


text:
Q: How to give a node an option in Vis.js to I'm using vis.js and want to render a graph that looks like this one: http://visjs.org/examples/network/nodeStyles/circularImages.html
The problem is that I don't know how to set image per node. In documentation it's said:

When you have given a node an option, you will override the global
  option for that property, and also the group option for that property
  if the node is in a group. If you then set that option to null, it
  will revert back to the default value.

But nothing is said about how to give option to a particular node.
Here's my code:

    <link href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.18.1/vis.min.css" rel="stylesheet" type="text/css" />

A: Ok, never mind... It seems that I've already found an answer. It seems like using the Dot language doesn't let a user to customize nodes individually.
This answer helped me: How to set the image size in Vis.js network graph
Here's what I have

    <link href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.18.1/vis.min.css" rel="stylesheet" type="text/css" />