$I$ an irreducible ideal in a PID is a prime ideal

$I$ is irreducible ideal of $R$ when $R$ is a PID , I want to show it's a prime ideal.  The definition I am familiar with: $I$ a proper ideal of $R$ is an irreducible ideal if for any two ideals $J,K$ such that $I\subseteq J$, $I\subseteq K$ , then $I\neq J\cap K$    Well denoting $I=\langle a\rangle$ , Assuming $I$ is not a primes, means there are $x,y\in R$ , such that $xy\in\langle a\rangle$ such that $x\notin\langle a \rangle$ , $y\notin\langle a \rangle$.  Taking $\langle x \rangle \cap \langle y \rangle$ , we get an ideal such that $a\in \langle x \rangle \cap \langle y \rangle$ because $a=xy\in \langle x \rangle$ , $a=xy\in \langle y \rangle$. So $\langle a \rangle \subset\langle x \rangle\cap \langle y \rangle$.  For $r\in  \langle x \rangle\cap \langle y \rangle$  I tried to show $r\in \langle a \rangle$ but didn't succeed, I gotthe next results:   $r = xd , r=ye \Rightarrow r^2=xyed=a\cdot ed\Rightarrow r^2 \in  \langle a \rangle$ $r=xd , r=ye \Rightarrow ry=xyd=ad$ and$ rx=yxe=ae\Rightarrow rx,ry\in \langle a \rangle$.


Where was Thanos before the events of Avengers: Infinity War?

In Avengers: Infinity War, Thanos is depicted collecting 5 of the 6 Infinity Stones relatively breezily (as  where only for a moment do the Avengers come close to stopping him).  Where was he before the events of Avengers: Infinity War? If he's so powerful and capable, why didn't he do all this 10 years earlier or a week earlier instead of on this specific day (or two)?


Consider the following MWE:  \documentclass{scrreprt}  \usepackage{textcase}  \RequirePackage{listings} \usepackage[american]{babel}  \begin{document}     \MakeTextLowercase{A~B} \end{document}   LaTeX fails with the error  ! Undefined control sequence. <to be read again> az                      b l.9     \MakeTextLowercase{A~B}  ?    The error seems to lie in the combination of MakeTextLowercase, the listings package and the tilde. Whenever I remove any of these three components, everything works fine. Does anyone have a clue where the problem is?


Box2d :What is the best approach to build static Box2d smooth curve line

i want to know what is the best approach to simulate smooth curved line as static body  it will be like path for car to drive . something like this :   how does its box2d static body are constructed ? Thanks


I wan't decode json string from file, but there is problem with special characters(for ex. '™', '★'..). My code from PHP  $price_string = file_get_contents("/var/www/bot/price.json"); $price = json_decode($price_string, true); echo $price["StatTrak™ P250 | Mehndi (Field-Tested)"];   Result should be 12.01, but the result is this:  Notice: Undefined index: StatTrak� P250 | Mehndi (Minimal Wear) in /var/www/html/menu.php on line ..   And the JSON string is for example:  {     "★ Huntsman Knife | Boreal Forest (Well-Worn)": 62.84,     "StatTrak™ P250 | Mehndi (Field-Tested)": 12.01 }


I have a problem about updating in terminal

Here is the link, please help me what it means below:   http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2518248EEA14886   What should I do with the link above


Tables generated by LaTeX are usually not good looking. The standard thickness of row and column separators and also the corners where the rules meet leave much to be desired. Are there any examples of beautiful tables using TikZ available?


I need to adjust the vertical spacing between three tables as defined in the following MWE.   \vspace{30pt} only works for between the second and third table. I'm suspecting this has something to do with the minipages defined but I need them for the footers beneath the tables.   Any clues?  \documentclass[12pt, a4paper]{report}  \begin{document} \begin{table}[t] \begin{minipage}{\textwidth}  \renewcommand{\thefootnote}{\thempfootnote} \centering \setlength{\tabcolsep}{12pt} \renewcommand{\arraystretch}{1.3} \begin{tabular}{ l l l } \hline     \multicolumn{1}{|c|}{X} & \multicolumn{1}{c|}{Y} & \multicolumn{1}{c|}{Z } \\ \hline \multicolumn{1}{|c|}{YYYYY.\footnote{Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy} + ZZZZZ.} & \multicolumn{1}{c|}{62.9\% (73.2\%)} & \multicolumn{1}{c|}{213} \\   \multicolumn{1}{|c|}{XXXX + YYYYY.\footnote{Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy}} & \multicolumn{1}{c|}{81.5\% (92.8\%)} & \multicolumn{1}{c|}{638} \\   \multicolumn{1}{|c|}{XXXX + ZZZZZ.} & \multicolumn{1}{c|}{80.9\% (93.8\%)} & \multicolumn{1}{c|}{560} \\   \multicolumn{1}{|c|}{XXXX + YYYYY.\footnotemark[\value{mpfootnote}] + ZZZZZ.} & \multicolumn{1}{c|}{94.8\% (98.7\%)} & \multicolumn{1}{c|}{155} \\ \hline \end{tabular} \caption{Results for a} \end{minipage} \vspace{30pt} \begin{minipage}{\textwidth}  \renewcommand{\thefootnote}{\thempfootnote} \centering \setlength{\tabcolsep}{12pt} \renewcommand{\arraystretch}{1.3} \begin{tabular}{ l l l } \hline   \multicolumn{1}{|c|}{X} & \multicolumn{1}{c|}{Y} & \multicolumn{1}{c|}{Z } \\ \hline \multicolumn{1}{|c|}{YYYYY.\footnote{Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy} + ZZZZZ.} & \multicolumn{1}{c|}{67.7\% (81.7\%)} & \multicolumn{1}{c|}{344} \\   \multicolumn{1}{|c|}{XXXX + YYYYY.\footnote{Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy}} & \multicolumn{1}{c|}{80.4\% (92.6\%)} & \multicolumn{1}{c|}{810} \\   \multicolumn{1}{|c|}{XXXX + ZZZZZ.} & \multicolumn{1}{c|}{82.1\% (94.2\%)} & \multicolumn{1}{c|}{727} \\   \multicolumn{1}{|c|}{XXXX + YYYYY.\footnotemark[\value{mpfootnote}] + ZZZZZ.} & \multicolumn{1}{c|}{90.6\% (97.0\%)} & \multicolumn{1}{c|}{267} \\ \hline \end{tabular} \caption{Results for B} \end{minipage} \vspace{30pt} \begin{minipage}{\textwidth}  \renewcommand{\thefootnote}{\thempfootnote} \centering \setlength{\tabcolsep}{12pt} \renewcommand{\arraystretch}{1.3} \begin{tabular}{ l l l } \hline   \multicolumn{1}{|c|}{X} & \multicolumn{1}{c|}{Y} & \multicolumn{1}{c|}{Z } \\ \hline \multicolumn{1}{|c|}{YYYYY.\footnote{Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy} + ZZZZZ.} & \multicolumn{1}{c|}{73.2\% (79.4\%)} & \multicolumn{1}{c|}{97} \\     \multicolumn{1}{|c|}{XXXX + YYYYY.\footnote{Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy}} & \multicolumn{1}{c|}{86.0\% (94.0\%)} & \multicolumn{1}{c|}{315} \\   \multicolumn{1}{|c|}{XXXX + ZZZZZ.} & \multicolumn{1}{c|}{88.5\% (95.5\%)} & \multicolumn{1}{c|}{157} \\    \multicolumn{1}{|c|}{XXXX + YYYYY.\footnotemark[\value{mpfootnote}] + ZZZZZ.} & \multicolumn{1}{c|}{90.5\% (95.9\%)} & \multicolumn{1}{c|}{74} \\ \hline \end{tabular} \caption{Results for C} \end{minipage} \end{table}  \end{document}


Poor grades in courses related to my PhD thesis. Is that an indication to my research and future academic career potential?

My PhD research will be in numerical modeling of Selective laser melting (SLM) process. I will be using finite element method, Fortran and python programming and a bit of machine learning in my research. My research is going to be completely computational based. I will be using Abaqus finite element analysis software for my research.  I took three courses (Finite Element Analysis, Mechanical behavior of materials and Numerical methods in scientific research) as part of my grad school requirements. I have a background in metallurgical engineering.  Now, I have got B-, A-, B+ grades in the three courses respectively. And I had worked hard for these courses, probably should have worked harder. My advisor says the grades and courses are a formality and I should focus on my research as I will learn more by doing than through any coursework.  It's true that I won't be developing any finite element code for my research and I will learn programming and fundamentals of material behavior as I go about my research, I am concerned that the abysmal grades in the courses is an indication to my research and future academic career inability. Is it? Any advice?


When I write:  \documentclass{report} \begin{document} \begin{thebibliography}{99} \bibitem{key1} First item  \bibitem{key2} Second item  \end{thebibliography} \end{document}   The pdf displays "Bibliography" like a title. Can I change it? For example, istead of displaying "Bibliography", displaying "Information sources". Also, can I make it appear in the table of contents?  Here is my full preamble:  \documentclass[12pt,a4paper,twoside]{report} \usepackage[catalan]{babel} \addto\captionscatalan{\renewcommand{\bibname}{Fonts d'informació}} \usepackage[nottoc,numbib]{tocbibind} \usepackage{graphicx} \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage{fancyvrb} \usepackage{color} \usepackage{float} \usepackage{verbatim} \usepackage[utf8]{inputenc} \usepackage{setspace} \usepackage{parskip} \parskip=2mm \makeindex   Thanks for your help.


$x^2-y^2=2s$, s cannot be an odd integer

How can we prove that if $x^2-y^2=2s$ holds, s cannot be an odd integer. What theorem in number theory should we use?


I would appreciate a little help in finalizing a proof for the following:  Let $a_n$ be the sequence defined as $a_1 = 1$, $a_2 = 8$, and $a_n = a_{n-1} + 2*a_{n-2}$ when $n \geq 3$. Prove that $a_n = 3*2^{n-1} + 2(-1)^n$.  I decided to use strong induction and show that if the statement is true for $1,...,n$ , then it is true for $n+1$ (going off the fact that the statement is true for $n=3$). I have: $$a_{n+1} = a_n + 2*a_{n-1} = 3*2^{n-1} + 2(-1)^n + 2(3*2^{n-2} + 2(-1)^{n-1}) = 3*2^n + 2(-1)^n + 4(-1)^{n-1}$$  Which is close to the result I want $(3*2^n + 2(-1)^{n+1})$ but the signs are switched for the $(-1)$ terms; therefore I suspect I missed a $-1$ somewhere, but I could not see where the error is.  I appreciate all and any help. Thank you kindly!


How should I structure my URLs for both SEO and localization?

When I set up a site in multiple languages, how should I set up my URLs for search engines and usability?  Let's say my site is www.example.com, and I'm translating into French and Spanish. What is best for usability and SEO?  Directory option:  http://www.example.com/sample.html http://www.example.com/fr/sample.html http://www.example.com/es/sample.html   Subdomain option:  http://www.example.com/sample.html http://fr.example.com/sample.html http://es.example.com/sample.html   Filename option:  http://www.example.com/sample.html http://www.example.com/sample.fr.html http://www.example.com/sample.es.html   Accept-Language header:  Or should I simply parse the  header and generate content server-side to suit that header?  Is there another way to do this? If the different language versions don't have different urls, what do I do about the search engines?    UPDATE 2011-12-06  Google has new recommendations for meta tags for explicitly pointing to other language content: .  UPDATE 2012-05-25  Related but not precisely:   UPDATE 2013-06-12  includes discussion of several URL schemes directly relevant to the question.


Let $X$ and $Y$ be subspaces of a vector space $V$. Show that $X\cup Y$ is a subspace if and only if $X\subset Y$ or $Y \subset X$

I'm currently learning linear algebra using textbook Linear Algebra Done Wrong, and I encountered this problem.  Let $X$ and $Y$ be subspaces of a vector space $V$. Show that $X\cup Y$ is a subspace if and only if $X\subset Y$ or $Y\subset X$  I don't really have any idea. I only figured out that 0 is in the set, so it is not empty. What else should I do? Thanks!!


Remove a directory from inside using the command line interface

Imaging the next simple file structure within the /home/user/ directory:    /home/user         |--dir0             |--dir1                |--file1   My current directory is 'dir1' and I remove the directory from inside with the following command:  rm -r ../dir1   After that (and not getting any errors on the terminal), the working directory still is the same and when using the command pwd the output is:  user@ubuntu:~/dir0/dir1$ pwd /home/user/dir0/dir1 user@ubuntu:~/dir0/dir1$   Why would the OS return that the working directory is 'dir1' if that was already removed from the filesystem?


How to prove that if group $G$ is abelian, $H = \{x \in G : x = x^{-1}\}$ is a subgroup?

$G$ is abelian, $H = \{x \in G : x = x^{-1}\}$ is a subgroup?  I know to prove that a subset $H$ of group $G$ be a subgroup, one needs to (i) prove $\forall x,y \in H:x \circ y \in H$ and (ii) $\forall x \in H:x^{-1} \in H.$


I am doing chi-square tests using . Just realized the test statistics will change even though you simply rescale all data and the testing outcome could change.  For example, using chisquare([8,5,9,2,7,5], f_exp = [6,6,6,6,6,6]), it gives test statistic = 5.3333, p-value = 0.377. But if I just naively double the input data, like chisquare([16,10,18,4,14,10], f_exp = [12,12,12,12,12,12]), the test statistic = 10.6667 (of course double), and p-value=0.0584. The test statistic doubles, and p-value decreases significantly.  I understand that, from the definition of Chi-Square, the test statistic will double and p-value will change. But I think rescaling data should not change statistic testing results. What logic do I make mistake here?


Add a message when posting to old questions with more than N answers

On Software Engineering I've been adding a message along these lines to old(ish) questions that have enough answers to be CW if they start getting new answers.     Please read all of the existing answers before posting yours. The question is relatively old and has a reasonable number of answers already. There is a good chance that your answer has already been posted.   I know most people don't read dialogs and just click "OK" to get through them, but if we can stop a few people adding to such questions then it's got to be good right?  The age of the question and the number of existing answers required that trigger this message can be configurable.


I want an app that displays browser inside an app, but I get this error:     FATAL EXCEPTION: main                                                      Process: com.example.name.app, PID: 11672                                                      java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.name.app/com.example.name.app.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Window$Callback android.view.Window.getCallback()' on a null object reference   Manifest.xml  <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.example.name.app">     <uses-permission android:name="android.permission.INTERNET"/>     <application         android:allowBackup="true"         android:icon="@drawable/icon"         android:label="@string/app_name"         android:roundIcon="@drawable/icon"         android:supportsRtl="true"         android:theme="@style/AppTheme">         <activity android:name=".MainActivity">             <intent-filter>                 <action android:name="android.intent.action.MAIN" />                  <category android:name="android.intent.category.LAUNCHER" />             </intent-filter>         </activity>     </application>    </manifest>   activity_main.xml  <?xml version="1.0" encoding="utf-8"?>  <LinearLayout     xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical">      <Button         android:id="@+id/button"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_gravity="center_horizontal"         android:text="Click"/>      <WebView         xmlns:android="http://schemas.android.com/apk/res/android"         android:id="@+id/webView"         android:layout_width="fill_parent"         android:layout_height="match_parent" />  </LinearLayout>   MainActivity.java  package com.example.name.app;  import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Button;  public class MainActivity extends AppCompatActivity {      Button button = (Button) findViewById(R.id.button);     WebView browser = (WebView) findViewById(R.id.webView);     String url = "http://www.google.com";      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);          button.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                  browser.setWebViewClient(new WebViewClient());                 browser.getSettings().setLoadsImagesAutomatically(true);                 browser.getSettings().setJavaScriptEnabled(true);                 browser.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);                 browser.loadUrl(url);             }         });     } }   What is wrong? Thanks!


Proving bipartition in a connected planar graph

Let $G$ be a connected planar graph with a planar embedding where every face boundary is a cycle of even length. Prove that $G$ is bipartite.  Any hints/tips will be greatly appreciated.


I am sorry if this is a basic question but I am struggling to come top with a simple file naming convention. I have never used one until now and want to work through all of my files.. From my research I came up with something like:  truckle-andrew_20201205_banes-keynsham_photo01.jpg  But what do we do when the photo has more individuals? For example, I have a photo which has my wife, and two of her sisters along with her sister-in-law. The date is 20160117. I don't know what to  use for the name part of the file name since this photo is associated with all four of them on the tree. I know this can be open to personal opinion so I don't want to start any debates or anything. I just want to start this right from the beginning as I have a lot of images to go through.


In the word mentality, how should the letter i be pronounced?  In , it's a shwa.  In , it's a shwa.  In , its American dictionary(at the middle of this page) says it's a short I.  In , it's a short I.  I'm confused by these dictionaries.   Is there a distinction between AmE and BrE? One say short I while the other say shwa?  Or they are both okay in the USA and the UK?


If I leave my job, what happens to my flexible spending account?

I am about to decide how much money to set aside for my 2013 Flexible Spending Account (FSA). (The max this year is $2500.) But I am wondering what happens if I switch employers during the year. Does the FSA from one employer somehow roll over to the new employer? Is it completely separate? Consider a couple possible scenarios. Scenario A Separate FSAs. I spent my entire election. I elect to put $2000 in my FSA. I spend all $2000 in the first four months of 2013. In July I start a new job for a new employer. It's midway through the year so they have only taken $1000 out of my weekly paychecks. Q1: Do they take $1000 out of my final paycheck? Q2: How much can I elect to put in the FSA at the new employer? (Can I bump it up to the $2500 limit?) Scenario B Separate FSAs. I underspent all my election. I elect to put $2000 in my FSA. I spend $600 in the first four months of 2013. In July I start a new job for a new employer. It's midway through the year so they have only taken $1000 out of my weekly paychecks. Q1: Do they take $1000 out of my final paycheck? Q2: Do I lose any of the unspent $1400? Q3: How much can I elect to put in the FSA at the new employer? (Can I bump it up to the $2500 limit?) Scenario C Coupled FSAs. I elect to put $2000 in my FSA. I spend $600. They have taken $1000 out of my paychecks. All that info somehow makes it to my new employer so they give me credit for having $400 in my FSA. Over the rest of the year they plan to take the remaining $1000 out of my paycheck. Q1: Am I allowed to make an upward/downward adjustment in my election amount?  (Can I bump it up to $2500? Can I bring it down to say $1500?) So many possibilities! Can anyone shed some light on how this works?


Can't restore the directory menu on the left side of the directory

On the left side of the picture there is the menu bar. Probably I clicked on something that cancelled it and I can't restore it.


I have a table such that;  \documentclass{article} \documentclass[a4paper,onesided,12pt]{report} \usepackage{array,longtable} \renewcommand*{\arraystretch}{1.5}  \begin{document}     \begin{center} \begin{table}[H] \caption{Çınar's emergent codes and corresponding themes} \begin{tabular}{|m{9cm}|m{5cm}| } \hline\multicolumn{1}{|c|}{RELEVANT CODES} & \multicolumn{1}{|c|}{THEME} \\  \hline Graph representation (false assumption) & \\  Graph completion & \multirow{1}{*}{Interpretation of    } \\  Determining slope & \multirow{1}{*}{graph} \\ Determining values for horizontal and vertical axes & \\ \hline Writing problem situation & \multirow{1}{*}{Making sense of model}  \\  Solve conflicts on variable- graph interaction by a model& \multirow{1}{*}{representation} \\  Writing reasonable real world situation & \\  \hline IV $\rightarrow$ time, DV $\rightarrow$ velocity & \\ IV $\rightarrow$ time, DV $\rightarrow$ location & \\  IV $\rightarrow$ undetermined, DV $\rightarrow$ location & \multirow{3}{*}{Searching for} \\ IV $\rightarrow$ decide to change IV except "time"& \multirow{2}{*}{variable} \\ IV $\rightarrow$ temperature, DV $\rightarrow$ temperature & \\ IV $\rightarrow$ time, DV $\rightarrow$ location & \\ IV $\rightarrow$ time, DV $\rightarrow$ subjects completed during summer school & \\ \hline IV $\rightarrow$ location, DV $\rightarrow$ time and looking their interaction & \multirow{3}{*}{Alignment of } \\  Manipulation of graph properties to fit graph to determined variables & \multirow{2}{*}{variable-graph }   \\  Finding conflict when matching variables on graph & \\ \hline  Converting graph to table & \multirow{1}{*}{Converting graph} \multirow{1}{*}{to table} \\ \hline \end{tabular} \end{table} \end{center}       \end{document}   I need to divide them into two parts since the table contains several rows and they did not fit in one page.


How can one set up a filter to forward automatically all outgoing Gmail messages?

I have been able to set up an automatic forward of all incoming Gmail, but for outgoing I set up a filter, and it doesn't do anything. I need the forwarding to be automatic and discreet.  I am going to try the Gmail Auto-forward script.


How to call an external program in python and retrieve the output and return code?

How can I call an external program with a python script and retrieve the output and return code?


How can I make the cursor in Windows with a multiple monitor setup behave like it's moving between all monitors having the same resolution?

I just added a new 4k monitor to my setup, bringing my total to 3. My problem is that windows "thinks" that the monitors are physically the relative sizes they are in the display settings, when they're really only an inch different (the 4k is 28" and the 2 1080s are 27").  This makes moving between the monitors a bit of a pain, since the mouse stops at the monitor edge when going from display 1 to either of the other 2.  The cursor also jumps to the middle of the screen when moving from either 1080 to the 4k.  Is there a way to get them to "line up" to the point where the cursor behaves like it's moving between monitors that have the same resolution?    System setup: nVidia GTX 970 Intel Core i7 4790K 16Gb ram Windows 10 Pro 64 bit


any option to show my answer above upvoted answers?

I have answered a question. I would be the 25th to give the answer. My answer is shown at the last in the list. I am sure that my answer is correct and will solve the questioner's problem. How can my answer be shown on the top or near by so that others give a glance.


Could anyone explain to me how did we get this result? This is simple example but I'm struggling with little o notation in general.


Subsample of a random sample: random sample?

Let's say you have a large random sample of soccer players in Europe but you are only interested in what happens in Spain. Could you reduce your sample to players in Spain and still call it a random sample (but of a different population)? If not, how would you call that subsample and which specific precautions should you take to be able to make inferences on the population of spanish soccer players?  My feeling is that using that subsample would be fine as long as it is large enough, but maybe I am missing something.


Seeking Symbology for Interactive Mapping?

When a user clicks on a map what should they expect to see?   I would say a symbol for where they clicked.  A pushpin seems to be the most accepted icon for generic data. Google has pushed the upside down tear drop.   What are other ideas/options and is there a place for finding professional gis oriented icon packs?  I ended up creating this,     This just popped up from the guys at map box. Clean


What's the best way to play additional lands in a turn? I am assembling a black/white deck but want to play with cards that have higher casting cost. I do not, however, want my deck to lose speed as a result.


Is there a proof of the irrationality of $\sqrt{2}$ that involves modular arithmetic?

I was reading Ian Stewart's Concepts of Modern Mathematics.     Using congruences, It's possible to explain why all perfect squares end in $0,1,4,5,6,9$ but not in $2,3,7,8$.    With this I had the idea of exploring the congruences for both sides of $n^2=2m^2$ in Mathematica:  Table[Mod[n^2, 9], {n, 0, 20}]  Table[Mod[2 m^2, 9], {n, 0, 20}]  And had the results:  {0, 1, 4, 0, 7, 7, 0, 4, 1, 0, 1, 4, 0, 7, 7, 0, 4, 1, 0, 1, 4}  {0, 2, 8, 0, 5, 5, 0, 8, 2, 0, 2, 8, 0, 5, 5, 0, 8, 2, 0, 2, 8}  But I'm still not sure if the outputs really show what I'm looking for, I have also tried $mod \;10$. The idea is still pretty loose in my mind, I'm stuck on deciding if this proves something or what directions I could take in this enterprise.


Bash script for 'apt-get update' with automatically insert password

I want make shell script to start sudo apt-get update, automatically insert password for sudo and automatically hit enter key.  I've tried:  #!/bin/bash sudo apt-get update expect "[sudo] password for username: " send "password"


How to apply the same style to different columns?

For many of my datasets I have the same imported data duplicated numerous times, each iteration displaying the data values for a different column (in my case it's fish catch weight per gridded cell per year, so lots of iterations of the same grid, with a different pattern of values per year).  For presentation purposes, it strikes me as helpful to use the same scale for each year, so I go to the original data and divide the maximum value into (arbitrarily) 10 classes and manually input the values and labels after setting the desired colour ramp and input data field:   This is extremely tedious, not just the manual excel calculation part, but also the input interface for the values & labels*, hence my intention to make use of the 'save style' option. HOWEVER: when I save the style as QML and load it for the next layer, it saves everything - including the data field (in my case, year). When I change this field, QGis automatically generates the values & labels based on the data for that field, ditching all of the values & labels I set.   Is there any way to avoid this happening & thereby duplicate class number, values and labels for each field by simply loading a style? (somewhat meta) Am I going around this the wrong way, OR, is there a different face I could use to climb this mountain?


When using the extra objects add on, I can create the shape (sine wave) I want by inputting the correct function.  Once I move onto another object, I can't reopen the options for changing the equation/size of the object.  I just want to add more periods to the sine wave but I can't get the original options for choosing the x and y size.


Will be something deleted if I upgrade from Ubuntu 12.10 to 13.04?

I want to upgrade to 13.04 but I dont know if something will be deleted ...


How to find which running process is modifying a file's permissions (Linux)?

There's a process in my system (a standard desktop installation with upwards of 150 quiescent processes at any time) that is sporadically resetting a config file's permissions that I have explicitly set so that it could be read by multiple users.   Even though I have ways to prevent that from happening (eg, changing the file's owner), I really want to find the process that is doing the change, if only so that I can terminate it with extreme prejudice.  I know the kernel has at least 2 mechanisms for this, inotify and the more recent fanotify. However, the latter only intercepts changes to file contents, not to the inode, while the former does detect such changes but doesn't report the process responsible.   So is there another kernel mechanism which i don't know about? Or some other roundabout way of "trapping" the process as it's going to change the file's permissions, or after it has done so?


Show that if the smallest prime factor $p$ of the positive integer $n$ exceeds $n^{\frac{1}{3}}$ then $\frac{n}{p}$ must be a prime or 1.

I am really having a problem understanding the proof of this question. Let me write the proof and i will explain my question  Let $p$ be the smallest prime factor of $n$. Assume that $p > n^{\frac{1}{3}}$ Then $p > n^{\frac{1}{3}} \Rightarrow p^{-1} < n^{-\frac{1}{3}} \Rightarrow np^{-1} < nn^{-\frac{1}{3}} \Rightarrow \frac{n}{p} < n^{\frac{2}{3}}$.  Let $m = \frac{n}{p}$, and assume that it is greater than $1$. Notice that $m$ cannot have a prime factor less than $n^{\frac{1}{3}}$. However  $n^{\frac{1}{3}} = \sqrt{n^{\frac{2}{3}}} > \sqrt{m}$  Therefore, $m$ does not have a prime factor less than $\sqrt{m}$. Hence, $m$ is a prime.  I really dont understand this proof and Why does $m$ not have a prime factor less than $n^{\frac{1}{3}}$? If someone can explain to me this proof i would really appreciate it ! thanks


How to make a Python Regular Expression, have an optional start requirement?

So I need to be able to check for the word "view" in a sentence, without pulling it out of another word, and even if its the first word.  import re   if re.search(r"view", "interview"):     print "aw"                          #This cuts it out of the word "interview"  if re.search(r" view", "interview"):     print "aw"                          #This wont cut it out of another word, but                                      #doesn't work if "view" is the first word.  if re.search(r" view", "view"):     print "aw"                          #This just shows it wont work since its the first word.


Is there any way to undo operation of last command in ubuntu?

The files located in extension directory got deleted through  execution of rm command in terminal Please suggest me appropriate solution to undo operation of last rm command


Delete files in /var/cache to save space

There is very little space left on my file system. I want to delete files in /var/cache to save disk space.  Are  there  some important files in the /var/cache which mustn't be deleted? If there are,please list all of them. My system is Debian.


How to algebraically solve $\frac{1}{x} < 5$ inequality to obtain two solutions?

Given the inequality:  $\frac{1}{x} < 5$  In order to find a solution, I would normally multiply both sides by $x$:  $1 < 5x$  Then I would divide by $5$  $\frac{1}{5} < x$  To obtain the solution: $x > \frac{1}{5}$.  Now, the thing is, the solutions are actually two: $x > \frac{1}{5}$ and $x < 0$  How am I supposed to reach this conclusion algebraically? It seems I'm not able to obtain the second solution ($x < 0$).  Thanks!


Bootable pendrive for Windows 10 Technical Preview

I want to install Windows 10 Technical Preview. I have downloaded its .iso file. Now I want to make a flash drive bootable. How can I do that?  I already have tried these 2 options.   Making a bootable pendrive via dd command, but it's not working.  sudo umount /dev/sdb sudo dd if=/path/to/windows10.iso of=/dev/sdb bs=1M && sync  I also have tried using WinUSB, but it's not working either.  sudo add-apt-repository ppa:colingille/freshlight sudo sh -c "sed -i 's/trusty/saucy/g' /etc/apt/sources.list.d/colingille-freshlight-trusty.list" sudo apt-get update sudo apt-get install winusb    It was just running a process showing a message that it's formatting the USB stick, but that didn't last for 20 minutes!! And I had to cancel it.  Is there any way I can make a bootable pendrive for installing Windows 10 from Ubuntu 14.04?


Proving $ \frac{x^3y^2}{x^4+y^4}$ is continuous.

The problem asks to show that $$f(x,y) = \left\{ \begin{align} \frac{x^3y^2}{x^4+y^4}, & (x,y) \neq (0,0), \\ 0, & (x,y) = (0,0), \end{align} \right.$$ is continuous at the origin, however it has resisted my bravest efforts. I have attempted using $x^4+y^4 \geq y^4$ and therefore $$\left\vert \frac{x^3y^2}{x^4+y^4} \right\vert \leq \left\vert \frac{x^3}{y^2} \right\vert$$ and similar strategies but they have failed. Trying to disprove it and see if it's discontinuous has only strengthened the belief that it's continuous.


Did Leia have any hint she was a Force user?

Leia was feisty in her youth. Before ROTJ, did she never get into a situation where her Force powers might show by accident?


(Java) Why does this constructor cause a null pointer exception?

I'm trying to make a matrix using two dimensional arrays, but when I try to print it to the screen I get a null pointer exception  import java.util.concurrent.ThreadLocalRandom;  public class GridWorld {   // data    int [][] grid; // a "r by c" grid will all entries of type int   int r; // no. of rows    int c; // no. of cols    final static int ROW = 4;  // Default row size    final static int COL = 4;  // Default col size    // constructors    // 1. default constructor: construct a 4x4 Grid of int   //    the entry at row i and col j is  4*i+j+1    public GridWorld() {     r=4;     c=4;     for(int i =0;i<r;i++){       for(int j=0; j<c; j++){         grid[i][j] = 4*i+j+1;}}    }    * -----------------------------      |    1 |    2 |    3 |    4 |      -----------------------------      |    5 |    6 |    7 |    8 |      -----------------------------      |    9 |   10 |   11 |   12 |      -----------------------------      |   13 |   14 |   15 |   16 |      -----------------------------   */  public void display() {    System.out.println("-----------------------------");    for(int i=0;i<this.r;i++){      for(int j =0;j<this.c;j++){        System.out.print("|    "+this.getVal(i,j)+" ");}      System.out.println(" |");      System.out.println("-----------------------------");}   }      GridWorld grid1 = new GridWorld();      grid1.display(); }     I was hoping this would print something similar to the commented picture, but instead it is giving me java.lang.NullPointerException  I'm pretty new to java and couldn't find how to fix this anywhere, any help would be greatly appreciated.


To quote :     Two commonly used languages that   support many kinds of implicit   conversion are C and C++, and it is   sometimes claimed that these are   weakly typed languages. However,   others argue that these languages   place enough restrictions on how   operands of different types can be   mixed, that the two should be regarded   as strongly typed languages.   Is there a more definitive answer?


Why does my bike vibrate when going down?

When I go down the mountain that is approximately 6% descent riding on a road, stop pedaling and remove hands from steerer (please save me from the comments about how that's a bad thing :p ) and reach the speed of, I'd say around 40 km/h, my steerer and entire fork start to vibrate. Do you know what could be possible reason for this? Is it something I should be very worried about? Same thing happens to some of my friends. I have a new fork (it happened with the old one as well), wheels are centered and cones are properly set both on wheels and fork.


Is XORing a SHA256 better than truncating it?

Let say I want to truncate SHA256 to 128 bits. What would be the best way to minimize a probability of a collision and improve collision resistance?   Taking the last 16 bytes Taking the first 16 bytes XORing the first 16 bytes and the last 16 bytes together   And should I assume that the same logic will apply for other hash functions from the SHA-2 set (like SHA516) as well as other hash functions in general, for example, SHA-1 or MD5?


Animated Series: Earth vanishes, two astronauts survive and explore space

I scarcely remember this animated series.  The gist of it is in the title: Earth vanishes (I can't remember the reason now but it was probably explained) and the only surviving humans were two astronauts on an interstellar spaceship. They decide to explore space and meet up with different aliens, hoping that one day they'll find out what happened to Earth.


How to change priority of Chrome's URL autocomplete

Let's say I frequently visit www.mydomain.co.uk  Chrome quite rightly suggests this URL when I begin to type "myd"  Now, I am very often going to www.mydomain.co.uk/directory - Chrome presumably has recognised that recently, I visit this page more frequently than I visit www.mydomain.co.uk. Now when I begin typing "myd", the first URL suggested to me is www.mydomain.co.uk/directory with www.mydomain.co.uk having been pushed down the list.  I want for www.mydomain.co.uk to always remain at the top of the suggested list, is there a way I can manually re-order the suggestions or perhaps ensure that www.mydomain.co.uk is always the first suggestion?    I'm aware that you can delete things from the autocomplete list, that's not what I'm looking for.


Show that an infinite set of families are linearly independent

I'm having problems with the following problem:  Let $V$ be a vector space over the field $F$. Let $n \in \mathbb{N}$. Suppose that $\left( v_1, \ldots,v_n \right)$ is a linearly independent family of vectors in $V$. Show that the families $\left( {{v_1},{v_1} + {v_2}} \right),\left( {{v_1},{v_1} + {v_2},{v_1} + {v_2} + {v_3}} \right),$ $\ldots,$ $\left( {{v_1},{v_1} + {v_2}, \ldots ,{v_1} + {v_2} +  \ldots  + {v_n}} \right)$ are linearly independent.  This is my attempt:  I take a typical finite subset such as $\left( {{v_1},{v_1} + {v_2}, \ldots ,{v_1} + {v_2} +  \ldots  + {v_n}} \right)$,  where $n \in \mathbb{N}$. Then suppose that $\lambda_1{v_1}+\lambda_2\left({v_1} + {v_2}\right)+ \ldots +\lambda_n \left({v_1} + {v_2} +  \ldots  + {v_n}\right)=0$,  where $n \in \mathbb{N}$.  I know there is the trivial solution $\lambda_1=\lambda_2=\ldots=\lambda_n=0$, but I'm not sure how to check if there are others?


Help with basic modular arithmetic question

I  but it was closed despite the link being non-applicable to my question. I need help solving the below basic modular problem,  Show that $39$ divides $17^{48}-5^{24}$  My course has NOT covered Fermat's Theorem. The only properties of modular arithmetic I know are additivity, multiplicativity, symmetry, and transitivity. My professor wants me to solve this question only using these basic properties, but I have honestly no idea how to do so. I don't know what pattern I'm supposed to recognize.


Can I use an external touchscreen with the Nexus 4?

I've seen a few videos of folk connecting their Nexus to an external monitor with a SlimPort HDMI cable. Would a 10 or 7 inch touchscreen work the same way? Or would it need a different cable connection?  If this is possible I can extend my Nexus 4 to a tablet :)


Why are my Macbook's internal speakers not available?

My Macbook (the unibody aluminum version) has lost its internal speakers. When I open System Preferences -> Sound -> Output, all I see is "Digital Out". If I plug in a pair of headphones, this switches to "Headphones". I don't see "Internal Speakers" at all any more. Headphones seem to work fine.  In System Profiler -> Audio -> Available Devices, I do see "Speaker: Connection: Internal".   I just clean-installed Snow Leopard, so it appears to be a hardware problem.  Is there anything I can do to fix this, short of taking it back to Apple? It's out of warranty.


Is Galen Marek ("Starkiller") part of the Star Wars canon?

Is  considered part of the Star Wars canon? More specifically, does he appear in any canon property?


Are there rules in 5e for shooting into combat?

What rules govern "shooting into combat" -- that is making a ranged attack on an enemy who is partially obscured by other creatures.  I know that the rules regarding cover may give the enemy an AC bonus in this case.  Is there any risk of hitting an unintended target on a miss?


I may get caught cheating on my finances exam

Long story short I just had two exams - one after the other. One required me to use LockDown Browser and the other one was in CANVAS. The second class is Finances and I asked a friend who already graduated from the same campus on Finances to help me out answer some questions. With that being said, the final question allowed us to attach a file with the procedure and I sent a PDF file of the excel sheet. The excel file has my friend as an author and I completely forgot to change/remove such a basic thing- later on there is a modification done by me. I sent an email right away after noticing the pdf was a mess just to notice the author thingy. I tried recalling the email but hey, 2021 and we still cannot edit tweets nor delete sent emails. I sent like two additional emails explaining that I messed up not adding my name on it and bla bla bla. Additional information. Teacher asked us to join the zoom meeting via phone and record our screen, hands and desk at ALL-TIME. Update: Teacher just replied to the email with the correct file that has name and no friend author. In case, just in case the teacher finds out about the author what could be a good excuse? "Teacher I had an exam before this one that required me to use Lockdown and my friend's laptop already had it so I proceeded to do the exam in the same laptop" "Teacher at that time my friend was at my house- my laptop had a BSOD so I proceeded to use his laptop" "Teacher I visited my friend and had no laptop- proceeded to use his and do the exam" I am so nervous- I am such an idiot because I graduate next semester... way to freaking go and messing up things. Finally, I would also like to add that the teacher said "it is not necessary to upload any file but if you want to overview something then you won't be able to". I simply do not what to think, do or say... I am shocked and worst thing is that they upload grades this weekend but I have classes with her once a week (THU). Also my friend lives like 3 hours away from me.


PHP : Regex to extract data from web url

I am receiving URL from an application as post data.   The URL has a signature : //abc.com/name?q=123456.   I want to extract name from the URL using regex ( Regular Expression ) How do I do that?


What's the relationship between irreducible number and prime number and query common example

I see from textbook that prime number must be irreducible number and not vice versa. But my degree of awareness is limitted in number field, so it's hard to understand because irreducible number is equivalent to prime number in number field. Thanks for helping me!


How to check the battery temperature of laptop? How do I know the normal temperature of it?

How to check battery temperature? How do I know the normal temperature of it?  My OS is Ubuntu, and my laptop is Lenovo G470.  Output of acpi -t:  Thermal 0: ok, 0.0 degrees C


ok... let's try this again! Newby here and i have a problem that is really really really annoying. Blender becomes sluggish with time! And i can't find a cause for it. laptop has 8 gig 4 cores 4 Gh While i run blender only 1 core is active around 1 Gh and rarely more. Less than 4 gig of memory is occupied. When i open the software it runs properly... i click on any object, vertex, etc... and it lights up immediately. But after about half an hour latter it can take more than a second for the item to light up. And after a full hour it is beyond 5 second. Someone suggested it could be the undo step??? if it was... when i close the file and open a new one, the system is suppose to drops the old undo list and create a new one... hence the system should then return to normal speed... it doesn't! Plus the lag time should not keep growing. it does! Therefore the problem must be something else. I tried reinstalling the software a while back but it didn't solve the problem. i didn't have that problem with... 3ds Max maya or Rhino (and i used a lot more undo step then, as i was beginning to teach myself 3d). Having to close and reload the software every 30 minutes is truly annoying! Does anyone have any usable ideal?


How to show that $\sin:\Bbb C\to\Bbb C$ is surjective

There is an easy way to show that the function $$\sin:\Bbb C\to\Bbb C,\quad z\mapsto \sin(z)\tag1$$  is surjective? My work so far: observe that  $$\sin(x+iy)=\sin(x)\cosh(y)+i\cos(x)\sinh(y)\tag2$$  Then its clear that $\sin$ is $2\pi$ periodic, as in the real case. Then it seems enough to restrict the study of $\sin$ to the domain $A:=[0,2\pi)\times[0,\infty)$ for $\Bbb C\ni z\equiv x+iy\in\Bbb R+i\Bbb R$.  However I can't see a clever (an elementary) way to show the surjectivity of $\sin|_A$. Some help will be appreciated.  EDIT: clearly $\sin(A)$ is connected because $\sin$ is continuous. Moreover: choosing $x_k=k\pi/2$ (for $k\in\Bbb Z$) we can see that $\Bbb R$ and $i\Bbb R$ are subsets of $\sin(A)$.


Sometime like this case I don't know if I can put the name before or after the label (movie in this sentence)...  The movie "Die Hard" or The "Die Hard" Movie? The variable "X" or The "X" variable?  Are they both correct? What is their difference? What is the application of each? My question is not about "the" (), but the order of the "movie" and "Die Hard"


Would the voltage of a power source decrease if multiple loads / more load is added to it? I am researching battery types, and wanted to know, if I added enough load to a battery how much / would there be any voltage drop? Example: I have a 12 V set of batteries in series. The batteries' rated current is 48 A. I have four loads that each require 12 V and 13 A of electricity. Would there be any voltage drop, would the load have to be significantly higher to actually see a decrease, or would the voltage stay the same?


I have two CheckBoxLists on my webpage. I have tried to center them on the page. Nothing so far has worked. I wanted to know if it has to do with the table that is created on databind and if I have to somehow add attributes to that instead of formatting the TR and TD? Any help would be appreciated.   I have tried creating three td's, putting the checkboxlist in the middle td and setting the left and right td's margin to 25%. Did not work.   I have tried setting the <td style="text-align:center;">, this did not work either.


How can I remove a package and its dependencies?

How can I go back to the state before the package was installed?  Install:  # apt-get -y install --no-install-recommends build-essential ... The following additional packages will be installed:   binutils cpp cpp-5 dpkg-dev g++ g++-5 gcc gcc-5 libasan2 libatomic1   libc-dev-bin libc6-dev libcilkrts5 libdpkg-perl libgcc-5-dev libgdbm3   libgomp1 libisl15 libitm1 liblsan0 libmpc3 libmpfr4 libmpx0 libperl5.22   libquadmath0 libstdc++-5-dev libtsan0 libubsan0 linux-libc-dev make patch   perl perl-modules-5.22 xz-utils Suggested packages:   binutils-doc cpp-doc gcc-5-locales debian-keyring g++-multilib   g++-5-multilib gcc-5-doc libstdc++6-5-dbg gcc-multilib manpages-dev autoconf   automake libtool flex bison gcc-doc gcc-5-multilib libgcc1-dbg libgomp1-dbg   libitm1-dbg libatomic1-dbg libasan2-dbg liblsan0-dbg libtsan0-dbg   libubsan0-dbg libcilkrts5-dbg libmpx0-dbg libquadmath0-dbg glibc-doc   libstdc++-5-doc make-doc ed diffutils-doc perl-doc libterm-readline-gnu-perl   | libterm-readline-perl-perl Recommended packages:   fakeroot libalgorithm-merge-perl manpages manpages-dev   libfile-fcntllock-perl rename The following NEW packages will be installed:   binutils build-essential cpp cpp-5 dpkg-dev g++ g++-5 gcc gcc-5 libasan2   libatomic1 libc-dev-bin libc6-dev libcilkrts5 libdpkg-perl libgcc-5-dev   libgdbm3 libgomp1 libisl15 libitm1 liblsan0 libmpc3 libmpfr4 libmpx0   libperl5.22 libquadmath0 libstdc++-5-dev libtsan0 libubsan0 linux-libc-dev   make patch perl perl-modules-5.22 xz-utils   Removal:  # apt-get -y --purge --auto-remove remove build-essential ... The following packages will be REMOVED:   build-essential*  # apt-get -y --purge autoremove ... The following packages will be REMOVED:   g++* g++-5* libstdc++-5-dev*   Why is the other stuff kept?


Test Class Issue with UNKNOWN_EXCEPTION, portal account owner must have a role

Im getting above error when i was trying to run my test class. In my test class i will create an Account, Contact. And this contact id will be used in my original code to create Community user.  I noticed following help article from SFDC. But couldn't figure out how to achieve.   Here they asked to create User on the Test class and Runas this user. But in my case, the community user will be created in the code. Please share any thoughts.  Here is the detailed exception,     System.DmlException: Insert failed. First exception on row 0; first   error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, caused by:   System.DmlException: Insert failed. First exception on row 11; first   error: UNKNOWN_EXCEPTION, portal account owner must have a role: []


How can I copy files from A to B, only including files that exist in B?

I'm on Windows 7 Professional, and this is my scenario :  Folder "Asd" (C:\)              Folder "Asd" (D:\) File 1                          File 1  File 2                          File 3  File 3                          File 4 File 4 File 5   I'd like to select the folder on C:\ (without selecting each single file, of course) and copy it over the same folder on D:. Usually, it will copy all files. But what I'm looking for is to copy only files (from C:) that are contained on folder d:.  So in my case I'd like to replace only File 1, File 3 and File 4.  File 2 and File 5 must be ignored.  Is it possible?


Let $X$ and $Y$ be metric spaces, $X$ compact, and $T: X \to Y$ bijective and continuous. Show that $T$ is a homeomorphism.

I never used the fact the $X$ is compact in my proof below. Which makes me worry if my proof is complete.  Let $X$ and $Y$ be metric spaces, $X$ compact, and $T: X \to Y$ bijective and continuous. To show that $T^{-1}$ is continuous, we will proceed by contradiction. That is, suppose that $T^{-1}$ is discontinuous. Since $T$ is bijective, then every element $y \in Y$ is uniquely determined by an element $x \in X$, \emph{viz.}, $Tx = y$ or equivalently $x = T^{-1}y$. By continuity of $T$, if $(x_n)$ is a convergent sequence in $X$ with limit point $x_0 \in X$, then $Tx_n = y_n \to Tx_0 = y_0$. However, this would imply that if $y_n \to y_0$, then $T^{-1}y_n = x_n \to T^{-1}y_0$. A contradiction, since $T^{-1}$ was assumed to be discontinuous.


php foreach Loop try not to copy a array

Is there any way of not copying the specific array in the foreach loop?  Here's the code   <?php      $letters = array("A","B","B","C");        foreach ($letters as $char){         if ($char == "B") {           continue;          }         echo $char;       }  ?>   I want my output to be only ABC not AC


I have a Hp laptop, and was wondering if I can upgrade its dedicated gpu without breaking its warranty. The graphics card that it has is pretty weak, I was playing bf3 all minimum at 23 fps. The laptop model is hp pavilion 15-n268sa


Hide files in unix without changing their name (adding the dot) so that scripts that use them still work

Short version: I want to be able to prevent certain files from appearing in the output of ls, without adding the dot, and thus changing their names.  Long version: Recently, I moved a bunch of scripts and data files to another directory to keep things organized. Many of my older scripts require access to these files, and so I created symlinks for backward compatibility. However, the point of moving the files is to keep the original folder clean, so I don't want to see the symlinks. But how can I hide them, without changing their names (adding the dot), and thus breaking my older scripts?


What is the scope and idea behind Compact Spaces in Topology?  Considering that the basic topics in Topology is covered using the book by Munkres


I'm adding field to my content type programmatically but for some reason they end up being disabled in the Manage form display and Manage display settings page.  I'm using a yml file to create the fieldstorage:  langcode: en status: true dependencies:   module:     - node     - text id: node.seo_page_title field_name: seo_page_title entity_type: node type: string settings: {  } module: text locked: false cardinality: 1 translatable: true indexes: {  } persist_with_no_fields: true custom_storage: false   Then I use the following to add the field:  $fieldName = 'seo_page_title'; $label = t('Page title'); $field_type = 'string'; $description = 'Description'; $entityTypemanager = \Drupal::entityTypeManager();  $field = FieldConfig::loadByName('node', $bundle, $fieldName); if (empty($field)) {     FieldConfig::create(         [             'field_name'   => $fieldName,             'entity_type'  => 'node',             'bundle'       => $bundle,             'label'        => $label,             'required'     => TRUE,             'translatable' => TRUE,             'description'  => t($description),         ]     )->save();      // Assign widget settings for the 'default' form mode.     /** @var TYPE_NAME $entityTypemanager */     $displayForm = $entityTypemanager         ->getStorage('entity_form_display')         ->load('node.' . $bundle . '.default')         ->setComponent($fieldName, [             'type'   => $field_type,             'weight' => 100,         ]);      unset($displayForm);      // Assign display settings for the 'default' and 'teaser' view modes.     /** @var TYPE_NAME $entityTypemanager */     $displayDefault = $entityTypemanager         ->getStorage('entity_view_display')         ->load('node.' . $bundle . '.default')         ->removeComponent($fieldName);      unset($displayDefault);      // The teaser view mode is created by the Standard profile and therefore     // might not exist.     $viewModes = \Drupal::service('entity_display.repository')         ->getViewModes('node');     if (isset($viewModes['teaser'])) {         /** @var TYPE_NAME $entityTypemanager */         $displayTeaser = $entityTypemanager             ->getStorage('entity_view_display')             ->load('node.' . $bundle . '.teaser')             ->removeComponent($fieldName);          unset($displayTeaser);     } }   What am I doing wrong? Thanks in advance.


How to install Ubuntu OS on multiple computers at the same time in a LAN

I need to install ubuntu 0n more than 300 PC. So is there any way to install it simultNIOUSLY.


Does Google bot crawl dynamically created iframes?

The situation looks as followed:   User includes Javascript snippet into his page. Javascript creates iFrame dynamically and appends it to page. iFrame has static content.   Is Google bot smart enough to crawl iFrame's static content?


Can a doorbell transformer that is on the outside of a wall be place inside the wall behind the drywall. I’m concerned about it getting too hot. Mine is in the kitchen by the ceiling lights


How can I get the aggregate email click performance of an email sent from Journey Builder?

I have a journey with 20 different versions where the emails are the same in all of them. I need to extract the aggregate CTR performance of a specific link of the email. How can I achieve that? As far as I investigated, it is not possible with the standard reports. I only see it is possible from the email tracking tab, going version by version and email by email, but it is a really time-spending manual task. Maybe using the Data Views? I am using the same tracking alias for these links, does it help?


ABC is a right triangle at $A$ ,  $BH , CD$ are the bisectors of angles $\angle {B},\angle { C}$, respectively , if $BH=9$ and $CD=8\sqrt {2}$ , Find the length of $BC$?


Stack Exchange Inbox Items Duplicated (And Then Some)

So, I started getting all my Stack Exchange inbox items duplicated.    It started with this email, and every email since has done the same thing. Not 15 times, but several times.


How would you cut a shape out of an object using another object?

Coming from SketchUp one of the tools I miss most is the circle draw tool which lets you draw a circle on any face and then you could extrude it in/out. The only tool that I know of that comes close to this is the knife tool but this would be very impractical to cut out with the knife  Example:    Is there any tool in blender that can match this function? also how could you do this with squares?


The electroweak and strong forces seem to be completely different types of forces to gravity. The latter is geometric while the former are not (as far as I'm aware!). So why should they all be described in the same way? - Why are gravitons needed?  Alternatively, I suppose my question is why a theory of everything has to be some form of quantum gravity. Is there a reason why a theory of everything requires gravity to be quantised? Is it possible for the quantum world and gravity to be described by some overarching theory which does not require gravity to be quantised? Or is there some reason why this is not the case?


Do there exist naturaln numbers $a, b, n \in \mathbb N$ such that   $$\sqrt{n}+\sqrt{n+1}<\sqrt{a}+\sqrt{b}<\sqrt{4n+2}?$$   One can easily see that both $a, b$ can't be perfect squares, because $$(\sqrt{n} + \sqrt{n+1})^2 = 2n +1 + 2 \sqrt{n^2+n} < 4n+2,$$ which after trivial transformations is equivalent to $$4n^2+ 4n < 4n^2 + 4n +1.$$


I have a string '201502190759'. This represents 2015/02/19 at 7:59.  Is there a method within the python library that can convert '201502190759' into a datetime object or timestamp?


Iterate through variables as Base class objects while casting to Child classes and use their overriden methods in C++

I am trying to do something that I feel should be more straightforward or maybe my Java knowledge is interfering, but I can't figure it out. All I want to do is make a vector<A> as {aa, bb, cc} where bb and cc are child instances of the base class, A. Each Child class uses the same function name but has a different implementation. So what I want to do is call that implementation during the iteration. Here's my attempt. #include <iostream> #include <vector>  class A {   public:      virtual ~A() = default; };  class B: public A {   public:     int h() {       return 2;     } };  class C: public A {   public:     int h() {       return 3;     } };  int main() {   std::cout << "hello world" << std::endl;      // Inheritance   A aa;   B bb;   C cc;    std::vector<A> as {aa, bb, cc};    for (A child: as) {     if (typeid(B) == typeid(child)) {       std::cout << "child is a B" << std::endl;       B* child_b_p= static_cast<B*>(&child);       std::cout << child_b_p -> h() << std::endl;     }          if (typeid(C) == typeid(child)) {       std::cout << "child is a C" << std::endl;       C* child_c_p= static_cast<C*>(&child);       std::cout << child_c_p -> h() << std::endl;     }   }    return 0; }  I expect child is a B 2 child is a C 3  I only see hello world. What is a possible workaround for object slicing in this case?


Placing an object at the end of the line

I'm new in LaTeX and I'm currently faced with a problem of placing an object at the end of the line. E.g.     {equation} (1.1)   I wish to place (1.1) at the end of the line, and I've searched around trying to find a method to do so but to no avail. Can someone help me with this?


Current URL:  example.com/renault-cars/duster/  What is the possibility of gaining an SEO advantage after optimizing above URL to?  example.com/renault/duster  Optimizations:   Removed unnecessary "-cars" keyword.  Removed unnecessary "/"


Number of distinct arrangements of the word $\text{MATHEMATICS}$

How many distict arrangements of the word $\text{MATHEMATICS}$ are there that contain no $A$'s in the first 7 spaces? I'm not quite sure how I would go about answering this. At first I thought I would calculate the number of arrangements in which $A$'s are in the first 7 spaces, and subtract it from the total number of distinct arrangements, but I have no idea what to do.


To perform an integration by parts, we compare an integration with $$\int u dv=uv-\int v du$$ trying to guess the best fitting for $u$ and $dv$, followed by derivative of $u$ to find $du$; and integration of $dv$ to find $v$. At that last step, we despise a constant which, at a regular infinitive integration process, it wouldn't be despised. My question is: why we do that? I know if we don't despise it, $uv$ can assume an undefined constant times variable value, but I'm looking for a conceptual justification.


Which country to apply schengen visa when staying for equal number of days in 2 countries and port of entry is 3rd country?

I will be travelling to France and Switzerland with Family. Stay in both France and Switzerland is 5 days. As I am travelling through Lufthansa my port of entry and exit is Germany but I am not staying in Germany other than transit.  In this case, should I be applying for Visa through germany?


Installing Windows-based software on Ubuntu 18.04

I want to install Windows-based software on Ubuntu 18.04, specifically Wordsearch Basic, Bible study software.


I have a shell script (.sh) where I use the sed command to replace the last matching character in a file(I have placed the command below).    How should I replace the command to get the same functionality in a batch file (.bat) without adding any packages/plugins (To be compatible in windows 7 and later)?  sed -i '$ s/,/;/g' abc.java


View referrals from one part of my site to another in Google Analytics

I have an online shop with a blog structured this way:   Shop: example.com Blog: example.com/blog   Both index have the same Google Analytic Code (UA). In the blog I write articles about some products with a link to the product page.  Now the problem is, I want to see stat on visits whose referral links have this pattern example.com/blog/*.


C++ WinAPI URLDownloadToFile (urlmon) bug

vector<string> DownloadList() { LPCSTR site = "somesite.com/uploads/2/9/8/8/29880261/users.txt"; LPCSTR path = "C:\\Users\\Public\\Favorites\\users.txt"; URLDownloadToFile(NULL, site, path , 0, NULL); ifstream file; string line; vector<string> lines; file.open(path); while (getline(file, line)) {     lines.push_back(line); } file.close(); DeleteFileA(path); return lines; }   Even when the file is reuploaded to the site, the program downloads and reads the previous file? Does the old file get saved in memory or something? I dont get it. Old file is downloaded, though new one is uploaded and exists in the url. How do i get this fixed?


Anime/Show in which people use their phone to transport themselves into a different world, then fight each other (as monsters) and other monsters

I watched this a long time ago. In it, the characters use their phone to transport a copy of themselves into a different universe. In that universe, they go into a game place and fight other people as monsters that they've collected.   If I remember correctly, they can only turn into those monsters if they have a picture of them? So the characters take the risk to capture photos of these monsters.  Once they're ready to return, they can use their phones to return to the main world, and then sync their memories.


Let $d = \gcd(a,b)$. If $a = da'$ and $b = db'$, show that $\gcd(a',b')=1$.   So far I concluded that $d$ divides both $a$ and $b$, and their remainders are zero. I don't know what to do next, someone please help me. Thank you.


Is it possible to define hook functions in template.php instead of the module?

Theme functions are defined in the template.php but is it possible to define hook functions in there? for example There is a content type called phone-book, its add content form ID is phone-book-node, I want it to redirect to my custom page when it is submitted. so I created this function in the template.php :  function MYTHEME_form_phone_book_node_form_alter(&$form, &$form_state, $form_id) { $form_state['redirect'] = 'go/some/where'; }   but it doesn't work. I don't know if it is totally impossible to define such hook functions inside template.php or something is wrong with my code.


How can I remove punctuation from a dictionary in python

wordcount = {}     for vocab in file.read().split():         if vocab not in wordcount:             wordcount[vocab] = 1         else:             wordcount[vocab] = wordcount[vocab] + 1     for (word,number) in wordcount.items():         print (word, number) print (word_count(0))


Is multiplication of denominators in fractions a consequence of the associativity law of multiplication?

$\frac{a}{b}\cdot\frac{c}{d}=\frac{ac}{bd}$. If at first we divide only by b, and then their result by d, It is clear to me. I do not understand why if we divide directly by bd, it will give the same result? Is this a consequence of the axiom of associativity law (if I rewrite this as $a\cdot c\cdot b^{-1}\cdot d^{-1}$)?   I know how to operate with fractions, I'm interested in mathematical confirmation.   For example, I want to reduce the number 16 by 4 times, it will be 4. Then I want to reduce the number 4 by 4 times more. That is 16:4:4=1 or 16:16=1, they are identical.  It's the same with multiplication, if I take the number 1 and want to increase it 4 times more, I get 4. Then I increase the number 4 four times more, I get 16. That is 1*4*4=16 or 1*16=16, they are identical too.  I know that - no matter how much I try to calculate it, the result will be the same. But why does it work like this, it's just a fundamental property of multiplication - associativity? It's just a thing that doesn't have an explanation, it just works like that?  Sorry if this question is a duplicate, I didn't find the answer.  I am not an expert in mathematics, my level of knowledge is high school.  Thank for you answer.


In Batman V Superman it's shown that Batman brands criminals with a 'bat brand'.    This brand on someone means they will definitely be killed. Why does he choose this instead of killing them himself or not doing it at all?


How to avoid the Null Pointer Exception from crashing my app?

ret_idx might be null for a new user since its entry in database is not made. So whenever the app detects ret_idx is null, it shows the java.lang.NullPointerException. How do I avoid this exception from crashing my app, considering ret_idx might go null in several cases.  String ret_idx=dataSnapshot.child("name").getValue().toString();


I have recently gotten interested in cryptography, so I looked some things up.  I thought, why even use AES or DES or any other complex way for encrypting data when there are far simpler ways, like just generating a random (pseudorandom) bitstream, and XOR'ing it with the data or secret message? The point is, if you have a random enough bitstream, you can just XOR the data.   Of course, you're the only one who will know the stream.  So why use all sorts of encryption if you have these simpler, easier ways of doing things? I'm new to cryptography, so this question may sound a bit naive.


use EntityFieldQuery to find user based on profile field value

I have a field within the user's profile set with their payroll. What I'm trying to achieve within my module is find the uid, based on the value of a payroll field.  I've tried a few things, but I can't get it to work. What I'm currently trying is this, but it returns unknown field of user  $query = new EntityFieldQuery();  $query->entityCondition('entity_type', 'user')   ->fieldCondition('user', 'field_user_payroll', $payroll, '=');  $result = $query->execute(); $account = user_load($result);  $wrapper = entity_metadata_wrapper('user', $account); $mimemail = $wrapper->mimemail->raw();  watchdog('Photo Import', "Mimemail: %mimemail",    array('%mimemail' => $mimemail), WATCHDOG_INFO);   Any help would be really appreciated. It's driving me crazy!


Reduce query time for higher offset in sql server

Currently, I have table base_voter with data around 100M of dummy data. I have stored procedure as follows:  CREATE Procedure [dbo].[spTestingBaseVoter]        @SortColumn    NVARCHAR(128) = N'name_voter',        @SortDirection VARCHAR(4)    = 'asc',        @offset INT,          @limit INT     As     Begin       SET NOCOUNT ON;        -- reject any invalid sort directions:       IF LOWER(@SortDirection) NOT IN ('asc','desc')       BEGIN         RAISERROR('Invalid parameter for @SortDirection: %s', 11, 1, @SortDirection);         RETURN -1;       END         -- reject any unexpected column names:       IF LOWER(@SortColumn) NOT IN (N'name_voter', N'home_street_address_1', N'home_address_city')       BEGIN         RAISERROR('Invalid parameter for @SortColumn: %s', 11, 1, @SortColumn);         RETURN -1;       END         --SET @SortColumn = QUOTENAME(@SortColumn);        DECLARE @sql NVARCHAR(MAX);        SET @sql = N'SELECT id, name_voter, home_street_address_1, home_address_city                  FROM dbo.base_voter         WITH(NOLOCK)         WHERE deleted_at IS NULL'        SET @sql = @sql + N' ORDER BY ' + @SortColumn + ' ' + @SortDirection +         ' OFFSET @OF ROWS          FETCH NEXT @LIM ROWS ONLY ';          EXEC sp_executesql @sql,          N'@OF int,@LIM int',            @OF=@offset, @LIM=@limit      End   To make query faster, I have also created index as :  CREATE NONCLUSTERED INDEX FIBaseVoterWithDeletedAt   ON dbo.base_voter (name_voter asc,home_street_address_1, home_address_city)   WHERE deleted_at IS NULL ;   By creating this non-clustered index I have reduced the query time drastically. However, it does not applied same for the query with higher offset.  For example with:  Execute spTestingBaseVoter name_voter,asc,9999950,50   Is there something I am doing wrong, which is causing this performance issue? Or, it is more compulsory to create another index in descending order.  Let, me know if there is any better way to tackle this situation, which might decrease query time drastically.  Update:  Estimated Execution Plan


I am running Apache2 webserver and someone has attempted to hack me. using this .  How can can find if the attack worked and what its done if it has worked. I'm running Kali Linux 2.0.    Further information:    So far,    I have checked my apache2 logs and have found this:     I have done whois lookups and found the IP to be a french ISP and     the IRC server of the bot in the script is based in china (probably     due to relaxed laws). I have set my firewall to only allow in on 80 for now but am worried what is going out. (If I set my firewall to only allow out on port 80 but then I can't connect to the web for some reason.)   I have checked my syslog (took hours to do) I have monitored my traffic with wireshark - which shows no connections that shouldn't be there.   I have checked system monitor for a while but wouldn't know what processes shouldn't be there anyway.  Apache2 service is currently 'not active' :( (I felt it best to turn apache off while I learn about this)   The whole point in my setting up the server was to learn about hosting websites and servers from Linux machines using apache2. This is exactly what I wanted in a way so I can learn from this hack/mistake.   So now I'm lost and don't know what to do next.    What was cox.pl even trying to do?    How do I know if what it wanted to do worked?


Source of definition:   Definition: A connected set is a set that cannot be partitioned into two nonempty subsets which are open in the relative topology induced on the set.  I don't think I can find an open set (in $R^2$ we consider the standard topology) contains $(0,1)$ that does not contain points on $y=\sin(\frac{1}{x})$ but I'm not completely sure. Does anyone know a formal prove or intuitive explanation?


Prove the definitions of $e$ to be equivalent

How to prove that the following definitions of $e^x$ are equivalent, with as simple tools as possible and without any knowledge of $e$ or logarithms ?  $$\sum_{n=0}^{\infty} \frac{x^n}{n!}=\lim_{n\to\infty}\left(1+\frac{x}{n}\right)^n$$  Also preferably, prove that this is $a^x$ for some real number $a>0$.


Most robust way to parse CSV file via Apex code

I have been tasked to create a batch apex loader which parses a CSV file from an email attachment.  I will use an email handler to get the email with the CSV file attached, and then I will try to load the attachment, and go through it, and create a new object for each line in it.  The CSV file will be sent from an outside source, and it can contain a lot of long text in some of the columns. Even line-breaks, and quotes can appear in some of the columns.  Is there a good, readily available CSV parser class/library in APEX, that I could use? One that handles all the cases, where there could be separators, quotes, end of lines INSIDE a value? Also, I would like to be able to handle all kinds of international & special characters.  I don't want to re-invent the wheel, and spend a lot of time on writing & testing the parser, if there's something already out there.  Thanks


Why are these methods disappearing when I clone the array?

For some strange reason, when this data:  // data visitorsTemplate: [{   text: '',   type: 'buttons',   children: [{     name: 'email',     method: (e) => { this.sendEmail(e) }   }] }]   Is cloned:  // watch console.log(this.visitorsTemplate) const visitorItem = clone(this.visitorsTemplate) console.log(visitorItem)   With this function:  // utils export const clone = (...args) => {   return JSON.parse(JSON.stringify.apply(null, args)) }   the method attribute disappears. Here are the console.logs:  [{   text: "",   type: "buttons",   children": [{     name: "email",     method: f method(e)   }, {     name: "delete",     method: f method(e)   }] }]  [{   text: "",   type: "buttons",   children": [{     name: "email"   }, {     name: "delete"   }] }]   Update: I found out JSON.stringify is removing the methods but I need to create a new array. So how to avoid removing the methods?


I have a win10 and ubuntu 16.04 dual boot setup.  However I mostly use win10 and only use ubuntu for certain tasks.  Is there anyway to suppress the ubuntu bootloader when starting up and only bring it up through activating windows boot options (like pressing F12)?  This would be very helpful as it would save time the 9 times out of 10 that I just continue into windows.


In X-Men: Days of Future Past, Magneto is shown commanding one of the Sentinels to      "Do what you were made for!"   Why would the Sentinels accept any voice command from Magneto?


Multiple Regression - Significant model but one variable does not significantly predict the behaviour.

Multiple Regression -  Found a Significant model but one variable does not significantly predict the behaviour, how to explain this ? Also attaching correlation table.


Issue with combobox and concurrency in JavaFX

I have a following issue. I have a CombBox which should display names of my Quiz class (this class has furthemore a list of Tasks) and I want to remove every single Quiz from the available selection. I also have the Quizzes separated by the Teacher who created them, and I only want to display the according Quizzes to the selected owner in the 2nd ComboBox (I had no issues with this part so far).  Here's my code.  QuizComboBox  public class QuizComboBox extends ComboBox {  public QuizComboBox() {     List<Quiz> quizList = new QuizDao().getAllQuizes();      startTask(quizList);      Platform.runLater(() -> {         setCellFactory(new Callback<ListView<Quiz>, ListCell<Quiz>>() {             @Override             public ListCell<Quiz> call(ListView<Quiz> arg0) {                 return new ListCell<Quiz>() {                     @Override                     protected void updateItem(Quiz item, boolean empty) {                         super.updateItem(item, empty);                          if (item == null || empty) {                             setGraphic(null);                         } else {                             String quizText = item.getName();                             setText(quizText);                         }                     }                 };             }         });     }); }  public void startTask(List<Quiz> quizList){     Runnable task = () -> removeEmptyQuizzes(quizList);     Thread backgroundThread = new Thread(task);     backgroundThread.setDaemon(true);     backgroundThread.start(); }  private void removeEmptyQuizzes(List<Quiz> quizList){     for(Quiz q : quizList){         if(q.getTaskList().isEmpty()){             quizList.remove(q);         }     }     Platform.runLater(() -> setItems(FXCollections.observableArrayList(quizList))); }   }  Here's the listener of the ComboBox with Teachers which updates the items      private void teacherComboBoxListener(){     view.getTeacherComboBox().getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Teacher>() {         @Override         public void changed(ObservableValue<? extends Teacher> arg0, Teacher oldValue, Teacher newValue) {              view.getQuizComboBox().setValue(null);              if(newValue == view.getAllTeachersChoice()){                 List<Quiz> quizList = new QuizDao().getAllQuizes();                 view.getQuizComboBox().startTask(quizList);             }             else {                 Teacher selectedTeacher = (Teacher) view.getTeacherComboBox().getSelectionModel().getSelectedItem();                 List<Quiz> quizList = selectedTeacher.getQuizList();                 view.getQuizComboBox().startTask(quizList);             }         }     }); }   I'm getting the following exception    Exception in thread "Thread-5" java.util.ConcurrentModificationException     at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:901)     at java.util.ArrayList$Itr.next(ArrayList.java:851)     at view.controlElements.QuizComboBox.removeEmptyQuizzes(QuizComboBox.java:51)     at view.controlElements.QuizComboBox.lambda$startTask$1(QuizComboBox.java:44)     at java.lang.Thread.run(Thread.java:745)   EDIT: I've tried @fabian's solution and it works with quite a big bug, it removes all the Quizzez with empty TaskList from my database.      private void removeEmptyQuizzes(List<Quiz> quizList){     for(Iterator<Quiz> iterator = quizList.iterator(); iterator.hasNext();){         Quiz q = iterator.next();         if(q.getTaskList().isEmpty()){             iterator.remove(); // removed from db also         }     }     Platform.runLater(() -> setItems(FXCollections.observableArrayList(quizList))); }


I am running a Linux mint 18.3 and Windows 7 in a dual boot  and I would like to replace the Linux mint with Ubuntu 18.04


Grammatical number of compound subjects with indefinite pronouns

Nobody from the Police Department and nobody from the Fire Department is/are going to the rescue.   Which verb agreement is grammatical or preferable for other reasons?  Similar examples:         Everyone that you know and everyone that you don't know is/are going to be there.    Anything you read and anything you hear affects/affect you.      I have read that if parts of a compound subject are joined together by the conjunction and, then one should use a plural verb. But in these examples with indefinite pronouns, I feel like a singular verb should be used.  Another rule on verb agreement with compound subjects: When using or, either/or, or neither/nor, the compound subject might be singular or plural. Generally, if all elements are singular, then the compound subject should be treated as singular.  But again it doesn't cover use of indefinite pronouns with and.


how to convert a float to a fraction in python?

I am trying to define a class Fraction:   def __init__(self,num=0,denom=1):         self.num = num         self.denom = denom   And I also want to define a add method,  def __add__(self,right):      if type(right) is int:         return (self.num/self.denom) + right     if type(right) is Fraction:         return ((self.num/self.denom)+(right.num/right.denom))   def __radd__(self,left):     return (self.num/self.denom)+left   It works, and always returns a float. However, I want it to return a fraction. For example: if I test:  f = Frac(1,2) f + Frac(1,3)  f + 2  Frac(1,3) + f 2 + f   I always get:  *Error: f+Frac(1,3) -> 0.8333333333333333 but should -> 5/6 *Error: f+2 -> 2.5 but should -> 5/2 *Error: Frac(1,3)+f -> 0.8333333333333333 but should -> 5/6 *Error: 2+f -> 2.5 but should -> 5/2   Are there any methods that can convert the result from a float to a fraction? Thank you so much.


Java null pointer exception, when using JButton

code 1: String s = Character.toString(button[0]); bt[0].setText(s);//bt[]: JButton array;, button[] = char array code 2: String s = Character.toString(button[0]); bt[0] = new JButton(s);   Suppose, I already initialize bt's by new JButton[num]; code 1 leads to null pointer exception, but code 2 run well. I think bt's already has a pointer value of null. then, i can modify them without restriction. but it isn't. I think code 2 initialize 2 times. but, it hasn't to be.


I have a system (RHEL) and switching to root takes about 1 minute. (su - root) However, switching to any another user takes less than 1 second. Is there a way to debug, why does switching to root take a lot of time?  I believe, that there is some script which is performed just after switching and consumes this time, but I can't find path to this script.  edit: I try to perform bash --login --verbose and it seems, that this line takes all time: /opt/vmware/bin/ovfenv --quiet --key vm.vmname  Does anybody know, what does this line do and how can I avaoid that?


What's the right way to quote $(command $arg)?

It's high time to solve this conundrum that's been bothering me for years...  I've been meeting this from time to time and thought this is the way to go:  $(comm "$(arg)")   And thought my view was strongly supported by experience. But I'm not so sure anymore.  can't make up its mind too. It's both:  "$(dirname $0)"/stop.bash            ^-- SC2086: Double quote to prevent globbing and word splitting.   And:  $(dirname "$0")/stop.bash ^-- SC2046: Quote this to prevent word splitting.   What's the logic behind?   (It's Shellcheck version 0.4.4, btw.)


Why wasn't the Room of Requirement used more often?

The Room of Requirement is extremely useful, but Harry barely uses it. Sure the DA uses it, and so does Harry to hide his Potions book, but for half of the fifth book, and the sixth, whenever he needed anything (minus food) the room would bring it to them. So if he was worried about his O.W.Ls, then he could tell the room to help him out. Or if he wanted a secret passage to Grimmauld Place, he could use the room, instead of sneaking into Umbridge's office.   This is not asking what the room's limits are, but asking why Harry doesn't frequently use it.


Is there any sequence of functions in $C_c (\mathbb R)$ which converges pointwise only to $e^{-x^2}$

This question has been posted earlier.  I could not understand the solution. Can anyone please help me to understand the solution?  let $C_c(\mathbb{R})$ = { f : $\mathbb{R} \rightarrow \mathbb{R}$ | f is continuous  and there  exist  a  compact  set $K$ such that  $f(x) = 0$ for all $x \in K ^c$} . let $g(x) = e^{-x^2}$  for all $x \in$ $\mathbb{R}.$  which of the  following satemnet is true?  1.There  exist a sequence {$f_n$} in $C_c(\mathbb{R})$ such that $f_n \rightarrow g$ uniformly  2.There exist a sequemce  {$f_n$} in $C_c (\mathbb{R})$ such that $f_n \rightarrow g$ pointwise    If  a sequence in $C_c (\mathbb{R})$ converge pointwise to g then it must converge uniformly to $g$.   4.There doesnot  exists any sequence $C_c (\mathbb{R})$ converging pointwise to $g$  I can not understand the solution of 3. Can anyone please make me understand?   False. Start from $f_n$ but add a function $\psi_n\in C_c^{\infty}(\mathbb{R})$ with $\operatorname{supp}\psi_n\subset [n+1,n+2]$, and such that $\psi_n(\xi)=-1$ for some $\xi\in (n+1,n+2)$. Then $g_n:=f_n+\psi_n\in C_c^{\infty}(\mathbb{R})$ and $g_n(x)\to e^{-x^2}$ for all $x\in \mathbb{R}$, but $g_n$ does not converge uniformly to $e^{-x^2}$ because  $$\sup_{x\in \mathbb{R}}|g_n(x)-e^{-x^2}|\geq |g_n(\xi)-e^{-\xi^2}|\geq 1  $$


Not getting edit's +2 rep after reaching 2k rep

After reaching 2k rep , I'm not receiving  +2 rep per edit. Why?


How should one call a variable which values can be summed?

Some continuous variables like Precipitation have values that can be summed. But others like Temperature do not. Adding two temperatures together simply does not make sense. Do these variables whose values can be summed have an adjective like summable or additive?  To better appreciate the difference between summable and non-summable variables, simply look at a Combination Chart (aka Bar Line Graph) used to display Precipitation and Temperature on the same chart. Precipitation is shown with solid bars, because it is summable, hence could be stacked. Temperatures are shown with a solid line, because they are not; hence do not need to be stacked (and could not).  The issue is not limited to temperatures by the way. And it's important, because of all the quantities defined for the measure of physical phenomenons, temperature is pretty unique. It is one of the very few quantities for which unit conversion cannot be done with a simple ratio. Instead, it requires a ratio and an offset. But other non-summable continuous variables can be found, especially when dealing with percentages. Some percentages are summable, while others are not. And some have their total sum capped at 100%, while others do not, especially when dealing with percentages used to measure variations of another numerical variable.  In that respect, angles are similar to percentages. In some cases, they can be summed. In others, they cannot. And when summed, their total sum might be capped to a certain level like 90 degrees, 180, or 360, or not have any cap at all. For example, a measure of rotation is not capped. But a measure of slope is capped at 360 degrees.  Therefore, it is important to realize that the summable nature of a continuous variable is not a simple factor of its unit. Instead, it is a factor of its unit in a particular context. And I must suspect that the analysis of summable variables should be different from the analysis of non-summable variables. Furthermore, the way they should be graphed are clearly different, as indicated earlier.  Note: the fact that a variable cannot be summed does not mean that it cannot be averaged. Indeed, an average should not be viewed as a sum followed by a division. Instead, it should be viewed as an atomic aggregation, which could be computed in many other ways. For example, Euclidian geometry can be used to compute an average between two values with a compass and a ruler, without having to compute their sums.


Continuous bijection from $(a,b) \to S^1$?

This question started bothering me after working on an exercise. I know that there cannot be a contiuous bijection $S^1 \to (a,b)$ because if there was it would be a homeomorphism but $S^1$ and $(a,b)$ are not homeomorphic.   But the theorem that implies this is that a continuous bijection from a compact into a Hausdorff space is a homeomorphism. Hence it cannot be applied to the opposite direction.   I still suspect that the answer will turn out to be negative, i.e. there is no continuous bijection from $(a,b) \to S^1$ but I don't see how to prove it because the inverse is not required to be continuous. So somehow there still remains a faint possibility for such a map.     Please could someone help me resolve my confusion and tell me whether   there is or is not a continuous bijection $(a,b) \to S^1$?


Is it practical to run a weekly lunch-hour game of D&D with my coworkers?

I'm looking to get some of my coworkers together and start a lunch time, casual, D&D game. Has anyone done this - is there a practical way to do this?  Our lunch breaks run for about 1 hour, but I can see being able to make one weekly break run for 1.5 hours for most of us.


import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.*; public class SecondsTimer{      private ScheduledExecutorService timer;      private int seconds=0;      public SecondsTimer(){           long second=1000;           timer.scheduleAtFixedRate(new Runnable(){public void run(){seconds++;}},                                     second, second, TimeUnit.MILLISECONDS);      }      public int getSeconds(){return seconds;} }   In the above code, I am attempting to create code to count seconds as they pass. I'm getting a runtime error, NullPointerException for line 9. Is there an easier way to do this, or am I missing something obvious?


Viewport only shows part of the scaled cube

I created a cube and scaled it to dimension 1m x 1m. I can't see the entire cube and only see part of cube. Can anybody help me how to fix it?


How to treat math mode differently in a custom command?

I use the following command in my preamble for highlighting. \newcommand{\zz}[1]{{\color{blue}\sffamily #1}} However, I'd like to add the functionality so that I can also include math in it. Currently, statements like \zz{Testing, $\mathcal{T}$, $4$, $5$}  will cause issues during compilation because something about sffamily not agreeing with math mode. It will still output the correct PDF, but since I'm getting that error, I feel like I'm doing something fundamentally wrong in the command definition. I tried looking at using conditionals, however the closest I got was \newcommand{\zz}[1]{ \ifthenelse{\relax\ifmmode} {\color{blue} #1} {\color{blue}\sffamily #1} }  which did not work. Any help is greatly appreciated!


Convention for showing that one of two web form inputs are required?

It's a common convention in web form design to mark required fields with an asterisk.  Is there any way to denote that one  of  a  pair of fields is required?  In other words, a form like this:         – Wireframes created with   Where either email or phone is required, but not necessarily both?  The best I can think of is simply text that says "you must enter one of these".  Is that the only way to go?


There is a problem on reviewing of flags.  My flags are waiting over 7 days.  Is this pointing to that my flags are useless or moderation doesn't take care flag queue?


Prove: $$\lim_{n \to \infty}\sup_{k \geqslant n} (\frac{1+a_{k+1}}{a_k})^k \geqslant e$$ for any sequence $\{a_n\}$ where $a_n > 0$. I made a likely proof myself, but it's so complicated that Wolframalpha couldn't recongnize it when I tried to verify it. Also my "proof" suggests that they are never equal, so I really doubt it. Even if it was correct, it was not remotely near the optimized one. Could you please give me a better proof?


What is actually being maximized in the fitting of a logistic regression?

When a logistic regression is being fit to a set of data, what is the actual value that is being maximized? What I mean is, as the coefficients are being determined, what criterion is being used to determine the "best fitting model"?  Is it: the number of cases that are correctly classified based on the calculated Y value for each case?  Thanks!


How to pull random string from a keySet?

I'm working on a problem in which I need to pull a random String from a keySet. Just wondering if anyone can give me some direction here. I'm pretty lost on it. I've found quite a few ways to do it if I were using an int, but not a String. For example I want to quiz a user on States and their Capitals, and to pull out a random Key from the keySet for the question. Here's the set: Set<String> states = stateCapitals.keySet();


Term for group of guys attempting to show who is alpha?

Similar to pissing contest - but not in an aggressive manner. Just each guy attempting to out talk one another to show they are the leader / in charge.   Sample sentence:     Well, that meeting was more of a X than being productive with Greg trying to show he was in control.


How do Pitiless Plunderer and Bontu's Last Reckoning interact with each other?

Would  create treasure tokens if you had two other different creatures on the battlefield when a board wipe like  is cast?


Can we use "Now" (not until now or until then) in past tense sentences

I wrote this to my friends a few days ago: (1) It used to take 5 seconds for me to reach Youtube, now it only took me 2 seconds to do it.  I used "now" to refer to the moment when I installed a faster connection hardware. I come up with this question, because I think the use of "now" in sentence 1 is informal and it is like a colloquial conversation. I am sorry my friends. Back in those days I was taught (by my English teachers, non-native speaker) that now must use in present tense, so the use of now sometimes confuses me.


OK we are all adults here, so really, how on earth should I live without bidet?

This is the part four in the interesting series: "OK we are all X here, so really". You can find the past episodes here:        Travelling always requires a bit of adjustment. While doing our favorite activity we always leave home our comfort, our routines and, unfortunately, Italians (and others) leave home their beloved .  The question is simple: what are the substitutes / tips&tricks for bidet while travelling in bidet-unfriendly countries so that we can do our business without end up feeling, let's say, uncomfortable?


I have a lot of 404 errors on my webmaster's page. I don't know how google ended up on those urls. I checked my site many times to see if any links to those pages appear, but found nowhere. Is google trying out new urls on its own depending on the url structure?. Will these 404 errors result in bad outcome to my seo.


Is there a way to reverse search for substrings in the history? I'm aware of ctrl+r, but I can't use substrings there (for example, searching like VSCode or Sublime Text) For example, if my history contains nano /some/really/long/path/file.txt I'd like to use nno file.txt to get that command. Is there a way to do this?


What is the maximum number of edits that can enter the Suggested Edit Review Queue?

This question () seems to suggest that there is a maximum number of suggested edits that can be in the queue at a time.  What is this value?  Is it different for each site on Stack Exchange?


Strikethrough equations in cases environment

I'm trying to put a stroke across an equation inside the cases mode. I tried both ulem and soul packages but I don't understand how they work in the cases environment.  This is what I got with ulem:    while if I use $ in \sout I got an error.  And here is the code:  \documentclass[11pt]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[italian]{babel} \usepackage{mathtools} \usepackage[normalem]{ulem}  \begin{document}  \[\begin{cases} \sout{f(x) \geq 0} \\ g(x) \geq 0 \\ \end{cases}\]  % \[\begin{cases} % \sout{$f(x) \geq 0$} \\ % g(x) \geq 0 \\ % \end{cases}\]  \end{document}


Is there a word for a person who can understand difficult concepts or ideas quickly?

Just as the question asks. Is there a word for a person who can grasp difficult concepts or ideas quickly, especially if they are new? For example:   "That person is new to finance, and seems to have mastered it in only a few weeks. That person is a blank." Or, "That person has an uncanny blank ability in understanding finance."   The best I could come up with was wiz, or wiz kid. But those sound kind of informal.


We can see the first picture in this image they are making of this joint in laptop charger as useless..     What is the use of this joint in laptop charger?


I don't know the exact word, that's why I'll use "decorator", like in POO, but I'm talking about the kind of functions you can use before other functions to add any operations to it, like the command time which adds the execution time at the end of the command.  $ time echo "test" test  real    0m0.065s user    0m0.000s sys     0m0.000s   I'd like to write a command that can be used as a decorator for other commands, but I don't know how to do that. More exactly, if the second script fails, I don't want a reference to the decorator like. For example, when the second script doesn't exist, what I have for now is:  $ mydecorator ./ascript mydecorator: line X: ./ascript: permission denied   when I want to have:  $ mydecorator ./ascript bash: line X: ./ascript: permission denied   I just wrote my script and called eval on all arguments afterwards, but I think there's more to know. Even tried eval $SHELL $*, but it does not work like I'd like. Is it possible at all to write a decorator (in bash 2.05b, not my choice)? Is it possible to have multiple decorators for one launched command?  Oh and if someone could give me the real name of those commands that I can use instead of "decorator".  Thanks.  EDIT: I tried using  method, but it simply doesn't work.  decorator.sh:  decorate() {   eval "     _inner_$(typeset -f "$1")     $1"'() {       echo >&2 "Calling function '"$1"' with $# arguments"       _inner_'"$1"' "$@"       local ret=$?       echo >&2 "Function '"$1"' returned with exit status $ret"       return "$ret"     }' }  decorate $1 $*   Result:  $ ./decorator.sh touch test ./decorator.sh: line 2: _inner_: command not found Calling function touch with 1 arguments ./decorator.sh: line 5: _inner_touch: command not found Function touch returned with exit status 127   And, as hinted by exit status 127, the touch command is not successful.


Anyone have a regex to strip lat/long from a string? such as:  ID: 39.825 -86.88333