text:
Q: Third degree Taylor series of $f(x) = e^x \cos{x} $ Suppose you have the function: $$f(x) = e^x  \cos{x} $$
and you need to find the 3rd degree Taylor Series representation. The way I have been taught to do this is to express each separate function as a power series and multiply as necessary for the 3rd degree. For example for
$$ \cos x =\sum_{n=0}^\infty (-1)^n\frac{  x^{2n}}{(2n)!} = 1-\frac{x^2}{2!}+\frac{x^4}{4!}+\cdots  \text{ and }  e^x =\sum_{n=0}^\infty \frac{x^n}{n!} = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!}+\cdots $$ multiply the terms on the right of each until you get the 3rd degree.
Logically, I am happy. However, I have not seen a theorem or any rule that says you can just multiply series in this way. Doing it this way, is there a guarantee that I will always get the power series representation of $f(x)$?
Additionally, if instead of multiplying, functions were being added? Would the above hold true - take the series of each function and add up the necessary terms?

A: Taylor's theorem allows you to use the Big O notation:
$$\cos(x)= 1-\frac{x^2}{2!}+O(x^4)\quad\mbox{and}\quad e^x=1 + x + \frac{x^2}{2!} + \frac{x^3}{3!}+O(x^4).$$
Therefore
$$e^x\cos(x)=1 + x + \frac{x^2}{2!} + \frac{x^3}{3!}+O(x^4)-\frac{x^2}{2!}(1+x+O(x^2))=1+x-\frac{x^3}{3}+O(x^4).$$

A: Alternatively, you can directly expand the given function $f(x)=e^x\cos x$ to the Taylor series:
$$\begin{align}f(0)=&1 \\
f'(x)=e^x\cos x-e^x\sin x \Rightarrow f'(0)=&1;\\
 f''(x)=-2e^x\sin x \Rightarrow f''(0)=&0; \\
f'''(x)=-2e^x\sin x-2e^x\cos x \Rightarrow f'''(0)=&-2;\\
f^{(4)}=-4e^x\cos x \Rightarrow f''(0)=&-4 \end{align}$$
Hence:
$$\begin{align}e^x\cos x=&1+\frac{1}{1!}x+\frac{0}{2!}x^2+\frac{-2}{3!}x^3+\frac{-4}{4!}x^4+O(x^5)=\\
=&1+x-\frac{x^3}{3}-\frac{x^4}{6}+O(x^5).\end{align}$$

A: You can use the real part of $e^{(1+i)x}$. As the powers of $1+i$ are $$1,1+i,2i,-2+2i,-4,-4-4i,-8i\cdots$$
 you write immediately
$$e^x\cos x= 1+x-\frac{x^3}3-\frac{x^4}6-\frac{x^5}{30}+\cdots$$

Using the polar form, the general term is
$$\frac{(1+i)^n}{n!}x^n=\frac{\sqrt2^n\cos\frac{n\pi}{4}}{n!}x^n.$$

A: $\begin{array}\\
f(x)
&= e^x  \cos{x}\\
&= e^x  Re(e^{ix})\\
&= Re(e^{x+ix})\\
&= Re(e^{x(1+i)})\\
&= Re(\sum_{n=0}^{\infty} \dfrac{x^n(1+i)^n}{n!})\\
&= Re(\sum_{n=0}^{\infty} \dfrac{2^{n/2}x^ne^{i\pi n/4}}{n!})\\
&= Re(\sum_{n=0}^{\infty} \dfrac{2^{n/2}x^n(\cos(\pi n/4)+i\sin(\pi n/4))}{n!})\\
&= \sum_{n=0}^{\infty} \dfrac{2^{n/2}x^n\cos(\pi n/4)}{n!}\\
&= \sum_{n=0}^{\infty} \dfrac{2^{n/2}x^n[1, 1/\sqrt{2}, 0, -1/\sqrt{2}, -1, -1/\sqrt{2}, 0, 1/\sqrt{2}]}{n!}\\
&= \sum_{n=0}^{\infty} \dfrac{2^{\lfloor n/2 \rfloor}x^n[1, 1, 0, -1, -1, -1, 0, 1]}{n!}\\
&=1+x+0x^2-2x^3/6-4x^4/24-4x^5/120+...\\
&=1+x-x^3/3-x^4/6-x^5/30+...\\
\end{array}
$

A: About the product of Taylor series.
In the development of the product
$$f(x)g(x)=\left(\sum_n\frac{f^{(n)}(0)}{n!}x^n\right)\left(\sum_m\frac{g^{(m)}(0)}{m!}x^m\right)=\sum_n\sum_m\frac{f^{(n)}(0)}{n!}\frac{g^{(m)}(0)}{m!}x^{n+m},$$
the terms of degree $n+m=d$ can be grouped as
$$\sum_{n+m=d}\frac{f^{(n)}(0)}{n!}\frac{g^{(m)}(0)}{m!}x^{d}
=\sum_{n}\frac{f^{(n)}(0)}{n!}\frac{g^{(d-n)}(0)}{(d-n)!}x^{d}
=\sum_{n}\binom dnf^{(n)}(0)g^{(d-n)}(0)\frac{x^{d}}{d!}.$$
Compare this to the Leibniz product rule:
$$(f(x)g(x))^{(d)}=\sum_n\binom dnf^{(n)}(x)g^{(d-n)}(x)$$
and you obtain
$$\left.\left(f(x)g(x)\right)^{(d)}\right|_{x=0}\frac{x^{d}}{d!}.$$


text:
Q: How to understand degrees in real estate We are wanting to understand where the easement is on a 10 acre property we purchased. We don't really understand about tags for posting.
This is the description:

Ingress-egress easement for road purpose: Beginning 12.5 ft on each
  side of the following described center line: Beginning at the center
  of section 4, township 23, north range 32 west, McDonald County, MO.
  Thence north 68 degrees, 39 minutes, 25 seconds east 7l.96 feet.
  Thence south 75 degrees, 51 minutes, 17 seconds east, 55. 41 feet,
  thence south 81 degrees, 40 minutes, 50 seconds east, 162.27 feet to
  the point of termination.

A: The legal description you provided (of an easement along the road) should have been provided by a licensed professional land surveyor.
That description is also what a mapper would use to digitally map the described road centerline, which could then be buffered on each side by 12.5 feet (i.e., easement is 25 feet wide).
A mapper could start with a Public Land Survey System ("PLSS"; or equivalent) dataset for Montana, or better yet certified Section Corners, to locate the Section of Interest (Section 4, Township 23 North, Range 32 West), and starting at the [Point of] Beginning (center of Section 4), map, using Coordinate Geometry or "COGO", the road centerline traverse by the bearings and distances in the description.
That mapped centerline could then be buffered on both sides by 12.5 feet.
The resulting buffered area/polygon is the land/road described for the easement.

A: This is describing the shape of an area in polar coordinates. Polar coordinates work from a known starting point, and each new point is derived from a bearing (angle) and a distance. Think of it this way: you are at your kitchen table. If you face North and turn clockwise 40 degrees, and then walk 5 steps, you're at the hallway door. So your hallway door is 40 degrees and 3.5 meters (considering 70cm per step) from your kitchen table.

EDIT (in accordance to comment by mkennedy): in the USA, bearing is measured either from the North or South, and you turn X degrees to either East or West. So a "North 40 degrees East" bearing means looking North, turn 40 degrees to the East.
Your area description is marking a line, and saying your area is everything encompassing 12.5 ft to the left and right of your centre line. The starting point is "center of section 4, township 23, north range 32 west, McDonald County, MO". From there, you look East, turn 68°39'25" anticlockwise and walk 71.96ft. This is your second point. From it, you look East again, turn 75°51'17" clockwise and walk 55.41ft. That is your third point. Finally you look East again, turn 81°40'50" clockwise and walk 162.27ft to what is your final point. Everything within 12.5ft of this line is your area of interest.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Derivative not ignoring fields for comparison I have the following data structure. When I do a binary search on it, and pass in a &limit_price, it only matches if the values in size and orders matches as well. Because I am ignoring PartialEq I would assume it should only match on the price field.
Am I missing something?
#[derive(Derivative)]
#[derivative(Hash, PartialEq, Eq, PartialOrd, Ord, Debug)]
struct LimitPrice {
    price: OrderedFloat<f32>,

    #[derivative(Hash="ignore", PartialEq = "ignore", PartialOrd = "ignore")]
    size: OrderedFloat<f32>,
    #[derivative(Hash="ignore", PartialEq = "ignore", PartialOrd = "ignore")]
    orders: Vec<Order>,
}

A: A reproducible example shows that only Ord is incorrect.
Any time you implement Ord and PartialOrd, you need to ensure that the implementations agree. With #[derive] this is automatic, but because derivative allows you to skip fields it also makes it possible to get Ord and PartialOrd that don't agree with each other. In this code, it would make sense for them to both have the same "ignore" annotation.
#[derivative(Hash="ignore", PartialEq = "ignore", PartialOrd = "ignore", Ord = "ignore")]
                                                                      // ^^^^^^^^^^^^^^

(playground)
Ord and PartialOrd have a different relationship than Eq and PartialEq. Eq is a marker trait – it has no behavior of its own, only a contract about the behavior of PartialEq. Ord, on the other hand, carries both a promise about the behavior of PartialOrd (that partial_cmp always returns Some) and its own behavior (a function that returns an Ordering directly). This is why you don't need an "ignore" annotation for Eq but you do need one for Ord.


text:
Q: Learning TypeScript with no JavaScript Background I'm planning to learn TypeScript, I have enough HTML5, CSS basics, my problem is that I practically never used nor learned JavaScript, how bad is that, should I start learning JavaScript first, or I can just jump with TypeScript ?

A: The closest equivalence you might be more familiar with is trying to learn C++ without knowing C first. TypeScript while based on JavaScript and compiled to JavaScript is a different language which emphasises different aspects of programming than JavaScript.
Sure, a strong background in JavaScript would help you pick up TypeScript faster, but learning the basics of JavaScript won't do you much good compared to just diving into TypeScript.


text:
Q: JPA not creating columns when using @PrePersist & @PreUpdate I am attempting to resolve the same old issue with having a reusable set of Created and Updated time stamp fields.  I have attempted to implement this solution: using @PrePersist and @PreUpdate with no success.
When I try this approach the created and updated columns are not created in the table. Extending the AbstractTimestampEntity class has no effect on the table creation.  The only way I get the columns created is by using the generally accepted approach of using private member variables with public getter/setter methods which have the standard annotations @Column(nullable=false) and @Temporal(TemporalType.TIMESTAMP).
I assumed (yeah, I know) that extending the AbstractTimestampEntity class and the annotations within it would cause my SchemaExport(config).create call to include the two inherited fields and create the columns.
Fairly certain that I'm missing something simple (yet not obvious).  Are there overrides for the two fields that need to exist in the entity model class?
btw - I'm using hibernate-distribution-3.6.8.Final, hibernate-annotations-3.4.0.GA and db-derby-10.8.2.2-bin.


text:
Q: using order_by() seperate from query I am retrieving some Posts using order_by in my for loop as given below
logged_user = Profile.objects.get(user=request.user.id)
followings = logged_user.follows.all()
all_posts = []
for foll in followings:
        all_posts += Posts.objects.all().filter(user_profile=foll.id).order_by('trending_ratio')

It sorts the Posts for each user, but I want to sort all post based on their trending ratio. for e.g the above code sorts all posts of user1 based on their tending_ratio, then it sorts posts user2 based on trending_ratio and so on.
But, I simply want to perform sorting after all the posts from all users is stored in all_posts i.e
all_posts.order_by('trending_ratio') after my for loop execution
Note :
1. I follows a ManyToMany field in Posts model.
2. followings is the list of all the users whom logged user follows
models.py
class Posts(models.Model):
    user_profile = models.ForeignKey(Profile, on_delete=models.CASCADE)
    trending_ratio = models.FloatField(default=1)
    ...

A: You can get all the posts in one query:
all_posts = Posts.objects.filter(user_profile__in=followings).order_by('trending_ratio')

This will order them correctly, as well as being much more efficient.


text:
Q: url rewriting with railo tomcat apache for cf wheels I am new to cf wheels and would like to enable url rewriting. I have my wheels folder on a subdirectory at the root of my host.
I believe I have my .htaccess file set up correctly but don't have the proper apache settings to enable url rewriting.
What settings would I need to mess with and how would I go about doing so?

A: Follow the instructions in the cfwheels url-rewriting documentation
If these don't work, update your question to indicate what parts succeed and where it fails, and post the relevant parts of your config files.


text:
Q: Kofax integration with Nuxeo I'm working with Nuxeo 7.10.
Now I'm facing with problem of integration Kofax with it.I have seen Kofax is integrated with Alfresco but with Nuxeo I didn't find any thing.
Have any body any idea, if it is possible, how can I integrate?

A: You may need to clarify which Kofax you want to integrate. As for Kofax Capture, there's no dedicated Export Connector for Nuxeo, however Kofax does offer a connector for anything that complies with the CMIS standard, which Nuxeo should.
Kofax TotalAgility on the other hand offers a dedicated CMIS activity that (among others) allows you to get, update or find a document in any compliant EDMS (hence, Nuxeo).

A: You can write your own Export Connector for Kofax Capture.
There is a frame work you can use that integrates the Kofax API.
Nuxeo has an REST API i see so that is no problem.
Just write a Export Connector that exposes the REST API.
When you are going to write an export connector for version 10.0 en below you have to consider that Kofax is COM based after version 10.0 Kofax is .Net based.


text:
Q: changing value of threshold value when getting error at neuralnet package - R At the below link, I asked, why I am getting error using neuralnet package:
[https://stackoverflow.com/questions/67854153/getting-requires-numeric-complex-matrix-vector-arguments-error-using-neuralnet/67854278#67854278][1]
@akrun explained and solved the problem. The problem was default value of threshold. It's default value is 0.01. If we let that value to be 0.05, the algorithm converges.
But, I want to use default threshold value in general. Bu when I get error, I want to use 0.05 as threshold value instead of the default value.
For that aim I revised the code as below:
{df1_1<-structure(list(realized1 = c(11.121, 0.122, 0.009, 0.007, 0.008,
0.013, 0.003, 0.004, 0.01, 0.01, 0.015, 0.006, 0.001, 0.018,
0.01, 0.011, 0.001, 0.012, 0.014, 0.028, 0.001, 0.024, 0.007,
0.025, 0.025, 0.006, 0.005, 0.005, 0.018, 0.005, 0.003, 0.004,
0.009, 0.009, 0, 0.013, 0.007, 0.024, 0.038, 0.01, 0.002, 0.043,
0, 0.029, 0.012, 0.015, 0.018, 0.019, 0.011, 0.01, 0.012, 0.005,
0.015, 0.003, 0.006, 0.006, 0.01, 0.018, 0.01, 0.002, 0, 0.008,
0.013, 0.002, 0.02, 0.028, 0.001, 0.014, 0.012, 0.02, 0.002,
0.003, 0.003, 0.004, 0.007, 0.027, 0.017, 0.004, 0.007, 0.002,
0.003, 0.005, 0.011, 0.01, 0.012, 0.004, 0.008, 0.009, 0.001,
0.016, 0.004, 0.01, 0.024, 0.014, 0.03, 0.013, 0.001, 0.026,
0.006, 0.001, 0.021, 0.015, 0.002, 0.021, 0.015, 0.025, 0.002,
0.002, 0.005, 0.011, 0.015, 0.006, 0.006, 0, 0.003, 0.021, 0.02,
0.003, 0.01, 0.012, 0.017, 0.013, 0.006, 0.008, 0.002, 0.014,
0.003, 0.004, 0, 0.015, 0.005, 0.01, 0.014, 0.008, 0.011, 0.003,
0.009, 0.008, 0.002, 0.01, 0.003, 0.003, 0.012, 0.018, 0.021,
0.005, 0.003, 0.022, 0.004, 0.006, 0.003, 0.007, 0.033, 0.053,
0.073, 0.014, 0.052, 0.034, 0.003, 0.024, 0.011, 0.002, 0.043,
0.022, 0.004, 0.017, 0.012, 0.002, 0.014, 0.004, 0.026, 0.024,
0.018, 0.004, 0.026, 0.014, 0.005, 0.019, 0.01, 0.018, 0.013,
0, 0.05, 0.002, 0.048, 0.028, 0.009, 0.025, 0.012, 0.013, 0.001,
0.004, 0.038, 0.002, 0.002, 0.002, 0.017, 0.006, 0.013, 0.015,
0.013, 0.015, 0.005, 0.016, 0.033, 0.016, 0.01, 0, 0.015, 0.021,
0.007, 0.017, 0.022, 0.016, 0.014, 0.006, 0.011, 0.012, 0.006,
0.001, 0, 0.015, 0.011, 0.032, 0.014, 0.017, 0.029, 0.029, 0.023,
0.004, 0.046, 0.014, 0.018, 0.007, 0.01, 0.009, 0.03, 0.007,
0.026, 0.002, 0.023, 0.011, 0.004, 0.018, 0.027, 0.008, 0.003,
0.007, 0.011, 0.001, 0.019, 0.01, 0.015, 0.002, 0.029, 0.026,
0.006, 0.02, 0.007, 0.019, 0.012, 0.014, 0.012, 0.024, 0.014,
0.016, 0.004, 0.005, 0.005, 0.007, 0.002, 0.036, 0.006, 0.008,
0.011, 0.035, 0.014, 0.001, 0.009, 0.002, 0.01, 0.017, 0.014,
0.021, 0.015, 0.003, 0.003, 0.018, 0.005, 0.003, 0.006, 0.02,
0.001, 0.016, 0.02, 0.012, 0, 0.003, 0.02, 0.009, 0.006, 0.003,
0.007, 0.004, 0.006, 0.024, 0.007, 0.017, 0.003, 0.006, 0.002,
0.004, 0.006, 0.018, 0.001, 0.011, 0.004, 0.014, 0.009, 0.005,
0.013, 0.006, 0.018, 0.002, 0.014, 0.012, 0.003, 0.005, 0.002,
0.003, 0.009, 0.005, 0.005, 0.007, 0.004, 0.012, 0.002, 0.01,
0.018, 0.006, 0.005, 0.003, 0.001, 0.011, 0.013, 0.001, 0.018,
0.007, 0.011, 0.014, 0.007, 0.007, 0.01, 0.024, 0.015, 0.002,
0.001, 0.011, 0.006, 0, 0.009, 0.003, 0.001, 0.008, 0.008, 0.011,
0.003, 0.012, 0.001, 0.002, 0.002, 0.002, 0.017, 0.002, 0.017,
0, 0.016, 0.011, 0.017, 0.006, 0.028, 0.01, 0.013, 0.004, 0.016,
0.013, 0.003, 0.008, 0.001, 0.012, 0.005, 0, 0.003, 0, 0.002,
0.009, 0.017, 0.01, 0.006, 0.034, 0.008, 0.01, 0.012, 0.003,
0.005, 0.024, 0.004, 0.01, 0.004, 0.003, 0.01, 0, 0.015, 0.007,
0.005, 0.013, 0.005, 0, 0.006, 0.004, 0.003, 0, 0.018, 0.003,
0.005, 0.01, 0.002, 0.003, 0.003, 0, 0.001, 0.013, 0.013, 0.001,
0.007, 0.007, 0.002, 0.013, 0.01, 0.009, 0.017, 0.002, 0.006,
0.005, 0.011, 0.01, 0.001, 0.007, 0.001, 0.009, 0.006, 0.016,
0, 0.002, 0.007, 0.006, 0.005, 0.006, 0.006, 0.006, 0.001, 0.014,
0.011, 0, 0.016, 0.018, 0.01, 0.006, 0.015, 0.012, 0.006, 0.009,
0.01, 0.004, 0.011, 0.002, 0, 0.002, 0.008, 0.015, 0.012, 0.002,
0, 0.007, 0.008, 0.017, 0.016, 0.007, 0.003, 0.006, 0.006, 0.001,
0.008, 0.006, 0.009, 0.015, 0.002, 0.006, 0, 0.002, 0.008, 0.004,
0.005, 0.006, 0.002, 0.005, 0.018, 0.005, 0.006, 0.008, 0.001,
0.012, 0.004, 0.002, 0.012, 0.005, 0.02, 0.009, 0.002, 0.003,
0.004, 0.008, 0.001, 0.02, 0.043, 0.013, 0.04, 0.002, 0.018,
0.006, 0.005, 0.003, 0.024, 0.007, 0.018, 0.011, 0.002, 0.005,
0.006, 0.002, 0.005, 0.008, 0.021, 0.018, 0.01, 0.011, 0.008,
0.015, 0.006, 0.009, 0.005, 0.014, 0.004, 0.021, 0.005, 0.003,
0.009, 0.008, 0.014, 0.003, 0.013, 0.001, 0.003, 0.001, 0.004,
0.014, 0.002, 0.013, 0.007, 0.002, 0.001, 0.014, 0.019, 0.014,
0.016, 0.007, 0.004, 0.02, 0.005, 0.006, 0.005, 0.004, 0.016,
0.003, 0.009, 0.009, 0.002, 0.002, 0, 0.01, 0.03, 0.004, 0.007,
0.003, 0.016, 0.01, 0.004, 0.002, 0.017, 0.009, 0.002, 0, 0.019,
0.012, 0.021, 0.02, 0.003, 0.005, 0.007, 0.031, 0, 0.014, 0.11,
0.049, 0.014, 0.048, 0.032, 0.025, 0.018, 0.024, 0.005, 0.045,
0.014, 0.015, 0.014, 0.071, 0.004, 0.034, 0.009, 0.036, 0.025,
0.007, 0.006, 0.004, 0.036, 0.023, 0.031, 0.019, 0.004, 0.013,
0.01, 0.029, 0.03, 0.008, 0.018, 0.001, 0.015, 0.001, 0.006,
0.018, 0.002, 0.018, 0.005, 0.02, 0.014, 0, 0.009, 0.003, 0.004,
0.007, 0.025, 0.002, 0.001, 0.021, 0.004, 0.026, 0.002, 0.035,
0.02, 0.005, 0.012, 0.049, 0, 0.014, 0.032, 0.024, 0, 0.004,
0.008, 0.036, 0.029, 0.001, 0.013, 0.015, 0.036, 0.007, 0.002,
0.062, 0.021, 0.013, 0.004, 0.004, 0.008, 0.011, 0.004, 0.026,
0.018, 0.015, 0.001, 0.004, 0.011, 0.008, 0.016, 0.007, 0.001,
0.034, 0.005, 0.01, 0.004, 0.005, 0.004, 0.008, 0.016, 0.014,
0.003, 0.02, 0.014, 0, 0.025, 0.024, 0.003, 0.006, 0.022, 0.004,
0.018, 0.013, 0.01, 0.01, 0.013, 0.012, 0.013, 0.009, 0.004,
0.016, 0.011, 0.025, 0, 0.015, 0.019, 0.011, 0.002, 0.002, 0.012,
0.014, 0.01, 0.054, 0.007, 0.033, 0.007, 0.022, 0.014, 0.043,
0.023, 0.01, 0.062, 0.003, 0.012, 0.015, 0.031, 0.008, 0.019,
0.014, 0.022, 0.002, 0, 0.001, 0.019, 0.018, 0.002, 0.008, 0.016,
0.029, 0.015, 0.002, 0.016, 0.023, 0.01, 0.014, 0.003, 0.017,
0.005, 0.033, 0.001, 0.009, 0.004, 0.004, 0.012, 0.018, 0.011,
0.023, 0.011, 0.005, 0.003, 0.005, 0.033, 0.01, 0.005, 0.012,
0.022, 0.03)), row.names = c(NA, -800L), class = "data.frame")

df1_2<-structure(list(ann_t1 = c(-3.57, -0.81, -1.62, -1.82, -2.11,
-2.36, -2.57, -2.72, -2.89, -3.04, -3.18, -3.23, -3.24, -3.31,
-3.41, -3.36, -3.46, -3.44, -3.52, -3.6, -3.52, -3.35, -3.44,
-3.54, -3.61, -3.43, -3.53, -3.54, -3.61, -3.68, -3.54, -3.61,
-3.65, -3.7, -3.76, -3.81, -3.84, -3.7, -3.67, -3.48, -3.24,
-3.35, -3.43, -3.18, -3.29, -3.41, -3.5, -3.45, -3.54, -3.62,
-3.69, -3.75, -3.8, -3.77, -3.64, -3.7, -3.75, -3.8, -3.84, -3.64,
-3.7, -3.73, -3.77, -3.72, -3.78, -3.79, -3.84, -3.9, -3.93,
-3.96, -3.99, -3.69, -3.74, -3.75, -3.8, -3.79, -3.83, -3.52,
-3.6, -3.67, -3.72, -3.77, -3.81, -3.78, -3.69, -3.75, -3.8,
-3.84, -3.88, -3.78, -3.81, -3.64, -3.65, -3.6, -3.43, -3.52,
-3.33, -3.43, -3.51, -3.36, -3.41, -3.48, -3.57, -3.5, -3.57,
-3.44, -3.4, -3.51, -3.58, -3.63, -3.63, -3.7, -3.76, -3.73,
-3.7, -3.75, -3.76, -3.55, -3.44, -3.52, -3.6, -3.55, -3.63,
-3.55, -3.62, -3.69, -3.71, -3.77, -3.81, -3.85, -3.87, -3.92,
-3.86, -3.76, -3.81, -3.75, -3.67, -3.68, -3.74, -3.69, -3.72,
-3.66, -3.68, -3.7, -3.61, -3.5, -3.59, -3.65, -3.67, -3.74,
-3.74, -3.71, -3.73, -3.69, -3.39, -3.08, -2.83, -2.99, -2.89,
-3.05, -3.18, -3.31, -3.42, -3.5, -3.21, -3.33, -3.43, -3.38,
-3.48, -3.54, -3.62, -3.68, -3.75, -3.51, -3.6, -3.66, -3.74,
-3.62, -3.63, -3.7, -3.64, -3.71, -3.77, -3.81, -3.9, -3.9, -3.28,
-3.19, -3.31, -3.42, -3.51, -3.59, -3.64, -3.66, -3.32, -3.42,
-3.49, -3.56, -3.64, -3.7, -3.76, -3.63, -3.69, -3.59, -3.65,
-3.54, -3.31, -3.42, -3.43, -3.51, -3.46, -3.55, -3.62, -3.51,
-3.4, -3.49, -3.58, -3.58, -3.54, -3.61, -3.61, -3.67, -3.72,
-3.6, -3.56, -3.33, -3.33, -3.3, -3.2, -3.33, -3.44, -3.49, -3.6,
-3.53, -3.61, -3.68, -3.63, -3.69, -3.42, -3.51, -3.35, -3.45,
-3.34, -3.44, -3.49, -3.41, -3.51, -3.52, -3.56, -3.63, -3.7,
-3.75, -3.57, -3.64, -3.54, -3.61, -3.69, -3.47, -3.49, -3.4,
-3.43, -3.53, -3.61, -3.68, -3.61, -3.69, -3.75, -3.8, -3.84,
-3.88, -3.91, -3.83, -3.86, -3.93, -3.95, -3.98, -3.82, -3.89,
-3.93, -3.95, -3.97, -3.95, -3.98, -3.74, -3.63, -3.7, -3.59,
-3.65, -3.71, -3.77, -3.81, -3.81, -3.76, -3.57, -3.64, -3.54,
-3.62, -3.69, -3.74, -3.78, -3.58, -3.56, -3.63, -3.69, -3.67,
-3.67, -3.73, -3.79, -3.84, -3.88, -3.91, -3.85, -3.86, -3.82,
-3.78, -3.84, -3.85, -3.74, -3.73, -3.79, -3.83, -3.87, -3.72,
-3.7, -3.55, -3.6, -3.53, -3.61, -3.67, -3.67, -3.7, -3.75, -3.69,
-3.69, -3.74, -3.71, -3.76, -3.81, -3.82, -3.73, -3.58, -3.65,
-3.65, -3.67, -3.71, -3.63, -3.7, -3.75, -3.59, -3.59, -3.66,
-3.57, -3.57, -3.57, -3.64, -3.46, -3.42, -3.49, -3.56, -3.64,
-3.63, -3.68, -3.74, -3.78, -3.82, -3.86, -3.9, -3.93, -3.95,
-3.98, -3.99, -4, -4.01, -3.98, -4.01, -4.02, -4.05, -4.05, -3.79,
-3.84, -3.89, -3.83, -3.89, -3.78, -3.83, -3.86, -3.68, -3.74,
-3.75, -3.8, -3.82, -3.71, -3.76, -3.8, -3.79, -3.82, -3.83,
-3.75, -3.6, -3.67, -3.72, -3.8, -3.84, -3.88, -3.75, -3.76,
-3.74, -3.81, -3.84, -3.75, -3.75, -3.75, -3.8, -3.84, -3.67,
-3.73, -3.78, -3.83, -3.86, -3.88, -3.82, -3.86, -3.89, -3.91,
-3.95, -3.93, -3.88, -3.92, -3.94, -3.96, -3.97, -3.98, -3.99,
-3.8, -3.85, -3.86, -3.79, -3.74, -3.77, -3.82, -3.72, -3.78,
-3.61, -3.67, -3.67, -3.72, -3.78, -3.69, -3.74, -3.79, -3.83,
-3.87, -3.9, -3.94, -3.95, -3.97, -3.99, -4.01, -3.94, -3.96,
-3.99, -3.9, -3.91, -3.95, -3.98, -3.99, -3.76, -3.82, -3.73,
-3.71, -3.77, -3.67, -3.66, -3.72, -3.65, -3.71, -3.63, -3.66,
-3.72, -3.73, -3.69, -3.75, -3.81, -3.84, -3.86, -3.9, -3.93,
-3.97, -4, -4.02, -3.97, -3.99, -4.01, -4.01, -4.03, -3.94, -3.84,
-3.88, -3.87, -3.82, -3.85, -3.85, -3.89, -3.92, -3.94, -3.96,
-3.98, -3.92, -3.96, -3.98, -3.9, -3.93, -3.94, -3.97, -3.92,
-3.94, -3.97, -3.99, -4.03, -4.04, -4.05, -4.05, -4.06, -4.07,
-4.07, -3.75, -3.3, -3.41, -3.19, -3.29, -3.4, -3.49, -3.52,
-3.56, -3.41, -3.5, -3.42, -3.51, -3.56, -3.58, -3.65, -3.68,
-3.73, -3.78, -3.57, -3.47, -3.56, -3.63, -3.69, -3.76, -3.8,
-3.85, -3.88, -3.92, -3.88, -3.93, -3.87, -3.9, -3.8, -3.74,
-3.8, -3.83, -3.7, -3.73, -3.78, -3.81, -3.85, -3.89, -3.92,
-3.95, -3.97, -3.99, -3.98, -3.79, -3.6, -3.53, -3.61, -3.6,
-3.62, -3.69, -3.74, -3.79, -3.77, -3.77, -3.62, -3.68, -3.74,
-3.79, -3.82, -3.86, -3.88, -3.92, -3.97, -3.99, -4.01, -3.97,
-4, -3.85, -3.83, -3.86, -3.91, -3.94, -3.93, -3.94, -3.68, -3.74,
-3.81, -3.6, -3.62, -3.63, -3.62, -3.37, -3.46, -3.43, -2.65,
-2.84, -2.95, -2.88, -3.04, -3.05, -3.09, -3.23, -3.3, -3.43,
-3.4, -3.37, -3.47, -2.97, -3.09, -3.03, -3.17, -3.31, -3.42,
-3.51, -3.58, -3.61, -3.32, -3.43, -3.27, -3.24, -3.35, -3.35,
-3.45, -3.55, -3.64, -3.62, -3.69, -3.73, -3.61, -3.66, -3.65,
-3.52, -3.57, -3.47, -3.55, -3.64, -3.55, -3.62, -3.68, -3.73,
-3.74, -3.71, -3.77, -3.81, -3.85, -3.6, -3.66, -3.45, -3.51,
-3.28, -3.25, -3.32, -3.43, -3.13, -3.25, -3.36, -3.47, -3.35,
-3.45, -3.5, -3.58, -3.67, -3.75, -3.78, -3.83, -3.67, -3.75,
-3.8, -3.81, -3.91, -3.64, -3.56, -3.6, -3.62, -3.6, -3.55, -3.58,
-3.67, -3.54, -3.62, -3.67, -3.68, -3.61, -3.6, -3.67, -3.73,
-3.77, -3.84, -3.88, -3.77, -3.82, -3.85, -3.88, -3.8, -3.63,
-3.55, -3.58, -3.46, -3.55, -3.62, -3.43, -3.32, -3.4, -3.49,
-3.58, -3.64, -3.71, -3.61, -3.68, -3.63, -3.7, -3.76, -3.65,
-3.61, -3.63, -3.7, -3.63, -3.44, -3.52, -3.46, -3.55, -3.63,
-3.67, -3.7, -3.61, -3.68, -3.74, -3.18, -3.3, -3.18, -3.29,
-3.25, -3.36, -3.14, -3.13, -3.19, -3.34, -3.41, -3.4, -3.37,
-3.48, -3.56, -3.46, -3.43, -3.52, -3.59, -3.66, -3.71, -3.55,
-3.45, -3.53, -3.61, -3.68, -3.42, -3.39, -3.48, -3.42, -3.33,
-3.43, -3.4, -3.47, -3.56, -3.58, -3.67, -3.72, -3.67, -3.72,
-3.77, -3.67, -3.74, -3.79, -3.55, -3.52, -3.59, -3.65, -3.71,
-3.4, -3.41, -3.5, -3.58)), row.names = c(NA, -800L), class = "data.frame")

df1_3<-structure(list(ann_t2 = c(0, -3.372, -0.059, -0.005, -0.004,
-0.006, -0.011, -0.003, -0.004, -0.01, -0.012, -0.019, -0.007,
-0.001, -0.024, -0.013, -0.016, -0.001, -0.018, -0.021, -0.041,
-0.002, -0.033, -0.01, -0.037, -0.034, -0.009, -0.008, -0.007,
-0.028, -0.007, -0.004, -0.006, -0.014, -0.015, 0, -0.023, -0.011,
-0.037, -0.053, -0.013, -0.002, -0.059, 0, -0.036, -0.016, -0.021,
-0.025, -0.028, -0.016, -0.015, -0.019, -0.009, -0.024, -0.005,
-0.009, -0.01, -0.017, -0.031, -0.016, -0.003, 0, -0.013, -0.02,
-0.004, -0.033, -0.048, -0.002, -0.025, -0.022, -0.038, -0.003,
-0.004, -0.005, -0.006, -0.012, -0.047, -0.025, -0.007, -0.012,
-0.003, -0.004, -0.009, -0.018, -0.015, -0.019, -0.006, -0.014,
-0.016, -0.001, -0.028, -0.006, -0.016, -0.036, -0.019, -0.043,
-0.017, -0.001, -0.037, -0.009, -0.002, -0.03, -0.022, -0.004,
-0.032, -0.02, -0.034, -0.004, -0.003, -0.007, -0.017, -0.023,
-0.011, -0.01, -0.001, -0.005, -0.035, -0.029, -0.004, -0.014,
-0.018, -0.025, -0.021, -0.009, -0.012, -0.003, -0.022, -0.005,
-0.007, 0, -0.025, -0.009, -0.017, -0.023, -0.014, -0.018, -0.005,
-0.014, -0.014, -0.003, -0.016, -0.004, -0.005, -0.02, -0.027,
-0.03, -0.008, -0.005, -0.034, -0.007, -0.01, -0.004, -0.012,
-0.052, -0.07, -0.082, -0.013, -0.055, -0.034, -0.003, -0.029,
-0.014, -0.003, -0.061, -0.026, -0.005, -0.023, -0.016, -0.002,
-0.02, -0.006, -0.041, -0.04, -0.026, -0.006, -0.04, -0.023,
-0.008, -0.029, -0.015, -0.027, -0.021, -0.001, -0.084, -0.003,
-0.086, -0.035, -0.011, -0.032, -0.016, -0.018, -0.002, -0.006,
-0.06, -0.003, -0.002, -0.003, -0.025, -0.009, -0.02, -0.025,
-0.02, -0.023, -0.008, -0.025, -0.048, -0.021, -0.013, -0.001,
-0.021, -0.029, -0.011, -0.027, -0.031, -0.021, -0.02, -0.009,
-0.017, -0.017, -0.009, -0.001, 0, -0.024, -0.017, -0.047, -0.018,
-0.022, -0.037, -0.035, -0.03, -0.005, -0.064, -0.021, -0.026,
-0.011, -0.015, -0.013, -0.048, -0.009, -0.038, -0.003, -0.032,
-0.014, -0.006, -0.025, -0.037, -0.011, -0.004, -0.01, -0.017,
-0.001, -0.032, -0.015, -0.024, -0.002, -0.044, -0.041, -0.009,
-0.028, -0.009, -0.026, -0.018, -0.021, -0.018, -0.036, -0.021,
-0.026, -0.007, -0.009, -0.009, -0.013, -0.004, -0.064, -0.012,
-0.014, -0.021, -0.06, -0.024, -0.003, -0.016, -0.004, -0.019,
-0.032, -0.022, -0.032, -0.024, -0.005, -0.005, -0.028, -0.009,
-0.006, -0.011, -0.032, -0.002, -0.024, -0.029, -0.018, 0, -0.005,
-0.034, -0.013, -0.009, -0.005, -0.011, -0.007, -0.01, -0.039,
-0.012, -0.029, -0.005, -0.011, -0.003, -0.008, -0.01, -0.031,
-0.002, -0.019, -0.007, -0.023, -0.014, -0.008, -0.023, -0.01,
-0.029, -0.003, -0.021, -0.018, -0.004, -0.008, -0.003, -0.005,
-0.014, -0.007, -0.007, -0.012, -0.006, -0.02, -0.002, -0.017,
-0.029, -0.009, -0.007, -0.005, -0.002, -0.018, -0.019, -0.001,
-0.029, -0.01, -0.017, -0.021, -0.01, -0.01, -0.014, -0.037,
-0.02, -0.002, -0.001, -0.016, -0.009, -0.001, -0.013, -0.005,
-0.002, -0.014, -0.014, -0.019, -0.006, -0.022, -0.001, -0.004,
-0.003, -0.005, -0.031, -0.003, -0.033, 0, -0.032, -0.018, -0.03,
-0.011, -0.048, -0.018, -0.021, -0.007, -0.028, -0.021, -0.005,
-0.014, -0.002, -0.02, -0.009, 0, -0.005, -0.001, -0.003, -0.015,
-0.028, -0.014, -0.01, -0.055, -0.013, -0.018, -0.021, -0.004,
-0.008, -0.039, -0.007, -0.017, -0.006, -0.005, -0.016, 0, -0.026,
-0.011, -0.007, -0.021, -0.009, -0.001, -0.011, -0.008, -0.005,
0, -0.033, -0.005, -0.008, -0.018, -0.004, -0.006, -0.005, 0,
-0.002, -0.025, -0.022, -0.002, -0.013, -0.012, -0.003, -0.022,
-0.018, -0.015, -0.028, -0.002, -0.009, -0.009, -0.018, -0.017,
-0.002, -0.012, -0.001, -0.016, -0.01, -0.029, 0, -0.004, -0.014,
-0.011, -0.009, -0.011, -0.012, -0.012, -0.001, -0.025, -0.02,
0, -0.029, -0.03, -0.017, -0.01, -0.023, -0.019, -0.01, -0.014,
-0.016, -0.006, -0.018, -0.004, -0.001, -0.004, -0.012, -0.024,
-0.02, -0.003, -0.001, -0.012, -0.015, -0.03, -0.03, -0.013,
-0.006, -0.011, -0.012, -0.002, -0.015, -0.011, -0.016, -0.026,
-0.004, -0.011, 0, -0.003, -0.014, -0.006, -0.009, -0.011, -0.003,
-0.009, -0.033, -0.009, -0.011, -0.015, -0.002, -0.022, -0.007,
-0.004, -0.021, -0.009, -0.038, -0.017, -0.003, -0.006, -0.008,
-0.016, -0.002, -0.039, -0.071, -0.016, -0.054, -0.002, -0.023,
-0.008, -0.007, -0.004, -0.035, -0.01, -0.026, -0.015, -0.003,
-0.007, -0.01, -0.004, -0.007, -0.013, -0.035, -0.026, -0.015,
-0.016, -0.013, -0.023, -0.011, -0.016, -0.009, -0.024, -0.008,
-0.037, -0.01, -0.005, -0.016, -0.013, -0.023, -0.005, -0.023,
-0.002, -0.004, -0.002, -0.006, -0.025, -0.004, -0.022, -0.014,
-0.004, -0.002, -0.026, -0.032, -0.021, -0.022, -0.011, -0.006,
-0.031, -0.009, -0.01, -0.008, -0.006, -0.027, -0.005, -0.014,
-0.014, -0.003, -0.003, -0.001, -0.018, -0.054, -0.008, -0.013,
-0.006, -0.029, -0.02, -0.007, -0.004, -0.029, -0.016, -0.004,
0, -0.035, -0.018, -0.035, -0.034, -0.005, -0.008, -0.011, -0.047,
0, -0.019, -0.151, -0.043, -0.014, -0.05, -0.032, -0.028, -0.019,
-0.027, -0.007, -0.057, -0.019, -0.02, -0.019, -0.099, -0.004,
-0.038, -0.009, -0.043, -0.032, -0.009, -0.008, -0.006, -0.055,
-0.03, -0.043, -0.024, -0.005, -0.017, -0.013, -0.04, -0.044,
-0.012, -0.028, -0.001, -0.024, -0.001, -0.009, -0.028, -0.003,
-0.026, -0.008, -0.029, -0.022, -0.001, -0.013, -0.005, -0.006,
-0.011, -0.04, -0.003, -0.002, -0.037, -0.006, -0.04, -0.003,
-0.05, -0.025, -0.006, -0.016, -0.066, 0, -0.018, -0.042, -0.033,
0, -0.005, -0.011, -0.053, -0.046, -0.001, -0.022, -0.026, -0.057,
-0.011, -0.003, -0.106, -0.038, -0.021, -0.005, -0.006, -0.012,
-0.017, -0.005, -0.039, -0.028, -0.022, -0.002, -0.006, -0.017,
-0.012, -0.023, -0.011, -0.001, -0.057, -0.008, -0.017, -0.007,
-0.009, -0.006, -0.015, -0.028, -0.022, -0.005, -0.029, -0.019,
-0.001, -0.038, -0.033, -0.004, -0.008, -0.032, -0.006, -0.027,
-0.021, -0.016, -0.015, -0.02, -0.018, -0.021, -0.014, -0.006,
-0.024, -0.017, -0.038, 0, -0.022, -0.027, -0.017, -0.003, -0.003,
-0.019, -0.021, -0.016, -0.088, -0.009, -0.042, -0.009, -0.027,
-0.017, -0.057, -0.027, -0.012, -0.074, -0.004, -0.016, -0.02,
-0.041, -0.011, -0.028, -0.019, -0.031, -0.003, 0, -0.001, -0.031,
-0.026, -0.003, -0.012, -0.024, -0.046, -0.02, -0.003, -0.022,
-0.031, -0.013, -0.019, -0.004, -0.024, -0.007, -0.05, -0.001,
-0.014, -0.006, -0.006, -0.02, -0.028, -0.018, -0.038, -0.017,
-0.007, -0.005, -0.007, -0.052, -0.013, -0.006, -0.018, -0.033
)), row.names = c(NA, -800L), class = "data.frame")

df1_4<-structure(list(ann_t3 = c(0, 2.818, -0.049, 0.004, 0.004, -0.005,
-0.009, -0.002, 0.003, 0.009, -0.01, -0.016, -0.006, 0.001, -0.02,
0.011, -0.013, -0.001, 0.015, -0.018, -0.034, 0.002, 0.028, 0.009,
-0.031, 0.028, -0.008, 0.007, 0.006, -0.023, 0.006, -0.003, 0.005,
0.011, 0.013, 0, -0.019, -0.01, -0.031, -0.045, 0.011, -0.002,
-0.049, 0, 0.03, 0.013, -0.018, 0.021, 0.023, 0.014, 0.013, 0.016,
-0.007, -0.02, 0.004, 0.007, 0.008, 0.014, -0.026, 0.013, -0.002,
0, -0.011, 0.017, -0.003, 0.028, 0.04, 0.002, 0.021, 0.019, -0.032,
0.002, -0.004, 0.004, -0.005, 0.01, -0.039, 0.021, 0.005, 0.01,
0.002, 0.004, -0.007, -0.015, 0.013, 0.016, 0.005, 0.011, -0.014,
-0.001, -0.023, -0.005, -0.013, -0.03, 0.016, -0.036, 0.014,
-0.001, -0.031, -0.007, -0.002, 0.025, -0.019, 0.003, -0.026,
-0.017, 0.028, 0.003, -0.002, -0.006, 0.015, 0.02, -0.009, -0.008,
0.001, -0.004, -0.029, -0.024, 0.004, 0.012, -0.015, 0.02, -0.017,
0.008, 0.01, -0.003, 0.019, 0.004, 0.006, 0, 0.021, -0.008, -0.014,
0.019, -0.012, -0.015, -0.004, 0.012, -0.011, -0.002, -0.013,
-0.004, -0.004, -0.016, -0.022, 0.025, 0.007, -0.004, 0.029,
-0.005, -0.008, -0.004, -0.01, -0.044, -0.059, -0.068, 0.011,
-0.046, 0.028, 0.003, 0.024, 0.012, 0.002, -0.051, 0.022, 0.004,
-0.019, 0.014, -0.002, 0.017, 0.005, 0.034, -0.034, 0.022, 0.005,
0.034, -0.02, -0.007, 0.024, -0.013, 0.023, 0.018, 0.001, 0.071,
-0.002, -0.072, -0.03, 0.009, 0.027, 0.014, 0.015, -0.002, -0.005,
-0.05, 0.002, -0.002, 0.002, 0.021, 0.007, 0.017, -0.021, 0.017,
-0.02, 0.007, -0.021, -0.04, 0.017, -0.011, 0, -0.017, 0.024,
0.009, -0.022, -0.026, 0.018, 0.017, -0.008, -0.014, 0.015, -0.008,
0.001, 0, -0.02, -0.014, -0.039, -0.015, -0.018, -0.031, 0.029,
0.025, -0.004, 0.054, -0.017, 0.022, 0.01, -0.013, 0.011, -0.04,
0.007, -0.031, 0.003, -0.027, 0.012, -0.005, -0.021, 0.031, -0.009,
-0.004, 0.009, 0.014, 0.001, -0.026, 0.012, -0.02, 0.002, 0.037,
-0.034, -0.007, -0.024, -0.007, 0.022, 0.015, 0.018, -0.015,
0.03, 0.018, 0.021, 0.005, 0.007, 0.008, -0.011, 0.004, 0.053,
0.01, 0.012, -0.018, 0.051, 0.02, 0.002, 0.013, -0.004, 0.016,
-0.026, -0.019, 0.026, -0.02, 0.004, 0.004, 0.024, 0.007, -0.005,
-0.009, -0.027, 0.002, -0.02, 0.024, 0.015, 0, 0.004, -0.028,
-0.011, 0.007, 0.004, -0.009, -0.006, 0.009, 0.032, 0.01, 0.024,
0.004, -0.009, -0.002, -0.006, -0.009, 0.026, -0.002, -0.016,
-0.006, 0.019, 0.012, 0.007, -0.019, -0.009, -0.024, -0.002,
-0.017, 0.015, 0.004, -0.007, -0.002, 0.004, -0.012, -0.006,
0.006, -0.01, 0.005, 0.017, -0.002, -0.014, -0.024, 0.007, -0.006,
-0.004, -0.001, -0.015, 0.016, 0.001, -0.024, -0.009, 0.014,
-0.018, -0.008, -0.009, 0.012, -0.031, -0.017, -0.002, 0.001,
0.014, -0.008, 0, 0.011, 0.004, 0.001, 0.011, 0.011, 0.016, 0.005,
0.018, 0.001, 0.003, 0.003, -0.004, 0.026, 0.002, 0.028, 0, -0.026,
0.016, 0.025, -0.009, 0.04, -0.015, 0.017, 0.006, -0.024, 0.017,
-0.004, 0.011, -0.002, -0.016, 0.007, 0, -0.005, -0.001, -0.002,
-0.013, -0.024, 0.012, 0.009, 0.046, 0.011, 0.015, -0.018, -0.004,
-0.006, 0.032, 0.005, -0.014, -0.005, -0.004, 0.013, 0, -0.022,
0.009, 0.006, 0.018, 0.007, -0.001, -0.01, 0.006, 0.004, 0, 0.027,
-0.004, -0.007, 0.015, 0.003, 0.005, 0.004, 0, 0.002, -0.021,
0.019, -0.002, -0.011, -0.01, -0.002, 0.018, -0.015, 0.012, -0.024,
0.002, -0.007, 0.007, 0.015, -0.014, 0.002, 0.01, 0.001, 0.013,
0.008, 0.024, 0, 0.004, 0.011, 0.009, -0.008, 0.009, 0.01, -0.01,
-0.001, 0.021, 0.017, 0, -0.025, 0.025, -0.014, -0.008, 0.02,
-0.016, -0.008, 0.012, -0.013, 0.005, -0.015, -0.003, 0.001,
-0.003, -0.01, 0.02, 0.016, 0.002, 0, 0.01, 0.012, 0.025, 0.025,
0.011, -0.005, 0.009, 0.01, 0.002, 0.012, -0.009, -0.013, 0.022,
-0.004, -0.009, 0, -0.002, 0.012, 0.005, 0.008, 0.009, 0.002,
-0.007, 0.028, 0.007, -0.009, 0.013, -0.001, 0.019, -0.006, 0.004,
0.018, 0.008, 0.032, 0.014, 0.003, 0.005, 0.007, 0.013, 0.002,
-0.032, -0.059, 0.014, -0.045, -0.002, 0.019, 0.007, -0.006,
-0.004, -0.03, 0.008, -0.022, 0.012, -0.002, -0.006, 0.008, -0.003,
0.006, 0.011, -0.029, -0.022, 0.012, 0.013, 0.011, 0.02, 0.009,
0.013, 0.008, 0.02, -0.006, 0.031, -0.008, 0.004, -0.013, -0.011,
0.019, 0.004, -0.019, -0.002, 0.004, 0.001, 0.005, 0.021, 0.004,
0.019, 0.011, 0.004, -0.002, -0.021, -0.027, -0.018, 0.019, -0.009,
-0.005, 0.026, 0.007, 0.008, -0.007, -0.005, -0.022, 0.004, 0.012,
0.012, 0.002, 0.003, 0.001, 0.015, 0.045, 0.007, 0.011, -0.005,
0.024, -0.016, -0.006, 0.003, 0.025, 0.013, -0.003, 0, -0.03,
0.015, 0.029, -0.028, -0.004, -0.006, -0.009, -0.039, 0, -0.016,
-0.126, 0.036, -0.012, -0.042, 0.027, -0.023, -0.016, 0.023,
-0.005, 0.048, -0.016, -0.017, 0.016, -0.083, -0.004, -0.032,
0.008, 0.036, 0.027, 0.008, 0.007, -0.005, -0.046, 0.025, -0.036,
-0.02, 0.004, -0.014, 0.011, 0.034, 0.037, -0.01, 0.023, -0.001,
-0.02, -0.001, -0.008, -0.023, -0.002, -0.022, 0.006, 0.025,
-0.018, 0.001, 0.011, 0.004, -0.005, -0.009, 0.033, 0.002, 0.001,
-0.031, 0.005, -0.034, -0.002, -0.042, -0.021, -0.005, 0.013,
-0.055, 0, 0.015, 0.035, -0.028, 0, -0.004, 0.009, 0.044, 0.038,
-0.001, 0.018, -0.022, 0.047, 0.009, -0.002, 0.089, -0.032, -0.017,
-0.004, -0.005, -0.01, -0.014, -0.004, 0.033, -0.023, 0.018,
-0.001, -0.005, -0.015, -0.01, 0.02, 0.009, 0.001, 0.047, 0.007,
-0.014, 0.006, 0.008, 0.005, -0.012, -0.023, -0.018, -0.004,
-0.025, 0.016, 0, -0.032, -0.027, -0.003, 0.007, 0.026, 0.005,
0.023, -0.018, 0.013, -0.013, 0.016, 0.015, -0.018, -0.011, -0.005,
0.02, -0.014, -0.032, 0, -0.018, 0.022, 0.014, -0.002, -0.003,
-0.016, 0.017, 0.014, -0.073, 0.007, -0.035, 0.007, -0.023, 0.014,
-0.047, -0.022, -0.01, 0.062, -0.004, -0.014, -0.017, 0.034,
0.01, -0.023, -0.016, 0.026, 0.002, 0, 0.001, -0.026, -0.022,
0.002, 0.01, 0.02, -0.039, -0.017, 0.003, -0.019, -0.026, 0.011,
-0.016, -0.003, 0.02, -0.006, 0.041, 0.001, -0.012, 0.005, 0.005,
-0.016, 0.023, 0.015, -0.032, -0.014, 0.006, 0.004, 0.006, -0.044,
-0.011, 0.005, 0.015, -0.028)), row.names = c(NA, -800L), class = "data.frame")

df_1<-cbind(df1_1,df1_2,df1_3,df1_4)

}

Code body is as below:
tryCatch({model1<-neuralnet(realized1~ann_t1+ann_t2+ann_t3, data=df_1, hidden=3, act.fct = "logistic",linear.output = TRUE)
                  predict(model1,df_1)},
         error=function(e){
          model1<-neuralnet(realized1~ann_t1+ann_t2+ann_t3, data=df_1, hidden=3, act.fct = "logistic",linear.output = TRUE,threshold = 0.06)
          predict(model1,df_1)}
)

And the prediction dta frame is as below:
{
df2_1<-structure(list(ann_t1 = c(-3.84, -3.842, -3.849, -3.805, -3.951,
-4, -3.898, -3.922, -3.962, -4.002, -3.703, -3.59, -3.875, -3.973,
-4.008, -4.021, -3.678, -3.223, -3.751, -3.434, -3.725, -3.671,
-3.903, -3.737, -3.697, -3.912, -3.595, -3.88, -3.782, -3.942,
-3.707, -3.918, -3.987, -3.671, -3.903, -3.981, -4.009, -4.021,
-4.026, -3.707, -3.915, -3.568, -3.643, -3.894, -3.868, -3.97,
-3.778, -3.939, -3.894, -3.979, -3.931, -3.994, -4.013, -3.947,
-3.676, -3.6, -3.878, -3.843, -3.964, -3.876, -3.663, -3.9, -3.982,
-3.961, -4.003, -3.625, -3.785, -3.868, -3.76, -3.94, -3.78,
-3.942, -3.999, -3.907, -3.965, -3.748, -3.93, -3.755, -3.932,
-3.987, -4.013, -3.913, -3.982, -4.013, -4.02, -3.821, -3.953,
-3.628, -3.83, -3.92, -3.99, -3.788, -3.678, -3.792, -3.732,
-3.924, -3.859, -3.967, -3.937, -3.915)), row.names = c(NA, -100L
), class = "data.frame")

df2_2<-structure(list(ann_t2 = c(0, -19.253, -0.212, -0.015, -0.013,
-0.015, -0.023, -0.005, -0.007, -0.018, -0.016, -0.023, -0.01,
-0.001, -0.034, -0.019, -0.018, -0.001, -0.02, -0.019, -0.046,
-0.002, -0.043, -0.012, -0.039, -0.045, -0.01, -0.01, -0.008,
-0.032, -0.008, -0.005, -0.007, -0.013, -0.017, 0, -0.025, -0.014,
-0.046, -0.061, -0.019, -0.002, -0.066, 0, -0.051, -0.022, -0.025,
-0.033, -0.034, -0.02, -0.017, -0.022, -0.01, -0.027, -0.005,
-0.008, -0.01, -0.018, -0.034, -0.018, -0.003, 0, -0.015, -0.023,
-0.004, -0.03, -0.047, -0.002, -0.023, -0.022, -0.034, -0.003,
-0.005, -0.005, -0.007, -0.012, -0.05, -0.028, -0.008, -0.014,
-0.003, -0.005, -0.01, -0.02, -0.018, -0.02, -0.007, -0.012,
-0.016, -0.001, -0.031, -0.007, -0.016, -0.041, -0.022, -0.054,
-0.023, -0.001, -0.047, -0.012)), row.names = c(NA, -100L), class = "data.frame")

df2_3<-structure(list(ann_t3 = c(0, 16.092, -0.178, 0.012, 0.011, -0.013,
-0.019, -0.004, 0.006, 0.015, -0.014, -0.019, -0.009, 0.001,
-0.028, 0.016, -0.015, -0.001, 0.017, -0.016, -0.038, 0.002,
0.036, 0.01, -0.033, 0.037, -0.008, 0.008, 0.007, -0.027, 0.007,
-0.004, 0.006, 0.011, 0.014, 0, -0.021, -0.011, -0.038, -0.051,
0.016, -0.002, -0.055, 0, 0.043, 0.018, -0.021, 0.028, 0.028,
0.017, 0.015, 0.018, -0.008, -0.022, 0.004, 0.007, 0.009, 0.015,
-0.028, 0.015, -0.002, 0, -0.012, 0.02, -0.003, 0.025, 0.039,
0.002, 0.019, 0.018, -0.029, 0.003, -0.004, 0.004, -0.006, 0.01,
-0.042, 0.024, 0.007, 0.012, 0.003, 0.004, -0.008, -0.017, 0.015,
0.017, 0.006, 0.01, -0.013, -0.001, -0.026, -0.006, -0.014, -0.034,
0.019, -0.045, 0.019, -0.001, -0.039, -0.01)), row.names = c(NA,
                                                            -100L), class = "data.frame")

df_2<-cbind(df2_1,df2_1,df2_3)
}

However I am still getting the error:
> y<-as.data.frame(predict(model1,df_2))
Error in h(simpleError(msg, call)) :
  error in evaluating the argument 'x' in selecting a method for function 'as.data.frame': requires numeric/complex matrix/vector arguments

How can I manage to using default threshold value in general, but when the algorithm fails to diverge how can I switch to 0.05?
Thanks a lot.

A: Note that you actually get a warning (and not error) while applying neuralnet function so you can try this -
tryCatch({
  model1<-neuralnet(realized1~ann_t1+ann_t2+ann_t3, data=df_1, hidden=3, act.fct = "logistic",linear.output = TRUE)
  as.data.frame(predict(model1,df_1))
},
warning =function(e){
  model1<-neuralnet(realized1~ann_t1+ann_t2+ann_t3, data=df_1, hidden=3, act.fct = "logistic",linear.output = TRUE,threshold = 0.06)
  as.data.frame(predict(model1,df_1))
})


text:
Q: Convert full-width digits `0` through `9` to corresponding normal `0` through `9` in C# if (char.IsDigit(e.KeyChar))
{
    if (IsCharFullWidthDigits(e.KeyChar))
    {
        e.KeyChar = Strings.Chr(Strings.Asc(e.KeyChar) + 23680);
    }
}

If user inputs a full-width digit such as 0 to 9, how to auto convert to the corresponding normal 0 or 9? In VB.NET I used Strings.Chr and Strings.Asc, but I don't see the equivalent in C#. How can I do this?

A: Try this:
int diff = (int)'0' - (int)'0';
if (char.IsDigit(e.KeyChar) && IsCharFullWidthDigits(e.KeyChar))
{
        e.KeyChar = (char)(((int)e.KeyChar) - diff);
}


text:
Q: I get POST 500 Internal Server Error on hosting while it works fine on localhost The error is "POST mywebsite.com/login.php 500 (Internal Server Error)"
Here is my header file which I doubt it may cause the problem but I dont know how to solve and why:
<!DOCTYPE html>
<html>
<head>
    <title>Ajanda Uygulaması</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!--BOOTSTRAP CSS-->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
    <!--BOOTSTRAP JAVASCRIPT-->
    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
    <!--W3 CSS-->
    <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<!--CUSTOM CSS-->
    <link rel="stylesheet" type="text/css" href="styles/style.css">
    <!--JQUERY UI-->
    <link rel="stylesheet" href="js/jquery-ui/jquery-ui.min.css">
<script src="js/jquery-ui/external/jquery/jquery.js"></script>
<script src="js/jquery-ui/jquery-ui.min.js"></script>
<!--FONTAWESOME ICONS-->
    <script src="https://kit.fontawesome.com/e3f3a6e99c.js" crossorigin="anonymous"></script>

When the user click on login, the below script is executed:
$(".choice").click(function(){

    var choosen_id=$(this).attr("id");
    $(".choice").removeClass("choosen");
    $("#" + choosen_id).addClass("choosen");

    $("form").hide().promise().then(function() {
        $("#" + choosen_id + "-form").show();
    });

});

$(".login-button").click(function(e){

    e.preventDefault();

    var loginType = $(this).attr("id");
    if(loginType=="manager_login"){

        if($("#manager_password").val()){

            var password = $("#manager_password").val();
            $.ajax({
                type: 'POST',
                url: 'login.php',
                data: { manager_password: password },
                success: function(response) {
                    if(response==1){
                        window.location.replace("manager.php");
                    }else{
                        $("#error").text(response);
                    }

                }
            });
        }else{

            $("#manager_password").css("outline", "2px solid #1f1a87");
        }

    }else if(loginType="inst_login"){
        if($("#inst_password").val()){
            var password = $("#inst_password").val();
            $.ajax({
                type: 'POST',
                url: 'login.php',
                data: { inst_password: password },
                success: function(response) {
                    if(response==1){
                        window.location.replace("instructor.php");
                    }else{
                        $("#error").text(response);
                    }

                }
            });
        }else{
            $("#inst_password").css("outline", "2px solid #1f1a87");
        }
    }

});

And that script posts data to below script.At this point, I get 500 internal server error :
 <?php

include 'includes/class-autoload.inc.php';
if(isset($_POST["manager_password"])){
    $managersObj = new ManagersContr();
    $managersObj->checkManager($_POST["manager_password"]);
}
else if(isset($_POST["inst_password"])){
    $instObj = new InstsContr();
    $instObj->checkInst($_POST["inst_password"]);
}

Also here is the ManagersContr class codes :
    <?php

class ManagersContr extends Managers{

    public function checkManager($password){

        $results = $this->getManager($password);

        if($results){

            foreach ($results as $result) {

                if($results){
                    if(isset($_SESSION)){
                        session_unset();
                    }
                    $_SESSION["manager_full_name"]=$result["manager_full_name"];

                    $_SESSION["manager_id"]=$result["manager_id"];

                    $_SESSION["permission_level"]=$result["permission_level"];
                    echo 1;

                    /*

                    $_SESSION["full_name"]=$result["full_name"];

                    $_SESSION["permission_level"]=$result["permission_level"];

                    $_SESSION["id"]=$result["password"];

                    //Eğitmen sayfasına yönlendir
                    if($_SESSION["permission_level"]==3){
                        header("Location: instructor.php");
                    }

                    //2.Seviye yönetici sayfasına yönlendir
                    else if($_SESSION["permission_level"]==2){
                        header("Location: moderator.php");
                    }

                    //1.Seviye yönetici sayfasına
                    else if($_SESSION["permission_level"]==1){
                        header("Location: admin.php");
                    }

                    else{
                        echo "Bir hata oluştu";
                    }
                    */

                }

            }

        }else{
            echo "Böyle bir yönetici parolası yok";}

        }

    }


text:
Q: How to simplify the heat equation $u_{t}-\Delta u=\sin(u)$by substitution Given $u_{t}-\vartriangle u=\sin(u)$ for $x \in \Omega$ and $t>0$, how would one substitute $u$ with a function $v$ such that this equation reduces to the form $v_{t}-\vartriangle v=0$?

A: I don't believe that this is possible. The reason is that for suitable $\Omega$ (e.g. large intervals) the stationary equation $-\Delta u = \sin x$ has more than solution under zero Dirichlet boundary conditions while the equation $-\Delta v = 0$ has only one solution.
More loosely arguing, if this were possible, there should also be a similar transformation that turns solutions of the scalar ode $u' + \lambda u = \sin u$ into solutions of $v' + \lambda v = 0$, for arbitrary positive $\lambda$. But the zero solution of the first equation is unstable for $\lambda < 1$ while it is always stable for the second one.


text:
Q: Convert items in a list element to a list I am forced to use comma separation in one of my input arguments to separate multiple values. So I end up with
my_string = ['a,b,c']

How can I convert this so that
my_new_string = ['a', 'b', 'c']

A: One possible way:
my_new_string = my_string[0].split(',')

A: Try this one-liner:
my_new_string = [x for y in my_string for x in y.split(',')]

A: Try this one-liner:
print(list(my_string[0].split(',')))


text:
Q: Is there a way of getting a raw psql query of an sequelize method? For example, I have the following case:
const user = await User.findByPk(1);

But I need to know the psql query to get the exact result, how can I get that query from its sequelize form of getting the result, in this case it would be something like "SELECT * FROM USERS WHERE ID = 1"

A: Have you tried using:
await User.findByPk(1, {logging: console.log});

source: https://sequelize.org/api/v6/class/src/model.js~model#static-method-findByPk


text:
Q: Real-life application of min(X,Y) series system Let $X$ and $Y$ be the random variables. What are the real life situations where $\min(X,Y)$ arises?

A: Two elementary examples, involving exponential models. Exponential models are widely used in queueing theory and in reliability theory.
(1) Waiting for service. Your bank has 2 tellers with one waiting line. You are the next person in
line to be served. Tellers have exponentially distributed service rates of
$\lambda_1 = 5$ and $\lambda_2 = 6$ customers per hour. How long on average before you will get to start your service with the first available teller.
Simulated answer: About 0.091 hours or 5.46 minutes.
set.seed(1234)
x = rexp(10^6, 5);  y = rexp(10^6, 6)
w = pmin(x, y)
mean(w)
[1] 0.09097995

Theoretical: Using CDF's it is not difficult to show that $$W = \min(X,Y) \sim \mathsf{Exp}(\text{rate} = 6+5=11).$$ By the no-memory property of exponential models, your exponential waiting time begins when you get to the head of the line, so the average wait is $E(W) = 1/11$ hr.
(2) Useful life of a space probe. A space probe has two computers. The mission will be completely successful only if both computers survive. Given information on the lifetime distributions of the two computers, what is the probability one of the computers will fail before
the end of a planned 5 year mission.
Theoretical answer: Suppose each computer fails (independently) at an exponential rate, each surviving on average 10 years. The distribution of the time to failure of the first computer is exponential with rate 1/5 per year. Then $P(W \le 5) = 1 - e^{-1} = 0.6321.$
Simulated:
set.seed(2019)
x = rexp(10^6, .1);  y = rexp(10^6, .1)
w = pmin(x,y)
mean(w < 5)
[1] 0.631415


text:
Q: L'Hospital's rule help I tried using L'Hospital's rule to find the limit as $x$ tends to $0$ for the following function:
$$f(x) = \frac{(1 - \cos x)^{1.5}}{x - \sin x}$$
I tried differentiating the top and the bottom and I can do it many times but it still gives the denominator with zero meaning I have to differentiate again and again (mainly because a  $(1 - \cos x)^{0.5}$  always manages to find its way into the numerator.)
Is there a better way of solving this limit question?

A: Hint:
$$1-\cos x = 2\sin^2 \frac{x}{2}$$
also:
$$\frac{2\sin \frac{x}{2}}{x - 2\sin \frac{x}{2}\cos \frac{x}{2}} $$
$$\implies \frac{2}{\frac{1}{2} \frac{\frac{x}{2}}{\sin \frac{x}{2}} -{2}\cos \frac{x}{2}} $$
where:
$$\lim_{\alpha \rightarrow 0} \frac{\sin \alpha}{\alpha} = 1$$
here consider: $\alpha = \frac{x}{2}.$
Then, it's ready for replacing $x \rightarrow 0$!

A: It appears that you mean $(1 - \cos x)^{3/2}$ in the numerator. Please reflect this by editing your question.I have edited the question to reflect this.
In this case it can be shown that the limit does not exist as left and right hand limits are different. Doing this requires the use of standard limit $$\lim_{x \to 0}\frac{1 - \cos x}{x^{2}} = \frac{1}{2}\tag{2}$$ and the use of L'Hospital's Rule once.
Thus we have for $x \to 0^{+}$
\begin{align}
L &= \lim_{x \to 0^{+}}\frac{(1 - \cos x)^{3/2}}{x - \sin x}\notag\\
&= \lim_{x \to 0^{+}}\left(\frac{1 - \cos x}{x^{2}}\right)^{3/2}\cdot\frac{x^{3}}{x - \sin x}\notag\\
&= \frac{1}{2\sqrt{2}}\lim_{x \to 0^{+}}\frac{x^{3}}{x - \sin x}\notag\\
&= \frac{1}{2\sqrt{2}}\lim_{x \to 0^{+}}\frac{3x^{2}}{1 - \cos x}\text{ (via L'Hospital's Rule)}\notag\\
&= \frac{3}{\sqrt{2}}\notag
\end{align}
The limit as $x \to 0^{-}$ is $-3/\sqrt{2}$ and this can be shown by putting $x = -t$ and then using the above limit evaluation.

A: Note that a two sided limit does not exist, so let's look at the limit approaching from the positive side. After one time Hospital, we get $\frac{1.5sinx\sqrt{1-cos}}{1-cosx}$.Now it goes very easy: Divide out $\sqrt{1-cosx}$ and then multiply top and bottom by $\sqrt{1+cosx}$ and after applying the Pythagorean theorem in the denominator, the expression becomes $\frac{1.5sinx\sqrt{1+cosx}}{sinx}$. So the $sinx$ term cancels and you can take the limit $\frac{3\sqrt{2}}{2}$. The reason why the limit only exists one sided is because technically the squareroot of $sin^2x$ is $|sinx|$. Hint: Make a graph. I did just that...When you approach $0$ from the negative side, you get $-\frac{3\sqrt{2}}{2}$. Do you see why?

A: Note that $1-\cos x\geq 0$ and is an even function, so $(1-\cos x)^{3/2}$ is also even. On the other hand, $x-\sin x$ is odd. When you divide an even and odd function, you get an odd function. Due to the symmetry of odd functions, either $\lim_{x\rightarrow 0} f(x) = 0$ or the limit doesn't exist. You can see that the limit on one side is $\frac{3}{\sqrt{2}}$ (see imranfat's answer), so the limit must not exist.


text:
Q: Check MySQL status I am experiencing a slow connection on a website that I am developing and MySQL errors from time to time.
How do I check MySQL server status? Is there something like ping from cmdprompt in Win?
Thanks

A: Just create a php file for connection to any database and program for returning the connection status like
<?php
$conn = mysqli_connect('host', 'user', 'password', 'database');
if ($conn){
echo "Connection is alive";
}
else{
echo "failed to connect server: ".mysql_error();
}
mysqli_close($conn);
?>

upload as to test.php and open in browser // this is the easiest way


text:
Q: contain operation on hashmap dependant on size of hashmap? As per my understanding on hashmap
Question 1:-
For Hashmap returning the unique hashcode for each key

time to determine whether a object is contained in hashmap is constant
  and does not depend on size of hashmap

Question 2:-
For Hashmap returning the same hashcode for each key but retrning false for equals method

time to determine whether a object is contained in hashmap is dependant on size of hashmap

Is that true ?

A: It is generally considered that hashmap look ups only take O(1) time. This is the average time for look up. But in the worst case scenario it can be O(n) as well. For an example if a linked list is used in the implementation of hashmap this scenario can occur. But it can be avoided if self-balancing trees are used which reduces the worst case scenario to O(log n) time.

A: If we have an appropriately written hash function, then yes order of retrieval comes out to be of O(1).
Think of it this way, if your hash function is written appropriately, so that elements are distributed across buckets then the time to search an element would be proportional to the size of bucket. Now, if you have a constant size bucket and number of buckets or memory size is not a constraint, then you will be able to retrieve the element in constant time.
Regarding your second question: Yes if you have a hash function returning same hashcode, then the order of retrieval of element will be proportional to the size of hashmap also called O(n)


text:
Q: AWS ALB with GRPC I'm trying to run a netty server with GRPC API on AWS ECS (on Fargate) behind an application load balancer for an Android GRPC client to connect to.
Calls are forwarded but the server logs show an error like
io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2Exception: HTTP/2 client preface string missing or corrupt. Hex dump for received bytes: 1603010102010000fe03036a5663244616ee784100b9d61c

I've read here that such an error is related to the client and server not both using SSL, which arguably is true in my case.
The server itself is not configured to use SSL (I wouldn't know which certificate to deploy it with).
The ALB provides an ACM public certificate to the client and should do SSL offloading I would expect. However, the fact that I cannot configure the load balancing target group with another protocol than HTTPS when protocol version is GRPC indicates otherwise.
Can anyone clarify this to me or have a working example?
This is the relevant ALB config of my cfn template:
  ApplicationLoadBalancer:
    Type: "AWS::ElasticLoadBalancingV2::LoadBalancer"
    Properties:
      Name: my-alb
      Scheme: "internet-facing"
      Type: "application"
      Subnets:
        - !Ref public-sn-1
        - !Ref public-sn-2
      SecurityGroups:
        - !Ref ALBSecurityGroup
      IpAddressType: "ipv4"

  HubListener:
    Type: "AWS::ElasticLoadBalancingV2::Listener"
    Properties:
      LoadBalancerArn: !Ref ApplicationLoadBalancer
      Port: 50051
      Protocol: HTTPS
      SslPolicy: "ELBSecurityPolicy-2016-08"
      Certificates:
        - CertificateArn: !Ref AlbCertificateArn
      DefaultActions:
        - Order: 1
          TargetGroupArn: !Ref HubTargetGroup
          Type: "forward"

  HubTargetGroup:
    Type: "AWS::ElasticLoadBalancingV2::TargetGroup"
    Properties:
      Port: 50051
      Protocol: HTTPS
      ProtocolVersion: GRPC
      HealthCheckEnabled: true
      HealthCheckPath: "/grpc.health.v1.Health/Check"
      HealthCheckPort: "traffic-port"
      HealthCheckProtocol: HTTP
      TargetType: ip
      Matcher:
        GrpcCode: 0
      VpcId: !Ref VpcId

A: Turns out the target group just needs to be switched to protocol HTTP for the SSL offloading to work.
I had initially assumed that this would not be permitted, since a listener forwarding to a GRPC target group must use HTTPS as protocol but that constraint does not apply to the target group itself.


text:
Q: get_meta_tags - if else I have:
$tags = get_meta_tags("https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");

<?php echo $tags['filter-title'] ?>

How I can add if else, If the meta tag 'filter-title' doesn't exist and I only want to display the text "Filtering" instead?

A: @wetmarble's answer can be shortened to this:

<?= $tags['filter-title'] ?? 'no filter title found'; ?>

A: to check for the existence of an array key use array_key_exists( 'keyName', $array ).
Like this:

<?php echo ( array_key_exists( 'filter-title', $tags ) ) ? $tags['filter-title'] : 'no filter title found'); ?>

You can substitute whatever you like in place of 'no filter title found'.


text:
Q: How to modify telerik pageview tabs Using telerik winform pageview control how can i set the tab to be angled like the google chrome tabs.They are vertical by default. Is it an image property i need to set or a property?. I have tried the telerik forum but noone seems to have asked a similar question.
Image showing sample below

A: Here is how to achieve the desired effect:
        TabVsShape shape = new TabVsShape();
        shape.RightToLeft = true;
        foreach (RadPageViewPage p in radPageView1.Pages)
        {
            p.Item.Shape = shape;
            p.Item.MinSize = new Size(65, 0); //if you need to increase the page item size
        }


text:
Q: What is nature of root of the polynomial $x^5 -10x + 20?$ Problem
The polynomial $x^5 -10x + 20$ has
a. both positive and negative real roots
b. only positive real roots
c. only negative real roots
d. at least two complex roots
My Approach

*

*Tried to solve this using Descartes Rule of Sign Change and its correspondence to real roots.

*In this case, for $f(x)$ the change of signs is $2$ so positive real roots is $\leq2$ and for $f(-x)$ the change of signs is $1$ so negative real roots $\leq1$ (or one negative real root).

*Hence, the complex roots$\geq2$. So option d is correct.

Though the answer key listed option c as Correct Answer.
Could someone help me out where I am going wrong or probably some other approach to solve this question?


text:
Q: ASP.NET Core 3 MVC Routing parameters not working Feel like I'm doing something silly here, I'm playing around with ASP.NET Core 3 (MVC), doing some tutorials, getting familiar - and I'm having some issues specially with routing.
I have the below code in my Startup.cs attempting to setup a route of Main/Home/{team}.
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddControllersWithViews(mvc => mvc.EnableEndpointRouting = true)
        .AddNewtonsoftJson(options =>
                        options.SerializerSettings.ContractResolver = new DefaultContractResolver()
        )
        .AddRazorRuntimeCompilation();
        services.AddKendo();
    }

    // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseBrowserLink();
            app.UseDeveloperExceptionPage();
        }
        else
        {
            app.UseExceptionHandler("/Error");
        }
        app.UseStaticFiles();

        app.UseRouting();

        app.UseAuthorization();

        app.UseEndpoints(endpoints =>
        {
            endpoints.MapControllers();

            endpoints.MapControllerRoute(
                name: "team",
                pattern: "Main/Home/{team}");

            //endpoints.MapControllerRoute(
            //    name: "default",
            //    pattern: "{controller=Main}/{action=Home}/{id?}");
        });
    }

On my Main controller. The action Home has a single parameter of team
public class MainController : Controller
{
    private readonly ILogger<MainController> _logger;

    public MainController(ILogger<MainController> logger)
    {
        _logger = logger;
    }

    public IActionResult Home(string team)
    {

        TeamModel model = new TeamModel(team);
        return View(model);
    }
}

No matter what I do, I cannot get the team parameter to come through correctly as a route value.
The below configuration gives me a 404 every time, no matter the URL (/Main/Home/MyTeam or /Main/Home?team=MyTeam).
Other scenarios either give me the above issue, or the team parameter comes through with a null value..
Any help would be great - I think am probably doing something a stupid!

A: The way you add your endpoint do not have the controller and action that will be called for this route.
You can do something like this:
app.UseEndpoints(endpoints =>
{
    endpoints.MapControllers();

    endpoints.MapControllerRoute(
        name: "team",
        pattern: "Main/Home/{team?}",
        defaults: new { controller = "Main", action = "Home" });

        //endpoints.MapControllerRoute(
        //    name: "default",
        //    pattern: "{controller=Main}/{action=Home}/{id?}");
    });


text:
Q: CMakeLists.txt with two subprojects with own CMakeLists.txt needs to create only one .so library which contains all I have three shared libraries: lib_1.so, lib_2.so and lib_3.so.
How do you create only one library with the name lib_all.so which are going to contain all three libraries?
I am trying to compile some source files which includes files from two subprojects/subdirectories and every subproject(2) have CMakeLists.txt but I want to create just one .so library, not three.
added
I want that medium.so contains also libnoise.so and noiseutils.so, this is my CMakeLists.txt
project (map)
cmake_minimum_required(VERSION 2.8)

find_package(PythonLibs)
include_directories (${PYTHON_INCLUDE_DIRS})

find_package(Boost 1.45.0 COMPONENTS python)
include_directories (${Boost_INCLUDE_DIRS})
set (LIBNOISE_PATH ${MY_SOURCE_DIR}/libnoise)
set (LIBNOISEUTILS_PATH ${MY_SOURCE_DIR}/noiseutils)

add_subdirectory(libnoise)
add_subdirectory(noiseutils)

add_library (
    map SHARED
    Wrapped.cpp
)

target_link_libraries (
    map
    boost_python
    ${PYTHON_LIBRARIES}
    ${Boost_LIBRARIES}
)

linoise and noiseutils are sudirectories with own CMakeLists.txt

A: You cannot merge multiple shared libraries together into a single shared library. You also cannot merge multiple static libraries into a single static library.
What you can do however is merging multiple static libraries into a single shared library.
This is more a limitation of the underlying compiler and not one of CMake. Think of static libraries as you would of object files and of shared libraries as you would of executables: You can link multiple object files into a single executable, but the other permutations don't really work that well.
So in your case, use add_library([...] STATIC) for the noise and noiseutils libraries and add_library([...] SHARED) for the medium library. Then just add a target_link_libraries(medium noise noiseutils) to finish the job.


text:
Q: How to define route parameters in Router.js depends on Urls in Nuxt Js? I use Nuxt composition api in my project. I have 1 detail page and 2 different url comes from my API. I don't want to create different detail pages for every url. I use extendRoutes in my project and I need to solve this issue.
urls
/sport/asian-football-3581.  -> sub category + news title
/video/world/mama-dog-rubble-in-india-3581246. -> category + subcategory + news title

router.js
 extendRoutes(routes, resolve) {
    routes.push(

   {
        name: 'detail',
        path: '/:subCategory/:title(.*)-:id([0-9]+)',
        component: resolve('pages/detail.vue'),
      },

 path: '/:subCategory/:title(.*)-:id([0-9]+)',
 path: '/:category/:subCategory/:title(.*)-:id([0-9]+)',

Paths can come with these two types. I want to route them to same detail page.
And I need to catch subCategory, title, id and if it has category params also. In my solution, if second path comes, I cant catch parameters true

A: I found answer
        path: '/:category/:subCategory?/:title(.*)-:id([0-9]+)',

this solves my problem


text:
Q: NSNumber from NSDate I'm attempting to get around a date validation that refuses to take anything earlier than tomorrow.
So far I have this:
NSDate *dateY = [NSDate dateWithTimeIntervalSinceNow:-86400];
                // Negative one day, in seconds (-60*60*24)
NSLog(@"%@", [NSDate date]);
    // "yyyy-MM-dd HH:mm:ss Z", accurate assuming Z = +0000
NSLog(@"%@", dateY);
    // "yyyy-MM-dd HH:mm:ss Z", same accuracy (minus one day)

That's great, but dateY is not an NSNumber. I need an NSNumber for the comparison, but I can't find anything that works. (I don't even know how an NSNumber can be 2011-04-14 13:22:29 +0000, anyway...)
I can use NSDateFormatter to convert an NSDate into an NSString, so if it would be possible to take that string and convert it to the required NSNumber (as opposed to directly converting the NSDate to an NSNumber, which I can't seem to find help with either), that would be fine.

- (BOOL)validateDueDate:(id *)ioValue error:(NSError **)outError {
    NSDate *dateY = [NSDate dateWithTimeIntervalSinceNow:-86400];
    NSNumber *tis1970 = [NSNumber numberWithDouble:[dateY timeIntervalSince1970]];
    NSLog(@"NSNumber From Date : %@", tis1970);
    NSLog(@"Date From NSNumber : %@", [NSDate dateWithTimeIntervalSince1970:[tis1970 doubleValue]]);

    // Due dates in the past are not valid
    // Enforced that a due date has to be >= today's date
    if ([*ioValue compare:[NSDate date]] == NSOrderedAscending) {
        if (outError != NULL) {
            NSString *errorStr = [[[NSString alloc] initWithString:@"Due date must be today or later."] autorelease];
            NSDictionary *userInfoDictionary = [NSDictionary dictionaryWithObject:errorStr forKey:@"ErrorString"];
            NSError *error = [[[NSError alloc]
                                initWithDomain:TASKS_ERROR_DOMAIN
                                code:DUEDATE_VALIDATION_ERROR_CODE
                                userInfo:userInfoDictionary] autorelease];
            *outError = error;
            }
        return NO;
    } else {
        return YES;
    }
}

Right now, the user is not allowed to choose a date before tomorrow. errorStr lies. Before today makes more sense than before tomorrow as a rule for refusing to save the date, so I've been fighting with this thing to let me use yesterday in place of today, rather than looking any deeper.
Edit: Using NSOrderedSame allows any date to be selected without an error. That won't do.

A: You can convert an NSDate to an NSNumber like this:
NSDate *aDate = [NSDate date];
NSNumber *secondsSinceRefDate = [NSNumber numberWithDouble:[aDate timeIntervalSinceReferenceDate]];

and convert back like:
aDate = [NSDate dateWithTimeIntervalSinceReferenceDate:[NSNumber doubleValue]];

A: All that is needed to get a NSNumber is
NSDate *dateY = [NSDate dateWithTimeIntervalSinceNow:-86400];
NSNumber *tis1970 = [NSNumber numberWithDouble:[dateY timeIntervalSince1970]];
NSLog(@"NSNumber From Date : %@", tis1970);
NSLog(@"Date From NSNumber : %@", [NSDate dateWithTimeIntervalSince1970:[tis1970 doubleValue]]);

A: You should never use 86400 to calculate date differences, because not all days have 86,400 seconds in them.  Use NSDateComponents instead:
- (BOOL)validateDueDate:(NSDate *)dueDate error:(NSError *)error {
  NSDate *today = [NSDate date];
  NSCalendar *calendar = [NSCalendar currentCalendar];
  NSDateComponents *components = [calendar components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit) fromDate:today];
  //adjust the components to tomorrow at the first instant of the day
  [components setDay:[components day] + 1];
  [components setHour:0];
  [components setMinute:0];
  [components setSecond:0];
  NSDate *tomorrow = [calendar dateFromComponents:components];

  NSDate *earlierDate = [dueDate earlierDate:tomorrow];
  if ([earlierDate isEqualToDate:dueDate]) {
    //the dueDate is before tomorrow
    if (error != nil) {
      NSString *errorStr = [[[NSString alloc] initWithString:@"Due date must be today or later."] autorelease];
      NSDictionary *userInfoDictionary = [NSDictionary dictionaryWithObject:errorStr forKey:NSLocalizedDescriptionKey];
      *error = [[[NSError alloc] initWithDomain:TASKS_ERROR_DOMAIN code:DUEDATE_VALIDATION_ERROR_CODE userInfo:userInfoDictionary] autorelease];
    }
    return NO;
  }
  return YES;
}

WARNING: code typed in a browser. Caveat Implementor


text:
Q: How to retrieve data from other Excel using VBA and SQL? I have a problem with my code. I tried retrieving data from other Excel file. My code works but I received full data in one cell (A1). I'm sorry but I'm just beginner, believe that's the problem related to output, but I'm not find out why:
Sub RefreshData()

'Refresh data

Dim CreateNew As Object
Dim RunSELECT As Object
Dim Data As String
Dim SQL As String

FolderPath = ActiveWorkbook.path

path = Left(FolderPath, InStrRev(FolderPath, "\") - 1)

Set CreateNew = CreateObject("ADODB.Connection")
With CreateNew
    .Provider = "Microsoft.ACE.OLEDB.12.0"
    .ConnectionString = "Data Source=" & path & "\Task1.xlsm; Extended Properties=Excel 12.0 Xml;HDR=YES;IMEX=1;CorruptLoad=xlRepairFile"
    .Open
End With

'Run SQL

SQL = "SELECT * FROM [tw$]"
Set RunSELECT = CreateNew.Execute(SQL)
Do
   output = output & RunSELECT(0) & ";" & RunSELECT(1) & ";" & RunSELECT(2) & vbNewLine
   Debug.Print RunSELECT(0); ";" & RunSELECT(1) & ";" & RunSELECT(2)
   RunSELECT.Movenext
Loop Until RunSELECT.EOF

ThisWorkbook.Worksheets("Dic").Range("A1").Value = output

    RunSELECT.Close
    CreateNew.Close
    Set CreateNew = Nothing
    Set RunSELECT = Nothing

End Sub

A: No need to wrap recordset values wtih semicolon delimiters using a Do loop. Simply use Range.CopyFromRecordset:
SQL = "SELECT * FROM [tw$]"
Set RunSELECT = CreateNew.Execute(SQL)

ThisWorkbook.Worksheets("Dic").Range("A1").CopyFromRecordset RunSELECT

RunSELECT.Close
CreateNew.Close

Set CreateNew = Nothing
Set RunSELECT = Nothing

A: ADOdb to Retrieve Data From Another Workbook (Without Opening It)

*

*While playing around with Parfait's solution combined with a few posts, I came up with the function copySheetADOdb.

*Adjust the constants under Source and Target in testCopySheetADOdb to test it.

The Code
Option Explicit

Sub testCopySheetADOdb()

    ' Initialize error handling.
    Const ProcName = "testCopySheetADOdb"
    On Error GoTo clearError ' Turn on error trapping.

    ' Source
    Const Path As String = "F:\Test"
    Const FileName As String = "Test.xlsx"
    ' Sheet Name ('SheetName') is case-insensitive i.e. 'A = a'.
    Const SheetName As String = "Sheet1"

    ' Target
    Const tgtName As String = "Sheet1"
    Const tgtCell As String = "A1"
    Dim wb As Workbook: Set wb = ThisWorkbook

    ' Define FilePath.
    Dim FilePath As String
    FilePath = Path & Application.PathSeparator & FileName

    ' Define Target Range.
    Dim rng As Range
    Set rng = wb.Worksheets(tgtName).Range(tgtCell)

    ' Test Result.
    Dim Result As Boolean
    Result = copySheetADODb(rng, FilePath, SheetName)

    ' Of course you can do all the above in one line:
    'Result = copySheetADODB(Thisworkbook.Worksheets("Sheet1").Range("A1"), _
                            "C:\Test\Test.xlsx", "Sheet1")

    ' Inform user.
    If Result Then
        MsgBox "Worksheet successfully copied.", vbInformation, "Success"
    Else
        MsgBox "Worksheet not copied.", vbExclamation, "Failure"
    End If

ProcExit:
    Exit Sub

clearError:
    Debug.Print "'" & ProcName & "':" & vbLf & "    " & "Run-time error '" _
              & Err.Number & "':" & vbLf & "        " & Err.Description
    On Error GoTo 0 ' Turn off error trapping.
    GoTo ProcExit

End Sub

Function copySheetADOdb(TargetCellRange As Range, _
                        ByVal SourceFilePath As String, _
                        Optional ByVal SourceSheetName As String = "Sheet1") _
         As Boolean

    ' Initialize error handling.
    Const ProcName = "copySheetADOdb"
    On Error GoTo clearError ' Turn on error trapping.

    ' Test Target Cell Range ('TargetCellRange').
    If TargetCellRange Is Nothing Then
        GoTo NoTargetCellRange
    End If
    If TargetCellRange.Rows.Count > 1 Or TargetCellRange.Columns.Count > 1 Then
        GoTo OneCellOnly
    End If
'
    ' Define SQL Generic String.
    Const sqlGeneric As String = "SELECT * FROM [SheetName$]"

    Dim conn As Object
    Set conn = CreateObject("ADODB.Connection")
    Dim strErr As String
    With conn
        .Provider = "Microsoft.ACE.OLEDB.12.0"
        ' If you need the headers, HDR=NO means there are no headers
        ' (not: do not retrieve headers) so the complete data will be retrieved.
        .ConnectionString = "Data Source='" _
                          & SourceFilePath _
                          & "';" _
                          & "Extended Properties='" _
                          & "Excel 12.0 Xml;" _
                          & "HDR=NO;" _
                          & "IMEX=1;" _
                          & "CorruptLoad=xlRepairFile" _
                          & "';"
        On Error GoTo connOpenError
        .Open
            On Error GoTo clearError
            ' Run SQL.
            Dim SQL As String
            ' Replace 'SheetName' in SQL Generic String
            ' with the actual sheet name ('SourceSheetName').
            SQL = Replace(sqlGeneric, "SheetName", SourceSheetName)
            Dim rs As Object
            On Error GoTo connExecuteError
            Set rs = .Execute(SQL)
            On Error GoTo clearError
            If Not TargetCellRange Is Nothing Then
                ' Copy sheet.
                If Not rs.EOF Then
                    TargetCellRange.CopyFromRecordset rs
                    ' Write result.
                    copySheetADOdb = True
                Else
                    GoTo NoRecords
                End If
            End If
NoRecordsExit:
            rs.Close
connExecuteExit:
        .Close
    End With

ProcExit:
    Set rs = Nothing

connOpenExit:
    Set conn = Nothing

    Exit Function

NoTargetCellRange:
    Debug.Print "'" & ProcName & "': " & "No Target Cell Range ('Nothing')."
    GoTo ProcExit

OneCellOnly:
    Debug.Print "'" & ProcName & "': " _
              & "Target Cell Range has to be one cell range only."
    GoTo ProcExit

NoRecords:
    Debug.Print "'" & ProcName & "': No records found."
    GoTo NoRecordsExit

connOpenError:
    If Err.Number = "-2147467259" Then ' "-2147467259 (80004005)"
        strErr = "'" & SourceFilePath & "' is not a valid path"
        If Left(Err.Description, Len(strErr)) = strErr Then
            Debug.Print "'" & ProcName & "': " & strErr & "..."
            On Error GoTo 0 ' Turn off error trapping.
            GoTo connOpenExit
        End If
    Else
        GoTo clearError
    End If

connExecuteError:
    If Err.Number = "-2147467259" Then ' "-2147467259 (80004005)"
        strErr = "'" & SourceSheetName & "' is not a valid name"
        If Left(Err.Description, Len(strErr)) = strErr Then
            Debug.Print "'" & ProcName & "': " & strErr & "..."
            On Error GoTo 0 ' Turn off error trapping.
            GoTo connExecuteExit
        End If
    Else
        GoTo clearError
    End If

clearError:
    Debug.Print "'" & ProcName & "':" & vbLf & "    " & "Run-time error '" _
              & Err.Number & "':" & vbLf & "        " & Err.Description
    On Error GoTo 0 ' Turn off error trapping.
    GoTo ProcExit

End Function

A: You have problem in this code:
ThisWorkbook.Worksheets("Dic").Range("A1").Value = output

you are yourself asking to save the output to A1 Cell.
I would suggest you use for or while loop to enter the data in cells according to your need.


text:
Q: How to swipe and delete element? I have tested multiple libraries swipegestures or using itemtouchhelper I also tried use SwipeReavealLayoutl...
If I implement it like in every guide I have got wrong adapter position and it is not deleted.
My implementation, viewmodel:
    fun onItemSwiped(id: Int) {
            ItemTouchHelper(object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT) {
                override fun onMove(
                    v: RecyclerView,
                    h: RecyclerView.ViewHolder,
                    t: RecyclerView.ViewHolder
                ) = false

                override fun onSwiped(h: RecyclerView.ViewHolder, dir: Int) {
                    deleteItem(id)
                    ItemTouchHelper.ViewDropHandler { view, target, x, y -> }
                }
            })

    }

adapter
   inner class NotificationItemViewHolder(
        private val layout: LayoutListItemNotificationBinding,
    ) :
        RecyclerView.ViewHolder(layout.root) {
        fun bind(item: NotificationItemsResponse.NotificationItemData) = with(layout.vContent) {

// these two works
            btnClose.setOnClickListener { onItemDeleteClicked(item.id) }
            root.setOnClickListener {
                onItemRootClicked(item.leadId)
            }

// doesnt work
            onItemSwiped(item.id)

fragment
    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        notificationAdapter = NotificationAdapter(vm::deleteItem, vm::onItemClicked, vm::onItemSwiped)

If I try to manage id from fragment like:
        var pos = viewHolder.absoluteAdapterPosition

I get weird position -1 or 2131296679
i.e my previous implementation from fragment when I could swipe but it wasn't deleted and swiped element came back to previous position.
    private fun onSwipeDelete() =
        ItemTouchHelper(object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT) {
            override fun onMove(v: RecyclerView, h: RecyclerView.ViewHolder, t: RecyclerView.ViewHolder) = false
            override fun onSwiped(h: RecyclerView.ViewHolder, dir: Int) {

                vm.onItemSwiped(h.absoluteAdapterPosition)
                notificationAdapter.deleteItem(h.absoluteAdapterPosition)

                ItemTouchHelper.ViewDropHandler { view, target, x, y ->  }
            notificationAdapter.notifyItemChanged(h.absoluteAdapterPosition)}
        }).attachToRecyclerView(layout.rvNotificationItems)

How should I handle this in that case?
When I have direct element I can use in adapter I can easily handle it.. How to react for swiping in adapter?
Now it doesn't even swipe..
greetings
EDIT1:
class NotificationAdapter(
    private val onItemDeleteClicked: (Int) -> Unit,
    private val onItemRootClicked: (Int) -> Unit,
    private val onItemSwiped: (Int) -> Unit
) :
    RecyclerView.Adapter<NotificationAdapter.NotificationItemViewHolder>() {
    var items = emptyList<NotificationItemsResponse.NotificationItemData>()
  override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NotificationItemViewHolder {
        val inflater = LayoutInflater.from(parent.context)
        return LayoutListItemNotificationBinding.inflate(inflater, parent, false)
            .let(::NotificationItemViewHolder)
        setListData(items)

        val mIth = ItemTouchHelper(
            object : ItemTouchHelper.SimpleCallback(
                0, ItemTouchHelper.LEFT
            ) {
                override fun onMove(
                    recyclerView: RecyclerView,
                    viewHolder: ViewHolder, target: ViewHolder
                ): Boolean {
                   return false // true if moved, false otherwise
                }

                override fun onSwiped(viewHolder: ViewHolder, direction: Int) {
                    deleteItem(viewHolder.absoluteAdapterPosition)
                }
            })
    }

   inner class NotificationItemViewHolder(
        private val layout: LayoutListItemNotificationBinding,
    ) :
        RecyclerView.ViewHolder(layout.root) {
        fun bind(item: NotificationItemsResponse.NotificationItemData) = with(layout.vContent) {
           btnClose.setOnClickListener { onItemDeleteClicked(item.id) }
            root.setOnClickListener {
               onItemRootClicked(item.leadId)
            }

            ItemTouchHelper(
                object : ItemTouchHelper.SimpleCallback(
                    0, ItemTouchHelper.LEFT
                ) {
                    override fun onMove(
                        recyclerView: RecyclerView,
                        viewHolder: ViewHolder, target: ViewHolder
                    ): Boolean {

                       return false // true if moved, false otherwise
                    }

                    override fun onSwiped(viewHolder: ViewHolder, direction: Int) {
                        deleteItem(item.id)
                    }
                })

   override fun getItemCount(): Int = items.size

    fun setListData(list: List<NotificationItemsResponse.NotificationItemData>) {
        this.items = list

        notifyDataSetChanged()
    }

    // nie uzywane
    fun deleteItem(id: Int) {
        onItemDeleteClicked(id)
        notifyItemRemoved(id)
        notifyDataSetChanged()

    }

    fun onSwipe(id: Int) =
        ItemTouchHelper(object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT) {
            override fun onMove(
                v: RecyclerView,
                h: RecyclerView.ViewHolder,
                t: RecyclerView.ViewHolder
            ) = false

            override fun onSwiped(h: RecyclerView.ViewHolder, dir: Int) {
                deleteItem(id)
                ItemTouchHelper.ViewDropHandler { view, target, x, y -> }
            }
        })
}}

EDIT2:
OK from my understanding:
I use anonymous function in adapter:
private val onItemDeleteClicked: (Int) -> Unit,

then I can call it from viewmodel:
fun getActualState() {
        viewModelScope.launch {
            getNotificationListItemDetailsUseCase.build(Unit).collect {
                notificationData.value = it
                Log.d("test2", "${notificationData.value}")

            }
        }
    }

    fun deleteItem(id: Int) {
        viewModelScope.launch {
            deleteNotificationListItemDetailsUseCase.build(id)
            getActualState()
        }

then in fragment I init my adapter
   private lateinit var notificationAdapter: NotificationAdapter

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        notificationAdapter = NotificationAdapter(vm::deleteItem, vm::onItemClicked, vm::onItemSwiped)

A: you are calling the following to delete item from the adapter
notificationAdapter.deleteItem(h.absoluteAdapterPosition)
and the following to notify the adapter :
notificationAdapter.notifyItemChanged(0)
instead you should notify the removal of item
notificationAdapter.notifyItemRemoved(h.absoluteAdapterPosition)
[EDIT 01] : pseudo approach to remove item from the adapter [java]
...
private List<Object> data = new ArrayList()

public void removeItem(int index){
    data.remove(index);
    notifyItemRemoved(index);
}
...

you should do something like above
[EDIT 02] : possible bugs in your code
look at this snippet from your code
fun deleteItem(id: Int) {
    onItemDeleteClicked(id)
    notifyItemRemoved(id)
    notifyDataSetChanged()
}

if you have called notifyItemRemoved then there is no need to call notifyDataSetChanged
moreover there is no line in whole code which actually removes the item from the items object.
modify your code to the following
fun deleteItem(id: Int) {
    items.remove(id)
    notifyItemRemoved(id)
}


text:
Q: Using Query String in a Datasource Very simple question and yet I can't seem to find the right answer. How do I pass the value of a textbox into a query string in a sqldatasource? Below is the markup of the sqldatasource that I have so far.
<asp:SqlDataSource ID="sqldsGPATLotFailures" runat="server"
            ConnectionString="<%$ ConnectionStrings:CamRpt %>"
            ProviderName="<%$ ConnectionStrings:CamRpt.ProviderName %>" SelectCommand="SELECT
  s.insertionnumber
  , s.insertionreason
  , s.containername
  , s.wafernumber
  , s.OPCODE
  , s.trackinqty
  , s.totalgoodqty
  , s.totalrejectsqty
  , s.trackoutqty
  , ROUND(s.yield, 4) yield
  , ROUND(s.uppersyl, 4) uppersyl
  , ROUND(s.lowersyl, 4) lowersyl
  , s.gpatrejectsqty
  , ROUND(s.gpatyield, 4) gpatyield
  , s.trackouttime
FROM wsigssummary s
WHERE s.containername LIKE :lotID || '%'
ORDER BY s.trackouttime">
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="%" Name="lotID"
                    QueryStringField="lotID" />
            </SelectParameters>
        </asp:SqlDataSource>

Do I need to do code behind for it to work or anything? By the way, I am using ASP.Net, Oracle 11g and C# is my code behind. Thank you cool people.

A: There is a special type of parameter in SqlDataSource for values from controls - ControlParameter:
<SelectParameters>
    <asp:QueryStringParameter DefaultValue="%" Name="lotID"
        QueryStringField="lotID" />
    <asp:ControlParameter Name="ParameterName" ControlID="TextBox1"
                          PropertyName="Text"/>
</SelectParameters>


text:
Q: multiple line plot in R from multiple timeseries I have a series of timings.
I'm trying to plot them as individual lines, I use the %>% group_by(runs), but I get the error: geom_path: Each group consists of only one observation. Do you need to adjust the group aesthetic? where have I gone wrong?
All the necessary code and data is included in the below code snippet.
library(lubridate)
library(dplyr)
runs <- c("10000", "20000","50000","75000","100000","200000","300000","400000","500000","600000","700000","800000","900000","1000000")
k10 <- c("0:00:01","0:00:03","0:00:11","0:00:16","0:00:22","0:00:48","0:01:12","0:01:38","0:02:04","0:02:29","0:02:59","0:03:23","0:03:49","0:04:15")
k20 <- c("0:00:03","0:00:06","0:00:23","0:00:33","0:00:44","0:01:37","0:02:27","0:03:18","0:04:10","0:05:03","0:05:57","0:06:45","0:07:38","0:08:33")
k50 <- c("0:00:07","0:00:14","0:00:56","0:01:23","0:01:49","0:04:04","0:06:08","0:08:19","0:10:27","0:12:37","0:14:55","0:16:53","0:19:04","0:21:20")
k75 <- c("0:00:11","0:00:21","0:01:24","0:02:05","0:02:44","0:06:05","0:09:12","0:12:22","0:15:38","0:18:56","0:22:22","0:25:21","0:28:40","0:32:04")
k100 <- c("0:00:15","0:00:28","0:01:53","0:02:45","0:03:39","0:08:07","0:12:17","0:16:29","0:20:43","0:24:56","0:29:27","0:33:20","0:37:52","0:42:32")
k200 <- c("0:00:29","0:00:56","0:03:47","0:05:31","0:07:13","0:16:08","0:24:35","0:33:02","0:41:47","0:51:42","1:01:11","1:08:21","1:17:44","1:26:20")
k300 <- c("0:00:45","0:01:26","0:05:46","0:08:26","0:11:06","0:25:02","0:37:42","0:50:29","1:03:25","1:16:12","1:30:22","1:42:37","1:56:04","2:09:45")
k400 <- c("0:00:59","0:01:53","0:07:36","0:11:12","0:14:46","0:33:13","0:50:01","1:07:44","1:25:21","1:42:27","2:02:14","2:16:48","2:34:49","2:51:18")
k500 <- c("0:01:16","0:02:26","0:09:40","0:14:11","0:18:43","0:42:34","1:03:51","1:24:41","1:46:19","2:08:28","2:30:19","2:50:32","3:13:16","3:35:59")
k600 <- c("0:01:31","0:02:54","0:11:36","0:17:02","0:22:27","0:50:57","1:16:08","1:41:52","2:08:31","2:34:50","3:01:37","3:25:43","4:02:04","4:23:58")
k700 <- c("0:01:50","0:03:30","0:13:35","0:20:00","0:26:23","1:00:05","1:31:41","2:01:26","2:30:03","3:01:47","3:35:24","4:12:10","4:45:46","5:11:17")
k800 <- c("0:02:03","0:04:01","0:15:40","0:22:57","0:30:09","1:08:12","1:41:59","2:17:02","2:52:59","3:33:07","4:10:31","4:39:18","5:17:31","5:50:03")
k900 <- c("0:02:19","0:04:31","0:17:37","0:25:44","0:34:00","1:17:01","1:55:09","2:34:44","3:20:17","4:09:13","4:57:57","5:38:23","6:22:07","6:51:39")
m1 <- c("0:02:34","0:05:02","0:19:48","0:29:22","0:38:30","1:27:17","2:10:32","2:54:40","3:40:49","4:28:53","5:17:31","5:59:44","6:46:24","7:35:39")

k10 <- as.numeric(hms(k10))/60
k20 <- as.numeric(hms(k20))/60
k50 <- as.numeric(hms(k50))/60
k75 <- as.numeric(hms(k75))/60
k100 <- as.numeric(hms(k100))/60
k200 <- as.numeric(hms(k200))/60
k300 <- as.numeric(hms(k300))/60
k400 <- as.numeric(hms(k400))/60
k500 <- as.numeric(hms(k500))/60
k600 <- as.numeric(hms(k600))/60
k700 <- as.numeric(hms(k700))/60
k800 <- as.numeric(hms(k800))/60
k900 <- as.numeric(hms(k900))/60
m1 <- as.numeric(hms(m1))/60

k10 <- as.data.frame(cbind("10000", k10))
k20 <- as.data.frame(cbind("20000", k20))
k50 <- as.data.frame(cbind("50000", k50))
k75 <- as.data.frame(cbind("75000", k75))
k100 <- as.data.frame(cbind("100000", k100))
k200 <- as.data.frame(cbind("200000", k200))
k300 <- as.data.frame(cbind("300000", k300))
k400 <- as.data.frame(cbind("400000", k400))
k500 <- as.data.frame(cbind("500000", k500))
k600 <- as.data.frame(cbind("600000", k600))
k700 <- as.data.frame(cbind("700000", k700))
k800 <- as.data.frame(cbind("800000", k800))
k900 <- as.data.frame(cbind("900000", k900))
m1 <- as.data.frame(cbind("1000000", m1))

colnames(k10)[2] <- "times"
colnames(k20)[2] <- "times"
colnames(k50)[2] <- "times"
colnames(k75)[2] <- "times"
colnames(k100)[2] <- "times"
colnames(k200)[2] <- "times"
colnames(k300)[2] <- "times"
colnames(k400)[2] <- "times"
colnames(k500)[2] <- "times"
colnames(k600)[2] <- "times"
colnames(k700)[2] <- "times"
colnames(k800)[2] <- "times"
colnames(k900)[2] <- "times"
colnames(m1)[2] <- "times"

df <- rbind(k10,k20,k50,k75,k100,k200,k300,k400,k500,k600,k700,k800,k900,m1)
colnames(df)[1] <- "runs"
p2 <- df %>% group_by(runs)

ggplot(p2, aes(runs, times, colour = runs)) +
  geom_line()

A: You can try this changes over df (stage is only an index for axis reference of data and keep original names for df).
library(tidyverse)
#Create index
df %>% group_by(V1) %>% mutate(stage=1:n()) -> df1
df1 %>% ungroup() %>% mutate(times=as.numeric(as.character(times))) -> df1

#Plot
ggplot(df1, aes(x=stage,y=times, colour = V1)) +
  geom_line()

Update
Try this:
ggplot(p2, aes(x=as.numeric(as.character(runs)), y=as.numeric(as.character(times)), colour = runs,group=runs)) +

geom_line()

A: library(lubridate)
library(dplyr)
library(ggforce)
runs <- c("10000", "20000","50000","75000","100000","200000","300000","400000","500000","600000","700000","800000","900000","1000000")
k10 <- c("0:00:01","0:00:03","0:00:11","0:00:16","0:00:22","0:00:48","0:01:12","0:01:38","0:02:04","0:02:29","0:02:59","0:03:23","0:03:49","0:04:15")
k20 <- c("0:00:03","0:00:06","0:00:23","0:00:33","0:00:44","0:01:37","0:02:27","0:03:18","0:04:10","0:05:03","0:05:57","0:06:45","0:07:38","0:08:33")
k50 <- c("0:00:07","0:00:14","0:00:56","0:01:23","0:01:49","0:04:04","0:06:08","0:08:19","0:10:27","0:12:37","0:14:55","0:16:53","0:19:04","0:21:20")
k75 <- c("0:00:11","0:00:21","0:01:24","0:02:05","0:02:44","0:06:05","0:09:12","0:12:22","0:15:38","0:18:56","0:22:22","0:25:21","0:28:40","0:32:04")
k100 <- c("0:00:15","0:00:28","0:01:53","0:02:45","0:03:39","0:08:07","0:12:17","0:16:29","0:20:43","0:24:56","0:29:27","0:33:20","0:37:52","0:42:32")
k200 <- c("0:00:29","0:00:56","0:03:47","0:05:31","0:07:13","0:16:08","0:24:35","0:33:02","0:41:47","0:51:42","1:01:11","1:08:21","1:17:44","1:26:20")
k300 <- c("0:00:45","0:01:26","0:05:46","0:08:26","0:11:06","0:25:02","0:37:42","0:50:29","1:03:25","1:16:12","1:30:22","1:42:37","1:56:04","2:09:45")
k400 <- c("0:00:59","0:01:53","0:07:36","0:11:12","0:14:46","0:33:13","0:50:01","1:07:44","1:25:21","1:42:27","2:02:14","2:16:48","2:34:49","2:51:18")
k500 <- c("0:01:16","0:02:26","0:09:40","0:14:11","0:18:43","0:42:34","1:03:51","1:24:41","1:46:19","2:08:28","2:30:19","2:50:32","3:13:16","3:35:59")
k600 <- c("0:01:31","0:02:54","0:11:36","0:17:02","0:22:27","0:50:57","1:16:08","1:41:52","2:08:31","2:34:50","3:01:37","3:25:43","4:02:04","4:23:58")
k700 <- c("0:01:50","0:03:30","0:13:35","0:20:00","0:26:23","1:00:05","1:31:41","2:01:26","2:30:03","3:01:47","3:35:24","4:12:10","4:45:46","5:11:17")
k800 <- c("0:02:03","0:04:01","0:15:40","0:22:57","0:30:09","1:08:12","1:41:59","2:17:02","2:52:59","3:33:07","4:10:31","4:39:18","5:17:31","5:50:03")
k900 <- c("0:02:19","0:04:31","0:17:37","0:25:44","0:34:00","1:17:01","1:55:09","2:34:44","3:20:17","4:09:13","4:57:57","5:38:23","6:22:07","6:51:39")
m1 <- c("0:02:34","0:05:02","0:19:48","0:29:22","0:38:30","1:27:17","2:10:32","2:54:40","3:40:49","4:28:53","5:17:31","5:59:44","6:46:24","7:35:39")

k10 <- as.numeric(hms(k10))/60
k20 <- as.numeric(hms(k20))/60
k50 <- as.numeric(hms(k50))/60
k75 <- as.numeric(hms(k75))/60
k100 <- as.numeric(hms(k100))/60
k200 <- as.numeric(hms(k200))/60
k300 <- as.numeric(hms(k300))/60
k400 <- as.numeric(hms(k400))/60
k500 <- as.numeric(hms(k500))/60
k600 <- as.numeric(hms(k600))/60
k700 <- as.numeric(hms(k700))/60
k800 <- as.numeric(hms(k800))/60
k900 <- as.numeric(hms(k900))/60
m1 <- as.numeric(hms(m1))/60

k10 <- as.data.frame(cbind(runs, 10000, k10))
k20 <- as.data.frame(cbind(runs, 20000, k20))
k50 <- as.data.frame(cbind(runs, 50000, k50))
k75 <- as.data.frame(cbind(runs, 75000, k75))
k100 <- as.data.frame(cbind(runs,100000, k100))
k200 <- as.data.frame(cbind(runs, 200000, k200))
k300 <- as.data.frame(cbind(runs, 300000, k300))
k400 <- as.data.frame(cbind(runs, 400000, k400))
k500 <- as.data.frame(cbind(runs, 500000, k500))
k600 <- as.data.frame(cbind(runs, 600000, k600))
k700 <- as.data.frame(cbind(runs, 700000, k700))
k800 <- as.data.frame(cbind(runs, 800000, k800))
k900 <- as.data.frame(cbind(runs, 900000, k900))
m1 <- as.data.frame(cbind(runs, 1000000, m1))

colnames(k10)[3] <- "times"
colnames(k20)[3] <- "times"
colnames(k50)[3] <- "times"
colnames(k75)[3] <- "times"
colnames(k100)[3] <- "times"
colnames(k200)[3] <- "times"
colnames(k300)[3] <- "times"
colnames(k400)[3] <- "times"
colnames(k500)[3] <- "times"
colnames(k600)[3] <- "times"
colnames(k700)[3] <- "times"
colnames(k800)[3] <- "times"
colnames(k900)[3] <- "times"
colnames(m1)[3] <- "times"

df <- rbind(k10,k20,k50,k75,k100,k200,k300,k400,k500,k600,k700,k800,k900,m1)
colnames(df)[2] <- "run_group"

q1 <- df %>% group_by(run_group)

q1$runs <- as.numeric(as.character(q1$runs))
q1$run_group <- as.character(q1$run_group)
q1$times <- as.numeric(as.character(q1$times))

ggplot(q1, aes(runs, times, colour = run_group)) +
  geom_point() +
  geom_line()


text:
Q: Bamboo script logs all output at the end. Bamboo thinks it hanged Tried this on both windows and linux agents.  Create a script task that calls python sleepandoutput.py , which outputs and sleeps and outputs more.  Check the logs after the  plan finishes running, and theyre all at the same time.
The real problem is that when the duration is a long time, Bamboo kills the script.
How to get real time logs of processes that a script task creates?

A: Just needed to call flush after writing.


text:
Q: Open Jpg in morzila firefox using jsp link dynamicaly generated for image How to open jpeg in jsp file using Mozila Firefox? It works in IE but can't run in Firefox by passing it's scr tag dynamicaly
It will say E:\stxavier\docs\7.jpg
e not protocol error

and without generate dynamic content it will see path like
e|\stxavier\docs\7.jpg

So I can't understand that meaning I also use this thing but my other link to pdf or avi file is lost

A: To link to a local file, like "E:\stxavier\docs\7.jpg" you should prepend the local path with "file:///".("file:///e:/stxavier/docs/7.jpg")
But even if you do this Firefox and Opera sometimes DO NOT ALLOW links to the local file system.
Sometimes it will work sometimes it will not, you just can not relly on links to local files.


text:
Q: Entity Framework DbSet performance usage Having an DbContex:
public class ProductsContext : DbContext
{
  public DbSet<Product> Products;
}

I can do this:
Product product = _context.Products.Find(1);

I want to do that in an generic way
IDbSet<T> set = _context.Set<T>();
T entity = set.Find(1);

There are any Entity Framework related performance difference between the two or is the same thing?

A: You can use query-profiler for performance issue.


text:
Q: Creating a Hash with a method I am having trouble creating a method to establish a new hash. I know that it is definitely easier just to declare the hash, however I need to create a method. Here is what I have so far and it keeps generating an error message.
def create_new(hash_name)
hash_name = Hash.new

end

This should create and empty hash^
def add_item(hash_name, item_name, item_quantity)

hash_name[:item_name.to_sym] = item_quantity
end

I keep getting an error message on the above code^ I am trying to update this hash and add a new key value pair with a method
p create_new("grocery_list")

This creates a new empty hash^ however when I call it with the below code is says the hash is undefined
add_item(grocery_list, "pizza", "1")
 p grocery_list

A: You could also turn it into a class if you fancy.
class MyHash
  attr_reader :hash

  def initialize
    @hash = Hash.new
  end

  def [](key)
    self.hash[key]
  end

  def []=(key, value)
    self.hash[key.to_sym] = value
  end
end

grocery_list = MyHash.new
grocery_list['pizza'] = 1

> grocery_list.hash
=> {:pizza=>1}

A: in your create_new method, you define a hash_name local variable. This variable does not exist anywhere but the body of your method. That's what seems to confuse you.
You could express better your intent with :
def create_new
  Hash.new
end

def add_item(hash, key, value)
   hash[key.to_sym] = value
end

In order to get to what you are trying to do, you will have to store the result of your method in some kind of variable in order to use it :
grocery_list = create_new # grocery_list is now a local variable

add_item(grocery_list, 'pizza', 1)