text:
Q: Cannot Assign Symbols to Power BI Scatterchart Data Points (argument of type 'Symbol<{}>' is not assignable to paramater of type 'Primitive'') I'm trying to assign symbols to data points in a Power BI scatterchart, using d3. I can easily make all of them crosses by using:
.attr("d", d3.svg.symbol().type("cross"))

I thought I'd be able to build on that by using an "if" statement to assign symbols based on values within a column called "component." There are four potential component values: OA, OI, RA, and CA. I tried to make the data points related to component OA use crosses and the rest be circles. Here's what I did:
.attr("d", function(d) {
   if (d.component === "OA") { return d3.svg.symbol().type("cross") }
   else { return d3.svg.symbol().type("circle") };
 })

But I'm getting the following error.

[ts] Argument of type '(d: ScatterChartDataPoint) => Symbol<{}>' is not assignable to parameter of type '(datum: ScatterChartDataPoint, index: number, outerIndex: number) => Primitive'. Type 'Symbol<{}>' is not assignable to type 'Primitive'. Type 'Symbol<{}>' is not assignable to type 'false.

Any idea how to fix this? I need a solution that works with d3 v3.5.5. I can't use d3 v4.

A: Change the attr like this:
.attr("d", d3.svg.symbol().type((d:any)=> {
           if (d.component === "OA") { return "cross";}
           else {return "circle";}
        })
)

You want to return the type of d3.svg.symbol not the "d" attribute. So your callback is in the wrong place.


text:
Q: Finding positive integer solutions to $a!+5^b=7^c$ This question: "Solve: $a!+5^b=7^c$" was closed for lack of context, and probably lack of effort by OP. Nonetheless, the question is interesting in itself, and several particular solutions were given in the comments. I show here those given answers are nearly exhaustive, and pose a question about the one instance for which I have not yet obtained a which a full solution.

*

*Based on parity alone, $a!$ must be even, hence $a \ge 2$

*$\min (a!+5^b)=2!+5^0=3$, hence $c \ne 0$

*If $a\ge 7$, then $7\mid a! \land 7\mid 7^c \Rightarrow 7\mid 5^b$. This is not possible, so $a<7$

*Examine the case $b=0$. Here, $2\le a \le 6 \Rightarrow a! \in \{2,6,24,120,720\}$ and $a!+5^0=a!+1 \in \{3,7,25,121,721\}$. The only instance in which $a!+5^0=7^c$ is $3!+5^0=7$. Solution 1 is $a=3,b=0,c=1$

*If $b>0 \land a\ge 5$, then $5\mid a! \land 5\mid 5^b \Rightarrow 5\mid 7^c$. This is not possible, so $a<5$

*$2\le a \le 4 \Rightarrow a! \in \{2,6,24\}$. We can examine each of these three cases individually.

*$24+5^b=7^c$ is analyzed modulo $7$ and modulo $5$. First, $3+5^b\equiv 0 \bmod 7$ is true when $b$ has the form $6m+2$. Next, $4\equiv 7^c \equiv 2^c \bmod 5$ is true when $c$ has the form $4n+2$. In order to have integer solutions, this equation must be formulated $24+5^{6m+2}=7^{4n+2}$. Rearranging, $24=7^{2(2n+1)}-5^{2(3m+1)}$. This is simply the difference of two squares, viz: $24=(7^{(2n+1)}-5^{(3m+1)})(7^{(2n+1)}+5^{(3m+1)})$. This resolves $24$ into two factors, both of which are even and have no common factors other than $2$. The possiblities for this are $24=2\times 12$ and $24=4\times 6$. Moreover, for $m>1$ or $n>1$, the factor $(7^{(2n+1)}+5^{(3m+1)})$ is much larger than $24$ itself, so the only possible candidate is given by $m=n=0$, which sets $24=(7-5)(7+5)=2\cdot 12$ which is true, leading uniquely to Solution 2: $a=4,b=2,c=2$

*$6+5^b=7^c$ is analyzed modulo $7$ and modulo $5$. First, $6+5^b\equiv 0 \bmod 7$ is true when $b$ has the form $6m$. Next, $1\equiv 7^c \equiv 2^c \bmod 5$ is true when $c$ has the form $4n$. As before, we derive $6=(7^{(2n)}-5^{(3m)})(7^{(2n)}+5^{(3m)})$. This plainly has no solutions because each of the factors is even and contains at least one factor of $2$, but $6$ has only one factor of $2$. So there are no solutions in this instance.

*$2+5^b=7^c$ is analyzed modulo $7$ and modulo $5$. First, $2+5^b\equiv 0 \bmod 7$ is true when $b$ has the form $6m+1$. Next, $2\equiv 7^c \equiv 2^c \bmod 5$ is true when $c$ has the form $4n+1$. In order to have integer solutions, this equation must be formulated $2+5^{6m+1}=7^{4n+1}$. By inspection, when $m=n=0$, we get Solution 3: $a=2,b=1,c=1$. Here I am stopped. Since a solution exists, it is not likely that I can rule out larger solutions (i.e. for $mn \ge 1$) by modular arithmetic, and since the exponents in this case are odd, I cannot use the difference of two squares trick which afforded solutions in the previous cases.
My question is: Is there a method or strategy for evaluating the existence and nature of solutions to $2+5^{6m+1}=7^{4n+1}$ for $mn \ge 1$?

A: If $mn\geqslant 1$, then one has
$$5^{6m+1}\equiv 25\pmod{100}\qquad \text{and}\qquad 7^{4n+1}\equiv 7\pmod{100}$$
So, if $mn\geqslant 1$, then $2+5^{6m+1}=7^{4n+1}$ has no solutions.

A: Actually, as to your paragraph 9,

Since a solution exists, it is not likely that I can rule out larger
solutions

is too pessimistic; a string of modular  statements may work.  Your $7^m = 5^n + 2$  becomes  $7^m -7 = 5^n -5$  or
$$ 7 (7^x - 1) = 5 ( 5^y - 1) $$
We assume $x,y \geq 1$  and hunt for a contradiction.
(I) since $7^x \equiv 1 \pmod 5,$  we calculate $4 | x.$  Well
$ 7^4 - 1 = 96 \cdot 25.$ As $4|x,$ we know $7^x - 1$  is divisible by said $2400;$
(II)  $7^x - 1$ is divisible by $25 = 5^2,$ but $5(5^y-1)$ is not divisible by $25$ Therefore $ 7 (7^x - 1) \neq 5 ( 5^y - 1) $
unless $x,y=0;$  there is no larger solution.
$$  \bigcirc \bigcirc  \bigcirc  \bigcirc \bigcirc  \bigcirc \bigcirc  \bigcirc \bigcirc  \bigcirc     \bigcirc \bigcirc  \bigcirc \bigcirc  \bigcirc \bigcirc  \bigcirc  \bigcirc \bigcirc  \bigcirc \bigcirc  \bigcirc \bigcirc  \bigcirc $$
here are some links on this method, including the guy from whom I learned it
https://math.stackexchange.com/users/292972/gyumin-roh
Exponential Diophantine equation $7^y + 2 = 3^x$ Gyumin Roh answer from 2015
Elementary solution of exponential Diophantine equation $2^x - 3^y = 7$.
Elementary solution of exponential Diophantine equation $2^x - 3^y = 7$.  ME!  41, 31, 241, 17
Finding solutions to the diophantine equation $7^a=3^b+100$   343 - 243 =
100
http://math.stackexchange.com/questions/2100780/is-2m-1-ever-a-power-of-3-for-m-3/2100847#2100847
The diophantine equation $5\times 2^{x-4}=3^y-1$
Equation in integers $7^x-3^y=4$
Solve in $\mathbb N^{2}$ the following equation : $5^{2x}-3\cdot2^{2y}+5^{x}2^{y-1}-2^{y-1}-2\cdot5^{x}+1=0$
Solve Diophantine equation: $2^x=5^y+3$ for non-negative integers $x,y$.  128 - 125 = 3
Diophantine equation power of 7 and 2
Find natural numbers a,b such that $|3^a-2^b|=1$  did +-1
Finding all natural $x$, $y$, $z$ satisfying $7^x+1=3^y+5^z$
https://math.stackexchange.com/questions/4155854/how-do-we-find-all-k-s-in-mathbbn-where-5s-2-3k/4156003#4156003 5-3=2
$$  \bigcirc \bigcirc  \bigcirc  \bigcirc \bigcirc  \bigcirc \bigcirc  \bigcirc \bigcirc  \bigcirc     \bigcirc \bigcirc  \bigcirc \bigcirc  \bigcirc \bigcirc  \bigcirc  \bigcirc \bigcirc  \bigcirc \bigcirc  \bigcirc \bigcirc  \bigcirc $$

A: Once you establish $2\le a\le4$, you can treat the six possibilities with $b\lt2$ individually, so it remains to consider $a!+5^b=7^c$ with $b\ge2$, in which case we have $7^c$ mod $25$ is either $2$, $6$, or $-1$.  But the powers of $7$ mod $25$ are $1$, $7$, $-1$, and $-7$. So the only possibility with $b\ge2$ is $4!+5^b=7^c$. Moreover, closer inspection of the powers of $7$ mod $25$ shows $7^c\equiv-1$ mod $25$ implies $c$ is even (and positive), at which point an argument mod $8$ tells us $b$ must also be even. Since $7^{2m}-5^{2n}=(7^n-5^n)(7^n+5^n)\ge24$ if $m$ and $n$ are both positive, we find $4!+5^2=7^2$ is the only solution with $b\ge2$.
(For completeness, of the six possibilities with $b\lt2$, only two are powers of $7$, namely $3!+5^0$ and $2!+5^1$.)

redpajama_set_name: RedPajamaStackExchange


text:
Q: I just want a percent sign at end of my edittext like in google I tried to use imageview but was of no help I would prefer that of this pic
Like the mic button

I don't want to set an onClick for It

A: you can try like this
 <EditText
        android:id="@+id/textView2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Medium Text"
        android:drawableRight="@mipmap/ic_launcher"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textColor="@color/darker_grey"
        android:textStyle="bold" />

put your image in
            android:drawableRight="@drawable/ic_launcher"

or you can do like this
 <FrameLayout
        android:id="@+id/pwdLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/emailLayout">

        <android.support.design.widget.TextInputLayout
            android:id="@+id/textinputlayoutpwd"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/emailLayout"
            android:layout_marginTop="10dp">

            <EditText
                android:id="@+id/signinpassword"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="40dp"
                android:layout_marginRight="40dp"
                android:hint="Password"
                android:inputType="textPassword"
                android:paddingRight="30dp"
                android:singleLine="true"
                android:textSize="20dp" />
        </android.support.design.widget.TextInputLayout>

        <TextView
            android:id="@+id/loginpwdicon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="right|center_vertical"
            android:layout_marginRight="45dp"
            android:layout_marginTop="10dp"
            android:text="@string/lock_icon2"
            android:textColor="@color/red"
            android:textSize="25sp" />
    </FrameLayout>

I used here icon image in textview. you can use here image view, image button or any other layout as for your requirements.


text:
Q: Have to / having to? As fas as I know, "have to" is the commoner version of the two,
but I'm finding more and more that "having to" is also used instead of "have to".
She has to / is having to look after herself now.
Are both freely interchangeable without any difference in meaning?
If any,I want to know what is the difference between the two and when you use "having to" more preferably than the other.
Proper contexts with good examples to be given will be very helpful to me.

A: "Have to" as expressing obligation or importance of having to do something has all the possibilities of a normal verb.  You need an auxiliary when you use it in a question or in the negative  :

Do I have to do that now ?
You don't have to go.

It can be used in the past:

I had to get up early this morning.

And you can use it the with -ing form. Choosing to use -ing form or not is done a purpose of course, and the difference  will be the same as with any other verb.
Two extracts from US writers :

There have been many times, when Laura Bell has had to walk all alone back to her home, unless a few of her siblings would walk along with her while she is having to walk to school or having to run an errand out on the Ridge for her Ma...

now after four months cooped up, her arthritis is so bad, she is having to learn a new stand-up style...

a New Zealand paper:

the parents are having to make really difficult choices

a British Californian blog

Why are we having to subsidize the tight proprietors who don't pay their staff properly?

Other examples from what seem to be reliable sources*, links provided for having full context:

*

*People are having to leave their rural areas

*my builder is having to come back in and repaint our baseboards

*I am having to attend a disciplinary hearing

*The difficulty in finding examples in English on the Internet is that English is used as a lingua franca and you can never be sure what is written has been written by a native who has a good knowledge of the language.

A: Has to is the common form correct in great most cases.
is having (without to) appears only as an idiom for eating.

She has to buy a sandwich - means opinion/necessity: "she definitely should buy a sandwich" or "She has no other choice, she must buy a sandwich."
She has a sandwich - ownership. She bought a sandwich and kept it, it's hers.
She is having a sandwich - eating. She is eating the sandwich.

I don't think I could think of an example where "She is having to do something" would be correct.

A: Difference Between "Have To" and "HAVING TO" is similar to the use of Present Simple (Present Indefinite) and Present Progressive (Present Continous) tenses.
While using have to, we refer something that we do regularly / for a longer period of time, e.g.
I have to walk 5km every day to pick the bus for my office. (i.e. this is a part of my routine activities)
Whereas, "Having To" is used while we mention something that we are doing for a limited time period due to any need / requirement, e.g.
I am having to do extra work in the absence of my colleague. (i.e. it's not my job but I am doing it due a specific reason and for a particular time period.)
Hope it helps in answering your query. If anyone thinks I am not correct then please rectify.


text:
Q: Node.js parse returns undefined while it does receive JSON I'm trying to parse an incoming JSON object on my node.js server, yet it keeps saying it's undefined? Here is my code:
app.get("/adddates", function (req, res) {
var url_parts = url.parse(req.url, true);
var query = url_parts.query;
console.log("does this get called?"); //Response 1 here is correct
    console.log(query); //Response here 2*
    console.log(query['name']); // Response 3 here is undefined?
if(query["Name"]!==undefined) {
    var tx = { Name : query["Name"],
        Description: query["Description"],
        Date: query["Date"],
                    People: query["people"],
                    Tag: query["Tag"]

    };
            console.log(tx);
    todos.push(tx);
    console.log("Added " + tx.message);
    res.end("Todo added successfully");
}
else {
    res.end("Error: missing message parameter");
}
});

2* = { '[{"Name":"testetst","Description":"Blasts","Date":"2016-12-08","People":["Sjaak"],"Tag":"': '' }

So my question is, why is response 3 undefined and how to fix it otherwise?
Also why is the Tag value empty? The input is a hexcode color? Is it just a JSON parse i'm doing wrong?
Many thanks in advance

A: If you look at the url.parse documentation you'll see this:
┌─────────────────────────────────────────────────────────────────────────────┐
│                                    href                                     │
├──────────┬┬───────────┬─────────────────┬───────────────────────────┬───────┤
│ protocol ││   auth    │      host       │           path            │ hash  │
│          ││           ├──────────┬──────┼──────────┬────────────────┤       │
│          ││           │ hostname │ port │ pathname │     search     │       │
│          ││           │          │      │          ├─┬──────────────┤       │
│          ││           │          │      │          │ │    query     │       │
"  http:   // user:pass @ host.com : 8080   /p/a/t/h  ?  query=string   #hash "
│          ││           │          │      │          │ │              │       │
└──────────┴┴───────────┴──────────┴──────┴──────────┴─┴──────────────┴───────┘
(all spaces in the "" line should be ignored -- they are purely for formatting)

so the tag in the json will become the hash after being send. To fix this the data you send should be url encoded. This can be done by encodeURIComponent(URI).
$.get( "localhost:3000/adddates", encodeURIComponent(dateobj) );

edit
If you look at the query part you'll see it parses the data like query=string. So adding the query part to the url string:
$.get( "localhost:3000/adddates", "data=" + encodeURIComponent(dateobj) );

Then you should be able to retrieve the data like
var json = query["data"];
var data = JSON.parse(json);
var name = data[0]["Name"]

original answer
assuming the json is
[{"Name":"testetst","Description":"Blasts","Date":"2016-12-08","People":["Sjaak"],"Tag":""}]

There are different sites where you can validate if your json is correct.
then the query is an array of objects indicated by the [ and ]. To access the object itself you'll first need to get them from the array and then you'll be able to access the properties.
query[0]["Name"]


text:
Q: Bayesian ODE with Julia I have been trying to implement Bayesian ODE. In Oil industry, we use the following equation to fit production data then forecasting :

The ODE equation is described as :

where 0<n<1, n and K are parameters defined by fitting the raw production data, in my case K is 0.17, n = 0.87.
My initial code :
using DiffEqFlux, OrdinaryDiffEq, Flux, Optim, Plots, AdvancedHMC

function Arps!(du,u,p,t)
    y = u
    K,n = p
    du  = (y * K * y^n)
end

tspan=(1.0,200.0)
tsteps = range(1, 200, length = 200)
u0 = [5505.99]
p=[0.17,0.87]
prob1 = ODEProblem(Arps!,u0,tspan)
sol_ode = solve(prob1,Vern7(),saveat = tsteps)

Not sure how to solve this issue :
MethodError: no method matching iterate(::DiffEqBase.NullParameters)

A: You didn't pass any parameters into your ODE. prob1 = ODEProblem(Arps!,u0,tspan,p).
For the Bayesian part, look at the tutorial:
https://turing.ml/dev/tutorials/10-bayesiandiffeq/


text:
Q: How to install softwares for all users? I am running an Ubuntu 18.04 server among a small group. How can I install some common software that all users can use at the same time?
On my own laptop, I can just use apt-get. However, it has a huge limitation. For some package, it requires sudo to fully function. For example, when tmux is installed by apt-get, it requires sudo to properly load .tmux.conf. Without sudo, tmux starup takes forever.
what is the best practice here?

A: You may want to look at how linux's directory structure is constructed .  For example, this link
Non-essential binaries for multi-user use can typically be placed in /usr, /usr/bin, or /usr/local/bin.  This link here https://unix.stackexchange.com/questions/8656/usr-bin-vs-usr-local-bin-on-linux goes into greater detail.
Obviously package managers may put their apps elsewhere, but that is the historical purpose for these directories.

A: If you install software in Ubuntu using apt-get, it is installed system-wide for every user. However in nearly all cases, it is required to be root to do so.
One way to become root -if you are not yet- is to prepend commands with sudo. This applies to all packages to be installed using apt-get.
The problem, that you require root to start tmux is probably a different problem, unrelated to the package installation via apt-get.
Maybe this could help you:
https://serverfault.com/questions/405391/tmux-wont-run-as-non-root-user


text:
Q: Change the position and size of legend of vertical lines ggplot I would like to change the size and the position of the legend for the vertical lines in my plot. Here is the code:
central_values <- data.frame(measurement = c("mean", "median"),
                             value = c(mean(CBGrecord_days[,2]), median(CBGrecord_days[,2])))

ggplot(CBGrecord_days, aes(x=CBGrecord_days[,2])) +
  geom_histogram(color="darkblue", fill="lightblue", binwidth=17)+
    xlab("Number of days recorded")+ # for the x axis label
      ylab("Number of individuals")+
        scale_y_continuous(breaks=c(seq(0,40,5)))+
          scale_x_continuous(breaks=c(seq(0,230,15)))+
            geom_vline(data = central_values, aes(xintercept = value, color = measurement),size=1.2)+
               scale_color_manual(values = c("red", "darkblue"), name = NULL) +
              theme(panel.background = element_rect(fill = "white", colour = "grey50"),
                axis.text=element_text(size=32),
                  axis.title=element_text(size=40))+guides(color = guide_legend(title=NULL))

Thank you!


text:
Q: Passed string become empty in gdb? I have the following code:
CrowdSim::Simulation my_simulation;
void printstring(std::string filename)
{
  std::cerr<<"filename= " <<filename<<std::endl;
}

int main(int argc, char* argv[])
{

  std::vector<std::string> tokens;
  std::string filename = "";
  if(argc > 1)
  {
    std::string args(argv[1]);
    split(tokens, args, is_any_of("\"="), token_compress_on);
    filename = tokens.at(1);
  }

  my_simulation = CrowdSim::Simulation();
  printstring(filename);

I run the program with the following
./CrowdSim -filename="Layout/layout_1"

Within gdb, I put a breakpoint right before printstring(filename). When hitting this breakpoint, I execute print filename, and the output is "Layout/layout_1". Immediately after entering printstring (stepping in with step), I print filename and the result is "".
However, if I actually let the next line run, the output is fine: it prints filename= Layout/layout_1. Is this some sort of gdb error? It's making it very hard to debug without using a ton of cerr statements. What could be causing this?
Additionally, if I comment out all lines involving my_simulation (so that it never gets initialized and I never use it) I get an error upon stepping into printstring:
printstring (filename=Traceback (most recent call last):
  File "/usr/share/gdb/python/libstdcxx/v6/printers.py", line 469, in to_string
    return self.val['_M_dataplus']['_M_p'].string (encoding, length = len)
RuntimeError: Error reading string from inferior: Input/output error
) at Source/main.cc:13

I also tested this with a program which contains only the above main and printstring functions, with no references to any other objects. The above error still occurs.
Can anyone explain either of these errors to me? Also, somewhat related, in c++, does the line CrowdSim::Simulation my_simulationautomatically call the constructor, so that I no longer need the line my_simulation = ...? In Java, declaring a variable doesn't construct it (as far as I know), so both lines are usually necessary (I think).


text:
Q: Create a Tabular Table I would like to develop a tabular table like this.

However, when I use the reference code from https://www.overleaf.com/learn/latex/Tables#Creating_a_simple_table_in_LaTeX , with code:
\documentclass{article}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{0.8\textwidth} {
  | >{\raggedright\arraybackslash}X
  | >{\centering\arraybackslash}X
  | >{\raggedleft\arraybackslash}X | }
 \hline
 Place/Transition & Explanation & Time  \\
 \hline
 T_1 and T_(2(n+1))  & Robot operation which relates to loadlocks. Transition T_1indicates that wafer unloading from the loadlocks and T_(2(n+1)) means that the robot loads the wafer to the loadlocks. & w \\
\hline
 item 31  & item 32  & item 33 \\

\hline
\end{tabularx}
\end{document}

The result is as follows.

Perhaps, does anyone have any other reference to create a tabular table that I want, please?
When I Replace \begin{tabularx}{0.8\textwidth} by \noindent\begin{tabularx}{\linewidth} , here is the result:

Thank you in advance.

A: The problem is, as stated in the comments, that you omit the necessary syntax for math mode. Because of this, TeX will at some point read a _ which is only a valid character in math mode. Hence, it will switch to math mode automatically, but since it does not know where the math mode should end, it keeps typesetting in math mode which results in this strange output.
It is very easy to solve this problem by using the correct syntax for math mode. Since you don't need pragraphs in columns one and three, you could also switch to another column defintion:
\documentclass{article}
\usepackage{tabularx}

\begin{document}
\begin{tabularx}{0.8\textwidth} { |
  l |
  >{\raggedright\arraybackslash}X |
  c |
}
  \hline
  Place/Transition & Explanation & Time  \\
  \hline
  $T_1$ and $T_{2(n+1)}$  & Robot operation which relates to loadlocks. Transition $T_1$ indicates that wafer unloading from the loadlocks and $T_{2(n+1)}$ means that the robot loads the wafer to the loadlocks. & w \\
  \hline
  item 31 & item 32 & item 33 \\
  \hline
\end{tabularx}
\end{document}

An alternative solution could be created with the help of the booktabs package, which can help you reduce the amount of borders between cells:
\documentclass{article}
\usepackage{tabularx}
\usepackage{booktabs}

\begin{document}
\renewcommand{\arraystretch}{1.25}
\begin{tabularx}{0.8\textwidth} {
  l
  >{\raggedright\arraybackslash}X
  c
}
  \toprule
  Place/Transition & Explanation & Time  \\
  \midrule
  $T_1$ and $T_{2(n+1)}$  & Robot operation which relates to loadlocks. Transition $T_1$ indicates that wafer unloading from the loadlocks and $T_{2(n+1)}$ means that the robot loads the wafer to the loadlocks. & w \\
  item 31 & item 32 & item 33 \\
  \bottomrule
\end{tabularx}
\end{document}

Note that you might want to replace 0.8\textwidth by \linewidth if you want to extend the table to the width of a text column in a two-column layout:
\documentclass[journal]{IEEEtran}
\usepackage{lipsum}
\usepackage{tabularx}

\begin{document}

\lipsum[1]

\noindent%
\begin{tabularx}{\linewidth} { |
  l |
  >{\raggedright\arraybackslash}X |
  c |
}
  \hline
  Place/Transition & Explanation & Time  \\
  \hline
  $T_1$ and $T_{2(n+1)}$  & Robot operation which relates to loadlocks. Transition $T_1$ indicates that wafer unloading from the loadlocks and $T_{2(n+1)}$ means that the robot loads the wafer to the loadlocks. & w \\
  \hline
  item 31 & item 32 & item 33 \\
  \hline
\end{tabularx}

\newpage

Right column

\end{document}

A: Here's an idea that's complementary to the second table in @JasperHabicht's answer: Get rid of the whitespace padding at either end, and allow line breaks in column 1.

\documentclass{article}
\usepackage{tabularx} % for 'tabularx' env. and 'X' column type
\usepackage{booktabs} % for well-spaced horizontal rules
\usepackage{ragged2e} % for '\RaggedRight' macro
\newlength\mylen

\begin{document}

\begin{center}
\settowidth\mylen{Transition} % target width of column 1
\begin{tabularx}{0.8\textwidth} {@{}
     >{\RaggedRight}p{\mylen} >{\RaggedRight}X c @{}}
 \toprule
 Place\slash Transition & Explanation & Time  \\
 \midrule
 $T_1$ and $T_{2(n+1)}$  &
 Robot operation which relates to loadlocks. Transition $T_1$ indicates that wafer unloading from the loadlocks, and $T_{2(n+1)}$ means that the robot loads the wafer to the loadlocks. &
 $w$ \\
 \addlinespace
 item 31 & item 32 & item 33 \\
 \bottomrule
\end{tabularx}
\end{center}
\end{document}


text:
Q: ASP.NET C# Date comparison I've read through some suggestions in the forum and this is closest thing I could relate to but not quite there yet Compare journey date with return date in asp.net c#
Anyway, the question is I am trying to book a room, from date x until date y. No other booking should take place at this time i.e. system sends off a message saying it can't complete overwriting booking.  Any tutorial you could direct me to? or even sample code to build upon?
Thanks,

A: When you are about to create a new booking, check against the existing bookings.
A booking doesn't overlap if ends before the existing booking or starts after it, so just loop throught the existing bookings and check:
if (!(newBooking.EndDate < existingBooking.StartDate || newBooking.StartDate > existingBooking.EndDate)) {
  // there is a conflicting booking
}

A: Assuming a Booking class with the properties RoomNumber, StartDate and EndDate.
class Booking
{
    public DateTime StartDate { get; set; }
    public DateTime EndDate { get; set; }
    public int RoomNumber { get; set; }
}

bool IsRoomAvailableOnDate(int roomNumber, DateTime date)
{
    //change this to match your data source
    List<Booking> bookings = Booking.GetBookings();

    // get all bookings that have a start date and end date within your timeframe
    var bookingsWithinDate = from booking in bookings
                                where booking.RoomNumber == roomNumber
                                && booking.StartDate <= date
                                && booking.EndDate >= date
                                select booking;

    if (bookingsWithinDate.Any())
    {
        //bookings found that match date and room number
        return false;
    }
    else
    {
        //no bookings
        return true;
    }
}

A: How about:
private bool ConflictsWithExisting(Booking booking)
{
  return existingBookings.Any(b => b.ConflictsWith(booking));
}

with the following method on Booking:
public bool ConflictsWith(Booking booking)
{
  // You may want to check they are for the same room here.
  return !(booking.EndDate <= this.StartDate || booking.StartDate >= this.EndDate);
}

A: I came across something helpful myself, this is is
MSDN: DateTime Subtract
and the code looks like this:
                    System.DateTime date1 = new System.DateTime(1996, 6, 3, 22, 15, 0);
        System.DateTime date2 = new System.DateTime(1996, 12, 6, 13, 2, 0);
        System.DateTime date3 = new System.DateTime(1996, 10, 12, 8, 42, 0);

        // diff1 gets 185 days, 14 hours, and 47 minutes.
        System.TimeSpan diff1 = date2.Subtract(date1);

        // date4 gets 4/9/1996 5:55:00 PM.
        System.DateTime date4 = date3.Subtract(diff1);

        // diff2 gets 55 days 4 hours and 20 minutes.
        System.TimeSpan diff2 = date2 - date3;

        // date5 gets 4/9/1996 5:55:00 PM.
        System.DateTime date5 = date1 - diff2;

Nonetheless, I will try this, but thanks again for the help
Edit:
I've also come across this code from a site http://www.dotnetspider.com/forum/84579-How-To-Check-Date-Date-Range.aspx
DateTime sd=Convert.ToDateTime("2/2/2007");
DateTime ed =Convert.ToDateTime("2/2/2009");
if ((sd<=Convert.ToDateTime(nTextBox1.Text)) && (Convert.ToDateTime(nTextBox1.Text<=ed))
{
MessageBox.Show("In Range");
}
else
{
MessageBox.Show("Not In Range");
}

good for range check :D

A: If it were me I would have a RoomBooking transactional table in the database (containing at least a RoomId column plus RoomTypeId,BookingStartDate and BookingEndDate).  Then write a store procedure that queried the database to fulfill the use case "Is there a room available of an appropriate room type for a particular date range" - with a signature like:
GetAvailableRoomsForTypeAndDates(RoomTypeId, BookingStartDate, BookingEndDate)
The return from that is then handled in your code or via an ORM tool.


text:
Q: Simple template class member function specialization that returns a value I am trying to call a template class member function specialization that returns a value from within the class's constructor, and I cannot seem to find the correct syntax (if it exists).  Below is my code, and, below that, the error messages from the compiler (not the linker).
#include <iostream>

class A {};

class B {};

template <typename T>
class C
{
    public:
        C()
        {
            std::cout << "C constructed." << std::endl;
            std::cout << name() << std::endl;;
        }
        template constexpr const char * name();
};

template <> const char * C<A>::name() { return "You got an A."; }
template <> const char * C<B>::name() { return "You got a B."; }

int main()
{
    C<A> c_a;
    C<B> c_b;
    return 0;
}

Error messages:
g++ -std=c++11 -o t1 t1.cpp
t1.cpp:19:18: error: expected '<' before 'constexpr'
         template constexpr const char * name();
                  ^
t1.cpp:22:26: error: template-id 'name<>' for 'const char* C::name()' does not match any template declaration
 template <> const char * C::name() { return "You got an A."; }
                          ^
t1.cpp:22:37: note: saw 1 'template<>', need 2 for specializing a member function template
 template <> const char * C::name() { return "You got an A."; }
                                     ^
t1.cpp:23:26: error: template-id 'name<>' for 'const char* C::name()' does not match any template declaration
 template <> const char * C::name() { return "You got a B."; }
                          ^
t1.cpp:23:37: note: saw 1 'template<>', need 2 for specializing a member function template
 template <> const char * C::name() { return "You got a B."; }
I have searched and found many discussions about code that elicits this error message, but neither the cases nor the advice seem to be close enough to be relevant.  Also, if I do  not try to return anything from the specialized member function--if it has return type void and simply prints to cout--then it works as I would expect, i.e., I see the printed text with the right values.
Is it possible to do what I am trying to do?  If so, how?  Thanks!

A: Syntax would be:
template <typename T>
class C
{
    public:
        C()
        {
            std::cout << "C constructed." << std::endl;
            std::cout << name() << std::endl;;
        }
        constexpr const char* name();
};

template <> constexpr const char * C<A>::name() { return "You got an A."; }
template <> constexpr const char * C<B>::name() { return "You got a B."; }

Demo

A: You are complicating it a bit.  There is no need for "template" in the function declaration.  It's just an ordinary function that happens to be inside a class template, and you want to specialize it for certain T's.  Here's a way to do that:
#include <iostream>

class A {};
class B {};

template <typename T>
class C {
public:
    C() {
        std::cout << "C constructed." << std::endl;
        std::cout << name() << std::endl;;
    }
    static constexpr const char * name();
};

template <> constexpr const char * C<A>::name() { return "You got an A."; }
template <> constexpr const char * C<B>::name() { return "You got a B."; }

int main() {
    C<A> c_a;
    C<B> c_b;
}

A: For the record, I found a solution to the exact problem I had posted--i.e., using a member function instead of a static (or global) function, here.
#include <iostream>

class A {};
class B {};

template <typename T>
class C
{
    template <typename U> struct type {};
    public:
        C()
        {
            std::cout << "C constructed." << std::endl;
            std::cout << name<T>() << std::endl;;
        }
        template <typename U> constexpr const char * name()
        {
            return name(type<U>());
        }

    private:
        template <typename U> constexpr const char * name(type<U>) {}
        constexpr const char * name(type<A>) { return "You got an A."; }
        constexpr const char * name(type<B>) { return "You got an B."; }
};

int main()
{
    C<A> c_a;
    C<B> c_b;
    return 0;
}


text:
Q: Dynamic inilne style with default StyleSheet React Native I need to give dynamic inline style with static default stylesheet style. How can I achieve this
<View
    style={[styles.card,{{width:width,  height: height}}]}>
             <View style={styles.card}>
                <Text>
                  <Image
                    source={{uri: this.props.media.image_url}}
                    style={{width:width,  height: this.props.media.height}}/>
                </Text>
             </View>
 </View>

Above code is not working for me.

A: Nope, the problem isn't the order, you haven't passed the dynamic(inline styles) properly. You wrapped them in additional curly braces
Change this:
style={[styles.card,{{width:width,  height: height}}]}

to:
style={[styles.card,{width:width,  height: height}]}

You have actually done the same thing in your answer above.

A: Finally after trying a lot I am able to resolve it.
Here is the code
  <View
    <View style={[{width:width,  height: height},styles.card]}>
         <View style={styles.card}>
            <Text>
              <Image
                source={{uri: this.props.media.image_url}}
                style={{width:width,  height: this.props.media.height}}/>
            </Text>
         </View>
    </View>
 </View>


text:
Q: UIScrollView stops (or slows down) scrolling between stops defined by Paging I have an iOS App that uses Unity3D. When I pause Unity to show only Quartz-related content, the performance is usually fine.
But on a current project, scrollviews and table views sometimes perform very bad. They stop scrolling too early, and the scrollview stops even between multiples of the size predefined by the paging.
I tried to take a look with Instruments, and found FPS is usually ~50-60, but sometimes less. However this does not answer my question.
Btw, the table and the scroller have only a few data, and there is no reloading issue.

A: Okay, now I found some very helpful information at the Unity Forum. Using
#define USE_DISPLAY_LINK_IF_AVAILABLE 0

prevents the described issue. The Unity-iOS project now uses THREAD_BASED_LOOP instead of the CADisplayLink class. Maybe I will further play around with CADisplayLink and lower target frame rates.
Some interesting information about the used Rendering Loop Type can be found in the Unity Manual.


text:
Q: Fatal Signal 11 I developed and tested an application on my emulator that had an API of 4.1 (Jelly Bean). When I debug my application on my actual device, which is a Samsung Galaxy Nexus, it gives me in the logcat- Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 4395. Can you help?
Java XML:
package ID;

import java.io.IOException;
import java.io.InputStream;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;

public class Menu extends Activity implements OnClickListener {

ImageView display;
int toPhone;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

    setContentView(R.layout.activity_wallpapers);

    toPhone = R.drawable.eye;

    display = (ImageView) findViewById(R.id.IVdisplay);
    ImageView image1 = (ImageView) findViewById(R.id.IVimage1);
    ImageView image2 = (ImageView) findViewById(R.id.IVimage2);
    ImageView image3 = (ImageView) findViewById(R.id.IVimage3);
    ImageView image4 = (ImageView) findViewById(R.id.IVimage4);
    ImageView image5 = (ImageView) findViewById(R.id.IVimage5);
    ImageView image6 = (ImageView) findViewById(R.id.IVimage6);
    ImageView image7 = (ImageView) findViewById(R.id.IVimage7);
    Button setWall = (Button) findViewById(R.id.button1);

    image1.setOnClickListener(this);
    image2.setOnClickListener(this);
    image3.setOnClickListener(this);
    image4.setOnClickListener(this);
    image5.setOnClickListener(this);
    image6.setOnClickListener(this);
    image7.setOnClickListener(this);
    setWall.setOnClickListener(this);
}

@SuppressWarnings("deprecation")
public void onClick(View v) {
    // TODO Auto-generated method stub
    switch (v.getId()) {
    case R.id.IVimage1:
        display.setImageResource(R.drawable.eye);
        toPhone = R.drawable.eye;
        break;
    case R.id.IVimage2:
        display.setImageResource(R.drawable.falls);
        toPhone = R.drawable.falls;
        break;
    case R.id.IVimage3:
        display.setImageResource(R.drawable.inthemiddle);
        toPhone = R.drawable.inthemiddle;
        break;
    case R.id.IVimage4:
        display.setImageResource(R.drawable.web);
        toPhone = R.drawable.web;
        break;
    case R.id.IVimage5:
        display.setImageResource(R.drawable.watching);
        toPhone = R.drawable.watching;
        break;
    case R.id.IVimage6:
        display.setImageResource(R.drawable.similar);
        toPhone = R.drawable.similar;
        break;
    case R.id.IVimage7:
        display.setImageResource(R.drawable.solar);
        toPhone = R.drawable.solar;
        break;
    case R.id.button1:
        InputStream cont = getResources().openRawResource(R.drawable.eye);
        Bitmap background = BitmapFactory.decodeStream(cont);
        try {
            getApplicationContext().setWallpaper(background);
        } catch (IOException e) {
            e.printStackTrace();
        }
        break;
    }
}

Java XML:
package ID;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import ab.wallpapers.hd.R;

public class Wallpapers extends Activity {

@Override
protected void onCreate(Bundle Wallpapers) {
    super.onCreate(Wallpapers);
    setContentView(R.layout.activity_wallpapers);
}

@Override
protected void onStart() {
    // TODO Auto-generated method stub
    super.onStart();
}

@Override
protected void onPause() {
    // TODO Auto-generated method stub
    super.onPause();
}

@Override
protected void onResume() {
    // TODO Auto-generated method stub
    super.onResume();
}

@Override
protected void onStop() {
    // TODO Auto-generated method stub
    super.onStop();
}

@Override
protected void onDestroy() {
    // TODO Auto-generated method stub
    super.onDestroy();
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.activity_wallpapers, menu);
    return true;
}

Logcat:
09-24 20:34:11.619: I/System.out(5225): Sending WAIT chunk
09-24 20:34:11.619: W/ActivityThread(5225): Application ab.wallpapers.hd is waiting for the debugger on port 8100...
09-24 20:34:11.643: I/dalvikvm(5225): Debugger is active
09-24 20:34:11.822: I/System.out(5225): Debugger has connected
09-24 20:34:11.822: I/System.out(5225): waiting for debugger to settle...
09-24 20:34:12.025: I/System.out(5225): waiting for debugger to settle...
09-24 20:34:12.221: I/System.out(5225): waiting for debugger to settle...
09-24 20:34:12.424: I/System.out(5225): waiting for debugger to settle...
09-24 20:34:12.627: I/System.out(5225): waiting for debugger to settle...
09-24 20:34:12.830: I/System.out(5225): waiting for debugger to settle...
09-24 20:34:13.033: I/System.out(5225): waiting for debugger to settle...
09-24 20:34:13.236: I/System.out(5225): debugger has settled (1435)
09-24 20:34:13.393: D/dalvikvm(5225): GC_FOR_ALLOC freed 39K, 2% free 10842K/11011K, paused 17ms, total 18ms
09-24 20:34:13.400: I/dalvikvm-heap(5225): Grow heap (frag case) to 13.618MB for 3145744-byte allocation
09-24 20:34:13.432: D/dalvikvm(5225): GC_CONCURRENT freed 1K, 2% free 13912K/14151K, paused 12ms+2ms, total 27ms
09-24 20:34:13.650: D/dalvikvm(5225): GC_FOR_ALLOC freed 0K, 2% free 13912K/14151K, paused 12ms, total 12ms
09-24 20:34:13.666: I/dalvikvm-heap(5225): Grow heap (frag case) to 18.949MB for 5591056-byte allocation
09-24 20:34:13.697: D/dalvikvm(5225): GC_CONCURRENT freed 0K, 2% free 19372K/19655K, paused 11ms+3ms, total 28ms
09-24 20:34:14.033: D/dalvikvm(5225): GC_FOR_ALLOC freed 3072K, 18% free 16308K/19655K, paused 10ms, total 10ms
09-24 20:34:14.041: I/dalvikvm-heap(5225): Grow heap (frag case) to 18.957MB for 3145744-byte allocation
09-24 20:34:14.088: D/dalvikvm(5225): GC_CONCURRENT freed <1K, 2% free 19380K/19655K, paused 12ms+19ms, total 45ms
09-24 20:34:14.143: D/dalvikvm(5225): GC_FOR_ALLOC freed 0K, 2% free 19380K/19655K, paused 12ms, total 12ms
09-24 20:34:14.150: I/dalvikvm-heap(5225): Grow heap (frag case) to 24.289MB for 5591056-byte allocation
09-24 20:34:14.174: D/dalvikvm(5225): GC_CONCURRENT freed 0K, 2% free 24841K/25159K, paused 2ms+2ms, total 25ms
09-24 20:34:14.838: D/dalvikvm(5225): GC_FOR_ALLOC freed 3072K, 14% free 21770K/25159K, paused 10ms, total 10ms
09-24 20:34:14.853: I/dalvikvm-heap(5225): Grow heap (frag case) to 28.321MB for 7372816-byte allocation
09-24 20:34:14.885: D/dalvikvm(5225): GC_CONCURRENT freed <1K, 11% free 28970K/32391K, paused 13ms+2ms, total 25ms
09-24 20:34:15.088: D/dalvikvm(5225): GC_FOR_ALLOC freed 0K, 11% free 28970K/32391K, paused 10ms, total 10ms
09-24 20:34:15.119: I/dalvikvm-heap(5225): Grow heap (frag case) to 40.824MB for 13109776-byte allocation
09-24 20:34:15.143: D/dalvikvm(5225): GC_CONCURRENT freed 0K, 8% free 41772K/45255K, paused 12ms+3ms, total 30ms
09-24 20:34:16.228: D/dalvikvm(5225): GC_FOR_ALLOC freed 7200K, 24% free 34573K/45255K, paused 11ms, total 11ms
09-24 20:34:16.236: I/dalvikvm-heap(5225): Grow heap (frag case) to 40.825MB for 7372816-byte allocation
09-24 20:34:16.283: D/dalvikvm(5225): GC_CONCURRENT freed <1K, 8% free 41773K/45255K, paused 13ms+8ms, total 49ms
09-24 20:34:16.283: D/dalvikvm(5225): WAIT_FOR_CONCURRENT_GC blocked 37ms
09-24 20:34:16.502: D/dalvikvm(5225): GC_FOR_ALLOC freed 0K, 8% free 41773K/45255K, paused 15ms, total 15ms
09-24 20:34:16.525: I/dalvikvm-heap(5225): Grow heap (frag case) to 53.327MB for 13109776-byte allocation
09-24 20:34:16.557: D/dalvikvm(5225): GC_CONCURRENT freed 0K, 7% free 54576K/58119K, paused 11ms+3ms, total 28ms
09-24 20:34:17.533: D/dalvikvm(5225): GC_FOR_ALLOC freed 7200K, 19% free 47377K/58119K, paused 14ms, total 14ms
09-24 20:34:17.541: I/dalvikvm-heap(5225): Grow heap (frag case) to 53.329MB for 7372816-byte allocation
09-24 20:34:17.580: D/dalvikvm(5225): GC_CONCURRENT freed <1K, 7% free 54577K/58119K, paused 12ms+3ms, total 40ms
09-24 20:34:17.799: D/dalvikvm(5225): GC_FOR_ALLOC freed 0K, 7% free 54577K/58119K, paused 19ms, total 19ms
09-24 20:34:17.799: I/dalvikvm-heap(5225): Forcing collection of SoftReferences for 13109776-byte allocation
09-24 20:34:17.877: D/dalvikvm(5225): GC_BEFORE_OOM freed 9K, 7% free 54568K/58119K, paused 71ms, total 74ms
09-24 20:34:17.877: E/dalvikvm-heap(5225): Out of memory on a 13109776-byte allocation.
09-24 20:34:17.877: I/dalvikvm(5225): "main" prio=5 tid=1 RUNNABLE
09-24 20:34:17.877: I/dalvikvm(5225):   | group="main" sCount=0 dsCount=0 obj=0x40d9e568 self=0x40d8e9f8
09-24 20:34:17.877: I/dalvikvm(5225):   | sysTid=5225 nice=0 sched=0/0 cgrp=apps/bg_non_interactive handle=1075160624
09-24 20:34:17.877: I/dalvikvm(5225):   | schedstat=( 0 0 0 ) utm=343 stm=24 core=1
09-24 20:34:17.877: I/dalvikvm(5225):   at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:500)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:353)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:781)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.content.res.Resources.loadDrawable(Resources.java:1930)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.widget.ImageView.<init>(ImageView.java:120)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.widget.ImageView.<init>(ImageView.java:110)
09-24 20:34:17.877: I/dalvikvm(5225):   at java.lang.reflect.Constructor.constructNative(Native Method)
09-24 20:34:17.877: I/dalvikvm(5225):   at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.view.LayoutInflater.createView(LayoutInflater.java:587)
09-24 20:34:17.877: I/dalvikvm(5225):   at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
09-24 20:34:17.877: I/dalvikvm(5225):   at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.app.Activity.setContentView(Activity.java:1867)
09-24 20:34:17.877: I/dalvikvm(5225):   at ab.wallpapers.hd.Wallpapers.onCreate(Wallpapers.java:13)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.app.Activity.performCreate(Activity.java:5008)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.app.ActivityThread.access$600(ActivityThread.java:130)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.os.Handler.dispatchMessage(Handler.java:99)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.os.Looper.loop(Looper.java:137)
09-24 20:34:17.877: I/dalvikvm(5225):   at android.app.ActivityThread.main(ActivityThread.java:4745)
09-24 20:34:17.877: I/dalvikvm(5225):   at java.lang.reflect.Method.invokeNative(Native Method)
09-24 20:34:17.877: I/dalvikvm(5225):   at java.lang.reflect.Method.invoke(Method.java:511)
09-24 20:34:17.877: I/dalvikvm(5225):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
09-24 20:34:17.877: I/dalvikvm(5225):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-24 20:34:17.877: I/dalvikvm(5225):   at dalvik.system.NativeStart.main(Native Method)
09-24 20:34:17.877: A/libc(5225): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 5225 (b.wallpapers.hd)

A: If you are using ics with version 4.1.2 or higher, you can check the issue discussed here.
It is mensioned that the latest versions of android uses a different kind of a garbage collector that handles big data in a different way and that causes a fatal signal. I had the same issue on Samsung Galaxy SIII and solved by using smaller images. You may load the smaller sizes of images into the splash screen (I thought you are developing a baground images application or something like that).

A: Try to reduce the size of the images you set as the source of the ImageViews. The problem is that Android can't allocate enough memory to hold the drawable of your ImageViews. So Start by analysing which image is too big and remember that it is the size of the decrompressed image that matters here (basically, height * width * 4 bytes).


text:
Q: General Formula for Defined Sequence While solving a programming challenge, I've had to efficiently evaluate the following function:
Given $n$ and $b$, return the number of natural numbers within the interval $[1, n]$ where bit index $b$ is set.
In set builder notation:
$$
|\{x | x \in \mathbb{N} \land 1 \leq x \leq n \land \operatorname{bit_set}(x, b)\}|
$$
For example, to compute the function at $n = 6, b = 2$:
1 => 0b001 & 0b100 => 0b000 > 0 => false
2 => 0b010 & 0b100 => 0b000 > 0 => false
3 => 0b011 & 0b100 => 0b000 > 0 => false
4 => 0b100 & 0b100 => 0b000 > 0 => false
5 => 0b101 & 0b100 => 0b100 > 0 => true
6 => 0b110 & 0b100 => 0b100 > 0 => true

2 true values. f(6, 2) = 2

I am searching for an efficient-to-compute form of this function. The method displayed above is very slow for large n.
The function clearly obeys some patterns. Here is a graph of some small values:

As is visible on the graph, each value of $b$ produces a staircase pattern. The number of points in the slants and flat parts of the shape are always the same.
Here is a link to a plotly with the data below. That also contains the raw term values. https://plotly.com/~carsonriker/1/

A: Your plot shows the key: starting from $0$ the $b$-th bit is $0$ for $2^b$ values, then $1$ for the next $2^b$, then repeating. Thus
$$f(n)=2^b\lfloor(n+1)/2^{b+1}\rfloor+f(r=(n+1)\bmod2^{b+1})$$
and the latter is easily seen to be $\min(0,r-(2^b-1))$.
The first term can easily be implemented by shifting, and the second is as easily evaluated by looking at the $2^b$ bit of $n+1$ and returning that bit multiplied by the bits to the right.


text:
Q: WCF Service Internal Fire/Forget Queue I'm currently implementing a service using WCF, which controls operations to a CRM database. I've implemented several aspects of CQRS to separate all operations into distinct Command and Queries.
Question 1:
Several of the Command Operations perform a relatively simple operation, but trigger a secondary, often more expensive operation. I've separated these triggers, but they still execute  within the original operation thread.
I was thinking of separating these into a second WCF service, with one-way operations. That way the original operation can return immediately, and the "Trigger" service can handle all of these secondary operations. Currently reliability is not a major issue, so issue logging would suffice - but could be extended in the future.
Is this the typical way for handling such a scenario? Or is there a way this could be completed without using a secondary service?
Question 2:
Are there significant performance improvements from dividing WCF services like this on the same server?
My thinking is that core WCF Service's application pool will be freed up quicker (although the new pools will be competing), with the possibility of separating additional services onto separate servers.

A: I agree with oleksii that a queue may be a better option than a WCF service if you're looking to scale.  It will also allow you to move your commands to be one-way and really just return to the user a basic ack/nack that the command was received and is being processed (not that it was processed).
I'd suggest you look at Greg Young's intro to CQRS document on his CQRS Info site, specifically in the Command Side section (about half-way down).
Getting to your questions:

*

*By moving to a queue or a WCF service that is all one-way, I think this solves your problem.  Your one-way service receives the command from the client and then hands it to your domain to process it.  Your domain would then fire off 0, 1 or many events based on what needs to be done -- these events could be calls to other WCF services in your application or they could be messages dropped on a queue picked up by your event handler.  The key is that you're letting the business rules (domain) determine what events to raise.  How they get handled specifically is an implementation detail (but I'd go with a queue or event store).  Check out Jonathan Oliver's Event Store.

*I think the faster you can free up IIS threads (or threads in general) is a good thing; so if you divide your services up into synchronous and asynch, that may be good.  I think if you're going the CQRS route, going one-way on your services to just return ack/nack messages is probably a good thing and may help you from a performance perspective since you'll probably free up threads faster to handle more requests.

I hope this helps.  Good luck!!

A: There's nothing stopping you from having synchronous commands and then having only some of the execution code run asynchronously without having to separate services.
You mentioned that you have separated your "triggers". I assume that means they run as separate methods? That being the case, you can easily run them in the background and let your main WCF thread return, without having to separate services. (The code below is NOT assuming event sourcing.)
public class MyCommandHandler
{
    public string Do(MyCommand1 command)
    {
        var myCrmObject = ... ; // load some object
        string message = myCrmObject.CriticalWork(command); // synchronous
        ThreadPool.QueueUserWorkItem(x => myCrmObject.OtherWork(command)); // async
        // async alternative 1
        //Action<MyCommand1> action = myCrmObject.OtherWork; // make into action delegate
        //action.BeginInvoke(null, command); // start action async, no callback
        // async alternative 1a - custom delegate instead of Action. same BeginInvoke call
        // async alternative 2 - Background Worker
        // async alternative 3 - new System.Threading.Thread(...).Start(command);
        return message; // will be here before OtherWork finishes (or maybe even starts)
    }
}

If you were using an event stream and event handlers to perform database writes and integrate with other systems, then this could be structured a bit better. You could have your individual event handlers worry about whether it should execute synchronously or not.

A: Just a suggestion

*

*You can try a working queue, some services on the front end asynchronously add items. Other services on the back end dequeue items and process the work. State of the work is saved to the persistent storage where it can be queried.

*It's better to have several workers on both sides of the queue, but for any improvements, your server needs to be multi-core (multi-processor), so it will be able to truly parallelise work. You may need to actually try different options and see what's best.


text:
Q: Costumize button_html in JsPsych Does anyone know how to specify the button_html, so it also allows for the participant to press 'r' on the keyboard to repeat the sound/trial? R doesn't need to be shown as a button on the screen it only needs to be possible to press it to repeat.
This is the code I've used:
  var sound_trial = {
    type: jsPsychAudioButtonResponse,
    stimulus: 'sound/Centrifuge.mp3',
    choices: ['img/test1.png', 'img/test2.png', 'img/test3.png', 'img/test4.png', 'r'],
    prompt: "
Hvilket billede passer til ordet?
",
    button_html: '</button>',
    name: 'soundtrial',
    on_finish: function (data) {
      jsPsych.data.addProperties({ sound: data.response });
      //jsPsych.data.displayData();
    }
  };

  var loop_node = {
    timeline: [sound_trial],
    loop_function: function(data){
        if(jsPsych.pluginAPI.compareKeys(data.values()[0].response, 'r')){
            return true;
        } else {
            return false;
        }
    }
  };

  timeline.push(loop_node);

Thank you in advance!


text:
Q: Case insensitive comparison on string fields of Record type Is there a way to substitute the comparison of string fields in a F# record class to be case-insensitive without having to take full custom control of equality/comparison?
Subtracting Records from a Set using case-insensitive comparison is the closest I have found to an answer.

A: If you want to do it in a clean way, I would suggest introducing a wrapper type for case insensitive strings. That way you can have the notion of case insensitive comparisons reflected in the types, and don't have to change the default structural comparisons on the records.
[<CustomEquality; CustomComparison>]
type CIString =
    | CI of string
    override x.Equals y = ...
    override x.GetHashCode() = ...
    interface System.IComparable with
        member x.CompareTo y = ...

I left out the implementation of the methods - there's nothing fancy there, just use ToUpperInvariant on the nested string whenever you access it.
Then you can modify your records like this:
type OldRecord = { field : string }
type NewRecord = { field : CIString }

and comparisons on the new type should show that { field = "TEST" } = { field = "test" }.
The other solution I suggested (reflection-based) would be easy to put in place for a simple case, but it's dodgy. Making it work in a sensible way for all the possible cases is a non-trivial exercise, if you can even establish what "sensible way" means here.


text:
Q: How can I safely (and easily) count *all* instances of a class within my program? I would like to be able to instantiate a particular (and otherwise normal) class (the source of which I can modify) and count the number of times the class has been instantiated (e.g. like this). But I would like to include all instances in my total count, even some which are created via the copy constructor in standard containers.
Would it be appropriate to have all the constructors (including the copy constructor) of my class increment a static counter? If so, is it possible to ensure my class still conforms to the requirements of standard containers (i.e., T(x) is equivalent to x), by overriding other operators for example?

A: A common way of accomplishing this is with a class template from which you inherit.
template <typename T>
class Countable
{
    static unsigned cs_count_;
public:
    Countable() { ++cs_count_; }
    Countable( Countable const& ) { ++cs_count_; }
    virtual ~Countable() { --cs_count_; }
    static unsigned count() { return cs_count_; }
};

template <typename T>
unsigned Countable<T>::cs_count_ = 0;

So to use this I would write:
class MyClass : public Countable<MyClass> { };

Below is a thread-safe version. It uses a class from boost to ensure the increment, decrement, and read operations are atomic on the supported platforms.
#include <boost/detail/atomic_count.hpp>

template <typename T>
class Countable
{
    static boost::detail::atomic_count cs_count_;
protected:
    ~Countable() { --cs_count_; }
public:
    Countable() { ++cs_count_; }
    Countable( Countable const& ) { ++cs_count_; }
    static unsigned count() { return cs_count_; }
};

template <typename T>
boost::detail::atomic_count Countable<T>::cs_count_(0);

A: Think of the static class variable as a global variable which is just in the namespace of the class. Incrementing or doing other things with it will not have any side effects on other code, i.e. your constructors and other operators will behave exactly as before.
I.e., you are right: Just increment in all constructors and decrement in the destructor.

Of course, as George pointed out, if you want to have it multithreading safe, you need to add some multithreading safe code around the access to your counter variable (for example some mutex). Or as Steven pointed out, you might also use atomic increment/decrement instructions (but the usage will depend on the platform). Those would be a lot faster. Though, you have to be careful because in some cases that wont work in multi-processor environments. You can use Boost's atomic_count to be on the safe side.


text:
Q: Select input field options being added outside select field I am building out a dynamic dropdown field that gets populated with all the "Saturdays" during a 3 month period. The dropdown is being populated correctly but I am getting duplicate 'options' added after the closing </select> input. I don't know what could be causing this. Below in the Javascript when I console.log(formatted); the values only appear ONCE in the Chrome console.
Wordpress, Contact Form 7
Dev: Laragon localhost
<select name="dates" class="wpcf7-form-control wpcf7-select wpcf7-validates-as-required span6 dates" aria-required="true" aria-invalid="false">
    <option value="0">Saturday, June 18</option>
    <option value="1">Saturday, June 25</option>
    <option value="2">Saturday, July 2</option>
    <option value="3">Saturday, July 9</option>
    <option value="4">Saturday, July 16</option>
    <option value="5">Saturday, July 23</option>
    <option value="6">Saturday, July 30</option>
    <option value="7">Saturday, August 6</option>
    <option value="8">Saturday, August 13</option>
    <option value="9">Saturday, August 20</option>
    <option value="10">Saturday, August 27</option>
</select>
// HERE'S the issue - Duplicate options added to my page
<option value="0">Saturday, June 18</option>
<option value="1">Saturday, June 25</option>
<option value="2">Saturday, July 2</option>
<option value="3">Saturday, July 9</option>
<option value="4">Saturday, July 16</option>
<option value="5">Saturday, July 23</option>
<option value="6">Saturday, July 30</option>
<option value="7">Saturday, August 6</option>
<option value="8">Saturday, August 13</option>
<option value="9">Saturday, August 20</option>
<option value="10">Saturday, August 27</option>

Contact Form 7
[select* dates class:span6 class:dates "Sat, Jun 04"]

Javascript
jQuery(document).ready(function($) {
// Date object
var date = new Date();
var year = date.getFullYear();
var this_month = date.getMonth();
var this_day = date.getDate();
var num_months = 3;
// Select input
var select = $('.contact .dates');
select.find('option').remove();

// 3 months of Saturdays
let index = 0;
for (var i = 0; i < num_months; i++) {
    var cur_month = this_month + i;
    // Loop through each day of the month
    for (var j = 0; j <= new Date(year, cur_month, 0).getDate(); j++) {
        var date = new Date(year, cur_month, j);
        // Find Saturdays and append option to select input
        if (date.getDay() == 6){
            let day = "Saturday, ";
            let dayNum = date.getDate();
            let month = date.toLocaleString('default', { month: 'long' });
            // Don't include past Saturdays for the current month
            if (dayNum<this_day && date.getMonth()==this_month){
                continue;
            }
            let formatted = day + month + " "+ dayNum;
            //let value = date.toString('dddd, MMMM ,yyyy');
            select.append($('<option></option>').attr('value', index).text(formatted));
            index += 1;
            console.log(formatted); // This only outputs once NOT twice
        }
    };
}
});

A: Since you're using Contact Form 7.  It seems to me that this would be easier with PHP and the CF7 Filter wpcf7_form_tag_data_option which is pretty much designed for this kind of thing.  It is with this filter that the CF7 developer created listo.
Doing this instead of using JS, ensures that the form will be rendered with the correct dropdown data before the page loads.
The form tag would then look like this:
[select* dates class:span6 class:dates data:saturdays]
So the function is pretty straight forward, and should be added to the functions.php of your theme/child theme, or implemented as another plugin if needed.
add_filter( 'wpcf7_form_tag_data_option', 'he_find_every_saturday', 10, 3 );
/**
 * Find Every Saturday in the next 3 months and return to CF7 Via DATA option.
 *
 * @param null  $data nothing if nothing is returned.
 * @param array $options the data option (in an array).
 * @param array $args if any additional args.
 * @return array|void
 */
function he_find_every_saturday( $data, $options, $args ) {
    if ( 'saturdays' === $options[0] ) {
        $start      = new DateTime();
        $end        = new DateTime();
        $end        = $end->add( new DateInterval( 'P3M' ) );
        $sat_period = new DatePeriod(
            $start,
            DateInterval::createFromDateString( 'next saturday' ),
            $end
        );
        $saturdays  = array();
        foreach ( $sat_period as $saturday ) {
            $saturdays[] = $saturday->format( 'l F, j' );
        }
        return $saturdays;
    }
}

This is tested and works.


text:
Q: Adding elements from first array to second array I have 2 arrays with me
First array
Array ( [2019-04-29] => Array ( [0] => 366 [1] => 82 [2] => 44 ) [2019-04-30] => Array ( [0] => 330 [1] => 115 [2] => 55 ) )

Second array
Array ( [0] => 492 [1] => 500 )

Need to merge these arrays with output like this.
Array ( [0] => Array ( [0] => 492 [1] => 366 [2] => 82 [3] => 44 ) [1] => Array ( [0] => 500 [1] => 330 [2] => 115 [3] => 55 ) )

Please help.

A: You can use array_walk and array_merge
$arr1 = Array (
        '2019-04-29' => Array (
                 '0' => 366,
                 '1' => 82,
                 '2' => 44
        ) ,
        '2019-04-30' => Array (
                '0' => 330,
                '1' => 115,
                '2' => 55
        )
);
$arr2 = Array ( '0' => 492 ,'1' => 500 ) ;
$index = 0;
$res=[];
array_walk($arr1, function($v,$k) use (&$res,$arr2,&$index){
  $res[] = array_merge(array($arr2[$index]),$v);
  $index++;
});
echo '<pre>';
print_r($res);

Result
Array
(
[0] => Array
    (
        [0] => 492
        [1] => 366
        [2] => 82
        [3] => 44
    )

[1] => Array
    (
        [0] => 500
        [1] => 330
        [2] => 115
        [3] => 55
    )

)

A: You can do this with a foreach loop and array_merge, after using array_values to reindex $array1 to numeric indexes starting with 0.
$array1 = array_values($array1);
foreach ($array2 as $k => &$v) {
    $v = array_merge(array($v), $array1[$k]);
}
print_r($array2);

Output:
Array
(
[0] => Array
    (
        [0] => 492
        [1] => 366
        [2] => 82
        [3] => 44
    )

[1] => Array
    (
        [0] => 500
        [1] => 330
        [2] => 115
        [3] => 55
    )
)

Demo on 3v4l.org

A: You can use array_walk and array_merge combination with traditional incrementer
array_walk($arr1, function (&$item, $key) use ($arr2,&$i) { // $i should change at memory address
    $item = array_merge($item, [$arr2[$i]]);
    $i++;
});

Output
Array
(
    [2019-04-29] => Array
        (
            [0] => 366
            [1] => 82
            [2] => 44
            [3] => 492
        )

    [2019-04-30] => Array
        (
            [0] => 330
            [1] => 115
            [2] => 55
            [3] => 500
        )

)

Demo.


text:
Q: How can I access the spelling check correction in LibreOffice Calc? LibreOffice Calc  5.0.4.2 on Ubuntu Linux 15.10 underlines misspelled words but does not display spelling check suggestions.
Is there a way to add spelling check suggestions to the right mouse click context menu?

A: It should work.  Here is what it looks like on my system, using LO 5.0.3.2 on Windows 10:

I also tested this for LO 4.2.8.2 on Ubuntu 14.04 and it worked.
It may help to review the spellcheck settings using this checklist.  Although the word is getting underlined, so I am not sure that is the problem.
Try upgrading to a newer version of LibreOffice and see if it works.
EDIT:
Now I see the problem.  It will not display the list of corrections if the row is too tall, or if the text in the cell is wrapped to multiple lines.
The behavior seems odd to me, and the help gives no indication of this.  You may want to consider filing a bug report.  It occurs on all systems and versions that I tested.


text:
Q: Edit Comment- Default post by pushing return key is annoying Sounds trivial, I know. But you are working on the text of your comment. In a small space. So the natural reaction is to get  a new line by hitting the return key. Wham, your half completed comment is posted AND you have only 5 minutes to get it right. Up goes the heart rate. Would it not be more friendly to have only the Add Comment button do the posting?

A: Well...since comments can't transcend multiple lines, there's no real reason to hit the return key until you're done writing it.  And if you run out of time, there's nothing wrong with copying the comment you half-started, deleting it, and starting fresh.
It took me a while to figure this out too, but once you train yourself out of writing formatted paragraphs in a comment, then this isn't that much of an issue.
Further, I would also disagree since it's counter-intuitive; there are forms all over the internet that treat the return key as "submit".  why would we want to break that in the case of comments?  Answers, I can see (and totally agree with; otherwise it would really suck to write answers).


text:
Q: Question about the minimal polynomial of an inseparable element in a field Let $K/F$ be a field extension. The characteristic of F is prime $p$. Suppose $\beta \in K$
is an inseparable element of degree $p$, show the minimal polynomial of $\beta$ in $F$.


text:
Q: "I draw myself" vs. "I draw me" "How can I draw myself using a mirror?" — I came across this question and couldn't help but wonder if it should be "draw me". Draw here is to mean "make a picture".
What do you think?

A: When the object of the verb is the same as the subject, the reflexive form of the pronoun is called for.  You are both the subject (the one doing the drawing) and the object (the one being drawn) and so the reflexive form is correct:  I draw myself.  Whether the verb is active or passive has no bearing.

A: When a person does something reflexively to oneself, the "self" part is necessary.
Examples:

I like myself.
  John likes himself.
  How does one award oneself?
  Jane was unable to draw herself.

A: Myself is correct. It replaces me as the object of a verb.


text:
Q: how i can get my current posiotion in alert dialog? How can I get my current position in AlertDialog
String text = String.format("Lat:\t %f\nLong:\t %f\nAlt:\t %f\nBearing:\t %f", location.getLatitude(), location.getLongitude(), location.getAltitude(), location.getBearing());
this.locationText.setText(text);

thx for help

A: Google provide plenty of documentation on this subject.
The important thing to remember is that getting a users current location can take time, a lot of time if they are using GPS. There are multiple approaches you can take, however if you want to display a dialog with location info quickly you should use 'getLastKnownLocation', it may not be accurate, but it will be fast.


text:
Q: How to deploy gem with related branch for different environments using Capistrano? I'm using Capistrano 3 to deploy a RoR application. I already have deployment scripts for different environments: stage, production, etc.
But I need possibility to deploy on these environments with different gem branches. For example, if I will deploy to production I want to use gem's master branch; if I will deploy to stage I want to use gem's develop branch and etc.
I already have solution with custom branch definitions for each environment like this for production:
gem 'custom-gem', git: 'path-to-git', branch: 'master'

But I need more flexible solution in Capistrano way, not custom definitions for each branch. Is it possible?

A: Move your gem to groups like in Gemfile
group :staging do
gem 'custom-gem', git: 'path-to-git', branch: 'stag'
end

group :production do
gem 'custom-gem', git: 'path-to-git', branch: 'master'
end


text:
Q: With nginx loadbalancer, do clients get redistributed after a member recovers? Suppose I have a simple setup where nginx is being used as a load balancer for two servers, using the ip_hash option.
upstream backend {
  ip_hash;

  server backend1.example.com;
  server backend2.example.com;
}

Clients will be distributed across the two servers based on the client IP.
Now suppose backend1 goes down. Clients that were previously sent to backend1 based on their hash will now get directed to backend2. That's fine. What happens later, when backend1 returns? Will all of the clients get 'stuck' on backend2? Or will the ones that were originally on backend1 migrate back?
I've looked at the docs, but the behavior is not clear to me.

A: The docs for the upstream module show options for
max_fails=number

sets the number of unsuccessful attempts to communicate with the server that should happen in the duration set by the fail_timeout parameter to consider the server unavailable for a duration also set by the fail_timeout parameter. By default, the number of unsuccessful attempts is set to 1

fail_timeout=time

the time during which the specified number of unsuccessful attempts to communicate with the server should happen to consider the server unavailable;
  and the period of time the server will be considered unavailable.
  By default, the parameter is set to 10 seconds.

Based on that, I have always believed that once you hit you max_fails threshold that nginx would offline that server for the fail_timeout then after the fail_timeout it would be placed back into service.


text:
Q: Are there any ways to create HTML report for NUnit3? I saw several solutions for NUnit 2.x version. For example, I can create XSLT, or use Allure Reporter.
But how can I do it for NUnit 3.x version (without writing my own XSLT for NUnit XML results)?
Allure does not work with NUnit3.

A: I would suggest using GHPReporter.
You can create reports for NUnit 3, SpecFlow and MSTest.
No additional attributes required for NUnit 3. Just set up addin (see short instruction in README file: https://github.com/GHPReporter/Ghpr.NUnit) and run your tests with NUnit3 Console.
View your report locally in Firefox:

*

*Go to about:config

*Find security.fileuri.strict_origin_policy parameter

*Set it to false
View your report locally in Chrome:

*

*Close your Chrome (all instances)

*Launch it with --allow-file-access-from-files option:
eg C:\PATH TO\chrome.exe --allow-file-access-from-files
Also see demo report here
EDITED
NUnitGo is no longer maintained.


text:
Q: How to express a child or even a grown-up who try to act floppily and sweetly so that you have to give them what they want? My children sometimes pull my hand in a floppy way and move around me and ask me sweetly and repeatedly "Daddy, could you buy me this toy?" or "Could you do this for me?"
Or sometimes my wife just moves floppily in front of me and rubbed my hair playfully and ask me sweetly and repeatedly something like "Honey, can we have a trip to Hawaii" or things like that.
In general, they try to be lovely to get me do what they want. They floppily convince me do something for them. Sometimes, I feel annoyed but sometimes I feel that is lovely.
Do we have a word for it in everyday English?
For example, "My children/wife are being kittenish/childish"


text:
Q: Pionion Docker is not working on background I am working on pionion for streaming.(https://pionion.github.io/docs/deploy/docker) I follwed their documentation and it worked fine for me. The command I used to run is "docker-compose up".
As I can't run this docker containers everytime so I run this docker containers on background using "docker-compose up -d" command. But it doesn't worked for me.
How can I run it on background and make it work as previous?
I want to up this streaming server for all time on background. So that I can use this without logging on the server.


text:
Q: Replace variable name in loop in R Is there a way to automate the following in a loop? rather than writing all by hand:
hour_1 <- aggregate(hour_1$freq, by=list(country=hour_1$country), FUN=sum)

hour_2 <- aggregate(hour_2$freq, by=list(country=hour_2$country), FUN=sum)

hour_3 <- aggregate(hour_3$freq, by=list(country=hour_3$country), FUN=sum)

hour_4 <- aggregate(hour_4$freq, by=list(country=hour_4$country), FUN=sum)

hour_5 <- aggregate(hour_5$freq, by=list(country=hour_5$country), FUN=sum)

hour_6 <- aggregate(hour_6$freq, by=list(country=hour_6$country), FUN=sum)

hour_7 <- aggregate(hour_7$freq, by=list(country=hour_7$country), FUN=sum)

hour_8 <- aggregate(hour_8$freq, by=list(country=hour_8$country), FUN=sum)

hour_9 <- aggregate(hour_9$freq, by=list(country=hour_9$country), FUN=sum)

hour_10 <- aggregate(hour_10$freq, by=list(country=hour_10$country),
FUN=sum)

I want smth like a for loop that takes the number of hours automatically.
Thx :)

A: Yes, but the best approach is to use lists and the lapply or sapply functions instead of loops.
hour.in <- mget( paste0('hour_', 1:10) )
hour.out <- lapply( hour.in, function(x) aggregate(x$freq,
    by=list(country=x$country), FUN=sum) )
names(hour.out) <- paste0('hour_', 1:10)

Now all the results are in hour.out and can be accessed individually, or further processed using lapply or sapply.


text:
Q: Discord python unban member Ok, my ban command works ban(member), however when doing the same except using unban(member) the output is always that the user wasn't found.
Here's the code of the ban command, what's the correct usage of the unban command?
@commands.command(pass_context = True)
@commands.has_permissions(ban_members=True)
async def ban(self, ctx, member:discord.Member=None):
    """Bans a member."""
    if not member:
        await self.bot.say("Who would you like me to ban, {0.mention}?".format(ctx.message.author))
        pass
    await self.bot.ban(member)
    await self.bot.say(f"{member.mention} got banned, what a shame...")
    print(colored('moderation.clf: ', 'blue'), colored('Banned member', 'white'))

A: Since members represent users inside a server you can't have a member instance for a user that is currently banned. You have to use the User instance which is not server-specific to unban, for example await self.bot.unban(server, user) where server is of type discord.Server and user of type discord.User.


text:
Q: Indexpath.row not working while getting record from NSMutableArray I'm trying to load the data UITableViewwhich is coming from webservice. Everything is working fine. But, whenver the record is being displayed in UITableView using -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath delegate method i'm getting exception like below-

Here is my code -
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell; //= [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Reuse_Cell"];
    UILabel *label = nil;

    cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
    cell.selectedBackgroundView = [[UIView alloc]init];
    if (cell == nil)
    {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];

        label = [[UILabel alloc]initWithFrame:CGRectZero];
        [label setLineBreakMode:UILineBreakModeWordWrap];
        [label setNumberOfLines:1];
        [label setFont:[UIFont fontWithName:@"Trebuchet MS" size:18]];
        [label setTag:1];
        label.backgroundColor = [UIColor clearColor];
        label.textColor = [UIColor blackColor];
        [[cell contentView] addSubview:label];

    }

    if (!label)
        label = (UILabel *)[cell viewWithTag:1];

    [label setText:[[webserviceRecords objectAtIndex:indexPath.row] objectForKey:@"catName"]];
    [label setFrame:CGRectMake(10.0, 5.0, 225.0, 35.0)];

    cell.selectedBackgroundView.backgroundColor = RGBACOLOR(151.0, 191.0, 69.0, 1.0);
    cell.layer.borderWidth = 2.0f;
    cell.layer.borderColor = RGBCOLOR(214, 218, 1).CGColor;

    return cell;
}

My Array records -
http://pastie.org/7120406
Custom init method
- (id)initwithInteger:(NSInteger )integer
{
    self = [super init];
    if (self) {
        startingpage = integer;
        webserviceRecords = [[NSMutableArray alloc]init];
    }
    return self;
}

NumberofRowsInSection
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    NSLog(@"Row count - %d", [webserviceRecords count]);
    return [webserviceRecords count];
}

A: You're setting the cell's selectedBackgroundView before checking that the cell has a value. You should check if the cell is nil first before doing that.
On a side note, you may find it much easier to display your array using the free Sensible TableView framework. The framework generates all the cells automatically from your array (including all the detail views), and can even fetch the data from the web service directly if you wish. Should save you a lot of headache and manual work. Hope this helps.

A: Really a silly mistake was there. I've parsed the JSON data directly into my NSMutableArray I've parsed like below first -
webserviceRecords = [NSJSONSerialization JSONObjectWithData:mutableData options:0 error:&error];

Instead of this i've fixed this like below -
NSArray *array = nil;
array = [NSJSONSerialization JSONObjectWithData:mutableData options:0 error:&error];
webserviceRecords = [array mutableCopy];

It helps me to fix my issue. Thanks for responsing my question.
Cheers!


text:
Q: Full list of variables that can be used in a vim statusline Following on from this question - I was wondering if there was a list of all the variables that you can use in the status line in vim - e.g %F seems to be full file path and %L seems to be 'total number of lines - would anyone have a link to a comprehensive listing of all of the magic variables?

A: That information can be found under :help 'statusline'; all options are single-quoted in the Vim help. There's a link from :help status-line, too.
Learn how the excellent and comprehensive :help is structured; all the information is in there (you just need to know how to find it)!
Additionally, with the %{...} syntax, you can include arbitrary Vimscript expressions in the statusline as well, so you have all the flexibility you need. Plugins like airline showcase what is possible there; it might be worth exploring plugins like those before rolling your own.


text:
Q: How to make Doxygen documentation that helps in understanding the code? So a few years ago I came across a statement that most of the Doxygen generated documentation out there is quite bad.  "Bad" in the sense that defies the purpose of documentation and doesn't help in understanding the code. To an extent,  I think this also applies to other automatic documentation generators.
The majority of Doxygen-ated stuff I have seen was okay; you could work with it. Of course there's always the really bad apple that leaves scars in your memory.
So far, I've not come across some documentation which made me go: "Oh, wow, this is written really well, I love it."
My question(s):

*

*What should a developer do in order to avoid auto-generating bad documentation that doesn't help future developers?

*And are there additional things that could be done that would make the auto-generated documentation good so it actually helps future developers?

A: Generated documentation's audience is developers who are trying to use the code. Meaning the code is a reusable library or framework.
If code is named and structured properly, documentation is not as important. I have found that the most important documentation is at the class or module (namespace, package, etc) level. The least important documentation is at the function or method level.
In order to make the documentation meaningful and useful to developers, be sure to describe the purpose of classes and how they are used together. If I have an e.g. PrintJob class, I know what it is. But how does it interact with a PrintManager or PrinterProperties? What is the process of taking an object and printing it? How do these objects work together? I would expect to see a short code example showing the class interactions.
Generated documentation must also include pre- and post-conditions in plain English at the function level where appropriate. If your print() function expects a job to be in a certain state, tell me. I do not want to dig around in the code to decipher what it needs. Once the printing is done, can I reuse the job to print a second copy or is it now invalid?
Finally, omit documentation for entities that truly are simple and do not need it. If you have a List, you do not need to document the size() function. I understand it will be a nonnegative integer, and based on the data type, I know how big it can be. This reduces fluff. When I am scanning documentation, I know that if I see text, it is important. It is not documenting something that is common-sense to a developer.


text:
Q: autocompletar input con un valor anterior tengo como un pequeño formulario, uno de los campos es n° de factura, lo que necesito es que al momento de generar otra fila, el campo de n° de factura se autocomplete con el valor de la primera vez que los escribi, sin necesidad de volverlo a escribir

  <form action="POST">

   N° Referencia:<input type="TEXT" name="nfactura" id="factura">
   Descripcion <input type="TEXT" name="descripcion" id="descripcion">
   Modelo:<input type="TEXT" name="modelo" id="modelo">
   Serial:<input type="TEXT" name="serial" id="serial">
     Add More

   <input type="SUBMIT" name="submit">
  </form>

A: Tal vez agregando tu html a una función para que puedas mandar como parámetro la factura pueda servirte, mira el código como lo modifique seguro te sirve.
EDIT:
Explicacion:
Uso un ternario (fact ?: '') para evaluar en caso de que fact exista, te retornara al input fact dentro de value, en caso contrario no hace nada dentro del value.

$(document).ready(function(e) {
  //Variables
  function inputs(fact) {
    return '

N° Factura:<input type="TEXT" name="nfactura" id="childnfactura" value=' + (fact ? fact : '') + '>Descripcion: <input type="TEXT" name="descripcion"    id="childdescripcion"   /> Modelo: <input type="TEXT" name="modelo"  id="childmodelo"  /> Serial: <input type="TEXT" name="serial"    id="childserial" /> X
';
  }

  var maxrows = 5;
  var x = 1;
  //agregar filas al form
  $("#add").click(function(e) {
    //let factura = $('#childnfactura').val();
    let factura = $('#factura').val();
    $("#container").append(inputs(factura));
  });
  //remover filas del form
  $("#container").on('click', '#remove', function(e) {
    $(this).parent('div').remove();
  });
});
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet" />

  <form action="POST">

      N° Referencia:<input type="TEXT" name="nfactura" id="factura"> Descripcion <input type="TEXT" name="descripcion" id="descripcion"> Modelo:
      <input type="TEXT" name="modelo" id="modelo"> Serial:
      <input type="TEXT" name="serial" id="serial">
       Add More

    <input type="SUBMIT" name="submit">
  </form>