I have a .jrxml file template generated and I am trying to create reports for different scenarios. In some cases, i have to add new columns to what is already present in the .jrxml file or I have to remove columns. Is there a way where I can still use the .jrxml as the base and add or remove a column programmatically?
I'd like to show/hide a column at runtime based on a particular condition. I'm using "Print when expression" to conditionally show/hide this column (and it's header) in my report. When the column is hidden, the space it would have occupied is left blank, which is not particularly attractive.  I would prefer if the extra space was used in a more effective manner, possibilities include:   the width of the report is reduced by the width of the hidden column the extra space is distributed among the remaining columns   In theory, I could achieve the first by setting the width of the column (and header) to 0, but also indicate that the column should resize to fit its contents. But JasperReports does not provide a "resize width to fit contents" option.  Another possibility is to generate reports using the Jasper API instead of defining the report template in XML. But that seems like a lot of effort for such a simple requirement.
What approach should I take to establish this logical proof? I need to design a logical math proof:  Write a detailed structured proof to prove that if m and n are integers, then either 4 divides mn or else 4 does not divide n.   Hint: Think about the form of the statement.   I was thinking about first proving that either 4 should divide m or n in order for the first part to be true, then use proof by cases to prove what happened when m was 4, and another case when n was 4...  But I got stuck, what do you recommend:    This is what I got so far: Claim: (m ∈ Z ∧ n ∈ Z) => (4 | mn ˅ 4 ∤ n)  Negated claim: (m ∈ z ∧ n ∈ z) ∧ ( P(n) ∧ ¬P(mn) )  Proof by contradiction  Assume m , n ∈ z:    Assume P(n) ∧ ¬P(mn):       Then ∃ q ∈ R, n = 4q       Let q0 be such that n = 4q0       Then mn = m(4q0)       Then mn = 4(mq0)       Then ∃ q ∈ R, mn = 4q        Then 4 | mn     Then P(n) ∧ P(mn) Then (m , n ∈ z) ∧ P(n) ∧ P(mn))    I know that is wrong, how can I fix it? Commutative non Noetherian rings in which all maximal ideals are finitely generated In commutative rings we have the following  Theorem. $R$ is Noetherian if and only if each prime ideal of $R$ is finitely generated.  From this Theorem I am looking for commutative rings $R$ in which every maximal ideal is finitely generated but $R$ is non Noetherian.  Question: Is there a straightforward example of a commutative ring $R$ so that each maximal ideal is finitely generated, but $R$ is non Noetherian?  Thank You IndentationError: unindent does not match any outer indentation level Why was the DeLorean in Back To The Future not always covered in ice after time travel, and why didn't it fly in 1885? SSH and home directory permissions It took me hours to solve this SSH problem with one of my class accounts on my school's servers.    I couldn't ssh into one particular class account without entering my password, while passwordless authentication worked with my other class accounts. The .ssh/ directory and all of its contents had the same, correct permissions as the other class accounts.   Turns out the problem was the permissions set on my own home directory. Passwordless authentication did not work when the permissions on my HOME directory were set to 770 (regardless of the permissions set for .ssh/), but it worked with permissions set to 755 or 700.   Anyone know why SSH does this? Is it because the home directory permissions are too permissive? Why does SSH refuse to authenticate with the public/private keys when the home directory is set more permissive than 700? Read echo'ed output from another PHP file Understanding Join Attributes by Location in QGIS? I wonder if there is somewhere an explanation for the parameters that can be set when running the Algorithm "Join Attributes by Location" in QGIS 2.18.  I had a look here:       but there is no explanation. Any hints? Prove that sequence $ x_{(n+1)}= \frac {a}{1+x_n}$ is convergent to positive root of $x^2+x-a=0,$where $a >0$ and $x_1 >0$ Prove that sequence $$ x_{(n+1)}= \frac {a}{1+x_n}$$ is convergent to positive root of $x^2+x-a=0,$where $a &gt;0$ and $x_1 &gt;0$  we have $$x_{(n+2)}-x_n=\frac{-a(x_{(n+1)}-x_{(n-1)})}{(1+x_{(n-1)})(1+x_{(n+1)})}$$  Hence from this we see behaviour of even terms subsequence and odd terms subsequence  is opposite. how to proceed from there. any hint please Answering your own question? Accept it. How to programmatically remove a field from a node? I was able to post in chat with less than 20 rep by joining 20 sites I joined 20 other sites (out of the many) and even with 1 rep was able to post in any of the chatrooms. For example: In ELL, I have just 1 rep and have posted messages in its chat.  ell.stackexchange.com/users/18923/lamart This seems like a bug because I should have needed 20 rep to post. . EDIT: From , I got the idea to make this edit. To reproduce this bug/error:  Create a new SE account. Use it to make an account here. You will get 1 default rep. Choose a random SE site and use this account to get 1 rep on that random site. Repeat the above step 20 times. Now you have 1 rep on 20 network sites but the net SE rep is 20. Go to the ELL chat and ping me. (important step)  From my comment: I have now got 40 rep since people voted this question up. Initially I had net 20 rep gained by creating 20 accounts on 20 different SE sites. Those default 1rep added up to get me to 20rep and I was able to chat. The link says one needs 20 rep in any of the SE site to chat in &quot;all the other&quot; category chatrooms..... but I did not have 20 rep on ELL at that moment. How to skip validation when a specific button is clicked? how can I open a extra console and run a program in it with one command? So I know if I type gnome-terminal or xterm, a new window will be popped out. Then I checked the man page for these two, nothing relevant found.  Then I noticed under Mac you can do it with the program open. But it seems under Linux it's not that trivial.  Does anyone have experience? General integral to find resistance My question is: is there a simple and truly general equation for the resistance between two electrical equipotential surfaces?.  Obviously, if so, what is it, and if not, why?  It would be very difficult to solve, granted, but I just want to see a calculus equation that is fully descriptive.  I have two frameworks under which this could be entertained, I'll write those out and then explain the motivation.  To start with, we need propose that the volume separating the two surfaces has a volumetric resistivity, $\rho$ in units of $(\Omega m)$.  Single Volume Framework  We can limit the discussion to a defined volume, then the surfaces reside in that volume or on the surface of it.  This volume may have a constant resistivity $\rho$ while everywhere outside the volume is completely electrically insulating.  Infinite Volume Framework  An alternative to the above approach that might make the task more or less difficult would be to replace a constant resistivity with a spatial dependence $\rho(\vec{r})$ and no longer require a boundary condition.  In that case we only have 3 mathematical inputs to the problem, which is the resistivity defined for all $\vec{r}$ and a definition of the two surfaces, $S_1$ and $S_2$.  Known Algebraic Analogs  The  that I find insufficient is:  $$R = \rho \frac{\ell}{A}$$  Where $l$ is the length of the restive material that is any shape which has translation symmetry over that length, and $A$ is the cross-sectional area.  Obviously, this is a rather simple equation that won't apply to more complicated geometry.  Even more  seem to give equations that fall short of what I'm asking.  For example:  $$R = \rho \int_0^l \frac{1}{A(x)} dx$$  I think it's obvious that an equation such as this is built upon a myriad of assumptions.  For a thought experiment, imagine that the area starts out as very small and then pans out to very large quickly.  Well, accounting for the larger area in the above sense underestimates the resistance, because the charge has to diffuse out perpendicular to the average direction of flow as well as parallel to it.  I have some reasons to suspect this might actually be rather difficult.  A big reason is that all the approaches I'm familiar with require the flow paths to be established beforehand, which can't be done for what I'm asking.  So maybe this will result in two interconnected calculus equations.  Motivation  I had an interest in , and it occurred to me that I can't quickly and simply write down the equation for resistance between two points.  The unique thing about Squishy Circuits is that it calls for two types of dough, one that conducts and one that is mostly insulating.  However, the recipes aren't perfect and because of that, the young children who play with these circuits regularly encounter the limits of conductor and insulator definitions.  If you make your conductor dough too long and/or too thin, you will encounter dimming of the light you connect with it.  Similarly, a thin insulator layer will lead to a lot of leakage current which also dims the light. Positioning of decorations on parallel lines Is it possible to switch a certain Stack Exchange site's interface (as a personal preference) to the theme used by beta sites?  Some sites have flashy decorations or unreadable fonts (I prefer to disable antialiasing on fonts). It would be nice to have an option to see a site with the "beta" theme.  If there's a solution using custom styles, I would accept that as an answer. Pgfplots: how to fill bounded area under a curve using addplot and fill? Lazy evaluation in C++ C++ does not have native support for lazy evaluation (as Haskell does).  I'm wondering if it is possible to implement lazy evaluation in C++ in a reasonable manner. If yes, how would you do it?  EDIT: I like Konrad Rudolph's answer.  I'm wondering if it's possible to implement it in a more generic fashion, for example by using a parametrized class lazy that essentially works for T the way matrix_add works for matrix.  Any operation on T would return lazy instead. The only problem is to store the arguments and operation code inside lazy itself. Can anyone see how to improve this? I (as a middle-school student) was wondering how virtual particles even conserve energy of the entire system? I don't mean just the particle's energy, but conservation with respect to the surroundings?  Let me explain more, Einstein proved that $E = mc^2$ and equivalently, we can say $m = \frac{E}{c^2}$ . We however know mass causes curvature in space-time (gravity well). Now that statement being completely valid we can use Quantum Fluctuation, implying energy and time can be related by the relation:  $\Delta{E}\Delta{t}\approx\frac{\hbar}{2}$ and by that simple relation we can make the following points:   As the energy increases, the time allowed to be "borrowed" decreases, before it gives it back to the universe. As time increases, the energy allowed to be "borrowed" decreases.    These are completely satisfactory points I've made, I believe.  Now, I have read that the vacuum is filled with constantly bubbling virtual particles that get created from the energy "borrowed" by the above relation and is destroyed again, which satisfies the energy conservation laws.   This seems to imply that  in the short time the virtual particle exists, they must have a very small mass which is: $m_{1} = \frac{\Delta{E}}{c^2}$ and using basic classical mechanics rather than GR (for sake of simplicity) we calculate that the gravitational force mediated by this short-lived virtual particle;  $F_{g}= G\frac{m_1 * m_x}{r^2}$   where $m_x$ is an particle\mass in question. Nevertheless since we know the force set upon an object moves the object in a direction, we can say it would increase its kinetic energy by this factor: $F_g = \frac{1}{2}mv^2$ which is equal to $G\frac{m_1 * m_x}{r^2} = \frac{1}{2}mv^2$.  Surely, this implies that every time quantum fluctuations happen, energy of real-particles\masses increases and therefore violates energy conservation, but what prevents this violation from taking place?  If virtual particles are not really present and interact with objects like I thought, how can Hawking radiation (currently a large concept in black hole physics) then be accepted in physics community? How can brackets be escaped in using string.Format? For example: String val = &quot;1,2,3&quot; String.Format(&quot; foo {{0}}&quot;, val);  This example doesn't throw an exception, but it outputs the string foo {0}. Is there a way to escape the brackets?