text:
Q: Dates not printing using BibLaTeX I'm using biblatex to process the bibliography for my dissertation using APA. The problem is that dates are not being printed; the dates are being replaced by a n.d. and this is not correct because my .bib file has dates.
This is my MWE:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{mwerefs.bib}

@MISC{MacLachlan2006,
author = {{MacLachlan}, Anne J.},
title = {Developing graduate students of color for the professoriate in Science,
Technology, Engineering and Mathematics {(STEM)}},
year = {2006},
owner = {Ricardo Gomez},
publisher = {University of California, Berkeley, Center for Studies in Higher
Education},
timestamp = {2013.04.27}
}
@TECHREPORT{George2001,
author = {George, Y. S. and Neale, D. S. and Horne, V. V. and Malcolm, S. M.},
title = {In pursuit of a diverse science, technology, engineering, and mathematics
workforce: Recommended research priorities to enhance participation
by underrepresented minorities},
institution = {American Society for Advancement of Science {(AAAS)}},
year = {2001},
address = {Washington, {DC}},
owner = {Ricardo Gomez},
timestamp = {2013.04.27},
url = {http://ehrweb.aaas.org/mge/ Reports/Report1/AGEP/AGEP_report.pdf}
}
@ARTICLE{Dubin2000,
author = {Dubin, Jon C.},
title = {Faculty diversity as a clinical legal education imperative},
journal = {Hastings Law Journal},
year = {2000},
volume = {51},
pages = {445--478},
number = {3},
owner = {Ricardo Gomez},
timestamp = {2013.04.27}
}
@ARTICLE{Alger1999,
author = {Alger, Jonathan},
title = {When Color-Blind is Color-Bland: Ensuring Faculty Diversity in Higher
Education},
journal = {Stanford Law and Policy Review},
year = {1999},
volume = {10},
pages = {191--204},
number = {2},
owner = {Ricardo Gomez},
timestamp = {2013.04.27}
}
@ARTICLE{Carrell2010,
author = {Carrell, Scott E. and Page, Marianne E. and West, James E.},
title = {Sex and Science: How Professor Gender Perpetuates the Gender Gap},
journal = {The Quarterly Journal of Economics},
year = {2010},
volume = {125},
pages = {1101--1144},
number = {3}
}
\end{filecontents}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=apa, doi=false]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
%\usepackage[citestyle=authoryear]{biblatex}
\addbibresource{mwerefs.bib}

\begin{document}

Several policy mechanisms have been implemented to reduce social, ethnic, and gender disparities in STEM education, including scholarships or loans for promising students, and alternative admission policies. A more recent policy mechanism, however, seeks to develop a pool of suitable individuals from traditionally underrepresented groups in STEM who can become faculty and mentors. This approach---known as the Alliance for Graduate Education and the Professoriate (AGEP)---resonates with research and anecdotal evidence that suggests that faculty who share the same background as their students can serve as effective role models \parencite{Carrell2010} since they are in a better position to understand their needs, expectations, and challenges, and this, in turn, can translate to higher enrollment and retention rates, and better race relations on campus \parencite{Alger1999, Dubin2000, George2001, MacLachlan2006}.

\printbibliography

\end{document}

A: Important test could be style=authoryear
try this
\usepackage[backend=biber,style=authoryear]{biblatex}

and see if it works. That should definitely work. Unfortunately, it is a different type of citation and you obviously would like to have APA and not humanities-style citations. The reason I suggest this is because you can use it as a test on your system. If it fails to produce an output with years, then it is likely that your typesetting system has a problem.
egreg's comment of \parentcite is correct + henriques recompiling suggestion.

FYI, I just typeset the original code provided in your post and I saw dates, not n.d. (no date)
Order of commands:

*

*xelatex

*bibtex

*xelatex

*xelatex


text:
Q: Books Preparatory for Putnam Exam I am extremely interested in the Putnam competition. Given that I am currently in 11th grade (so I have 12th grade and half my freshman year to study (plus summers and vacations, etc..)), what resources would you recommend to me?
I have done some research and found the following books. Is it advisable to use them to study for Putnam?

*

*Principles of Mathematical Analysis -- Rudin

*Real Mathematical Analysis -- Charles Pugh

*Problem Solving Strategies -- Arthur Engel

*Putnam and Beyond -- Andreescu

*Calculus -- Spivak

A: Take a look at the following links:

*

*https://www.math.hmc.edu/putnam/ (Now only visible to HMC students, archived link

*Studying for the Putnam Exam

*http://www.quora.com/What-is-the-best-way-to-prepare-for-the-Putnam-Competition

*http://web.unbc.ca/~bluskovi/teaching/putnam/putnam.html

*https://answers.yahoo.com/question/index?qid=20100424024154AAxsocy
You can find good books scattered throughout the links. For a link which lists out the best references there without any clutter, click here: http://www.math.illinois.edu/~hildebr/putnam/resources.html
To relay a part of the content of the above link:-
[Beginner] A. Gardiner, The Mathematical Olympiad Handbook. The first part
of this book contains a brief, but very handy collection of useful tools from
algebra, geometry, number theory, and other areas. (The "Beginner" rating
applies to this part. The second part, containing problems from the British
Mathematical Olympiad, is much more challenging.)
_
[Beginner-Intermediate] E. Lozansky and C. Rousseau, Winning solutions, A good
introduction to some useful background material from number theory, algebra,
and combinatorics, and to problem-solving techniques.
_
[Beginner-Advanced] Arthur Engel, Problem solving strategies, A huge (1300+)
collection of problems, with solutions, grouped by subject and proof technique.
The problems range from easy to extremely challenging.
_
[Intermediate-Advanced] Loren Larson, Problem solving through problems, A
systematic treatment of problem-solving techniques, illustrated by Putnam level
problems. Considerably more advanced than Lozansky/Rousseau, with the main
focus on techniques rather than theorems.
_
[Intermediate-Advanced] Paul Zeitz, The Art and Craft of Problem Solving.,
An excellent book for self-study for more advanced students. Problems are
grouped by technique and by subject.
_
[Advanced] D.J. Newman, A problem seminar. A collection of 100+ carefully
selected--and quite challenging--problems, with hints and solutions.
_
[Advanced] R. Gelca and T. Andreescu, Putnam and Beyond. At 800 pages,
with 1100 problems, all with complete solutions, this is by far the largest
and most comprehensive Putnam training book. The level is fairly advanced
and probably too much for all but the most experienced Putnam students.

Also, a personal recommendation includes http://www.amazon.com/The-Art-Problem-Solving-Vol/dp/0977304582, which, as a tenth grader, I find very interesting to solve problems from {Just got Principles of Mathematical Analysis today myself!).

Finally, I would like to say please have a look at problems scattered throughout the internet in sites like AOPS and MSE. Wishing you all the best for your studies; hope you have fun!

redpajama_set_name: RedPajamaStackExchange


text:
Q: Is there a monster behind the trees? First Fix the following notation:

$\forall \kappa\in Card~~~Tp(\kappa):="\kappa~has~tree~property"$

The large cardinals as "monsters of heaven" live everywhere in the land of mathematics. Most of them appear in topology, measure theory, infinitary logic, category, model theory, etc. But some of them live in a strange misty place, "the forest of tall trees"! One of the most important problems of set theory is to discover that which one of these monsters have a forestial nature? The forestial nature of a monster gives us very important information about his possible behavior at many combinatorial situations in set theory and model theory. Now define the following concepts:

Definition (1): Let $A$, $B$ be large cardinal axioms, $I$, $J$ be sub classes of $Ord$ , $\lbrace \alpha_{i}\rbrace_{i\in I}, \lbrace \beta_{j}\rbrace_{j\in J}\subseteq Ord$ , $\lbrace \alpha_{i}\rbrace_{i\in I}\cap \lbrace \beta_{j}\rbrace_{j\in J}=\emptyset$
then respectively every statement in the form $(\star)$ and $(\star\star)$ called a "weak" and "strong" tree property "equation".

$(\star)~~Con(ZFC+A+\bigwedge_{i\in I}Tp(\aleph_{\alpha_{i}}))\Longleftrightarrow Con(ZFC+B+\bigwedge_{j\in J}Tp(\aleph_{\beta_{j}}))$

$(\star\star)~~(A+\bigwedge_{i\in I}Tp(\aleph_{\alpha_{i}}))\Longleftrightarrow (B+\bigwedge_{j\in J}Tp(\aleph_{\beta_{j}}))$

Example (1): Note to the following well known results:

A weak tree property equation:

$Con(ZFC+Tp(\aleph_{2}))\Longleftrightarrow Con(ZFC+\exists~a~weakly~compact~cardinal)$

A strong tree property equation:

$(\kappa~is~strongly~inaccessible~+~Tp(\kappa))\Longleftrightarrow (\kappa~is~weakly~compact)$

Remark (1): It seems there are many weak tree property "unequalities" like the following results, but strangely the weak and strong "equalities" are too rare. These equalities uncover some fundamental relations between large cardinal axioms and combinatorial properties of other cardinals and so could be very useful and valuable.

A weak tree property unequality discoverd by Menachem Magidor:

$Con(ZFC+ \exists~\mathtt{0}^{\sharp})\Longleftarrow Con(ZFC+Tp(\aleph_{2})+Tp(\aleph_{3}))$

Another weak tree property unequality discoverd by Uri Abraham:

$Con(ZFC+\exists~a~supercompact~cardinal~with~a~weakly~compact~cardinal~above~it) \Longrightarrow Con(ZFC+Tp(\aleph_{2})+Tp(\aleph_{3}))$

Question (1): Is there any known large cardinal axiom stronger than "$\mathtt{0}^{\sharp}$ exists" and weaker than "there is a supercompact cardinal with a weakly compact cardinal above it " like $A$ in which we have an "weak tree property equality" in Magidor and Abraham's results? What about "strong tree property equality"? In the other words: is there any large cardinal axioms $A$, $B$, $C$ which the following statements be true?

$(1)~Con(ZFC+A)\Longleftrightarrow Con(ZFC+Tp(\aleph_{2})+Tp(\aleph_{3}))$

$(2)~B \Longleftrightarrow (C+Tp(\aleph_{2})+Tp(\aleph_{3}))$

Question (2): Are there any other known weak or strong tree property equality different from statements in example $(1)$?

A: For a strong special tree property equation, here is Theorem 9.4 in Todorcevic´s "Coherent Sequences":

$\kappa$  is strongly inaccessible + $sTp(\kappa) \Longleftrightarrow \kappa$ is Mahlo.

Where $sTp(\kappa)$ would mean "there are no special $\kappa$-Aronszajn trees".


text:
Q: Adding raster from attribute table? I have a table("ecw") with a field ("raster_path") which contains the paths of many rasters (ecw type)
Selecting several rows from the table, I Would like to add the rasters into my dataframe.
How do I do it?
(Sorry if my english is not good; It isn't my native languaje)

A: My solution is more arcpy based.  I would run this from the interactive window.  I left some spots in there for you to add your own information/query/etc.  I borrowed some of the raster code from this other post.
#get the mxd you're in
mxd = arcpy.mapping.MapDocument("CURRENT")

#get the dataframe
df = mxd.activeDataFrame

#select the records via your query
arcpy.SelectLayerByAttribute_management("TABLENAME", "NEW_SELECTION", "WHERE QUERY OF SORTS")

#create a cursor to go through those records
rows = arcpy.SearchCursor("TABLENAME")

#go through the records
for row in rows:
    #get the path
    tablePath = row.getValue("raster_path")
    #set up the new raster layer
    rasterLayer = arcpy.MakeRasterLayer_management(tablePath, "NAME FOR THE LAYER")
    #get the output from the in memory layer
    addLayer = rasterLayer.getOutput(0)
    #insert into the data frame
    arcpy.mapping.AddLayer(df, addLayer, "AUTO_ARRANGE")

del rows

A: Thank's for your answer. I applied your code to my work.
but it doesn't works good.The first raster is added correctly,but it is no one of the  selected raster in the table.
I think the code tries to add all the files.
And then, the code show this message:
Runtime error
Traceback (most recent call last):
  File "", line 20, in
NameError: name 'result' is not defined
Mi code is this:
#get the mxd you're in
mxd = arcpy.mapping.MapDocument("CURRENT")

#get the dataframe
df = mxd.activeDataFrame

#select the records via your query
arcpy.SelectLayerByAttribute_management("CATALUNA_2013", "NEW_SELECTION")

#create a cursor to go through those records
rows = arcpy.SearchCursor("CATALUNA_2013")

#go through the records
for row in rows:
    #get the path
    tablePath = row.getValue("FILENAME")
    #set up the new raster layer
    rasterLayer = arcpy.MakeRasterLayer_management(tablePath, row.NAME)
    #get the output from the in memory layer
    addLayer = result.getOutput(0)
    #insert into the data frame
    arcpy.mapping.AddLayer(df, addLayer, "AUTO_ARRANGE")

del rows


text:
Q: Is the way to show two sequence are the same? Suppose this pattern $$1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35, 37,...$$ I find Two sequences that shows this pattern .
$$a_n=\frac{(6n+(-1)^n-3)}{2} \tag{1}$$and
$$b_{n+3}=b_{n+2}+b_{n+1}-b_{n}  \tag {2}$$ both of them work here .
Is there a way to show (1),(2) are the same ?
 1.Without writing $1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35, 37,...$
2.Without find recursion formula of $b_n$
Thanks in advance.

A: $$a_{n+2}+a_{n+1}-a_n=$$$$\frac12[(6n+12+(-1)^{n+2}-3)+(6n+6+(-1)^{n+1}-3)-(6n+(-1)^n-3)]=$$$$\frac12[6n+9+(-1)^{n+3}-3]=a_{n+3}$$
So $(b_n)_n$ and $(a_n)_n$ have an equal recurrence relation.
Then $a_1=b_1\wedge a_2=b_2\wedge a_3=b_3$ is enough to conclude that the sequences are the same.
This is formally proved by induction: $$a_n=b_n\wedge a_{n+1}=b_{n+1}\wedge a_{n+2}=b_{n+2}\implies a_{n+3}=b_{n+3}$$

A: I tried induction. It works fine !
It is now your turn to prove:
If $a_1=1, a_2=5, a_3=7$ and $a_{n+3}=a_{n+2}+a_{n+1}-a_n$ for $n \ge 1$, then
$a_n=\frac{(6n+(-1)^n-3)}{2} $  for all $n$.

A: $$a_n=\frac{(6n+(-1)^n-3)}{2} \\a_{n+1}=\frac{(6n+6-(-1)^n-3)}{2}\\
a_{n+2}=\frac{(6n+12+(-1)^n-3)}{2}\\
a_{n+3}=\frac{(6n+18-(-1)^n-3)}{2} $$now you can put tehm to check ,is the $$b_{n+3}=b_{n+2}+b_{n+1}-b_{n}  \tag {2}$$ correct ?


text:
Q: How to change project item icon programmatically Do you know how to change the c# file type icon marked bellow image(Startup.cs) temporary based on some condition for menu item click in VSIX extension development project.
I couldn't find any article in MSDN or somewhere regarding this.
Thank you.


text:
Q: What is the expected value of $X^2$ when $X\backsim \frac{n+1}{n}Y$ and $Y\backsim f(y\mid \theta )=\frac{n}{\theta}(\frac y \theta)^{n-1}$ Here's the question again: what is the expected value of $Z^2$ when $Z\backsim \frac{n+1}{n}Y$ and $\displaystyle Y\backsim f(y\mid\theta )=\frac{n}{\theta}\left(\frac y \theta \right)^{n-1}$ from $0$ to $\theta$
I know the set up of the problem is to make it $$\int_0^\theta z^2f(z\mid \theta) \, dz $$ but the problem is how to figure out the density for z is. I also do not know what the variance is, so I cannot use that formula to figure that out.

A: $$
\operatorname{E} \left( \left( \frac {n+1} n Y \right)^2 \right) = \left( \frac {n+1} n \right)^2 \operatorname{E}(Y^2).
$$
So you need to find $\operatorname{E}(Y^2)$.
\begin{align}
\operatorname{E}(Y^2) & = \int_0^\theta y^2 \Big( \frac n \theta \left( \frac y \theta\right)^{n-1} \, dy\Big) = \theta^2 \int_0^\theta \left( \frac y \theta\right)^2 n\left( \frac y \theta \right)^{n-1} \frac{dy} \theta \\[10pt]
& = \theta^2 \int_0^1 u^2\cdot nu^{n-1} \, du = \theta^2 \frac n {n+2}.
\end{align}
PS: If you're ultimately looking for $\operatorname{var}\left( \dfrac{n+1} n Y \right)$, you will have
\begin{align}
& \operatorname{var}\left( \frac {n+1} n Y \right) = \left( \frac {n+1} n \right)^2 \operatorname{var}(Y) = \left( \frac {n+1} n \right)^2 \Big( \operatorname{E} (Y^2) - \left( \operatorname{E}(Y) \right)^2 \Big) \\[10pt]
= {} & \left( \frac{n+1} n \right)^2 \left( \theta^2 \left( \frac n {n+2} \right) - \theta^2 \left(\frac n {n+1}\right)^2 \right) = \cdots
\end{align}
ok, so far --- what is just above is routine.  The next part is trivial and thus you may think it doesn't need much attention, but the answer is somewhat enlightening: If I'm not mistaken, it comes down to this:
$$
\frac {\theta^2}{n(n+2)}.
$$


text:
Q: Is it possible to execute Python scripts within a rst file? I have multiple example scripts in a rst file (for documentation purposes), is it possible to make a script that will go through and run them all? Also, if not, would there be a better way to document these examples so it's easier to test?
It looks something like this:
********
Examples
********

Example 1
=========

::

   *SCRIPT 1*

Example 2
=========

::

   *SCRIPT 2*


text:
Q: How to call a node.js function from an express rendered ejs webpage I have an express server that has a button that issues a POST which activates a function in my node.js server.
Instead of sending a post, I would like to do something kind of like AJAX because I don't want a new page to load. If I use a Javascript button, is there a way I can directly call a function defined in the node.js server instead of having to send a post?
I noticed that JSON values can be passed into the .ejs webpage when it's rendered, but I haven't been able to get it to work for functions.

A: You can use Socket.io to emit an event from the browser, and than listen for that event on the server to act on it.
Socket.io works flawlessly with express http://socket.io/#how-to-use

A: Take a look at nowjs.  It lets you very easily invoke functions on the server from the client and vice-versa:
From the site:

*

*NowJS creates a magic namespace "now", accessible by server and client

*Functions and variables added to now are automatically synced, in real-time

*Call client functions from the server and server functions from client


text:
Q: Reference for Calderon-Zygmund $L^p$ inequalities on the sphere The following question is motivated from Chapter 2 (Generalized Hodge Systems in 2D), particularly Section 2.3 ($L^p$ theory for Hodge systems in 2D) of Christodoulou and Klainerman's book, The global nonlinear stability of the Minkowski space.
In this section (page 43, in my copy), the authors state that the Calderon-Zygmund inequalities on the standard unit round 2-sphere imply that for a Hodge system of the form
$$
\text{div}\xi = f \\
\text{curl}\xi = g
$$
one has the estimates
$$
\int_S |\nabla \xi|^p + |\xi|^p \leq C_p\int_S |f|^p + |g|^p.
$$
Here, $S = S^2$ is the standard unit round sphere, and $\xi$ is a 1-form on $S$, while $f, g$ are scalar functions on $S$. The divergence and curl are
$$
\text{div} \xi = g^{AB}\nabla_A \xi_B, \ \ \ \ \text{curl}\xi = \epsilon^{AB}\nabla_A \xi_B
$$
where $g$ is the unit round metric on $S$ and $\epsilon$ is the corresponding volume form.
I'm looking for a reference for this fact and the theory behind it. I have only seen Calderon-Zygmund inequalities briefly in the context of Euclidean space $\mathbb{R}^d$, and I have not seen them applied to Hodge systems.
For a more complete summary, here is the statement of the lemma.
Lemma 2.3.1. Let $\xi$ be a 1-form on $S = S^2$ solving the equations
$$
\text{div} \xi = f
$$
$$
\text{curl} \xi = g.
$$
For every $1 < p < \infty$, there exists a constant $C_p$ such that
$$
\int_S |\nabla \xi|^p + |\xi|^p \leq C_p\int_S |f|^p + |g|^p
$$
and
$$
\int_S |\nabla^2 \xi|^p \leq C_p\int_S |\nabla f|^p + |\nabla g|^p + |f|^p + |g|^p.
$$
All integrals are with respect to the volume form on $S$.

A: I don't know of an exact reference, and in general this sort of result (transfering a "classical" result from the analysis of PDE in $\mathbb{R}^n$ to Riemannian manifolds) is often quite hard to track down. Instead, I can explain how you derive the inequalities you want from the standard Calderon-Zygmund estimates for domains in $\mathbb{R}^n$. What follows is quite long for a MathOverflow answer, but I've tried to be as complete as possible. It is a "standard" patching argument to turn estimates from $\mathbb{R}^n$ into estimates on a manifold. I don't remember where I learned this sort of argument from (maybe Wells' book on analysis on complex manifolds?) but it is ubiquitous in geometric analysis.
Take a deeep breath, and here we go.
There are two important hypotheses which mean the result holds. Firstly the system you are interested in is elliptic. Secondly there is no kernel, i.e. no solutions to the homogeneous equation. I will explain the result in this sort of generality (linear elliptic systems over a compact Riemannian manifold) since it's less notation and no more extra thought.
So, let $(M,g)$ be a compact Riemannian manifold with vector bundles $E, F \to M$ and let $L$ be a linear differential operator taking sections of $E$ to sections of $F$. In your case, $M=S^2$ is the shpere, $E=T^*S^2$ is the cotangent bundle and $F$ is the sum of two real line bundles: $F = \underline{\mathbb{R}} \oplus \Lambda^2T^*S^2$. Your operator is:
$$
L(\alpha) = (\mathop{div}(\alpha), \mathop{curl}(\alpha))
$$
We aassume that $L$ is elliptic. This means that the principal symbol in any given cotangent direction is an isomorphism $E \to F$. This is the case for your $L$ because the symbol in the direction $\beta$ is given by
$$
\sigma_L(\beta)(\alpha) = ( g(\alpha,\beta),  \beta \wedge \alpha)
$$
(To see that $\sigma_L$ is an isomorphism it's enough to check it has no kernel.)
The first estimate I will explain is that for any elliptic $L$, any $k \in \mathbb{N}$ and any $p \in (1,\infty)$, there is a constant $C$ (which depends on $L,k,p$) such that for any section $s$ of $E$,
$$
| s |_{L^p_{k+r}} \leq C \left( | L(s)|_{L^p_k} + |s |_{L^p}\right)
$$
Here $r$ is the order of $L$ (so $r=1$ in your cases). Meanwhile, $L^p_k$ means the Sobolev norm given by taking the sum of the $L^p$ norms of derivatives up to order $k$, all defined using the Riemannian metric $g$. We also need to fix a choice of fibrewise innerproduct in both $E$ and $F$,as well as connections in the bundles. (Your question only asks about $k=1,2$.)
To prove this estimate, use a partition of unity to write $s = \sum \phi_i s$ where each $\phi_i$ is supported in a small coordinate chart. Suppose moreover that $E$ and $F$ are both trivial over each of these coordinate patches. Now on any single coordinate chart, $\Omega_i$, you can treat everything as if it were taking place on vector valued functions on $\mathbb{R}^2$. Apply the classical Calderon-Zygmund inequality to obtain:
$$
| \phi_i s |_{W^p_{k+r}(\Omega_i)} \leq C| L(\phi_i s)|_{W^p_k(\Omega_i)}
$$
where here $W^p_k(\Omega_i)$ means using the Euclidean $(p,k)$-Sobolev norm for vector valued functions on $\Omega_i \subset \mathbb{R}^n$. It is important here that $\phi_i s$ is compactly supported in $\Omega_i$.
To get a global inequality over the whole of $M$, we need to do two things: Firstly, we need to compare the $W^p_k(\Omega_i)$ norm and $L^p_k(\Omega_i)$ norm for sections supported in $\Omega_i$. It turns out that there is a constant $K>0$ such that for any section of $E$ or $F$ supported in $\Omega_i$,
$$
\frac{1}{K} | s |_{L^p_k(\Omega_i)} \leq | s|_{W^p_k(\Omega_i)} \leq K | s|_{L^p_k(\Omega_i)}.
$$
The constant $K$ will depend on $\Omega_i$, because we need to compare $g$ to the Euclidean metric on each chart $\Omega_i$ (and also our connections on $E$ and $F$ to the trivial connection). When $M$ is compact, there are only finitely many charts, so we can use the same $K$ for all of them. (When $M$ is not compact, one needs to assume some uniform geometric bounds here.)
From here we see that for any section $s$ at all,
$$
| s|_{L^p_{k+r}(M)}
\leq K \sum | \phi_i s|_{W^p_{k+r}(\Omega_i)} \leq CK^2 \sum | L(\phi_i s)|_{W^p_k(\Omega_i)}
$$
where the second inequality is Calderon-Zygmund in $\Omega_i$.
Next, we need to relate $L(\phi s)$ to $\phi_i L(s)$. We do this via the Leibniz rule. The difference $L(\phi_i s) - \phi_i L(s)$ is an expression in which we see terms with at most $r-1$ derivatives of $s$. This means that (with a little more work),
$$
| L(\phi_i s) |_{W^p_k(\Omega_i)} \leq B \left(| \phi_i L(s)|_{W^p_k(\Omega_i)} + | s |_{W^p_{r+k-1}(\Omega_i)}\right)
$$
Multiplication by a smooth function is a bounded map on Sobolev spaces and so
$$
| \phi_i L(s)|_{W^p_k(\Omega_i)} \leq A |L(s)|_{W^p_k(\Omega_i)}
$$
Putting this together we find that
$$
| s|_{L^p_{k+r}(M)} \leq D \sum \left(|L(s)|_{L^p_k(\Omega_i)} + |s|_{L^p_{k+r-1}(\Omega_i)}\right)
$$
where $D$ combines all our previous constants $C,K,A,B$.
We also choose our coordinate charts to be locally finite: any point of $M$ is in at most $m$ of the $\Omega_i$. This means that
$$
\sum |L(s)|_{L^p_k}(\Omega_i) \leq m |L(s)|_{L^p_k(M)}
$$
and similarly for the $L^p_{k+r-1}$ term. So we conclude that
$$
| s|_{L^p_{k+r}(M)} \leq C \left( |L(s)|_{L^p_k(M)} +|s|_{L^p_{k+r-1}}\right)
$$
for some new constant $C$. We now get the estimate we really want (with $L^p_{k+r-1}$ replaced by $L^p$ in the last term) by induction on $k$. (When $r=1$ the base of the induction is simple enough, but when $r>1$ it needs a little more thought, which I leave as an exercise - code for I didn't have time to think about this bit very much!)
This is almost the estimate you want in your original quesiton - which asked about the cases $k=1,2$ for $L = (\mathop{div}, \mathop{curl})$ - except there is an additional $L^p$ norm of $s$ on the right-hand side. To get rid of this we need an additional hypothesis: we assume that $L$ has no kernel. In your case this is true because the first Betti number of $S^2$ vanishes. (The estimate would be FALSE on the torus for example. You can see this by taking, in your notation, $\alpha$ to be a non-zero parallel 1-form. Then $\mathop{div}(\alpha)=0=\mathop{curl}(\alpha)$.)
With this additional assumption, let us prove that there exists $C$ for which
$$
|s|_{L^p(M)} \leq C|L(s)|_{L^p_k(M)}
$$
If not then, by contradiction, there is a sequence $s_j$ of sections of $E$ with $|s_j|_{L^p} =1$ and with $L(s_j) \to 0$ in $L^p_k(M)$. By the estimate we have just proved, $s_k$ is bounded in $L^{p}_{k+r}$. By Rellich's Lemma, a subsequence converges in $L^p_{k+r-1}$. The limit $s$ must be a solution of $L(s)=0$ and so must vanish, but this contradicts the fact that $|s|_{L^p}=1$. This means that, when $\mathrm{Ker}(L)=0$, we can absorb the $|s|_{L^p}$ term on the right-hand side in our previous estimate into the $|L(s)|_{L^p_k}$ term.
This completes the proof that when $L$ is elliptic and has no kernel, there is a constant $C$ (depending on $k,p$) such that
$$
|s|_{L^p_{k+r}(M)} \leq C |L(s)|_{L^p_{k}(M)}
$$
This is what you asked for, when you set $k=1,2$ and $L = (\mathop{div},\mathop{curl})$ acting on 1-forms over the 2-sphere.


text:
Q: UICollectionView custom cell did not reload I have download sample project of UICollectionVIew. I have created custom cell in code and in that cell I am adding UI elements(image, button etc). The problem is when I dequeue the cell I did not get the reusable cell. Here is the link of the code.
http://speedy.sh/kq3mr/code.zip
Kindly Guide me where I am doing wrong

A: self.imageView = [[UIImageView alloc] init];
self.imageView.frame = frame;
The above line of code (self.imageView.frame = frame) is causing the issue. It should be
self.imageView.frame = self.bounds

A: UICollectionView dequeueReusableCellWithReuseIdentifier will reuse cell just if already created cell is available. Otherwise dequeueReusableCellWithReuseIdentifier will create and return new cell.


text:
Q: codemirror related css files not getting loaded when using require I am using require js to load codemirror.
In main.js i have,
requirejs.config({
packages: [{
name: "codemirror",
location: window.siteRootDir + 'node_modules/codemirror',
main: "lib/codemirror"
}],

And in my actual js file i have this
define([
'codemirror',
'codemirror/mode/yaml/yaml',
'codemirror/addon/fold/comment-fold',
'codemirror/addon/fold/foldgutter',
'codemirror/addon/fold/foldcode',
'codemirror/addon/lint/lint',
'codemirror/addon/lint/yaml-lint',

When the application loads, in the network tab i see the js files are getting loaded but the css files (codemirror.css, lint.css, foldgutter.css) are not loaded.
Any help would be appreciated


text:
Q: My functions displays garbage, and some other times it displays clean result I have to count the number of upper case and lower case letters in a given line. For this assignment, I have to use arrays of characters terminated by \0, which is what I do. I use ascii code to identify lower case or upper case letters.   However, the output is sometimes clean, sometimes not clean. Any help will be appreciated.  Here is my code in Dev-C++. Thanks
#include <iostream>
#include<conio.h>
#include<cstring>

using namespace std;

int getline();
int isupper(char line[]);
int islower(char line[]);

int main()
{
  int  Month, last_digit;      //initialize variables and char array
  char temp[255];
  getline();

  getch();
  return 0;
}

int getline()
{
  char line[255];
  cout << "Enter a sentence: ";
  cin.getline (line, 255);
  isupper(line);
  islower(line);
  getch();
  return 0;
}

int isupper(char line[])
{
  int y, i=0, k=0; int count_uppercase=0; char Uppercase_array[80];

  cout<<endl<<"from isupper function"<<endl;
  do
   {
     y=line[i++]; // Convert to int
     if(y>64 && y<91)        //if it is a Uppercase letter...
     {
       Uppercase_array[k]=line[i-1];
       k++;
       count_uppercase++;     //increment the counter...
     }
  }
  while(y);
  cout<<"Uppercase letter  = " <<Uppercase_array;
  cout<<"   number of uppercase = "<<count_uppercase<<endl;
  cout<<"----------"<<endl;

  return 0;

}

int islower(char line[])
{
  int z, i=0,  count_lowercase=0;
  cout<<"from lowercase function"<<endl;
  do
  {
    z=line[i++]; // Convert to int
    if(z>96 && z<123)     //if it is a Lowercase letter...
     count_lowercase++;      ////increment the counter...
  }
  while(z);
  cout<<"number of lowercase = "<<count_lowercase<<endl;

  getch();
  return 0;
}

 *******example1 of output*****
 Enter a sentence: Good morning Dad, how ARE u?

from isupper function
Uppercase found in that line = GDARE√"   number of uppercase = 5
----------
from lowercase function
number of lowercase = 16

************example2 of output*********
Enter a sentence: Good morning Dad how are u?

from isupper function
Uppercase letter  = GD   number of uppercase = 2
----------
from lowercase function
number of lowercase = 19

A: Look closely at this line:
cout<<"Uppercase letter  = " <<Uppercase_array;

How does it know how many characters to output? You really should use std::string or std::vector<char>.
If you want the simplest fix, do this before you print: Uppercase_array[k]=0;. C-style strings have their ends marked with a terminating nul (zero byte) which tells functions that handle them how big they are.

A: If the "garbage" you are referring to is the √" in GDARE√", then the answer is to add the null-terminator \0 to the last char of Uppercase_array. That is, after the do/while loop, add Uppercase_array[k] = '\0'.


text:
Q: Python - C Compile errors - gcc failed Oftentimes when I try to install a Python package, installation will fail with following error: "error: command 'gcc' failed with exit status 1".
I am at loss. Most things I try to instal fail. I am losing my mind on this. Really like the language, but this is driving me crazy. Spent countless hours looking for solutions, to no avail.
Probably the problem comes from my environment. Here's how I am (insanely?) trying to run things:
Windows 7 machine
MS Visual C++ 14 redist freshly installed
Python 2.7.15 through Jupyter/SageMath 8.3 (can't execute Python through Console because throws 16bit error)
P.s.: I'm an ignorant, but I know it, so don't bother. Any help appreciated.

A: Ok, I found a workaround/solution.
I am suspecting that the Python kernel provided with SageMath is not a 100% complete/functional Python kernel/core. I reluctantly conceded to install a standalone Python "kernel" (not certain the term is technically correct) from Python.org, v. 2.7.15, using the standard prebuilt binaries for x64 Windows systems. Installed it in a different folder than Sage of course, added it to the system Path variable, and guess what? Yeah, issues resolved. Everything now installs flawlessly - well, mostly, but at least now it's down to an acceptable level of failure. So I installed Jupyter on this kernel and I can now continue my development the way I like it.
I mean, I would if a few hundred lines of code weren't too many for the computer on which I am working... Since it's lagging a bit, I will need to resort to other 'IDE' solutions. But that's another story altogether...
Thanks much nonetheless to everybody who bothered dropping a line by. Especially @Red Cricket, who helped me reconsider my reluctancy to install another Python kernel alongside SageMath's. Not a big fan of duplication, but hey, enough time lost there.


text:
Q: How to Get Full JavaScript/TypeScript Debugging in Chrome with Visual Studio (Like IE) Is there a method for interactive debugging JavaScript and TypeScript in Visual Studio using Chrome similar to the functionality currently provided with Internet Explorer? With IE I can set a breakpoint in JavaScript or TypeScript in the IDE and step through the code within the IDE. I cannot get that same behavior with Chrome in Visual Studio.

A: For a fully integrated debugging experience with any JavaScript/browser based application and Visual Studio, you'll need to use Internet Explorer today. As TypeScript compiles to JavaScript, the integrated debugging also requires Internet Explorer.
The "trick" I often use if I want to use another browser is to add a debugger; statement somewhere in my TypeScript/JavaScript code and have the development tools open in Chrome ..., and execution will then stop on that instruction. As long as you have source-maps enabled, you should see your original TypeScript code in the Chrome debugging window. You can then use Chrome debugging tools to set further breakpoints. If the file doesn't change, the breakpoints will be retained from a "refresh" of the page.
This does not allow me to set breakpoints within Visual Studio though, but it's still effective and works well enough for my development.
Update April 2016
As a few in comments have pointed out, there's a path to making this work a little better, although the experience isn't nearly as complete as it is for Internet Explorer. Follow the steps outlined here. It involves starting Chrome with a custom command line (to enable remote debugging):
chrome.exe --remote-debugging-port=9222

And then attaching to the Chrome process with WebKit debugging enabled. You can add a custom browser to make it easy to launch Chrome.

(But, I will add that I haven't been able to get this to work in a way that I find useful and consistent, especially as I use Chrome for most other web browsing.)


text:
Q: Firebase data grid view items repeat in the grid view Please review my code.
This code actually fetches values from Firebase and appends it to the grid view, although I found that gridView updates with the duplicate values but the onclick listener executes properly giving only unique values.
The gridView has repeated values and it appears to be changing randomly.
It would be helpful if anyone could help me through some sample working code. Could anyone please help me to solve this problem?
public class Materials extends Fragment {
    private Button btnTEST;
    Context context;
    CardView cardview;
    RelativeLayout.LayoutParams layoutparams;
    TextView textview;
    RelativeLayout relativeLayout;
    GridView grid;
    int l=0,fl=0;
    @Nullable
    @Override

    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment

        View v= inflater.inflate(R.layout.fragment_materials, container, false);

        context = v.getContext();

        grid=(GridView)v.findViewById(R.id.grid);

        final String[] web=new String[13];

        final int[] imageId = new int[13];

        DatabaseReference ref = FirebaseDatabase.getInstance().getReference("Materials_management_new/Materials/");

        ref.addValueEventListener(new ValueEventListener() {

            @Override
            public void onDataChange(DataSnapshot dataSnapshot) {
                if (fl == 0) {
                    for (DataSnapshot snap : dataSnapshot.getChildren()) {

                        web[l] =snap.getKey().toString();
                        l++;
                        fl=1;

                    }

                    //= gson.toJson(dataSnapshot);
                    //  Toast.makeText(LoginPage.this, json, Toast.LENGTH_SHORT).show();
                }
                CustomGrid adapter;
                adapter = new CustomGrid(getContext(), web, imageId);
                grid.setAdapter(adapter);
            }
            @Override
            public void onCancelled(DatabaseError databaseError) {
                System.out.println("The read failed: " + databaseError.getCode());
            }
        });

     //   Toast.makeText(getActivity(), "SUccesssssafmlnfka", Toast.LENGTH_SHORT).show();

        grid.setOnItemClickListener(new AdapterView.OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> parent, View view,
                                    int position, long id) {
                Toast.makeText(getActivity(), "You Clicked at " +web[+ position], Toast.LENGTH_SHORT).show();

            }
        });

        return v;
    }

}

And this is my custom grid code
public class CustomGrid extends BaseAdapter{
    private Context mContext;
    private final String[] web;
    private final int[] Imageid;

    public CustomGrid(Context c,String[] web,int[] Imageid ) {
        mContext = c;
        this.Imageid = Imageid;
        this.web = web;
    }

    @Override
    public int getCount() {
        // TODO Auto-generated method stub
        return web.length;
    }

    @Override
    public Object getItem(int position) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public long getItemId(int position) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub
        View grid;
        LayoutInflater inflater = (LayoutInflater) mContext
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        if (convertView == null) {

            grid = new View(mContext);
            grid = inflater.inflate(R.layout.grid_single, null);
            TextView textView = (TextView) grid.findViewById(R.id.grid_text);
            ImageView imageView = (ImageView)grid.findViewById(R.id.grid_image);
            textView.setText(web[position]);
            imageView.setImageResource(Imageid[position]);
        } else {
            grid = (View) convertView;
        }

        return grid;
    }
}

A: if you want to have an ordered list of items, you can sort it using the database query, additionally setting the rules for the database to be indexed, otherwise the entire installation will be done on the client side.
See Sorting and filtering data in https://firebase.google.com/docs/database/android/lists-of-data?authuser=1


text:
Q: Find the vector equation of line in $R^3$

Find the vector equation of a line which contains the two points $(1, 2, 3)$ and $(4, 5, 6) $

Hints only.
I know $x = a + t*d$ where $a, d$ are vectors and $t$ is a scalar.
We can have $a =\{<1, 2, 3>, <4, 5, 6> \}$ as two options of the vectors.
The difficulty is in finding $d$?

A: Hint. You want both $u := (1,2,3)$ and $v: = (4,5,6)$ to lie on the line, that is for some values of $t_u, t_v$, we want
$$ a + t_ud = u,\qquad a + t_vd = v $$
as we are free in choosing $t_u$ and $t_v$ (we just want them to lie on the line $a + \mathbf R d$ somewhere, let $t_u = 0$ and $t_1 = 1$, this gives
$$ a = u, \qquad a + d = v $$
Can you continue from here?


text:
Q: How to rename an element name with random values inside a for-each loop in xslt? I have a requirement to rename the element name based upon the value of the element while retrieving values from the root.
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dat="http://ws.wso2.org/dataservice" version="1.0">
  <xsl:key name="key-by-company_code" match="dat:row" use="dat:company_code" />
    <xsl:template match="company_code">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
  <xsl:template match="dat:rows">
    <xsl:element name="{local-name()}">
      <xsl:for-each select="dat:row[generate-id() = generate-id(key('key-by-company_code', dat:company_code)[1])]">
        <xsl:element name="sae">

        <xsl:attribute name="filename">
            <xsl:value-of select="dat:company_code" />
          </xsl:attribute>
          <xsl:for-each select="key('key-by-company_code', dat:company_code)">
          <xsl:element name="{local-name()}">
                <xsl:element name="row">
                    <xsl:element name="sae_id">
                      <xsl:value-of select="@sae_id" />
                    </xsl:element>
            <xsl:element name="sae_date">
                      <xsl:value-of select="@sae_date" />
                    </xsl:element>
            <xsl:if test="'company_code' = local-name()">
            <xsl:if test="dat:company_code = '30'">
            <xsl:template match="company_code">
            <Co30>
            <xsl:apply-templates/>
            </Co30>
            </xsl:template>
                    </xsl:if>
                    </xsl:if>
            <xsl:element name="payment_type">
                      <xsl:value-of select="dat:payment_type" />
                    </xsl:element>
            <xsl:element name="concur_pay">

                <xsl:variable name="Concur-Pay" select="dat:concur_pay" />

                <xsl:choose><xsl:when test="$Concur-Pay = '0'">N</xsl:when><xsl:otherwise>Y</xsl:otherwise></xsl:choose>
            </xsl:element>

           </xsl:element>
          </xsl:for-each>
        </xsl:element>
      </xsl:for-each>
    </xsl:element>
  </xsl:template>
</xsl:stylesheet>

Above is the xslt I am trying to use for the requirement but it does not work.I need to rename the element name based on the value of the element and assign the value from a different element.For eg.:- if the value of the company_code is 30 then the output should be as below
<sae filename="30">
<row>
<sae_id>76</sae_id>
<sae_date>2012-12-07-08:00</sae_date>
<Co30>1286.91</Co30>
<payment_type>CASH</payment_type>
<concur_pay>N</concur_pay>
<total>1286.91</total>
</row>
</sae>

Here the value of the element "total" should be assigned to "Co 30".Similarly if the company_code is 32 or 33 or 36 things should happen as above.
Please let me know how can I rename this element.

A: Please try replacing this:
        <xsl:if test="'company_code' = local-name()">
        <xsl:if test="dat:company_code = '30'">
        <xsl:template match="company_code">
        <Co30>
        <xsl:apply-templates/>
        </Co30>
        </xsl:template>
                </xsl:if>
                </xsl:if>

with this:
<!-- Ensure company_code is a valid number to prevent invalid tag names -->
<xsl:if test="number(dat:company_code) = number(dat:company_code)">
  <xsl:element name="Co{dat:company_code}">
    <xsl:value-of select="dat:total"/>
  </xsl:element>
</xsl:if>

You also need to remove the
<xsl:element name="{local-name()}">
after the <xsl:for-each>. It is unclosed and appears to be unnecessary.


text:
Q: reduce number of cases from a switch I have the following piece of code. It's kind of a factory function that retrieves an instance of a writer base on it's type. Notice that the type is an enum.
public Writer getWriter(WriterTypeEnum type){
  switch(type){
    case A: new AWriter() break;
    case B: ... break;
    case C: ... break;
    ...
  }
}

The problem is I have about 30 cases. What can I do to reduce them or to not implement them at all?
I solved cases like this in the past using strategy pattern but here I am facing an old enum used in the entire app. The other problem is that I cannot inject spring beans into this enum. Some of the instances from switch cases are beans.
The WriterTypeEnum has an ID that is coming from UI and based on that ID I have to determine the right instance.

A: You can setup your enum to have an abstract method
public abstract Writer getWriter();

and after that, all your instances would have to implement that method, for example
public enum YourEnum{
    FIRST(){
        public Writer getWriter(){
            return null;
        }
    }, ... // other enums

    public abstract Writer getWriter();

}

or you could omit the break in your switch, if there are repeating statements

A: How about having a look up map of writer names, then creating an instance using reflection?
String writerNameJustFound = mapOfWriters.get(type);
Object instance = Class.forName(writerNameJustFound).newInstance();

A: Another type of answer I come across is to use inheritance, i.e. make WriterTypeEnum into WriterType.
public Writer getWriter(WriterType type){
    return type.getWriter();
}

that way, all you have to do is pass correct child of WriterType, and you will never touch code inside getWriter.
The problem lies in context, whether such solution is possible to implement.

A: All of the previous solution are welcome and most probably some will work in my case.
My solution was to create another object that has a Set<WriterMapping>. In this object I store the value of WriterEnumType and its correspondent Writer.


text:
Q: Different Results using Simple Linear Regression Packages in Python: statsmodel.api vs sklearn I am hoping to understand why I am getting two different results for a linear regression model prediction. I am using the same data set, and asking for the same value for prediction. I have pasted some example code below, with a link as well to an open Google Colab, available here.
import pandas as pd
from sklearn import linear_model, metrics
import statsmodels.api as sm

temp = [73,65,81,90,75,77,82,93,86,79]
gallons = [110,95,135,160,97,105,120,175,140,121]
merged = list(zip(temp, gallons))
df = pd.DataFrame(merged, columns = ['temp', 'gallons'])

X = df[['temp']]
Y = df['gallons']

regr = linear_model.LinearRegression().fit(X,Y)
print("Using sklearn package, 80 temp predicts rent of:", regr.predict([[80]]))

model = sm.OLS(Y,X).fit()
print("Using statsmodel.api package, 80 temp predicts rent of:", model.predict([80]))

With the above code, I receive a result of:
Using sklearn package, 80 temp predicts rent of: [125.5013734]
Using statsmodel.api package, 80 temp predicts rent of: [126.72501891]
Can someone explain why the result is not the same? My understanding is that they are both linear regression models.
Thank you!

A: Statsmodel doesn't use intercept by default while sklearn use it by default.You have to add intercept manually in statsmodel.
Statsmodel OLS documentation.

Notes
No constant is added by the model unless you are using formulas.

Sklearn

fit_interceptbool, default=True Whether to calculate the intercept for
this model. If set to False, no intercept will be used in calculations
(i.e. data is expected to be centered).

use add_constant function to add intercept to the X and this will give the same results for both algorithms.
X = sm.add_constant(X)
model = sm.OLS(Y,X).fit()
print("Using statsmodel.api package, 80 temp predicts rent of:", model.predict([1,80]))


text:
Q: Execute POST API with local filepath reference on remote machine I've 2 VM (VMA and VMB).
On VMA I'm running and API for image detection (https://hub.docker.com/r/codait/max-resnet-50), I've a mount folder containing all the images I need to scan (/mnt/image/).
After executing coontainer with docker run -it -p 5000:5000 quay.io/codait/max-resnet I don't have any problem running a simple POST CURL command from VMA:
curl -F "image=@/mnt/image/7aa2914d14ee4aa1a8cc243599b3270e" -XPOST http://localhost:5000/model/predict

Response:
{"status": "ok", "predictions": [{"label_id": "n03680355", "label": "car", "probability": 0.6460472941398621}, {"label_id": "n04133789", "label": "truck", "probability": 0.1919122040271759}]}

My goal is to execute the command from VMB (note that all ports are open, no network issue):
curl -F "image=@/mnt/image/7aa2914d14ee4aa1a8cc243599b3270e" -XPOST http://<VMA_IP>:5000/model/predict

I got this error:
curl: (26) Failed to open/read local data from file/application

Pls note both VMA and VMB got same rights on mount folder "/mnt/image".
Is there any command/syntax I'm missing to execute correctly the POST curl?


text:
Q: Spring MVC, Hibernate Entity Manager Configuration for Module Access I am using Spring MVC with Maven and I have a structure of modules a below.
The Web Project is MVC Module I moved the models which I was using in Web Module to the Model Module. It compiles and runs just ok.
But when i try to use the entity manager I get an Unknown Entity Error.
Is there a configuration which I am missing to add for my entity manager configuration to access the model classes in the Model Module?
I added the dependencies for the Model Module in the Web Module and I can access the classes in the Model module. But the entity manager looks like just cant access the model module.
 main
 |
 --Web
 |
 --Model

jpaContext.xml:
<context:annotation-config />
<context:component-scan base-package="com.myproject"/>

<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />

<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="persistenceUnitName" value="punit"/>
    <property name="dataSource" ref="dataSource" />
    <property name="jpaVendorAdapter">
        <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
            <property name="showSql" value="true" />
        </bean>
    </property>

    <property name="jpaPropertyMap">
        <map>
            <entry key="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
            <entry key="hibernate.hbm2ddl.auto" value="create" />
            <entry key="hibernate.format_sql" value="true" />
        </map>
    </property>

</bean>

<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
    <property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>

<tx:annotation-driven transaction-manager="transactionManager"/>

<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property name="url" value="jdbc:mysql://localhost:3306/Web?autoReconnect=true" />
    <property name="username" value="root" />
    <property name="password" value="123456" />
</bean>

POM.XML FOR MODEL MODULE
<modelVersion>4.0.0</modelVersion>
 <parent>
   <groupId>com.myproject</groupId>
  <artifactId>main</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>Model</artifactId>
<dependencies>
<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>4.2.0.Final</version>
</dependency>
<dependency>
    <groupId>javax.persistence</groupId>
    <artifactId>persistence-api</artifactId>
    <version>1.0.2</version>
</dependency>

 </dependencies>

POM.XML FOR WEB MODULE
        <modelVersion>4.0.0</modelVersion>
<artifactId>Web</artifactId>
<packaging>war</packaging>
<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>3.2.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>4.2.0.Final</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.4.1</version>
    </dependency>
    <dependency>
        <groupId>com.thoughtworks.xstream</groupId>
        <artifactId>xstream</artifactId>
        <version>1.3.1</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-oxm</artifactId>
        <version>3.2.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.21</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>4.1.9.Final</version>
    </dependency>
    <dependency>
        <groupId>javax.transaction</groupId>
        <artifactId>jta</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>3.2.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>3.2.4.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>com.myproject</groupId>
        <artifactId>Model</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </dependency>
</dependencies>
<parent>
    <groupId>com.myproject</groupId>
    <artifactId>main</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</parent>

A: Try
<bean id="entityManagerFactory"
    class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">

    <property name="packagesToScan">com.myproject.model</property>

    ... other properties ...

</bean>

A: The problem was the that the Entity Manager config file in my case jpaContext.xml was in my WEbModule/Resources Folder and The Web Module had a dependency on Model Module for using the Entity Classes which were defined in the Model Module.
The Entities In the Model Module which has the @Entity Annotation by default searches for the entity manager and because the Entity manager is defined in the Web Module I cannot reach it thats why I was getting the entity not found error. And in my case Because my Web Module already refers to Model Module, due to circular dependency I cant refer Model Module to Web Project.
The soultion was to move my jpaContext.xml to Model Module and Works Just Fine


text:
Q: Почему не срабатывает find При работе с SVG столкнулся с проблемой: не находится элемент tspan в строке.
Например, этот код не выведет ничего. В чём проблема?

var subrows = "<tspan x='100' y='26.4'>ТЕст</tspan><tspan x='100' y='52.8'>И</tspan><tspan x='100' y='79.2'>Тест</tspan><tspan x='100' y='105.6'></tspan>";

$(subrows).find('tspan').each(function() {
    console.log($(this).attr("y"));
});

A: .find() ищет только среди потомков. Так как в $(subrows) находятся только 4 <tspan> на верхнем уровне, и у каждого из которых нет потомков, то find среди отсутствующих потомков ничего найти и не сможет.
Для поиска среди потомков и самих элементов можно воспользоваться комбинацией из методов find и addBack:

var subrows = "<tspan x='100' y='26.4'>ТЕст<tspan y='internal_tspan_y'></tspan></tspan><tspan x='100' y='52.8'>И</tspan><tspan x='100' y='79.2'>Тест</tspan><tspan x='100' y='105.6'></tspan><p y='not_tspan_y'
";

$(subrows).find('tspan').addBack('tspan').each(function() {
    console.log($(this).attr("y"));
});

Внутренний <tspan> и
 в конце добавлены для демонстрации корректности результата.

Если потомки вообще не предполагаются, и нужно просто отфильтровать <tspan> элементы, то достаточно воспользоваться методом filter:

var subrows = "<tspan x='100' y='26.4'>ТЕст<</tspan><tspan x='100' y='52.8'>И</tspan><tspan x='100' y='79.2'>Тест</tspan><tspan x='100' y='105.6'></tspan><p y='not_tspan_y'
";

$(subrows).filter('tspan').each(function() {
    console.log($(this).attr("y"));
});

A: Потому что $().find ищет среди подэлементов элементов в выборке
https://api.jquery.com/find/


text:
Q: Get days using two dates in js I'm having this trouble where I can only get the days between specified 2 dates. Please see the code below:

var getDaysArray = function(start, end) {
  for (var arr = [], dt = start; dt <= end; dt.setDate(dt.getDate() + 1)) {
    arr.push(new Date(dt));
  }
  return arr;
};

var daylist = getDaysArray(new Date('08/13/2018'), new Date('08/17/2018'));
daylist.map((v) => v.toISOString().slice(0, 10)).join("");
console.log(daylist);

The output of the code above is:

Expected output (due to start and end dates 08/13/2018 and 08/17/2018):
0: Date 2018-08-13T16:00:00.000Z
1: Date 2018-08-14T16:00:00.000Z
2: Date 2018-08-15T16:00:00.000Z
3: Date 2018-08-16T16:00:00.000Z
4: Date 2018-08-17T16:00:00.000Z

Note: The code above was from one of the SO answers found somewhere.

A: toISOString represents the date in UTC format. You are probably in positive timezone offset, that's why the UTC representation of your date objects are a day off. You can use toLocaleString instead to represent your dates in your timezone.
Another issue is that Array.prototype.map retuns a new array, which you forgot to assign to daylist Without that assignment, no changes in daylist will be made.
Below snippet works as per your requirements.

var getDaysArray = function(start, end) {
  for (var arr = [], dt = start; dt <= end; dt.setDate(dt.getDate() + 1)) {
    arr.push(new Date(dt));
  }
  return arr;
};

var daylist = getDaysArray(new Date('08/13/2018'), new Date('08/17/2018'));
daylist = daylist.map((v) => v.toLocaleString());
console.log(daylist);


text:
Q: How do I get link in bootstrap tabs i want in this tabs code get the link for tabs directly
like this ex : domainname.com/index.php#tab3
any idea for get the url tabs because i want to use in form ...
How do I get link in bootstrap tabs
code directly : http://www.bootply.com/D4A2AglssW#3

Step 1

Step 2

Step 3

Step 4

Step 5

Here is the content for the first step...

                 Continue

Here is the content for step 2...

                 Continue

Here is the content for step 3...

                 Continue

Here is the content for step 4...

                 Continue

This is the last step. You're done.

                 Start over

Javascript
        $('.next').click(function(){

      var nextId = $(this).parents('.tab-pane').next().attr("id");
      $('[href=#'+nextId+']').tab('show');

    })

    $('.first').click(function(){

      $('#myWizard a:first').tab('show')

    })

A: You can easily get control over you tabs by following function. Define a global variable and whenever tab is shown, append the tab name in current url:
var url = window.location.href;
var url_withtab = "";  //you can easily access current tab url on this variable whenever needed.
$("body").on("shown.bs.tab", "#step1", function() {
        //code to do after displaying step2 tab.
        url_withtab = url+"#step1";
    });

$("body").on("shown.bs.tab", "#step2", function() {
        //code to do after displaying step2 tab.
        url_withtab = url+"#step2";
    });

$("body").on("shown.bs.tab", "#step3", function() {
        //code to do after displaying step2 tab.
        url_withtab = url+"#step3";
    });

Update: here is a quick work around, and I hope it will work for you.

Step 1

Step 2

Step 3

Step 4

Step 5

Here is the content for the first step...

                 Continue

Here is the content for step 2...

                 Continue

Here is the content for step 3...

                 Continue

Here is the content for step 4...

                 Continue

This is the last step. You're done.

                 Start over

Update 2 (more effective):

If doesnot work, try using src via url:

A: use this
$(".nav-pills>li>a").click(function(){
    alert($(this).attr("href"));
});


text:
Q: Add UITableView to Sidebar programmatically i created a custom class to add a sidebar to some of my MainTableViewControllers. If the user click on the MainTableRow the sidebar should open and show some detail Information in another UITableView. So i need to create a UITableView in my sidebar View. There should be some different Custom Cells for this new table.
My Problem is, that there is no data shown in my Table. The cells are always empty. Do i need to set on init anything else to tell the TableViewController where he find his UITableViewDataSource?
Any help would be greatly appreciated.
This is my code atm:
class SideView: UIView, UITableViewDataSource, UITableViewDelegate {

On init i load my TableView into my View:
init(view: UIView) {

    super.init(frame: CGRect(x: view.frame.size.width, y: 0, width: 150, height: view.frame.size.height-40))

    var tvc:UITableView = UITableView(frame: CGRectMake(0, 0, 150, 768), style: UITableViewStyle.Plain)
    addSubview(tvc)

....

func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return 5
}

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

    var cell = tableView.dequeueReusableCellWithIdentifier("TitleLabelCell", forIndexPath: indexPath) as SideLabelTitleTableViewCell

    cell.titleText = "Hello Test"

    return cell

....

And this is my Custom Cell atm:
var titleText:String!

init(style: UITableViewCellStyle, reuseIdentifier: String) {
    super.init(style: style, reuseIdentifier: "TitleLabelCell")
    // Initialization code

    var titleLabel:UILabel!
    titleLabel.frame = CGRectMake(0,0,150,44)
    titleLabel.text = titleText

    self.contentView.addSubview(titleLabel)
}

Edit: Ok now the datasource should work, but i am unable to use my UITableViewCell.
I use:
tvc.dataSource = self

But when i try to set a value from my sideViewClass for "titleLabel" it is always "nil". If i set it from my CustomCellClass it works as expected:
init(style: UITableViewCellStyle, reuseIdentifier: String) {
    super.init(style: style, reuseIdentifier: "TitleLabelCell")

    var labelText:String!

    println(self.labelText)

    var titleLabel:UILabel = UILabel(frame: CGRectMake(0,0,150,44))

    titleLabel.text = self.labelText // THIS IS NOT WORKING, always nil?

    self.contentView.addSubview(titleLabel)

And set my cell value with on cellForRowAtIndexPath:
    cell.labelText = "Test"

A: Change Your Custom Cell Class To :
var titleLabel:UILabel!
init(style: UITableViewCellStyle, reuseIdentifier: String) {
    super.init(style: style, reuseIdentifier: "TitleLabelCell")
    // Initialization code

    titleLable = UILable()
    titleLabel.frame = CGRectMake(0,0,150,44)

    self.contentView.addSubview(titleLabel)
}

And Then
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

    var cell = tableView.dequeueReusableCellWithIdentifier("TitleLabelCell", forIndexPath: indexPath) as SideLabelTitleTableViewCell

    cell.titleLabel.text = "Hello Test"

    return cell

A: You need to set the delegate and datasource, then reload the table.
tvc.delegate = self
tvc.dataSource = self
tvc.reloadData()

Also register the tableview cell with the table
tvc.registerClass(SideLabelTitleTableViewCell, forCellReuseIdentifier:"TitleLabelCell")

A: try to implement class in proper syntax:
class MyCell: UITableViewCell {
   var titleLabel = UILabel(frame:CGRectMake(0.0, 0.0, 150.0, 44.0))
   var labelText: String! {
       willSet {
           titleLabel.text = newValue
       }
   }
   init(style: UITableViewCellStyle, reuseIdentifier: String) {
       super.init(style: style, reuseIdentifier: "TitleLabelCell")
       contentView.addSubview(textLabel)
   }
}

do not declare external var/let in methods
and one more thing, if you're going to use XIB/storyboard, use awakeFromNib() instead of init(style: UITableViewCellStyle, reuseIdentifier: String)


text:
Q: Determining thread that throw an exception from a dump file Let's say my application has two threads A and B and each thread throws an exception. Can I determine what thread has raised which exception by using ~{threadid}s and then running !pe?

A: Usually there is only one thread that was throwing the exception which causes the application to terminate. That said, I saw it happen during a debugging session where the thread with the exception was freezed and other threads were resumed.
The .NET !threads command will list the .NET threads and the exceptions on each thread:
0:000> !threads
ThreadCount: 6
UnstartedThread: 0
BackgroundThread: 2
PendingThread: 0
DeadThread: 0
Hosted Runtime: no
                                              PreEmptive                                                Lock
       ID OSID        ThreadOBJ     State   GC     GC Alloc Context                  Domain           Count APT Exception
   0    1 251c 00000000003deff0   201a220 Enabled  00000000027846f8:0000000002785fd0 0000000000382ca0     0 MTA
   2    2 2b10 0000000000a88280      b220 Enabled  0000000000000000:0000000000000000 0000000000382ca0     0 MTA (Finalizer)
   3    3 255c 0000000000aacac0      b020 Enabled  00000000027862b8:0000000002787fd0 0000000000382ca0     0 MTA System.ArgumentException (0000000002786090)
   4    4 2a48 0000000000aad5b0      b020 Enabled  000000000278a290:000000000278bfd0 0000000000382ca0     0 MTA System.NotImplementedException (000000000278a070)
   5    5 2e50 0000000000aa20d0      b020 Enabled  0000000002788268:0000000002789fd0 0000000000382ca0     0 MTA System.OutOfMemoryException (0000000002788048)
   6    6  d50 0000000000aa2e00      b020 Enabled  000000000278c280:000000000278dfd0 0000000000382ca0     0 MTA System.Threading.ThreadInterruptedException (000000000278c060)

You can then switch to the thread listed as ID and dump the exception on that thread (~xs;!pe or ~xe!pe where x is the ID):
0:004> ~3e!pe
Exception object: 0000000002786090
Exception type: System.ArgumentException
Message: This method does not have arguments.
InnerException: <none>
StackTrace (generated):
    SP               IP               Function
    000000000112F100 000007FF0017055F MultiException!MultiException.Program.ThrowException1()+0x5f
    000000000112F140 000007FEEB4E2BBC mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)+0x9c
    000000000112F190 000007FEEB57AADE mscorlib_ni!System.Threading.ThreadHelper.ThreadStart()+0x4e

StackTraceString: <none>
HResult: 80070057
0:004> ~4e!pe
Exception object: 000000000278a070
Exception type: System.NotImplementedException
Message: This method does nothing but thorwing this exception.
InnerException: <none>
StackTrace (generated):
    SP               IP               Function
    000000000135F2C0 000007FF0017067F MultiException!MultiException.Program.ThrowException2()+0x5f
    000000000135F300 000007FEEB4E2BBC mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)+0x9c
    000000000135F350 000007FEEB57AADE mscorlib_ni!System.Threading.ThreadHelper.ThreadStart()+0x4e

StackTraceString: <none>
HResult: 80004001

Also important to know: .NET pre-allocates some exceptions in memory so that they can be thrown later. This may confuse developers who work with WinDbg for the first time. So don't worry, if you see some exceptions in the output of !dumpheap -stat -type Exception, e.g. in a simple HelloWorld application:
0:000> !dumpheap -stat -type Exception
total 7 objects
Statistics:
      MT    Count    TotalSize Class Name
78e4421c        1           12 System.Text.DecoderExceptionFallback
78e441d8        1           12 System.Text.EncoderExceptionFallback
78e4108c        1           72 System.ExecutionEngineException
78e40ffc        1           72 System.StackOverflowException
78e40f6c        1           72 System.OutOfMemoryException
78e4111c        2          144 System.Threading.ThreadAbortException
Total 7 objects

In unmanaged code, threads that threw an exception are marked with # when displaying the threads using ~:
0:000> ~
.  0  Id: 2b14.251c Suspend: 1 Teb: 000007ff`fffde000 Unfrozen
   1  Id: 2b14.71c Suspend: 1 Teb: 000007ff`fffdb000 Unfrozen
   2  Id: 2b14.2b10 Suspend: 1 Teb: 000007ff`fffd9000 Unfrozen
#  3  Id: 2b14.255c Suspend: 1 Teb: 000007ff`fffd7000 Unfrozen
   4  Id: 2b14.2a48 Suspend: 1 Teb: 000007ff`fffd5000 Unfrozen
   5  Id: 2b14.2e50 Suspend: 1 Teb: 000007ff`fffd3000 Unfrozen
   6  Id: 2b14.d50 Suspend: 1 Teb: 000007ff`fff0e000 Unfrozen

If you can't see the #, then it is typically hidden behind the .. You can switch to this thread using ~#s. Note that WinDbg only displays one #, although there are exceptions on other threads as well. I don't know how to figure it out on native side.


text:
Q: SQL Server query parse and compile time I am trying to optimize run time of a stored procedure and whenever SQL Server is not picking up the plan from cache, I am seeing lot of time spent on compiling and parsing of the stored procedure. I took these stats using
SET Statistics TIME ON

EXEC [My_Stored_Proc_name]

SET Statistics TIME OFF

SQL Server parse and compile time:
CPU time = 1170 ms, elapsed time = 1173 ms.

Out of total run time of 1860 ms, SP is spending 1170 ms in compiling the stored procedure. Is there a way to optimize the compile plans?
Note: the stored procedure is using around 30 + table joins.


text:
Q: ios Add Event to google calendar I have searching how to add event t users google calendar. In my project I have database with events(title,startDate,endDate etc). When user clicks sync button all this events should be add to users google calendar.
I downloaded api from here. But its for MAC OS. Since I never worked on MAC OS application I cant understand how to use it in IOS app.
Please help me and tell which view controller to use asking for username and password, then login to google calendar service and add event in it.
Thank you.
I got http://code.google.com/p/google-api-objectivec-client/. But its difficult to understand. It takes username and password from preferences. Then gets calendars and adds events, but to add we need ticket and some more things. This code did some things.
In their add event method I wrote my own event object and tried to add that, but its not working. Here is the code:
- (void)insertCalendarEvent:(GDataEntryCalendarEvent *)event toCalendar:(GDataEntryCalendar *)calendar
{
    NSLog(@"adding event");

    GDataDateTime *time = [GDataDateTime dateTimeWithDate:[NSDate date] timeZone:(NSTimeZone*)[NSTimeZone timeZoneForSecondsFromGMT:0]];

    GDataEntryCalendarEvent *newEntry = [GDataEntryCalendarEvent calendarEvent];
    [newEntry setTitleWithString:@"title"];
    [newEntry addLocation:[GDataWhere whereWithString:@"pune"]];
    [newEntry addTime:[GDataWhen whenWithStartTime:time endTime:time]];

  [googleCalendarService fetchEntryByInsertingEntry:newEntry
                                         forFeedURL:[[calendar alternateLink] URL]
                                           delegate:self
                                  didFinishSelector:@selector( insertTicket:finishedWithEntry:error: )];

}

My requirement is simple. I just want add my custom events to google calendar. Get calendar, get ticket, and in for loop add all my events.

A: Instead of using Google API and a new window where the user needs to be login again, you should use the EventKit, it's pretty easy stuff and you could sync to the Calendar where the user wants, not only Google cal.

A: I have the same requirement like yours to integrate google calendar and syncing events. I researched and found documentation from here but I didn't understand it clearly, so later I found another good tutorial for accessing google calendar API's. You can try this for your requirement.

A: As @Tuss Laszlo mentioned, the Google API Client library is your best option to add events only to a Google Calendar.  Google has a calendar sample in their example code.  See the example for the full implementation of adding calendar events.


text:
Q: Just update one column, strange execution plan I have logged the slowest queries on my database, and one surprises me, showing many times in the list, and taking often many seconds to execute.
UPDATE books SET last_read='2018-12-31 11:23:45' WHERE book_id='15'

book_id is int identity PK (clustered), last_read is a datetime.
The query is written with the 15 in single quotes, thus requiring a conversion, but I cannot imagine this being a big deal, because the conversion would only be done once per query.
There are 6 indexes on the table, but the column last_read is not involved or included in any of them. The PK is on book_id and is nothing special.
The estimated execution plan tells me:
UPDATE: 0%
Clustered Index Update (on the PK constraint): 100%

I would not expect the query to update any index, because last_read is not indexed in any way, and book_id is not changed.
What am I missing?

A: Let's do a small thought exercise:

*

*How do you think SQL Server finds the row with that book_id?

*How do you think it finds (not updates) the value for last_read?

Remember that the clustered index is the table. If you update the table, you must update at least the clustered index.
Let me continue the thought exercise by asking a different question - do you think there is (or should be) a more efficient way of updating this value, than by finding the row via the clustered index, and changing the value there?
Let's leave heaps out of this for now, but the concept is similar there.

A: Every column in the table is contained within the clustered index this is why you are seeing a clustered index update. The primary key is used to define how the rows are sorted within each page of the clustered index.
From Clustered and Nonclustered Indexes Described

Clustered indexes sort and store the data rows in the table or view based on their key values. These are the columns included in the index definition. There can be only one clustered index per table, because the data rows themselves can be sorted in only one order.

The key part that specifically relates to your question is here:

Indexes are automatically maintained for a table or view whenever the table data is modified.


text:
Q: 2 fixed width sidebars with a central div that fills remaining space How can I let the green div be width: 100% with the other two divs on the same line with fixed width.
My idea is to let the two side div's have fixed width and the central div to be width: 100% (taking up the remainder space).
Is it possible to implement this situation?
CSS:
.boxMenu {
    width:200px;
    height:40px;
    background-color:#000;
    float:left;
}
.boxConteudoMaster {
    height:40px;
    background-color:#4cff00;
    float:left;
}
.boxNotificacao {
    width:200px;
    height:40px;
    background-color:#000;
    float:left;
}

HTML:

asd

JSFIDDLE HERE

A: I think your after something like this:
HTML:

Testing...

CSS:
.boxMenu {
    width:200px;
    height:40px;
    background-color:#000;
    float:left;
}
.boxConteudoMaster {
    height:40px;
    background-color:#4cff00;
    width: 100%;
}
.boxNotificacao {
    width:200px;
    height:40px;
    background-color:#000;
    float:right;
}

So we can float the 2 divs that we want fixed (float:left and float: right) and then after put are middle div to width: 100%.
DEMO HERE


text:
Q: Optional function parameter with default value by reference By automatic conversion of code written in VB.NET to C# I have such situation in function declaration of VB.NET:
Private Function dataArchiver(ByVal toPlace As String,
                               Optional ByVal aExtension As String = ".7z",
                               Optional ByRef createdName As String = "") As Integer

Tool for automatic conversion does this in C#:
private int dataArchiver(string toPlace,
                         string aExtension = ".7z",
                         ref string createdName = "")

And this of course don't work. Keyword "ref" before last argument is underlined with red.
Why is that so? Because string createdName may be (and don't have to be) generated in function and in that case have to be passed out from function.
It is important that this code can work with NET framework 3.5.
Any idea to get this working in C# without much reconcepting of VB.NET program?

A: You can use the out keyword instead in this case:
string createdName;
int retVal = dataArchiver("to place", out createdName, extension);

And your new method signature.
private int dataArchiver(string toPlace,
                      out string createdName,
                      string aExtension = ".7z")
{
    createdName = "some value";

    // rest of your code
}

The only change is that out can't have a method signature default value, so you will need to set it inside the method.

A: You have to create overloaded methods for this (as you would have had to do before C# acquired the optional parameter feature):
private int dataArchiver(string toPlace, string aExtension)
{
    string tempVar = "";
    return dataArchiver(toPlace, aExtension, ref tempVar);
}

private int dataArchiver(string toPlace)
{
    string tempVar = "";
    return dataArchiver(toPlace, ".7z", ref tempVar);
}

private int dataArchiver(string toPlace, string aExtension, ref string createdName)
{
    return 0;
}


text:
Q: access Nth node from xpath result set
Possible Duplicate:
Get Nth child of a node using xpath

How can I access Nth node from the following set.
XPath = /ProcessData/*[starts-with(name(), 'INV')]

A: Below expression will help
(/ProcessData/*[starts-with(name(), 'INV')])[5]

Here 5 can be replaced with the desired value to get the nth node from the selected(filtered) nodes.


text:
Q: To find relative position of point in a sector (2D)? I am given the center of circle $C_x$,$C_y$ , radius $R$ and the angle of the sector $\theta$. We go clockwise.
For eg- If Center is $(0,0)$ and $R= 10$ then circle is started from line segment formed by line segment $(0,0),(0,10)$ and the $\theta$ is given in reference to it.
I am given a point $X$, $Y$ and I have to find the position of point (inside the sector or not).
So I calculated the $r$ distance from $C_x,C_y$ to point $X,Y$. I
 know the first condition should be that $r \le R$.
How do I check for the angle ??

A: Let $\hat{\alpha} = \operatorname{atan2}(Y-C_y,X-C_x)$ and define
$$
\alpha = \left\{
\begin{array}{rr}
\pi/2 - \hat{\alpha}, & -\pi < \hat{\alpha} \leq \pi/2\\
5\pi/2 - \hat{\alpha}, & \pi/2 < \hat{\alpha} \leq \pi
\end{array}
\right.
$$
If $\alpha \leq \theta$ and $(Y-C_y)^2 + (X - C_x)^2 \leq R^2$, then the point $(X,Y)$ belongs to the sector.


text:
Q: Join new data to selected features in a table using Arcgis I have a point feature class, A, and I have joined data from another point feature class, B, to its attribute table based on spatial location. I selected the second option in the Join Data window ('Each point will be given all the attributes of the point in the layer being joined that is closest to it ...'). It worked perfectly and all fields from B (say Field_1 and Field_2) are added to A.
Then I added two new records to A (two new points to shapefile) and I want to join data from a different point feature class, C, to these two new points. C has exactly the same fields as B but their values are different. I want data from C to be added to the same fields (Field_1 and Field_2) that are already imported from B, but for these new points. I am wondering Is there any way that I can join data from C to selected features in A (these two new points) in ArcGIS?
P.S. I am using ArcGIS 10.1 on Windows 7

A: Instead of adding the two records to A, make a new feature class with them called D. Join the fields in C to your new feature class D. Then use the Merge tool to combine A and D.


text:
Q: change comment structure in buddypress plugin I try to change  default comment structure of buddy press with my own plugin and add some custom edit . for that i found we should use wp_list_comments and in callback function . i use below example function:
function my_blog_comments( $comment, $args, $depth ) {
    $GLOBALS['comment'] = $comment;

    if ( 'pingback' == $comment->comment_type )
        return false;

    if ( 1 == $depth )
        $avatar_size = 50;
    else
        $avatar_size = 25;
     ...
 }
wp_list_comments( array( 'callback' => 'my_blog_comments', 'type' => 'comment' ) );

but cant show any change on comment structure what's wrong in my code

A: wp_list_comments goes in your template file.


text:
Q: Show that $\int_{\pi}^{\infty} \frac{1}{x^2 (\sin^2 x)^{1/3}} dx$ is finite. Show that $\int_{\pi}^{\infty} \frac{1}{x^2 (\sin^2 x)^{1/3}} dx$ is finite. I've been trying to use Holder inequality but it seems I can't get the right combination of $p$ and $q$. Maybe I'm on the wrong track?

A: We have:
$$ \int_{0}^{\pi}\frac{dx}{\left(\sin^2 x\right)^{\frac{1}{3}}}=\frac{\Gamma\left(\frac{1}{2}\right)\Gamma\left(\frac{1}{6}\right)}{\Gamma\left(\frac{2}{3}\right)}$$
hence:
$$\begin{eqnarray*} \left|\int_{\pi}^{+\infty}\frac{dx}{x^2\left(\sin^2 x\right)^{\frac{1}{3}}}\,dx\right|&\leq& \pi\left(\frac{1}{\pi^2}+\frac{1}{4\pi^2}+\frac{1}{9\pi^2}\ldots\right)\frac{\Gamma\left(\frac{1}{2}\right)\Gamma\left(\frac{1}{6}\right)}{\Gamma\left(\frac{2}{3}\right)}\\&=&\frac{\pi}{6}\cdot \frac{\Gamma\left(\frac{1}{2}\right)\Gamma\left(\frac{1}{6}\right)}{\Gamma\left(\frac{2}{3}\right)}.\end{eqnarray*}$$
The exact value of the integral is given by:
$$ I = \frac{1}{\pi}\int_{0}^{1}\frac{\psi'(1+x)\,dx}{\left(\sin^2 (\pi x)\right)^{\frac{1}{3}}}$$
and by computing the Laplace transform of $\frac{1}{(\sin^2 x)^{\frac{1}{3}}}$, the inverse Laplace transform of $\frac{1}{(x+\pi)^2}$ and keeping just the terms $A e^{-\pi s},B s^2 e^{-\pi s}$ of their product we get:
$$ I\leq \frac{\Gamma\left(\frac{1}{6}\right)}{4\pi^{7/2}\Gamma\left(\frac{2}{3}\right)}\left(5\pi^2-\psi'\left(\frac{1}{3}\right)+\psi'\left(\frac{2}{3}\right)\right)\leq\color{red}{\frac{4}{5}}.$$


text:
Q: cURL failing to submit POST data I'm trying to submit a simple form with cURL. After obtaining the login cookie and submitting the data I want, I get a random response and form fails to submit. Here is what it looks like when browser submits a form:
formPost:cur_product_form_new_86286
curCheckbox:Y
C2cProductsListing[business_hr_from]:10:00:00
C2cProductsListing[business_hr_to]:09:30:00
C2cProductsListing[online_hr]:35
C2cProductsListing[offline_hr]:16
C2cProductsListing[non_business_hr]:17
C2cProductsListing[actual_quantity]:25000
C2cProductsListing[minimum_quantity]:25000
C2cProductsListing[products_base_currency]:USD
C2cProductsListing[products_price]:88
delivery[1]:1
C2cProductsListing[c2c_products_listing_id]:86286

Here is what it looks like when I submit the form:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.g2g.com/sell/manageListingInfo'); // open a protected page
curl_setopt($ch, CURLOPT_REFERER, 'http://www.g2g.com/sell/manageListing?game=2522&product_type=19248');
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.A.B.C Safari/525.13");
$data = array(
    'formPost' => 'cur_product_form_new_86286',
    'curCheckbox' => 'Y',
    'C2cProductsListing' => array(
        'business_hr_from' => '09:00:00',
        'business_hr_to' => '08:30:00',
        'online_hr' => '35',
        'offline_hr' => '16',
        'non_business_hr' => '17',
        'actual_quantity' => '25000',
        'minimum_quantity' => '25000',
        'products_base_currency' => 'USD',
        'products_price' => '25',
        'c2c_products_listing_id' => '86286'
    ),
    'delivery' => array(
        '1' => '1'
    )
);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_REFERER, 'http://www.g2g.com/sell/manageListing?game=2522&product_type=19248');
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_FAILONERROR, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
print_r(curl_getinfo($ch));

curl_close($ch);

And here is the completely random response I get:
Array ( [url] => http://www.g2g.com/sell/manageListingInfo [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => 0 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0 [namelookup_time] => 0 [connect_time] => 0 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 [certinfo] => Array ( ) )

The array I just posted is result of print_r(curl_getinfo($ch)). How do I end up here? I emulated the browser request fully (aside from it being cURL and not the actual browser) using all the data necessary, yet the form doesn't seem to be submitted?

A: You're not calling curl_exec to actually execute the query. Call curl_getinfo afterwards. If you want the data returned use the return value of curl_exec instead of  curl_getinfo. For example:
$data = curl_exec($ch);
echo $data;


text:
Q: Redux+React+Typescript - What is the proper way to save the selected index state of a navigation bar New to these technologies and have a question regarding my single page application.  I started with the reactredux example from this template:
https://blogs.msdn.microsoft.com/webdev/2017/02/14/building-single-page-applications-on-asp-net-core-with-javascriptservices/
The root component of my SPA is the layout.  The NavMenu is directly under the layout as well as the RightNavMenu object.  The RightNavMenu changes depending on the state of the NavMenu, so I setup the NavMenu store at the layout level as follows:
index.ts:
import * as NavMenu from './NavMenu';

// The top-level state object
export interface ApplicationState {
navMenu: NavMenu.NavMenuState //-stores information on which index is currently selected
}

// Whenever an action is dispatched, Redux will update each top-level application state property using
// the reducer with the matching name. It's important that the names match exactly, and that the reducer
// acts on the corresponding ApplicationState property type.
export const reducers = {
navMenu: NavMenu.reducer
};

// This type can be used as a hint on action creators so that its 'dispatch' and 'getState' params are
// correctly typed to match your store.
export interface AppThunkAction<TAction> {
(dispatch: (action: TAction) => void, getState: () => ApplicationState): void;
}

Here is my NavMenu store (NavMenu.ts):
    import { Action, Reducer } from 'redux';
export interface NavMenuState {
selectedIndex: number;
}

interface SelectIndexAction { type: 'NAV_SELECT_INDEX' }
interface DoNothingAction { type: 'NAV_DO_NOTHING' }

type KnownAction = SelectIndexAction | DoNothingAction;

export const actionCreators = {
select: (selectedIndex:number) => <SelectIndexAction>{ type: 'NAV_SELECT_INDEX' },
donothing: () => <DoNothingAction>{ type: 'NAV_DO_NOTHING' }
};

export const reducer: Reducer<NavMenuState> = (state: NavMenuState, action: KnownAction) => {
switch (action.type) {
    case 'NAV_SELECT_INDEX':
        alert('hasdf');
        return { selectedIndex: state.selectedIndex };
    case 'NAV_DO_NOTHING':
        return { selectedIndex: state.selectedIndex };
    default:
        // The following line guarantees that every action in the     KnownAction union has been covered by a case above
        const exhaustiveCheck: never = action;
}

// For unrecognized actions (or in cases where actions have no effect), must return the existing state
//  (or default initial state if none was supplied)
return state || { selectedIndex: 0 };
};

Here is my NavMenu.tsx component:
import * as React from 'react';
import { Link } from 'react-router';
import { connect } from 'react-redux';
import { ApplicationState } from '../store';
import { List, ListItem, makeSelectable } from 'material-ui/List';
import * as NavMenuStore from '../store/NavMenu';

let SelectableList = makeSelectable(List);
type NavMenuProps = NavMenuStore.NavMenuState
& typeof NavMenuStore.actionCreators
& { params: { startIndex: string } };       // ... plus incoming routing      parameters

export class NavMenu extends React.Component<NavMenuProps, null> {
componentWillMount() {

    // This method runs when the component is first added to the page
    let selectedIndex = parseInt(this.props.params.startIndex) || 0; //parse the int or set to 0 if it fails
    if (selectedIndex == 0) //if the parse fails select the first index by defaualt
        selectedIndex = 1;
    this.props.select(selectedIndex);
}

public render() {
    return (
        <SelectableList defaultValue={1}>

Current index: {this.props.selectedIndex}

            <ListItem onClick={() => { this.props.select(1) }} value={1} primaryText="TestIndex1"   />
            <ListItem onClick={() => { this.props.select(2) }} value={2} primaryText="TestIndex2"  />
        </SelectableList>
    );
}

}

export default connect(
(state: ApplicationState) => state.navMenu, // Selects which state properties are merged into the component's props
NavMenuStore.actionCreators                 // Selects which action creators are merged into the component's props
)(NavMenu);

Finally, this is how I am embedding it in my layout component:
<NavMenu />

The above throws an error about missing properties, so I tried changing to this, but it still does not work.
<NavMenu donothing={null} params={null} selectedIndex={0} select={ null } />

Can someone please tell me what I am doing wrong?  I am currently just trying to output the selected index at the top of the list.  When the user clicks on the first or second item in the list, I would expect the selected index text to update accordingly.
Questions:

*

*Am I implementing the navigation bar structure correctly with the layout and right navigation bar?

*How can I make it work?
Thank you.

A: This post is a bit old, but I thought I would share my experience just in case someone else comes across this. I fought the exact same issue for 2 days and finally got it working.
For me, it seemed to come down to two things. First, I changed:
export class NavMenu extends React.Component<NavMenuProps, null> {

and took off the "export" keyword:
class NavMenu extends React.Component<NavMenuProps, null> {

I'm guessing that with the export keyword in place, when you "import NavMenu" in another component, it's grabbing the actual NavMenu class, and not the one wrapped in Redux's Connect object.
Also, in the Layout.tsx file where I had the NavMenu in the markup, I apparently had the import statement wrong. I changed it to:
import NavMenu from './NavMenu';

All of this now works for me.
Sorry if my answer is a little confusing or inaccurate. I'm very new to React, and not much of a javascript expert either, so please don't flame me...


text:
Q: How to access nested JSON array values using Gloss? I'm currently using the library Gloss: https://github.com/hkellaway/Gloss
in order to help parse JSON data.  I can't seem to access nested arrays like the "know_for" value:
    "results": [
        {
          "profile_path": "/s2eX7lG0n35AtkenfZV0uoLSudv.jpg",
          "adult": false,
          "id": 77700,
          "known_for": [
            {
              "poster_path": "/ckrTPz6FZ35L5ybjqvkLWzzSLO7.jpg",
              "adult": false,
              "overview": "",
              "release_date": "2016-05-25",
              "original_title": "Warcraft",
              "genre_ids": [
                12,
                14,
                28
              ]
       }
    ]
  }
]

This is how I have my data objects set up:
    public struct ResultsPeopleData: Decodable {

      public let results: [PeopleData]?

      public init?(json: JSON) {

        results = "results" <~~ json
      }
    }

    public struct knownForArray : Decodable {

      public let poster : String
      public let overview : String
      public let releaseDate : String
      public let title : String
      public let id : NSNumber
      public let backdrop : String

      public init?(json: JSON) {

        guard let poster : String = "poster_path" <~~ json,
          let overview : String = "overview" <~~ json ?? "N/A",
          let releaseDate : String = "release_date" <~~ json ?? "N/A",
          let title : String = "title" <~~ json ?? "N/A",
          let id : NSNumber = "id" <~~ json,
          let backdrop : String = "backdrop_path" <~~ json
          else { return nil }

        self.poster = poster
        self.overview = overview
        self.releaseDate = releaseDate
        self.title = title
        self.id = id
        self.backdrop = backdrop
      }
    }

    public struct PeopleData: Decodable {

      public let profile : String
      public let id : NSNumber
      public let knownFor : [knownForArray]?
      public let name : String

      public init? (json: JSON) {

        guard let profile : String = "profile_path" <~~ json ?? "N/A",
          let id : NSNumber = "id" <~~ json,
          let knownFor : knownForArray = "known_for" <~~ json,// This causes function to return
          let name : String = "name" <~~ json
          else { return nil }

        self.profile = profile
        self.id = id
        self.knownFor = [knownFor]
        self.name = name
      }

This is how I update the data objects:
  static func updateAllData(urlExtension: String, completionHandler:@escaping (_ details: [PeopleData]?) -> Void){

    let nm = NetworkManager.sharedManager

    nm.getJSONData(type:"person", urlExtension: urlExtension, completion: {
      data in

      if let jsonDictionary = nm.parseJSONData(data)
      {
        guard let peopleResults = ResultsPeopleData(json: jsonDictionary)

          else {
            print("Error initializing object")
            return
        }

        print(jsonDictionary)

        guard let peopleData = peopleResults.results
          else {
            print("No such item") //This gets triggered when updating "knownfor" value
            return
        }

        completionHandler(peopleData)
      }
    })
  }
}

I put break points in the inits for the object values and every time I try and initialize the PeopleData's `

public let knownFor : [knownForArray]?

` value it stops initializing the PeopleData struct and causes the

print("No such item")

part of the updateAllData function to trigger. I'm  not sure what I'm doing wrong.


text:
Q: Stop picture element downloading image if viewport over certain width Using a <picture> element, what is the best way to stop an image being downloaded if the viewport is over a certain width?
I'm currently using the following HTML and CSS, which correctly prevents image.png being downloaded if the viewport is > 900px - but only when the page is first loaded! The moment the viewport is resized below 900px and then resized back over 900px again, transparent.png is downloaded.
Additionally, on IE9, transparent.png gets downloaded when the page first loads and when the viewport is resized.
HTML
<picture>
    <source type="image/png" srcset="image.png" media="(max-width: 900px)">
    <img srcset="transparent.png"><!-- 1px transparent PNG -->
</picture>

CSS
@media (min-width: 900px) {
    picture {
        display: none;
    }
}

Ideally, I don't want anything to be downloaded above 900px no matter what. Is this possible?

A: You can use
srcset="data:" OR srcset="about:blank"

Also please note the img tag in the picture is loaded first if the media condition is not met on first load otherwise the source image is loaded, so set the img tag to empty and then in the source tag with the media you have load the image you want when the screen is less than 900px. Here is a codepen to check out. reduce the screen size to see the effect.
https://codepen.io/Nasir_T/pen/rJOwzq
Hope this helps.