These two methods seem to be extensively used inside linux kernel code. I know the foundations of branch prediction, but I would like to know how these two functions affect the operation of if() statements. Also do they work at the level of CPU instruction pipeline? or is it at a much higher level of abstraction at kernel code level?  Being a starter to linux kernel I would be deeply interested in knowing the internal workings of these two methods. Thanks!
I've been digging through some parts of the Linux kernel, and found calls like this:  if (unlikely(fd &lt; 0)) {     /* Do something */ }   or  if (likely(!err)) {     /* Do something */ }   I've found the definition of them:  #define likely(x)       __builtin_expect((x),1) #define unlikely(x)     __builtin_expect((x),0)   I know that they are for optimization, but how do they work? And how much performance/size decrease can be expected from using them? And is it worth the hassle (and losing the portability probably) at least in bottleneck code (in userspace, of course).
What can I do on a Visualforce page that is a renderAs="pdf" that will result in the name of the file that shows up when the user clicks Save As... to not be the name of the Visualforce page.  The page is generated via a GET request coming from clicking a custom button.  Below is some code that is representative of the PDF.   &lt;apex:page standardController="Account" extensions="AccountPdf"           showHeader="false"           sidebar="false"           renderAs="PDF"          title="AccountReport.pdf"          contentType="application/pdf#AccountReport.pdf"          &lt;head&gt;              &lt;title&gt;AccountReport.pdf&lt;/title&gt;          &lt;/head&gt;          &lt;apex:outputText value="Hello World"/&gt;  &lt;/apex:page&gt;   The browser bar does not have the title value in it and when the user clicks Save As... the name of the file is the name of the Visualforce page (e.g., myPageName).  If I remove the renderAs="pdf" the file downloads automatically with the correct file name due to the contentType, but the actual content type doesn't appear to be a PDF. Require reason for post deletion and un-deletion? Could we have a method of explaining why we think a question or answer should be deleted?  It could work identically to closing a question, maybe with an additional text-input box (like the "Requires Moderator attention" flag option) to provide additional info because the reasons for deletion should really be more specific..  For example, "exact duplicate" doesn't explain to me the user has re-posted the same question, thus, it should definitely be deleted (not just left closed). Like with close-messages, these reasons would be listed under the deleted item (or answer).   I don't think comments are suitable, as they can be a pain to quickly.. "extract" deletion reasons from them - I have to scan through the comments, and they may all be irrelevant.  Equally, for un-deletion, it'd be useful to know why another user thinks a question should be restored. For example "new user deleted the question after they accepted an answer", or "Jeff went insane and started deleting any questions with the letter O in it".  I think requiring un-deletion reasons is possibly more important, since commenting is disabled on deleted questions - we have no way of explaining why we think it should be restored Disable RAM stick in Windows 7 I have 2 8gb RAM sticks on my motherboard. One is faulty on some bytes and is giving me BSOD once in a while.  Is it possible to disable one of them without removing it physically? I want to keep it inside the motherboard as I dual boot with Xubuntu and I can block the fauly bits there, and as far as I know, it is impossible to block them in Windows. Highlight tags corresponding to our favorites Each of us have our list of favorite tags.  When a question has tag(s) that match one or more of ours, the background gets highlighted, drawing our attention to the question.  It would also be nice to highlight (perhaps using a bold font) the tags(s) that matched our own, so one could quickly do a further filtering of the question to see if it is of interest at the present time, like the following:    e.g. arduino is in my list of favorites, but the other two in each question are not. Can't install apps from App Store on iPhone with iOS 7 If $A$ is an $n \times n$ matrix and $ A^2 = 0$, then $\text{rank}(A)\le n/2$. Was revising for a Linear Algebra when I came across this question.     "Given a Matrix $A$ over $\mathbb{R}^{n \times n}$, and $A^2 = 0$,   show that rank($A$) $\leq n/2$"   My attempt:  I was thinking of the theorem from Cayley-Hamilton but the matrix is a $n \times n$ matrix hence that's probably invalid.  Is there perhaps a significance of $A^2 = 0$? apart from a special case of the nilpotent matrix? A machine is described as being "really slow" or "freezing". How can I troubleshoot/resolve this issue? What should be the first steps to take? I have a bunch of files as follows:  04602635_b0294.DAT20120807164534 04602637_b0297.DAT20120807164713 04602638_b0296.DAT20120807164637 04602639_b0299.DAT20120807164819 04602640_b0298.DAT20120807164748 04602641_b0300.DAT20120807164849 04602650_b0301.DAT20120807164921 04602652_b0302.DAT20120807164956   I need to rename them to exclude the prefix. It needs to look like this..  b0294.DAT20120807164534 b0297.DAT20120807164713 b0296.DAT20120807164637 b0299.DAT20120807164819 b0298.DAT20120807164748 b0300.DAT20120807164849 b0301.DAT20120807164921 b0302.DAT20120807164956   EDIT  I forgot to add that I am using Solaris. How to find "file-release" in OS X El Capitan 10.11.6? I can not find file-release through command line on OS X El Capitan Version 10.11.6. On my virtual machine in Ubuntu I can do "ls /etc/*release" and it shows me two files with all needed information:  $ cat /etc/redhat-release  Red Hat Enterprise Linux Server release 7.0 (Maipo)  $ cat /etc/os-release  NAME="Red Hat Enterprise Linux Server" VERSION="7.0 (Maipo)" ID="rhel" ID_LIKE="fedora" VERSION_ID="7.0" PRETTY_NAME="Red Hat Enterprise Linux Server 7.0 (Maipo)"   No idea how to find the file with release information on Mac. Please give me a hint or a hint how to search it? python ImportError: No module named primes I found the below in  web-site:     We use much in questions and negative clauses to talk about degrees of something.      We don’t use much in affirmative clauses.   Also, it the same web-site, I found the following:     She runs much faster than he does.    also I noticed that some web-sites use much with affirmative clauses:     May we all be having this much fun and getting this much exercise when we're his age!    Is it Okey to use much in affirmative clauses? If yes, when can we use it? and what is the rules?  Update:  Here is another example on how often the word "much" is used  in informal style:     After much consideration I will NOT be performing at the Inauguration with my improv group Capitol Hill-arious Nonphysical entities cannot be observed. Therefore such entities cannot be verified by observation. How could statements like "God exists" be even considered true? Why would anyone appeal to the metaphysical realm at all?  It seems to me that the best method by which we should go about in understanding the world is by initially ruling out the possibility of the metaphysical altogether for the simplest answer (a sort of null hypothesis). Once we can get a hold of a natural cause of some phenomenon, we should be satisfied that that is all there is to it. Formulating some nonphysical cause would be unnecessary, superfluously complicated, or even cluttered. Now if there was some problem that we were certain could not be solved by observation or experimentation or whose solution could not possibly exist in the observable realm, yet must be true, I would consider the possibility of a metaphysical cause.      That said, I don't think that if you can't empirically observe something, it doesn't exist; rather, I would declare total agnosticism and say that it is unknowable. The sign in the formula for the voltage across the inductor This question is about voltage induced in a inductance.  I know the rate of change of current induces EMF in the inductor. The direction of the induced EMF will be opposite to the change that is causing it. The EMF induced is given by the following formula.  $$V_l = -L \frac{dI}{dt}$$  The negative sign indicates direction of induced emf across the coil is opposite the current change.     In the picture I have drawn current direction and \$V_l\$ direction.  If \$\dfrac{dI}{dt}\$ is postive, \$V_l\$ will be negative according to formula right? Or does the direction of \$V_l\$ has to be reversed?  In many Internet references I found \$V_l = L \dfrac{dI}{dt}\$. Which one is correct?  I hope they reversed \$V_l\$ reference points and removed the negative sign in the formula. Please clarify. How does LSTM prevent the vanishing gradient problem? LSTM was invented specifically to avoid the vanishing gradient problem. It is supposed to do that with the Constant Error Carousel (CEC), which on the diagram below (from ) correspond to the loop around cell.  (source: ) And I understand that that part can be seen as a sort of identity function, so the derivative is one and the gradient stays constant. What I don't understand is how it does not vanish due to the other activation functions ? The input, output and forget gates use a sigmoid, which derivative is at most 0.25, and g and h were traditionally tanh. How does backpropagating through those not make the gradient vanish ? Number of ways to write n as a sum of k nonnegative integers How many ways can I write a positive integer $n$ as a sum of $k$ nonnegative integers up to commutativity?  For example, I can write $4$ as $0+0+4$, $0+1+3$, $0+2+2$, and $1+1+2$.    I know how to find the number of noncommutative ways to form the sum: Imagine a line of $n+k-1$ positions, where each position can contain either a cat or a divider. If you have $n$ (nameless) cats and $k-1$ dividers, you can split the cats in to $k$ groups by choosing positions for the dividers: $\binom{n+k-1}{k-1}$. The size of each group of cats corresponds to one of the nonnegative integers in the sum. Utopia of children brought up by robots I am looking for the title of a science-fiction book describing a colony (utopia) on another planet that has been established as a social experiment. The inhabitants had been brought up only by robots and therefore work perfectly as a society. I think there is no formal government and people work on what they are interested. If any catastrophe happens, they are able to form groups of specialists who react to the threat. Later there comes a group of outsiders who decide to join and live in the utopia. I am not sure, but author was probably Canadian. how to fix ioctl permissions denied error? I searched in lots of websites/forums but did not find a solution for this problem, and this site is last chance, this is problem: This problem have several other users too. my phone is Galaxy S7 Edge , exynos, Oreo 8.0 (Stock ROM), rooted with magisk latest version. root works well in other applications. In pentesting applications like csploit, Network Spoofer, WifiKill and others  root works well(grants permission)  but when start using options of app(for example, arp spoofing, network sniffer, MITM, etc) drops same error: [ERROR] Unable to retrieve local hardware address libnet ( ioctl: Permission denied ) what to do? Can this issue fixed? or exactly which permission is it?  Also one interesting thing, when I installed old version of WifiKill app it worked - killed wifi connection. Legal issues for a "fangame" of a commercial franchise? I've played around in the past of the 2D Flash fan-made version of the popular Valve game Portal.  It has basically the exact same mechanics, but as a 2D side-view flash game.  Lately I've toyed around with creating a simplified flash version of some of my favorite franchises (such as Zelda, Mario, Splinter Cell, etc.).  Of course, nothing is "stopping" me from just using the same mechanics and just changing the name to something not copyrighted.  I have witnessed projects that have tried to directly port a 3D game into a 2D simplified version, with the exact same plot and puzzles (Ocarina of Time in 2D comes to mind), and I have seen them being shut down.  But I am not likely going to exactly duplicate any game...just borrow some of the source material and basic underlying mechanics.  For example, if I were to make a Zelda-influenced fan game, I would have items such as the Hookshot, Boomerang, and all other sorts of ones from the Gameboy Zeldas; just with a custom plot and dungeons.  With likely the same mechanics.  What are the legal issues involved in this?  I used to think it was a "Don't do this ever; it's a bad idea."  But then I've seen the Portal clone, and now I'm curious. Show $f$ is analytic if $f^8$ is analytic This is from Gamelin's book on Complex Analysis.  Problem: Show that if $f(z)$ is continuous on a domain $D$, and if $f(z)^8$ is analytic on $D$, then $f(z)$ is analytic on $D$. (I assume the intention is that $D$ is nice, i.e. open and connected)  I'm not exactly sure how to approach this. I'm guessing it has something to do with zeroes of $f$. For example, around non-zeroes, $f$ is analytic since $z^{1/8}$ is nonzero in a neighborhood. Or something along those lines. The details are eluding me.  Any help would be appreciated! I have a spreadsheet full of addresses to geocode in ArcMap 10.  I've added the spreadsheet to the map, then started to geocode them via the context menu's "Geocode addresses" item.  Many were matched automatically, and most of the unmatched I've been able to resolve within the Interactive Rematch dialog. But I have a handful of addresses where I get no result at all.  I can, however, locate these points on Google Maps, and I can get the latitude and longitude that way.  How can I enter that data into the table to locate the missing points?  I have tried editing the data and putting the lat/lon values into the X and Y columns, (via Edit Features -> Start Editing, then Open Attribute Table on the context menu).  But when I Flash the point, I don't see it.  The lat &amp; lon are consistent with the other data points on the map (i.e., not swapped, and using the correct sign).  How can I add the points to the table?