I found these two different sources, but they do the exact same thing. I was wondering if there is a difference or not but I couldn't figure it out.  Can anyone tell me the difference and when should I use which?  this is the first one:   void function1(int *x) {     *x = 100; }  int main() {     int var1 = 10;      function1(&amp;var1);     cout &lt;&lt; var1 &lt;&lt; endl; }   and this is the second one:  void function2(int &amp;x) {     x = 100; }  int main() {     int var2 = 10;      function2(var2);     cout &lt;&lt; var2 &lt;&lt; endl; }
What would be better practice when giving a function the original variable to work with:  unsigned long x = 4;  void func1(unsigned long&amp; val) {      val = 5;             } func1(x);   or:  void func2(unsigned long* val) {      *val = 5; } func2(&amp;x);   IOW: Is there any reason to pick one over another?
$K \subset \mathbb{R}^n$ is compact iff it is closed and bounded I want to prove $\Leftarrow$.  I just need one more step, now. If I find a compact set that contains K, then it will finish the proof. Rudin take a k-cell to do that, but before it he proves that every k-cell is compact, and I think I can take a more simple compact to do this step. I has thinked in the closed ball, but don't know how to prove that it is compact. Can anyone help me to find this set, if it really exists? Thanks. Integrating trigonometric function problem $\int \frac{3\sin x+2\cos x}{2\sin x+3\cos x}dx$ \begin{eqnarray*} \int \frac{3\sin x+2\cos x}{2\sin x+3\cos x}dx &amp;=&amp;  \int \frac{(3\sin x+2\cos x)/\cos x}{(2\sin x+3\cos x)/\cos x}dx\\ \\ &amp;=&amp; \int \frac{3\tan x +2}{2\tan x +3} dx\\ &amp;&amp; u = \tan x \text{ and } du = \sec^2 x \ dx  \end{eqnarray*} Am I going in the right direction with this one? It seems like not. Android How to use MediaScannerConnection scanFile Local collection of Python packages: best way to import them? Log of mounted/unmounted devices in Unix Why does an argument similiar to 0.999...=1 show 999...=-1? Solving "MySQL server has gone away", mysql error 2006 How do hashes really ensure uniqueness? This might seem an impractical and unnecessary conversation, but I feel it's something I need to clarify. Especially, as I just got my first developer job in a blockchain startup.  So hashes are said to generate the same thing for any information it sees, and it's only a one-way interaction.   As far as I understand, hashes are just long alphanumeric strings. If one computes hashes across all documents, keys, information, files, etc, over and over again- it's simply a matter of time until the same combination comes up again for different information (applying it across all possible contexts)? This might be an impractical test given size and possibility, yes, but is it this that makes hashes powerful, that it's practically impossible to recreate a hash that for any foreseeable endeavor it's fine, or is there some element that I'm missing that reduces even that extremely low probability to zero? Is there any design constraint that prevents a very powerful computer to back-calculate the original data from a hash? Or is it simply that the design is so complex that it's simply a futile exercise to dream of such a large computer required for this task? What's stopping a hacker or malicious middle man to hack open the software program or library that creates this "hash" and then use that library to create hashes of his/her own or mislabel some target company's hash with his/her own pointing to their version of the file? Especially since many applications, languages, and developers use hashing independently. Whichever is most weakly secured, we can use that to take on the rest?   Any resources are also appreciated. A secretary with ____ good knowledge of English: "a" or no article? I'm trying to pass a test on "Articles exercise" as they call it . Reviewing my answers I got stuck about the two I posted on the picture below.  As I understand both words are uncountable (according to the ), so it looks like (or said for example ) I can't say a/an with an uncountable noun.  But this test says the opposite. Is there some trick? Or am I just dumb? Please help me to understand why I need to use "a" article in these cases?        We need a secretary with ____ good knowledge of English.          a  (marked as the correct answer)   the     a / the     no article is needed (the answer I think is correct)        We're having ____ terrible weather.         a (marked as the correct answer)     the     a / the     no article is needed (the answer I think is correct) Are the review queues planned for the iOS app? I enjoy reviewing on SO, is it currently possible to review on the iOS app? If not, is it planned to be implemented? Entity Query field condition for Webform submissions I'm trying to query webform submissions based on a field value. The field is called "ticket_for". Somethings I tried and do not work:      -&gt;condition('ticket_for',$adnummer)     -&gt;condition('webform_submission_data:ticket_for',$adnummer,'CONTAINS') ...   What kind of condition should I be using in a query like this?  $query = \Drupal::entityQuery('webform_submission') -&gt;condition('webform_id', 'ticket') -&gt;condition('entity_id', $eventID) -&gt;condition('webform_submission_data:ticket_for',$adnummer,'CONTAINS'); How can I increment a date by one day in Java? I'm working with a date in this format: yyyy-mm-dd.  How can I increment this date by one day? No error message if the URL is very long I entered a URL with a very long parameter on Stack Exchange.  I have type this url    It shows a blank screen , does not shown any messages.    We need to show a “Page Not Found” message, same as what you did on other Stack Exchange pages. Possible to use draws from two distributions to get draw from distribution with density their product? sqlite3: not found A well-supported wireless PCI adapter for Ubuntu 12.04? Changing the style of the first *typeset* line of a paragraph Prezi is a proprietary software .   I found beamer, powerdot, HA -prosper, prosper, slides and seminar. Which one or something similar should I use to create something like Prezi-style zooming dia -presentation? Best methods to fix broken tracks I've made a couple of PCBs which need the odd few 10 mil tracks, but are mostly 20/30 mil. Unfortunately the etching process isn't fantastic and there are numerous breaks in the traces, most of them small.  I've managed to convince solder lumps to go over the top of the smaller gaps, and have used components legs to bridge some of the larger ones. The solder lumps don't feel particularly reliable though, and there are some gaps which are too small and awkward to get a piece of wire across but too big to be bridged with just the iron.  Are there any standard ways to reliably fix up broken traces?  Update: Thanks for the suggestions everyone!  I found and tried out a silver conductive pen. As a first time user I found it difficult to dispense, and obviously I didn't use enough of it or mix it properly because it didn't even end up being conductive.  It seems like the main problem was that I was trying to use pieces of wire which are too short. I found some small gauge tinned wire and used longer lengths, running it over significant lengths of good track on either side of the fault. That makes it much easier to position, and you can tack them down one end at a time. Is voting to balance in the spirit of the site? The other day I saw an answer which was ok. Not great but not bad. So no reason to upvote or downvote. However the answer already had a single downvote. I felt this was unfair so upvoted the answer to keep it at what I felt was a fair score. It wasn't until afterward that it occurred to me that I should have perhaps solely voted on the content of the answer.  Is this a reasonable reason for an upvote or should I have left the answer alone?