I'm basically running a IF statement that in the condition checks if the array number[i] is equal to 18 and if so the color should be read but have had no luck with using html or setColor.  if (number[i].equals("18"))             {                 number[i] =              }   What would I assign number[i] to be if the integer is 18?  Trials such as :  number[i].setColor(Color.red); number[i] = number[i].setColor(Color.red) number [i] = "&lt;html&gt; &lt;font color=red&gt; 18&lt;/font&gt;&lt;/html&gt;";   Have all not worked  Should also point out 18 is stored as a string.
I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?
Knowing which java.exe process to kill on a windows machine When a java based application starts to misbehave on a windows machine, you want to be able to kill the process in the task manager if you can't quit the application normally. Most of the time, there's more than one java based application running on my machine. Is there a better way than just randomly killing java.exe processes in hope that you'll hit the correct application eventually?  EDIT: Thank you to all the people who pointed me to Sysinternal's Process Explorer - Exactly what I'm looking for! Is there a location where I can drop in a custom JavaScript file in Drupal 7.x?  It just includes simple event actions for menus, and I don't want to edit the theme/module files.  Or do I have to just add the "include" hook to the theme/module? Can I run a natural gas dryer from a portable propane tank? How to make applications open on the correct monitor when using multiple monitors? I'm using Windows 8.1, which has much better multiple monitor support than Windows 7 (sort of). However when I'm in a full-screen app on one monitor, and I go to the Start menu on the other and open a desktop app, it opens on the opposite monitor because of it being on that one last time the app was used.  This suspends the full-screen app and switches to the desktop view on that monitor. I then have to drag the desktop app to the other monitor which I didn't have my mouse pointer near in the first place, then switch back to the full-screen app on that monitor by going to the upper-right corner.  This is so incredibly irritating, every time I plug in my laptop to my second monitor and try to use it, this happens. Not to mention whenever I have Netflix or any kind of video in the second monitor and it just randomly stops playing when I'm trying to work on the other screen.  Most likely there is going to have to be a third-party application to install to do this, right? I would really prefer if it was free, as this was less annoying in Windows 7 when the application would only open on top of the other that was on that monitor. This is one of the maybe two annoying things I don't like about Windows 8/8.1. Everything else is fantastic, to be honest. Intuition behind why order of a subgroup divides order of a group. I want to digitize my old family albums using a scanner and there are lots of photos in them. Thus far, my method has been to scan 4 images at a time and then manually cropping them in a simple editor like Picasa or Windows Live Photo Gallery. This has been pretty time consuming as each scan is followed by 4 crop operations. Scanning each image individually would possibly be even more time consuming.  Is there any software or simple plugin (preferably free) that does this job? The best solution I have found is in , but that's an overkill. Is there a similar feature for one of the free photo editors like Paint.NET or GIMP? Creating 3D model in QGIS? Can I create a 3D model in QGIS or is there some model for 3D city models? Calculate battery life I would like to know how to calculate battery life when using an LED strip. The LED strip is powered by 8 AA batteries in series. LED Current Draw = 260 mA. LED power consumption: 3.1 W. LED Operating Voltage range: 9-14.8 VDC. Please see attached images for battery datasheet.  This is my calculation, but I'm not sure if it's correct:     Battery Life = (Battery Capacity)/(Load Current) = 2000 mAh /260 mA = 7.7 Hours   This is for one battery, and the lights are powered by 8 batteries, so is the total battery life = (7.7)x(8) = 61.6 hours ? Find count of all combination of numbers whose sum is x Padding trailing whitespaces in a string with another character I'd like to output hello world over 20 characters.  printf "%-20s :\n\n" 'hello world!!'  # Actual output hello world!!        :  # Wanted output hello world!!========:   However, I don't want to complete with spaces but with "=" instead. How do I do that? How do you sort du output by size? How do you sort du -sh /dir/* by size? I read one site that said use | sort -n but that's obviously not right. Here's an example that is wrong.  [~]# du -sh /var/* | sort -n 0       /var/mail 1.2M    /var/www 1.8M    /var/tmp 1.9G    /var/named 2.9M    /var/run 4.1G    /var/log 8.0K    /var/account 8.0K    /var/crash 8.0K    /var/cvs 8.0K    /var/games 8.0K    /var/local 8.0K    /var/nis 8.0K    /var/opt 8.0K    /var/preserve 8.0K    /var/racoon 12K     /var/aquota.user 12K     /var/portsentry 16K     /var/ftp 16K     /var/quota.user 20K     /var/yp 24K     /var/db 28K     /var/empty 32K     /var/lock 84K     /var/profiles 224M    /var/netenberg 235M    /var/cpanel 245M    /var/cache 620M    /var/lib 748K    /var/spool Suppose I attach an blur function to an HTML input box like this:  &lt;input id="myInput" onblur="function() { ... }"&gt;&lt;/input&gt;   Is there a way to get the ID of the element which caused the blur event to fire (the element which was clicked) inside the function? How?  For example, suppose I have a span like this:  &lt;span id="mySpan"&gt;Hello World&lt;/span&gt;   If I click the span right after the input element has focus, the input element will lose its focus. How does the function know that it was mySpan that was clicked?  PS: If the onclick event of the span would occur before the onblur event of the input element my problem would be solved, because I could set some status value indicating a specific element had been clicked.  PPS: The background of this problem is that I want to trigger an AJAX autocompleter control externally (from a clickable element) to show its suggestions, without the suggestions disappearing immediately because of the blur event on the input element. So I want to check in the blur function if one specific element has been clicked, and if so, ignore the blur event. BibTeX bibliography not printing I was unable to find a previous post about this - perhaps too simple? I just came across the BibTeX and am trying to use it with an EndNote library. I have exported to the .bib file (which looks good as far as I can tell), but no bibliography is printed and the references aren't being cited. Obviously there is something major missing.  My document looks as follows.  \documentclass[11pt, fceqn]{article} \usepackage{epsfig} \usepackage{setspace, titlesec, caption, floatrow}    \usepackage{amsmath, amssymb, amsfonts, amsthm, cite, mathtools, lineno, subfig, natbib}  \begin{document}   Some text \cite{Alo_1}.  \bibliography{bib} \bibliographystyle{plain}  \end{document}   Any thoughts would be greatly appreciated. Today my lecturer put up on the board that:  If $\lim\limits_{n\to\infty}\frac{a_{n+1}}{a_n}$ exists and $a_n&gt;0$ then   $\displaystyle \limsup\limits_{n\to\infty}\left(a_n^{\frac{1}{n}}\right)=\lim_{n\to\infty}\frac{a_{n+1}}{a_n}$  however I am not sure why this is true, can somebody give me a hint or something as to how to go about proving this.  thanks for any help I have read lots of information about page caching and partial page caching in a MVC application. However, I would like to know how you would cache data.  In my scenario I will be using LINQ to Entities (entity framework). On the first call to GetNames (or whatever the method is) I want to grab the data from the database. I want to save the results in cache and on the second call to use the cached version if it exists.  Can anyone show an example of how this would work, where this should be implemented (model?) and if it would work.  I have seen this done in traditional ASP.NET apps , typically for very static data. Determine the probability densities for coefficients of equation Find an element by id and replace its contents with php Sum of two squares modulo p Flagging "look at my answer pls" comments I've started to flag a few of these once I had seen one too many of them, but I'm not sure whether I'm doing the right thing.  This is an example of what I'm talking about (this comment is on the question, but sometimes on their own answers too):    Are they something that should be considered acceptable, and if not, are they bad enough to be "flaggable"? What is so special about speed of light in vacuum? I will try to be as explanatory as possible with my question. Please also note that I have done my share of googling and I am looking for simple language preferable with some example so that I can get some insight in this subject.  My question is what is so special about $c$? Why only $c$. Its like chicken and egg puzzle for me. Does Einstein reached to $c$ observing light or does he got to light using some number which turned out equal to $c$.   Why is $c$ not relative. If something has zero rest mass like a photon why they only travel at $c$ in vacuum and not with $c+1$ or $c-1$?