Fragment cannot be converted to Context (App crashes immediately)
What is a NullPointerException, and how do I fix it?
What is a word for someone that only does something to benefit them? Take this paragraph for example: I am a follower, not a leader. Hell, I'm not even that good of a follower either, just someone who will do your bidding for the right price. Even then, if it doesn't benefit me -- or put you in debt to me -- I won't do it. Axiom of Choice: Family of non-empty sets mutually disjoint or not? Compare classifiers based on AUROC or accuracy? I have a binary classification problem and I experiment different classifiers on it: I want to compare the classifiers. which one is a better measure AUC or accuracy? And why?  Raondom Forest: AUC: 0.828  Accuracy: 79.6667 %            SVM: AUC: 0.542  Accuracy: 85.6667 % Can moving tables to another MySQL database help performance? I want to know if I using different databases can help performance.  I have one big table support_chat with more than 5 million rows. I need to scan this all the time (3s with ajax) to check new messages on support.  If I move this table to another database in the same computer, can it help anything? (let users, sells, comments table faster)  For example:  db1  users table sells table comments table support_chat table // move this table to db2   db2  support_chat table   They want to keep old things due legal reasons, to have a user support history. PHB says 'once per turn,' so, it would seem that a Rogue with Sentinel, for example, could "consistently" deal Sneak attack twice per round (whether the enemy triggers an OA or the melee weapon attack provided by the Feat).  So, can rogues deal sneak attack damage with any weapon attack outside their turn? (obv. one that meets the standard requirements--finesse, adv or adj ally) There are two different commands to incorporate another file into the source of some document, \input and \include. When should I use one or the other? What are the differences between them? Are there more things like them to be aware of? I am trying to execute a web service call to our backend system when the opportunity is closed/won. I am attempting to do a  POST to our endpoint. All the api call is really carrying the account name and a few structural detail back (All listed below). My problem is that when the trigger executes I get the following error in the debug logs "System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out".  The Process Builder Passing in the company name:   APEX Class  public class Play2 { @TestVisible static HttpResponse res;  @InvocableMethod public static void sendNotification(List&lt;String&gt; name) {        HttpRequest req = new HttpRequest();     Http http = new Http();     String payload = JSON.serialize(         new Map&lt;String, String&gt; {             'companyName' =&gt; name.get(0),             'salesforceAccountType' =&gt; 'Company',             'salesforceSynchStatus' =&gt; 'Enabled'         }     );      req.setEndpoint('https://TheEndPoint');     req.setMethod('POST');     req.setHeader('Authorization', 'The Mighty API KEY');     req.setHeader('Content-Type', 'application/json');      req.setBody( payload );     req.setCompressed(true);       try {         System.debug('Point 1');         res = http.send(req);         System.debug('Point 2');     } catch(System.CalloutException e) {         System.debug('Callout error: '+ e);         System.debug(res.toString());     } } } I want to see you.   I look forward to seeing you.      How can one say "to" in the first sentence is an infinitive marker and in the second sentence a preposition when we are given just the following two sentences and are asked to fill in the blanks?        I want to ____(see/seeing) you.   I look forward to __(see/seeing) you. How to enable touchpad? Yesterday, suddenly my touchpad on my MSI Laptop started to not respond. In other words, in Login screen, touchpad is working as expected. However, in Desktop screen, after I have logged in, touchpad is not working.  How can I enable touchpad in Desktop? For as long as I can remember I have avoided using switch statement fall-through. Actually, I can't remember it ever entering my consciousness as a possible way to do things as it was drilled into my head early on that it was nothing more than a bug in the switch statement. However, today I ran across some code that uses it by design, which got me immediately wondering what everyone in the community thinks about switch statement fall-through. Is it something that a programming language should explicitly not allow (like C# does, though it supplies a workaround) or is it a feature of any language that is powerful enough to leave in the programmer's hands? Edit: I wasn't specific enough to what I meant by fall-through. I use this type a lot:     switch(m_loadAnimSubCt){         case 0:         case 1:             // Do something             break;         case 2:         case 3:         case 4:             // Do something             break;    }  However, I'm concerned about something like this.    switch(m_loadAnimSubCt){         case 0:         case 1:             // Do something, but fall through to the other cases             // after doing it.          case 2:         case 3:         case 4:             // Do something else.             break;    }  This way whenever the case is 0, 1 it will do everything in the switch statement. I've seen this by design and I just don't know if I agree that switch statements should be used this way. I think the first code example is very useful and safe. The second seems kind of dangerous. How to subtract a day from a date? Lunch Meeting Probability for two person to meet in given 1 hour slot and none would wait more then 15 minute. Two friends who have unpredictable lunch hours agree to meet for lunch at their favorite restaurant whenever possible. Neither wishes to eat alone and each dislikes waiting for the other, so they agree that each will arrive at a random time between noon and 1 pm, and each will wait for the other for 15 minutes or until 1:00. What is the probability that the friends will meet for lunch on a given day? How do volume control headphones work? A recent question over on  got me to wondering how volume control headphones work.  I don't mean volume control which works by , but the kind of volume control that signals to the device to increase or decrease the signal output.  For instance, according to the , the volume controls are only for apple devices:     Universal Compatibility and Microphone Communication   LP comes with 2 cables for universal compatibility with all modern mobile and audio devices. The 3-Button remote microphone cable is designed for the latest Apple devices, including iPhone®,iPad®, iPod®, and Macbook series. The long audio-only cable and 1/4" adapter is universally compatible with all audio devices and professional equipment.   However this sort of device apparently works with some android phones and the question implies that it works with some computer sound cards on Windows machines too, but not being an Apple buyer (and only recently getting my first smartphone) I haven't seen this sort of thing before. I've done a quick google search, but can't find anything on standards for this technology.   How does this work?   Is it something as simple as shorting left/right/mic channels? If so, could using headphones of this type with equipment that doesn't support this technology, damage that equipment? Is it a serial signal, for instance sent over the mic channel? Does it just require a headphone  connector or a headphone  +microphone TRRS connector?   Does this technique have a name?  Incidentally, is someone could answer this, I can probably look up the rest of the information myself. *8') Is it as standard as it appears, or is everyone just following Apple? Is this something that is patented?   If so, who holds the patent and do they charge a license fee for people to use this technology? If not, is there an open standard for it?    There is some excellent information in  to the question  but it doesn't answer the specifics of how this type of volume (etc.) control works, since it now seems to be rather more common and standard. using underscore's “difference” method on arrays of objects Group with order $p^2$ must be abelian . How to prove that? SQL Server 2008 server cannot connect to itself with alias name or "localhost" We have a SQL Server 2008 ENT 64bit SP3 server running Server 2008 R2 Standard SP1 64-bit.  This is also a windows/sql clustered environment.  There is the cluster alias for the server, and then we have 2 AD DNS aliases as well for the server  Suddenly I can't connect to the sql instance in Management Studio, or with a Powershell Invoke-SQLcmd IF I am doing it from that actual server, when using one of the dns alias names, or "localhost".  If I use the Cluster alias name it works and if I use the other dns alias name it works.  Using management studio with the non-working dns alias I get "Login failed. The login is from an untrusted domain and cannot be used with Windows authentication."  If I use localhost, I get "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)"    Shared Memory and TCPIP are enabled in SQL Server Config manager but named pipes is not.  But we've NEVER had named pipes enabled, and don't have it enabled on any of our other sql servers and they're set up the same (clustering, dns aliases...etc) and are having no issues.  I've Googled around and had a view people suggest listing what other SQL servers it can see (cmd prompt sqlcmd -L)  If it do it from a good server I see all other servers on my network including the "bad" one.  If I do that command from the "bad" server, I get no results at all.  Pretty much checked everything from this blog and it's all ok except the sqlcmd -L issue I just mentioned above.    Windows firewall is not enabled.  This was working just fine for a couple of years.  I'm not sure when this started happening, but I know that at some point, it was not happening.  And the other kicker...it's only happening locally to this server.  If I connect with management studio or run a powershell Invoke-Sqlcmd from another machine, or my local machine connecting to the "bad" server, it works fine no matter what alias I use.  I'm stumped.  I think it sounds like an issue with the AD alias (there are 2 ad aliases, 1 works locally the other doesn't)...but not being able to connect with localhost makes me question that.  any help is greatly appreciated. Invoking shader in DX So I am new to the DX12 world. I am currently trying to tweek the nbody_gravity DX12 sample, but appending or calling another Compute Shader which is to add 2 buffers to produce an output in a different buffer.   I have written this code in "ComputeShader.hlsl" however when i tried to invoke it using the following, i get an error sayin "file not found" When i printed the debug error it says the following: D3D12GetDebugInterface: This method requires the D3D12 SDK Layers for Windows 10, but they are not present on the system.   I am invoking my shader after the default invocation to the nBodyGravity.hlsl is done:  ComPtr&lt;ID3DBlob&gt; computeShader; ComPtr&lt;ID3DBlob&gt; computeShader_m;  #if defined(_DEBUG)         // Enable better shader debugging with the graphics debugging tools.         UINT compileFlags = D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION; #else         UINT compileFlags = 0; #endif           ThrowIfFailed(D3DCompileFromFile(GetAssetFullPath(L"NBodyGravityCS.hlsl").c_str(), nullptr, nullptr, "CSMain", "cs_5_0", compileFlags, 0, &amp;computeShader, nullptr));  //extra call for my shader ComPtr&lt;ID3DBlob&gt; error_ptr;         ThrowIfFailed(D3DCompileFromFile(GetAssetFullPath(L"ComputeShader.hlsl").c_str(), nullptr, nullptr, "main", "cs_5_0", compileFlags, 0, &amp;computeShader_m, &amp;error_ptr));  if (error_ptr) {     OutputDebugStringA((char *)error_ptr-&gt;GetBufferPointer()); }   Is there somthing amiss? How do I delete all empty directories in a directory from the command line? Say I have a directory named foo/. This folder includes subdirectories. How can I delete all the empty directories in one command? Do I have to claim and re-check in my baggage in international transit when traveling with the same airline? I'll be traveling to Memphis, Tennessee form New Delhi, India via Qatar Airways.  The itinerary would be: New Delhi &lt;--> Doha || Doha &lt;--> Chicago || Chicago &lt;--> Memphis  Would I be required to claim and re-check my baggage at Chicago even though all the flights were booked with Qatar Airways or can I check it in all the way from New Delhi to Memphis without re-checking in the baggage again? When do I use "can" or "could"? When should I use can? When should I use could? What is right under what context?