How to bulkify the soql query in this trigger? I have been correctly informed by people who know what they are talking about that I should bulkify this code. The code does what it should but needs to be more efficient. Can anyone give concrete code examples what needs to done?  trigger trgr_Check_Duplicate_Roles on Key_Staff_People__c (before insert,before update) {       for (Key_Staff_People__c rsp: Trigger.new)          {               List &lt;Key_Staff_People__c&gt; rcrd = [SELECT Contact__c, Role__c FROM Key_Staff_People__c                                                  WHERE Contact__c = :rsp.Contact__c AND Role__c = :rsp.Role__c];               if (rcrd.size() &gt; 0)             {                 if (rsp.Role__c &lt;&gt; Null &amp;&amp; rsp.Role__c &lt;&gt; 'Other' )                 {                     if((Trigger.isUpdate &amp;&amp; rcrd[0].Role__c &lt;&gt; Trigger.oldMap.get(rsp.Id).Role__c) || Trigger.isInsert)  trigger.new[0].addError('A contact with the role "'+rsp.Role__c+'" already Exist. Only the role "Other" may be assigned to multiple Key Staff People.');                                     }             }         } }
How to create SQL like composite key I have an object in which there are two fields i.e Phone no. &amp; email. The combination of these fields should be unique Right now I can create just one unique field But I want their composite to work like a unique field.   I know that I can create composite key in SQL but I dont know how to achieve this in salesforce.
Why is Minecraft giving an OpenGL error? I recently got Minecraft but not from the website, I paid for a code and everything seemed ok. When I tried to play the game a thing came up saying it crashed and then a message popped up saying The game crashed whilst initializing game     Error: java.lang.IllegalStateException: GLFW error 65542: WGL: The driver does not appear to support OpenGL. Did this character even qualify for being Azor Ahai or The One Who Was Promised? In the books and to some degree in the show as well there is a prophesy about the legendary figure Azor Ahai. But in the latest Game of Thrones episode (S08E03) we see Arya      killing the Night King.   However in a  we discussed​ all possible candidates but nobody thought about Arya. Does she even fulfill the prophecy? If she does, how? How can I manually generate a random number from a given distribution, as for instance, 10 realisations from the standard normal distribution? How to set textbox value in jQuery? Marshal "char *" in C# Given the following C function in a DLL:  char * GetDir(char* path );   How would you P/Invoke this function into C# and marshal the char * properly. .NET seems to know how to do LPCTSTR but when I can't figure out any marshaling that doesn't cause a NotSupportedException to fire when calling this function. Evaluate: $$\int_{-\pi/4}^{\pi/4}(\cos(t)+\sqrt{1+t^2}\cos(t)^3\sin(t)^3)dt$$  I have tried substituting $t=\tan(\theta)$ and breaking up the $\cos(t)^3$ using $\cos(t)^2=1-\sin(t)^2$, but I can't figure it out.  This question is #21 from the Math subject GRE form GR1268. Prevent Photos app on OSX from launching when plugging in device The Photos app opens whenever I plug in my phone.    How can this be prevented?  I have seen many solutions for the old iPhoto app that involve changing the "Connecting camera opens" option, but the new app has no such option. Title says it all, I don't see confirmation in  and a cursory google search seemed to say assume no and speculate about the pokemon bank. How to import a .max model into Blender? I've tried to import but I don't see the (.max) file as an option when importing. Is there another way to import the 3DMax model into Blender for rigging and animation? Using the fact that $n^3 + 5n$ is divisible by $6$, infer that $n^4 - 2n^3 + 11n^2 + 14n$ is always divisible by $24$ The problem is as stated in the title. I've tried factorization, but it doesn't seem to yield anything. Any help is greatly appreciated. Also please don't use modular arithmetic, thank you. Crick’s Central Dogma — Counter Cases How can I record sound from the windows command line? Is there an application capable of recording sound that I can run from the command line on XP?  Ideally I'd start it with one command and stop it with another. Or I could specify a duration with the starting command. Linux Debian codenames I've got a few, quite silly, non-technical questions about giving  to  releases.  Each Debian release has its unique codename, which is (so far) a characters' name from  movies by .  Here is list of all assigned codenames so far:   release 1.1 is  (Buzz Lightyear) - the spaceman, release 1.2 is  - the tyrannosaurus, release 1.3.x is  (Bo Peep) - the girl who took care of the sheep, release 2.0 is  - the piggy bank, release 2.1 is  (Slinky Dog) - the toy dog, release 2.2 is  - Mr. Potato, release 3.0 is  -  the cowboy, release 3.1 is  - the sergeant of the Green Plastic Army Men, release 4.0 is  - the toy blackboard (Etch-a-Sketch), release 5.0 is  - the toy binoculars, release 6.0 is  - the name for the three-eyed aliens, release 7.0 is  - the name of the rubber toy penguin with a red bow tie, release 8.0 is  - the name of the yodelling cowgirl, release 9.0 is  - a purple rubbery octopus toy at , release 10.0 is  - 's pet dachshund (currently ).   List of upcoming major Debian releases' codenames after :   release 11.0 is  - 's horse (currently ), release 12.0 is  - intelligent worm toy with a built-in flashlight.   There are also:   special codename  () which is symbolic link to codename which is currently unstable,  which is symbolic link to codename which is currently stable,  which is symbolic link to codename which is currently testing.   The list of Toy Story  is quite  but at some time, there will be no more characters' names to assign.  My questions are:   What codenames will be assigned if we run out of characters' names? Who decides what is codename of next release (please don't answer ambiguously like: 'community')? How many releases' names are planned ahead?   BTW: Interesting quote from :     The  of using Toy Story names was  by  who   was, at the time, the Debian Project Leader and was working also at   , the company that produced the movies.     by  (: ). Can you choose which version of a game to play on Steam? I want to play a game in an older update, but can't see a way to choose a specific version. Is this possible? I'm trying to connect to a sandbox using the sfdx cli and the JWT flow through force:auth:jwt:grant. According to , we can use the same connected app information from Production to connect to our Scratch Org.  Is it something that should work for sandbox too ? I'm getting a "Failed: Not approved" error.  Connected app in sandbox comes from the refresh but has a different consumer key. The Permission set is set correctly on my user.  Is there a way to connect to a recently refreshed sandbox using the JWT flow (without manually changing something like the consumer key) ? Is it possible to create individual power settings for each hard drive? I have a number of different drives that I use for different purposes but I only use two of them frequently. I would like for the others to enter sleep mode when not in use, but never my main two.  Is there any way to edit power saving settings for individual drives? When looking at my objects in 3d view I'm seeing a gray cone that seems to be hiding other objects.   Can anyone help me turn this off and explain what it is please.  Screenshots attached. Geometric proof that a Pythagorean triple has a number divisible by $3$? Can I infer from “If $a,b \in \mathbb{N}$ such that $(a,3)=(b,3)=1$ then $a^2+b^2\neq c^2$ for any $c\in\mathbb{N}$” that any pythagorean triple has a number which is divisible by $3$? If so, how can this relationship be proved geometrically? Mathematics Ph.D program foreign language requirement I will soon be attending a Ph.D program in mathematics. I do not know how common this practice is, but the department has a requirement that graduate students must learn a foreign language and be able to read and write mathematics in that language. The three choices are French, German, or Russian. I personally have no preference on which to learn, but I was wondering if there were other reasons that would make one language more advantageous over the others in terms of a general mathematical career. Thanks in advance in any response. Can't start mongod , configured storage engine is 'mmapv1' I try to run mongo v2.6.10 on Ubuntu 16.04 lts:  mongod   And get the result:  mongod --help for help and startup options 2017-09-16T12:15:19.660+0430 [initandlisten] MongoDB starting : pid=15959 port=27017 dbpath=/data/db 64-bit host=mahdi-MS-7808 2017-09-16T12:15:19.660+0430 [initandlisten] db version v2.6.10 2017-09-16T12:15:19.660+0430 [initandlisten] git version: nogitversion 2017-09-16T12:15:19.660+0430 [initandlisten] OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016 2017-09-16T12:15:19.660+0430 [initandlisten] build info: Linux lgw01-12 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:16:20 UTC 2015 x86_64 BOOST_LIB_VERSION=1_58 2017-09-16T12:15:19.660+0430 [initandlisten] allocator: tcmalloc 2017-09-16T12:15:19.660+0430 [initandlisten] options: {} 2017-09-16T12:15:19.660+0430 [initandlisten] exception in initAndListen: 28574 Cannot start server. Detected data files in /data/db created by storage engine 'wiredTiger'. The configured storage engine is 'mmapv1'., terminating 2017-09-16T12:15:19.660+0430 [initandlisten] dbexit:  2017-09-16T12:15:19.660+0430 [initandlisten] shutdown: going to close listening sockets... 2017-09-16T12:15:19.660+0430 [initandlisten] shutdown: going to flush diaglog... 2017-09-16T12:15:19.660+0430 [initandlisten] shutdown: going to close sockets... 2017-09-16T12:15:19.660+0430 [initandlisten] shutdown: waiting for fs preallocator... 2017-09-16T12:15:19.660+0430 [initandlisten] shutdown: lock for final commit... 2017-09-16T12:15:19.660+0430 [initandlisten] shutdown: final commit... 2017-09-16T12:15:19.660+0430 [initandlisten] shutdown: closing all files... 2017-09-16T12:15:19.660+0430 [initandlisten] closeAllFiles() finished 2017-09-16T12:15:19.660+0430 [initandlisten] dbexit: really exiting now   error :     exception in initAndListen: 28574 Cannot start server. Detected data   files in /data/db created by storage engine 'wiredTiger'. The   configured storage engine is 'mmapv1'., terminating   after update mongodb show error .