Integration By Parts of Gamma Function
Help evaluating a gamma function
iPhone 5S, LTE does not work Why does boiling water in the microwave make a cup of tea go weird? When I boil water in the kettle, it makes a nice cup of tea.  Sometimes I need to use a microwave because a kettle isn't available.  I boil the water in the mug and it looks pretty normal, but when I drop in the teabag the water froths up and looks foamy.  I don't see what the chemical difference is here, so I assume it must be some physical difference.  I have noticed this with multiple types of tea and multiple microwaves, the results being consistent so it's not just a weird microwave or something like that.    What is the reaction here and how/why does it occur?  Here is a photo of the 'fizzy' looking tea just after dunking in the teabag. When, if ever, should voting override answer acceptance for answer sorting? The accepted answer always appears at the top of the list, regardless of sort order. This can be misleading if the question author accepted an invalid solution and a better solution was proposed later, and eventually got more votes. I have seen somewhat obscure questions where the accepted answer has a negative score and the next answer has 10 or more up-votes. Prison problem: locking or unlocking every $n$th door for $ n=1,2,3,...$ When ssh'ing, how can I set an environment variable on the server that changes from session to session? I wrote a script to create a big number of heat maps for a given scenario. I would like to save the result of every heat map as an PNG image. I have figured it out doing it with simple Map Rendering but the quality of the result is too low. Furthermore I would like to export to OpenLayers using the same code, which does not seem to be possible with simple rendering.   Now I am trying to do it with QgsComposition instead. Manually in the Map Composer you can just set the paper color to transparent and disable the background of the map canvas.   This is the code that I have so far. I just cannot figure out why it is not working. The result png-file always has a white opaque background.   My OS is Windows 7 and I'm using QGIS 2.6 Brighton.  I hope someone can help me out here.  # PARAMETERS mainPath = 'path/to/folder/' filename = 'filename' imageType = "png" imageWidth_mm = 400 imageHeight_mm = 160 dpi = 300  mapRenderer = iface.mapCanvas().mapRenderer()  c = QgsComposition(mapRenderer) c.setPlotStyle(QgsComposition.Print)  c.setPaperSize(400, 160)  x, y = 0, 0 w, h = c.paperWidth(), c.paperHeight() composerMap = QgsComposerMap(c, x ,y, w, h) c.addItem(composerMap)  # get all items and disable the backgrounds itemList = c.items() c.removeItem(itemList[2]) c.removeItem(itemList[2]) itemList[2].setBackgroundEnabled(False) itemList[3].setBackgroundEnabled(False) # add them to the composition c.addItem(itemList[2]) c.addItem(itemList[3])  c.refreshItems() c.refreshDataDefinedProperty(QgsComposerObject.AllProperties)  c.setPrintResolution(dpi) dpmm = dpi / 25.4 width = int(dpmm * c.paperWidth()) height = int(dpmm * c.paperHeight())  # create output image and initialize it # image = QImage(QSize(width, height), QImage.Format_ARGB32) image = QImage(QSize(width, height), QImage.Format_ARGB32_Premultiplied) image.setDotsPerMeterX(dpmm * 1000) image.setDotsPerMeterY(dpmm * 1000) #image.fill(0)  imagePainter = QPainter(image)  # This part does not seem to have any effect #brush = QBrush(Qt.BrushStyle(0)) # transparent brush # #imagePainter.setBackgroundMode(0) #c.setBackgroundBrush(brush)  c.renderPage( imagePainter, 0 ) imagePainter.end()   imageFilename =  mainPath + filename + '.' + imageType image.save(imageFilename, imageType) print 'image saved' print 'done' Riemann and Darboux Integral of a product of two functions I have a bunch of Spring beans which are picked up from the classpath via annotations, e.g.  @Repository("personDao") public class PersonDaoImpl extends AbstractDaoImpl implements PersonDao {     // Implementation omitted }   In the Spring XML file, there's a  defined:  &lt;bean id="propertyConfigurer"    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;     &lt;property name="location" value="/WEB-INF/app.properties" /&gt; &lt;/bean&gt;    I want to inject one of the properties from app.properites into the bean shown above. I can't simply do something like   &lt;bean class="com.example.PersonDaoImpl"&gt;     &lt;property name="maxResults" value="${results.max}"/&gt; &lt;/bean&gt;   Because PersonDaoImpl does not feature in the Spring XML file (it is picked up from the classpath via annotations). I've got as far as the following:  @Repository("personDao") public class PersonDaoImpl extends AbstractDaoImpl implements PersonDao {      @Resource(name = "propertyConfigurer")     protected void setProperties(PropertyPlaceholderConfigurer ppc) {     // Now how do I access results.max?      } }   But it's not clear to me how I access the property I'm interested in from ppc? New "[tag:" syntax interferes with Markdown links Links in [link text][number] format don't work properly if they follow a tag using the new [tag:tagName] format. Here's the result of [tag:python] [gold badge page][1]:      [gold badge page]   Putting the tag inside the link is worse. Here's the result of [[meta-tag:bug] some text][2], where [2] is google.com:        The part of the link outside the tag just disappears silently.  EDIT: To be more precise, the entire link to [2] disappears. The markup that is produced contains (invalid) nested anchor tags, as shown here from Firefox's "View Source":  &lt;a href="http://google.com" rel="nofollow"&gt;&lt;a href="/questions/tagged/bug" class="post-tag required-tag" title="show questions tagged 'bug'" rel="tag"&gt;bug&lt;/a&gt; some text&lt;/a&gt;   So the tag is still a link, but it is a link to the tag page, which is the behavior it would have if the link to [2] didn't exist at all. The user's desired behavior in this case is... ambiguous, to be charitable.  EDIT 2: I briefly included markup from Firebug here, but it turned out to be irrelevant. It has now been removed to improve readability. See  if you're interested. I have just installed Ubuntu 16.04 32-bit.   When I opened its software store, I found that it's not showing the apps I installed in Ubuntu 15.10 like Clementine, Gdebi package installer or synaptic package manager, dconf, acetoneiso etc.   I need these applications. How can I install them? I'm quite confused about the following regular expressions I found in a shell script:  ${0##*/} ${0%/*}   How do they work? Why are imported PDFs blurry in InDesign? Add comment length counter on the mobile site I know that comments have to be at least 15 chars for the system to post it. I noticed that on the mobile site, there is no "x chars to go..." warning.  If I try to post a comment that is too short, it silently fails and still no mention of minimum length at all.  Can the length counter that is present in the full site theme be added to the mobile theme please? Entry to The US before 30-day grace period for student visa The F student visa allows me to enter the US up to 30 days before the program starts. For starting to set up things it is of my interest to arrive sooner than that. How hard is it to travel there beforehand with a tourist visa (waiver) and leave to, say Mexico, to then re enter on a proper date within the 30 days with the student visa? This seems easier than requesting for a status change inside the US from tourist to student.. How to install Ubuntu 18.04 alongside Windows 10 Wacom Tablet - Illustrator brush tool I currently got the intuos art wacom tablet so still learning how to use it. I'm currently in illustrator trying to draw out a map and the brush tool is doing something weird and I cannot figure out why. You can see in my image that where there are curves the black slightly spills over and is filling in half the curve with black. Brush setting is set up as a new calligraphic brush and the size is set to pressure, 3pt-3pt. using Ajax with 3 consecutive drop down lists depending on eachother How to duplicate sys.stdout to a log file? Edit: Since it appears that there's either no solution, or I'm doing something so non-standard that nobody knows - I'll revise my question to also ask: What is the best way to accomplish logging when a python app is making a lot of system calls?  My app has two modes.  In interactive mode, I want all output to go to the screen as well as to a log file, including output from any system calls.  In daemon mode, all output goes to the log.  Daemon mode works great using os.dup2().  I can't find a way to "tee" all output to a log in interactive mode, without modifying each and every system call.    In other words, I want the functionality of the command line 'tee' for any output generated by a python app, including system call output.  To clarify:   To redirect all output I do something like this, and it works great:  # open our log file so = se = open("%s.log" % self.name, 'w', 0)  # re-open stdout without buffering sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)  # redirect stdout and stderr to the log file opened above os.dup2(so.fileno(), sys.stdout.fileno()) os.dup2(se.fileno(), sys.stderr.fileno())   The nice thing about this is that it requires no special print calls from the rest of the code.  The code also runs some shell commands, so it's nice not having to deal with each of their output individually as well.  Simply, I want to do the same, except duplicating instead of redirecting.  At first thought, I thought that simply reversing the dup2's should work.  Why doesn't it?  Here's my test:   import os, sys  ### my broken solution: so = se = open("a.log", 'w', 0) sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)  os.dup2(sys.stdout.fileno(), so.fileno()) os.dup2(sys.stderr.fileno(), se.fileno()) ###  print("foo bar")  os.spawnve("P_WAIT", "/bin/ls", ["/bin/ls"], {}) os.execve("/bin/ls", ["/bin/ls"], os.environ)   The file "a.log" should be identical to what was displayed on the screen. How to install the latest versions of NodeJS and NPM? I noticed over at the  website that node is currently at v 0.12.0.  Can someone let me know how to install the latest version of node together with npm (terminal commands please)? Linux: coloring bash prompt will break carriage return When I try to colorize the bash prompt like this:  export PS1="\e[0;31m[\u@\h \W]\$ \e[m "   it breaks the carriage return (instead of going to a new line when line is full, it starts in the same line and erases the input text).  If I remove the color sequence it works fine. I use Ubuntu 11.10 and terminal (guake has the same bug too).