Is there a way to edit a Connected App from Apex code? I'm looking for a way to edit some fields from a Connected App using Apex code. Is there a way to do it? For example, I want to add a Profile to the 'Connected App Allowed Profiles List'. Thank you in advance!
Is it possible to programmatically change connectedApp settings in production? Background: I have a requirement to make it so that an SFDC connected app defaults/is super easy to set to Admin Users are Pre-authorized instead of All users may self-authorize. This setting is important to make this app work and we have historically have had problems with admins not configuring this setting correctly.  Here is a quick history on what I have tried to do to get the isAdminApproved set to "true":   Directly, via xml definition (doesn't get honored) Directly via apex code (doesn't get honored)  (ended up being more pain than what it was worth and was told that it wouldn't work in prod because of security restrictions) Indirectly via a connected-app connected service to make a metadata API call: works in a scratch org but not in prod, which I assume is because it is a managed package. This would occur when an Admin clicks on a button, not from a post-install script.   Details on what I mean by it isn't working in prod: When I try to do a readMetadata call on my connectedApp objects that are in my managed package, the response comes back as [{\n    'fullName': None\n}] instead of with the metadata configuration of my connected app.  Here is a sequence diagram of what I am trying to do in #4 right now:    My question is this: Am I on a fool's errand, where this is impossible to do? ...Or is there a way to set a connected app (in a managed package that I publish) to Admin Users are Pre-authorized without making the admin just do it themselves directly in the settings?
How can I deploy a connected app from my sandbox environment to my production environment? I built a changeset and I was able to include all my classes, but it was a surprise that salesforce has not provided any option to deploy a connected app.  So how do I go about deploying a connected app? Do I need to create it in every other environment? Setting or modifying a (system wide) environment variable in cmd.exe I am looking for a convenient way to add and/or modify and/or delete an environment variable from the command line. Particularly, I find myself at times in situations when I have to add a few variables in cmd.exe.  I'd be grateful if someone showed me a non-GUI way to modify (that is: to add a new directory to) the %PATH% variable.  The change should be be permanent, not just for duration of the cmd session. A worker carries two bags. Each of the bags initially contains N nails. Whenever the worker needs a nail, he takes it from a bag picked at random. At some point the worker picks an empty bag. Find the probability that the other bag contains exactly m nails.  My reasoning:  The desired probability: $C_2^1 \cdot P(|A| = 0\ and\ |B| = m)$, where A, B - sets of nails in each bag. Then we can "divide" this probability (I suppose that I deal with independent events):  $P(|A| = 0\ and\ |B| = m) = P(|A| = 0) \cdot P(|B| = m);$  $P(|A| = 0) = (\frac{1}{2})^N$, where $|A| = |B| = N$ (initial condition).  $P(|B| = m) = (\frac{1}{2})^{N - m}$  Result: $C_2^1 \cdot P(|A| = 0\ and\ |B| = m)$ = $C_2^1 \cdot (\frac{1}{2})^{2N - m}$  Am I wrong or it is correct? General identity for a double summation theorem I've been reading a research paper, and I'm interested in generalizing a certain theorem but I can't seem to understand how the following results are derived:  $$\sum_{i=1}^{n}\sum_{j\neq i}^n \frac{1}{z_i-z_j}=0$$  $$\sum_{i=1}^{n}\sum_{j\neq i}^n \frac{z_i}{z_i-z_j}=\frac{1}{2}n(n-1)$$ $$\sum_{i=1}^{n}\sum_{j\neq i}^n \frac{z_i^2}{z_i-z_j}=(n-1)\sum_{i=1}^n z_i$$ $$\sum_{i=1}^{n}\sum_{j\neq i}^n \frac{z_i^3}{z_i-z_j}=(n-1)\sum_{i=1}^n z_i^2 + \sum_{i&lt;j}^n z_i z_j$$ asp.net mvc put controllers into a separate project I have two servers (both servers are on Windows OS):   Server_A running Oracle 12c Server_B running SQL Server 2014   I want these servers to be able to see each other, so I can SELECT anything I want in Server_A from Server_B and vice versa.  I only want the ability to run SELECT queries (not INSERT, UPDATE, DELETE or any DDL queries), and also if possible to EXECUTE procedures.  What options or technologies we have for achieving this issue and which one is better?    Tell me if any software I have to install or any configuration have to be set on each of servers. I appreciate explaining the instructions step by step. How to build a single virtual machine on top of multiple computers? Is there a way to run Linux operating system on a virtual machine which aggregates the resources of physical machines on the local network and acts as a single super-computer? If possible, how?  Thanks. Is there a way to monitor an SSD state and predict its failure in case of active read-write usage? As far as I know, the only con against switching to an SSD except its price is the tendency to fail soon (relatively to conventional HDDs) in case used in active read-write operation. Is there an efficient way to predict the failure? How can I combine two plots? What is the simplest way to convert char[] to/from tchar[] in C/C++(ms)? This seems like a pretty softball question, but I always have a hard time looking up this function because there seem there are so many variations regarding the referencing of char and tchar. How to get layer extent in OpenLayers or zoom to WMS layer extent? I have added WMS layers using follow:  basemap = new OpenLayers.Layer.WMS( "Layer Name1", "http://localhost:8080/geoserver/wms/workspacename", {layers: 'workspacename:layername'} );   utility = new OpenLayers.Layer.WMS( "Layer Name2", "http://localhost:8080/geoserver/wms/workspacename", {layers: 'workspacename:layername', transparent:"true"}, {isBaseLayer:false} );   Now I want to get zoom to my utility layer, How can I?  I have tried as following:  map.zoomToExtent(utility.getDataExtent()); How to search something on across multiple sites with a single Google query? I tried   (search term site:stackoverflow.com) OR (search term site:superuser.com) OR (search term site:stackexchange.com) search term site:stackoverflow.com,superuser.com,stackexchange.com search term site:stackoverflow.com site:superuser.com site:stackexchange.com   None of them works. What is the correct way to search? Is two-thirds plural? Is 2/3 always, sometimes or never plural?  E.g.     1a) 2/3 of the pizza were eaten.     1b) 2/3 of the pizza was eaten.      2a) 2/3 of the visitors were men.     2b) 2/3 of the visitors was men.   I feel that example 1 could go either way but example 2b sounds very wrong.  Is there a rule for this? How to prevent Windows from entering idle state? Are plants creatures or objects? This has occurred to me due to conflict between Fabricate and Blight. Fabricate says it can not target creatures and lists trees as example targets. Blight on the other hand can only target creatures and lists mundane normal plants as example targets.     Which of these conflicting spell descriptions is correct?    Note: It also occurred to me that plants might also be whichever one is convenient, unlikely but possible. How could towns restrain a magic user? The modern concept of crime and punishment is very reliant on the ability to disarm and restrain and control an individual (think handcuffs, the dividers in police cars, and jails).  How can that be replicated in a world where even a wizard's apprentice has a much power as an armed man with a handgun?  I've seen stories where magical restraints are present, but you can't write that into every thorp and hamlet, even in Eberron.    How can you restrain a magic user in a fantasy setting?   Either answers that conform to modern concepts of crime and punishment or answers about restraining a magic-user in a psuedo-medieval setting are acceptable. Vertical spaces between lines in cases environment \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation*}   X_i =    \begin{cases}     \left[\begin{smallmatrix}       0 \\ 1 \\ 2     \end{smallmatrix}\right]     &amp;     \text{if $i$ is even;}     \\     \left[\begin{smallmatrix}       2 \\ 1 \\ 0     \end{smallmatrix}\right]     &amp;     \text{otherwise.}   \end{cases} \end{equation*} \end{document}   This is the LaTeX code that I wrote based on a cases environment. There's no space between the matrices on the right. What's the best way to add some vertical spaces to separate them?    p.s. This is a simplified form of my original writing, so I cannot just accept suggestions like 'use a matrix transpose to transform the column vector into a row vector.' How do I use method overriding in this case? How is a pitch supporting fast bowlers or spin bowlers? How do I sudo a command in a script without being asked for a password? I want to turn my system on automatically every day. So I use the below code in my Python script, but sudo asks me for a password every time:  os.system('sudo sh -c "echo date \'+%s\' -d \'+ \        24 hours\' &gt; /sys/class/rtc/rtc0/wakealarm"')   How can I run this script without sudo asking for the password every time?