Ruby print function
Why am I getting objects printed twice?
Decode JWT Token in Apex I am trying decode JWT token in apex, and i am not sure how that can be done. If anyone has done that before, please let me know the process.  A JWT token is sent to SFDC and need to decode it in apex class.  Questions: 1) Can we decode the JWT using any standard salesforce classes, if yes what class and method? 2) Or do we need to decode it with our custom code -- if so can you provide an example. Proof of Neumann Lemma Prove that if $\|A\| &lt; 1$, then $I-A$ is invertible. Here, $\|\cdot\|$ is a matrix norm induced by a vector norm.  This lemma is referred to as Neumann Lemma.  Any ideas on how to go ahead with this?  Thanks. Irreducible polynomials and affine variety Let $k$ be any field, and let $f,g\in k[x,y]$ be two irreducible polynomials such that $g$ is not divisible by $f$. Prove that $V(f,g)\subseteq A_k^2$ is finite. So essentially does margin collapsing occur when you don't set any margin or padding or border to a given div element? Bash: command not found Should I upgrade to the "mainline" kernels? Newer "mainline" versions of the kernel are available from the , e.g. 3.4 and 3.5, while Ubuntu 12.04 is on 3.2.   What are the mainline kernels? Are they better than my existing kernel? What are the pros and cons of upgrading to a mainline kernel? Will I easily be able to go back? "Cannot find this file" error when deploying from Visual Studio 2010 I'm getting an error in Visual Studio 2010 after pressing F5 to Debug:     Error occurred in deployment step 'Add   Solution': Error: Cannot find this   file specified in the manifest file:   G2_SiteDefinition_List_Instances_Feature\ListInstance1\Elements.xml   But elements.xml file is there with the ListIntance1 folder. What am I missing here? Discrepancy with lsof command when trying to get the count of open files per process In English, the number 0 is treated as plural. It is then:   0 seconds 1 second    1.2 seconds   2 seconds     Shouldn't it be "nobody want to go there," instead of "nobody wants to go there"?  I also saw in TOEFL that "any __" should be used with a singular.  But I see it very common that it is a plural also.  Why is that?  (updated: example, "we don't have any apples any more" vs "If you get any apple, please let me know.") Is there some easy way to pad Strings in Java?  Seems like something that should be in some StringUtil-like API, but I can't find anything that does this. "I think him to be about 50" or "I think he is about 50"? I have two options. Which one is correct?      a) I think him to be about 50.   b) I think he is about 50.   If both are correct, should I avoid one or the other? To show that $2$ | $x^{2n} - x^n$, $n \in \mathbb{Z^+}$ is the following adequate? Show that $2$ | $x^{2n} - x^n$, $n \in \mathbb{Z^+}$   Let $x^n = a$ then $\frac{a}{2}$ $\implies a = 2q + r$ such that $r = 0 \vee r = 1$.   So $x^{2n} = (x^n)^2 = a^2 = (2q + r)^2$, which means that $2|[x^{2n} - x^n ]= 2| [(2q + r)^2 - (2q + r)]$. If $r = 1$ we get $(4q^2 + 4q + 1) - 2q - 1 = 4q^2 + 2q = 2(2q^2 +1)$. Thus $2$|$x^{2n} - x^n$, $n \in \mathbb{Z^+}$. Is this reasoning correct? Is it adequate? How to install latest HPLIP on my Ubuntu to support my HP printer and/or scanner? Let's assume that one has some modern HP printer and/or scanner which is not supported by HPLIP package from official repository. Currently Ubuntu versions have :  trusty (14.04LTS): 3.14.3-0ubuntu3.4 xenial (16.04LTS): 3.16.3+repack0-1 bionic (18.04LTS): 3.17.10+repack0-5 focal (20.04LTS): 3.20.3+dfsg0-2 groovy (20.10): 3.20.5+dfsg0-3build1 hirsute (21.04): 3.21.2+dfsg1-2   What can one do if printer is supported in newer version of HPLIP (checked this in )? I edit a lot of posts every day. I often run across posts with 'Hi' and 'Thanks' on the top and the bottom of the post respectively. I also run across things like:     --User   Should these items be removed during the editing of the post by an editor? How does a USB 2.0 Wall Charger negotiate current output? I'm trying to use a mobile phone charger for my projects, and want a high current output. I have read , however my measurements show something else.  is a link to the Battery Charging Specification Rev. 1.2.  1.4.7 Dedicated Charging Port A Dedicated Charging Port (DCP) is a downstream port on a device that outputs power through a USB connector, but is not capable of enumerating a downstream device. A DCP shall source \$I_{DCP}\$ at an average voltage of \$V_{CHG}\$. A DCP shall short the D+ line to the D- line.   I verified on three different chargers, and all read \$R_{DCP\_DAT}\$ as ~1.5 Ohms. Now, if there is a short between the D+ and D-, there is no detection on the charging port side, and the charger should always output \$I_{DCP}\$ {0.5 - 5.0A max} on the VBUS line - is this correct? I tested the current output of three chargers, but they are all completely different. Charger 1 - Nokia Rated current output: 1.3A Measured current output: 1.34A Charger 2 - Asus Rated current output: 2.0A Measured current output: 0.7A - 1.1A (unstable) Charger 3 - HTC Rated current output: 1A Measurent current output: 0.1A If all these dedicated charging ports have no current negotiation, how come only one charger is showing it's rated output? N.B All three chargers can charge a mobile phone in a reasonable amount of time. Convergence of $\int_0^\infty \sin(t)/t^\gamma \mathrm{d}t$ For what values of $\gamma\geq 0$ does the improper integral $$\int_0^\infty \frac{\sin(t)}{t^\gamma} \mathrm{d}t$$ converge?   In order to avoid two "critical points" $0$ and $+\infty$ I've thought that it would be easier to test the convergence of the sum (is this coherent?): $$ \int_0^1 \frac{\sin(t)}{t^\gamma}\mathrm{d}t + \int_1^\infty \frac{\sin(t)}{t^\gamma}\mathrm{d}t. $$ For the second integral, it converges if $\gamma &gt; 1$ (comparision) and also converges if $0 &lt;\gamma \leq 1$. I'm stuck on proving the last part and the fact that the first integral converges for $\gamma &lt; 2$. Any help would be appreciated. Thanks in advance.  PD: I've checked the answers for  but I would not like to solve this integral using $(n\pi,(n+1)\pi)$ intervals. I have seen many programs consisting of structures like the one below  typedef struct  {     int i;     char k; } elem;  elem user;   Why is it needed so often? Any specific reason or applicable area? I am trying to capitalize Western Canada or western Canada properly and am wanting a definition for when the "ern" is added as a suffix to a locational distinction of a proper noun.  I believe the capitalization is related to the suffix and am grouping two questions.  After researching on the internet I have found a trend that areas of discrete area become capitalized along with their proper noun   East New York West Hollywood East London (Britain) East Los Angeles   Some locations have "ern" added to their locational modifier.    Web Examples (from government sites):   eastern Canada ( Western Canada ()   All the examples listed contain discrete areas.  The "ern" suffix is used for larger areas, but I am unable to determine when an area becomes large enough. Bravo for allowing comment editing, but what's the explanation for enforcing a five-minute window?  I think this might be over-engineering. If I have a spelling mistake or an inaccuracy I'd like to fix, I don't think the fact that five minutes has elapsed should prevent me from fixing it.  Further, if you are worried people will edit their comments in a way that makes the comment thread nonsensical, they can already do this by deleting their comment. So, limiting the ability to edit isn't really helping much in that regard.  Update  If people don't like this idea, I'm definitely open to hearing your reasons. For now, it seems like an unnecessary limitation of a quite awesome feature.  Update 2  Regarding John's scenario...     Me: Obama is cool!   You: You are right, man!      My edit: Obama is an idiot!   You: You are right, man!   ...this problem can still occur with deletions...     user1: Obama is cool!   user2: No, McCain is cool!   you: You are right, man!        user1: Obama is cool!   ---- deleted -----   you: You are right, man!     So, yes, editing could be abused as you suggest, but discontinuities can occur already because of deletions (and as someone else mentioned, because upvoted comments get prioritized upward).  As for Jeff's argument about rate limiting, I agree that is important, but I don't understand why you can't just use a CAPTCHA to prevent too many edits in a short period of time. Consider:  List&lt;String&gt; someList = new ArrayList&lt;String&gt;(); // add "monkey", "donkey", "skeleton key" to someList     for (String item : someList) {     System.out.println(item); }   What would the equivalent for loop look like without using the for each syntax?