Currently, I'm trying to paste a picture to my pygame game and this picture have a alpha channel (as you can see bellow this sentence).  But, for some reason, when I use convert() or convert_alpha(), it's not putting correctly the picture with the alpha channel on the game... Even when I tried to do some mainpulations of the picture, nothing.  Here is the code I tried to write (with the manipulations for alpha channel that it didn't worked) : class Spritesheet:     # utility class for loading and parsing spritesheets     def __init__(self, filename):         self.spritesheet = pygame.image.load(filename).convert()      def get_image(self, x, y, width, height):         # grab an image out of a larger spritesheet         image = pygame.Surface((width, height))         image.fill(pygame.color.Color(&quot;black&quot;))         image.blit(self.spritesheet, (0, 0), (x, y, width, height))         image.set_colorkey(pygame.color.Color(&quot;black&quot;))         return image  How can I put a picture who have originally the alpha channel on it?
Can someone give me some example code that creates a surface with a transparent background in pygame?
Is it possible to add entries to the bibliography based on keyword using Biblatex/Biber and within the document code? I would like to print a bibliography which includes all entries with a certain keyword (and possibly some additional entries).  I know that I can filter by keyword when I print the bibliography using  \printbibliography[keyword=&lt;keyword&gt;]   but this will only print entries which I have cited. I could, of course, use  \nocite{*}   to add all entries to the bibliography and then print just those I want.  However, this will make my .bbl file huge as my database is enormous.  Another possibility is to use Biber or another tool to prepare a document-specific .bib file containing only those entries with the keyword. However, this would need to be recreated if additional entries with the keyword are added to my main database files.  Here's an MWE to play with, annotated to indicate the way I'd like it to work ;), and the disadvantages of the way it (almost) works.  The issue of excluding explicitly cited entries is less of an issue for me. The thing I'd really like to work around is adding the entire database contents to the .bbl.  \RequirePackage{filecontents} \begin{filecontents}{\jobname.bib} @book{new-stuff,     author          =   {Watt, Brian},     title           =   {Happy Times with Penguins},     publisher       =   {Harvard University Press},     address         =   {Cambridge, MA},     year            =   1995,     pagination      =   {section},     keywords        =   {happy}} @book{den-coll,   author                =   {Till, Jr., Dennis E.},     booktitle           =   {Penguin Land and Further North: Human Influence},     title               =   {Penguin Land and Further North: Human Influence},     publisher           =   {Oxford University Press},     year                =   2008,     address             =   {Oxford and New York},     keywords            =   {penguin, human}} @book{old-stuff,   author                =   {Harvey, Jr., Dennis E.},     booktitle           =   {Penguin Land and Further North: Human Influence},     title               =   {Penguin Land and Further North: Human Influence},     publisher           =   {Someone \&amp; Daughters},     year                =   1567,     address             =   {Oxford},     bookpagination      =   {paragraph},     keywords            =   {penguin}} \end{filecontents} \documentclass{article} \usepackage[defernumbers=true]{biblatex} \bibliography{\jobname} \begin{document}  \cite{old-stuff}  % what I would like to work % \nocite[keyword=happy] % \printbibliography  % what does work - except that \cite{old-stuff} is ignored and, more importantly, den-coll is added to the .bbl \nocite{*} \printbibliography[keyword=happy]  \end{document} Series involving log $\sum_{n=1}^{\infty} \left( n\log \left(\frac{2n+1}{2n-1}\right)-1\right) = \frac{1-\log 2}{2}$ How is it possible to use the GNU find command to match several file types at a time (one search command)?  The man page says:  -type c     File is of type c:     b      block (buffered) special     c      character (unbuffered) special     d      directory     p      named pipe (FIFO)     f      regular file     l      symbolic link; this is never true if the -L option or the -follow            option  is in  effect,  unless  the  symbolic link is broken.  If            you want to search for symbolic links when -L is in effect, use            -xtype.     s      socket     D      door (Solaris)   and I want to search for files (f) and symbolic links (l) and pipe it to another process. How can I search for both at the same time?  I have tried  find -type fl | … find -type f -type l | … find -xtype f -type l | …   I know a workaround would be to use a subshell  (find -type f; find -type l) | …   but I just want to know if it is possible. Prove that a non-empty closed convex $S$ has an extreme point iff it does not contain any line I am wondering how to prove the following theorem: Let $S \subset \mathbf{R}^{n}$ be a non-empty closed convex set. Then $S$ has at least one extreme point iff $S$ does not contain any line. Extreme point $x \in S$ means that there is no couple of points $y, z \in S$ and $\lambda \in (0;1)$ such that $x = \lambda y + (1-\lambda)z$. I know that every non-empty closed convex set can be represented as an intersection of all closed half-spaces containing the set but I do not know if it is helpful in proving the theorem. How to render as only wireframe in Cycles? If $f(x)=x-\int^{\frac{\pi}{2}}_0f(x)\sin(x)dx$ find the explicit function for $f(x)$ in its simplest form How can I check if my (unlocked) phone will work with a particular country's SIM cards, for 3G and calls? I've used my phone overseas with local SIM cards a lot, but recently had a surprising experience where one local SIM card simply wouldn't work with my phone but did work first time on my partner's, even though both were similar (unlocked Android phones) and another SIM card from a different local provider did work. Looking into it, it looks like there are various different standards around, but it all gets very technical very quickly.  Is there any simple way of looking up which SIM cards in a particular country will work with a particular model of phone, for calls, texts and internet access? Boot Error - ACPI PCC Probe Failed ACPI PCC Probe Failed is the error that pops up instead of the default GRUB loader after I updated my kernel to 3.19.  I searched around and couldn't find much information except that it is a known error and it is registered in kernel.org's launchpad . My question is, is anyone else facing it?, what are the impacts of this? And if only an update in the future can fix it, any suggestions or safety tips till then? Finding Distribution function from probability density function I'm taking a look at  (now removed), which all seem to be pretty much the same.  Should any be downvoted/flagged, and if so, which ones? How to know (in GCC) when given macro/preprocessor symbol gets declared? Suppose I have #define foo in various header files. It may expand to some different things. I would like to know (when compiling a .cc file) when a #define is encountered, to what it will expand, it which file it is and where it got included from.  Is it possible? If not, are there any partial solutions that may help?  Feel free to add comments with clarification requests.  Edit: current answers seem to concentrate on the case when there is one #define and I just want to jump to definition or know what the definition is. That's the simple case and yes, your solutions work. But when I have the same #define in different files, and want to know which one kicks in first, none of these techniques is useful. Okay, I actually used #warning carefully to find the right place. But this requires much work. Is there a platform-agnostic and filesystem-agnostic method to obtain the full path of the directory from where a program is running using C/C++? Not to be confused with the current working directory. (Please don't suggest libraries unless they're standard ones like clib or STL.)  (If there's no platform/filesystem-agnostic method, suggestions that work in Windows and Linux for specific filesystems are welcome too.) Problem:  If $\gcd(a, b) = 1$ and If $ab = x^2$ ,prove that $a$, $b$ must also be perfect squares; where $a$,$b$,$x$ are in the set of natural numbers  I've come to the conclusion that $a \ne b$ and $a \ne x$ and $b \ne x$ but I guess that won't really help me.. I understand that if the $\gcd$ between two numbers if $1$ then they obviously have no common divisors but where do I go from this point?  Any tips at tackling this would be great. It looks quite easy though I'm still trying to get my hand around these proofs! Any pointers in the right direction would be great.  Thank you in advance, I have a lot of filesystems:   / on a PCI-E SSD swap on a SATA SSD /media/ned is a RAID5 array /tmp lives on RAM Parts of /home/oli are symlinked and bind-mounted in from ned I also have /media/jeff/ which is RAID1 that I store backups and bind-mount ~/.wine in off.   It's actually a lot more complicated than that. There are all sorts of extra symlinks that I need to untangle in the long run but for now I just need a nice way of taking a path and finding out where it physically lives. The following is exercise 8.2 in 3rd edition (and exercise 8.19 in 2nd edition) of Goldstein's Classical Mechanics.   Adding the total time derivative of a function of $q_i$ and t to the Lagrangian will not change the the Euler-Lagrangian equation. So if we make the following change to Lagrangian,   $$L'(q,\dot{q},t) = L(q,\dot{q},t) + \frac{dF(q_1,q_2,...,q_n,t)}{dt}$$ we can get  $$ \frac{d}{dt}\frac{\partial{L'}}{\partial{\dot{q_i}}} - \frac{\partial{L'}}{\partial{q_i}} = 0 $$ from  $$ \frac{d}{dt}\frac{\partial{L}}{\partial{\dot{q_i}}} - \frac{\partial{L}}{\partial{q_i}} = 0 $$  How can we get the corresponding Hamiltonian equation part? This is to prove  $$ \dot{p'_i} = \frac{\partial{H'}}{\partial q_i} $$ $$ -\dot{q_i} = \frac{\partial{H'}}{\partial p'_i}  $$  from   $$ \dot{p_i} = \frac{\partial{H}}{\partial q_i} $$ $$ -\dot{q_i} = \frac{\partial{H}}{\partial p_i}  $$ where $p'_i = \frac{\partial L'}{\partial \dot q_i}$.  Edit  The corresponding $H'$ is $$ H' = \sum_k{p'_k \dot{q_k}} - L' $$ where $p'_k = \frac{\partial L'}{\partial \dot q_k}$. There is an alignment issue in the stackexchange.com search page .  The bottom bar is missing in the search input box.  Sample URL:   Screen shot for reference:    Firefox version: 54.0b8 (32-bit) OS Version: Windows 10 Pro  Also happens with Chrome latest version. 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) Where is the operator panel in Blender 2.8? My current employer has given me the opportunity to design my own GIS workstation. The problem is I have no idea what is important when it comes to hardware! I have been given a datasheet from Fujitsu which includes the latest CELSIUS M720 series workstations but the configuration includes about 30 different processors, graphics cards, and hard drives.  I will be working a lot with the ESRI desktop suite (spatial analyst and 3D analyst) and doing a fair amount of raster processing (DEMs, visibility analysis, etc.), but I also use the GDAL library, SAGA-GIS, Quantum GIS and others.  Does ArcGIS 10 actually use multiple cores?  I have the choice from 4 cores with 8 threads up to 8 cores with 8 threads - 16 threads?  Is SSD SATA III better than HDD SATA III?  The Celsius R920 supports up to 512 GB RAM. But what do I need?  It will probably be the last time I get a new workstation for the next 5 years, so I am curious what others have ordered or feel will be necessary for the coming years. Obviously the cloud isn't taking over as quick as they say! Fred and George stumbled upon the Marauder's map in their first year. They passed it on to Harry while in their fifth year. Also note that, while talking to Harry on the train, Ron described Scabbers as being "Percy's old rat".   Hence, we can safely assume that the twins had the Marauder's Map for about five years. How could they not see Peter Pettigrew on the map, with Percy for first two years and with Ron for the next three years?  How come Harry didn't see Peter? How was Lupin the only one able to see Peter on the map?