I want to draw a set like :    but don't know how to do it. I mean, how to put an object inside the set.
What I am up to is to write some exercises dealing with logical formulas for my students, like:     And the students should draw these formulas on . At the end of the lesson, I really would like to print the correct answer for them. I found a great resource on a forum thread at , which helped me a lot to make up some Venn diagrams with tikz, but have some problems with visualizing complements, like ~A.  A simple, modified version of the TeX file found on the forum linked above, can be seen below, which produces the following expression:    \documentclass{letter}   \usepackage{tikz}   \def\firstcircle{(90:1.75cm) circle (2.5cm)}   \def\secondcircle{(210:1.75cm) circle (2.5cm)}   \def\thirdcircle{(330:1.75cm) circle (2.5cm)}   \begin{document}     \begin{tikzpicture}       \begin{scope}     \clip \secondcircle;     \fill[cyan] \thirdcircle;       \end{scope}       \begin{scope}     \clip \firstcircle;     \fill[cyan] \thirdcircle;       \end{scope}       \draw \firstcircle node[text=black,above] {$A$};       \draw \secondcircle node [text=black,below left] {$B$};       \draw \thirdcircle node [text=black,below right] {$C$};     \end{tikzpicture}   \end{document}   Which looks like:    Could anyone please help me out plotting/defining some expressions dealing with complements? A nice example could be:    That should look like: (image from )    I do not insist on the red color :)  I would like to use the simplest possible solution, as I would like to mass generate the exercises with the help of . So any suggestion dealing with gnuplot, R or any other opensource packages is welcome. Thank you!    UPDATE (25/01/2011): added details based on answers.  Thank you @Leo Liu, you helped me a lot! I modified a bit the code you suggested to be able to color the area outside of the two circles also (in the H universe), but have no idea how to set a background to that polygon also. The code:  \begin{tikzpicture}[fill=gray] % left hand \scope \clip (-2,-2) rectangle (2,2)       (1,0) circle (1); \fill (0,0) circle (1); \endscope % right hand \scope \clip (-2,-2) rectangle (2,2)       (0,0) circle (1); \fill (1,0) circle (1); \endscope % outline \draw (0,0) circle (1) (0,1)  node [text=black,above] {$A$}       (1,0) circle (1) (1,1)  node [text=black,above] {$B$}       (-2,-2) rectangle (3,2) node [text=black,above] {$H$}; \end{tikzpicture}   And the image generated:    I will also look for even odd rule in the near future which does not make sense for me at the moment but looks really simple and promising!
Print lines between (and including) two patterns 403 Forbidden with Java but not web browser? A stochastic process is a process that evolves over time, so is it really a fancier way of saying "time series"? In-universe explanation for single line of planetary entry/departure in Star Wars Why are planetary blockades confined to a single point of a planet instead of being sphere shell shaped around the planet? (I know, it would take an awful lot of spaceships.)  Also, when a rebel ship wants to escape from a planet and there is a single star destroyer hovering in the atmosphere (or some more of them further up, like in the Empire Strikes Back) how come it's not a viable maneuver to fly low altitude for a couple of hundred kilometers horizontally (they would be out of the single-point blockade), then make a vertical dash upwards? Proving the Cauchy-Schwarz inequality by induction I ran across this problem in some old notes, and I frustratingly can't figure out how to do it   Let $a_i$ and $b_i$ be sequences of natural numbers, use induction to show  $\sum_{i=1}^n (a_ib_i)^{1/2} \le (\sum_{i=1}^n a_i)^{1/2}(\sum_{i=1}^n b_i)^{1/2} $  Obviously this is trivial to show for n=1. I can't make much progress on n+1. I've tried various tactics, squaring both sides etc.   Any hint or help would be appreciated. Thanks. "No root filesystem is defined" while installing Ubuntu I have just got a new laptop, It is running Windows 7 Home Premium.  I have shrunk the windows partition to give me some empty space and now I want to install ubuntu.  From Windows my partitions look like:   So now in the ubuntu live cd If I hit install and go manual the partitioner looks like   So I thought I could just select the empty space and be away laughing, but when I hit it I get Is there a word for four times as much, analogous to once, twice, and thrice? How do I tell a Python script to use a particular version While looking at online code samples, I have sometimes come across an assignment of a String constant to a String object via the use of the new operator.  For example:  String s; ... s = new String("Hello World");   This, of course, compared to  s = "Hello World";   I'm not familiar with this syntax and have no idea what the purpose or effect would be.  Since String constants typically get stored in the constant pool and then in whatever representation the JVM has for dealing with String constants, would anything even be allocated on the heap? Interior of closure of open set in topological space If $U$ is an open set in a topological space, is it true that $U$ is the interior of the closure of itself?   If $U$ is open, it must be the interior of itself. But is it the interior of the closure of itself? In the closure, we include all points $x$ such that any open set containing $x$ also contains a point in $U$. In the interior of the closure, we take the union of all open sets contained in the closure. Hide c# windows application source code I wrote a windows application using C# .Net 2.0 and i want to do something which hide the source code, so when any one use refactor tool can't see the source code. I used dotfuscator but it just changed the function names but not all the source code.  UPDATE: I want to hide the source code, not because of hiding the key, but to hide how the code is working.  Thanks, So what does Cyanogen Inc shutting down mean for CyanogenMod and similar ROMs? So Cyanogen Inc (cyngn), known for their support for their support for CyanogenMod and their efforts to integrate Cyanogen OS into devices such as the OnePlus One, Alcatel POP Mirage, and . Cyanogen Inc just recently .  What does this mean for CyanogenMod, Cyanogen OS, and the devices which originally shipped with Cyanogen OS? Will they no longer receive OTA updates? Background Video is shown in Rendered mode but not when szene is rendered Embed data in a C++ program Segmentation fault error occurs for a simple function I have coded I’ve had a good look and can’t seem to find out how to select all elements matching certain classes in one jQuery selector statement such as this:  $('.myClass', '.myOtherClass').removeClass('theclass');   Any ideas on how to achieve this? The only other option is to do  $('.myClass').removeClass('theclass'); $('.myOtherClass').removeClass('theclass');   But I’m doing this with quite a few classes, so it requires much code. Why is median age a better statistic than mean age? If you look at       Or this Wikipedia page      Clearly  seems to be the statistic of choice when it comes to ages.  I am not able to explain to myself why  would be a worse statistic. Why is it so?  Originally posted  because I did not know this site existed. Masking NetCDF time series data from shapefile using Python I have a 3-D time-series precipitation data (187 x 1800 x 3600), stored in a NetCDF file. I need to obtain the precipitation data for a shapefile. import matplotlib.pyplot as plt from netCDF4 import Dataset, num2date,  from matplotlib.pyplot import figure from datetime import datetime, date, timedelta import numpy as np import xarray as xr import pandas as pd import geopandas as gpd       MSWEP_monthly = 'D:\G3P\DATA\Models\MSWEP\MSWEP_monthly.nc4'  MSWEP_monthly = Dataset(MSWEP_monthly, 'r') Pre_MSWEP = MSWEP_monthly.variables['precipitation'][:]   MSWEP_monthly2 = xr.open_dataarray('D:\G3P\DATA\Models\MSWEP\MSWEP_monthly.nc4')  Lon_MSWEP = MSWEP_monthly2.lon Lat_MSWEP = MSWEP_monthly2.lat  Africa_Shape = gpd.read_file('D:\G3P\DATA\Shapefile\Africa_SHP\Africa.shp')    from osgeo import gdal,osr,ogr  def makeMask(lon,lat,res):     source_ds = ogr.Open(shapefile)     source_layer = source_ds.GetLayer()       # Create high res raster in memory     mem_ds = gdal.GetDriverByName('MEM').Create('', lon.size, lat.size, gdal.GDT_Byte)     mem_ds.SetGeoTransform((lon.min(), res, 0, lat.max(), 0, -res))     band = mem_ds.GetRasterBand(1)       # Rasterize shapefile to grid     gdal.RasterizeLayer(mem_ds, [1], source_layer, burn_values=[1])       # Get rasterized shapefile as numpy array     array = band.ReadAsArray()        mem_ds = None     band = None     return array  shapefile = 'D:\G3P\DATA\Shapefile\Africa_SHP\Africa.shp' source_ds = ogr.Open(shapefile)  # calculate the cellsize cellsize = Lon_MSWEP[:][1] - Lon_MSWEP[:][0]   # create the mask mask = makeMask(Lon_MSWEP,Lat_MSWEP,cellsize)  Now if I implement the following code, the precipitation data for the first day (from the time-series) can be obtained with shape of 1800x3600: precip = np.ma.masked_where(mask==0,Pre_MSWEP[0,:,:])  I tried to use a for loop to mask the precipitation data for the entire time series (time, lon, lat) over the area of interest. however, the below code gives me a 2-D data, probably for the last day. Why is that? for i in range(len(Pre_MSWEP)):     precip = np.ma.masked_where(mask==0,Pre_MSWEP[i,:,:]) How to repair a broken .EXE file association After (hopefully) scrubbing viruses out of a Windows 7 installation (after deciding not to simply run over the laptop repeatedly with my car), I've got everything almost back to normal. The only lingering issue I have is that for my non-admin users, the ".exe" file extension doesn't work. That is, clicking on the various desktop application links results in a "How do you want to open this?" dialog.  I've been through the alleged registry fixing from "winhelponline" and that had absolutely no effect.  I've tried running "assoc" for the affected users, but it reports the .exe association to be "exefile" even though it persistently does not work.  Right-clicking on a desktop icon and then choosing "start" does successfully open an application, but that's clearly a terrible situation.  For my admin user, things seem to work fine.  What do I need to do to get things working? How does ADR (Automated Dialogue Replacement) work?  There's an entry in Wikipedia that says what it is (essentially actors dubbing their lines in post production, sometimes requiring several takes) but I don't see what's "automatic" about it.  It doesn't seem to work all that well because I can almost always tell when it has been used.