So at our university, they've been printing out the following piece of code on the coffee cups :  void f(char *x, char*y, int z) {     int z2 = (z + 7) / 8;     switch (z % 8)     {         case 0:         do          {             *x++ = *y++;         case 7:             *x++ = *y++;         case 6:             *x++ = *y++;         case 5:             *x++ = *y++;         case 4:             *x++ = *y++;         case 3:             *x++ = *y++;         case 2:             *x++ = *y++;         case 1:             *x++ = *y++;             } while (--z2 &gt; 0);     } }   Running it, I've figured out it just copies z bytes from the address pointed to by y, into the address pointed to by x.  It seems to me as if the code is just needlessly complicated and ugly , with the switch statement and especially the confusing do while loop beginning in case 0 and ending in case 1. Wouldn't a simple for loop suffice ? :  void ff(char *x, char *y, int z) {     for (int i = 0; i &lt; z; i++)         *x++ = *y++; }   As far as I could tell, it does the same thing, unless there's something I'm missing?
I've read the , and I don't get it. I am really interested, but I've read the explanation there a couple of times and I still don't get it how the Duff's device works.  What would a more detailed explanation be?
find the number of injections/surjections I've been banging my head on this problem for some time now, and could really use help. Bear in mind I'm not very good at this sort of thing and am struggling to get by in class.  Problem:     Given $ \alpha : A \to B       \;\;\;\;\;   |A|=p \;\;\;\;|B|=q $      Find:         Number of Injections: $A \to B$   Number of Surjections: $ A \to B$    Prove that ∃ a bijection $A \to B$       $\Rightarrow$ p = q   find number of bijections: $A \to B$         I apologize for dropping such a big problem on you all, but I just can't get anywhere with this. Help?  EDIT: These answers are really helpful and I believe I've got down the number of Injections, but  we haven't gone through permutations or combinatorics in class so my understanding of it is really hamstrung. I'm unclear on the Stirling theorem as discussed here: , specifically the part where inclusion-exclusion comes into play. I'm not sure how to apply that, since right now I'm letting p = 4 and q = 3, so I don't know where inclusion-exclusion would be used (if at all!) since I don't know how elements would be missing. Which facility upgrade unlocks maneuver nodes in KSP Which  unlocks  in career mode in KSP?  The  hints that maneuver nodes are now unlocked with a facility upgrade:     Are there any perks for upgrading?      The building in question   will upgrade visually, both from the outside and the inside. More   gameplay mechanics will be also be unlocked as the player progresses   through the different building tiers. For example, allowing EVAs in   space or being able to use maneuver nodes in the map view. \documentclass{article} \usepackage{expl3} \ExplSyntaxOn \begin{document} \tl_to_str:n { testing _ things }  \par  \tl_set:Nn \l_tmpa_tl { testing _ things } \tl_to_str:N \l_tmpa_tl \end{document}   gives a strange result (testing ̇things).  How can I get testing_things?  I basically want verbatim content (with line breaking). Topology: Example of a compact set but its closure not compact Can anyone gives me an example of a compact subset such that its closure is not compact please? Thank you. Microphone volume at maximum yet too quiet I have got a reasonbly basic desktop microphone, however for reasons that I don't understand it is extremley quiet. I dual boot, both systems run Windows 7, one system is working just fine although the other system, after I restarted the computer a couple of weeks ago, the microphone is now far too quiet.  I've been through the Sound control panel. The correct microphone is selected as the default communication device. The microphone level is set to 100. The microphone is plugged into a sound card, so I uninstalled the audio card (an Asus D1) driver and reinstalled it which made no difference. If I tap the microphone, it does register 5 or 6 green bars in the recording volume monitor. So, does anybody have any suggestions on where to look next? How do I share samba via Open VPN? Is that possible? I have configured open VPN in my home so that it can be accessible from my office easily.  Now I want to share samba via my open VPN. How can I share samba over open VPN between Ubuntu and Windows?  Home public IP: HHH.OOO.MMM.EEE Home desktop IP: 192.168.10.10 Office public IP: OOO:FFF:III:CCC Office Windows desktop IP: 192.168.1.10 Do I have to peel red potatoes before baking them? I recently made some potato wedges in the oven. I shared this recipe with my relative, who admonished me for not properly peeling the red potatoes before baking them.  She claims that there are disease and viruses that lie on the skin, so peeling it will get rid of it.  I bake it, so I assume that even the high heat in the oven would kill bacteria and germs. And besides that, I make sure to wash potatoes thoroughly before cooking them.  Am I in the wrong here? Should I have properly peeled the potato wedges before baking them? Personally I feel they add more flavor, and from all the pictures on the recipes online, it seems they also do not peel it. One of the topics that seems to come up regularly on mailing lists and online discussions is the merits (or lack thereof) of doing a Computer Science Degree. An argument that seems to come up time and again for the negative party is that they have been coding for some number of years and they have never used recursion.  So the question is:   What is recursion? When would I use recursion? Why don't people use recursion? Why can a discontinuous function not be differentiable? How to remotely display my Android on my PC? There is a thing which is called miracast, it can mirror the display of the Android phone to another monitor, but my screen doesn't have this function, am I possible to do it in Ubuntu? I can easily find files with given string in name:  me@comp:/usr/local/hydra/hydra-7.4.2$ find -D stat -name "*hack*" ./hack881663129.txt ./hack881663129_7.txt ./hack881663129_5.txt ./hack881663129_4.txt ./hack881663129_4_7.txt ./hack881663129_6.txt ./hack881663129_1_6.txt ./hack881663129_8.txt   How can I also print file details, like size, date of creation etc.? Should you set all the objects to null (Nothing in VB.NET) once you have finished with them?   I understand that in .NET it is essential to dispose of any instances of objects that implement the IDisposable interface to release some resources although the object can still be something after it is disposed (hence the isDisposed property in forms), so I assume it can still reside in memory or at least in part?  I also know that when an object goes out of scope it is then marked for collection ready for the next pass of the garbage collector (although this may take time).  So with this in mind will setting it to null speed up the system releasing the memory as it does not have to work out that it is no longer in scope and are they any bad side effects?  MSDN articles never do this in examples and currently I do this as I cannot  see the harm. However I have come across a mixture of opinions so any comments are useful. Mirror modifier mirrors on different axis/axes from the selected one(s) I have 2 objects a face and an ear. Mirror modifier works fine for the face. But when I use mirror modifier to duplicate the ear on X axis, it duplicates on Z axis. And when I use mirror modifier on Z axis it mirrors on X axis. How to correct the axis orientation? After reading , the most popular answer use the identity $$\sum_{t=0}^n \binom{t}{k} = \binom{n+1}{k+1}.$$  What's the name of this identity? Is it the identity of the  modified.  How can we prove it? I tried by induction, but without success. Can we also prove it algebraically?  Thanks for your help.    EDIT 01 : This identity is known as the  because, on Pascal's triangle, when the addends represented in the summation and the sum itself are highlighted, a hockey-stick shape is revealed. Your summary page shows "N Edits to your posts" for the selected time period but you really have to be looking for it.  Could we add edits to the notification feed? You could put the reason for the edit (entered--or not--when the editor changes it) and just a link to the post. Flagged emails keep returning and won't synchronize between Apple Mail and Gmail I've had this problem before and can't recall how I managed to fix it last time. I use Apple Mail to access my Gmail and normally flagged emails show up correctly. Starred emails in Gmail equate to flagged emails in Apple Mail and I can unflag an email in either Gmail or Apple Mail and it works.  But now I've got four emails that I can't unflag. They're not flagged in Gmail at all (although they used to be). When I see them in the Flagged folder in Apple Mail, they don't even have flag icons next to them but they're still counted in the number showing next to "Flagged". If I manually re-flag them and then unflag them, they disappear from the Flagged box. But then if I click into Inbox and then back into Flagged they show up again.  Any ideas about how to make these guys disappear for good?! When using the xhtml1-transitional.dtd doctype, collecting a credit card number with the following HTML  &lt;input type="text" id="cardNumber" name="cardNumber" autocomplete='off'/&gt;   will flag a warning on the W3C validator:     there is no attribute "autocomplete".   Is there a W3C / standards way to disable browser auto-complete on sensitive fields in a form? Debugging using Nvidia Nsight 2.2 in Visual Studio 2010 How do I allow non-root access to /ttyUSB0? Since I updated from Ubuntu 10.04 (Lucid Lynx) to Ubuntu 12.04 (Precise Pangolin), I am unable to access the device connected in /ttyUSB0 if I don't have root access.  To be more specific, I use a USB-to-serial com port converter to access and configure Cisco equipment with software called . It happens that, since I upgraded to 12.04, PuTTY only sees the connected device when I run it as gksudo putty. If not, it says "unable to connect to port /ttyUSB0".  I have managed to change the permissions via chmod 666, and it works, but if I disconnect the USB device and reconnect, it goes back to root only. How do I permanently allow non-root access? I have a clue it might be via  rules, but I have no idea how to do it.  Obs.: Manufacturer and drivers are "PROLIFIC" Usage of that: There are many reasons [that] I am confident [that] I will excel at this job I always find it hard to see when it's best to use &quot;that&quot;. Which of these sounds best?  There are many reasons I am confident I will excel at this job. There are many reasons that I am confident I will excel at this job. There are many reasons I am confident that I will excel at this job. There are many reasons that I am confident that I will excel at this job.  Are there ways of looking at this that I can apply elsewhere? Is there a completely different formulation that works better?