What is wrong with my SOQL query on profile?  It's saying "Incompatible element type Profile for collection of Id"  What do I need to change      global class ProductAction {     WebService static String convertToService(Id product) {         string result; // Return a string telling us if this worked or not         Id currentProfile = UserInfo.getUserId(); // Get the current user profile Id         Id CurrentUser = UserInfo.getUserId(); // Get the current user Id          Set&lt;Id&gt; allowedProfiles = new Set&lt;Id&gt;(); // Create a new set to profile Ids         for (Profile p: [SELECT Id FROM Profile WHERE Name = 'System Administrator']) {// Get the System Administrator profile             allowedProfiles.add(p); // Add them to the set         }          Set&lt;Id&gt; allowedUsers = new Set&lt;Id&gt;(); // Create a new set to store User Ids         for (User u: [SELECT Id FROM User WHERE Id = '005w0000004j93kAAA' OR Id = '005w0000004Noi6']) {//Select Joy Palmer and Andy McGregor Id's and select Jeremey Sharp and Mark O'Leary once they're in SF}             allowedUsers.add(u);// Add them to the set         }         Product2 prod = [SELECT Convert_to_Service_catalogue__c, R_D_Service_Owner__r.id , Project_Owner__r.Id From Product2 WHERE Id = :product]; // Get the product          if( //If...             (currentUser == product2.R_D_Service_Owner__r.id) || // They own it             (currentUser == product2.Project_Owner__r.id) || // They own it              (allowedProfiles.contains(currentProfile)) || //They're a system admin             (allowedUsers.contains(currentUser))// They're a specific user             ) {                 //Do stuff!                 prod.Convert_to_Service_Catalogue__c = true;                  UPDATE prod;                  result = 'Success!';              }            else {// Otherwise...               // Do nothing               result = 'Go Away!';             }              // Return a message            return result;         }  }
I have a bit of code where I've written a SOQL query that returns a list of SObject records, however I need a Set&lt;Id&gt; structure to pass to another method that I don't have control of (and thus can't change the method signature of).  How can I turn my returned List&lt;SObject&gt; into a Set&lt;Id&gt;? Is the best option just a for loop?
How to smooth shade an object while retaining hard edges? I frequently come to the problem of having a mesh with parts I would like to render smooth and "hard" edges connecting them.   How can I set the mesh to show the sharp edges but render everything else smooth?  In the example I would like the sides of the individual cylinders render smooth but the intersection between bottom and top to be sharp/flat What areas of physics depend on the sum $1 + 2 + 3 + 4 + 5 + 6+ 7+\ldots= -1/12$? This youtube video from Numberphile,   shows how the value is derived. In the video, one interviewee claims that "this result is used in many areas of physics". In the video, only string theory is mentioned.  Which areas of physics use or depend on the sum $$1 + 2 + 3 + 4 + 5 + 6+ 7+\ldots= -1/12?$$ Am I able to use a controller to play the PC version of Minecraft? If so, can I just plug it in and play or do I have to do something else before being able use one? Whenever the Doppler effect is mentioned, it's typically in the context of sound waves or electromagnetic radiation. On the cosmological scale, red-shifting is also important because of the enormous speed of receding galaxies, thanks to the expansion of the universe.   Yet, red-shift is always discussed as the red-shifting of electromagnetic waves. Can gravitational waves be red-shifted? If so, could observations of them be used like red-shifted electromagnetic waves from distant sources are; that is, to figure out how fast an object is receding? Problem writing aux file Can I travel to France with Fiktionsbescheinigung (Fiction Certificate) of Germany Is there a power saving application similar to Jupiter? Sorting citations using \cites command in biblatex I am using biblatex for citations and bibliography. Now I often have lists of multiple citations, for which biblatex has the \cites command. Now I can get citations to automatically sort if I don't want page numbers, but I cannot get it right with page numbers.  What I want is all citation ordered chronological (oldest first). Is this possible, or must I just do this by hand?  Here is an example.  \documentclass[11pt,oneside]{memoir}  \usepackage[     style=authortitle,     useprefix=false,     maxnames=2,     firstinits=true,     sortcites=true,     uniquename=init,     abbreviate=true,     backend=biber,     sorting=ynt ]{biblatex}  \begin{filecontents}{jobname.bib} @book{tom1,   author = {Author, A.},   year = {2001},   title = {This book is from 2001},   shorttitle = {2001}, } @book{tom2,   author = {Author, A.},   year = {1999},   title = {This book is from 1999},   shorttitle = {1999}, } \end{filecontents}  \addbibresource{jobname.bib}   \begin{document} This one is corrent.\footnote{\Cites{tom1,tom2}.} This one is corrent.\footnote{\Cite{tom1,tom2}.}   This one is incorrent.\footnote{\Cites{tom1}{tom2}.} This one is incorrent.\footnote{\Cites[1]{tom1}[12]{tom2}.} \end{document} How to identify predatory publishers/journals What are the best strategies for assessing if a journal is a &quot;vanity&quot; or &quot;predatory&quot; journal that should be avoided (both for publishing in and reviewing for)? For example, how would one go about determining if a journal/publisher belongs on ? In short, :     If you go before the Board of   Directors and ask for 1.5 billion   dollars to build a nuclear reactor, no   one will review or discuss the details   of the plant. They will assume that   experts have been over every inch of   the plans, and not want to look   foolish by asking a silly question.      However, if you ask the same group to   approve a 30 dollar expenditure for   lumber with which to build a bikeshed   (presumably a British term for the   smallest possible building) then be   prepared for a 45 minute discussion   about all aspects of the bikeshed,   including the color of the paint. The   explanation for this is that everyone   can grasp the scale of a bikeshed.   To transform this problem to Stack Overflow terms, questions that are trivial such as "How to convert a C string to a QString or "What is the difference between . and ->" get a lot more views, answers and votes than real questions of the form "How do I frob this widget" that bother real professionals. Fewer views mean less possible votes for good answers and hence less incentive for people to answer.  How can Stack Exchange solve this problem? Most efficient way to see if an ArrayList contains an object in Java The cardinality of the set of all finite subsets of an infinite set Let $X$ be an infinite set of cardinality $|X|$, and let $S$ be the set of all finite subests of $X$. How can we show that Card($S$)$=|X|$? Can anyone help, please? Prove inequality $\sqrt{\frac{2a}{b+a}} + \sqrt{\frac{2b}{c+b}} + \sqrt{\frac{2c}{a+c}} \leq 3$ How to support different screen size in android Limiting sessions to one IP at a time On a site with premium user account subscriptions, I'd like to be able to limit logins to one computer at a time. The most straightforward way to accomplish this would be to limit by IP, but I haven't had any luck finding a plugin to accomplish this. Does anybody know of one I can use to get this functionality?  Related: I set a command block to /tp. It was supposed to activate only if you had 0 time left, and to activate the command block with a hopper clock to keep giving it power.   But it is not checking if you have 0 time left, so it keeps teleporting me. I can't get close enough to the command block to break it, so I'm stuck in a neverending teleport loop.  Any ideas? Remove the flag notification in the top bar when I have done my job with it I have the moderator privileges on .  Even though it's quite rare that flags appear over there, it is still quite annoying that once I have done my job with a flag and therefore cannot do anything else with it, the flag in the top bar remains there. Why do I have to keep seeing that flag when in fact, I can't do anything about it?  Images, with free-hand circles:  A flag exists in the notification bar:    I have already done my part of the flag handling:    And yet the flag remains in the notification bar. I had given an cipher text (of JSON string), an IV and a key. I tried decrypting using 's method:      decryptWithManagedIV(algorithmName, privateKey, IVAndCipherText)     //Sample code   Blob key = Blob.valueOf(decryptionKey);   Blob encryptedDatafor = EncodingUtil.base64Decode(bodystring);   Blob decryptedData = Crypto.decryptwithManagedIV('AES128', key, encryptedDatafor);    cipher = decryptedData.toString();   System.debug('Encrypted BodyString: ' +cipher);   and I was able to decrypt the cipher successfully. But when I use the provided IV with the following method:      decrypt(algorithmName, privateKey, initializationVector, cipherText)    //Sample code  Blob exampleIV = Blob.valueOf('HSDlUkhrmfEo7SgM'); //provided IV   Blob key = Blob.valueOf(decryptionKey);  Blob encryptedDatafor = EncodingUtil.base64Decode(bodystring);  Blob decryptedDataIV = Crypto.decrypt('AES128', key, exampleIV, encryptedDatafor);   cipher = EncodingUtil.base64Encode(decryptedDataIV );  System.debug('Encrypted BodyString: ' +cipher);   I get some string which looks like, it is still in the encrypted form (different from the encrypted string I have passed).   Update:  I have tried the below code-snippet based on the suggestion from @identigral, but I am still unable to decrypt the cipher using the IV:  Blob exampleIV = Blob.valueOf('HSDlUkhrmfEo7SgM'); //provided IV  Blob key = Blob.valueOf(decryptionKey); Blob encryptedDatafor = EncodingUtil.base64Decode(bodystring);  String encodedCipherTextAndIV = EncodingUtil.convertToHex(encryptedDatafor); String encodedCipherText = encodedCipherTextAndIV.substring(32); String finCipher = encodedCipherText.difference(encodedCipherTextAndIV); Blob ciphertext = EncodingUtil.convertFromHex(finCipher);   Blob decryptedDataIV = Crypto.decrypt('AES128', key, exampleIV, ciphertext);  decryptStg = EncodingUtil.base64Encode(decryptedDataIV ); System.debug('Decrypted BodyString: ' +decryptStg); What are the main differences between performing principal component analysis (PCA) on the correlation matrix and on the covariance matrix? Do they give the same results? I want to propose for a Persian version of Super User (I will explain why later) so I want to create a proposal in Area 51, but this means non-English question and answers, Is this OK? P.S: This may be a question for other non-English proposals too. Update: The main question is: How can non-English site proposals pass the Commitment phase? How can the English community support non-English proposals? You can find some information in  about the Stack Exchange 2.0 Site Creation Process (specially Commitment phase):  How does this thermometer work? Intuitively, if Jon Skeet says that he’ll participate in the Sock Puppet Stack Exchange, that commitment is a better sign that the site will succeed than if we get a commitment from a random Internet user who has never participated in Stack Overflow. Sure, they’re both wonderful people, I’m sure, but Jon Skeet has proven that he likes to participate in Stack Overflow so it’s a good bet that he’ll participate in SockExchange, too. .... we’re going to require a selection of existing users with certain badges and reputation that proves that they’ll participate. For instance (and I’m making these numbers up), we might require that a site get at least 100 commitments from people with the Teacher badge, at least 20 from people with the Enthusiast badge, and at least 50 from people with a reputation of 1000 or more on some of our sites.