production = {         'item1': '500',         'item2': '10000',     }   I'm trying to get the highest value from that dict, which would be 10000. However, I'm getting 500 as return of max(production.values()).  I believe it's like that because it's getting the highest value from string, not int (taking the lexicographical order of their codepoints).  Could someone help me with a solution. Thanks!
I have a dictionary: keys are strings, values are integers.  Example:   stats = {'a':1000, 'b':3000, 'c': 100}   I'd like to get 'b' as an answer, since it's the key with a higher value.  I did the following, using an intermediate list with reversed key-value tuples:  inverse = [(value, key) for key, value in stats.items()] print max(inverse)[1]   Is that one the better (or even more elegant) approach?
Very similar to , except for Java.  What is the recommended way of encoding strings for an XML output in Java. The strings might contain characters like "&amp;", "&lt;", etc. What are good basic statistics to use for ordinal data? How does the Commander interact with Banishing Light or Oblivion Ring? What happens if a commander is sent to the command zone via  and then enchantment is destroyed? Can the commander return to the battlefield from the command zone?.  I think that  would not allow that to happen. UBUNTU 14.04 cheese booth not detect webcam Cheese Booth shows an error:     There was an error playing video from the webcam     I test if webcam works fine or not by opening google hangout, its works fine.    Please tell, what is the issue in cheese booth.  Note: Sometimes the cheese booth works fine but most of time not Preserving signatures of decorated functions How can I make an overset symbol at the same size and height as \bar except with a different symbol? Apologies for the cryptic title, but I was not sure how best to phrase the question in one sentence. I am essentially trying the create a vector symbol with \rightharpoonup as the top instead of the arrow.  The output to the following code will feature an overset harpoon over x, next to a simple \bar{x}. Observe that on the left, the top symbol is significantly higher and bigger than on the right one.  \documentclass{article}  \usepackage{amsmath,amsfonts,amsthm,amssymb}  \newcommand{\vect}[1]{\overset{\rightharpoonup}{#1}}  \begin{document} $$ \vect{x} \quad \bar{x} $$ \end{document}   I would like to create something that looks in every way like the right hand symbol, except using something that looks like \rightharpoonup at the top.  If this command sequence already exists in LaTeX, please use that as an answer, because I have searched for and failed to find it so far. Why is it impossible to override a getter-only property and add a setter? Why is the following C# code not allowed:  public abstract class BaseClass {     public abstract int Bar { get;} }  public class ConcreteClass : BaseClass {     public override int Bar     {         get { return 0; }         set {}     } }      CS0546 'ConcreteClass.Bar.set': cannot override because 'BaseClass.Bar' does not have an overridable set accessor Is the neutral wire considered safe? If the neutral wire carries current, why do many people believe that it's safe? I've heard "You can touch the neutral wire/bar in the breaker box and not get shocked. Only the hot can hurt you." If the circuit is complete and current is flowing, can't you receive a shock? Can we have a moderator only "flag for community team/developer attention" link on posts? How to combine bold and "code sample" in Markdown? Calculating polygon area within polygons in QGIS? I am new to QGIS - I want to estimate the area of the reef under a polygon grid. My shapefiles are already in meters, however I am having a hard time calculating the area under the grid layer. Attached are the photos. I want to calculate the total area of the bold black polygons (reefs) under each grid square (image 2). How much reef is inside each square, for example, grid1: 25 sq.km, grid 1 sq.km, etc. Each reef polygon has its corresponding area in the layer attribute table.    ADDITIONAL PHOTO: RED IS THE REEF  THE ATTRIBUTES OF THE REEF LAYER Because of a former error in our ASP.Net application, created by my predecessor and undiscovered for a long time, thousands of wrong URLs where created dynamically. The normal user did not notice it, but Google followed these links and crawled itself through these incorrect URLs, creating more and more wrong links.  To make it clearer, consider the url     example.com/folder   should create the link     example.com/folder/subfolder   but was creating     example.com/subfolder   instead. Because of bad url rewriting, this was accepted and by default showed the index page for any unknown url, creating more and more links like this.     example.com/subfolder/subfolder/....   The problem is resolved by now, but now I have thousands of 404 errors listed in the Google Webmaster Tools, which got discovered 1 or 2 years ago, and more keep coming up.  Unfortunately the links do not follow a common pattern that I could deny for crawling in the robots.txt.  Is there anything I can do to stop google from trying out those very old links and remove the already listed 404s from Webmaster Tools? Let $x$ be a real number such that $x &gt; 0$. Prove that x +$\frac {1} {4x}  ≥ 1$.   Not really sure on the correct way to approach it/is valid and could use some help.  Answer:  Proof Strategy: Proof by cases:   $x = 1$ $x &gt; 1$ $x &lt; 1$   --  Case 1: $x = 1$  $x+\frac1{4x}$  $= (1) + 1/(4(1))$  $= 1.25 \ge 1$  Case is true  Case 2: $x &gt; 1$, in this case $x = 2$.  $x+\frac1{4x} $  $= (2) + 1/(4(2))$  $= 2.125 \ge 1$  Case is true  Case 3: $x &lt; 1$, in this case $x = 0.5$.  $= (0.5) + 1/(4(0.5))$  $= 1  \ge 1$  Case is true  Since all possible cases were satisfied therefore $x+\frac1{4x} \ge 1 $ when $x &gt; 0$. Changing underline color of LanguageTool in TeXstudio I've recently installed LanguageTool to check grammar and spelling mistakes in TeXstudio. However, I often miss the errors because the gray-bluish underlining makes them hard to spot. Is there a way to change the underlining to a distinctive color, such as red for example?   I checked . It says I have to do some changes to the .languagetool.cfg file, but for some reason this file doesn't appear in File Explorer. $n$ choose $k$ where $n$ is less than $k$ I am working on parameter estimation and one of the estimators involves a summation of $_nC_k$ ($n$ choose $k$) expressions. For some iterations, I need to compute expressions like $_0C_1$, $_0C_2$, etc.  In general how do we compute $_nC_k$ when $n$ is less than $k$? Do we still use the formula $\frac{n!}{(n-k)!k!}$ and use the gamma function to compute the negative factorial?  Thanks! Why doesn't grep using pipe work here? I have the following command:  find / -name libGL.so.1   Which returns lots of lines with "Permission denied". I want to exclude such lines, so I added the following:  find / -name libGL.so.1 | grep -v 'denied'   But the output is the same - my grep -v 'denied' is not filtering out the lines with Permission denied. I've tried many variations, looked over grep tutorials, but I cannot figure out the problem. Any suggestions? Optimization when Cost Function Slow to Evaluate As a mod when should I vote to close content that is not flagged? I know mods are supposed to step in to quickly close seriously problematic posts and otherwise allow the community to vote to close a post.  But what about when there are four close votes on a question, and I personally feel the question should be closed but isn't worthy of mod super-mega closing? Should I cast the final vote like a normal user (even though it's technically binding) or should I sit back and wait  for the community?  For me the problem is complicated because on UX.SE we hover close to the point where there's not enough high-rep activity to quickly close posts and I was one of those high rep users that used to VtC.  Should I always treat my mod close vote as binding and reserve it for extreme situations, or should I treat my close vote as "normal" when it's the fifth and final vote anyway? PC started having screen glitches after update I'm not sure what's caused it. I haven't changed any system settings. The only thing I've done that may have broken something is updating my software. My update was: upgrade linux-generic-hwe-20.04:amd64 5.8.0.48.54~20.04.32 5.8.0.49.55~20.04.33 upgrade linux-image-generic-hwe-20.04:amd64 5.8.0.48.54~20.04.32  upgrade linux-headers-generic-hwe-20.04:amd64 5.8.0.48.54~20.04.32  upgrade linux-image-extra-virtual:amd64 5.4.0.70.73 5.4.0.71.74 upgrade linux-image-generic:amd64 5.4.0.70.73 5.4.0.71.74 upgrade linux-libc-dev:amd64 5.4.0-70.78 5.4.0-71.79 upgrade libseccomp2:amd64 2.4.3-1ubuntu3.20.04.3 2.5.1-1ubuntu1~20.04.1 upgrade nomachine:amd64 7.3.2-3 7.4.1-3```  Removing nomachine did not solve the problem. It was far worse before, I'm not sure how to describe exactly, but my entire screen's UI was glitching out. So I rebooted and that stopped, but now the terminal text looks like this:  I haven't changed any terminal settings. This seems to be occurring in the entire OS. Here is another example:  Not sure how to go about troubleshooting this? I don't have the time to reinstall the OS, nor do I think I should have to because this is just ridiculous and shouldn't happen. I'm not aware of anything I've done to make the system unstable. Edit Earlier I also tried booting the PC. It failed and got stuck on some command in a terminal (didn't manage to take a photo of what it said). So I rebooted into recovery mode with both available kernels. I was getting strange glitches like this:  That didn't work. So I rebooted the PC normally, and now I somehow logged in fine. Now I'm getting popups saying to report a system error. It says this:  Environment  Ubuntu 20.04.2 LTS GNOME 3.36.8  sudo lshw -class display   *-display        description: VGA compatible controller        product: Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller        vendor: Intel Corporation        physical id: 2        bus info: pci@0000:00:02.0        version: 06        width: 64 bits        clock: 33MHz        capabilities: msi pm vga_controller bus_master cap_list rom        configuration: driver=i915 latency=0        resources: irq:33 memory:f7800000-f7bfffff memory:e0000000-efffffff ioport:f000(size=64) memory:c0000-dffff  I also did , which passed with 0 errors. Let me know if more details are required. If RSA is limited to 117-200 bytes or so, is that a very limited use case? Am I missing something, or is RSA very very limiting when it comes to ecrypting data when it comes to the actual message size?  I have read that you can only encrypt a message of around 117 to 200 bytes in size (depending on your key size: 1024 or 2048 bits). Is this correct?  If so, I think I have read people suggesting on using it for larger files. I guess they are just repeating the process many times over and over in blocks of 117 bytes?