I've been trying to learn Java lately, making slow progress but I'm getting there. Anyways, I've been working my way through the book: 'Sams teach yourself Java in 24 hours' and quite early on it states:     Java is flexible about where the square brackets are placed when an array is being created. You can put them after the variable name instead of the variable type, as in the following: String niceChild[];      To make arrays easier for humans to spot in your programs, you should stick to one style rather than switching back and forth. Programs that use arrays in this book always place the brackets after the variable or object type.   I totally understand all of that, but then later on during one of the exercises it seems to go against what has just been said. As you can see below it has: String phrase[] = { but I can't help thinking it should be String[] phrase = { instead? I know that the program runs fine with either. I presume it's just a typo but I wanted to know from someone who understands it a bit better.          package com.java24hours;  class Wheel {     public static void main(String[] arguments) {         String phrase[] = {             "A STITCH IN TIME SAVES NINE",             "DON'T EAT YELLOW SNOW",             "JUST DO IT",             "EVERY GOOD BOY DOES FINE",             "I WANT MY MTV",             "I LIKE IKE",             "PLAY IT AGAIN, SAM",             "FROSTY THE SNOWMAN",             "ONE MORE FOR THE ROAD",             "HOME FIELD ADVANTAGE",             "VALENTINE'S DAY MASSACRE",             "GROVER CLEVELAND OHIO",             "SPAGHETTI WESTERN",             "AQUA TEEN HUNGER FORCE",             "IT'S A WONDERFUL LIFE"         };         int[] letterCount = new int[26];         for (int count = 0; count &lt; phrase.length; count++) {             String current = phrase[count];             char[] letters = current.toCharArray();             for (int count2 = 0;  count2 &lt; letters.length; count2++) {                 char lett = letters[count2];                 if ( (lett &gt;= 'A') &amp; (lett &lt;= 'Z') ) {                     letterCount[lett - 'A']++;                 }             }         }         for (char count = 'A'; count &lt;= 'Z'; count++) {             System.out.print(count + ": " +                 letterCount[count - 'A'] +                 " ");             if (count == 'M') {                 System.out.println();             }         }         System.out.println();     } }
I have recently been thinking about the difference between the two ways of defining an array:   int[] array int array[]   Is there a difference?
How has the age of the Universe been derived from the observations made by the Planck mission? People like myself are Stack Exchange trusted users with thousands of reputation points and hundreds of badges.  In other words, we've proven ourselves as people who are assets to Stack Exchange and are a key component in making it so profitable.  As such, I was surprised when I posted  on the  site, and then shortly afterwards tried to  on that same meta site, but was blocked with a message in red stating I had to wait 40 minutes before posting again.  Why is this limit present for trusted Stack Exchange contributors, and can it be changed? My computer boots to a black screen, what options do I have to fix it? Plot an elliptic curve in Latex Add table row in jQuery How to show that $C=C[0,1]$ is a Banach space Let $C=C[0,1]$ be the space of all continuous functions on $[0,1]$. Define $\|f \|=\max \ |f(x)|$. I want to show that $C$ is a Banach space.     Below is my attempt and I was wondering if it's ok.    I know I have to show that $C$ is a complete normed space. Clearly, $\|f\| \geqslant 0$ and $\|f\|=0 \Leftrightarrow f=0$. $\|cf \|=\max~|cf(x)|=|c|\max |f(x)|=|c| \cdot \|f\|$. $\|f+g\|=\max~|f(x)+g(x)|\leq \max~|f(x)|+\max~|g(x)|=\|f\|+ \|g\|$. So $C$ is a normed space.   Next, I show that every Cauchy sequence in $C$ is convergent. Let $\{f_n\}$ be a Cauchy sequence in $C$. Let $\varepsilon \gt 0.$ Then $\exists$ an $N_1$ such that $$ \max~|f_n(x)-f_m(x)| \lt \frac{\varepsilon}{2}$$ for $n, m \gt N_1$ and $x\in[0,1]$.  But there is a subsequence $f_{k_n} $, which converges to $f$. So $\exists$ an $N_2$ such that $$ \max~\left|f_{k_n} - f\right|\lt \frac{\varepsilon}{2}$$ for each $n\gt N_2$.  Now Let $N = \max\{N_1, N_2\}$, if $n \gt N$ then $k_n \geqslant n\gt N$. So we have $$ \max~\left|f_n(x) - f(x)\right| \leqslant \max~\left|f_n - f_{k_n}\right| + \max~\left| f_{k_n} - f\right| \lt\frac{\varepsilon}{2} + \frac{\varepsilon}{2} = \varepsilon.$$  Thus, $\|f_n-f\| \to 0$ as $n\to \infty$. $\quad \square$  Thanks. When does the amount of skew or prevalence of outliers make the median preferable to the mean? I know that "deviations in the data are devil", and when the distribution is highly skewed, it is better to consider median as average rather than mean, but how to decide these hard-limits.  For example:   CASE 1:   Assume X = 10,20,30,40,50,60,70 In this case, I think that it is better to use mean and that it will give very accurate results.  CASE 2:   Assume X = 10,20,30,40,50,60,70,7000 In this case, I think that it is better to use median instead of using the mean.  CASE 3:    Assume X = 10,20,30,400,500,600,700 In this case, I think it is better to use IQR (Inter Quartile Range)    But I'm stuck with how to decide these hard-limits i.e. which to use in which condition, in general.   I've found a tool working on subjected principle, which takes context-less sample-distribution as input and determines whether mean is close/moderate or against the null-hypothesis.  Find References:-     (For Mean Test)  (For Median Test)   What I'm really looking is a good answer which states how to derive these conclusions. How do I get the member to which my custom attribute was applied? Can I install the free Windows 7/8 -> 10 upgrade on a new empty drive? With the new Windows 10 coming out soon as a free upgrade, I'd like to know if and how I can install the upgrade on a new HDD. I assume the files needed for Windows 10 are only for upgrading an installed copy of Windows 7 or 8 and not a standalone installer to use on an empty hard drive. Or is this assumption wrong?  I have some issues booting (an older non-working version appears in the list of OS's to choose from) and I'd like to replace my current SSD, which is too small, with a new larger capacity one, while keeping my other drives intact. The old SSD will then be removed.  If more information is needed, please let me know. Xcode free space requirement I am trying to update Xcode to 8.0. My OS is 10.11.6 El Capitan. However I am getting:     We could not complete your update   There is not enough disk space available to install the product.   I have got 14.22 GB free space. How much do I need?  UPDATE: I do not know the exact figure, though I did manage to update with 17.21 GB free space later on. how to add a custom lock for the recovery and/or bootloader? Unlocking the bootloader and/or the recovery is very popular discussion across many devices. But doing so exposes a very obvious and inevitable issue with security!  An unlocked recovery means that no matter how secure you make your android lock screen, someone can easily reset phone to restore the phone to a fully functional (and lockless/insecure) state and the worst part, they don't have to erase your data(meaning they can access all your personal files and folders)!  It is almost hilarious! In fact if the phone supports insertion of external SD cards, you can even flash your own software into the phone and maybe bypass the lock screen without wiping any data.  For example: One possible loophole is using the 'Tasker' app which has a feature that can temporarily disable the keyguard. And the best part is that Tasker can be flashed using the recovery!  So is there any method by which I could add a security measure that prevents complete access to my recovery and/or boot loader that will make my phone less insecure?!  Expected answer: Method by which a custom pin/password must be entered before entering the bootloader/recovery. So that my bootloader/recovery is still technically unlocked but simply requires authentication to use (this also ensures that conventional unlocking methods won't work as the phone is not really locked!). This also means that one does not have to lose root access to ensure security! What files should i put in a logo pack to give to clients? Should I put small, medium and large version of my logo as well as the vector file. Can it happen that the image of a functor is not a category? On Hilton and Stammbach's homological algebra book, end of chap. 2, they wrote in general $F(\mathfrak{C})$ is not a category at all in general. But I don't quite get it. I checked the axioms of a category for the image, and I think they are all satisfied. Am I missing something? Thanks. An inequality involving 4 real or complex numbers Let a,b,c,d be real or complex numbers with absolute value less than $1$. Is the following true:  $$|ab-cd| \leq |a-c| +|b-d|?$$ Uneven movement on camera following a path. I render a short movie. I set the camera to the circle curve to make it fly in circle. The problem is after render, the camera is a little shaky. Can anyone help me? Thanks first. Frobenius element in cyclotomic extension Let $K=\mathbb{Q}(\zeta_m)$. Then if $p\nmid m$ is any odd prime, how i can show that Frobenius map is $(p,K/\mathbb{Q})(\zeta_m)=\zeta_m^p$.  We know, if $P$ is a prime above $p$   $$(p,K/\mathbb{Q})(x) \equiv x^p (\mbox{mod } P) \quad\forall x \in \mathbb{Z}_K$$  Thanks! Chrome asks for password to unlock keyring on startup In Google Chrome, when I go to a login page, a window pops up asking to "Enter password for keyring 'default' to unlock". In most cases, whether I click Cancel or enter my password, the login form gets auto filled anyway.  How do I get rid of the popup? I want it to auto login each time, not ask for my system password. The dialog box never appears for any other apps. Simple & easy way to jail users I need a simple and easy way to jail users in their home directories in Oneiric. Do you have a simple configuration for jailing users, with full help, or some good web links?  I would be offering an online free public server with 10 to 20 GB free space. I don't know how many users. I want to give them SSH and SFTP so that they can connect through FileZilla. Converting a DC motor to a generator Can ANY DC motor become a generator if torque is applied to the shaft? example:   And by any, I mean the really cheap ones too.  Or is there a specific type of motor (of which I do not know the name) that can work in both directions (battery to power the shaft OR torque-on-shaft to create a voltage difference between the terminals). So, I'm working with OpenGL (I'm not exactly sure of the version), and I want to do an old-style lighting setup by essentially drawing a black rectangle over the screen, and drawing white circles over the areas that should be lit. I already have the rectangle and the circles, but I can't figure out how to make it so that the white circles are transparent when applied to the black areas. Any ideas? I tried to use blending modes, but it still evades me...  EDIT: Here's the code that I'm using (Python).  view_buf = Buffer(GL_INT, 4) glGetIntegerv(GL_VIEWPORT, view_buf) view = view_buf.to_list() if hasattr(view_buf, "to_list") else view_buf.list  glDisable(GL_DEPTH_TEST)  glDisable(GL_LIGHTING)  glEnable(GL_BLEND)  if logic.lights['smooth']:     glEnable(GL_LINE_SMOOTH)  # # Make sure we're using smooth shading instead of flat # glShadeModel(GL_SMOOTH)  # Setup the matrices  glMatrixMode(GL_PROJECTION) glPushMatrix() glLoadIdentity() gluOrtho2D(0, view[2], 0, view[3]) glMatrixMode(GL_MODELVIEW) glPushMatrix() glLoadIdentity()  #glAlphaFunc(GL_GREATER, 0.5)  glColor4f(0.0, 0, 0, 0.75)  glBegin(GL_QUADS);                              # Draw Black screen glVertex2d(0.0, 0.0); glVertex2d(view[2], 0.0); glVertex2d(view[2], view[3]); glVertex2d(0.0, view[3]); glEnd()  glColor4f(1, 1, 1, 1)  degtorad = 3.14159/180.0   glBlendFunc(GL_ZERO, GL_SRC_ALPHA)  def DrawCircle(x, y, radius, fill = 1, step = 11):      glVertex2f(x, y)      if fill:         glBegin(GL_TRIANGLE_FAN)     else:         glBegin(GL_LINE_LOOP)      for a in range(0, 360, step):         angle = degtorad * a         glVertex2f(x + (sin(angle) * radius), y + (cos(angle) * radius))      glEnd()   #for layer in range(len(logic.lights['layers'])): #   size =  for light in logic.lights['points']:     DrawCircle(light[0][0] * view[2], (1 - light[0][1]) * view[3], light[1], step = light[2])     if logic.lights['smooth']:         DrawCircle(light[0][0] * view[2], (1 - light[0][1]) * view[3], light[1], 0, light[2])  # Reset the state glPopMatrix() glMatrixMode(GL_PROJECTION) glPopMatrix()