I have a custom object in salesforce where I want to enforce uniqueness across two lookup fields and a date field.  I do not want to allow two records to have all three of those fields in common, but if any one is different, then it is ok.  Is there an accepted best practice for achieving this?  I've thought of a few ways to accomplish this, but I want to do it "right".   Create another field on the record that is a concatenation of all three fields. Use a workflow rule to populate it every time a record is created and check the unique checkbox on that field. Try to accomplish this with a Validation Rule.  (I've tried a few things here, and didn't have much luck.) Write a full-blown bulkified trigger specifically for this instance.  (This seems like a little bit of overkill to do something so standard)   Any comments on these methods or other ones I haven't thought of would be greatly appreciated.
I have a custom object. I want to put in a business rule so that a combination of two fields must be unique.   So I have Field1 and Field2 and want the combination to be unique:  Field1=4, Field2=7 Field1=4, Field2=8   is ok  But,   Field1=4, Field2=7 Field1=4, Field2=7   is not ok  What is the easiest / best way to do this? Thanks.
Not sure if this option ever existed, but the new QGIS version hides a lot of things somewhere else and this seems so simple that I'm kind of convinced it was possible to do this before. I have quite a large data set with ship tracks. I now want to analyse individual ship tracks (made from point layer with  Plugin). However, it is so crowded that it is hard to look at individual tracks. I don't want to save each single track as a new layer, so I wonder if it is possible to select one track in the Attribute table and display only that one on the map/hide the others? Let $f:\Bbb{R}\to\Bbb{R}$ be a function given by  $$f(x)=\begin{cases} \exp\left(\frac{1}{x^2-1}\right) &amp; \text{if }\vert x\vert\lt 1\\  0 &amp; \text{if }\vert x\vert\geqslant 1  \end{cases}$$  I would like to prove that $f\in C^\infty$, that is, $f\in C^k$ for all $k\in \mathbb{N}$. I think that it can be done by induction on $k$. If $\vert x\vert\gt1$, the problem is trivial. On other points, the base case is the simplest and the only that I'm be able to do. Can someone help me?  Thanks. How did Jaqen H'ghar get caught? Following a recent 9gag post:    Did Jaqen H'ghar end up in that cage because he knew that he would meet and "recruit" Arya, or was it some strange coincidence? Is it described somewhere in the books, or left unexplained? Explicit norm on $\mathcal{C}^0(\mathbb{R},\mathbb{R})$ Do you know an explicit norm on $\mathcal{C}^0(\mathbb{R},\mathbb{R})$? Using the axiom of choice, every vector space admits a norm but have you an explicit formula on  $\mathcal{C}^0(\mathbb{R},\mathbb{R})$?  A related question is: Can we proved that $\mathcal{C}^0(\mathbb{R},\mathbb{R})$ has a norm without the axiom of choice? What are reaching fouls in the NBA? Understanding Tag badges I very recently earned the below badge. But I am sorry, I do not understand it.    It says      Earned at least 100 total score for at least 20 answers in the java tag.   But I have answered 140 questions under Java tag and pretty sure would have earned more than 100 points. Then why did I receive it so late. Currently I have 3.3K points on SO.  Secondly if so, I have answered about 41 questions under Scala tag, then why didn't I receive this badge for Scala? I want to import graphics into my main input file using the macro \includegraphics. It does not work if the filename contains spaces.   also discusses this subject, but there is no solution there.  My compilation routine is latex->dvips->ps2pdf (because of PSTricks). Im trying to get my head around complex integration/complex line integrals. Real integration can be thought of as the area under a curve or the opposite of differentiation. Thinking of it geometrically as the area under a curve or the volume under a surface in 3 dimension is very intuitive.   So is there a geometric way of thinking about complex integration? Or should I just be viewing it as process that reverses differentiation? Or has integration other meanings in complex analysis? Here is an example, could someone explain this to me - Here's the definition of the integral along a curve gamma in C, parameterized by $w:[a, b] -&gt;C$ \begin{equation} \int_\gamma f(z)dz = \int_a^b f(w(t)).w{(t)}'dt \end{equation}   So I have -  $\gamma$ is the unit circle with anti-clockwise orientation parameterized by  $w:[0, 2\pi]\to C$  $w(t) = e ^{it} = Cos(t) + iSin(t)$  So if use the definition of the integral,   $\int_\gamma f(z)dz = \int^b_a f(w(t)).w{(t)}&#39;dt$,  and work this out it comes to  $\int^{2\pi}_0 i dt = 2{\pi}i$  So what does this $2{\pi}i$ represent? Does it mean anything geometrically, like if a regular integral works out to be 10 that means the area under the curve between 2 points is 10... Money from my parents from abroad to my bank account in UK I am from Japan. I have moved to UK recently on a spouse visa.   I still have my Japanese bank account which I have been using even before I came to UK. I have saving in that account and also my parents transfer me some money per month in my bank account in Japan. I have an International Debit Card on this account.  I am withdrawing this Money in UK via ATM / Debit Card.  In this case, do I have to pay taxes in UK or declare this as income in some form. A book in which every species on earth was rendered intelligent The 'blurb' on the back of the book was that something had boosted the intelligence of every creature on earth, to the point that at least some animals were on par with humans. I'm not sure if humans were similarly enhanced or just animals. I'm not sure whether it was done by aliens, or a side effect of something humans did, or what.   This book was on the shelves in the mid/late 1980's, so it's nothing more recent than that. The set of functions which map convergent series to convergent series Suppose $f$ is some real function with the above property, i.e.  if $\sum\limits_{n = 0}^\infty {x_n}$ converges, then $\sum\limits_{n = 0}^\infty {f(x_n)}$ also converges.   My question is: can anything interesting be said regarding the behavior of such a function close to $0$, other than the fact that $f(0)=0$? Is it true that $\mathbb{R}$ and $\mathbb{R}^2$ are isomorphic as abelian groups? I think the answer is yes.   Sketch of the proof Consider $\mathbb{R}$ as a vector space over $\mathbb{Q}$. Let $\{e_\lambda:\lambda\in\Lambda\}\subset\mathbb{R}$ be its Hamel basis. Then $\{(e_{\lambda_1},e_{\lambda_2}):\lambda_1,\lambda_2\in\Lambda\}\subset\mathbb{R}^2$ is a Hamel basis of $\mathbb{R}^2$. Consider set theoretic bijection $i:\Lambda\to\Lambda\times\Lambda$ define map $\varphi:\mathbb{R}\to\mathbb{R}^2$ by its action on element of Hamel basis of $\mathbb{R}$ by equality $\varphi(e_\lambda)=(e_{i(\lambda)_1},e_{i(\lambda)_2})$. This is an isomorphism between $\mathbb{Q}$-vector spaces $\mathbb{R}$ and $\mathbb{R}^2$.  Question Could you tell me is this proof correct, and if it is not, where is the mistake?  EDIT: Thanks to GAJO we found that this proof is wrong. The correct one basis is  $$ \{(e_\lambda,0):\lambda\in \Lambda\}\cup\{(0,e_\lambda):\lambda\in\Lambda\} $$ So we had to look at bijections of the form $i:\Lambda\to\Lambda\coprod\Lambda$ and the desired linear operator is defined by equalities $\varphi(e_\lambda)=(e_{i(\lambda)},0)$ if $i(\lambda)$ lies in the first copy $\Lambda$ and $\varphi(e_\lambda)=(0,e_{i(\lambda)})$ otherwise. I have noticed that the smackpacks say on the package that the package is meant for a 5 gal. batch and that you should pour the pack directly into the wort.   On the otherhand - nearly everyone tells me to always make a starter.   Is this just because making a starter never hurts or does the package contain wrong instructions?   I would have guessed that the yeast producers would tell you on the package if you should need some extra steps to get a good product. How do you keep parents of floated elements from collapsing? Although elements like &lt;div&gt;s normally grow to fit their contents, using the float property can cause a startling problem for CSS newbies: If floated elements have non-floated parent elements, the parent will collapse. For example:   &lt;div&gt;   &lt;div style="float: left;"&gt;Div 1&lt;/div&gt;   &lt;div style="float: left;"&gt;Div 2&lt;/div&gt; &lt;/div&gt;    The parent div in this example will not expand to contain its floated children - it will appear to have height: 0. How do you solve this problem? I would like to create an exhaustive list of solutions here. If you're aware of cross-browser compatibility issues, please point them out. Solution 1 Float the parent.   &lt;div style="float: left;"&gt;   &lt;div style="float: left;"&gt;Div 1&lt;/div&gt;   &lt;div style="float: left;"&gt;Div 2&lt;/div&gt; &lt;/div&gt;    Pros: Semantic code. Cons: You may not always want the parent floated. Even if you do, do you float the parents' parent, and so on? Must you float every ancestor element? Solution 2 Give the parent an explicit height.   &lt;div style="height: 300px;"&gt;   &lt;div style="float: left;"&gt;Div 1&lt;/div&gt;   &lt;div style="float: left;"&gt;Div 2&lt;/div&gt; &lt;/div&gt;    Pros: Semantic code. Cons: Not flexible - if the content changes or the browser is resized, the layout will break. Solution 3 Append a &quot;spacer&quot; element inside the parent element, like this:   &lt;div&gt;   &lt;div style="float: left;"&gt;Div 1&lt;/div&gt;   &lt;div style="float: left;"&gt;Div 2&lt;/div&gt;   &lt;div class="spacer" style="clear: both;"&gt;&lt;/div&gt; &lt;/div&gt;    Pros: Straightforward to code. Cons: Not semantic; the spacer div exists only as a layout hack. Solution 4 Set parent to overflow: auto.   &lt;div style="overflow: auto;"&gt;   &lt;div style="float: left;"&gt;Div 1&lt;/div&gt;   &lt;div style="float: left;"&gt;Div 2&lt;/div&gt; &lt;/div&gt;    Pros: Doesn't require extra div. Cons: Seems like a hack - that's not the overflow property's stated purpose. Comments? Other suggestions? I have searched the web a lot and could not find an answer that fits my situation. Here are two links that are quite contradictory:       My situation:  I've visited Portugal in December 2012 for 29 days on a Schengen visa valid from December 1st, 2012 to February 1st, 2013 for research purposes (I am a Ph.D. student). I want to visit Sweden from February 10th, 2013 to May 10th, 2013 (89 days). I have applied for a Schengen visa again (for research). How will the 90/180 rule work in my situation? GIS Point or discrete longitude and latitude columns? Why are all snaps being mounted and listed as block devices or partitions for Ubuntu 18.04? As of Ubuntu 18.04 running lsblk shows 16 snap loops (2-3 times for each snap). The question is, why are they being listed as results for lsblk, fdisf-l, and blkid?    It creates a lot of clutter from the actual disks drive partitions I need to see, namely /dev/ partitions. I know a purported duplicate of this question exists, but it only asks why three loops are being listed per snap. I want to know why these snaps are being listed in the first place, and the purported duplicate does not answer this (perhaps those marking this as duplicate could help me by explaining why it is a duplicate). Technically, they qualify as file systems (which I neither created nor asked for), but they are getting in the way of the information output for the /dev/ partitions I am interested in. This becomes a problem when fdisk -l outputs a three page+ list filled mainly with snaps.  The output of a recent (1 week old) Ubuntu install and I have not installed any snaps:    $ lsblk   NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT   loop0    7:0    0  14.5M  1 loop /snap/gnome-logs/37   loop1    7:1    0   2.3M  1 loop /snap/gnome-calculator/170   loop2    7:2    0  86.6M  1 loop /snap/core/4486   loop3    7:3    0  86.6M  1 loop /snap/core/4650   loop4    7:4    0   1.6M  1 loop /snap/gnome-calculator/154   loop5    7:5    0  14.5M  1 loop /snap/gnome-logs/34   loop6    7:6    0   3.3M  1 loop /snap/gnome-system-monitor/36   loop7    7:7    0   2.3M  1 loop /snap/gnome-calculator/178   loop8    7:8    0    13M  1 loop /snap/gnome-characters/101   loop9    7:9    0   3.7M  1 loop /snap/gnome-system-monitor/45   loop10   7:10   0 139.5M  1 loop /snap/gnome-3-26-1604/64   loop11   7:11   0   140M  1 loop /snap/gnome-3-26-1604/59    loop12   7:12   0   3.7M  1 loop /snap/gnome-system-monitor/41   loop13   7:13   0    21M  1 loop /snap/gnome-logs/25   loop14   7:14   0  12.2M  1 loop /snap/gnome-characters/69   loop15   7:15   0    13M  1 loop /snap/gnome-characters/96   sda      8:0    0 298.1G  0 disk   ├─sda1   8:1    0   512M  0 part /boot/efi   └─sda2   8:2    0 297.6G  0 part /   sr0     11:0    1  1024M  0 rom     (supplemental screen capture of above text):     My snap list shows 6 results:       core   gnome-3-26-1604   gnome-calculator   gnome-characters   gnome-logs   gnome-system-monitor     Meanwhile, gnome-disk-utility shows nothing at all for snaps, only showing my HDD and optical drive.    It won't be very efficient if every installed snap gets listed as a block device (2-3 times each to add). Should I expect future updates to deal with this?  Edit: fdisk-l also dumps out a very long list with 16 instances of these "disk loops" (Disk /dev/loop0, Disk /dev/loop1, etc., each with details which I won't show here because it's too long). This can't be intended behaviour, can it? blkid also lists 16 loops, as TYPE="squashfs". At least parted -l works as expected, only outing my actual disk partitions.    I just tested this, and installing more snaps does add more to the lsblk output. Therefore, fdisk, lsblk, blkid could have potentially huge output lists, according to the number of snaps available, and installed. biblatex: change name of author according to language? Usually a name stays the same in whatever language. So, whenever I quote a work by Knuth -- be it in an English article or a German one -- I will quote him as Donald E. Knuth.  This is not always the case with ancient or medieval names. They are spelled differently in different languages. Two examples in English | German | French:   Aristotle | Aristoteles | Aristote Thomas Aquinas | Thomas von Aquin | Thomas d'Aquin   This means that when I write an English article, I need a bib-file that contains the English names, but when I want to write a German article, I need to go through my bib file and change the names accordingly. Depending on how often I in fact publish in English or German this could keep me busy and is prone to error.  So, I though, maybe I could have the different names already included in one single bib-file and let biblatex choose the correct name according to the primary language used in the document. Any ideas?  NB: I do not want to use in one single document both spellings Aristotle and Aristoteles (as the following MWE might make you think). Of course, if the article's primary language is English, then all the references to Aristotle will use the English spelling of his name. However, I want to be able to write articles in different languages, without (a) having to edit my bib-files each time or (b) generally maintaing not one single bib-file but two different ones, one for each language, or (c) having two distinct entries in one bib-file  MWE  % !TEX TS-program = lualatexmk \documentclass{scrartcl}  \usepackage{fontspec}         \setmainfont[Ligatures=TeX]{Times New Roman}  \usepackage[ngerman, british]{babel} \usepackage[babel]{csquotes} \usepackage[style=verbose,abbreviate=false,backend=biber]{biblatex}  \usepackage{filecontents}  \begin{filecontents}{\jobname.bib} @book{aristotle:ross:1924,     Author = {Aristotle},    % It is here, I think, that something could be done, e.g., ...     Title = {Metaphysics},     % ... british=Aristotle,ngerman=Aristoteles,french=Aristote     Editor = {William David Ross},     Commentator = {William David Ross},     Introduction = {William David Ross},     Hyphenation = {british},     Location = {Oxford},     Publisher = {Clarendon Press},     Volumes = {2},     Year = {1924}} \end{filecontents}  \addbibresource{\jobname.bib}  \begin{document}  \selectlanguage{british} Some English text.\footcite{aristotle:ross:1924}  \selectlanguage{ngerman} Etwas Text auf Deutsch.\footcite{aristotle:ross:1924}  \end{document} I want to make a generic class that accepts only serializable classes, can it be done with the where constraint?  The concept I'm looking for is this:  public class MyClass&lt;T&gt; where T : //[is serializable/has the serializable attribute] Formula for coordinates (lat, lon), azimuth and distance. I would like to know how to find a set of coordinates on a small circle some distance from another point.   For example, lets say A = (39.73, -104.98) #Denver  B = (39.83, -106.06) #point approximately 50 nautical miles away from A along the great circle track to C  C = (40.75, -111.88) #Salt Lake City, approximately 323 nautical miles away from A  How do I get the set of orange coordinates when I don't know the angle but I do know the cross track distance?  For concreteness, lets say the outer points near B have a cross track distance of +- 30 nautical miles and the inner points have a cross track of +- 15nm.  And the points near C have a cross track of +- 25 nm.  Also I have an initial bearing from A to C of -1.34 #radians