How can I detect a client-side capsLock keypress...I have tried creating the following function that I wanted to launch when a key is pressed   &lt;script type="text/javascript" language="javascript"&gt; function changeCapsLock(e) {    if (typeof capsLockON != 'undefined' &amp;&amp; e.keyCode == 20) {       capsLockON = !capsLockON;       displayMsg();          }       }   //Display the message if CapsLocks is ON, otherwise conceal the message     function displayMsg() {           if (capsLockON)                 document.getElementById('divCapsWarning').style.visibility = 'visible';         else       document.getElementById('divCapsWarning').style.visibility = 'hidden';    } }   &lt;/script&gt; &lt;/head&gt;  &lt;body onkeydown="changeCapsLock(event)"&gt;    but the onkeydown event does not fire when the CapsLock is pressed?
How do you tell if caps lock is on using JavaScript?  One caveat though: I did google it and the best solution I could find was to attach an onkeypress event to every input, then check each time if the letter pressed was uppercase, and if it was, then check if shift was also held down. If it wasn't, therefore caps lock must be on. This feels really dirty and just... wasteful - surely there's a better way than this?
Solving multiple congruences by CRT = Chinese Remainder Theorem How to get the Input and output in a terminal to a text file? I want to create a text file which will add each command I am going to run on the terminal as a new line entry in the text file. i.e., I need to keep a record of what are the things I'm doing in the terminal. Further if I can keep a record of outputs I'm getting in the terminal, along with the inputs in the terminal, as a text file, it will be much better.   Each time I forget a command I have to search again in the Internet for the command.  Can I can make a file like above? How do I get breading to stick to pre-cooked chicken for pan frying? I've just read a proof of the statement:  Let $R$ be a commutative ring. If $R[X]$ is a principal ideal domain, then $R$ is a field.  In one part of the proof there is a step which I don't understand. I'll copy the proof: Let $u\in R$ be non-zero. Then using the principal ideal property, for some $f\in R[X]$ we have $\langle u,X\rangle = \langle f \rangle \subseteq R[X]$. Therefore, for some $p,q∈R[X], u=fp$ and $X=fq$. By properties of degree we conclude that $f=a$ and $q=b+cX$ for some $a,b,c\in R$. Substituting into the equation $X=fq$ we obtain $X=ab+acX$ which implies that $ac=1$, i.e. $a\in R^\times$, the group of units of $R$. Therefore, $\langle f\rangle =\langle 1\rangle=R[X]$. Therefore, there exist $r,s\in R[X]$ such that $ru+sX=1$ and if $d$ is the constant term of $r$, then we have $ud=1$. Therefore $u\in R^\times$. Our choice of $u$ was arbitrary, so this shows that $R^{\times}⊇R \setminus \{0\}$, which says precisely that $R$ is a field. I don't understand this: &quot;$X=ab+acX$ which implies that $ac=1$, i.e. $a\in R^\times$, the group of units of $R$. Therefore, $\langle f\rangle = \langle 1\rangle =R[X]$.&quot; Why does the fact that $a=f$ is a unit implies that $\langle f\rangle = \langle 1\rangle$? I would appreciate if someone could explain this to me. Thanks in advance. After my lie down, I posted  on SO. As I suspected would happen, it got moved to programmers. Unfortunately, the kind of people I'm interested in getting answers from (litb,skeet et al - the top SO programmers in their respective disciplines) don't frequent Programmers much. So my question is, where to ask somewhat non-specific questions of high-powered users? Suppose we have a set $S$ of real numbers. Show that   $$\sum_{s\in S}|s-x| $$   is minimal if $x$ is equal to the median.    This is a sample exam question of one of the exams that I need to take and I don't know how to proceed. Calculate Azimuth from polygon in GeoPandas Is there a simple way / ready-to-go function to calculate the azimuth of 2D-polygons in a GeoPandas DataFrame? My goal is to eventually compute azimuth angles of building footprints. Most of the functions I have found explicitly calculate the azimuth for a line, which is not what I am looking for. I have been thinking along the following lines to calculate the azimuth of a polygon using its normal vector (2 dimensions). Is my approach going into the right directions? I am a bit unsure how to adjust for the quadrants, also my results seem a bit odd. azimuth = 90 - math.degrees(math.atan2(normal[1], normal[0])) if azimuth &gt;= 360.0:     azimuth -= 360.0 elif azimuth &lt; 0.0:     azimuth += 360.0 I have a Student object and have a pick list field  "Student Status" in this object. Status can be Full-Time OR Part Time. Now my requirement is i want this student status list, Part-Time or Full-Time in apex controller. how can i do this?  If i get a student record it will only give me that particular student status Full-Time or Part-Time. But i need all options that are available in student status field.  Please help me Using same modulus for RSA I know that there exist some attack when using same modulus.      But with a little modification, $m$ is the plain-text $N$ is the RSA modulus $r_1, r_2$ is the random padding $e, s$ is the public exponent $C_e, C_s$ is the cipher-text  encrypt as follow $$С_e = (m + r_1)^e   \bmod N$$ $$С_s = (m + r_2)^s   \bmod N$$  If attacker only knows $C_e, C_s, r_1, r_2, e, s, N$. Is it possible to know $m$?  It seems the  does not work? Ubuntu 20.04 no sound out of Bluetooth headphones I'm doing some architectural cleanup that involves moving a bunch of classes into different projects and/or namespaces. Currently I'm moving the files by hand, building, and then manually adding using Foo statements as needed to resolve compilation errors. Anyone know of a smarter way of doing this? (We're a CodeRush and Refactor! shop, but I'd be interested to hear if Resharper has support for this) I have been asked by a client to implement some views for reporting purposes, the views will be accessed via PowerBI, Excel and SSRS. The designated user will only have access to the view and no underlying tables must be available to the user.  The problem I have encountered in that the SQL within the view touches 3 different schemas (All within the same database):   Pupil Provider  Security   The view is:  CREATE VIEW dbo.vTestPermissions AS SELECT a.Column1,        b.Column1,        c.Column1 FROM Pupil.Table1 a JOIN Provider.Table2 b ON a.Column1 = b.Column1 JOIN Security.Table3 c ON a.Column1 = c.Column1   The owners of the Tables/View are as follows:   Pupil.Table1 - Owner Pupil Provider.Table2 - Owner Provider Security.Table3 - Owner Security vTestPermissions - Owner dbo   When I select from the view I get an error:     The SELECT permission was denied on the object 'table3', database   'TEST', schema 'Security'   I have tried giving SELECT permission with and without the GRANT option to the schema, and the tables, but that makes the underlying tables available to the user.  Any help on this will be greatly appreciated. How to prove $a^2 + b^2 + c^2 \ge ab + bc + ca$? How can the following inequation be proven?  $$a^2 + b^2 + c^2 \ge ab + bc + ca$$ What are the valid characters for macro names? Per User Named Credential and External Identity Users My question is almost similar to one mentioned in 'Auth Provider with per-user Named Credential' (). I am trying to authenticate and make a API call when a new or existing Salesforce community users try to log in. The Authentication is provided by 3rd party (Cognito). So, the requirement is :  User to be authenticated using the 3rd party system for login. After successful authentication and before community page is displayed, the API call is to be made to 3rd party system to get more details about the user.  In order to achieve this:  Created an Open ID Connect Auth. Provider Use the registration handler on the Auth. Provider to create/link a new/existing user. Use a login flow for API call. Use Per User Identity Type Named Credential to make API calls.  No, where I am having issue is once the user has authenticated successfully, how do I allow the user to make API call without authenticating it again. I am getting the error: An Apex error occurred: System.UnexpectedException: You don't have permission to view this data, enter credentials for the named credential in your personal settings. Or ask your Salesforce admin for help. I believe this error is due to the fact that the user is not listed under 'Authentication setting for External Systems'. My requirement doesn't allow me to authenticate the user again, so how do I achieve this using either APEX or any other way? Are there any reputable studies on spanking? triggered my curiosity for this question. Why most of manga are black and white? Is this because of more cost if they add colors to it? How do I update my TeX distribution? I'm trying to compile a document that only works with an up-to-date distribution, so I'd like to know: how do I update my distribution? Please provide screenshots where appropriate.  List of answers           To keep an eye on what’s going on at CTAN you may subscribe to the  or the RSS feed feed://www.mail-archive.com/ctan-ann@dante.de/maillist.xml fontawesome and pdflatex When using pdflatex and the fontawesome package the below error shows up.   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! Fatal fontspec error: "cannot-use-pdftex" !  ! The fontspec package requires either XeTeX or LuaTeX to function. !  ! You must change your typesetting engine to, e.g., "xelatex" or "lualatex" ! instead of plain "latex" or "pdflatex". !  ! See the fontspec documentation for further information. !  ! For immediate help type H &lt;return&gt;. !...............................................     Wish to keep on using "pdflatex" instead of "xelatex" or "lualatex".   In fontawesome Version 4.4.0 manual it says "When using the (pdf)(LA)TEX engine, the fontawesome package doesn’t require any external package".  Tried solutions proposed for this question () without success.   MWE:  \documentclass{article} \usepackage{fontawesome} \begin{document} {\faAdjust} \end{document} Is there a LaTeX trick to prevent a PDF viewer from copying the line number? A PDF output is obtained by compiling the following code. \documentclass{article} \usepackage{xcolor} \usepackage{listings}  \lstset {     language={[LaTeX]TeX},         numbers=left,         numbersep=1em,         numberstyle=\tiny,     frame=single,     framesep=\fboxsep,     framerule=\fboxrule,     rulecolor=\color{red},     xleftmargin=\dimexpr\fboxsep+\fboxrule\relax,     xrightmargin=\dimexpr\fboxsep+\fboxrule\relax,     breaklines=true,     basicstyle=\small\tt,     keywordstyle=\color{blue},     commentstyle=\color[rgb]{0.13,0.54,0.13},     backgroundcolor=\color{yellow!10},     tabsize=2,     columns=flexible,     morekeywords={maketitle}, }  \begin{document}  \begin{lstlisting} \documentclass{article} \usepackage{listings} \title{Sample Document} \author{John Smith} \date{\today} \begin{document} \maketitle Hello World! % This is a comment. \end{document} \end{lstlisting}  \end{document}  I attempted to copy the code only inside Acrobat Reader. Unfortunately, the line numbers also got copied as shown on the following screen shot.  The line numbers are useful, but readers want not to copy them. Is there a LaTeX trick to prevent a PDF viewer from copying the line number?