JUnit How to handle an expected fail?
JUnit Testing Exceptions
Will links to images be kept permanently when added to a comment and nothing else? I assume, that Stack Exchange have some clean-up subsystem, which deletes all "abandoned" images (stored at i.stack.imgur.com), that is, all of them, that were initially uploaded, but no post is actually having link to them. Am I right?  If such subsystem is implemented and is doing its job on regular basis, then what about following scenario:   Start a new question or answer, anywhere. Hit button and upload an image. Copy generated image's URL  to clipboard. Close tab and drop editing post. Go to question on answer, you actually planned to reply. Post a comment to it and paste copied image's URL from clipboard to comment's body.   Will uploaded image, with URL pasted only to comment, be kept permanent? Does clean-up subsystem (if exitst) take care of checking for image's URLs in comments as well? Is there a simple way to reduce the amount of white space around the TikZ in the MWE pasted below (in particular in the x direction)?  \documentclass{article} \usepackage{xcolor} \usepackage{tikz}  \begin{document} VRCRCRCRCC \tikz[baseline] \node[fill=yellow!30, anchor=base,inner sep=0.7pt, outer xsep=-2pt] {ABCDE}; VBZBZBBBBG \end{document}     PS: This question may be a duplicate of . I posted it nevertheless since 1) my example is much simpler (and hence may have a much simpler solution) and 2) I don't see how the answers given there could help in my case. If you disagree feel free to mark my question as "exact (!) duplicate of ...". bread that does not get moldy How can a bread have an expiration date of one year into the future?? The bread in questions is Deutsche Küche rye bread (from Aldi).  Yes, it is a dense bread, but it is not dry like a cracker, so there seems to be enough moisture for mold to grow.  There are no preservatives.  Edit (pictures added): Can I use the Twig template engine? I do a lot of  development and I like their templating language. , the , looks very much like it.  How can I use Twig in Drupal 7 or even Drupal 6? Ambiguity of "quite" The adverb "quite" has the following meanings :     1: wholly, completely ("not quite   finished")      2: to an extreme : positively "quite   sure" —often used as an intensifier   with a "quite a swell guy" "quite a   beauty"      3: to a considerable extent : rather   ("quite near")   My understanding is that #1 and #2 conflict with #3. For example, when you say "She's quite right", do you mean "She's completely right" or "To a considerable extent, she's right"? Notice that in the latter case you're not saying that she is completely right.  Another example is "I'm quite sure". Does it necessarily mean "I'm completely sure"?   Does the word really have conflicting meanings that can possibly cause ambiguity? Or am I missing something? I agree that every page in a site should have a unique TITLE, and that every page should have one and only one H1 element, but should the text of each H1 be completely unique too?  Instinctively one would think so, but there are potentially many cases where (IMHO) mind this doesn't make sense and attempting to do so will impair the user experience &amp; presentation of the page - for example, where pages are part of a closely related cluster, e.g. a multi-step process/tool/wizard.  Surely the process name should go in the H1 (e.g. "Pregnancy Planner"), and the current step you're on should be marked up as a H2 (e.g. "Step 1 - Trying for a baby"), rather than shoehorning both into a single H1 together (e.g. "Pregnancy Planner - Step 1 - Trying for a baby")?  Not only does this make the H1 rather long and potentially impact the presentation of the page, I would argue that in combining both into one you also lose semantic goodness, as the page is surely semantically richer by keeping parent (process) and child (step) as separate, nested headings?  Furthermore, the current proposal I have read is that on the first page the H1 should be the name of the process and the first step an H2, but on subsequent pages the same text should not be a H1 at all (just text styled exactly the same as an H1) and the current step should become the H1 instead. For me this is introducing unnecessary complexity to the page authoring/production process, and inconsistency in the semantic structure of the pages within the stepped process.  So it all comes back to the basic assertion that each H1 must be completely unique, which I question. Can you convince me that this should be so and that the cost/complexity of implementing this (especially in situations such as that above) is worth it?  Your thoughts please... Do adjustable length lightsabers exist in Star Wars universe? I always see blades of lightsabers have more or less the same length (dual blades are double). Why is that?  Can't a longer or shorter length be advantage in some case?    I am NOT expecting infinite length lightsabers (due to energy issues), but have we seen adjustable length blades in the Canon? Night's Watch deserters are sentenced to death, as we've seen in the very first episode of Game of Thrones. A man dressed all in black is apprehended by Stark men and brought before Lord Eddard Stark. Lord Stark sees him as a deserter and sentences him to die (and then executes that death penalty).  However, there are men of the Night's Watch south of the Wall, on a legitimate mission or on some kind of allowed leave. For instance, we have Benjen Stark visiting Winterfell when the king and his party is there. There is also Yoren, who travels around Westeros in search of new recruits.  I could imagine that the Warden of the North (and other lords in the northern part of Westeros) would have a good idea of who would be allowed further south and whose appearance would raise suspicion. But I reckon the southern lords don't have as many visits from the Night's Watch, so they might not know who would be allowed to be there and who wouldn't.  How would lords who are rather unfamiliar with the specific brothers of the Night's Watch discern deserters from brothers sent out for some reason?  That ends my question, but there is a spoiler from the season 5 finale that continues the question a bit more:      Sam is sent to Oldtown to become a Maester, so he can replace Maester Aemon at Castle Black.  But he is riding together with Gilly (a woman!) and her baby (a baby!), which might raise a lot of suspicion from people who don't know what he is sent out to do.  What prevents southern lords of sentencing Sam as a deserter from the Night's Watch? How to divide LaTeX table cells vertically? I want my table to have separated cells. Basically double lines but I can't figure how to have horizontal lines disconnected. I tried \hline and \cline but those connect too.  This is best I can do:    This is how I want my table to look:   \begin{tabular}{|c||c||c||c|}   \hline   \multicolumn{2}{|c||}{First Cell}&amp;   Second Cell&amp;   Third Cell\\   \hline   \hline   \begin{tabular}{@{}l@{}} Data\\ Data\\ Data\\   \end{tabular}&amp;   \begin{tabular}{@{}l@{}}     Data\\     Data\\     Data\\   \end{tabular}&amp;   \begin{tabular}{@{}l@{}}     Data\\     Data\\     Data\\   \end{tabular}&amp;   \begin{tabular}{@{}l@{}}     Data\\     Data\\     Data\\   \end{tabular}\\    \hline  \end{tabular} What books would you recommend to start learning about software testing I'm trying to learn more about software testing, so I want to know which books you would recommend on this topic Assume   $$\lim_{n\to \infty}{x_ny_n}=0$$  then  $$\lim_{n\to \infty}{x_n}=0$$ or $$\lim_{n\to \infty}{y_n}=0$$  I couldnt find two series who disprove that.. just hint please thanks Can I get a rebate after using my HSA? Why are C character literals ints instead of chars? In C++, sizeof('a') == sizeof(char) == 1. This makes intuitive sense, since 'a' is a character literal, and sizeof(char) == 1 as defined by the standard.  In C however, sizeof('a') == sizeof(int). That is, it appears that C character literals are actually integers. Does anyone know why? I can find plenty of mentions of this C quirk but no explanation for why it exists. PyQGIS couldn't import processing with standalone script I have read post on that problem (). The problem is even with a sys.path.append it couldn't import processing. It's very frustrated. Here the code I used:  #!/usr/bin/python  def main():     layer = QgsVectorLayer('/path/to/file.shp', "BAT","ogr")     QgsMapLayerRegistry.instance().addMapLayers([layer])      # Testing processing     try :         Processing.runalg("qgis:creategrid")     except:         print "Processing module has not been loaded"      #Check the QgsMapLayerRegistry for the layers     print QgsMapLayerRegistry.instance().mapLayers()     # Check if they are valid     print layer.isValid()  if __name__=="__main__":     import sys     from PyQt4.QtGui import *     from qgis.core import *     app = QApplication([])     QgsApplication.setPrefixPath("/usr", True)     QgsApplication.initQgis()      sys.path.append('home/qsuser/.qgis2/python/plugins')      # try to load processing     try:         from processing.core.Processing import Processing         Processing.initialize()      except:         print "unable to load processing"      main()      QgsApplication.exitQgis()   I could load QGIS and layer is valid that's ok, but processing resist to me. I am on Ubuntu 14.04 I use Pycharm to do it.  I tried on terminal with the python console, it raised this error:  Traceback (most recent call last):   File "&lt;stdin&gt;", line 1, in &lt;module&gt;   File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 572, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)   File "/home/qsuser/.qgis2/python/plugins/processing/__init__.py", line 28, in &lt;module&gt;     from processing.tools.dataobjects import *   File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 572, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)   File "/home/qsuser/.qgis2/python/plugins/processing/tools/dataobjects.py", line 35, in &lt;module&gt;     from processing.core.ProcessingConfig import ProcessingConfig   File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 572, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)   File "/home/qsuser/.qgis2/python/plugins/processing/core/ProcessingConfig.py", line 30, in &lt;module&gt;     from PyQt4.QtCore import QPyNullVariant, QCoreApplication, QSettings ImportError: cannot import name QPyNullVariant   I don't know what I am missing.   Settings :  Qgis 2.12.1-Lyon Ubuntu 14.04 Trusty IDE : Pycharm 5 community Processing : 2.12.2   -- Edit -- And with the changes suggest by mathias kuhn  #!/usr/bin/python  def main():     layer = QgsVectorLayer('/path/to/file.shp', "BAT","ogr")     QgsMapLayerRegistry.instance().addMapLayers([layer])      # Testing processing     try :         Processing.runalg("qgis:creategrid")     except:         print "Processing module has not been loaded"      #Check the QgsMapLayerRegistry for the layers     print QgsMapLayerRegistry.instance().mapLayers()     # Check if they are valid     print layer.isValid()  if __name__=="__main__":     import sys     from qgis.core import *             from PyQt4.QtGui import *     app = QApplication([])     QgsApplication.setPrefixPath("/usr", True)     QgsApplication.initQgis()      sys.path.append('home/user/.qgis2/python/plugins')      # try to load processing     try:         from processing.core.Processing import Processing         Processing.initialize()      except:         print "unable to load processing"      main()      QgsApplication.exitQgis() Background I'm working on a time series data set of energy meter readings. The length of the series varies by meter - for some I have several years, others only a few months, etc. Many display significant seasonality, and often multiple layers - within the day, week, or year. One of the things I've been working on is clustering of these time series. My work is academic for the moment, and while I'm doing other analysis of the data as well, I have a specific goal to carry out some clustering. I did some initial work where I calculated various features (percentage used on weekends vs. weekday, percentage used in different time blocks, etc.). I then moved on to looking at using Dynamic Time Warping (DTW) to obtain the distance between different series, and clustering based on the difference values, and I've found several papers related to this. Question Will the seasonality in a specific series changing cause my clustering to be incorrect? And if so, how do I deal with it? My concern is that the distances obtained by DTW could be misleading in the cases where the pattern in a time series has changed. This could lead to incorrect clustering. In case the above is unclear, consider these examples: Example 1 A meter has low readings from midnight until 8AM, the readings then increase sharply for the next hour and stay high from 9AM until 5PM, then decrease sharply over the next hour and then stay low from 6PM until midnight. The meter continues this pattern consistently every day for several months, but then changes to a pattern where readings simply stay at a consistent level throughout the day. Example 2 A meter shows approximately the same amount of energy being consumed each month. After several years, it changes to a pattern where energy usage is higher during the summer months before returning to the usual amount. Possible Directions  I've wondered whether I can continue to compare whole time series, but split them and consider them as a separate series if the pattern changes considerably. However, to do this I'd need to be able to detect such changes. Also, I just don't know if this is a suitable way or working with the data. I've also considered splitting the data and considering it as many separate time series. For instance, I could consider every day/meter combination as a separate series. However, I'd then need to do similarly if I wanted to consider the weekly/monthly/yearly patterns. I think this would work, but it's potentially quite onerous and I'd hate to go down this path if there's a better way that I'm missing.  Further Notes These are things that have come up in comments, or things I've thought of due to comments, which might be relevant. I'm putting them here so people don't have to read through everything to get relevant information.  I'm working in Python, but have rpy for those places where R is more suitable. I'm not necessarily looking for a Python answer though - if someone has a practical answer of what should be done I'm happy to figure out implementation details myself. I have a lot of working &quot;rough draft&quot; code - I've done some DTW runs, I've done a couple of different types of clustering, etc. I think I largely understand the direction I'm taking, and what I'm really looking for is related to how I process my data before finding distances, running clustering, etc. Given this, I suspect the answer would be the same whether the distances between series are calculated via DTW or a simpler Euclidean Distance (ED). I have found these papers especially informative on time series and DTW and they may be helpful if some background is needed to the topic area: Is it possible to add subtitles of a figure which contains subfigures I have a single image which contains two sub-images. I want the following subtitles (a) and (b) to be shown correctly.   In which, left sides is my current image which contains two rectangular. And right sides is my expected result. I found a solution is that we can use subfig package. However, it requires separating the original figure into two subfigure. In that question, I am regarding that we do not need split original figure, I want to write (a),(b) directly below figure. Thanks Current solution is  \begin{figure}[H] \captionsetup{labelfont={bf}}   \centering     \subfloat[]{\centering\includegraphics[scale=0.5]{Fig1a.png}} \\     \subfloat[]{\centering\includegraphics[scale=0.5]{Fig1b.png}}   \caption{This is main figure}   \label{fig:9} \end{figure} If $(a,b)=1$ then prove $(a+b, ab)=1$. Does anyone know if there is an API to get the current monitor state (on or off) in Windows (XP/Vista/2000/2003)?  All of my searches seem to indicate there is no real way of doing this.    tries to use  which according to Microsoft's docs does not work for display devices.   In Vista I can listen to  but I do not seem to get events when the monitor is turned off manually.   In XP I can hook into WM_SYSCOMMAND SC_MONITORPOWER, looking for status 2. This only works for situations where the system triggers the power off.   The WMI Win32_DesktopMonitor class does not seem to help out as well.   Edit: Here is  on comp.os.ms-windows.programmer.win32 indicating there is no reliable way of doing this.   Anyone else have any other ideas? I am looking for a story about the future of mankind, in which most people have been enslaved in a virtual reality. It ends with the revelation that the people are just lying there imagining their lives with their heads in a trough of feed.  It explains that chemists began to create compounds that could be released into the air to manipulate citizens - causing them to live, shop, think as desired by whoever was in charge. Eventually these tools got subtle enough that they could simulate reality using just these airborne compounds.  This was clearly a prescient view of what later became computer-based virtual reality fiction. How to install Windows 8 without the setup DVD that came with my notebook?