Our vendor application database is very TempDB intensive.    The server is virtual (VMWare) with 40 cores and 768GB RAM, running SQL 2012 Enterprise SP3.   All databases including TempDB are on Tier 1 SSD in SAN.  We have 10 tempdb data files, each pre-grown to 1GB and they never auto-grow. Same with 70GB log file. Trace Flags 1117 & 1118 are already set.  sys.dm_io_virtual_file_stats shows over 50 Terabytes read/written on tempdb data & log files in past month, with cumulative io_stall of 250 hours or 10 days.    We have already tuned the vendor's code and SPs over past 2 years.  Now, we're thinking of placing tempdb files on RAM Drive since we have a ton of memory. Since tempdb gets destroyed/recreated when server is rebooted, it is an ideal candidate to place on volatile memory which also gets flushed out when server is rebooted.  I've tested this on a lower environment and it has resulted in faster query times but increased CPU usage, because the CPU is doing more work instead of waiting on slow tempdb drive.  Has anyone else put their tempdb on RAM in high oltp production systems? Is there any major disadvantage? Are there any vendors to specifically choose or avoid?

Reading over  reminded me of a question I had a while ago.  We have a SQL Server that has 512GB of RAM, the main database is 450 GB.  We see quite a lot of action in TempDB (ok, I think it's "quite a lot of action" - it may not be!).  I installed a demo version of RamDisk Plus Server, created a 50GB ramdrive, pointed TempDB at it, and saw no improvement in performance at all.  Do writes to TempDB always result in an actual physical write to disk, or are TempDB writes cached by SQL Server for delayed write like in the Windows file system cache?    Is a ramdisk pointless in this scenario?    I know SQL Server 6.5 had support for TempDB-In-Ram, but I see that was discontinued a long time ago!


When we're searching for an unanswered question, we're faced with thousand of finished questions, but unanswered, because there was a conversation via comments.  A good new feature would be to add a "finished" or "solved" button, this button could appear only if someone commented, where moderators or the owner could press, but the question would be open for new comments or answers.

I have a question and have seen others to which the best and most relevant answer (at least the one that solved my particular problem) is placed in the comments to the question as opposed to the answers:   I would like to recognize the commenter as the person who correctly answered the question, but there doesn't seem to be any way to do that. The only thing I could think of was to ask the commenter to repost his comment as an answer, but I cannot figure out a way to contact him. In the meantime the question is sitting unanswered and I am getting other "answers" (leading me to believe that people are not reading the comments and answers already posted before trying to answer it themselves).  How are we supposed to do this?  Note: I don't want to accept the comment as an answer (I agree completely with the answers to this question that comments are comments and answers are answers and they should stay that way). I do wonder if there should be some way to contact people in a reasonable manner (comments on their profile that they must opt in to receiving in email?).


I am trying to fetch record in my trigger using SOQL using LIKE.  The value I need to compare is a combination of three fields. I am trying the below code. Not sure what I am doing wrong   string DocName = ''+q.SBQQ__Account__c+' - '+q.SBQQ__Account__c+' - '+q.Name+'%'; Document d = [Select id from Document where Name LIKE ''+DocName+'' order by CreatedDate asc LIMIT 1];

I have a batch class where I need to find all contacts with titles like director, cEO, etc. This should allow partial matches such as 'support director', 'sales director', I was trying this but is not returning the contacts. Is there any other way other than adding a bunch of OR conditions?  String[]  VIPTITLES = new String []{'\'%CEO%\',\'%CFO%\',\'%CMO%\',\'%CTO%\',\'%CIO%\',\'%COO%\',\'%VP%\',\'%DIRECTOR%\',\'%VIP%\''};  query = 'Select Id FROM CONTACT WHERE Contact.Title LIKE : VIPTITLES'


Is the following scenario possible?   2-Node Automatic Failover Cluster in DC1, shared disk 2-Node Automatic Failover Cluster in DC2, shared disk employ a 'Node and Disk Majority' employ AAG across datacenters failover will be manual; availability mode asynchronous   The datacenters are up to 15.5-miles apart.  Thanks for the help!

In general is it problematic to cluster across two datacenters that are up to 15-miles apart?  For this one particular project the approach is the following?   2-Node Failover Cluster across two datacenters, one node per datacenter local SAN disks, no shared disks 'Node and FileShare Majority' at third location on-campus employ AAG, failover will be manual; asynchronous mode   Is anyone implementing something like this with success??!?  Thanks so much for the help!!


So I was messing around with OneDrive and decided to go back to Google Drive after seeing the change from 15GB storage to 5. My Documents folder under This PC was set to my OneDrive folder, and after copying everything under the OneDrive folder back to C:\Users\MY_USERNAME\Documents, I disabled OneDrive.  Now This PC -> Documents links to the old OneDrive folder which is no longer in use, and I cannot change the directory when right clicking Documents -> Properties -> Location -> Restore Default.  I have admin rights on the machine under this account. I have full admin rights for the Documents folder which is currently linked to C:\Users\MYUSERNAME\OneDrive\Documents. I have full admin rights to the folder that I want to move it to C:\Users\MYUSERNAME\Documents. However, when clicking Restore Default under locations I receive the error:     The folder can't be moved here. Access is denied.

I have recently changed the location of my Documents folder (originally located in C:\Users\TermoZour\Documents) to C:\Users\TermoZour\OneDrive\Documents so I could sync the documents folder between 2 PCs.  Now I want to remove this "link", but I can't. Whenever I try to "Restore Default Location" it indeed sees the default location as expected, but then it asks me if I want to move all the files from the old directory (OneDrive) to the new one (default Documents directory), so I click yes. After this, it tells me that "it can't remove the folder because there is a folder in the same location that can't be redirected. Access denied."  I tried to move all the files from OneDrive into a separate folder and do the process again, but it gave me the same error.  I tried to choose another new location instead of the default one, but it gave me the same error.


I have different Record Types on my opportunity and different Sales Prosses associated with them to be able select different values in picklist field Stage depending on Record Types. I add custom values in picklist field Stage and select them in one Sales Process. But when I am trying to deploy next error occur   Error: Picklist value: not found.  <businessProcesses>     <fullName>Custom Sales Process</fullName>     <description>Sales Process for ...</description>     <isActive>true</isActive>     <values>         <fullName>01 New</fullName>         <default>false</default>     </values>     <values>         <fullName>02 Prospecting</fullName>         <default>false</default>     </values>     <values>         <fullName>03 Qualifying</fullName>         <default>false</default>     </values>     <values>         <fullName>custom value 1</fullName>         <default>false</default>     </values> </businessProcesses>   API version in package.xml is 39  Please, help me.

I was trying to migrate some standard fields like Account Type, Opportunity Type and Opportunity StageName with Migration Tool with API version 39.0 but am i don't see any pick list values in Metadata (Now named as ValueSet) for only Standard pick list fields.   Even i cross checked in IDE for the object,i dont see any values for those pick lists, is it known issue from Salesforce?


ARMA model selection involves selecting a number of autoregressive lags and moving average lags.  Meaningfully estimating the coefficients (i.e. without overfitting) requires the length of the series to be far greater than the number of parameters. If the series is quite short, say 10 time points, then a model that considers all 10 lags to predict the next observation is out of the question (let's ignore Bayesian approaches for the moment).  However, suppose that instead of a single series I have 1000 series, and suppose that each of these is generated independently but from the same underlying random process. If all I care about are the AR coefficients, I could fit a linear regression of the final observation on all of the previous ones -- each series is a single row of a linear model design matrix -- right?  Is there a standard algorithm/software that similarly extends the fitting process for the MA terms to incorporate multiple series?

I have a novice background in time series (some ARIMA estimation/forecasting) and am facing a problem I don't fully understand.  Any help would be greatly appreciated.  I am analyzing multiple time series, all over the same time interval and all of the same frequency, all describing a similar type of data. Each series is just one variable, there are no other corresponding predictors that I'm looking at.   I have been asked to estimate a single model that describes ALL the series - for example, imagine I could find one ARIMA (p,d,q) with the same orders, coefficients, etc. that could fit all the series.  My supervisor does not want me to separately estimate each series, nor does he want me to do some sort of VAR model with dependencies between the series.  My question is:  what would I even call such a model, and how might I go about estimating / forecasting it?  If it's easier for you to use code examples, I speak both SAS and R.


For example,any "naked" code, i.e.:  IF ($_POST) then....,   runs directly, before any WP action.  for example, this runs later (even with point 1):  add_action('init','my_function',1);   I want to execute my code before any WP action starts. Which hook executes at first?

In what order add_action hooks execute? i.e. init wp_head wp_footer after_theme_setup  etc... ??? ??? ???     EDIT: I've also posted my solution.


im trying to change the text of an activity 2 upon starting another (different) activity 1 with setText(), but as soon as activity 1 starts it crashes (it is opened through the click of a button). the error message is java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(int)' on a null object reference  all solutions i found so far have not worked - either because they were for something else (i often saw something for a navigationdrawer, which i am not using), because they had nothing to do with my code or i had it already implemented. activity 1: public class ActivityTL extends AppCompatActivity {      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_tl);         final TextView text1 = (TextView) findViewById(R.id.textView1);         text1.setText(R.string.testB1);         final TextView text2 = (TextView) findViewById(R.id.textView2);         text2.setText(R.string.testB2);         final TextView text3 = (TextView) findViewById(R.id.textView3);         text3.setText(R.string.testB3);         final Intent intent = new Intent(this, testA.class);         final ImageButton imageButtonA = findViewById(R.id.imageButtonA);         imageButtonA.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                 startActivity(intent);             }         });     } }  strings.xml:     <string name="testA1">1</string>     <string name="testA2">2</string>     <string name="testA3">3</string>     <string name="testB1">4</string>     <string name="testB2">5</string>     <string name="testB3">6</string>  if you need other information, please tell me and i will add it. thank you in advance!

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I have been reading a lot on Stack Overflow for a while now, but this is my first post here. Thanks for all the help I've received! I am currently working on a project where we are trying to estimate the effects of a drug on overall and disease-specific mortality. This is a prospective observational study, where patients are enrolled when they have a blood test, which happens at different time points. Patients are then followed until death, emigration, or the end of the study. To figure out if the drug impacts mortality, we have set up a Cox regression model where drug exposure is allowed to accumulate over time with the cumtdc function specified . The problem is that the proportional hazards assumption is severely violated - with p-values approaching 0 for most of the covariates. I am a beginner to this type of analysis and what I have read and tried so far is:  Splitting continuous variables (such as age) into categories, which did not make a difference. Could interaction variables be helpful here - if so, how do I best implement them? Would this analysis be better suited to be performed with an accelerated failure time model? Is it possible that the analysis could be valid despite the non-proportional hazards? I am asking this since, intuitively, there are many individuals in the study (> 300 000) and many events (> 30 000), so even minimal violations might be registered as significant.  I am attaching the Schoenfeld plots with the respective p-values for the covariables.  I would be most appreciative of any suggestions to this problem. There seem to be many different approaches out there, making it a bit tricky to navigate for a beginner. Thank you!

I have been reading a lot on Cross Validated for a while now, but this is my first post here. Thanks for all the help I've received! I am currently working on a project where we are trying to estimate the effects of a drug on overall and disease-specific mortality. This is a prospective observational study, where patients are enrolled when they have a blood test, which happens at different time points. Patients are then followed until death, emigration, or the end of the study. To figure out if the drug impacts mortality, we have set up a Cox regression model where drug exposure is allowed to accumulate over time with the cumtdc function specified . The problem is that the proportional hazards assumption is severely violated - with p-values approaching 0 for most of the covariates. I am a beginner to this type of analysis and what I have read and tried so far is:  Splitting continuous variables (such as age) into categories, which did not make a difference. Could interaction variables be helpful here - if so, how do I best implement them? Would this analysis be better suited to be performed with an accelerated failure time model? Is it possible that the analysis could be valid despite the non-proportional hazards? I am asking this since, intuitively, there are many individuals in the study (> 300 000) and many events (> 30 000), so even minimal violations might be registered as significant.  I am attaching the Schoenfeld plots with the respective p-values for the covariables.  I would be most appreciative of any suggestions to this problem. There seem to be many different approaches out there, making it a bit tricky to navigate for a beginner. Thank you! ADDITON TO ORGINAL QUESTION These are the log hazards for the variables age and X. I have now attempted both restricted cubic splines and categorization without meaningful changes to the Schoenfeld residuals.  ADDITION 2 TO ORIGINAL QUESTION The output from cox.zph:  The requested plots from cox.zph for A and age:


I want to show all the empty directories under my home directory, using shell script, can you help me find the code? (without using find's -empty)

How can I find every empty directory, let's say, on the /home/.../Desktop. Because I am on Solaris, I can't use the find . -empty -type d command. Is there any other way?


When purchasing a used iPhone with a completely unknown history (which includes the possibility of multiple previous owners), is it possible to reset it and be sure that all software and firmware on it is 100% identical to the factory image? Please keep in mind that since the history is unknown, it's possible the device was previously jailbroken/unlocked/rooted/etc. If the answer varies depending on iPhone model, please indicate to which models your answer pertains. I'm interested in answers for all iPhone models.  Please note: The question and answers at  do not help because they do not take in account the possibility of the phone being jailbroken/unlocked/rooted/etc.  Also, that question is ambiguous as to whether or not it applies to both the software and firmware.

Back to the screen that asks for SIM insertion and iTunes connection on background. Is it?


I know the definition of Airplane mode is all communications and radio signals are blocked. But is it possible to turn off the "calling/receiving" part of the phone so your phone is not connecting to a cell tower and only allow Wifi? I've looked into a couple of apps in Google Play but they're either not working or out of date with newer versions of Android.   I know there is strong opinions on both sides of the issue but I'm worried about radiation from my phone since i use it a lot in bed and I hold the phone close to my head and face. At night I'm not worried about receiving calls, so I just want to turn off the phone part and  use WiFi. Is there a way? Or am i just crazy and paranoid?

I am currently having a look at the power consumption of a lenovo k900 phone and on the hardware side it seems Radio and Screen is using most of the power.  I am planning to use wifi but not the radio. Are they disconnected ? If so, can I use just the wifi, but no radio/telephony ? Are the settings or commands/intents to access these settings ?  Thanks!


In the second paragraph it is mentioned that eigenvector of $H$ is rescaled by a factor of $\frac{\lambda_i} {\lambda_i +\alpha}$ What exactly meant by that ?

I have understood how ridge regression shrinks coefficients towards zero geometrically. Moreover I know how to prove that in the special "Orthonormal Case," but I am confused how that works in the general case via "Spectral decomposition."


I tried to look for a function that fulfills this rule; $$f(f(x))=\frac{1}{x}$$  I tried a lot, and I didn't find anything.  Can anyone help me find such a function? Or prove that there isn't? It doesn't have to be a real function.

A student came to me with this question and I cracked my head for one hour but I couldn't unambiguously prove that it exists or it doesn't exist. Continuous and invertible function such that $f^{-1}(x) =1/f(x)$ on its domain of definition.


i am trying to just do basic theming.. there isnt an install button for "Desktop Theme" so i am trying to copy the files to root/usr/share/kde4/apps/desktoptheme but get access denied message every time.. i tried changing permissions via properties then tried getting permissions using terminal and neither has led to any success... it would be most helpful if someone could tell me how to get total root permissions any time that i should need them as i know that kubuntu has these files as read only to protect more inexperienced users, like myself.. but this is how i learn... a lot of reading and trial and error..... any help is greatly appreciated.. thanks

I can't seem to edit and save config files in the root system (eg: /etc/dhcp/dhcpd.config); it just says "permission denied" or the save option is blocked in the text editor.  I'm pretty sure I'm a root user, but how do I make sure? If I am a root user, how do I fix this?


I have this table: | id | part number | serial_number | qty | ========================================== | 1  | A           | 12345         | 1   | | 2  | A           | 54321         | 1   | | 3  | A           | 67890         | 1   | | 4  | B           |               | 10  | | 5  | B           |               | 5   | | 6  | C           |               | 6   | | 7  | C           |               | 3   |  I want to group the rows like this: | id | part number | serial_number | qty | ========================================== | 1  | A           | 12345         | 1   | | 2  | A           | 54321         | 1   | | 3  | A           | 67890         | 1   | | 4  | B           |               | 10  | | 6  | C           |               | 6   |  How to do this? Is this possible or not? I want group the row by part number that doesn't have serial number. So if I have 4 rows with same part number that doesn't have serial number, it's only display 1 row.

My table is:     id home datetime player resource     1 10 04/03/2009 john 399   2 11 04/03/2009 juliet 244   5 12 04/03/2009 borat 555   3 10 03/03/2009 john 300   4 11 03/03/2009 juliet 200   6 12 03/03/2009 borat 500   7 13 24/12/2008 borat 600   8 13 01/01/2009 borat 700     I need to select each distinct home holding the maximum value of datetime. Result would be:     id home datetime player resource     1 10 04/03/2009 john 399   2 11 04/03/2009 juliet 244   5 12 04/03/2009 borat 555   8 13 01/01/2009 borat 700     I have tried: -- 1 ..by the MySQL manual:   SELECT DISTINCT   home,   id,   datetime AS dt,   player,   resource FROM topten t1 WHERE datetime = (SELECT   MAX(t2.datetime) FROM topten t2 GROUP BY home) GROUP BY datetime ORDER BY datetime DESC  Doesn't work. Result-set has 130 rows although database holds 187. Result includes some duplicates of home. -- 2 ..join  SELECT   s1.id,   s1.home,   s1.datetime,   s1.player,   s1.resource FROM topten s1 JOIN (SELECT   id,   MAX(datetime) AS dt FROM topten GROUP BY id) AS s2   ON s1.id = s2.id ORDER BY datetime   Nope. Gives all the records. -- 3 ..something exotic:   With various results.


I was just learning about encoding strings in python and after fidgeting with it a little, I got confused by the fact that the size of an empty string ('') is 0 in utf 8 and ascii but somehow 2 in utf 16? how come?  print(len(''.encode('utf16'))) # is 2 print(len(''.encode('utf8'))) # is 0   I guess a big part of the problem is that I don't understand how utf 16 works. I don't understand why encoding 'spam' in utf 16 would be 10 bytes long instead of just 8 bytes (2 bytes (16 bits) for each character). I'm assuming that the 2 bytes are needed in utf 16 as default for any string for padding or something?  *edit  I am NOT confused about the basics of how UTF 8 or UTF 16 work and differ in storing each individual characters. I am confused about how the absence of any characters (an empty string) would be stored in 2 bytes in UTF 16 but have 0 bytes in UTF 8. (as opposed to 1 byte or 0 for both)  The link does not provide answer to my question.

What are the differences between UTF-8, UTF-16, and UTF-32?  I understand that they will all store Unicode, and that each uses a different number of bytes to represent a character. Is there an advantage to choosing one over the other?


I work on a number of different server version 10, 12 & 14 and use Vim extensively with only the default options and no special settings. I just deployed a small PC with Ubuntu Desktop 15 and the Vim behavior is drastically different in Insert mode:   The arrow keys insert special characters I can only backspace over characters I inserted in the current insert "session?"   i.e enter insert mode -> type a few chars -> I can backspace over them, but I cannot backspace over any other chars that exist there.  files are not auto colorized   ie: html files, system files like /etc/passwd    These are only of the few inconsistencies. Is there any way I can get the desktop unit to behave like the server units in Vim?

I am new to Vim. I'm following  tutorials to help me learn to use it.  But some of my commands are not working, for example:  Capital W. f followed by a character. (To move to next same char.)   Why is this happening and how can I get these commands to work?


If Observer A moves at speed $v$ respect to observer B, then there is a time dilation given by  $$t_B=t_A\gamma$$  as is known from special relativity. Here, $t_A$ is the time interval measured by A and $t_B$ is the time interval measured by B. However, a friend of mine asked me about the inverse case, what if we take the frame of reference in which A is stationary and B is moving? in that case,  $$t_A=t_B\gamma$$  In this case, A's time should be dilated with respect to B's, since B is moving away, so we get conflicting results. I know that this case is somehow erroneous, but I am now sure how to justify it. I think that it has something to do with the fact that in the first equation, $t_A $ is the proper time, and that is the one that is dilated, but I have been unsuccesful at developing a convincing enough argument. How can I solve this "paradox"?

Suppose we have two twins travelling away from each other, each twin moving at some speed $v$:    Twin $A$ observes twin $B$’s time to be dilated so his clock runs faster than twin $B$’s clock. But twin $B$ observes twin $A$’s time to be dilated so his clock runs faster than twin $A$’s clock. Each twin thinks their clock is running faster. How can this be? Isn’t this a paradox?


1)What are a group of people who live in the same place like city, state or nation, called?  2)What are the group of people who are part of the same institution or organization called?

What are the people who live in the same city are called? Any words for that? I want to use it in the following context:      I and my ____ are happy.


For what reasons would or wouldn't one want 0 to be the start of the natural numbers as opposed to 1? Why would one want it to be 1, or why wouldn't one?

Is there a consensus in the mathematical community, or some accepted authority, to determine whether zero should be classified as a natural number?  It seems as though formerly $0$ was considered in the set of natural numbers, but now it seems more common to see definitions saying that the natural numbers are precisely the positive integers.


Let $X$ and $Y$ be connected, locally path connected, and Hausdorff topological spaces. Can someone give me an example of a surjective local homeomorphism that is not a covering?  I don't think this is the same question as ? There's different conditions?

I am trying to find examples of maps between topological space which are local homeomorphism but not covering maps. Especially, how twisted has to be such a counterexample : can it be a local diffeomorphism between connected manifolds which is not a covering map ?   I found here() a nice proposition which state that a local homeo from a compact space to a connected Hausdorff space is a covering map.   I am interested in all type of counterexamples, from non-Hausdorff spaces to surfaces, to get a better picture of the differences between covering maps and local homeomorphisms.  Thank you !


Given a matrix of order $n \times n$ $$ A=   \begin{bmatrix}     a_1 & a_2 & ... & a_n \\     a_n & a_1 & ... & a_{n-2}\\     \vdots & \vdots & \vdots & \vdots\\     a_2 & a_3 & ... & a_1   \end{bmatrix} $$ Show that the characteristic roots of $A$ are $$a_1 + a_2w_i + a_3w_i^2 + ... + a_nw_i^{n-1},$$ for $i = 1, ... , n;$ where $\omega_1, \omega_2, ... , \omega_n$ are the $n^{th}$ roots of unity.

Show that for the circulant matrix      $$C =  \begin{bmatrix} c_0     & c_{n-1} & \dots  & c_{2} & c_{1}  \\ c_{1} & c_0    & c_{n-1} &         & c_{2}  \\ \vdots  & c_{1}& c_0    & \ddots  & \vdots   \\ c_{n-2}  &        & \ddots & \ddots  & c_{n-1}   \\ c_{n-1}  & c_{n-2} & \dots  & c_{1} & c_0 \\ \end{bmatrix}$$      the eigenvectors are      $$v_j = \left(1,w_j,w_j^2,...w_j^{n-1}\right), \qquad j=0,1,..,n-1,$$      where $$w_j = \exp\left(2\pi i j/n\right)$$ is the $n$-th root of unity. Show that the $\left(v_j\right)$ are linearly independent.   To show that the $v_j$ are eigenvector the only way I know is to solve the difference equation associated to the characteristic polynomial of $C$ to get a unique eigenvalue $\lambda$. Then find $\text{ker}\left(C-\lambda I\right)$. Is there an another way?    As for linear independence, I don't see how to reduce the matrix $\{v_j\}$ whose column are the eigenvector $v_j$.


On $\mathbb{R}$ with the usual topology, generate an equivalence relation by $x\sim x$ for all $x$ in $\mathbb{R}$ and $x\sim 0$ for all $x$ in $[0,1]$. Prove $\mathbb{R}/\sim$ is homeomorphic to $\mathbb{R}$.   I'm totally lost on this. I'm supposed to be proving that there is a homeomorphism but I don't understand how that is possibly true considering $f:[0,1]\ \longrightarrow \{0\}$ is not injective.


Consider the following sentences:     The last few years has seen the building of the new church.   and     The last few years have seen the building of the new church.   As a native speaker, both of these sentences "sound" correct to me.  Is only one of them correct, are they both correct or is each one only correct in specific circumstances.  This was a question one of my students asked me, so if there is a relevant grammar rule,  that would be great.

I was just copyediting  and my native English speaker Sprachgefühl told me I had to correct the grammar of one sentence:     ... 5–6 weeks are a lot of time ...   by changing the are to is. But as I was doing so I started wondering why is it that in this case it seems that I have to make the verb disagree with the plural subject?  So is my feeling for English going bad or if I did the right thing, how could I explain this to somebody who's learning English for instance?


What I am looking for is a math function that constrains a primitive variable between a minimum and a maximum value in only one single function call, if it exists, in the standard math libraries for Objective-C.  I currently use:  float constrainedValue = fminf( maxValue, fmaxf( minValue, inValue ) );   Since I know that both fminf and fmaxf could potentially have instruction jumps or branches, it seems likely there could be a simple routine that could conjoin both of these operations into one, optimized function.

Is there a more efficient way to clamp real numbers than using if statements or ternary operators? I want to do this both for doubles and for a 32-bit fixpoint implementation (16.16). I'm not asking for code that can handle both cases; they will be handled in separate functions.  Obviously, I can do something like:  double clampedA; double a = calculate(); clampedA = a > MY_MAX ? MY_MAX : a; clampedA = a < MY_MIN ? MY_MIN : a;   or  double a = calculate(); double clampedA = a; if(clampedA > MY_MAX)     clampedA = MY_MAX; else if(clampedA < MY_MIN)     clampedA = MY_MIN;   The fixpoint version would use functions/macros for comparisons.  This is done in a performance-critical part of the code, so I'm looking for an as efficient way to do it as possible (which I suspect would involve bit-manipulation)   EDIT: It has to be standard/portable C, platform-specific functionality is not of any interest here. Also, MY_MIN and MY_MAX are the same type as the value I want clamped (doubles in the examples above).


I presume 16.04 will be LTS, so I would like to ask if I installed 15.10 would I be able to upgrade to 16.04 without much in the way of problems.  Or if I installed 16.04 now, would it eventually become the release version?  Thanks

I have an alpha version of Ubuntu.  When the stable version is released do I have to upgrade or is it already stable from the installed updates?


I am trying to delete files while archiving, using:    rm -Rf /test/this/path/.   but when I run this command I am getting this error:     Device or resource busy   This is due to the file being open by some other user.  Now, how can I delete a file irrespective of whether it is open?

I tried to rm -rf a folder, and got "device or resource busy".  In Windows, I would have used LockHunter to resolve this. What's the linux equivalent? (Please give as answer a simple "unlock this" method, and not complete articles like . Although they're useful, I'm currently interested in just ASimpleMethodThatWorks™)


I would like to reproduce the following layout with two figures on one page and two others on the facing pages.    I would like the first couple to be on an even-numbered page and the second on an odd-numbered page so that all four figures can be seen together when the manuscript is printed and bound.

I have two sideways tables that I want on two facing pages so the reader can turn the entire book and read them both in one turn. For the moment I keep moving them around to keep them on facing pages. Is there a way I can make the first one float until it's on a left page and then place the other one right after? Or perhaps some similar way to automatically get them on the same spread?


The folder gets populated some jobs that run daily, weekly or monthly.  For eg. daily job outputs be like:  daily-2017-16-08.txt daily-2017-15-08.txt   Weekly be like:   weekly-2017-01-08.txt weekly-2017-08-08.txt   and monthly is like:   monthly-2017-01-08.txt monthly-2017-01-07.txt

I have found the command to delete files older than 5 days in a folder  find /path/to/files* -mtime +5 -exec rm {} \;   But how do I also do this for subdirectories in that folder?


this is my code to generate input boxes, it generate boxes but the generated add more button will not work. New files can only be added using the first static button

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


The question is to prove the inequality $$\frac{1}{n+1} \leq \ln \left(1+\frac 1n\right) \leq \frac 1n\\\forall n \geq 1, n\in \mathbb N$$  I tried using Taylor expansion but couldn't figure out anything. Any ideas? Thanks.

I'm learning calculus, specifically derivatives and applications of MVT, and need help with the following exercice:      Show that, for all $n > 1$ $$\frac{1}{n + 1} < \log(1 + \frac1n) < \frac1n.$$    I tried to follow the below steps in order to prove the RHS inequality:   Proving that $f < g$ on $I$ from $a$ to $b$:  Step $1$. Prove that $f' < g'$ on $\operatorname{Int}(I)$.  Step $2$. Show that $f(a) \leq g(a)$ or that $f(a^+) \leq g(a^+)$  Following the above steps, let $f(x) = \log(1 + \frac1x)$ and $g(x) = \frac1x$, for all $x > 1$. One has  $$f'(x) =  -\frac{1}{x^2 + x} \quad \text{and} \quad g'(x) = -\frac{1}{x^2}.$$  We note that, for every $x > 1$, $f'(x) > g'(x)$. Moreover, $f(1^+) = \log(2) < 1 = g(1^+).$   My problem is that I got the wrong inequality sign in Step $1$.    Looking at the solution in my textbook, the author suggests using the MVT but I don't know how to apply it in this case.


My understanding of strict aliasing is that we cannot (with few exceptions like char*) use two different types of pointers to access/dereference the same region of memory. I have a char buffer and a pointer to a struct Foo, and i want to "save" this pointer into the buffer so that elsewhere I just retrieve the pointer and use it. Like this:  Foo* f =//pointer to some real Foo object char buf[N]; memcpy(buf, &f, sizeof(Foo*));   then later:  Foo* f2 = *(Foo**) &buf; f2->bla;   This breaks aliasing as pointed out below because buf is an array of characters and we treat it as a Foo** and dereference that. Is there a way to get my Foo object through with the pointer only through buf or do I have to copy all of Foo into the buffer?

When asking about , people sometimes refer to the strict aliasing rule. What are they talking about?


Simple question but I can't find an answer - how do I find whether the current blog in a multisite network has a given plugin activated (speaking about plugins that are available to all sites on the network but are NOT network activated)?

How to find out if a particular plugin is enabled in a sub-blog in a multisite blog?


I am trying to load a custom css and js on my content type's view mode. Can this be achieved in drupal 8?

I need to get the node's view mode so that in the mymodule_page_attachments, I can add libraries conditionally if the node's view mode is set to full or default. I tried the following but not able to get the nodes view mode once I retrieve the$node` object.   How to get node's view mode in hook_page_attachments?  Here is what we tried:  function mymodule_page_attachments(array &$attachments) {   $node = \Drupal::routeMatch()->getParameter('node');   if(is_object($node)) {      // we tried printing but that didn't result any view_mode field.       ksm($node);      // Goal     if($node['view_mode'] == 'full' or $node['view_mode'] == 'default') {        // proceed with my logic.      }   } }


If I have the following Table1 in Excel  Name    Age Sex Pablo   28  Male Victor  32  Male Juan    33  Male Pedro   40  Male Jacinta 24  Female Laura   39  Female   And Table2  Sex    Color Male   Blue Female Pink   How can I create a table (or pivot table, or just a simple Excel range) that can relate both tables through the Sex field?  Name    Age Color Pablo   28  Blue Victor  32  Blue Juan    33  Blue Pedro   40  Blue Jacinta 24  Pink Laura   39  Pink   I know I can use VLOOKUP or INDEX-MATCH, but I'm looking for a more elegant solution using Excel data model.

I have two worksheets in two different Excel files. They both contain a list of names, id numbers, and associated data. One is a master list that includes general demographic fields, and the other is a list that only includes name and id, and an address. This list was pared down from the master list by another office.  I want to use the 2nd list to filter the first. Additionally, I want the results to include other fields from the master worksheet alongside the address fields from the second worksheet. I know how I could do this very easily with a database inner join, but I'm less clear on how to do this efficiently in Excel. How can join two worksheets in Excel? Bonus points for showing how to do outer joins as well, and I would greatly prefer knowing how to do this without needing a macro.


Im having this problem for a while and i can't solve it, i searched for solutions on google for a good time and nothing is working, im a novice on this kind of content so any explanation will help me.

I am getting the following error trying to read from a socket. I'm doing a readInt() on that InputStream, and I am getting this error. Perusing the documentation this suggests that the client part of the connection closed the connection. In this scenario, I am the server.  I have access to the client log files and it is not closing the connection, and in fact its log files suggest I am closing the connection. So does anybody have an idea why this is happening? What else to check for? Does this arise when there are local resources that are perhaps reaching thresholds?    I do note that I have the following line:  socket.setSoTimeout(10000);   just prior to the readInt(). There is a reason for this (long story), but just curious, are there circumstances under which this might lead to the indicated error? I have the server running in my IDE, and I happened to leave my IDE stuck on a breakpoint, and I then noticed the exact same errors begin appearing in my own logs in my IDE.  Anyway, just mentioning it, hopefully not a red herring. :-(


My Git repo has hundreds of gigabytes of data, say, database backups, so I'm trying to remove old, outdated backups, because they're making everything larger and slower. So I naturally need something that's fast; the faster, the better.  How do I squash (or just plain remove) all commits except for the most recent ones, and do so without having to manually squash each one in an ? Specifically, I don't want to have to use  git rebase -i --root   For example, I have these commits:  A .. B .. C ... ... H .. I .. J .. K .. L   What I want is this (squashing everything in between A and H into A):  A .. H .. I .. J .. K .. L   Or even this would work fine:  H .. I .. J .. K .. L   There is an answer on how to , but I want to keep some of the more recent commits. I don't want to  either. (Especially I need to keep the first two commits counting from the top.)  (Edit, several years later. The right answer to this question is to use the right tool for the job. Git is not a very good tool to store backups, no matter how convenient it is. )

Suppose you have a history containing the three commits A, B and C:  A-B-C   I would like to combine the two commits A and B to one commit AB:  AB-C   I tried  git rebase -i A   which opens up my editor with the following contents:  pick e97a17b B pick asd314f C   I change this to  squash e97a17b B pick asd314f C   Then Git 1.6.0.4 says:  Cannot 'squash' without a previous commit   Is there a way or is this just impossible?


I need to prove that $(H,+)$ is a cyclic sub-group of $(\mathbb{Z},+)$ when $H=\{30x+42y+72z:x,y,z\in\mathbb{Z}\}$.  Attempt: First, $H\subseteq \mathbb{Z}$ since the addition of integer numbers, yields an integer number. Now, we show the closure of $H$ with ($+$). Therefore, let $a_1=30x_1+42y_1+72z_1$, $a_2=30x_2+42y_2+72z_2$. We shall show that $a_1+a_2\in H$. Thus: $$a_1+a_2=30x_1+42y_1+72z_1+30x_2+42y_2+72z_2=30(x_1+x_2)+42(y_1+y_2)+72(z_1+z_2)\in H$$ In addition, we should show the existence of the opposite number, for each number in $H$. Hence, let $H \ni h=30x_1+42y_1+72z_1$. We define $H \ni h^{-1}=30(-x_1)+42(-y_1)+72(-z_1)$, therefore, we have that: $$h+h^{-1}=30(x_1-x_1)+42(y_1-y_1)+72(z_1-z_1)=0+0+0=0$$ Therefore, $(H,+)$ is a sub-group of $(\mathbb{Z},+)$. The last is to show that $(H,+)$ is a cyclic group, so for that, we shall look at the Gcd of $(30,42,72)$, when $(30,42,72)=6$, so by the definition of being in $H$. $$H=\{30x+42y+72z:x,y,z\in\mathbb{Z}\}$$ So $30x+42y+72z=6(5x+7x+12z)=6k$, when $k\in \mathbb{Z}$ then 6 is a creator element of $H$, thus, $(H,+)$ is cyclic. In conclusion, we have that $(H,+)$ is a cyclotomic sub-group of $(\mathbb{Z},+)$.  I don't know If I got it right, and my way is correct, so I will be glad if you can tell me whether my attempt for that question is correct, or not.  Thanks!

Given $a_1, a_2, a_3, \ldots , a_n$ not all zero, show $\gcd(a_1, a_2, a_3, \ldots , a_n)$ is the least positive integer that can be expressed in the form $a_1x_1+a_2x_2+ \ldots +a_nx_n$. Also deduce $a_1x_1+a_2x_2+ \ldots +a_nx_n = b$ has solutions $\iff \gcd(a_1, a_2, a_3, \ldots , a_n)|b$.   I know that $ax+by=n$ has integer solutions $\iff \gcd(a,b)|n$. I'll need to use induction to show $a_1x_1+a_2x_2+ \ldots +a_nx_n = \gcd(a_1, a_2, a_3, \ldots , a_n)$ has solutions, and then I will be able to say that as $\gcd(a_1, a_2, a_3, \ldots , a_n) | a_1x_1+a_2x_2+ \ldots +a_nx_n $ for any $x_1,x_2, x_3 \ldots x_n$ then $c \leq \gcd(a_1, a_2, a_3, \ldots , a_n)$ and $c \geq \gcd(a_1, a_2, a_3, \ldots , a_n)$, and thus $c=\gcd(a_1, a_2, a_3, \ldots , a_n)$.


this is my depedency    <dependency>     <groupId>org.json</groupId>     <artifactId>json</artifactId>   <version>20160810</version> </dependency>   this is my json object  {    "authorize": {        "balance": "9984.06",        "country": "id",        "currency": "USD",        "email": "xxxx.xxxx@gmail.com",        "fullname": "  ",        "is_virtual": 1,        "landing_company_fullname": "Binary Ltd",        "landing_company_name": "virtual",        "loginid": "VRg4423",        "scopes": [          "read",          "trade"        ]    } }   this is my code  JSONObject jsonObject = new JSONObject(fil); JSONObject jsonChildObject = (JSONObject) jsonObject.get("authorize"); Iterator iterator  = jsonChildObject.keys(); String key = null; while (iterator.hasNext()) {     key = (String) iterator.next();     System.out.println("balance value:" + ((JSONObject) jsonChildObject.get(key)).get("balance")); }   I have no idea why I can't acces all the child node value. It returns null pointer exception there is no "authorize" i can't get the parent value.

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I have an Azpen A1040 10" tablet and I have tried multiple root methods, nothing seems to work for this kitkat device.  I see some android enthusiasts successfully rooted this device.  Please let me know what method you used?  Thanks!

This is a common question asked by those who want to root their phones. How exactly do I root my Android device? Are there risks involved?


I've seen in several places that that given a well-ordered set, $X$, any initial segment $S = \{x | x < a\}$  may not be order isomorphic to $X$.  Is it still possible that there is a non-order-preserving bijection between $S$ and $X$?

My book states this as obvious, but it isn't so trivial to me. thanks


This question is particularly about "Umpire's Call". The linked question doesn't provide any information about umpire call.  When a decision is reviewed in the Decision Review System (DRS) we can sometimes see      Wickets Hitting: Umpires Call   What does Umpire's Call actually mean and in which situation this will be given?

In cricket, in UDRS screen, if the ball hits the wicket, then why is not out still given?  I saw this situation so many times happened; bowler appealed for UDRS for LBW, in UDRS it shows ball hits the wicket, but still not out is given sometimes.


I am writing code (Python and wxpython for GUI) which will run on Debian OS on Raspberry PI. I want to protect/hide the source code. Is there any way to do it? Probably py2exe, or converting it to a library or something else?

I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time restricted license file. If we distribute the .py files or even .pyc files it will be easy to (decompile and) remove the code that checks the license file. Another aspect is that my employer does not want the code to be read by our customers, fearing that the code may be stolen or at least the "novel ideas". Is there a good way to handle this problem?


To change the folder icon all you have to do is right click on a folder, select Properties, click on the folder icon, navigate to choose folder icon, select it and done!  But if you have to do it on 100s of folders that would be a pain. What I want is a shorter way to do the same. Like a shortcut that would automatically get to choosing image screen or anything to make it hassle free.  Each folder has a image inside it named "album art.jpeg" or "cover art.jpg" or something like that.

If there are pictures in folder A, B, C.....Z, how do I automatically set the first picture in each of these folders as its folder icon? Is there a way like a script or something else?


I am a beginner, drawing with tikz is a bit difficult for me.  Is there an auxiliary drawing tool that is suitable for beginners? Especially drawing three-dimensional graphics.

I found  to be a useful tool to help generate code for graphs. I suppose there must be other tools to help draw diagrams such as Sets/Venn Diagrams or Electrical Circuits (Logic Gates). Which ones would you suggest?


With respect to C/C++ main() must always return an integer(zero to indicate success and non-zero to indicate failure). I can understand this as the program is run it becomes a process and every process should have an exit status, which we obtain by doing echo $? from shell after the process gets over.   Now I don't understand why is the main method does not return anything in Java? Has it got anything to do with the fact that the program is run on JVM and the JVM process is reposnsible for the returning of exit status?  Please clarify.  Thanks, Roger

In the case of languages with a C-like syntax, we declare the main() method to return an int or float value (or void).  Is it possible to declare a non-void return type from main() in Java?  If not, then why not?  Does this mean that a Java program doesn't return any value to the OS?


In the help center when I was just reading up on bounties I noticed this:      As you can see the top subheader appears to be going under the line and the title is pushed to the right.  I went to check another page suspecting that the cause was because of the longer subheader.    Looking at the developer tools in Chrome the subheader <div> goes across fine, but the child <h1> and/or <a> appear to extend bellow the <div>      It is probably nothing major, but I would think there are some certain people who are pulling their hair out about now because I've brought it up and doesn't look right (OCD sufferer? I can't remember the name of the disorder).

When viewing a topic in the , e.g. , the sub header text is split into two lines, pushing the topic header to the right:        Can this please be fixed?  Chrome 52 under Windows 7 here.


I have a samsung note 2 but I have a problem 1GB ram is always used even if I don't use any app and that drain his battery he have 4.3 android (I tried update but I can't find new one) is this normal ?

I'm new to the ICS os, coming from Gingerbread from another phone. The phone's quite nice and fast when I first used it, but just this morning it started exhibiting weird actions. Camera360 doesn't open up automatically when I click it, the Camera closes for no reason, Pocket restarts when an article has an image, and TTPod resets the song to the previous song on my widget in the middle of a new song I'm playing.  I checked out the ram, and and was surprised to see 500+ mb used, 0 mb available. I looked at the list of programs and I see the usual culprits like Facebook, but the ram they're using doesn't add up to 500+ mb. Yeah, I know that the whole ram indicated isn't usable by the apps, but I don't think I've done anything to warrant the 0 mb. I close my apps. There are times when there's free 4 to 5 mb, but I think that too shouldn't be the case. I tried installing Advance Task Killer, it listed less than 10 apps, killed it, still the ram is what it is above.   I did a reboot, and now it reads 300+ mb usage, 200 something free.   What can I do? How do I ensure an app's closed on ICS? I installed GoLaucher because it has a handy task killer and I can see the ram freed in an instant, but I would like to know if there's a better way to handle the RAM.


When a Java member needs to be thread-safe, we do like the following:   public synchronized void func() {      ...  }   This syntax equivalent to:   public void func() {       synchronized(this) {            ....       }  }   That is, it actually uses this for a lock.  My question is, if I use synchronized with a static method, as follows:  class AA {     private AA() {}      public static synchronized AA getInstance() {         static AA obj = new AA();         return obj;     } }   In this case, on what is the lock made for the synchronized method?

The Java documentation says:      It is not possible for two invocations of synchronized methods on the   same object to interleave.   What does this mean for a static method?  Since a static method has no associated object, will the synchronized keyword lock on the class, instead of the object?


This is an aptitude question which looked simpler to me than it actually is and got me stuck. The question asks:     What is the maximum number of cylindrical pencils of $0.5$ cm diameter that can be stood in a square shaped stand of $5$ cm $\times$ $5$ cm cross-section?   I am aware of hexagonal packing but i really don't know how to get the answer which says it should be $105$ pencils.  EDIT  A link to this question already asked  found later.

I am working on the following problem asked in an examination: "What is the maximum number of cylindrical pencils of 0.5 cm diameter that can be stood in a square shaped stand of 5cm × 5cm inner cross section? 1. 99    2. 121   3. 100    4. 105." A simple calculation yielded me the answer 100.  But the answer in the key is 105. I don't how such an answer is possible. Any hint please.....Thanks in advance!


I'm trying to functional test some code that is dependent on reading the client date, and I want to validate that it does so correctly. Locally, I can change my system date using Java and run the test using Selenium, but I want to run my tests with RemoteWebDriver. Is there some way I can change the date on the client system? If not, can I spoof the date somehow?

Is webdriver capable to run a browser with a faked time, date or time zone?   Such ability would be highly useful for my automation purposes.  Yet, I did not find any such ability in the webdriver documentation. I guess such functionality is quite sophisticated as it would require to intercept and feedback altered Kernel calls. Therefore not necessarily included into webdriver - can you tell me otherwise?     Can you suggest any other method to spoof browser time settings that works   with Selenium? I am open for Windows/Linux solutions. Yet this way has to   work with webdriver automation.   -Olivier (Indeed a great blend of people here at  stackexchange.)


I'm trying to figure out how to sort a list of strings that I have. The default comparer is doing something fun with the file names, though it totally makes sense. My list is a list of file names that come out of a folder in this order: 8_1-MDX 501 9_1-MDX 501 10_1-MDX 501 11_-MDX 501 12_1-MDX 501  And it's outputting them in this order: 10_1-MDX 501 11_1-MDX 501 12_1-MDX 501 8_-MDX 501 9_1-MDX 501  I get why it wants to do that, but the List. Sort methods are a bit confusing and I'm brand new to this. Thanks for any help I can get, and if someone wants to knock me for not understanding delegates well enough, I completely understand. Thanks!

Anyone have a good resource or provide a sample of a natural order sort in C# for an FileInfo array?  I am implementing the IComparer interface in my sorts.


I'm having a hard time to distinguish "necessary and sufficient" in this case.  I think it's necessary. For bread to exist, all the above elements are necessary.  I also think that is sufficient. Just have these elements that bread comes up.  Am I right?

What is the logical difference between something being necessary in order for something else to be true; as opposed to something being sufficient to make something else true.  i.e.  Fuel is sufficient to make an internal combustion engine run.  vs  Fuel is necessary to make an internal combustion engine run.  and what are some subtle examples of how the difference between these two things can greatly impact the meaning of a sentence, discussion, or conclusion.


when I try to run Vmware View Client it says to me : "This Desktop does not support the requested display protocol."  I searched for it and found that i have to setup video graphics , I tried to install additional driver but the system does not find or recognize any additional drivers.  how can i solve this please ?

I have recently fallen in love with Linux. I first decided to try out Ubuntu 13.10 a few weeks ago, but I bricked it by incorrectly installing an AMD FGLRX driver. Then I reformatted and wiped that partition to try out Linux Mint 16. I did the same thing with Mint, as well as with Fedora 20, 19, and 18 (in that order). Now I am on a stable Ubuntu 12.04 because I know how to use it vastly more than the other distros I've tried and because it seems like it has the biggest online support group.  Because I am now tired of reformatting and reinstalling broken distros, I thought it would be a good idea to get at least one distro stable (Precise) and to test the driver installations and other risky modifications for that distro and others with them running in Oracle Virtual Box since I don't trust my Linux skill (lack?) at the moment. This way, I optimize the distros in the Box, take a "snapshot" like saving a video game, and try out the risky operations. If they fail and I break the distro, I can just open the snapshot up and go back to where I was right before the risky operation.   While this still seems like the best idea so far, I have noticed that the distros I have installed on Virtual Box report that I am NOT using my computer's actual hardware, and am actually using Virtual Box's "hardware", for instance, the "Innotek Systemberatung GmbH VirtualBox Graphics adapter.  Because of that adapter, my test graphics installations do not work properly. Even the operations I know would brick the distro with a black screen are not working. "My adapter is incompatible," FGLRX installation says, in the GUI version of installation (one of many methods).  My questions are: Can I not install these drivers inside of Virtual Box? Do I need some additional software? Is there any other virtual environment I could use for testing these distros that would result in a 100% identical virtual installation?    I am using the notoriously Linux-unfriendly Acer Aspire 5553G, which has "switchable graphics".  Those cards are the Mobility Radeon HD 4250 and 5470. The driver's I have tested so far work in Windows 7, yet do not in Linux.   Thank you all in advance!


I use Ubuntu 14.04. Recently, probably after last update, I encounter with a problem when OS shows not maximized windows, popup notes or right click menu. I upload two screen shots:  1- When I moved cursor above browser tab:   2- When GIMP window is not maximized:   How I can solve this problem?

After some gorgeous updates I witness this:


I have been making a simple a program to add a row in the data base using jdbc and spring in a maven project I have made the project watching videos as I am new to spring and database.     * To change this license header, choose License Headers in Project  Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.mariam.employee; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.jdbc.core.namedparam.SqlParameterSource; import org.springframework.stereotype.Repository; /**  * * @author shoaib kiani */ @Repository public class EmployeeDaoImpl implements EmployeeDao{  NamedParameterJdbcTemplate namedPJT; JdbcTemplate jt;  public SqlParameterSource getSqlP(Employee e) { MapSqlParameterSource m=new  MapSqlParameterSource();  m.addValue("id", e.getID()); m.addValue("FirstName",e.getFirstName()); m.addValue("LastName",e.getLastName()); return m;} @Override public void save(Employee e) { final String sql="INSERT INTO authors('FirstName','LastName') VALUE(?,? )";  namedPJT.update(sql , getSqlP(e)); System.out.println("Passed");    }  }   This is the exception:  Exception in thread "main" java.lang.NullPointerException at com.mariam.employee.EmployeeDaoImpl.save(EmployeeDaoImpl.java:38) at com.mariam.employee.Main.main(Main.java:22)

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


Is it possible to list all packages installed by a PPA? I was cleaning up my PPA list recently, removing things I'm not using anymore, and there was one PPA where I was not sure if I even have the software installed.

I installed many packages from many PPAs on my system. I want to list all the installed packages which are installed from launchpad PPAs, not repositories.  Is this possible through command-line?


My situation is the following:    I had a Visa issued from 20.9 till 20.12 for 90 days. I stayed in Croatia for 80 days, I went back to my country @ 20.12 and my visa has ended.   does the 90/180 still apply even if i issued a new visa as my last one has ended?  I called the embassy and they told me it is per visa so if my visa has ended, I am eligible to apply for a new visa and stay for the period specified in the new Visa regardless of the history of the old visa.  However my friends are telling me that it still applies regardless ir your visa has ended or not so the rule isn't per visa and I am now pretty confused as they said they may accept the visa however, the officer can refuse my entry.  Does anyone has a similar experience?!

I have searched the web a lot and could not find an answer that fits my situation. Here are two links that are quite contradictory:       My situation:  I've visited Portugal in December 2012 for 29 days on a Schengen visa valid from December 1st, 2012 to February 1st, 2013 for research purposes (I am a Ph.D. student). I want to visit Sweden from February 10th, 2013 to May 10th, 2013 (89 days). I have applied for a Schengen visa again (for research). How will the 90/180 rule work in my situation?


I have become paranoid with adding new repositories lately, but since I need skype, I have to add the repository called canonical.  I read, it is necessary to uncomment (delete the # sign at the beginning) the line in /etc/apt/sources.list for the repository I want to use.   However, when I am in /etc/apt/sources.list, I can't find any repository with canonical in its name.

I keep seeing places refer to the "partner" repository as a place I can get software, how can I enable this repository? Please specify how to do this graphically and via command line.


The below code outputs "February,February,February,February, February"  However I am trying to output the last 6 months on a rolling basis - can anyone help?  Thanks!        DateTime EndDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);//The AddDays function is self explanatory although you can have negative numbers in here            DateTime StartDate = EndDate.AddMonths(-1); //When do you want the meetings to start DateTime.Today will return midnight           DateTime m = StartDate.AddMonths(-6);            List<months> monthstore = new List<months>();            months monthdata = new months();            while (m < StartDate)           {               monthdata.month = m.ToString("MMMM");               monthstore.Add(monthdata);                m = m.AddMonths(1);           }         var publicationTable = new[] {     new[] { monthstore.Select(x=> x.month).ToArray()  }  };

I have a class like this:  public class myClass {   public List<myOtherClass> anewlist = new List<myOtherClass>;    public void addToList(myOtherClass tmp)   {     anewList.Add(tmp);   }  }   So I call "addToList" a hundred times, each adding a unique item to the list.  I've tested my items to show that before I run the "addToList" method, they are unique.  I even put a line in to test "tmp" to make sure it was what I was expecting.  However, when I do this (lets say myClass object is called tmpClass):  int i = tmpClass.anewList.Count(); for (int j = 0; j<i; j++) {    //write out each member of the list based on index j... }   I get the same exact item, and it's the last one that was written into my list.  It's as if when I add, I'm overwriting the entire list with the last item I've added.    Help?  This makes no sense. I've also tried List.Insert, where I'm always inserting at the end or at index 0.  Still no dice.  Yes, I'm doubly source my indexing is correct and when I do my test I'm indexing through each of the elements.  :)  UPDATE: Okay, I tried this and still had the same problem:  foreach(myOtherClass tmpC in tmpClass.anewList) {         Console.WriteLine(tmpC.theStringInMyClass.ToString()); }   and still for each of the 100 items, I got the same string output... I'm sure I'm doing something completely stupid, but I don't know what yet. I'm still 100% sure that the right string is getting passed in to begin with.  -Adeena    Okay, I tried this and still had the same problem:  foreach(myOtherClass tmpC in tmpClass.anewList) {     Console.WriteLine(tmpC.theStringInMyClass.ToString()); }   and still for each of the 100 items, I got the same string output...  I'm sure I'm doing something completely stupid, but I don't know what yet. I'm still 100% sure that the right string is getting passed in to begin with.  -Adeena


For a given topological space, in the definition of 'Compact set', why do we require the existence of finite subcover for any open cover? Why not countable subcover? In particular, what is the importance of having finite subcover for an arbitrary space?   Any help in this regard would be appreciated.

I've read many times that 'compactness' is such an extremely important and useful concept, though it's still not very apparent why. The only theorems I've seen concerning it are the Heine-Borel theorem, and a proof continuous functions on R from closed subintervals of R are bounded. It seems like such a strange thing to define; why would the fact every open cover admits a finite refinement be so useful? Especially as stating "for every" open cover makes compactness a concept that must be very difficult thing to prove in general - what makes it worth the effort?  If it helps answering, I am about to enter my third year of my undergraduate degree, and came to wonder this upon preliminary reading of introductory topology, where I first found the definition of compactness.


I have difficulties with a statement in the Java code, that is needed to be read in the SQL. The statement contains ? and is not understandable for me what is it's meaning. The code goes like this:      String sql = "SELECT lsw_id, lsw_planed_time, lsw_start_time, lsw_finish_time, lsw_exe_result, lsw_message FROM "             + ENTITY_NAME             + " WHERE lsw_planed_time < ? AND lsw_start_time IS NULL";   I would please require some help.

I am planning to replace repeatedly executed Statement objects with PreparedStatement objects to improve performance. I am using arguments like the MySQL function now(), and string variables.   Most of the PreparedStatement queries I have seen contained constant values (like 10, and strings like "New York") as arguments used for the ? in the queries. How would I go about using functions like now(), and variables as arguments? Is it necessary to use the ?s in the queries instead of actual values? I am quite confounded.


I keep getting a job offered by my company everywhere a careers ads box is shown. Is that a normal or intended behaviour?  Here's the company page, you can see that I'm already added to the company:   And here's a screenshot taken from StackOverflow:    I think I shouldn't be receiving job offers from the company I work at, should I?

I just saw this ad on the side of Stack Overflow:    I currently work for stealth.travel.  It even shows it when I click on the link!    How is it possible that the system does not link 2 + 2 together and not show me the company I already work for in the banner ad? (not that I am looking for a new job, just curious how my own company showed up there)


We have a package called XYZ for an app we are planning to publish on the AppExchange. The version 1.2  had a field called  'Level__c'  The version 1.2 of the package successfully went through Security Review. We are presently at version  1.8. The app is ready to be made public on AppExchange.  We need to delete the field Level__c from the package as it is creating issues in the functionality.  Is this possible? We can not make a new package on a new org, as the security review was done on this org.

Question  Is there anyway to get rid of custom field in a managed package that has been referenced in a custom report type for that managed package?  Background  I've built a managed package and for some unknown reason installed several add on packages (s4twitter) into the managed package dev org.  We're no longer using these packages and are trying to rip them out.  However, one of the fields for the s4twitter package made it's way into a custom report type.  Before I can uninstall the s4twitter package I need to get the field out of the custom report type, but I'm blocked.  Is there anything I can do to untangle this mess and rip out the s4twitter package?


After adjusting chrome://flags/ Chrome is crashing completely.  I can't revert anything because of the "aw snap" and crashing. I wish to reset all flags from a different Google account, like a mirror. Is this possible? and how?

I was messing around with chrome://flags/, and don't remember all the changes I made. Now I want to get it back to its default state.  Since I use Sync, does reinstalling Chrome do it? Or better yet, is there a way to do it without reinstalling?


In the following code:  using Previous = std::atomic<void*>; template<class T> struct Element{     Previous previous;     T value; }   Am I allowed to do pointer arithmetic to get Element<T>* from T* ? Like this:  template<class T> Element<T>* getElement(T* value){    return static_cast<Element<T>*>(static_cast<void*>(reinterpret_cast<unsigned char *>(value) - sizeof(Previous))); }   Where T may be non-standard layout.  P.S. I clearly see that I cannot use  for this. But, may be for this special case, pointer arithmetic will work?

Why does the sizeof operator return a size larger for a structure than the total sizes of the structure's members?


A large amount of computing resources is required to compute exact probabilities for the Kruskal–Wallis test. Existing software only provides exact probabilities for sample sizes less than about 30 participants. These software programs rely on asymptotic approximation for larger sample sizes. Exact probability values for larger sample sizes are available. Spurrier (2003) published exact probability tables for samples as large as 45 participants.[7] Meyer and Seaman (2006) produced exact probability distributions for samples as large as 105 participants.[8]


By writing $e^x$ as a infinite series proof that for every $x\geq{0}$ is true: $$ e^{x-1} \geq{x} $$ Also when is true $e^{x-1} = x$?

By expanding $e^x$ into a series $\sum e^x$ prove that $$\forall x \in \mathbb{R}, x \ge 0 \implies e^{x-1} \ge x$$  Also show when this inequality becomes equality.  I'm not really sure how to attack this problem at all, any tips would be very welcome.


I was looking for some explanation in the FAQs about this problem but I could not find anything.  I will explain:   User A asks a question about X User B starts helping him in the comments. After a few comments, User A asks User B to talk with him by email (giving his email in a comment) User B answers yes and posts his email too.   I want to discuss two things:   First, is it legal to try to solve questions where at first you use Stack Overflow as platform to get solved and then you solve with another Stack Overflow user by themselves without letting us know what happens? Second, why would these people resort to this method instead of using Stack Overflow like all of us?

I've come across quite a few answers that request the asker to, for example: "send the user an email", after which the answerer will provide them with the code or other resources they're looking for.  A few examples:          Should we take action against these questions?  I feel like these answers aren't appropriate (see my answer below).  Update:  Perhaps there are some cases where this is acceptable. I've seen a few questions regarding a particular piece of commercial software where the author/developer of the software answers, telling the asker to contact either them or their organization's in-house support.  I'm on the fence about this case. If I came across a question here describing a similar problem I was having, it would be useful to me to have the support information and know that I could contact it for assistance.  I'm interested in others' opinions on this situation in particular.


I have an EOS Rebel T7i and am wondering if I can put an EF 75mm-300mm lens on it.  Thanks and have a great day!

I have a canon 760D. It has a EF-S lens mount. Am I able to use a EF lens with my camera?


I have already asked the question and got too much of a short answer, which didn't allow me to actually solve the problem. I'm sure that elaboration is needed, so more users could enjoy an answer. The question:  Is it possible to display the full URL of the home page in Drupal 7, like:   www.example.com/The-best-example-possible   I'd like to display the full URL of the home page as displayed above, and not only the Pure URL which in this case is:  www.example.com   How can that be achieved? what file\s should i go for doing that, where can such file\s be found?, what exactly to change, etc.  Thank you !

Is it possible to display the full, absolute URL of the home page in Drupal 7, like  www.example.com/The-best-example-possible ?  I'd like to display the full URL of the home page, not just the hostname.


Importing files with windows7 will detect all phone photo files and not just those under camera/DCIM directory , want to use windows so can change files names same way as when importing from camera, I know there are other programs, thanks, would appreciated tips how to do it importing with windows 7 resident program.

When trying to import photos from my Galaxy S2 in Windows, it tries to import all image files on the phone (including application data), not just those in DCIM.   The system is Android 4.0.3. The phone is set to connect as a camera (but Windows Explorer can still see the full directory structure on the phone and SD card.)


I legit just broke my bike chain riding it. One of the links just snapped and i wanted to replace it with a brand new chain that will hold up better. How many links do i need in that new chain so that it will fit on my bike?

I am replacing the chain on my road bike soon.  How do I know how many links to get?  Does it have to exactly 114 or 116.  Or is it not a big deal?  I ordered a 116 link chain.  Will I need to shorten it?  Thank you.


There was a book I read quite a while ago where due to population problems the population of the world was divided into seven parts.  Each part actively lived one day a week and were in suspended animation for the other six days. The protagonist gamed the system and was living each day under different identities.

This story is about a man that is able to live every day of the week, while everybody else has a single day of wakefulness assigned to them. Due to overpopulation, each human spends 6 out of 7 days of the week in stasis, and has jobs assigned to them in daily shifts. 1/7 of the population works on Monday. 1/7 works on Tuesday, & so on. The main character has found away to circumvent the process and illegally live out his days consecutively by skipping the stasis program that is imposed on the general population and by working a different job everyday. Can somebody name this scifi story?


Let $V$ and $W$ be finite dimensional vector spaces on a field $F$. Show that $\dim(V\oplus W) = \dim V +\dim W$.   My idea: let $\dim V=n$ and $\dim W=n$. So $\mathcal{A}=$ {${v_1 , v_2 ,... , v_n} $} and $\mathcal{B}=${${w_1, w_2 ,... ,w_m}$} this means $\forall v\in V$, $v=x_1 v_1 + ... +x_n v_n $ such that $x_1 , ... , x_n \in F$ . Similarly, $\forall w\in W$ , $w= y_1 w_1 + ... + y_m w_m$ such that $y_1 , ... , y_m \in F$ . I know as $V$ , $W$ have finite basis $V\oplus W$ has finite basis, I mean, $\forall (v,w)\in V\oplus W$ , $(v,w)=a_1 (v_1 ,w_1 ) + ... + a_p (v_p , w_p )$ such that  $a_1 , ... , a_p \in F$ . Let $p$ is minimum between ${m,n}$ .Beside, $\forall (v,w)\in V\oplus W$ , $(v,w)=(v,0)+(0,w)$ . So we can say, $(v,w)= x_1 (v_1 ,0) + y_1 (0,w) +...+ x_p ( v_p , 0) + y_p (0 , w_p)$.  I want to know how I have to continue to get correct proof. Also, I want to write in mathematical way. I will appreciate any help.

$V = U_1\oplus U_2~\oplus~...~ \oplus~ U_n~(\dim V < ∞)$ $\implies \dim V = \dim U_1 + \dim U_2 + ... + \dim U_n.$ [Using the result if $B_i$ is a basis of $U_i$ then $\cup_{i=1}^n B_i$ is a basis of $V$]  Then it suffices to show $U_i\cap U_j-\{0\}=\emptyset$ for $i\ne j.$ If not, let $v\in U_i\cap U_j-\{0\}.$ Then \begin{align*} v=&0\,(\in U_1)+0\,(\in U_2)\,+\ldots+0\,(\in U_{i-1})+v\,(\in U_{i})+0\,(\in U_{i+1})+\ldots\\ & +\,0\,(\in U_j)+\ldots+0\,(\in U_{n})\\ =&0\,(\in U_1)+0\,(\in U_2)+\ldots+0\,(\in U_i)+\ldots+0\,(\in U_{j-1})+\,v(\in U_{j})\\ & +\,0\,(\in U_{j+1})+\ldots+0\,(\in U_{n}). \end{align*} Hence $v$ fails to have a unique linear sum of elements of $U_i's.$ Hence etc ...  Am I right?


If I search for a bookmark in my Library, how do I know which of the many folders on  left was it stored in?

When I search bookmarks I can't find a way to locate the folder of the result.  I have many bookmarks folder and subfolders and most folders and subfolders contain some bookmarks. When I cannot remember or guess the folder where a bookmark resides but I know I have it, I can search for bookmarks and all results are listed and I can click each result. There are properties of each result displayed. I would expect that the folder where a bookmark lives is an important property, but I cannot find this information.  Is this a one way street? Once you put it somewhere you have to always remember where you put it, otherwise no way to locate it? Is such a basic back reference missing in the Firefox bookmarks search?  Edit: In the meantime I found a related question (my question is also asked as a secondary question there), just for reference:   Edit 2: This was already filed as a bug:  as pointed out by m_cowen_uk in his answer.


I have sample codes below:  List<string> test = new List<string>(); test.Add("Hello2"); test.Add("Hello1"); test.Add("Welcome2"); test.Add("World"); test.Add("Hello11"); test.Add("Hello10"); test.Add("Welcome0"); test.Add("World3"); test.Add("Hello100"); test.Add("Hello20"); test.Add("Hello3");  test.Sort();   But what happen is, the test.Sort will sort the array to:   "Hello1",  "Hello10",  "Hello100",  "Hello11",  "Hello2",  "Hello20",  "Hello3",  "Welcome0",  "Welcome2",  "World",  "World3"   Is there any way to sort them so that the string will have the correct number order as well?  (If there is no number at the end of the string, that string will always go first - after the alphabetical order)  Expected output:   "Hello1",  "Hello2",  "Hello3",  "Hello10",  "Hello11",  "Hello20",  "Hello100",  "Welcome0",  "Welcome2",  "World",  "World3"

Anyone have a good resource or provide a sample of a natural order sort in C# for an FileInfo array?  I am implementing the IComparer interface in my sorts.


Wanted to know if Panem is based on current real world location or just a conceptual place? Maybe in future, part of Mexico is divided to form Panem according to the story.

In , the nation of Panem (implied to be North America after some sort of post apocalyptic scenario) is divided into 13 districts and the Capitol. District 12 is hinted to be in the Appalachia Mountains, and the Capitol is hinted to be in the Rocky Mountains. District 13, which was destroyed, is described as "east of District 12", which made me think it's where Washington D.C. is today.  The other districts, however, were mostly ignored, and almost no detail was provided as to their locations in the books. Has there been any supplemental information that reveals where the districts are?


I have computed probabilities that horse A beats horse B, horse A beats horse C and so on. I want to find out the probability that the horse will finish in a particular position, say 2nd.  Edit: In a horse race, with multiple horses. I know the probability that horse 1 will be horse 2 and probability that horse 1 will beat horse 3 and so on. eg: probability of horse 1 beating horse 2 depicted as h1->h2: P h1->h2: 0.6 h1->h3: 0.7 h1->h4: 0.75 h1->h5: 0.8  i want to know what is the probability that horse 1 will attain a position say 2nd or 3rd?

I've seen a few similar threads to this on different forums but they don't seem to conclude to a satisfactory answer. My question is this:  If you have 3 horses, A, B, and C and you know the winning probabilities of each horse racing against each other as a pair, how do you work out their winning probabilities if all 3 horses race together? Is there a formula for n number of horses?  So you know the probabilities of: A beating B A beating C BA BC CA CB  I initially thought that: p(A winning) = p(A beat B). p(A beat C) But this is clearly wrong.  Can someone please help!! Many thanks Matt


I'm using Mac OS Mojave with Spring STS version 3.9.7.  So I'm trying to load some environment variables such as database username & password into my application.properties file but Spring fails to load them into.  I'v used this command to set the username environment variable:  export ABC_DB_UNAME=some_username   and when I do echo $ABC_DB_UNAME or printenv I can see the value.  In my application.properties file I set the username as below:  spring.datasource.username=${ABC_DB_UNAME}   Now when running my spring sts from the IDE itself, it is not able to pick up the values and it throws an exception that      access is denied for ABC_DB_UNAME@database_endpoint.    It clearly shows that spring sts is not picking up my environment variables.  What makes it more twisting for me is that when I run the spring app via maven using the below command, it picks up the environment variables and it works just fine.  mvn spring-boot:run   but using the mvn command I don't know how I can make the IDE to trigger the breakpoints for me to debug as well.  EDIT: Testing and trying to print the environment variable using the code System.getenv("ABC_DB_UNAME") and System.getProperty("ABC_DB_UNAME") also returns null but maven still works.

How can I get the System Variable value which is present in   MyComputer -> Properties -> Advanced -> Environment Variables -> System Variables   in Java?  Edit  I have used System.getenv() method.  It is printing value if I give   System.out.println(System.getenv("JAVA_HOME"));   and it is showing null value if I try the same for system variable created by me   System.out.println(System.getenv("DBE"));


I've heard sleeping directly after eating makes digestion less effective, i.e. you don't get all the nutrients you could get if you would stay awake. I've also heard it raises sugar levels in the blood. But does it have any negative long term affects?

I often read or hear that eating one's dinner right before going to sleep is bad for health. How true is that?


I'm reading a textbook on different forms of convergence, and I've seen several examples in the text where they have an arrow with a letter above it to indicate different types of convergence.  Does anyone know how to make that symbol?  I tried what I thought was the most obvious guess ("\to^P") but that didn't work...

What is a simple way to have \ll on top of \gg with equal size and vertically center aligned and have them work as a binary relation symbol like \lessgtr? The commands \underset and \overset cannot be used because they do not treat the two symbols equally, and they do not vertically center.


I am trying to suppress network printers showing up under Settings/Devices/Printers on my Ubuntu 17.10 (Gnome) desktop. It's my desktop in my office and all the printers in this building appear under Settings/Devices/Printers.  I have edited /etc/cups/cups-browsed.conf as:  BrowseRemoteProtocols none BrowseLocalProtocols none BrowseProtocols none   and restarted the service.  $ sudo service cups-browsed restart     But if I go to settings/Devices/Printers, I still see all the network printers.  Same even if I log out and then log in, or restart the system.  But it is not that the modification to the cups-browsed.conf file is reset on reboot.  If I manually remove the printers from the Settings/Devices/Printers list (by clicking the gear button next to the "No Active Jobs" and Remove Printer), they are removed but come back on my next visit to the Printers tab. I think it is not intended that the "remove" operation is effective only while I stay inside the tab.   If I stop the cups-browsed as:  $ sudo service cups-browsed stop  or  $ sudo systemctl disable cups-browsed   Settings crashes and on re-opening the Settings/Devices/Printers tab, all the printers are again there.   For your information, there is only one printer visible in  or in some of the printing dialogs. However, for example, the printing dialog in Chrome would show me tens of network printers.   How can I stop the system searching for network printers everytime I open Settings/Devices/Printers, or a printing dialog in Chrome?

In Raring, everytime I connect to the network, Cups installs all the printers in the network automatically, some more than once.  Furthermore, I connect a USB printer to the laptop every now and then. Even though the printer is configured already, another printer is added to the list.  I wish to disable this feature and allow only manual installation of printers. How do I go about it?


Why is it true, that if you have a system of two stars for example, moving around the centre of inertia of the system due to gravitation, these stars can be replaced by a single star of mass  $$\mu=\frac{m_1m_2}{m_1 + m_2}$$ where $m_1$ and $m_2$ are the masses of the initial stars?

Two particles with initial positions and velocities $r_1,v_1$ and $r_2,v_2$ are interacting by the inverse square law (with G=1), so that  $$ {d^2r_1\over dt^2} = - { m_2(r_1-r_2)\over |r_1-r_2|^3} $$ $$ {d^2r_2\over dt^2} = - { m_1(r_2-r_1)\over |r_1-r_2|^3} $$  (the inverse square law along the line of separation). What is the complete solution of these differential equations? What is the position of the two objects as a function of time?  After reading a lot on Wikipedia, I've come to the definition of center of mass and relative coordinates:   $$R(t) ~=~ \frac{m_1 r_1 + m_2 r_2}{m_1+m_2}$$  $$\ddot{r}(t) r(t)^2 ~=~ (m_1+m_2)G$$  Where $R$ is the center of mass, and $r$ is the displacement between the particles... Is this correct? How do I proceed to solve the differential equation?


Background Accepted answers are useful to show which answer helped the OP the most and are likely to be helpful to others; therefore they show at the very top of the list of answers; irrespective of the sort order or the votes on the accepted answer. This is usually has a good effect; showing the OP's favourite answer followed by the communities most upvoted answer (probably two very good answers) at the top. However this can have a slightly strange effect when the community is highly against the accepted answer and downvotes it heavily. In addition to having a (strongly believed to be) wrong answer first it also turns grey; leading to an odd visual effect of something that looks like the top answer being difficult to read and looking like a footnote. For example , they're wrong, everyone knows they're wrong and yet they sit at the very top of each of their questions. Their authors can't even correct the situation because accepted answers can't be deleted. Reasoning Ultimately the sort order isn't for any political reasons; it is to show you what is likely to be helpful first. The accepted checkmark is a strong indication that an answer will be useful, on the other hand a negative score is an indication that an answer is unhelpful; at some point the downvotes should win. Proposal When an accepted answer is sufficiently downvoted to turn grey ( <=-3 ) then it loses its accepted answer privileges to be at the top of the answers list as the community is clearly strongly against it. This avoids the mixed message of putting it at the top (saying its important) and marking it grey (saying its unimportant). What I’m not proposing I'm not proposing removing its check mark or in any way undoing its accepted answer status, it was accepted by the OP and we shouldn't mess with that. Related proposals  has a similar thrust but seems to be saying that an answer with downvotes, even if it has an overall positive score should not be at the top; that seems slightly mad and I'm not proposing that.

Similar to  but narrower, I'm suggesting we make a particular exception for downvoted accepted answers (those with score less than zero, or some other threshold like -3), so that they stay in the normal sort order and don't jump to the top.  The accepted answer  on bh.se is -5 at time of writing, above an answer with +8 (which is quite a good score on our little site!). It also doesn't help things that the accepted answer is about a mile long so it takes a lot of scrolling to get past it:


How to get the specific name of the current method in Ruby?  Example:  class Pages   def home     @title = self.name   end end   I want to get this result:  p = Pages.new p.home # it must print "home"

$0 is the variable for the top level Ruby program, but is there one for the current method?


I was just surfing questions, and I came across a question. But accidentally I clicked on downvote for that question. I immediately changed my downvote, but still, I earned a Critics badge. Can I rollback badges I earned?   As it is been tagged as a duplicate of a question I will clarify a bit more. How can we give up a badge by our own choice?

What are badges? How do users get badges? How can users get tag badges? Can badges be lost/revoked/taken away after they are awarded? If so, how and when? How can I suggest a new badge?   For more information, see "" and the  in the .


I am using Ubuntu 18.04. Output of : uname -r  Linux 4.15.0-117-generic x86_64  I know Kinemaster is for android, but is it possible to install on Ubuntu 18.04?

I have Ubuntu 16.04 on Dell Vostro 15. I want to install kinemaster on my pc. Can somebody suggest a fast and easy way ? I know it can be installed on Andriod, but can it be installed on an Ubuntu (linux) pc. If yes, please suggest a way


I first searched why is Torque defined as a cross product and a lot of people answered that it is defined as a cross product because angular momentum is defined that way and it is only logical that Torque and angular momentum have the same direction.  I know the cross product is used for the direction of angular momentum but why does the direction of angular momentum have to be in the direction of axis of rotation and even if it has to be in the direction of axis of rotation then why does it have to be a cross product and not some other mathematical product.  also why is the magnitude of angular momentum defined as $$ ||p||*||r||*\sin{\theta} $$

We can define cross products mathematically like if we take two vectors, we can find another vector with certain properties but why do we use it in physics, if we consider a hypothetical physical quantity like force which is equal to cross product of certain vectors?     For example, the force exerted on a charge in motion in an uniform magnetic field.   Why is it so? Why does that force have to be a cross product of two vectors?  Is it possible to come up with them when what we do is just observe the nature?


I have a sign up form where people can enter their name and address, then click on a submit button.  However I am getting BOTs entering sign up details and submitting the form - or at least I presume it is a BOT, the user agent is "Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1" which seems ok, but the name is something like "5914f968f3ea6" and they did not confirm their email address immediately (I deleted the accounts when I noticed this, so it is now too late to confirm their email address on the off chance they are a real person).  I have had 4 BOT entries, so I was just wondering ... why would anyone have a BOT that submits fake sign ups?

I'm a bit confused as to why people make bots to do this - is it to find vulnerabilities?   I recently upgraded my contact form security with more client and server side validation, including a honeypot and log/ban to stop erroneous submissions on my contact forms.  While this cured the issue quick fast and in a hurry, I'm still not 100% sure why this even happens.  continued Most of the submissions were gibberish, however, I did recently have an email hijacked and a malicious script tried to send thousands (almost 6,000) spam emails in just a few minutes.  I think a weak password was the cause and I'm not convinced they're related, but the  possibility looms in my mind. Thankfully, my server has a threshold of 500 emails per hour and cut it 5,500 short.


The man notices that his renters are more than unusual. They seem uncomfortable in their clothing, and he catches the women admiring their clothing at times. He becomes friends with one of the women. She brings him into her room where she gives him a drink I believe, that makes him drugged out to the point of feeling as if he's in a dream state. She turns on a viewing device, akin to our television, and shows him things no one has ever seen. Afterwards she tells him how sorry she is that he will be caught up in something dreadful. The something dreadful is the climax to the story.

Read this in early 1980s - man meets up with a beautiful girl with equally beautiful friends.  They are space tourists who visit disasters across galaxies and who are in town (San Francisco?) to await the catastrophe which is about to occur.


Is there any reason why you may want to use " " and not ' ' to output blanks in Java (any version)?  In "Data Structures and Problem Solving Using Java (4th Edition)" by Mark Allen Weiss, it says that it is a common error to not use " " instead of ' ': i.e. We should use " ".  As far as I know, there are no differences between the two.  Trying:  System.out.println("a b c" + ' ' + "d e f"); System.out.println("a b c" + " " + "d e f");   There seems to be no difference in the output.

Is there a difference between single and double quotes in Java?


I'm trying to run multiple background processes and then exit with an error if any of them fail.  For whatever reason, I cannot get the exit status from wait to behave as documented.  This is maddening because if I try wait manually from the command line, I get the expected results, but when I try to run my script which launches remote processes, wait always succeeds.  #!/bin/bash -ex # ... pids= for remote in $REMOTE; do     ssh $remote run-script.sh & pids=${pids:+${pids} }$! done  set +e wait $pids result=$? set -e  echo $result    # should be nonzero because remote script exits with 1   debug output (the exit 1 is from the remote script)  ++ pids= ++ for remote in '$REMOTE' ++ pids=8142 ++ set +e ++ wait 8142 ++ ssh user@host run-script.sh ++ exit 1 ++ result=0 ++ set -e ++ echo 0 0   I've also tried using jobs but abandoned it because of inconsistent results if the script ends quickly:  wait < <(jobs -p)

How to wait in a bash script for several subprocesses spawned from that script to finish and return exit code !=0 when any of the subprocesses ends with code !=0 ?  Simple script:  #!/bin/bash for i in `seq 0 9`; do   doCalculations $i & done wait   The above script will wait for all 10 spawned subprocesses, but it will always give exit status 0 (see help wait). How can I modify this script so it will discover exit statuses of spawned subprocesses and return exit code 1 when any of subprocesses ends with code !=0?  Is there any better solution for that than collecting PIDs of the subprocesses, wait for them in order and sum exit statuses?


I'm not really sure how email routing works, but someone ordered something on Amazon and I received the email instead of them.  Or maybe we both got it, I don't know.  The order doesn't show up in my account, so I'm certain I wasn't charged for it, but I shouldn't be getting other peoples' emails.  We'll say that my email is johndoe1@gmail.com, and somebody who's email is john.doe1@gmail.com places an order on Amazon.  The confirmation email is sent to me at johndoe1@gmail.com.  I checked the email header, and it did say To: john.doe1@gmail.com which is not my email address.  At first I thought that Google ignores periods in email addresses, but I tested the account setup and it doesn't give any error when you put a period in the address.  I didn't create the account; I just used the "check availability" function and the address I chose with a period was fine.  Maybe someone with knowledge about how Email works could tell me why this happened.  Is this a bug in the way Amazon sends emails?  Or is it a bug in how Google receives them?  Who should I report this issue to?

E.g.: If your Gmail ID is abc.xyz@gmail.com, it considers this the same as abcxyz@gmail.com.  Why is this so?


I'm trying to make a timer within javascript. I want the timer to stop on click but it won't. I have two parameters: "start" and "stop". I want my program to restart the timer if the start button is clicked while the timer is already going and to stop when the stop button is clicked.  function timer(start, stop) { let count; if (start) {     let count = 0;     setInterval(() => {         count++;         console.log(count);     }, 1000); } if (stop) {     count = count; }   }

I am using setInterval(fname, 10000); to call a function every 10 seconds in JavaScript. Is it possible to stop calling it on some event?   I want the user to be able to stop the repeated refresh of data.


Usually I find compound adjectives quite straightforward, but I'm not so sure when it comes to the following:  A 210-million-people market    So how should I refer to a market 210 million people large with a compound adjective before the noun?

How do you know when to use singular or plural nouns if they're used as adjectives?  i.e.     32-bit computer vs 32-bits computer?      teacher union vs teachers union?      wedding planner vs weddings planner?      sport medicine vs sports medicine?      student council vs students council?   Which one is correct?


I am looking for administrative divisions' shapefile for Italy for QGIS. I found one which is a bit old with some inconsistencies.   Can anyone please suggest a database to find better (or newer) shapefiles?

I am after Italian GIS data - administrative boundaries such as:     Regions (Regioni) Provincies (Provincie) Municipalities (Comuni) Districts (Quartieri) City quarters (Contrade o Rioni) Zones (Zone) Suburbs (Frazioni)  and Postcodes.  I can find data some data to download - for example     But I want to make sure I have the most up to date data.  Who is the official supplier of this data? Which government department manages this GIS data? When the data is updated how will I know?  In Australia  there is a government department that manages this data and every 3 months we are are sent updates if we pay some $. I am not sure if there is an equivalent in Italy