I've read a gazillion times that in Java, arguments passed to methods cannot be modified by the methods. Nonetheless, I find I can modify objects I create as opposed to Java Objects. Consider the following code:      // My Integer Object     class MyInteger {         Integer val;     }      // Change Java Object     public void test1() {         Integer intval;      // Integer object         intval = 123;         setInteger( intval );       // THIS DOESN'T WORK          TTY.putR( "Integer Object="+intval);     }      // Change My Object     public void test2() {         MyInteger myInt;    // MyInteger object         myInt = new MyInteger();         myInt.val = 456;         setMyInteger( myInt );      // THIS WORKS!          TTY.putR( "MyIntegerObject=" + myInt.val );     }      // Set an Integer object     public void setInteger( Integer val) {         val = 888;     }      // Set a MyInteger object     public void setMyInteger( MyInteger myint) {         myint.val = 999;     }   test1 doesn't work as I have been warned. But test2 works just fine. AFAIK, both are objects and are passed by reference. So how come one works and the other doesn't? (Note: TTY is my print function)
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?
small limits in the pointed category of a category with all small limits In Hovey, Model Categories, he says that given a category $\mathcal{C}$ with a small limits and colimits, if we form the category of pointed objects ,i.e. the category with objects as morphisms $*\rightarrow A$ where * is the terminal object, then this category $\mathcal{C}_*$also has all small limits and colimits.  To prove this, for any Functor $F:J\rightarrow \mathcal{C}_* $ where $J$ is small we compose it with the forgetful functor $\mathcal{C}_* \rightarrow \mathcal{C}$ and take the limit here. My question is how will this give a limit in $\mathcal{C}_*$? we will get an object in the category, but how do we get the arrow from $*$ to that object? Biblatex citation order I'm facing a problem with biblatex citation order.  Using this configuration:  \documentclass {article} \usepackage[brazil]{babel} \usepackage[utf8]{inputenc} \hyphenation{es-ta-bi-li-da-de} \usepackage{setspace} \singlespacing \usepackage[natbib=true,style=numeric]{biblatex} \addbibresource{frameworks.bib}   Being frameworks.bib this:  @Article{JONHSON88, author = {Ralph Johnson, Brian Foote}, title = {Designin Reusable Classes}, journal = {Journal of Object-Oriented Programming SIGS}, year = {1988}, key = {Johnson:88}, volume = {1}, number = {5}, pages = {22-35}, month = jun }  @book{UML-F:00, author = {Fontoura M., Pree W., Rumpe B.}, editor = {Addison-Wesley}, title = {The UML Profile for Framework Architectures}, year = {2000}, }   The PDF is generated with a text like:  Something about something[4], and moo foo other children[1].   This citation [4] is the first in all text. How can I order this correctly to [1]...[2] ...? What does "can only heal so much" mean in this sentence? C++ warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] How can one have a mini table of contents for the current chapter appear just after the chapter name listing all sections of that chapter? One whose solution never makes me happy is the following: $$y'(t)=\sin(y+t)\text{.}$$ I would start by substituting $z(t)=y(t)+t$ to get an ODE in $z(t)$, but then I'm not sure about how to substitute back my solution to check if it's correct or not$\dots$ How Do I Choose Between a Hash Table and a Trie (Prefix Tree)? So if I have to choose between a hash table or a prefix tree what are the discriminating factors that would lead me to choose one over the other. From my own naive point of view it seems as though using a trie has some extra overhead since it isn't stored as an array but that in terms of run time (assuming the longest key is the longest english word) it can be essentially O(1) (in relation to the upper bound). Maybe the longest english word is 50 characters?  Hash tables are instant look up once you get the index. Hashing the key to get the index however seems like it could easily take near 50 steps.  Can someone provide me a more experienced perspective on this? Thanks! Pairwise independence of Random variables does not imply indendence Show by a counterexample that for a family $(X_i)_{i\in I}$ of random variables the independence of all pairs $(X_i,X_j)$ with $i,j\in I, i\neq j$ does not imply the independence of the family (It is enough to consider $\mbox{card}(I)=3$.).      Hello, I am searching for a simple example. The professor gave the hint that one might consider random variables which only can take two different values, but I do not know exactly what is meant.  By the way:  We call the family $(X_i)_{i\in I}$ of random variables independent, if $(\sigma(X_i))_{i\in I}$ is independent, whereat we call a family $(\mathcal{E}_i)_{i\in I}$ with $\mathcal{E}_i\subset\mathcal{A}$ independent, if for any finite subset $I_0\subset I$ and any choice $E_i\in\mathcal{E}_i, i\in I_0$, it is $$ \mathbb{P}(\bigcap_{i\in I_0}E_i)=\prod_{i\in I_0}\mathbb{P}(E_i). $$ How do I make windows save their position on screen after re-attaching a display? Cutting strands of wire to fit plug I am a hvac tech, but my question is I have 2awg stranded and my plug is 6awg, will it matter much if I cut some strands to fit my plug? the plug is 60amp 250vac for a piece of kitchen equipment if the matters. Kept back upgrade of fwupd What's wrong now with fwupd? It was OK since May 1st, 2020 on newly installed Ubuntu 20.04 The following packages have been kept back:    fwupd  0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. I am struggling to understand zero inflated distributions. What are they? What's the point?  If I have data with many zeroes, then I could fit a logistic regression first calculate the probability of zeroes, and then I could remove all the zeroes, and then fit a regular regression using my choice of distribution (poisson e.g.).  Then somebody told me "hey, use a zero inflated distribution", but looking it up, it does not seem to do anything differently than what I suggested above? It has a regular parameter $\mu$, and then another parameter $p$ to model the probability of zero? It just does both things at the same time no? Show intersection of two algebras are not a $\sigma$-algebra I have the following question:    $\textbf{Question}:$ Let $\mathcal{F}_1$ and $\mathcal{F}_2$ be two algebras. Is $\mathcal{F}_1 \cap \mathcal{F}_2$ a $\sigma$-algebra?  I believe the answer is no. I know the definition of an algebra and the definition of $\sigma$-algebra.    I'm assuming I need to show that the intersection of the finite unions of each algebra is finite, but then I get stuck trying to work out how to show it is not a $\sigma$-algebra.  All help is appreciated.  Many thanks, John Using PyQGIS to transform layer of polygons into layer of holes inside bbox? I'm using python in QGIS. I have a layer of polygons (its a result of some earlier dissolving and has no overlapping polygons but some holes and islands in holes etc). I want to build a new layer which contains one polygon representing a bbox of the first layer with each polygon cut from it.  Essentially I want to "invert" the layer I have so that where the was polygon, now there is not, and where there was not polygon now there is. All inside a bounding box of the original layer.  I can build a bbox easily and I tried to "subtract" the polygon layer from my new bbox polygon layer but the process slows to a stop and then crashes my PC. Here's the algorythm  processing.runalg("qgis.difference","path/to/polygon.shp","path/to/bbox.shp","path/to/result.shp")   I dont care about attributes (obviously). I just need to cut one set of polygons from one larger polygon.  It seems so simple, I wish I could find a simple command or script to acheive this. As stated at the top I'm looking for a solution in python in QGIS. Dimensions of symmetric and skew-symmetric matrices SOQL results returning RecordTypeId which is not included in query Remember window locations when docked and undocked I find this beyond frustrating.  I have two extra screens on my laptop at work. I take my laptop and go home, with no extra screens connected. I come back, dock the laptop, and the windows need to be rearranged again.  Is there a way to get windows (or a utility) to keep track of the overall screen configuration (#, size, resolution), and remember where windows were placed, so when the screen configuration matches again, it puts applications BACK where they were? Need help identifying a comic book about a wizard I need help with identifying the comicbook, what follows is my best effort to gather whatever I remember from reading it years ago (circa year 2000, but I'm positive it was older than that):   The main character was a guy with white hair, who wanted to become powerful.  Through some training and a deal of some kind he was able to become a mage of sorts. The training was set on some other world, or possibly even parts were happening in different dimension. His powers might have had something with travelling between dimensions, but I'm not  100% sure. Also, I seem to recall there was a hard limit of how many times he could use them. Then followed a part where he was famous, but someone framed him into a scandalous plot (it was a sexual scandal, I think) using his clone or a doppelganger. At the end of the issue     the main character is seen trapped in some strange state, unable to move or escape using his powers (this might have to do something with the deal he made earlier). I remember the scene at the end as this: he is suspended in mid-air, his friends look at him in disbelief while some malevolent figure explains to them that he is now trapped forever.  His name was the title of the comic. The second and third parts were set on futuristic-looking planet.   Rings any bells? I'd like to read it again only I can't google it out. I did not create a swap partition during Ubuntu installation.  Later, I freed up some space and made a swap partition.  Now after each boot up, I am manually opening gparted to right-click the swap partition to turn on the 'swapon' option.  How can I automatically enable the swap partition at boot?  Also, if I had not created the swap partition, what are my other options? Number of combinations of dice having different number of faces that add to $10$ A function $\textbf{face}_{\mathrm{sum}}$ that takes a vector  $f$ that represents the number of faces of each die, and a positive integer  $s$ , and returns the probability that the sum of the top faces observed is  $s$ .  For example, if $f=[3,4,5]$  and  $s≤2$  or $s≥13$ , $\textbf{face}_{\mathrm{sum}}$ returns $0$, and if  $s=3$  or  $s=12$ , it returns  $\frac13*\frac14*\frac15=\frac1{60}$  $\textbf{face}_{\mathrm{sum}}([2,4,4,6], 10)$  I tried to solve this but I can't find the formula to calculate the number of combination of die faces that add to $10$, as the number of faces are different for each die.  Since max no of possible combination is $6*4*4*2=192$, all I need to find is the number of combination of die faces that add to $10$.  Thanks in advance.