Restricting Org Wide Email Addresses based on profile in Apex? I have a class marked 'With Sharing' and a simple method to get all org wide emails to populate in a picklist on my page:  public String getOrgEmails(){     List&lt;OrgWideEmailAddress&gt; orgWideEmails = new List&lt;OrgWideEmailAddress&gt;();      orgWideEmails = [SELECT Id, Address, DisplayName FROM OrgWideEmailAddress LIMIT 50000];      return JSON.serialize(orgWideEmails); }   I had thought that when users set up org wide emails, and specified profiles who could access them, the query would only return org wide emails a user was profiled to have access to.   This is not the case. The query just returns all org wide emails. But, the org wide email address object is very limited and doesn't tell you what profiles have access to it.   Is there any way to actually limit the org wide emails returned by if the executing user has access to it based on profile permissions on the org wide email.   Salesforce is obviously capable of doing this check, which is why they let you set that up. But I cannot see how we are able to do this check in apex.
Identify which OrgWideEmailAddress records are valid for current user I'd like to create a popup list on one of my Visualforce pages, for a user to select from a list of OrgWideEmailAddress records.  My goal is to limit the list to only those records that they're allowed to use.  I'm going to save the selection for use in later automatic emails.  Based on what I've read, I won't be able to send emails to certain OrgWideEmailAddresses:   The address hasn't been verified yet.  I don't see any fields in the schema that appear to show verification state. The address is only available to profiles that the user isn't a member of.  I don't see where the profile list is stored for each record.   Some of my problem could just be due to not understanding the standard objects so well, and perhaps there's a way to get at this through UserInfo, or by making my query on the User object which may have a child relationship to OrgWideEmailAddress since it's listed in the schema viewer of the Force.com IDE.  Here's the test code I'm working with:  for (OrgWideEmailAddress addr : [SELECT DisplayName, Address          FROM OrgWideEmailAddress ORDER BY DisplayName]) {     System.debug( addr.DisplayName + ' &lt;' + addr.Address + '&gt;'); }   I tried creating a new Messaging.SingleEmailMessage and then calling setOrgWideEmailAddressId() on it with each OrgWideEmailAddress Id, in hopes that invalid Ids would throw an exception, but to no avail.  My goal is to modify the test code to provide just the subset of records that the current user will be able to use.
Repeating an equation including its content and number Check if all elements in a list are identical When using a new Windows 8 search bar:    What is the syntax of the search expression? Is it possible to use wildcards like "*", "?" or any other special symbol?  For example, when searching with Google i can use:   '-' (minus) for excluding certain words; "quoted phrase" for exact phrase matching. bibtex and genitive / possessive 's: the proper way to obtain "Kuran's (1989) model" To make sure that we are talking about the same, I would like to post the relevant definitions I know first.  Definitions:  A pair $(G, +)$ where $G$ is a set and  $+: G \times G \rightarrow G$  is called a commutative group if it has all of the following three characteristics:   (associativity): $\forall x,y,z \in G: (x+y)+z=x+(y+z)$ (identity element): $\exists e \in G \forall x \in G: e + x = x = x +e$ (inverse elements): $\forall x \in G \exists x^{-1} \in G: x^{-1} + x = e = x + x^{-1}$ (commutativity): $\forall x,y \in G: x+y=y+x$.     A triple $(\mathbb{K}, +, \cdot)$, where $\mathbb{K}$ is a set and  $+: \mathbb{K} \times \mathbb{K} \rightarrow \mathbb{K}$  $\cdot: \mathbb{K} \times \mathbb{K} \rightarrow \mathbb{K}$  is called a field if it has all of the following three characteristics:   $(\mathbb{K}, +)$ is a commutative group $(\mathbb{K} \setminus \{0\}, \cdot)$ is a commutative group distributive properties: $\forall x,y,z \in \mathbb{K}: x \cdot (y+z) = (x \cdot y) + (x \cdot z)$ and $\forall x,y,z \in \mathbb{K}: (y+z) \cdot x = (y \cdot x) + (z \cdot x)$     $\mathbb{N^+} := 1, 2, 3, 4, 5 ...$ (all positive integers)  $\mathbb{N}_0 := \{0\} \cup \mathbb{N}$ (the natural numbers with zero)  $\mathbb{N}$ can be both: $\mathbb{N^+}$ or $\mathbb{N}_0$.    My question: Does a field exist that has $\mathbb{N}$ as its set?  I know that $(\mathbb{Q}, +, \cdot)$ is a field and I know that $(\mathbb{N}, + )$ is only a commutative semigroup.   But maybe it's possible to define two mappings $\circ, *$ for $\mathbb{N}$ in such a way that $(\mathbb{N}, \circ, *)$ is a field.    Related:     The smallest field containing the integers is the field of rational   numbers.   Source: en-Wikipedia:   I don't know if this is true. If somebody can prove (or at least scribble the proof of) the quote it would be a good answer, I guess. optexp environment error when compiling with XeLaTeX I have troubles with optexp environment. There is a code  \documentclass[pstricks,margin=12pt]{standalone}  \usepackage{pst-optexp}  \begin{document} \begin{pspicture}(3.2,5) \pnodes(0,3){A}(1,3){BS}(3,3){M1}(1,5){M2}(1,1){PD} \psset{mirrortype=extended, mirrordepth=0.2}  \begin{optexp} \beamsplitter[bsstyle=plate, compname=BS](A)(BS)(PD) \mirror[compname=M1](BS)(M1)(BS) \mirror[compname=M2, variable](BS)(M2)(BS) \lens[compname=L](BS)(PD) \optdetector[compname=Det, dettype=diode](BS)(PD) \addtopsstyle{Beam}{beamwidth=0.2, fillstyle=solid,fillcolor=green!20!white} \drawwidebeam(A){BS}{M1}{BS}{M2}{BS}{L}{Det} \end{optexp} \end{pspicture}  \end{document}   and the result is this    and I get "MiKTeX GPL Ghostscript 9.19: Unrecoverable error, exit code 1" error. When I remove optexp environment, so  \documentclass[pstricks,margin=12pt]{standalone}  \usepackage{pst-optexp}  \begin{document} \begin{pspicture}(3.2,5) \pnodes(0,3){A}(1,3){BS}(3,3){M1}(1,5){M2}(1,1){PD} \psset{mirrortype=extended, mirrordepth=0.2}   \beamsplitter[bsstyle=plate, compname=BS](A)(BS)(PD) \mirror[compname=M1](BS)(M1)(BS) \mirror[compname=M2, variable](BS)(M2)(BS) \lens[compname=L](BS)(PD) \optdetector[compname=Det, dettype=diode](BS)(PD) \addtopsstyle{Beam}{beamwidth=0.2, fillstyle=solid,fillcolor=green!20!white} \drawwidebeam(A){BS}{M1}{BS}{M2}{BS}{L}{Det}  \end{pspicture}  \end{document}   the result is     which is correct but optical components are behind beam. I use XeLatex. What am I doing wrong? Which packages are missing? Thank you (example is from manual "Drawing optical experimental setups" where the code works correctly). How do I identify SMD components? (or how do I identify any component) How to set the default format in text_format and hide the select? /**  * Implements hook_form_alter().  */ function MODULE_NAME_form_alter(   &amp;$form,   \Drupal\Core\Form\FormStateInterface $form_state,   $form_id ) {    if ($form_id == 'node_article_form') {     $form["body"]["widget"][0]['#allowed_formats'] = ['full_html']; // Your default format     $form["body"]["widget"][0]['#after_build'][] = 'MODULE_NAME_hide_format';   } }  function MODULE_NAME_hide_format(   &amp;$element,   FormStateInterface $form_state ) {   if (isset($element["format"]["format"])) {     $element["format"]["format"]["#access"] = FALSE;   }    return $element; } I look today on a few fresh question, and the view count was 0. Even after I refreshed the page a few time. This is definitely a bug, since the question isn't mine.  Also I don't think the all page was cached, since that the DateTime mark was change every reload.  But maybe the SQL result is cached. Date api for managing off days in an year? Show path of a body of where it should go after linear impulse is applied I am making a game with Andengine and Box2D. I have a dynamic body and I apply linear impulse on the body to move it around when the user have touched the screen.  Now I want to show the path where the body will go when the user have touched. If you have played Angry Birds or Basket Ball Shoot or any other which have projectile motion with a path shown you will get my point. I want to show the white dots which are shown in those games. How can I read a file even when getting an "in use by another process" exception? I am  new to Linux. I am using Ubuntu 11.04 and do not know how to compile and execute C++ program in it. I need to know the commands to Compile and Execute a C++ program in Linux. How to delete (invalid) files with colon in their name under Windows? I've got a rather large number of files on my Windows drive that have a colon in their name. (These came from unpacking some Unix archives.)   When I try to delete them, Windows (XP) complains that the file does not exist, and refuses to delete it. This happens when trying to delete or rename it from explorer or the command line. Still, chkdsk does not complain about those files nor fix the problem.   Any ideas on how to get rid of them? Fundamental group of the torus I'm trying to get my head round the following calculation of the fundamental group of the torus, using Seifert Van-Kampen (I know it's easier to do this by considering covering spaces, but I'm trying to learn the Seifert Van-Kampen method).   Consider the torus $T$ as the unit square in $\mathbb R^2$ with opposite edges identified. Let $A$ be an open disc (say of radius $1/4$ about the origin), and $\overline{A}$ be it's closure. Let $B$ be complement of $A$, so that $A \cap B = S^1$. Then we have $T = A \cup B$ where $A$ and $B$ are a neighbourhood deformation retract pair, so we can use Van Kampen. It is clear that $\pi_1(A) = \{e \}$ and $\pi_1(A \cap B) = \mathbb Z$. So we need to find $\pi_1(B)$. Observe that $B$ deformation retracts onto the boundary of the square which, after identification, is homeomorphic to $S^1 \vee S^1$; in this way we see that $B$ and $S^1 \vee S^1$ are homotopy equivalent (inclusion in one direction, the retraction in another), and so $\pi(S^1 \vee S^1) = F_2$ (which can be calculated by Van Kampen, or by using the theory of covering spaces). So, by Van Kampen, $\pi_1(T) \cong F_2 *_{\mathbb Z} \{e\}$. This is the quotient of $F_2$ by the normal closure of the image of $l_* : \pi_1(A \cap B) \to \pi_1(B)$ (where $l_*$ is the homomorphism induced from the inclusion map $l : A \cap B \hookrightarrow B$). The following is causing me confusion: The generator of $\pi_1(A \cap B)$ is homotopic in $B$ to a loop of the form $u.v.\overline{u}.\overline{v}$, where $u$ and $v$ represent the two generators of $F_2$. So $\pi_1(T) \cong \langle a,b ; aba^{-1}b^{-1} \rangle$, the free abelian group on two generators.  Any explanation or geometric intuition would be really appreciated. Thanks STM32 & ST-LINK - Cannot connect to MCU after successful programming I have built my own board with STM32F7-45VGT6. I have successfully programmed it with ST-LINK v2 (not the original one though) and now I cannot even connect with MCU.  I use ST-Link Utility from ST and SWD interface. It can be the case that I use SWD pins as output and in my code I set them as GPIO output. Can it be the case?  Nevertheless, I connect my reset pin to GND and set "Connect under reset" option in ST-Link Utility but it doesn't work... What can I do?  On the Internet, I have found something about using BOOT0 Pin, but I don't know exactly... How do I summon a baby mob? In Minecraft Java Edition, one can summon baby zombies and drowned using the IsBaby NBT tag: /summon zombie X Y Z {IsBaby:1b}  Likewise, one can summon baby breedable mobs (Pigs, Cows, etc.) by giving them a negative Age NBT tag (the number of ticks until the mob grows up): /summon cow X Y Z {Age:-100000}  Since NBT is inaccessible from commands in Bedrock Edition, the above commands will not work there. How do I summon baby mobs in Minecraft Bedrock Edition? Guinier regime for form factor Why is it such a good idea to plot the logarithm of the form factor vs $Q^2$ in . It seems arbitrary to me. Obligatory: This is not a duplicate of , which is concerning the much older duplicate closure process.  Have a gander at . Notice anything weird?  The Community♦ user was invoked by the question asker to self-close as a duplicate (presumably of the comment below, which links to ), but the list of duplicates is entirely empty. So it would seem the question asker was able to close their own question as a duplicate of... nothing?  Screenshot, in case the post is altered later:    Any idea what happened here? Reasons why not to update an Ubuntu version to a newer/older kernel version