Here's what I have   public void someMethod() {   MyObject myObject = new MyObject();    .. some more initialization code..    myObject = methodThatRetunsMyObject();    myObject.doSomething(); }   Question: Will the orphaned object creation lead to significant performance issues?  The goal is to achieve maximum transactions per second, hence my assumption is, orphaned objects would lead to GC runs which could affect throughput.
Should Java Objects be reused as often as it can be reused ? Or should we reuse it only when they are "heavyweight", ie have OS resources associated with it ?  All old articles on the internet talk about object reuse and object pooling as much as possible, but I have read recent articles that say new Object() is highly optimized now ( 10 instructions ) and Object reuse is not as big a deal as it used to be.  What is the current best practice and how are you people doing it ?
Normal subgroups of infinite symmetric group I recently took a course on group theory, which mentioned that the following proposition is equivalent to the continuum hypothesis: "The infinite symmetric group (i.e. the group of permutations on the set $\mathbb{N}$) has exactly 4 normal subgroups." Does anyone have any references or explanation for this? How should I detect unnecessary #include files in a large C++ project? Why does mathematical convention deal so ineptly with multisets? I'd like to find out why  \begin{align} \sum_{n=0}^{\infty} \frac{n^2}{2^n} = 6 \end{align}  I tried to rewrite it into a geometric series  \begin{align} \sum_{n=0}^{\infty} \frac{n^2}{2^n} = \sum_{n=0}^{\infty} \Big(\frac{1}{2}\Big)^nn^2 \end{align}  But I don't know what to do with the $n^2$. Which badges do not cause a notification for experienced users? Yesterday, I have received two : Revival, and Self-Learner. However I was only notified of the Revival badge, because apparently the Self-Learner badge is not considered "".  What badges have their notification suppressed if the user has a 200-rep account somewhere on the Stack Exchange network, i.e. they won't trigger a new item in our achievements dialog? I have an alias that I would like to use both as a regular user and as root, via sudo. Specifically, it is this:  alias rm=trash   This works fine as a normal user, and it works fine when I use sudo -i to get a root shell prompt, but if I use sudo rm, the alias does not apply. So where do I need to put my alias so that it works in one-off sudo commands? Performance evaluation of auto.arima in R and UCM on one dataset I started evaluating and comparing some methods in forecasting. I used Price of dozen eggs in US, 1900–1993, in constant dollars in the R software FMA package. I held out the last 10 years for assessment of forecast. Below are the results:  I used auto arima method in the R software. Obviously the results are way off. Am I doing something incorrect ? Below is the forecast. It does not recognize the declining trend.     I also used an unobserved components model (UCM) and obtained a good forecast,  as below.   Without outliers/level shifts there are very large standard errors and therefore wide confidence bands.  After some iterative work, below is the output with outliers/level shifts (I know I'm overfitting here) but it did a pretty good job in forecasting; there are also narrow confidence bands.    In looking at just this example the UCM seems to predict the hold-out sample more accurately than auto.arima.  Why is auto.arima not providing a reasonable forecast?  Are state space models/UCMs better for forecasting long range?  Are there any benefits of using one method over other? How to render an ASP.NET MVC view as a string? Does the lens I just bought have a fungus? How to make Latexmk use makeglossaries? Converting time field omitting time and returning null values? I have a time field in my shapefile that is formatted as HH:mm:ss.s It is a text field, and I want to convert it to a date so I can calculate time elapsed across rows (if there's a better way to do this let me know). Basically, each row is a point on a route, and I want to use the time field to calculate the amount of time elapsed between the first and last points on the route.   I tried using the convert time field tool, setting the input format as HH:mm:ss.s, and the output type as DATE. The output field however only shows values of 01/01/2001 for some rows and  for other rows.   time is the input field and time_c is the output field  I'm not sure what's going wrong here, here is what shows up in the geoprocessing results window:    I tried adding the date data to the field as well to make the format yyyy-MM-dd HH:mm:ss.s, but it still didn't work: LWC to display salesforce objects as a picklist onclick I have a requirement where I need to display list of salesforce objects as a picklist when a radio button is clicked.  Being new to LWC development, I could not figure out what is the right approach to do so. I have come across  from Salesforce articles where we can display radio buttons but as per my scenario, i need to display list of all salesforce objects as picklist when a radio button option is selected.  Can anyone please suggest the right approach to do so. How do I drag and drop files into an application? This is something I've been curious about since starting this whole 'meta' thing a couple years back.     Let's say a user posts a feature request.   Under what circumstances is the feature-request read by staff? If staff decline to do anything (I'd guess it's some sort of triage), under what circumstances is the feature-request reevaluated by staff?     Let's say a user posts a bug.    Under what circumstances is the bug tested? What generally determines whether a verified bug is actionable? (And/or what are the criterion for deciding what to do?)     For both of the above, would it be possible to see a general-but-relatively-detailed flow for what happens to these questions? TypeError: Element-wise multiplication: not supported between 'Matrix' and 'Vector' Overview:  Lots of games with RPG-like statistics allow for character "buffs", ranging from simple "Deal 25% extra damage" to more complicated things like "Deal 15 damage back to attackers when hit."  The specifics of each type of buff aren't really relevant.  I'm looking for a (presumably object-oriented) way to handle arbitrary buffs.  Details:  In my particular case, I have multiple characters in a turn-based battle environment, so I envisioned buffs being tied to events like "OnTurnStart", "OnReceiveDamage", etc.  Perhaps each buff is a subclass of a main Buff abstract class, where only the relevant events are overloaded.  Then each character could have a vector of buffs currently applied.  Does this solution make sense?  I can certainly see dozens of event types being necessary, it feels like making a new subclass for each buff is overkill, and it doesn't seem to allow for any buff "interactions".  That is, if I wanted to implement a cap on damage boosts so that even if you had 10 different buffs which all give 25% extra damage, you only do 100% extra instead of 250% extra.  And there's more complicated situations that ideally I could control.  I'm sure everyone can come up with examples of how more sophisticated buffs can potentially interact with each other in a way that as a game developer I may not want.  As a relatively inexperienced C++ programmer (I generally have used C in embedded systems), I feel like my solution is simplistic and probably doesn't take full advantage of the object-oriented language.  Thoughts?  Has anyone here designed a fairly robust buff system before?  Edit: Regarding Answer(s):  I selected an answer primarily based on good detail and a solid answer to the question I asked, but reading the responses gave me some more insight.  Perhaps unsurprisingly, the different systems or tweaked systems seem to apply better to certain situations.  What system works best for my game will depend on the types, variance, and number of buffs I intend to be able to apply.  For a game like Diablo 3 (mentioned below), where nearly any bit of equipment can change a buff's strength, the buffs are just character stats system seems like a good idea whenever possible.  For the turn-based situation I'm in, the event-based approach may be more suitable.  In any case, I'm still hoping someone comes along with a fancy "OO" magic bullet which will allow for me to apply a +2 move distance per turn buff, a deal 50% of damage taken back to the attacker buff, and a automatically teleport to a nearby tile when attacked from 3 or more tiles away buff in a single system without turning a +5 strength buff into its own subclass.  I think the closest thing is the answer I marked, but the floor is still open.  Thanks to everyone for the input. Inform moderators migrating a question if the migration would have been normally blocked breaking of output into new lines How to find the inverse modulo $m$? For example: $$7x \equiv 1 \pmod{31} $$ In this example, the modular inverse of $7$ with respect to $31$ is $9$. How can we find out that $9$? What are the steps that I need to do? Update If I have a general modulo equation: $$5x + 1 \equiv 2 \pmod{6}$$ What is the fastest way to solve it? My initial thought was: $$5x + 1 \equiv 2 \pmod{6}$$ $$\Leftrightarrow 5x + 1 - 1\equiv 2 - 1 \pmod{6}$$ $$\Leftrightarrow 5x \equiv 1 \pmod{6}$$ Then solve for the inverse of $5$ modulo 6. Is it a right approach? Thanks. True\False?  For every matrix $A\in M_{2}( \mathbb{C}) $ there's  $X\in M_{2}( \mathbb{C})$ such that $X^2=A$.  I know that every complexed matrix has a Jordan form matrix $J$ such that $P^{-1}CP=J$, But it's not diagonalizable for sure.  Thanks