I'm wondering what is the best practice of designing select / drop down lists. In some projects I've worked in the select on a form was filled with first value from the list. In other project we had always "-- select --" option chosen before user selected something else. I can imagine also empty field.  Is there any guideline about it? What is state of art in this matter?
Given that there is no logically default animal from the list of animals below, what should be the "Default Value" below, according to best practice?  &lt;label for="animal"&gt;Animal (required):&lt;/label&gt; &lt;select name="animal"&gt;   &lt;option value=""&gt;Default Value&lt;/option&gt;   &lt;option value="0"&gt;Cat&lt;/option&gt;   &lt;option value="1"&gt;Dog&lt;/option&gt;   &lt;option value="2"&gt;Horse&lt;/option&gt;   &lt;option value="3"&gt;Pig&lt;/option&gt;   &lt;option value="4"&gt;Sheep&lt;/option&gt; &lt;/select&gt;   A blank value, &lt;option value=""&gt;&lt;/option&gt;?  Something visually irritating, &lt;option value=""&gt;***CHOOSE ANIMAL***&lt;/option&gt;?  Something which blends in but provides instruction, &lt;option value=""&gt;Select an Animal&lt;/option&gt;?  Something else entirely?
Is it possible to modify the title of the message box the confirm() function opens in JavaScript?   I could create a modal popup box, but I would like to do this as minimalistic as possible. I would like to do something like this:  confirm("This is the content of the message box", "Modified title");   The default title in Internet Explorer is "Windows Internet Explorer" and in Firefox it's "[JavaScript-program]." Not very informative. Though I can understand from a browser security stand point that you shouldn't be able to do this. How can I create launcher icon for PhpStorm? My objects are semi-transparent, and not one behind the other in the compositor How to show TCP listenings and filter them by local IP on Windows? Server has numerous IP addresses, set up on it's network interface.  How to find, who is listening to specific IP port 80?  netstat shows very long list. Are there any builtin means?  UPDATE  Also can't use findstr with also wishing to know process name because brocess name is displayed on separate line. Find $\sum_{n=1}^{\infty}$ $\frac{n^{2}}{\left(n+1\right)\left(n+2\right)\left(n+3\right)\left(n+4\right)}$ $$\sum_{n=1}^{\infty}\frac{n^{2}}{\left(n+1\right)\left(n+2\right)\left(n+3\right)\left(n+4\right)}$$   MY Approach$\sum_{n=1}^{\infty}$$\frac{n^{2}}{\left(n+1\right)\left(n+2\right)\left(n+3\right)\left(n+4\right)}$ = Lim$_{k\rightarrow\infty}$$\sum_{k=1}^{n}\frac{k^{2}}{\left(k+1\right)\left(k+2\right)\left(k+3\right)\left(k+4\right)}$  $\frac{k^{2}}{\left(k+1\right)\left(k+2\right)\left(k+3\right)\left(k+4\right)}$= $\frac{1}{6\left(n+1\right)}$-$\frac{2}{\left(n+2\right)}$+$\frac{9}{\left(n+3\right)2}$-$\frac{8}{\left(n+4\right)3}$  I don't think i can telescope it, And i don't know any other method What is this lock screen with ads and how do I remove it? I think my device got a malware. A lock screen with ads sometimes appear, and I must swipe an area at the bottom of the screen to open the phone. I am in Eastern Europe, some ads are in Slavic languages, and they are seemingly related to travel.    Image resized. Click to view the full image  I have seen ads for Lot Air (Polish carrier). I recently went to their site.  Considering my recent surfing activity and the nature of the ads, I guess the malware is connected to airlines active in Eastern Europe.  The lock screen also promotes the app "DU Quick Charger" by claiming it has recharged the phone extra fast during screen off. (!?) It also shows battery level. I have never installed DU Quick Charger. I doubt DU Quick Charger is installed on the phone.  The problem started after installing Ryanair app. The problem is maybe, but not surely, related to this. Uninstalling Ryanair and restarting the phone doesn't remove the occasional appearance of this lock screen. After a while the situation has changed for the worse, now this lock screen appears after EVERY screen off.  I have always used Avast. I am not rooted and only install via Google Play.  What is this? And how do I remove it? Inequality from Challenge and Thrill of Pre-college Mathematics How do you test that a Python function throws an exception? How does one write a unittest that fails only if a function doesn't throw an expected exception? I have this struct:  struct Map {     public int Size;      public Map ( int size )     {         this.Size = size;     }      public override string ToString ( )     {         return String.Format ( "Size: {0}", this.Size );     } }   When using array, it works:  Map [ ] arr = new Map [ 4 ] {     new Map(10),     new Map(20),     new Map(30),     new Map(40)};  arr [ 2 ].Size = 0;   But when using List, it doesn't compile:  List&lt;Map&gt; list = new List&lt;Map&gt; ( ) {     new Map(10),     new Map(20),     new Map(30),     new Map(40)};  list [ 2 ].Size = 0;   Why? I would like to clarify something that I don't think is clear in   The first automatic delete rule kicks in at 9 days for closed questions:     If the question was closed more than 9 days ago, and ...         was not closed as a duplicate   has a score of 0 or less   has no answers with a score > 0   some other criteria that don't matter right now...      Then, at 30 days, there's:     If the question is more than 30 days old, and ...         has −1 or lower score   has no answers   is not locked      This rule applies to both open and closed questions, but it doesn't mention the same exemption for duplicates.  I'm pretty sure that I've seen old, downvoted duplicates disappear on ServerFault (and that fits what the rule says), but I'm also sure I've seen lots of comments along the lines of  "duplicates aren't deleted."  So what I'm after is a clear statement from a power-that-be or a clear reference that says "duplicate questions fall under the same 30-day automatic deletion rule as any other question."  (or that they don't)  (Note: I realize this doesn't apply the stub left behind when a question is merged into another.  Those "stubs" are locked and are never deleted.) Best practice for Rails App to run a long task in the background? I have a Rails application that unfortunately after a request to a controller, has to do some crunching that takes awhile.  What are the best practices in Rails for providing feedback or progress on a long running task or request?  These controller methods usually last 60+ seconds.    I'm not concerned with the client side... I was planning on having an Ajax request every second or so and displaying a progress indicator.  I'm just not sure on the Rails best practice, do I create an additional controller?  Is there something clever I can do?  I want answers to focus on the server side using Rails only.  Thanks in advance for your help.  Edit:  If it matters, the http request are for PDFs.  I then have Rails in conjunction with Ruport generate these PDFs.  The problem is, these PDFs are very large and contain a lot of data.  Does it still make sense to use a background task?  Let's assume an average PDF takes about one minute to two minutes, will this make my Rails application unresponsive to any other server request during this time?  Edit 2:  Ok, after further investigation, it seems my Rails application is indeed unresponsive to any other HTTP requests after a request comes in for a large PDF.  So, I guess the question now becomes: What is the best threading/background mechanism to use?  It must be stable and maintained.  I'm very surprised Rails doesn't have something like this built in.  Edit 3:  I have read this page: .  I would love to read about various experiences with these tools.  Edit 4:  I'm using Passenger Phusion "modrails", if it matters.  Edit 5:  I'm using Windows Vista 64 bit for my development machine; however, my production machine is Ubuntu 8.04 LTS.  Should I consider switching to Linux for my development machine?  Will the solutions presented work on both? This is a question that has received various answers. This questions seems simple, but it proves to be rather tricky.  So :  We flip a coin (H-T) independently $10$ times. Let's for the moment not care about whether it is fair or not.   How many $3$-head sequences are there?  Solution:  Some say that the answer is $\displaystyle\frac{10!}{7!3!}$, but this is the number of ways  by which $3$ heads can be arranged in $10$ positions. This answer , however, does not say anything about the remaining $7$ positions.   Each of these seven positions can be H or T. The total number of $7$-element sequences is $1\cdot1\cdot1\cdot2^7=2^7$. Then we have to multiply this by $\displaystyle\frac{10!}{7!3!}$ as the three heads can be anywhere. But I have found that this is not the correct answer. The correct is just $\displaystyle\frac{10!}{7!3!}$. So why not multiply by $2^7$? Comment deletion notification I think you should be notified if anything of yours is deleted or even flagged, preferably with some explanation (even if it's a simple categorisation like #rude, #irrelevant, #incorrect) and who did it.  Recently, a couple of comments of mine vanished without warning or evidence afterwards. I'm fine with deletion, but I think it should be used sparingly and be based on democratic decisions. What's the harm of letting a comment simply sit with no up-votes or responses rather than outright removal? Or allow downvoting and then negatively voted comments are hidden by default?  I get the impression that anything I post could be deleted. Very few people want to be unpopular or do the wrong thing. It takes time to understand what something is about and how best to use it (this site). Whether or not what I posted deserved to be deleted is irrelevant because I got no feedback. No-one can learn without feedback. The number of frivolous comments with many upvotes I've seen shows how inconsistently the rules are applied. A community that gives too much power to highly rated users won't grow but turn stagnant.  Sorry if this was rude, inappropriate or pathetic. I'm aware that similar discussions have occurred. In any case, I'll continue to use the site and move on... Why a subspace of a vector space is useful Is it possible to change the default width of an image included via \includegraphics (from the graphicx package) to a custom value, for example \linewidth.  So I want something like this:  \documentclass{article}  \usepackage[draft,width=\linewidth]{graphicx}  %or something like \setglobalimagewidth=\linewidth  \begin{document}  \includegraphics{test1} %width=\linewidth \includegraphics[width=4cm]{test1} %width=4cm   \end{document} Length of a JavaScript object I have a JavaScript object. Is there a built-in or accepted best practice way to get the length of this object? const myObject = new Object(); myObject[&quot;firstname&quot;] = &quot;Gareth&quot;; myObject[&quot;lastname&quot;] = &quot;Simpson&quot;; myObject[&quot;age&quot;] = 21; How do I synchronise two folders in real-time in Windows 7? I want to synchronise two folders in real time under Windows 7.  Basically, I want to monitor a folder and synchronise each change (new files, changed files, deleted files) to another drive. It has to be in real time, so it gets synchronised instantly when a change happens. A one-direction synchronisation is enough.  I tried Microsoft's , but it does only syncing by hand or scheduled (thus not satisfying the "real-time" requirement).  Can this be achieved with Windows 7 itself? If not, are there other methods of doing this? I'm using Ubuntu 12.04.3 with NVidia drivers (319) for my Quadro K2100M graphic card, and when I switch my main 3200x1800 laptop screen to mode 1920x1080 (using nvidia-settings), the display goes blurry...  I am using two screens:    My main screen is a LCD with max resolution 1920x1200. My laptop screen (original resolution 3200x1800) is sitting to the right of that.   The main problem is that, on Ubuntu, the font is far too small on my laptop screen. Because of that, I wanted to change the resolution of my laptop to 1920x1080.  Reading , I tried to  and here is the DPI configuration which I should have:   94x94 for my main LCD screen 1920x1200 235x236 for my 3200x1800 laptop screen   Is there a way to have dual DPI resolutions with an extended desktop? Doppler redshift of distant galaxies gave first hint that the universe is expanding. I am curious to know how this redshift is actually measured and interpreted from observation. Suppose I observe some  visible line say red with wavelength \lambda_1.  This is not enough to tell that this line is redshifted, i.e., the  original line emitted from that galaxy had a smaller wavelength. How do I know the value of that particular line when it was emitted from that galaxy? It appears that mere observation of a line is not enough. So how do we proceed? Show $\operatorname{Aut}(C_2 \times C_2)$ is isomorphic to $D_6$ (the group with $x^3=1$, $y^2=1$ and $xy=yx^2$).  I'm not really sure how to express the elements of $\operatorname{Aut}(C_2 \times C_2)$. Would it be sufficient to show the elements of $\operatorname{Aut}(C_2 \times C_2)$, find their order and show they bijectively map to every element of $D_6$ and satisfy $xy=yx^2$?