How to truncate the number of digits after the decimal Suppose, I take an irrational number, q, and an integer n, and I want to print the truncated value of q after keeping exactly n digits after the decimal.   Example:  Input: q = 3.14159625, n = 3 Output: 3.141
How do I format a number in Java? How do I format a number in Java? What are the &quot;Best Practices&quot;? Will I need to round a number before I format it?  32.302342342342343 =&gt; 32.30 .7323 =&gt; 0.73  etc.
Can you use class features while Polymorphed? More specifically I'm trying to understand if a Barbarian who has been polymorphed, either willingly or not would be able to . However this also applies to things such as , or , anything a player might want to continue to use while no longer themselves.  Many questions specify you're able to rage while Wild Shaped, as  specifies      You retain the benefit of any features from your class, race, or other source and can use them if the new form is physically capable of doing so.   However,  specifies the following,     The target's game statistics, including mental ability scores, are replaced by the statistics of the chosen beast. It retains it's alignment and personality.   And     The creature is limited in the actions it can perform by the nature of its new form.   Unlike Wild Shape, nowhere does polymorph specify that you retain benefits from your class or race. Does this imply that class abilities do not carry over to polymorphed individuals? How to integrate PHP forum system with new Django website Paucity of words for relationships Prevent Photos app on OSX from launching when plugging in device I am trying to get an intuitive idea of how the  affects Quantum computation. My understanding is that given a qubit $Q$ in superposition $Q_0 \left| 0 \right&gt; + Q_1 \left| 1 \right&gt;$, NCT states another Qubit $S$ cannot be designed such that $S$ is equivalent to the state of $Q$.   Now the catch is, what does Equivalent mean? It could mean either that:   $S = S_0 \left| 0 \right&gt; + S_1 \left| 1 \right&gt;$ such that $S_0 = Q_0, S_1 = Q_1$. Or it could mean that $S = Q$, meaning that if $S$ is observed to be some value ( for example 0) then $Q$ MUST be that same value, and vice versa.    So it seems that point 2, occurs anyways in entangled systems (particularly cat-states), so I can eliminate that option and conclude that that No Cloning states, given a qubit $Q$, it's impossible to make another qubit $S$ such that:  $S = S_0 \left| 0 \right&gt; + S_1 \left| 1 \right&gt;$ such that $S_0 = Q_0, S_1 = Q_1$.  Is this correct? User systemd PulseAudio service Not much else to this question: I would like to know what I need to create a PulseAudio systemd service to be run with systemd --user.  I've tried a few different things, including various user services from Google, but I can't get it set up just right between dbus and everything else required for it.  Update: It seems to work ok with graphical sessions, but I'm still having some inconsistancy with dbus when logging in through console.  But PulseAudio is starting rather reliably, so I'm not overly concerned. Show $\sum\limits_{n=0}^{\infty}{2n \choose n}x^n=(1-4x)^{-1/2}$ How do you prove that $\sum\limits_{n=0}^{\infty}{2n \choose n}x^n=(1-4x)^{-1/2}$? I tried to identify the sum as a binomial series, but the $4$ and the $-1/2$ puzzle me. (This series arises in studying the first passage time of a simple random walk.) Making voltmeter accepting bipolar input voltage, using a microcontroller I want to build a very simple voltmeter using ATMEGA328 ADC. I can successfully measure up to 20v (using a voltage divider), but the problem is, I don't understand how to measure the voltage properly, if negative and positive terminals are switched.   Only way I could think of is adding another ADC input which is responsible for measuring the 'inverted voltage'. The join both ADC inputs, but add diodes in between, so one channel works with (+-) and the other channel works with (-+) and then 'merge' the input from both channels using code. Then I should be able to measure things like sin wave for example (where polarities switch).   Is the concept correct or is there a better way to do this? Thanks! Can I transfer trophies and data to a new account? Okay I have created a sub account on my ps3 as a new user. I wanted to change my psn online id. So I have copied all game data from the old account to my new account, but when I go to play the game it still says the trophies and data belong to the old account. I don't want to delete the old one and lose all my saved games and trophies, is there a way to either unlock and allow my new user to own the data and trophies or transfer the trophies and data so that my new account may own it? What's the difference between eq, eql, equal and equalp, in Common Lisp? What's the difference between eq, eql, equal and equalp, in Common Lisp?  I understand that some of them check types, some of them check across types an all that, but which is which?  When is one better to use than the others? Combinations of selecting $n$ objects with $k$ different types Suppose that I am buying cakes for a party. There are $k$ different types and I intend to buy a total of $n$ cakes. How many different combinations of cakes could I possibly bring to the party? Was V'ger responsible for the creation of the Borg? I remember reading somewhere a theory that  (the being that the Voyager probe had become in Star Trek: The Motion Picture) was somehow responsible for the creation of the Borg.  Is this canonical?  Where does the theory come from?  And how exactly did it go down? How can I implement object oriented programming in Mathematica? Does Python support short-circuiting? I have a bunch of raw data values that are dollar amounts and I want to find a confidence interval for a percentile of that data.  Is there a formula for such a confidence interval? How to kill a dragon in Skyrim? Anyone got any tips on how to beat down a Dragon solo? I've managed to get it down to 3/4 health, but keep running out of potions and getting owned.  I tend to whittle it down with bow from cover, then hit it with akimbo Lightning Strike which is awesome btw. Then poison and some sword.  I can't see a way to achieve this without having about 1000 points of stamina to run away from it when it does a swooping breath attack which seems to track you no matter what way you go.  Any advice please? This is for fighting them out in the open, "wild dragons" if you will. printing a block of text that matches a pattern Using just shell script, how to search a text file and list all whole blocks of lines that has inside some text (simple grep criteria).   The text file has blocks of lines separated by "-----------------" (precisely, each block start with "\n\n\n--------------------"... about 50 chars "-").  A sample could be:  ------------------------------- Abracadabra, blablablalbalba blablablabla, banana    ------------------------------- Text, sample text, sample text, sample text Text, sample text, sample text, sample text Text, sample text, sample text, sample text Text, sample text, sample text, sample text   -------------------------------   Text, sample text, sample text, sample text banana. Sample text, sample text, sample text, sample text Text, sample text, sample text, sample text   Lets consider the word "banana" the search criteria. So, the blocks listed would be:  ------------------------------- Abracadabra, blablablalbalba blablablabla, banana   ------------------------------- Text, sample text, sample text, sample text banana. Sample text, sample text, sample text, sample text Text, sample text, sample text, sample text   EDIT:  Testing answers to try awk, like: awk 'BEGIN{RS="\n------------"}/INFO/{print}' where INFO is what was searched for. I cannot get the whole block. So, follows a real sample and the result:  A REAL SAMPLE (including the first 3 new lines):      ------------------------------------------------- Diretório separado do nome o arquivo: adis, IWZLM (/home/interx/adis/src/IWZLM.SRC) Gerando rotina em linguagem C: (yla5 adis IWZLM -if) .INFO =>Rotina BLOQUEADA (status 'M'): Geracao ignorada (use -is para ignorar checagem do status)  [  OK-I ] IWZLM (adis) - Lista lay: Geracao ignorada do codigo em C.    ------------------------------------------------- Diretório separado do nome d arquivo: adis, ADISA (/home/interx/adis/src/ADISA.SRC) Gerando rotina em linguagem C: (yla5 adis ADISA -if) .ERRO: Falha inesperada  Compilando o programa: (ycomp adis ADISA -exe adis/exe/ADISA.temp.exe ) adis/exe/ADISA.temp.exe => adis/exe/ADISA  [  OK   ] ADISA (adis) - Menu A : Gerada e compilada com sucesso.    ------------------------------------------------- Diretório separado do nome o arquivo: adis, ADISD1 (/home/interx/adis/src/ADISD1.SRC) Gerando rotina em linguagem C: (yla5 adis ADISD1 -if) .ATENCAO: Definicao nao localizada  Compilando o programa: (ycomp adis ADISD1 -exe adis/exe/ADISD1.temp.exe ) adis/exe/ADISD1.temp.exe => adis/exe/ADISD1  [  OK   ] ADISD1 (adis) - Menu : Gerada e compilada com sucesso.   I cannot get the whole block, just the line containing "INFO", like a ordinary grep, either setting or not ORS:  $ cat file  | awk 'BEGIN{RS="\n------------"}/INFO/{print}'  .INFO =&gt;Rotina BLOQUEADA (status 'M'): Geracao ignorada (use -is para ignorar checagem do status)   NOTES: It is the awk from AIX 7.1, not gawk. Aut $\mathbb Z_p\simeq \mathbb Z_{p-1}$ Assume that $M$ and $N$ are two finitely generated $R$-modules. Then $\operatorname{Hom}_{R}(M,N)$ is a finitely generated $\mathbb Z$-module and/or $R$-module (in this case, assume that $R$ is commutative)?   Note that $R$ is not Noetherian ring. Is there any counterexample (for any cases)? Setting print layout to portrait using QGIS 3?