Does JavaScript pass by references or pass by values? Here is an example from . I am very confused about the my parameter for the rectangle function. It is actually undefined, and redefined inside the function. There are no original reference. If I remove it from the function parameter, the inside area function is not able to access it. Is it a closure? But no function is returned. var shape = function (config) {     var that = {};     that.name = config.name || &quot;&quot;;     that.area = function () {         return 0;     };     return that; };  var rectangle = function (config, my) {     my = my || {};     my.l = config.length || 1;     my.w = config.width || 1;     var that = shape(config);     that.area = function () {         return my.l * my.w;     };     return that; };  myShape = shape({     name: &quot;Unhnown&quot; });  myRec = rectangle({     name: &quot;Rectangle&quot;,     length: 4,     width: 6 });  console.log(myShape.name + &quot; area is &quot; + myShape.area() + &quot; &quot; + myRec.name + &quot; area is &quot; + myRec.area());
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?
I am trying to install Ubuntu 16.04 LTS on a Dell XPS 13 (9350). The laptop came with Windows 10 pre-installed. I am installing from a pendrive but I think the issue would be the same if I used e.g. a USB DVD drive.   Dude, where's my hard drive?  I am blocked because the installation program cannot find 8.6Gb of free space on my hard drive despite the fact that there are hundreds of Gb free according to Windows. Digging a bit into the problem, it seems that Ubuntu cannot see my hard disk at all.    This is the output of GParted:    I am not sure what that drive mounted at /cdrom is, but it seems the only device that exists in the system that is not a RAM disk or a loop device:   Content of /proc/partitions:   ubuntu@ubuntu:~$ cat /proc/partitions   major minor  #blocks  name     1        0      65536 ram0     1        1      65536 ram1     1        2      65536 ram2     1        3      65536 ram3     1        4      65536 ram4     1        5      65536 ram5     1        6      65536 ram6     1        7      65536 ram7     1        8      65536 ram8     1        9      65536 ram9     1       10      65536 ram10     1       11      65536 ram11     1       12      65536 ram12     1       13      65536 ram13     1       14      65536 ram14     1       15      65536 ram15     7        0     130048 loop0     7        1    1104188 loop1     8        0    1970239 sda     8        1    1953439 sda1   Summary of fdisk -l:   ubuntu@ubuntu:~$ sudo fdisk -l |grep Disk Disk /dev/ram0: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram1: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram2: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram3: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram4: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram5: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram6: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram7: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram8: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram9: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram10: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram11: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram12: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram13: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram14: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram15: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/loop0: 127 MiB, 133169152 bytes, 260096 sectors Disk /dev/loop1: 1.1 GiB, 1130688512 bytes, 2208376 sectors Disk /dev/sda: 1.9 GiB, 2017525248 bytes, 3940479 sectors Disklabel type: dos Disk identifier: 0x00000000   Result of fdisk of the only non-loop non-RAM device (not sure this is relevant):   ubuntu@ubuntu:~$ sudo fdisk -l |grep -A 50 sda Disk /dev/sda: 1.9 GiB, 2017525248 bytes, 3940479 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00000000  Device     Boot Start     End Sectors  Size Id Type /dev/sda1  *      129 3907007 3906879  1.9G  c W95 FAT32 (LBA)   I am blocked at this point. Any help will be much appreciated.   Additional information (following comments):   Running dmesg |grep -i sata shows (among others) eight lines that suggest some kind of error:   ata1: SATA link down (SStatus FFFFFFFF SControl FFFFFFFF) ata2: SATA link down (SStatus FFFFFFFF SControl FFFFFFFF) ata3: SATA link down (SStatus FFFFFFFF SControl FFFFFFFF) ata4: SATA link down (SStatus 0 SControl 0) ata5: SATA link down (SStatus 0 SControl 0) ata6: SATA link down (SStatus 0 SControl 0) ata7: SATA link down (SStatus 0 SControl 0) ata8: SATA link down (SStatus 0 SControl 0)  I have "Restarted" windows instead of only "Shutdown" it to avoid problems with "fast startup", following some recommendations I have read of other users having problems installing Linux on Windows 10 laptops.ago   Regarding SATA, the BIOS says: "SATA Operation: RAID ON". The other two options available are "Disabled" and "AHCI".    I have followed the instructions of these two pages from Dell: , . How do I convert an argument list to a sequence of arguments? Help me understand the oddity of percentage gains and losses? If you start with $100K, and you get a 50% gain, it's $150K.  Then, you get a 50% loss: now it's $75K. Reverse the order (i.e. lose 50%, gain 50%), it's the same thing (a 25% loss).  So, 50% up then 50% down, or 20% up then 20% down, you don't get back to "even"; it's a loss.  My question is: how can one make this notion work to their advantage, instead of to their disadvantage?  I'm wondering if you have any strategies/thoughts/ideas on how to make this effect work for you, instead of against you. Or is my thinking on this as a strategy somehow incorrect?  The effect seems to diminish with lower swings in returns.  E.g. the +20% / -20% case, results in a 4% loss.  I.e. 100K -> 120K -> 96K.  Not clear what the formula for it is, but it's not linear. Migrating to full Ubuntu after dual installation on WinXP I previously ran 12.04 alongside WinXP to see how it performed on my mom's older laptop.  i also migrated her email to Thunderbird. If I now convert from dual WinXP/Ubuntu to only run Ubuntu will things like her Thunderbird emails be transferred as part of the Ubuntu full install? Or must I do something else? I am fairly tech aware, but not a full IT boffin! I'm in trouble with this homework.  Find the sum of the series $ 1 + \frac12 + \frac13 + \frac14 + \frac16 + \frac18 + \frac19 + \frac1{12} +\cdots$, where the terms are the inverse of the positive integers whose only prime factors are 2 and 3.  Hint: write the series as a product of two geometric series.  Ok, I found some patterns in these numbers, but I can't find the two series. Is there a reason to use multiple question marks instead of an asterisk in filename expansion? If I have a number of directories, named, for example 10001 through 10025 is there any reason to use ls 1*/foo vs. ls 100??/foo?  I have a lot more than 25 of them, so I mostly curious if there's any differences in speed.  I know the difference in use between the two, that the asterisk will match longer file names, like 10001.backup. But let's say I don't have any files that don't follow my conventions. Is there any behind-the-scenes differences? SQL Server - Best way to get identity of inserted row? What is the best way to get IDENTITY of inserted row?  I know about @@IDENTITY and IDENT_CURRENT and SCOPE_IDENTITY but don't understand the pros and cons attached to each.  Can someone please explain the differences and when I should be using each? It's a shame to type out an entire question, press post and then:     Sorry, you are only allowed to ask 50 questions in a 30 day period   Could you put some sort of notice on the page itself before submitting it to let you know the question won't be going through?  Or perhaps tell me how many questions I've asked in the last 30 days if it's >0?  Edit  This is not a complaint or statement about the limit, just a request that the error handling be done in a slightly better way to save people a lot of time. Is there any matrix $2\times 2$ such that $A\neq I$ but $ A^3=I$? Is there any $2 \times 2$ matrix $A \neq I$ such that $A^3=I$?  In my opinion: no. Thank you very much. iOS 9 Screen Recording in El Capitan I used to record iOS devices through QuickTime, however now it's only recording audio (not sure is this linked to OS X 10.11 or iOS 9).  How can I fix this (without third party sofrware)? Given $f(x) = x + |x|$ for what values of $x$ is $f$ differentiable What is a decoupling capacitor and how do I know if I need one? What is a decoupling capacitor (or smoothing capacitor as referred to in the link below)?  How do I know if I need one and if so, what size and where it needs to go?    mentions many chips needing one between VCC and GND; how do I know if a specific chip is one?   Would an  4-bit parallel access shift register used with an Arduino need one? (To use my current project as an example) Why or why not?  I feel like I'm starting to understand the basics of resistors and some places they're used, what values should be used in said places, etc, and I'd like to understand capacitors at the basic level as well. How do I put a stencil-like texture across a sectioned object? Disable cache for some images To explain the expansion of space I have often heard people saying that space is continuously created. This picture is usually applied to cosmological scales but I`m nevertheless curious if some microscopic description of this process could be found (or probably is already available?).  The first thing which comes into my mind by thinking about this is that in theories like loop quantum gravity, there is an idea that space is quantized. Would space expansion then be explained as the creation of new quanta in loop quantum cosmology? Or are there other different ideas, such as the quanta themselves changing properties? Do people actually working on this already have some interesting results? Find the limit: $\lim_\limits{x\to 0}{\frac{\left(1+x\right)^{1/x}-e}{x}}$ What is Quantization? How to set Windows bootloader as default bootloader? I have a Win 7/11.10 dual boot system with Grub 2 as the default bootloader. However, I want to make Windows bootloader the default bootloader (grub 'dos' like interface scrares the hell out of my sister) so when I start the PC I will have the following boot options: 1. Windows 7 2. Ubuntu  NB: A process to reverse this operation so Grub can be the default bootloader again will also be appreciated I'm a first time Linux user. My laptop wasn't connecting to the wifi so I followed the instructions from .  On typing sudo apt-get update after that, I got this error:  E: Type 'sudo' is not known on line 2 in source list /etc/apt/sources.list E: The list of sources could not be read.   What can I do? Texture Channel animated, doesn't appear in viewport I'm creating an educational video, and for efficiency, I'm using a Cyclic repeater to repeat an on-page/off-page effect.  Every loop, I have the texture channel switch to the next image, rather than duplicating all the objects/animations. This works properly and appears when rendering the animation, but does not appear in the viewport. It sticks to the original UV image that was mapped.  Is there a way to have this change appear in the viewport?