in this code Why this prints >> 0 8  instead of >> 5 8 . The method doIt() changes the number of Person p which is already allocated, but the int x is already allocated and is not changed in doIt(). Can anyone give me an theoretic explanation? I'm trying to understand how it works. Thanks.  class Person{    int number=0; }  class Student extends Person {     int studentNumber; }  public class Prog{       public void doIt(int x, Person p)     {         x=5;         p.number=8;     }      public static void main(String[] args) {         Prog p = new Prog();        p.test();      }      public void test()     {         int x=0;         Person p = new Person();         doIt(x,p);         System.out.println(x);         System.out.println(p.number);     } }
I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?
Why can't the Klein-Gordon equation with a Couloumb potential describe the hydrogen atom?  Why can the first order Dirac equation explain it? What are the failures? How do I remove the file suffix and path portion from a path string in Bash? Given a string file path such as /foo/fizzbuzz.bar, how would I use bash to extract just the fizzbuzz portion of said string? I'm learning how to use the mirror modifier and I am having some trouble.  When I apply the modifier to my object I don't see a mirrored version of it.  What am I doing wrong? For years I've been trying to find this movie I saw on TV once.  I only saw the end.  It featured a teenage boy (about 18 years old) and his family hiding out in a cabin.  The kid is making molotov cocktails and preparing for something.  Sure enough two bad guys show up and I think one of them had a golden pistol.  They start fighting and one of the guys turns into a werewolf type creature.  The kid wounds it and tracks it through the woods to finish it off with his lever action rifle.  Anyone know the name of this movie?  I saw this probably mid to late 90s.  I'm guessing it was an 80's American film. It was live action. Show lim sup (an) = lim inf (an) for increasing for increasing sequence of subsets. I have a configuration file where a developer can specify a text color by passing in a string:   &lt;text value="Hello, World" color="Red"/&gt;   Rather than have a gigantic switch statement look for all of the possible colors, it'd be nice to just use the properties in the class System.Drawing.Brushes instead so internally I can say something like:   Brush color = Brushes.Black;   // Default   // later on...  this.color = (Brush)Enum.Parse(typeof(Brush), prasedValue("color"));   Except that the values in Brush/Brushes aren't enums.  So Enum.Parse gives me no joy.  Suggestions? How does Linux handle multiple consecutive path separators (/home////username///file)? I'm working on a python script that passes file locations to an scp subprocess. That's all fine, but I'm in a situation where I may end up concatenating a path with a filename such that there's a double '/ in the path. I know that bash doesn't care if you have multiple file separators, but I'm wondering how exactly that is rectified. Is it bash that strips extra /s or does it really not matter ever?  I ask because it will save me several lines of code to check for extra /s while concatenating. I know it's not a big deal, but I'm curious as well. I have a bash script that has the line cd //usr (instead of cd /usr), which seems to imply there might be a significance to using multiple /s in a path How can I control HDD spin down time? I have 2 HDDs in my PC. Ubuntu is turning off the secondary HDD very quickly after about 15 minutes, which is short for me. I need to control this time. How can I do it?  I tried GNOME power management but did not find it useful. How To Make A Solid Object Drop To The Ground Like It Was Liquid Do elevator upgrades increase your passive credit earnings, too? I'm trying to create a command, which calls on an environment, which defines a custom column definition with one argument using \newcolumntype, and defines a second command, containing parameters for a table column.  Then, still within the first command, I begin the tabular environment and call the custom column, with the second command as its argument. I always get an undefined control sequence error, though. Any thoughts on why that might be?  I'm sure that was clear as mud, but I've cut it down to a minimal example, which follows:  \documentclass{article} \usepackage{array} \usepackage[table,dvipsnames]{xcolor} \usepackage{colortbl}  \newenvironment{tablecolor}{     \newcommand{\tlight}{\columncolor{SkyBlue!30}\color{black}}     \newcolumntype{C}[1]{&gt;{##1}c} }{}  \newcommand{\tablegoals}{ \begin{tablecolor} \begin{tabular}{l|C{\tlight}} Goal 7  &amp; \\ \end{tabular} \end{tablecolor} }  \begin{document}     \tablegoals \end{document}     Here's my second attempt. Different approach, same undefined control sequence error with \columncolor.  \documentclass{article} \usepackage{array} \usepackage[table,dvipsnames]{xcolor} \usepackage{colortbl} \usepackage{ifthen}  \newenvironment{tablecolor}{     \newcolumntype{C}[1]{&gt;{         \ifthenelse{\equal{dark}{##1}}{             \columncolor{Cyan}\color{white}             }{             \columncolor{SkyBlue!30}\color{black}         }     }c} }{ }  \newcommand{\tablegoals}[1]{     \begin{tablecolor}         \begin{tabular}{l|C{dark}}             Goal 7  &amp;   #1         \end{tabular}     \end{tablecolor} }  \begin{document}     \tablegoals{Check mark} \end{document} I found this confusing when I use the neural network toolbox in Matlab. It divided the raw data set into three parts:   training set validation set test set   I notice in many training or learning algorithm, the data is often divided into 2 parts, the training set and the test set.  My questions are:   what is the difference between validation set and test set?  Is the validation set really specific to neural network? Or it is optional. To go further, is there a difference between validation and testing in context of machine learning? Why there is "the" before some names but not others Is there a rule beyond the common "no the with proper nouns and names" for the following problem?     I saw the Empire State Building.      We went to the White House.      We saw the Golden Gate Bridge.   but     I went to Death Valley National Park.      I crossed Brooklyn Bridge. How do question bookmarks work? What does bookmarking a question mean? How do you bookmark a question? Do users get updates on their bookmarked questions? Are my bookmarks publicly visible? How do you see your own bookmarks? How do you see other users' bookmarks? How do you see which users have bookmarked a particular question? What impact does the bookmark system have on the voting system? Can I &quot;un-bookmark&quot; a question? Can I search within my bookmarks? Measure the size of a PostgreSQL table row I have a PostgreSQL table. select * is very slow whereas select id is nice and quick. I think it may be that the size of the row is very large and it's taking a while to transport, or it may be some other factor. I need all of the fields (or nearly all of them), so selecting just a subset isn't a quick fix. Selecting the fields that I want is still slow. Here's my table schema minus the names: integer                  | not null default nextval('core_page_id_seq'::regclass) character varying(255)   | not null character varying(64)    | not null text                     | default '{}'::text character varying(255)   |  integer                  | not null default 0 text                     | default '{}'::text text                     |  timestamp with time zone |  integer                  |  timestamp with time zone |  integer                  |   The size of the text field may be any size. But still, no more than a few kilobytes in the worst case. Questions  Is there anything about this that screams 'crazy inefficient'? Is there a way to measure page size at the Postgres command-line to help me debug this? How to approach the modeling of duct work, piping, wiring? Unknown Syntax Error in Code So, I am following a , and it is using Python code to create an audio visualizer in Blender. Now, I've always been a coding geek, but I don't actually know Python. I've taken a few shots at it but overall, I don't know Python, however, I can read and understand the code because I know basic programming concepts. Now, I'm following this tutorial as closely as I can (the tutorial does not provide code to copy and paste) and I am getting a syntax error. As far as I can tell, there is no syntax error. The line of code (specified by the error message) appears perfect. This line of code is supposed to set the 3D cursor to the active object's origin. Here's the catch: if I run that exact same line of code in the console, it executes just fine. So here's the error message I get:  File "C:\Me\Blender\Blender Projects\audio visualisation.blend\AudioVisualizer", line 17 bpy.context.scene.cursor_location = bpy.context.active_object.location    ^ SyntaxError: invalid syntax location: &lt;unknown location&gt;:-1   It tells me to look in the console for error message, but the console doesn't output anything.    Thanks!  EDIT: Alright. I've tried all the examples and all the procedures that have been suggested by you guys, but it keeps feeding me errors. According to the console, one of the problems it is spitting out is in C:\Program Files\Blender Foundation\Blender\2.74\scripts\modules\bpy\ops.py. This makes me think there is a bug in the API that is causing one of the many errors. EDIT: Here are the error messages I get for my code. Original Code:  Error:   File "C:\Gannon\Blender\Blender Projects\audio visualisation.blend\Audi o Visualizer", line 35     bpy.ops.graph.sound_bake(filepath="C:\Gannon\Blender\Sounds\Music\Batty McFa dden.mp3", low=i*step high=i*step+step                           ^ SyntaxError: invalid syntax    gandalf3's Code and zeffii's Code are essentially the same with alternative formatting which changes the line numbers where the error occurs.  Error: Unsupported audio format  Traceback (most recent call last):   File "C:\Gannon\Blender\Blender Projects\audio visualisation.blend\Audio Visua lizer", line 42, in &lt;module&gt;   File "C:\Gannon\Blender\Blender Projects\audio visualisation.blend\Audio Visua lizer", line 35, in spiral   File "C:\Program Files\Blender Foundation\Blender\2.74\scripts\modules\bpy\ops .py", line 189, in __call__     ret = op_call(self.idname_py(), None, kw) RuntimeError: Error: Unsupported audio format When starring a message from the star board, it's not reflected in the main chat window If you click to star a post on the side (in the starred list), it changes color but not the star by the main chat area (it does add one to the number, but it doesn't change the color). Then when you click the star on the main chat area, it changes color to yellow but lowers the number by one  After clicking in sidebar:     After clicking in the main chat: How to print object content in correct way? Are there wizarding schools in the rest of the "magical" world? Are there other schools for witches and wizards in the rest of the world? In the books they only speak of 3 schools, but what about Asian or American people?  And even more, were they affected by the events happening in Europe?