what is the difference between const_iterator and iterator?

What is difference between these two regarding implementation inside STL. what is the difference regarding performance? I guess when we are traversing the vector in "read only wise", we prefer const_iterator, right?  Thank you.


iMac running Ubuntu 16.04, Unity Dash & Window Border graphical glitch

I'm Ethan and I am new to asking questions on ask Ubuntu normally it's me reading the answers. I have very little knowledge because I am yet to be an adult and I don't know what model Mac I have either.  My friend and I were at school and we found an iMac running MacOSX so I took it so my friend can use it at his home. Because of the age it won't patch anymore and since I am a Linux user I installed Ubuntu 16.04 just installed it was okay except for one thing. When ever I open the Unity Dash the menu on the top the screen freaks out and there is a lot of glitching and I see the current application name that i'm on in big blurry pixel words stretched across the top of the screen and after a bit the screen goes yellow then it crashes and turns off. My father and I think it's the iMacs' drivers.  My processor is an: Intel Core2 Duo CPU P7350 @ 2.00GHz x 2 Graphics: Gallium  0.4 on NVAC OS type: 64-bit  $ lspci -nnk | grep -A3 -Fe '[0300]' 03.00.0 VGA compatible controller [0300]: NVIDIA Corporation C79 [GeForce 9400] [10de:0867] (rev b1)   Subsystem: Apple Inc. iMac 9,1 [106b:00ad]   Kernel driver in use: nouveau   Kernel modules: nvidiafb, nouveau   What do I do to fix it? If you can please give me the solution because this is one of the first graphical problems I have had with Ubuntu!  Cheers Ethan


I know that there is something wrong in the following reasoning but I cannot explain it, can you say what is wrong with the following reasoning:   Null Hypothesis: The coin is fair (that is, the probability of a head is 0.5). The coin is thrown 100 times and 55 times it comes up heads. The probability of getting 55 heads with a fair coin is 0.048  Since 0.048 < 0.05 we can reject the null hypothesis.   I know that we should find P(X>=55) which is 0.18 but I really don't understand why are we finding P(X>=55).  Thanks


REOPEN: Perform arithmetic expansion inside parameter expansion?

Please reopen. This is not a duplicate, because here I am asking why it doesn't work, not just for workaround.    Bash manual says that     tilde expansion, parameter and variable expansion, arithmetic expansion, and command substitution (done in a left-to-right fashion)   If I understand  correctly,  "left-to-right" means that "brace expansion; tilde expansion, parameter and variable expansion, arithmetic expansion, and command substitution" have the same priority.  So is it possible to use arithmetic expansion inside parameter expansion? (i.e. one level recursion)  If no, why can't arithmetic expansion work inside parameter expansion, given that "tilde expansion, parameter and variable expansion, arithmetic expansion, and command substitution (done in a left-to-right fashion)"?  If yes, how?  For example,  $ set hello world $ echo $2 world $ echo ${$((1+1))} bash: ${$((1+1))}: bad substitution   I hope to    first expand $((1+1)) in ${$((1+1))} to 2. and then ${2} to world.   Thanks.


I've been studying geometric optics and I'm still a little confused with this idea of light . In the book I'm studying everything is being done starting from Fermat's principle which states that the ray path is the one which extremizes the optical length.  Now, I thought that because of this, geometric optics viewed light as particles and I thought that a light ray then would be a trajectory of those light particles. But my question  confirmed that geometric optics doesn't care if light is made of particles or waves.  On the other hand, if we think of light ray as "the path taken by light between two points", this is no good, because the idea of trajectory in this sense is not well defined for waves. Indeed, this idea of light ray doesn't even seen clear to me, because as we know if we have some light source, the light doesn't go along one single path, but as a wave it spreads out in all of the directions at once.  So, if geometric optics doesn't care about if light is made of particles or waves, what really is a light ray? How should we understand light rays and ray paths?


What is the maximum amount of pending edits allowed?

I was editing grammar on a number of old posts when suddenly the edit button began to be grayed out. When I hover over the edit button it gives the message "Account has the maximum amount of pending edit suggestions." I have never gotten this message before... so my question is, What is the maximum number of pending edits allowed?


I wish to show     $A=\dfrac{\mathbb{C}[x,y,z]}{x^5+y^3+z^2}$ is UFD   What I have tried so far:  I was thinking of applying Nagata's criterion. Indeed, $-(x^5+y^3)$ cannot be a square in $\mathbb{C}[x,y]$. Hence $A$ is a domain. Note that $$\frac{A}{xA}=\frac{\mathbb{C}[x,y,z]}{(x,x^5+y^3+z^2)} \cong \frac{\mathbb{C}[y,z]}{y^3+z^2}$$ which is a domain as $-y^3$ is not a square in $\mathbb{C}[y]$. Hence $x$ is a prime in $A$. Thus enough to check $A[\frac1x]$ is a UFD. Now I am stuck here. I cannot simplify the ring $A[\frac1x]$.  Any help/ suggestions to tackle this problem.


Why can I not connect to a local minecraft world?

When I try to join my brothers world, it will not show up for me and vice versa. This happens despite us being a few feet from each other. We currently have MCPE version 1.0.


I have strange problem, my Preview app is not responding and can't kill it.  leo-mac:~ leo$ sudo killall Preview No matching processes were found  Force Quit button also doesn't give any result. ps (and Activity Monitor) is empty: leo-mac:~ leo$ ps -ax | grep -i preview 24793 ttys000    0:00.00 grep -i preview  It's not a zombie because next command is also empty: ps aux | awk '"[Zz]" ~ $8 { printf("%s, PID = %d\n", $8, $2); }' I really can't understand what happened. Any ideas?


Solve the indefinite Integration $\int \frac{1}{\sqrt{\sin^3x\sin(x+\alpha)}}dx$   $$ \int \frac{1}{\sqrt{\sin^3x\sin(x+\alpha)}}dx=\int \frac{1}{\sin x\sqrt{\sin x\sin(x+\alpha)}}dx\\=\frac{1}{\sin\alpha}\int \frac{\sin(x+\alpha-x)}{\sin x\sqrt{\sin x\sin(x+\alpha)}}dx=\frac{1}{\sin\alpha}\int\frac{\sin(x+\alpha)\cos x-\cos(x+\alpha)\sin{x}}{\sin x\sqrt{\sin x\sin(x+\alpha)}}dx\\ =\frac{1}{\sin\alpha}\int\frac{\sin(x+\alpha)\cos x}{\sin x\sqrt{\sin x\sin(x+\alpha)}}dx-\frac{1}{\sin\alpha}\int\frac{\cos(x+\alpha)\sin{x}}{\sin x\sqrt{\sin x\sin(x+\alpha)}}dx $$  Is it possible to proceed further and complete the integration or what is the right substitution to find the solution ?  Note: I'm looking for a simple way to solve this, unlike here .


Difference between substring and string in java

class test {  public static void main(String[] args) {     String a = "Hiabc";     String b = "abc";     String c = "abc";     System.out.println(a.substring(2,5)==b);     System.out.println(b==c); } }  output: false true   As far as I understand, Java's == look for addresses of the two compared objects. Yet, I don't understand why b==c is true because they must have different addresses. Also, if b==c, then why is a.substring(2,5), which is "abc" == b false?


default file permissions for ftp uploads in ubuntu (vsftpd)

I followed  for setting default file permissions in my web root folder.  I am trying to set all files/dirs to 775 by default. This works fine when creating files within linux and also when creating files directly on the web root through the samba share but it doesn't seem to work when files are created on the windows disk and ftp'd over.  When I do this the file permissions are set as read/write owner only [-rw-------] so apache cant even read them.  My setup is that I'm running Ubuntu in a virtualbox with a Windows 7 host. I have a local directory on the host where I store the files and I ftp them to the Ubuntu machine using netbeans for testing.   When I ftp to the VM I am connecting as an authenticated user (the same one that owns the web root and everything in it - who is also in the same group as apache and this is the group all the files are part of).  How can ensure that files are created with 775 permissions when ftping? (I am using vsftpd)


How can I "merge" patterns in a single line?

I am doing grep and sed and I get 2 lines of a file that I am interested in. How can I get these lines in a single line ending with the new line character? Now I am getting:    pattern1   pattern2     I would like to get pattern1 pattern2 \n


Why would you want to fit/use a Poisson regression instead of Negative Binomial?

Given that Poisson is a special case of Negative Binomial which seems to just make error more likely in the case of overdispersion, without offering any real benefits, why would you fit a Poisson regression over a Negative Binomial? Is there some downside to fitting a Negative Binomial I'm just missing here? I guess it requires you to estimate an additional parameter, but when does that functionally matter? I'm sorry this question is somewhat open-ended, but I am puzzled why NB is not just a default recommendation.


What was the entropy of the universe at the time of the Big Bang?

(I asked this question in ; but I was advised to direct it here, despite it is, in my opinion, somewhat too speculative for physics.SE).  High entropy generally means high disorder; and low entropy low disorder; the two paradigmatic cases that illustrate these two possibilities is a gas, for the first, and a crystal for the second.  Since Entropy always increases (in general); its expected that the entropy at the beginning of the universe should be the lowest possible.  Which means it ought to be considered as a crystal.  On the other hand, as the universe is squeezed to something smaller than an atom; one expects the temperature to climb precipitously, and for any structure in matter, and perhaps space and time too to 'melt'; and hence approach the state of a gas (perhaps plasma might be a better description here).  How can one resolve these two possibilities?  Does considering that the singularity is a black hole allow one to make some guarded guesses here?


How to tune the proportion of minority class after oversampling in imbalanced data with cross-validation?

I have an imbalanced data set and I want to balance them with  with cross-validation. In order to determine the performance of the classifier on the original data, I will cross-validation as follows: Here, feature X is divided into X_train and X_val. scoring = {'accuracy' : make_scorer(accuracy_score),             'precision' : make_scorer(precision_score),            'recall' : make_scorer(recall_score),             'f1_score' : make_scorer(f1_score)}  model=RandomForestClassifier(n_estimators=50,random_state=10)   results = cross_validate(estimator=model, X=X, y=Y, cv=10, scoring=scoring)  Based on this code, I can find the performance of random forest on the original data. However, I am a bit confused about how I should compare the oversampled data with the original data. I want to determine the best proportion of data and I use the following code. Should I split the original data to train and val and oversample train data and find the performance on val data? I am wondering if the results of these codes are comparable? percentage = np.arange(0.20,0.5,0.02) Measurements = np.zeros( (np.size(percentage),4) )   skf = StratifiedKFold(n_splits=10)  for train_index, test_index in skf.split(X, y):     X_train, X_val = X[train_index], X[test_index]     y_train, y_val = y[train_index], y[test_index]        counter = 0     for per in percentage:          smote_nc = SMOTENC(sampling_strategy = per, categorical_features=[0,1,2,3,4,6,8,9], random_state=0)         X_resampled, y_resampled = smote_nc.fit_resample(X_train, y_train)          X_resampled = pd.DataFrame(X_resampled, columns=X_val_train.columns)           after_X_resampled = encoding(X_resampled)                  RF = RandomForestClassifier(n_estimators=50,random_state=10)          RF.fit(after_X_resampled, y_resampled)                  prediction = RF.predict(X_val)                   Measurements[counter,0] += accuracy_score(y_val, prediction)         Measurements[counter,1] += precision_score(y_val, prediction)         Measurements[counter,2] += recall_score(y_val, prediction)         Measurements[counter,3] += f1_score(y_val, prediction)          counter+=1


I can't seem to have both the small caps and boldface styles on a line:  \huge\sc\bf Hello   This will generate bold text, and if the \sc is placed after, it will generate small caps text but not bolded. They seem to override each other, so is there any way to apply them both?


To disable button or to not disable button?

Simple question, should a button be disabled if the form is not finished, i.e. still missing some input of mandatory fields?  Why/Why not?


I am trying to make a shader like the blue shader below but can’t get it right. I have tried using a mix shader with two diffuse and a fresnel but it ends up way off from the what I’m trying to achieve.


unable to type in password at login screen after restart?

I am locked out of my laptop after restarting it. When I am in the login screen, I have 3 options:    me / registered user guest session remote login   When I click on the password field/text box that says log in, or press enter, it disappears. I can only press Esc and i am taken back to the 3 options, so I tried to just start typing the password, but nothing happens.   What can the problem be? Ubuntu did install some updates and I installed GIMP and libimobiledevice.   I tried to look for previous questions/answers, but nothing seem to match my problem. Can anyone help? I am a novice here and I don't want to give up or start from scratch. I have done so much on it already.Thank you in advance.


Why do we say that in Coulomb's law the force is proportional to $\frac{1}{r^{2}}$ and not $\frac{1}{r^{3}}$?

I am going over Coulomb's law and there is something that is a bit confusing for me:  According to Coulomb's law, if I have a charge $q_{1}$ at a point $\vec{r_{1}}$ and a charge $q_{2}$ at a point $\vec{r_{2}}$ then the force that the first charge applies to the second charge is given by  $$ F_{1,2}=\frac{Kq_{1}q_{2}}{|\vec{r_{2}}-\vec{r_{1}}|^{2}}(\vec{r_{2}}-\vec{r_{1}})=\frac{Kq_{1}q_{2}}{|\vec{r_{2}}-\vec{r_{1}}|^{3}}\hat{(\vec{r_{2}}-\vec{r_{1}})} $$  I see that in the first expression is does look like the force is proportional to $\frac{1}{r^{2}}$, but I don't understand why it isn't the second expression that matters, giving us that the force is proportional to $\frac{1}{r^{3}}$:  Say both charges are on the $x-$axis, then $\hat{(\vec{r_{2}}-\vec{r_{1}})}=\hat{x}$. Increasing the distance between the charges to two times what is by moving the second charge on the $x$- axis was, would decrease the force $2^{3}=8$ times, since $\hat{(\vec{r_{2}}-\vec{r_{1}})}$ is still $\hat{x}$.  What is the mistake in my reasoning ?


How to prevent Windows 10 from starting previous programs after system failure?  My problem: In company, I have Visual studio project with TFS, but via VPN. With my job, I need to turn it on always to remote control when needed.  Sometimes when our building manager guys turn off the light (don't as me about our company policy), my computer lost power, agrr. The next day I come, turn on computer and it auto start Visual studio without connecting to VPN, so my TFS got offline.   After that I must do many steps to make TFS online again (connect TFS again, change value in regedit....  )  So, how to start windows 10 without auto run previous programs (visual studio) after system failure?


I ordered a new computer and - as always - I think about upgrading it before it arrives.  I thought about adding another graphics card, which would probably push the current PSU beyond its limits. What measures do I have to take care of to combine the powered rails of the PSUs?  I searched for this question and found no conclusive answer, what I've found so far:   some people strongly advise against it but don't provide a reason "don't risk it, simply buy a more powerful one". the power supplies will probably provide slightly different voltages, this will lead to the more powerful PSU providing most of the initial power until its voltage drops and the second one kicks in, too. some people advise using high current diodes. I have no problem with soldering on the wires of my PSU, but I have not seen any reason why I should do it in the first place and high current diodes are not that cheap, especially because I would need one for each powered rail on each PSU (8-10 pieces) there are some commercial solutions to this, like  which is basically just a relay that switches the other power supplies.   So, can I assume it is safe to connect multiple power supplies to power my hardware?


Does there exist a real square root for this diagonal matrix?

I am unable to find a real matrix $A$ that satisfies $A^2=B$ for the matrix given below by any methods I know, since it is already diagonalized. Does there exist such a real $A$ at all, and more importantly, is there any way  to prove whether it does? $$B=\begin{bmatrix} 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & -1 \end{bmatrix}$$


I've tried to make an artificial Corruption biome in Terraria for two purposes:   Farming mobs; Getting a lot of Vile Mushrooms;   But I want to do it accurately and limit the size of the corrupted area. So I'm stuck with the following problems:   Will Ebonstone make blocks of dirt in contact with it corrupted, if I place them in such way? Does Corruption spread through Corrupted grass and Thorns? How big or long may corrupted Thorns be?


How to change Gedit embeded terminal plugin colors?

I am trying to use Gedit as an IDE for learning C. So far everything is working great but i have this problem: when using ls in its embedded terminal I am unable to see all the files and directories in my workspace directory (only shows .c files but not the .out and other directories), yet when i run terminal from CTRL+ALT+T all the files in the current directory show.  I can't seem to figure out why this is happening, so any ideas would be greatly appreciated. it seems to me that only the colored files aren't showing in the embedded terminal and i need them to show.  thank you!


How can I write a button html code only using Jquery?

I am trying to write html code using jquery but this code for a functional button seems to not work for me, I have added the button functionality and works fine when the same line(as below) is written in .html file. function() {   var html '<div>';   html += '<button id="add-button" type="button" role="button">ADD</button>';   html += '</div>'   $("#id").append( html ); }


Schema.org Event does not appear in Google Search

This is my Event Website:  I have added the Json schema on the site in order to show events in google search. Crawled successfully on google webmaster too without any error.But events doesn't appear in google search on top   But when I search keyword "Whittier Events" on google, it doesn't show my events on top:     How this can be fixed?


Are there Apple guidelines for where user shell tools in Mountain Lion should be installed? Some (e.g. TeX, or Apple's Git) end up in /usr, and others (e.g. X11) seem to end up in /opt (sometimes with a symlink from /usr), while others (e.g., Git) end up in /user/local, and I wonder what the difference is, and whether one is preferred over the other.


I have a Look KG361 that is built with 9-speed Ultegra. Is it possible to change the drivetrain to 2x10 or 2x11 with this frame?


Let's suppose that I want to know how much the variables on a program is using s1 = "a long string" s2 = "another long string"  I want to know if it possible to know the usage of RAM of both strings, is there a way?


How would Snape have justified helping Harry in book 1 to Voldemort?

Although the reader is initially meant to believe otherwise, Snape essentially helps Harry and directly fights Voldemort's return in book 1 by opposing Quirrel's actions.  How could he justify this to Voldemort when becoming one of his followers after his return? And why would Voldemort believe whatever explanation he gives, since surely returning must have been his top priority at the time?


So I can't play flash videos on my 16.04 lts from most sites (imdb trailers for one), yet Youtube plays well (because it is html5 and not fĺash?). I am confused as to if this is a flash problem or other, I have followed many flash tutorials yet it just won't work (except for youtube, that is).  Any suggestions? Thanks in advance.


When closing db - java.lang.NullPointerException

I have exception in onDestroy()  public class FragmentList extends Fragment {      private ListView listView;     private FloatingActionButton fab;     private Cursor cursor;     private SQLiteDatabase db;     boolean isAvatar;     String nameText;      public FragmentList() {         // Обязателен открытый/публичный пустой конструктор     }      @Override     public View onCreateView(LayoutInflater inflater, ViewGroup container,                              Bundle savedInstanceState) {          View v = inflater.inflate(R.layout.fragment_list, container, false);         fab = (FloatingActionButton) v.findViewById(R.id.fab);         listView = (ListView) v.findViewById(R.id.listView);           //обработка добавления человека - нажатие на fab         fab.setOnClickListener(new View.OnClickListener() {             @Override public void onClick(View v) {                 //TODO добавление!!!                 Toast.makeText(v.getContext(), "Новая запись добавлена", Toast.LENGTH_SHORT).show();             }         });          //создание курсора         try{             SQLiteOpenHelper databaseHelper = new DatabaseHelper(v.getContext());             SQLiteDatabase db = databaseHelper.getWritableDatabase();             Cursor cursor = db.query("PEOPLE", new String[] {"_id", "NAME", "CHECKBOX"}, null, null, null, null, null);             CursorAdapter listAdapter = new SimpleCursorAdapter(v.getContext(), R.layout.list_item, cursor, new String[]{"NAME", "CHECKBOX"}, new int[]{R.id.name, R.id.checkBox}, 0);             listView.setAdapter(listAdapter);          } catch (SQLiteException e){             Toast.makeText(v.getContext(), "База данных недоступна", Toast.LENGTH_SHORT).show();         }            return v; }        //обработка нажатия пункте списка     public void onListItemClick(){      }      //закрытие базы данных и курсора     @Override     public void onDestroy(){         super.onDestroy();         if (cursor!=null) cursor.close();         if (db.isOpen()) db.close();     } }   log  E/AndroidRuntime: FATAL EXCEPTION: main                                                    Process: ru.bunakov.testapplication, PID: 30583                                                    java.lang.NullPointerException                                                        at ru.bunakov.testapplication.fragments.FragmentList.onDestroy(FragmentList.java:85)                                                        at android.app.Fragment.performDestroy(Fragment.java:1913)                                                        at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1013)                                                        at android.app.FragmentManagerImpl.removeFragment(FragmentManager.java:1167)                                                        at android.app.BackStackRecord.run(BackStackRecord.java:654)                                                        at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)


Is it mathematically possible for a black hole to be connected to a white hole or a worm hole?

I know that there's no evidence at this point for "white holes" however would it even be mathematically possible for a black hole to be connected to a white hole (total opposite so everything would be expelled, after some really extreme physical conditions)? Maybe with a wormhole connecting them? If this was even possible (if the black hole or connection could actually be created and be stable enough), would that matter be expelled into a different universe, etc? Maybe even a different region of spacetime? Just curious, as it would be a cool idea.


Let $T: V \rightarrow V$ linear transformation in finite dimension  why is it true that $(im(T^*))^{\perp}=KerT$  and what does even $im(T^*)$ means?


Can it be that apparent faster than light speed of shadow/laser dot is not actually faster than speed of light?

Many state that in fact laser dot or shadow can move faster than light but I beg to differ.  My question, rather statement would be that nothing, not even apparent illusion of shadow or laser dot is moving faster than light. If we were to point laser at Moon and if we were to move it across it's surface it wouldn't be moving faster than speed of light because each photon takes time to travel to the moon and when laser has been pointed to the new direction we would see that apparent lag until dot would reach new pointed location. Minutephysics states that if we were to do the same it would take 0.00005 seconds for dot to cross distance of 3,500,000 meters. But how can it be because it takes time for photons to reach new direction (more than 1 second)? And that time is dictated by the speed of light? Can this applied to any illusions of this kind? That even if we would to move laser dot along long surface it would never move faster than speed of light but rather at the same speed because there is lag until dot reaches new location at time it takes it's exactly the same amount of time as it would take light to move between that two positions.  I am surly missing something and I want to be corrected.


Will windows 10 partitions work on ubuntu without data lose

If I install Ubuntu 18.04 LTS on Windows partitions will it remove my media files?  If it removes them, then how to get rid of this problem?


BOOLEAN FUNCTIONS: generate a function $f: \{0, 1\}^n \rightarrow \{0, 1\}$ from a $n \times n$ S-Box

I want to calculate the hamming weight of a S-Box using this formula: $\text{hw}(f) = \sum_{x=0}^{2^n-1} f(x)$. Where $f: \{0, 1\}^n \rightarrow \{0, 1\}$  My problem is that I don't know how to get the $f$-function.  I found that helpful paper: . At Page 9 (18) boolean functions are described. But she only prints the truth table (Table 2.1) without describing her $f$-function. She only says $f$ is a linear function, therefore I think $f$ depends on my S-Box?  For example, if I have this $2 \times 2$ S-Box:  0    1    2    3  1    3    0    2    $00 \rightarrow 01\\ 01  \rightarrow 11\\ 10  \rightarrow 00\\ 11  \rightarrow 10$  What are the $f$-functions and what is the hamming weight?


Suppose $x_0:=2\sqrt{2}$ and $x_{n+1}=x_n^2-2$ for $n\ge1$.  We have to show $$\lim_{n\to\infty}\frac{x_n}{x_0x_1\cdots x_{n-1}}=2$$  Establishing convergence is pretty direct but I'm having trouble evaluating the limit. I have tried using the relation $\frac{x_{n}}{x_{0}x_{1}\cdots x_{n-1}}=\frac{x_{n-1}^{2}-2}{x_{0}x_{1}\cdots x_{n-1}}=\frac{x_{n-1}}{x_{0}x_{1}\cdots x_{n-2}}-\frac{2}{x_{0}x_{1}\cdots x_{n-1}}=\cdots=\frac{3}{\sqrt{2}}-2\sum_{k=1}^{n}\frac{1}{x_{0}x_{1}\cdots x_{k}}$ but that doesn't really shed light on the exact value of the limit.  Any and all help appreciated. Thanks!


MLE of $\delta$ for the distribution $f(x)=e^{\delta-x}$ for $x\geq\delta$.

Let $X_1,X_2,\dots, X_n$ be a random sample form a distribution $f(x)=e^{\delta-x}$ for $x\geq\delta$. Find MLE of $\delta$.   My solution:  $$L(\hat\gamma)=\prod_{i=1}^nf(x_i\mid \delta)=\prod_{i=1}^ne^{\delta-x} =e^{n\delta}e^{\sum_{i=1}^nx_i}$$  The log likelihood is $l(\hat\delta)=n\delta-\sum_{i=1}^n x_i$. To find the $\max$ we take the 1st derivative with respect to $\delta$: $$l'(\hat\delta)=n$$ the first derivative cannot be zero. I am not sure how to proceed.


I am having a problem that doesn't seem to be common based on searching various forums.  I cannot run the Make command.  Message:   The program 'make' is currently not installed. You can install it by typing: sudo apt-get install make   So do this:  sudo apt-get install make Reading package lists... Done Building dependency tree        Reading state information... Done make is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.   But then when I try to run Make I get the same message.  What's up?  Edit: Ubuntu 12.04 64bit Desktop fresh install.


Example 4.21 in Baby Rudin: Why is the inverse of this function not continuous at this point?

Here's Theorem 4.17 in the book Principles of Mathematical Analysis by Walter Rudin, 3rd edition:      Suppose $f$ is a continuous 1-1 mapping of a compact metric space $X$ onto a metric space $Y$. Then the inverse mapping $f^{-1}$ defined on $Y$ by $$ f^{-1}( f(x) ) = x \ \ \ \ \ \ \ ( x \in X ) $$ is a continuous mapping of $Y$ onto $X$.    Now in Example 4.21 Rudin illustrates that compactness of $X$ is essential in Theorem 4.17.   So here is Example 4.21:   Let $X$ be the half open interval $[0, 2 \pi )$ on the real line, and let $\mathbf{f}$ be the mapping of $X$ onto the circle $Y$ consisting of all points whose distance from the origin is $1$, given by $$ \mathbf{f}(t) = ( \cos t, \sin t ) \ \ \ \ \ \ ( 0 \leq t < 2 \pi). $$ Then this function $\mathbf{f}$ is of course continuous and injective. But Rudin asserts that the inverse function is discontinuous at the point $(1, 0) = \mathbf{f}(0)$. How to demonstrate this fact rigorously?  So far in the book, Rudin has not discussed the functions $\cos$ and $\sin$. So can we come up with an example that uses only what Rudin has discussed?


Do my blog page views help my main site's page ranking, if they are on the same domain?

My company has a blog, that we release weekly articles on. A few have gotten moderate traffic (more than our actual site's home page). I am trying to figure out if the effort we spend on writing these articles is helping our main site's page ranking. Our site is company.com and our blog is company.com/blog.  I know any traffic is good, but our main goal is to increase our home page's page rank for searches that are not related to blog articles. For example, we have a blog article about using social engagement in mobile apps, that is near the top when those keywords are searched. Does this help our page rank when people search for mobile development consulting companies (which is what we actually do)?


Can Maxwell's equations be derived from Coulomb's Law and Special Relativity?

As an exercise I sat down and derived the magnetic field produced by moving charges for a few contrived situations. I started out with Coulomb's Law and Special Relativity. For example, I derived the magnetic field produced by a current $I$ in an infinite wire. It's a relativistic effect; in the frame of a test charge, the electron density increases or decreases relative to the proton density in the wire due to relativistic length contraction, depending on the test charge's movement. The net effect is a frame-dependent Coulomb field whose effect on a test charge is exactly equivalent to that of a magnetic field according to the Biot–Savart Law.  My question is: Can  be derived using only  and Special Relativity?   If so, and the $B$-field is in all cases a purely relativistic effect, then Maxwell's equations can be re-written without reference to a $B$-field. Does this still leave room for magnetic monopoles?


Visiting multiple US and CA cities - ESTA

I'm traveling to the US for tourism, first to the East Coast, after that to Canada for a weekend, and then back to the US, West Coast. I'm using the ESTA Visa Waiver Program, and they require local contact information.    Do I need to refill the ESTA when traveling back to the US from Canada or is the "old ESTA" valid for this also?


For each $y \in \mathbb{R}$ either no $x$ with $f(x) = y$ or two such values of $x$. Show that $f$ is discontinuous.

This is from Apostol's Mathematical Analysis.  Let $f$ be a function defined in $[0, 1]$ such that for each real number $y$ either there is no value of $x \in [0, 1]$ such that $f(x) = y$ or there are exactly two such values of $x$. Prove that a) $f$ must be discontinuous on $[0, 1]$. b) $f$ has an infinite number of discontinuities in $[0, 1]$.  Long back I had tried to solve the problem. I reasoned for a) as follows: Suppose that $f$ is continuous and let $m, M$ be its minimum and maximum values on $[0, 1]$. Clearly if $m = M$ then $f$ is constant and clearly for every $x \in [0, 1]$ we have $f(x) = m = M$ which contradicts given property of $f$. So we must have $m < M$. Clearly there are now four distinct points $a, b, c, d$ in $[0, 1]$ such that $f(a) = f(b) = m, f(c) = f(d) = M$. By checking possible linear orderings of $a, b, c, d$ I could find a find a value of $y \in (m, M)$ for which there exist more than 2 values of $x$ such that $f(x) = y$. However this approach looks very clumsy and I suspect much simpler and easier proof is possible. Part b) seemed bit complex and my only guess was that probably $f$ was discontinuous on each subinterval of $[0, 1]$ but I could not prove this claim (may be the claim is wrong!). Perhaps there is a simpler solution to this part of the problem. Apostol's also asks to provide an example of such a function. Any hints on the overall problem will be appreciated.  Update: After looking at Marc's answer, I think I have found a way to show that there are infinitely many discontinuities. Earlier the solution was a part of the question itself but it made the question look quite lengthy hence I moved it to a separate answer.


Could Gendry become Lord of House Baratheon?

At the end of Season 6, The Northern Houses...      very informally "voted" Jon as the King in the North. It is widely acknowledged that Jon is the bastard of Eddard Stark. Note: I would've thought Jon could not be voted as Warden of the North or Lord of House Stark.   So, with that as precedent, when we look at House Baratheon:      Gendry is widely acknowledged as a bastard of Robert Baratheon. Unlike the Starks, there are no heirs to House Baratheon. Unlike the North, the Lord of the Stormlands are not a warden of anything.    Given all that, is it possible for Robert Baratheon's one openly acknowledged bastard to, upon a vote in the Stormlands, be elevated all the way to being the Lord of House Baratheon? King's Landing didn't sign-off on what happened in the North, but it is fait accompli. Can the Stormlands just do something as such?


USB enclosure shows one physical drive as two drives

I recently added  to a usb enclosure and plugged it in.  Somehow it showed up as two hard drives in the Disk Management window   I went ahead and formatted it as two drives, hoping that the situation would somehow right itself.  Any idea how this can be happening?     It is a 4TB drive The system is running Windows 10 Anniversary Update It is in a standard USB 2.0 enclosure   How can I get the system to see the new drive as one four terabyte drive?


how does salt works on crypt function in c?

I read the man crypt and didn't understand what the phrase below means: salt is a two-character string chosen from the set [a-zA-Z0-9./]. This string is used to perturb the algorithm in one of 4096 different ways.


Is this sentence correct?      I've never been to Toronto before; do you get the opportunity to visit   Montreal often?


What exactly does apt do for us? More specifically what does it mean when someone says it manages package dependencies? Does this mean that if I am installing PackageA but PackageA requires PackageA1,PackageA2,PackageA3, and PackageA4. Then apt will download these for me?   Also does apt look for errors when downloading a package using the checksum??  I fail to see how this is a duplicate, so if someone can explain why that'd be great. The linked 'duplicate question' asks specifically about apt-get update/upgrade however there is far more to apt then just apt-get update such as apt-get install/remove/purge or apt-cache ...


How to change the name of document elements like "Figure", "Contents", "Bibliography", "Appendix", etc.?

I'd like to modify the names used to typeset some of my document elements. For example, the caption of figure floats should change from "Figure" to "Fig.", and my \tableofcontents sectioning heading shouldn't read "Contents", but "Table of Contents". How can I do that?  \documentclass{article} % \usepackage[english]{babel} \begin{document} \tableofcontents \section{foo} \begin{figure}[h] \centering \rule{1cm}{1cm}% placeholder for graphic \caption{A figure} \end{figure} \end{document}


Why am I forced to use the newest chat interface?

When logging into chat-stackexange I am presented with this message:  The new mobile version of chat is now the default mobile version on devices that support it. Unlike the classic (okay, ancient) version, it allows you to perform actions like editing, starring, and direct replies to particular messages. The classic version is still available and will be used in browsers that lack support for some necessary features of the new version. Logged in users can also choose to continue using the old version on the preferences page of their user profile. Please report bugs and other issues on Meta Stack Exchange. Thank you!  I choose to continue using the old version but cannot find the option to do so on my chat user profile page?


Some words starting with vowels, preceded by 'an' instead or 'a'

We've all been taught in primary school how we're supposed to use 'an' instead of 'a' when we talk about an object whose name starts with a vowel, in its singular form.     -> An Apple -> An Ostrich-> An Elephant   But when we refer to one university, universe or even adjectives like useless, we use 'a' instead of 'an'.     -> A University-> A Useless Boy-> A Unique sight   Why is that so ? I get the fact that we use 'an' for words which start with consonants occasionally, for words like 'Hour','Honor', because the 'H' is silent. But what of the exceptions in the case of words starting with A,E,I,O,U ? Or is the just for certain words that start with 'U' ?


Blender Python: Exclude Collections from View Layers

I would like to replicate in a script what happens if i exclude a collection from a view layer via hotkey E (bpy.ops.outliner.collection_exclude_set()).  I cannot seem to find that exclude in the tree. Is the E hotkey doing a hide render and viewport, or is there more to that? How should i best approach this?  Thanks, Axel


How to make Filmic view transform to not affect the background image?

When rendering 3d scenes, I use the default view transform Filmic, because it is said this gives the most photorealistic results. But when I composit 3d elements over a background video, the Filmic view transform also affects the video footage. I don't want this, because it makes the colors in the video look less saturated. What would be the easiest way to keep the original colors of the background video, while applying the Filmic view transform on the 3d elements? Do I need to save the rendered 3d scene to a file before doing the compositing, or is there a way to do rendering and compositing in one go?


I'm using 13.04 for the first time and I am using proxy base server that's why I can't download anything while I use apt-get update then it shows this message  coolmonter@coolmonter-HP-ProBook-4431s:~$ apt-get update E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) E: Unable to lock directory /var/lib/apt/lists/ E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?   any suggestion


I just saw a few questions where the accepted answer was not the top answer when sorting by votes. I think that was always the case a few days ago.  Did the sorting system change?


LINQ to SQL Where Clause Optional Criteria

I am working with a LINQ to SQL query and have run into an issue where I have 4 optional fields to filter the data result on.  By optional, I mean has the choice to enter a value or not.  Specifically, a few text boxes that could have a value or have an empty string and a few drop down lists that could have had a value selected or maybe not...  For example:      using (TagsModelDataContext db = new TagsModelDataContext())      {         var query = from tags in db.TagsHeaders                     where tags.CST.Equals(this.SelectedCust.CustCode.ToUpper())                      && Utility.GetDate(DateTime.Parse(this.txtOrderDateFrom.Text)) <= tags.ORDDTE                     && Utility.GetDate(DateTime.Parse(this.txtOrderDateTo.Text)) >= tags.ORDDTE                     select tags;         this.Results = query.ToADOTable(rec => new object[] { query });     }   Now I need to add the following fields/filters, but only if they are supplied by the user.   Product Number - Comes from another table that can be joined to TagsHeaders. PO Number - a field within the TagsHeaders table. Order Number - Similar to PO #, just different column. Product Status - If the user selected this from a drop down, need to apply selected value here.   The query I already have is working great, but to complete the function, need to be able to add these 4 other items in the where clause, just don't know how!


If pendulum eventually stops due to air friction why pendulum of pendulum clock never stops?


Looking for a short story: one man is "lucky" enough to live forever through coincidences

I remember reading a story online years ago, but I can't find it anymore. The idea behind this story (pretty sure it was a short story, not even a novella) was some kind of many-worlds thing: there are an infinite number of universes, and all manner of coincidences happen somewhere, and you never observe the universes in which you happened to die. So, your subjective experience is that through a series of increasingly unlikely coincidences, you somehow manage to stay alive. In the end, the protagonist outlives everyone he knows, and eventually all other life on Earth; I remember the story ending when some aliens discover Earth and start investigating him, but I could be wrong about that bit.


Probability - Find $P(X_n \ge max(X_1, X_2, \dots, X_{n-1}))$

We have a set $X_1, X_2$, . . . , $X_n$ iid standard normal random variables. How would I go about finding $P(X_n \ge max(X_1, X_2, \dots , X_{n-1}))$


I am writing this program using the javax.swing library. The "purpose" of the program is that when you push button one the text of the label says button1 if you push button 2 the text of the label says button 2  right.addActionListener(new ActionListener(){         public void actionPerformed(ActionEvent ae){             label.setText("right")          }     });   for some reason this creates a null pointer exception. I really don't get this. Can you guys help me?  Kind regards


How to simplify a singular random structure when reported correlations are not near +1/-1

I have read in several answers to questions on this site that the best way to choose the random structure for a mixed effects model is by using theoretical knowledge. On the other hand I have also read the advice in Barr et al (2013) to “keep it maximal”, that is, to fit the maximal random structure by including all fixed effects, including interactions, as random slopes. However, this seems to often lead to models which either won’t converge, or do converge, but with a warning of a “singular fit”. In the accepted answer to [this] () question it is stated that singular models should be simplified.  But how is this done when the reported correlations are not near +/-1 and there is no theoretical knowledge to help choose.  An example would be much appreciated.


Can't connect to WiFi 16.04 - Additional Drivers not found

I've recently installed Ubuntu 16.04 on my device (alongside Windows 10) and I cannot get it to connect to the internet via WiFi. I have tried using the cable for an Ethernet connection but the Wifi option seem to be missing. Now of course I did my research and all the solutions I have found proposed going to the "Additional Drivers" and change the settings there; problem is, I did go there and there are no drivers available for me to select from. Is there any way for me to fix this? How? Thanks in advance.   ~~Edit after running sudo lshw -class network the output was:  *-network                       description: Network controller        product: BCM43142 802.11b/g/n        vendor: Broadcom Corporation        physical id: 0        bus info: pci@0000:06:00.0        version: 01        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress bus_master cap_list        configuration: driver=bcma-pci-bridge latency=0        resources: irq:18 memory:ab200000-ab207fff   *-network        description: Ethernet interface        product: RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller        vendor: Realtek Semiconductor Co., Ltd.        physical id: 0        bus info: pci@0000:07:00.0        logical name: enp7s0        version: 07        serial: 74:e6:e2:45:a5:64        size: 100Mbit/s        capacity: 100Mbit/s        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation        configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8106e-1_0.0.1 06/29/12 ip=192.168.1.108 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s        resources: irq:47 ioport:4000(size=256) memory:ab100000-ab100fff memory:d2100000-d2103fff   Also, after lspci -knn | grep Net -A3:  06:00.0 Network controller [0280]: Broadcom Corporation BCM43142 802.11b/g/n [14e4:4365] (rev 01)     Subsystem: Dell Wireless 1704 802.11n + BT 4.0 [1028:0016]     Kernel driver in use: bcma-pci-bridge     Kernel modules: bcma


Does a moving charge interact with the magnetic field it produces?

So the title cuts my question a bit short.  If a moving point charge produces a magnetic field, does the magnetic field it produces affect it?  And let's suppose a moving charge is moving in a region with an externally provided magnetic field, how does the magnetic field produced by the charge's movement interact with/affect/cancel the other magnetic field?


I have a URL like https://<domainname>/popup.jsp?sitekey=7-8&type=popup of this the request parameter string (sitekey=7-8&type=popup) is formed dynamically and then appended to the request URL and then a AJAX request is submitted. Before attaching the request parameter string to the URL we use escape() function of JS. so its like :  var URL=/popup.jsp?; var reqVal="sitekey=7-8"; reqVal=reqVal+"&type=popup"; URL=URL+escape(reqVal);   So the URL actually is submitted as   /popup.jsp?sitekey%3D7-8;amp&type%3Dpopup   In servlet when loop through the request parameter names I get parameter name as sitekey%3D7-8  instead of only sitekey and hence my code breaks when I try to get value of sitekey by using request.getParameter("sitekey")  Please help as to how I decode the URL so that request parameter name I get is proper.


I am SO user.  I just saw that if I delete an answer more then 3 upvotes then i got displined badge after geting this badge if i undelete my answer then i got my bounty & badge remains the same.  i have search on meta & i found     but I think this kind of badge must be revert back. otherwise no use of this. I got this badge in 2 account me & my friend same.   so I know its reproducable bug & not any caching issue.


I need to explain to someone why it's grammatically incorrect to use "artifacts reduction" as opposed to "artifact reduction." Can anyone help with an explanation?


Can I cash out my 401k every year (company match > withdrawal penalty)?

My company offers a 401k 50% match up to 6% of salary, but I'm restricted to picking one of a set of investment portfolios.  My thinking is, could I max out the 6% every year, get the full 50% match, and then withdraw at the end of each year for the 10% penalty?  Given a 50k salary, that would be 3k that I'd invest, 1.5k match = 4.5k total, and the 10% penalty would still give me 4.05k, or a 35% yearly return that I could immediately move to my regular investment account with full flexibility.  Good idea, bad idea?  What am I missing?


Null array of buttons supposed to be set

I don't understand why in my code I get a :     null reference object   when i try to click on my buttons.  buttonMenuOption = findViewById(R.id.buttonOption); Button[] buttonsOption = new Button[nbObjects]; buttonsOption[0] = findViewById(R.id.buttonOption0); buttonsOption[1] = findViewById(R.id.buttonOption1); buttonMenuOption.setOnClickListener(new View.OnClickListener() {     public void onClick(View v) {         setContentView(R.layout.graph_option);             for (int i = 0; i < nbObjects; i++) {                 final int j = i;                     buttonsOption[i].setOnClickListener(new View.OnClickListener() {                         public void onClick(View v) {                             //Do stuff                           }                     });              }      });   To resume my code, there is an option button in my main activity, when I press it, it changes the layout then there are multiples buttons to activate a color picker.  Why is my buttonsOption[0] a null reference?  Update  buttonMenuOption = findViewById(R.id.buttonOption) buttonMenuOption.setOnClickListener(new View.OnClickListener() { public void onClick(View v) {      setContentView(R.layout.graph_option);      Button[] buttonsOption = new Button[nbObjects];         for (int i = 0; i < nbObjects; i++) {             final int j = i;             buttonsOption[0] = findViewById(R.id.buttonOption0);             buttonsOption[1] = findViewById(R.id.buttonOption1);             buttonsOption[i].setOnClickListener(new View.OnClickListener() {                     public void onClick(View v) {                         //Do stuff                       }                 });          }  });


Difference between sequence and function

Online resources describe a function as a correlation between domain and range values,  while a sequence is just a bunch of numbers correlated with the term.  Isn't this the same thing if you consider the term to be the domain and the sequence value at that term to be the range? What's the difference between a sequence and function?


Laptop as second monitor via VGA cable, XP+ Vista

I have host desktop PC (running Windows XP) with a TV Card. I connected it via VGA cable to a laptop that runs Vista. I'd like to extend the desktop screen to the laptop. Both computers detected the second monitor but they detect it as a secondary and are not extending display to it. (So xp shows  itself as primary display and vista is showing itself as primary display)  There were few topic about connecting computers with software Like MaxiVista or ZoneScreen via network but this is too slow to watch movies or television on my setup.  What am I doing wrong?


Somehow I changed the setting from the default double click to single click which makes the right click open the file when I want the right click menu. So I need to know where I did it so I can reverse it.  I've spent the whole night trying to remember how I did it, Please help, Thanks  The setting altered both sides, Solved thanks guys!


Why does the blue line in the timeline cause errors if I render past it?

How can I reset this blue line? Because an error occurs when I render this file, the footage stops moving after the blue line ends (= frame ~250)


static async Task<loginResponse> SfLogin()     {         Task<loginResponse> lr = sc.loginAsync(null, userName, password + securityToken);         return await lr;     }  // In the above code, the loginAsync() method is expecting 4 parameters, missing parammeter is "CallOptions". Please help me in this, what should need to pass here.


So I have someone who is interested in a sugar daddy/sugar baby arrangement but in order to receive the money he wants my mobile banking username and password. Is it a scam ?


Where does an op amp's input bias current come from if capacitor is used?

In the case of a non-inverting amplifier, if I DC couple the input signal with a capacitor only, \$C_1\$ (i.e. no resistor to ground), sources (as well as an experiment in the lab) show me that the op amp input will be saturated as the input bias current deposits charges on the terminal without having a return path to ground. This is solved by using connecting a resistor (\$R_1\$, as shown in the image below) to ground to create the return path. [The image is reproduced from an answer by "Neil_UK" on one of my previous questions, thanks Neil!]    My questions:   1) How is the input bias current able to continuously deposit charges and saturate the input if I don't use the resistor? The resistor should not allow the DC bias current through, so where is this current flowing from/into?  2) Why is this not a problem for the feedback path to the "-" terminal? There is no resistor to ground in that case, and capacitor \$C_2\$ seems to be causing no issues. The PDFs I've been reading suggest that the feedback behaves similar to when I have a resistor to ground by acting as the return path, how is this?


How to prove $ \sum_{k=3}^n \binom nk \binom k3 =\binom n3 2^{n-3} $

How to prove this?  $$ \sum_{k=3}^n \binom nk \binom k3 = \binom n3 2^{n-3} $$  It seems that some terms in the binomial coefficients cancel out: $$\binom nk \binom k3  = \frac{n!}{k!(n-k)!} \cdot \frac{k!}{(k-3)!3!} = \frac{n!}{(n-k)!(k-3)!3!}.$$ But it's not clear whether this can be simplified further.  Thank you


It may be the case that this is extremely trivial to prove, but I just cannot see it. I want to prove this:  $|a\alpha-b\beta|\leq|a-b|+|\alpha-\beta|$  for $0\leq a,\alpha,b,\beta\leq1$  I think it is also the case that  $|a\alpha-b\beta|\leq|a-b + \alpha-\beta|$  I actually THINK these might hold because I cannot provide any counter example.  Any kind of help would be extremely appreciated.


What is a word for a "phrase to remember", e.g. "Life is like a box of chocolates"?

My mother always said, "Life is like a box of chocolates."  How do you describe such phrases, i.e., a phrase/saying/quote to remember by? Something like a memento or reminder, but for "phrases", "sayings" or "motivational quotes". "Reminder" may be a good word, but I wonder if there is something better, like "self-reminder".


Disable automatic activation of Gnome Shell activities on mouse over

I have been searching for a way to disable the "hot corner" feature of the Activities button in Gnome Shell. I would prefer it to require a click such that I don't keep accidentally activating it upon mouse over.


I want to show hide data via js on fetched data

I have two pages, first page is having html now i am calling first page html on the second page via jquery and the code is given below.  $(".cat_ring").click(function(){     var x =$(this).val();     var alphabet=$('.soganii').val();     $.ajax({         url : '******************',         method : 'POST',         data : {id:x, alpha:alphabet},         success : function(data){             $(".soganiiiii").html(data);         }     }); });   now the html part which i am fetching from previous page to new page having one radio button. by which i want to show & hide a div. which i am trying to do by below code.  $('.custom').click(function () {                     alert();                   $('#product').show('fast');               });               $('#product1').click(function () {                   $('#product').show('fast');               });   i can show the previous page html content to new page but my js is not working when i want to use radio button of fetched content. Thanks in advance


No notification (+15) for accepted answer

Yesterday my answer was accepted, but I got no notification in top bar, moreover, top bar still shows that I earned 45 reps  while reputation tab shows right 60 rep.  Update: July, 11 Again having this problem: In the dropdown:  In the rep tab:  You see, first down votes in the drop down are missing.


Can I use `SHA (message || key)` as MAC?

One should not use SHA for MAC, because knowing SHA(key || message) and message you can construct SHA(key || message || forgery) without knowing the actual key. I read somewhere that one shouldn't use SHA(message || key) as MAC. Why? Here || means string concatenation.


I have often wondered which is the better way of checking the type of an object before carrying out an operation.   I could use the 'is' operator:  if(obj is MyClass){     var tObj = obj as MyClass; }   Or I could use the 'as' operator and test for null:  var tObj = obj as MyClass;  if(tObj != null){  }   Is one preferable to the other? Is one way quicker? Does it matter?


Integral of $ x \ln( \sin (x))$ from 0 to $ \pi $

$$\int_0^\pi x \ln(\sin (x))dx  $$   I tried integrating this by parts but I end up getting integral that doesn't converge, which is this $$ \int_0^\pi \dfrac{x^2\cos (x)}{\sin(x)} \ dx$$ So can anyone help me on this one?


What is difference between a ring and a field?

The ring axioms require that addition is commutative, addition and multiplication are associative, multiplication distributes over addition.   A field can be thought of as two groups with extra distributivity law.   A ring is more complex: with abelian group and a semigroup with extra distributivity law.  Is a ring a more basic structure than a field, or vice versa? What's the relation between them? What's the background why people study them?


Lualatex: several levels of subscripts in a sum

I would like to have several subscripts in my sum, like "sum over all i but not for i = 3". I have tried using \subscript from amsmath but failed with undefined control sequence. I've also failed to use the subarray environment. Please tell me what is a step by step proper way to have several subscripts?


I keep hearing people say everything is not… which frustrating because it is ambiguous. It could mean either     Nothing is… (for the set of all things, no thing is…)   or      Not everything is… (for the set of all things, some things are not…/not all things are…)   I have been hearing it more and more in the past few years. In fact, when you , you get Selena Gomez’s rendition of the Wizards of Waverly Place theme song which only further popularizes it with the youth.  Is this phrase grammatically correct/legitimate (ie, would an English teacher complain?), and if so, which is the correct meaning (if any)?


In a database we have the full file path for a database field type is nvarchar(255) and structure/data would look like this:  M:\Blue\Red\Green\Folder\Pink\Purple\Database1.accdb M:\Blue\Red\Orange\Folder1\Folder2\Folder3\Size\Small\Large\DbTest1232323Test.accdb   My question is, how can I extract only the database name – pull only this out:   Database1.accdb DbTest1232323Test.accdb   Since the name of the database can vary, I can't use just a RIGHT() function.  Is there a way I can somehow use a wildcard in conjunction with RIGHT() to say, "Pull everything to the right of the last \"?


How can I downgrade from PHP 7 to PHP 5.6 on Ubuntu 16.04?

I am trying to revert my PHP version to 5.6 from 7 and though I removed PHP 7 and then installed PHP 5.6 I still seem to be running version 7.  Is there a simple method for moving through PHP versions where apache, phpMyAdmin and co are configured appropriately?  A simple way to change the current version of PHP on the fly and even site by site would be great.


How do I highlight certain word using the cat command on the terminal?


Bake Fluid Simulation via CLI or Python?

I would like to run a fluid simulation on a headless Ubuntu machine I have lying around. I did manage to find a  on the issue but to no avail. Has anyone else had any success? Or perhaps a better solution to my problem?


Why is ArcMap editor deleting some added vertices and simplifying polygon?

I am using ArcMap 10.0. I am trying to edit (and add) vertices in a polygon.   I start editing, (using "Edit Vertices" tool), and add many vertices in the polygon.   Then when I am done, I save the changes. But, the image gets simplified and I lose many of the additions!  Why is the editor deleting some vertices and simplifying the polygon?


keep a text in the center of the browser using CSS

"Hello Tamanna" will always be in the center after zooming in or out


Find the intersection of all $T_2$ topologies on an infinite set $X$

Let $X$ be an infinite set. Show that the intersection of all Hausdorff topologies on $X$ is a topology, and find it (Hint: We are familiar with this topology).   The best candidate seems to be the co-finite topology on X, as it is a subset of each of the Hausdorff topologies, and it fits the hint. However, I am having trouble proving that for every subset of $X$ whose complement is infinite, there is a Hausdorff topology which does not include it.


Reputation on graph doesn't match reputation on account

On Stack Overflow, when I look on my account it currently shows 1,040 reputation. However the graph shows 100 more reputation, sitting at 1,140.  Is there some sort of bug or error happening to cause this? How can I fix this?


Pros and cons of a PhD in material science for someone passionate about research

I am a material science Masters graduate i have a double bachelor degree and double Masters degree (From 3 countries) now i am working at a reputable automotive company. However, My passion is in research, I tried many times to get a PhD with no luck (in Germany and parts in europe). until i gave up and started working in the industry.   My questions are: If i want to work in research (and not necessary continue in the academic track). Does it make sense to still try and get a PhD?   If i want to go back to industry again, Will my PhD title affect my chances to go back in the industry and will i have to stick to academic career?   Would it be just easier to get a job at a research company/facility and just work there without a PhD degree?   I keep hearing mixed opinions about all the questions i asked. I would really love to hear feedback particularly from with a background in material science


stock changed name looking for cost basis

Looking for stock prices from 2000 to 2010 for Yahoo stock which is now Altaba (AABA).  Believe it may be defunk now.  Yahoo finance doesn't show historical prices for delisted or the old name for a stock.  Need to find cost basis for taxes


Why only light nuclei are able to undergo nuclear fusion not heavy nuclei?

Is it because of the binding energy or the binding energy per nuclei .  I am having trouble with this whole binding energy and nuclear fusion concept.


Measuring quantum entanglement in paper by Ma et al

Looking at the links below, could somebody please explain how entanglement between Alice and Bob particles is established/deduced from Victor's choice/measurement? I understand that Alice and Bob can make measurements in any one of three bases (Left/Right, Vertical/Horizontal, Up/Down). What I don't get is how Victor's choice of entangled-state measurement or a separable-state measurement affects the interpretation of what Alice and Bob see. Could you walk me through it?   p.s. I don't have a physics degree and have done as much research as I can on my own. Please don't patronize. Kindly answer in non-technical terms if you can. Dumb it down for me. Thanks.


Prob. 9, Sec. 4.3 in Kreyszig's Functional Analysis Book: Proof of the Hahn Banach Theorem without Zorn's Lemma

Here's Theorem 4.3-2 (i.e. the Hahn Banach theorem for normed spaces):     Let $f$ be a bounded linear functional defined on a subspace $Z$ of a normed space $X$. Then there exists a bounbed linear functional $\tilde{f}$ on $X$ such that $$\tilde{f}(x) = f(x) \ \mbox{ for all } \ x\in Z,$$ and $$\Vert \tilde{f} \Vert_X = \Vert f \Vert_Z, $$ where $$\Vert f \Vert_Z \colon= \sup \left\{ \ \frac{ \vert f(x) \vert }{\Vert x \Vert} \ \colon \ x \in Z, \ x \neq 0 \ \right\} \ \mbox{ if } \ Z \neq \{\ 0 \ \}; \ \mbox{ otherwise } \ \Vert f \Vert_Z \colon= 0.$$ And, $$\Vert \tilde{f} \Vert_X \colon= \sup \left\{ \ \frac{ \vert \tilde{f}(x) \vert }{\Vert x \Vert} \ \colon \ x \in X, \ x \neq 0 \ \right\}.$$    I think I'm clear about the proof of this beautiful result. It uses the Hahn Banach Theorem for Complex Vector Spaces, which uses the Hahn Banach Theorem for Real Vector spaces, and the latter uses the Zorn's lemma.   Now if $X$ is a separable normed space, then is there a proof of the above result that doesn't involve the use of the Zorn's lemma?


how to convert date string(2016/5/7/ 4:25:00 PM) to date format to (2016-05-07 4:25:00) in python

having trouble converting this string into a datetime this is what I tried so far in code:  import datetime  mystring = '2016/5/7/  4:25:00 PM' dateobj = datetime.datetime.strptime(mystring, "%Y-%B-%dT%H:%M:%S-%H:%M") print (dateobj)   it throws me errors and I search in the library and still can't figure it out what I have wrong in my format. Please any help I'll gratly apreciate it


How do I mark a comment as an answer? The  and meta-overflow FAQ does not appear to cover the topic.  Arrowdodger's comment at  is the correct answer.


C# problems to select property in a methode

I'm new in c# and can't find the solution.  I adding two car in an array.  I want to find the biggist car length in Greateslength().   Only I can't select Carlength or others at <--------- CAN'T SELECT  How can I select:   Carlength  Widthcar  CarInfo  CarBrand   in the Greateslength()method.      abstract class Car     {         abstract int Getperimeter();     }      class Cars     {         public Car[] _Items = new Car[0];         public int Count { get; set; }          public void Add(Car car)         {             Count = Count + 1;             Array.Resize(ref _Items, Count);             _Items[Count - 1] = car;         }          public void Greateslength()         {             foreach (Car element in _Items)             {                 int largestCarLength = 0;                  if (element. > largestCarLength) <--------- CAN'T SELECT Carlength                  {                     largestCarLength = element.; < ---------CAN'T SELECT Carlength                      Console.WriteLine(element.); < ---------CAN'T SELECT Carlength                                                   < ---------CAN'T SELECT Widthcar                                                   < ---------CAN'T SELECT CarInfo                                                   < ---------CAN'T SELECT CarBrand                  }             }         }     }      class VW : Car     {         public VW(int carlength, int widthcar, string carInfo)         {             this.Carlength = carlength;             this.Widthcar = widthcar;             this.CarInfo = carInfo;             this.CarBrand = "VW";         }          private double Carlength { get; set; }         private double Widthcar { get; set; }         private string CarInfo { get; set; }         private string CarBrand { get; set; }          public override double Getperimeter()         {             return Carlength * Widthcar;         }       static void Main(string[] args)     {         VW vw1 = new VW(10, 20, "car 1");         VW vw2 = new VW(22, 11, "car 2");          Cars c1 = new Cars();         c1.Add(vw1);         c1.Add(vw2);          Console.WriteLine("--------------------");         c1.Greateslength();     }


What is the right way to delete all photos from a camera?

What is the most correct way to delete all photos from a camera after they all have been copied to a computer:    to format memory card using the camera menu,  or simply Select All and Delete photo files from the card using a computer as if it would be just a usb flash drive,  or maybe some other way?   Or no difference at all?


How do I get a div to float to the bottom of its container?

I have floated images and inset boxes at the top of a container using float:right (or left) many times. Recently I hit a need to float a div at the bottom right corner of another div with the normal text wrap that you get with float (text wrapped above and to the left only).  I thought this must be relatively easy even though float has no bottom value but I haven't been able to do it using a number of techniques and searching the web hasn't come up with anything other than using absolute positioning but this doesn't give the correct word wrap behaviour.  I had thought this would be a very common design but apparently it isn't. If nobody has a suggestion I'll have to break my text up into separate boxes and align the div manually but that is rather precarious and I'd hate to have to do it on every page that needs it.  EDIT: Just a note for anyone who comes here. The question linked above as a duplicate is in fact not a duplicate. The requirement that text wrap around the inset element makes it completely different. In fact, the response to the top voted answer here makes it clear why the answer in the linked question is wrong as a response to this question. Anyway, there still doesn't appear to be a general solution to this problem but some of the solutions posted here and in the linked question may work for specific cases.


Show that: $$cond_2(A^TA)={cond_2(A)}^2$$  The only thing that i know is that $||A||_2=max[\sqrt{\lambda} \in \Bbb R|\lambda \ is\ an\ eigenvalue\ of \ A^TA ]$ Can someone help me, please?


Delete a vertex,how to show that graph remains connected?

How can I show that at each connected graph(there is a path from any point to any other point in the graph),there is a vertex,so that if we delete this vertex and the edges that conclude to it,the graph remains connected?


Do the initial value problem $dy/dx=2y^{1/2}$ , y(0)=a has infinitely many solution for a=0.

please solve the initial value problem $dy/dx=2y^{1/2}$, y(0)=a. I wanted to know that this  problem admits infinitely many solutions for a=0 or admits infinitely many solutions for $a\geq 0$


Referencing figures when compiling with pdfLaTeX

I had a problem in referencing figures, which now I solved, thanks to an  by Werner.  To be precise, in my case the reference was working properly (the hyperlink was pointing to the correct figure), but I couldn't manage to substitute the double question mark with the correct figure number.  Why does the relative placement of \label and \caption matter, shouldn't the double compilation of the LaTeX code suffice? Is there a technical reason for this behaviour? I noticed that it occurs only when compiling with pdfLaTeX, not with LaTeX.  Thanks in advance!


Play audio through another computer's speakers

I used to have Bluesoleil bluetooth bundle and I was able to play audio through my desktop computer from my laptop.  Is there any alternative software bundle that will do the same purpose but over wifi let's say? I tried to google but no luck.


Effect of a lin-log model on the R^2 value as compared to a lin-lin model?

From all the data I have worked with, I have noticed that in a linear model with one explanatory variable, taking the ln of that explanatory variable and using the result as the new "independent" variable in the model makes the regression line (with the estimators for the parameters gotten through OLS) a better fit (in terms of a better R^2 value).  Assuming the X's being considered are always positive, my question just has three parts:  1) Is it always the case that the new regression line for "Y on ln(X)" has a more favorable R^2 value as compared to the old regression line for "Y on X"?  2) If no, when is it not?  3) What determines this change in the R^2 value exactly?  All help would be appreciated!  (I know I mentioned ln(X) in this particular question but naturally this doubt would be applicable to most logs with any base, barring some cases)


Limit $\lim_{x \to 0 }\frac{x}{\sin x} = 1$?

I have a question regarding limits.  Recently in a math class, my teacher states that $\frac{\sin x}{x}$ goes to $1$ hence in the case of a $\lim_{x\to 0} \frac{x}{\sin x}$, the answer is $1$.  Why is that so? Shouldn't the answer be $0$ in this case?


Possible Duplicate:          Please, look at the picture?    Which calculator shows true result and how to prove achieved result?


What's the single-word for "left or right handed"?

'Male'/'female' is to 'gender' as 'left-handed'/'right-handed 'is to...?  Is there a word to describe this? For example, if I ask a guy     What's your ____?   It should mean I'm asking whether he's left or right-handed.  Another example could be     Our designs are not biased  against your ____.   Basically, I'm looking for something that means the state of being left- or right-handed which could be used analogously as gender.  EDIT: Sorry for the delay in the edit, but I was tied up. There are some points I'd like to clarify:   I'm not looking for a way to paraphrase my questions. I'm looking for a single word. I know people normally ask something along the lines of "Are you left-handed or not?" People also ask "Are you afraid of the dark?" instead of "Are you scotophobiac?". The word for it,  still exists, right? It has been pointed out that I should go with Our designs are not biased against left-handed people as that is what I mean. But that is not necessarily what I mean.    For example, let's say there is a washbasin with the tap on the right. Clearly, it's biased against lefties. Sometimes, you come across a washbasin with a tap on the left. (The logic being: you use your left hand to turn the tap as your right one's dirty). But, your right hand might not always be dirty, in which case, it's biased against righties.  A washbasin with the tap on the center is, then, handedness-blind or chirality-blind, if you will. (I foresee that some would dwell on Our designs are symmetrical. Please don't.)  I'm looking for a term that would be applicable here, as well as in the 1st example.  My favorite so far is chirality, suggested by Dan Bron in a comment (with 25 upvotes!) But, I'm reluctant to use it because there's no hard proof it's used in that sense  If we are talking about male-female, gender works perfectly. What's your gender? and Our designs aren't biased against your gender. , both work perfectly here.  Sorry for the late edit again. If the consensus is that I rollback, I will. Let me know in the comments.


Suggestion for books about mathematics of quantum entanglement and computation

I am reading book called Mathematics of Quantum Computation by Ranee K. Brylinski and Goong Chen, and it's really what I need since I am working on quantum entanglement and this kind of stuff, but the problem is that I found the book really vague and I can't really understand it. I wonder if someone can have suggestions about new book or book that can give me a building materials so I can understand this book.


Can critical points occur at endpoints? E.g. $f(x) = \frac{1}{x}$ at the interval $[1,4]$

Given that an extreme value can only occur at a critical point and in the following case $$f(x) = \frac{1}{x} \quad [1,4]$$ we definitely have two absolute extreme values (maximum and minimum), are $x = 1$ and $x = 4$ critical points?  If so, what is the reasoning for that: the fact that they are in the domain of $f$ and they are not differentiable at those points?  Is my reasoning correct?


Sometimes, the unity panel just stops working, meaning I can't access any menus for the programs I'm running. I know I can probably log in/out but that really puts an uncomfortable hickup in my work flow.  How can I restart unity-panel when it stops working?


Finding the limit of decreasing function

Given $$x_1=\arctan2>x_2>x_3\dots\\ \sin(x_n-x_{n-1})=\frac1{2^{n+1}}\sin x_n \sin{x_{n-1}} $$  Find $\cot x_n$ and prove $\lim_{x\to\infty}x_n=\frac\pi4$  I found that $\cot x_n=\cot x_{n-1}-(1/{2^{n+1}})$  Im not sure how to proceed with the limit. If I put $x_n=x_{n-1}$ in above eq  it evaluate to $0=0$


In the Star Wars universe, could a Jedi Mind Trick be performed over the telephone?   For instance, could Yoda have called up the Imperial embassy on Dagobah and mind tricked whoever answered into getting him in touch with Palpatine? (I know there's no embassy or telephones on Dagobah, but serious question nonetheless.)   To clarify, are long distance mind tricks not only possible but would being in communication with another person, through telecommunication, allow a force user to better perform the action?


Do effects that reduce a spell's casting cost also reduce its converted mana cost?

If I have  in play, can 's triggered ability pull a card like  from my library, which would originally have a converted cost of 4, but which is lowered by the Grand Arbiter's ability?


How can I convert colums to rows in Excel?

Below is a sample of a spreadsheet I have (fig 1). It has been exported from an asset tracking system and provides me a list of information about the hardware we have.  Each asset "area" uses the same format (Name/Asset/Date/Model/Serial) before repeating and I need to get them into columns rather than rows (see fig 2) for entry into a new spreadsheet.  I'm in the process of writing a macro using my Razer keyboard software (involving a lot of copying, moving between workbooks, and pasting) but does Excel actually do that itself?


Using a system with a Linux-based OS as bridge (for WIFI and ETH)

Context:  I have an old working system with an Ubuntu version correctly running on it.  The problem to solve:  The wifi where I work does not reach every place in the office. The idea is to use this system as a bridge for extending the wifi range (please note that I am not even sure that the right word to use is bridge. If not, please correct me).  Questions:   is it possible to solve the problem with the solution I am proposing? Should I use two different wifi antennas? (of course, I have more than one if necessary) is there a standard procedure (or a ready-to-use OS) for that purpose? any advice or suggestions on how to do that? additionally, can I connect this system to a switch in order to provide internet access to other systems connected via eth?   Sorry for this newbie question. I am quite new with networking issues.


In the film, Han says:     “He was training a new generation of Jedi. There was no one else left to do it, so he took the burden on himself. Everything was going good, until one boy, an apprentice, turned against him and destroyed it all. Everything Luke had worked toward: gone. Luke felt responsible. He walked away from everything.”   So what became of this "new generation of Jedi?"  The way Han phrases it, it is pretty clear that the betrayer was not the only apprentice.  Even if they never completed their training, where are there other people that      learned the ways of the Force from Luke?


I need to create a DateTime object with a fixed value on a given TimeZone for today, lets assume it to be 2018-04-23 now I would do DateTime.Today or DateTime.Now.Date to get it on the local timezone, or I could do DateTime.UtcNow.Date to get it on UTC. after that if I want the 9am its something like DateTime.Today.AddHours(9) and that would give me 2018-04-23 09:00 am but that would be, again, on the local timezone, as would new DateTime(.....).   The question then is how could I get 2018-04-23 09:00 am on a given timezone, lets say PST for instance?


Why can't I use objects created on stack for upcasting?

Is this an upcast or not? If not, please describe why. Thanks in advance.  C++ code:  Base base; Derived derived; base = derived; // is this the upcast?


How do I edit /etc/sudoers from a script?

I need to edit /etc/sudoers from a script to add/remove stuff from white lists.  Assuming I have a command that would work on a normal file, how could I apply it to /etc/sudoers?  Can I copy and modify it, then have visudo replace the original with the modified copy? By providing my own script in $EDITOR?  Or can I just use the same locks and cp?  The question is more about potential issues than about just finding something that works.


Automatically set group and permissions on files in a folder?

When I create new files and folders in a specific folder, I would like them to inherit the group and permissions of the parent folder. Is this possible ?  For example  mkdir -p example.com/public cd example.com sudo chgrp apache public chmod 775 public   Now when I create a new folder  cd public mkdir test ls -al drwxrwxr-x 3 foo bar 4096 Nov 3 16:19 public   The test directory belongs to foo and my default group bar. I'd like new folder to belong to the apache group instead.  I'd like the same behavior for files.  Any ideas?


Can I create a new partition my hard drive after installing Ubuntu?

I recently installed Ubuntu on a new hard drive.  I did not perform any partitioning operations during installation.  After the installation and upgrade, I tried to partition the drive in which Ubuntu was installed.  Partition: /dev/sda2 File System: ext4 Mount Point: /  I am not able to create another partition from this one.  Is it possible to do it or should I have to live with one BIG partition? The option to resize this partition is greyed out. What happens if I try to unmount this partition?


How do I multiply the integers between 11 and 30 by 0.015?


Create polygons from point dataset, where each polygon contains 3 points from the dataset

I'm using qgis Brighton  I have a dataset of 1500 points. I want to create polygons, where each polygon contains n=3 points from the dataset.  The aim of this is to have clusters of 3 points, which can be used for analysis, qua I can't show information on point level.  I have tried using heatmaps, but I'm not sure if this is the right tool for this analysis.  Here's a picture of my dataset.    Now, I want to create clusters of 3 points like this:   (Sorry for the amateur cutting)  I want to this, so I can make analysis of the clusters (with 3 points) e.g. energy demand, house characteristics, socioeconomics and so on.


I have the bad habit of late sleeping since I sleep between 1-4:30 AM every day It's very rare for me to sleep earlier before this time So my question is what are the health risks of late sleeping? Are there any scientific Experiments,peer-reviewed papers regarding this subject?


"High response time" warnings in Google Webmaster Tools

In my Google Webmaster Tools account, there are warnings about my site.     Some URLs listed in this sitemap have a high response time. This may indicate a problem with your server or with the content of the page.   What is the solution?


Are holes a fundamental particle? Are they a real thing or just a construct?

Some electronics textbooks seem to refer to holes as just a construct, while solid state physics textbooks seem to imply that holes are a very real thing. I understand that holes are vacancies (p-n junctions) that move towards the cathode while electrons move towards the anode, however, is a hole a real thing, or is it just a construct? I just want to think of it as a construct but I want to hear the general consensus. For example, recombination occurs in a semiconductor when an electron fills a hole.  What exactly is meant, then, when a photon is absorbed in semiconductor (e.g. a silicon p-i-n photodetector absorbs a lower-energy visible red photon about 400 nm within its band gap energy). When the semiconductor absorbs the photon, it cannot simply convert to an electron because charge, spin and lepton number would be violated. Is it converting into an electron and hole, and is a hole an actual, elemental particle? Does it make sense that an electron and hole move in opposite directions towards the anode and cathode, respectively, when radiative absorption occurs?


Fast calculation for $\int_{0}^{\infty}\frac{\log x}{x^2+1}dx=0$

I want to show that $\int_{0}^{\infty}\frac{\log x}{x^2+1}dx=0$, but is there a faster method than finding the contour and doing all computations?  Otherwise my idea is to do the substitution $x=e^t$, integral than changes to $\int _{-\infty}^{\infty}\frac{t e^t}{1+e^{2t}}dt$. Next step is to take the contour $-r,r,r+i\pi,-r+i\pi$ and integrate over it...


After trying to install Acroread I did try to  to remove it, with no success,  the message follows. Please help me because the software center was disabled as the result  sudo apt-get remove acroread Reading package lists... Done Building dependency tree        Reading state information... Done Virtual packages like 'acroread' can't be removed You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies:  acroread-bin:i386 : Depends: libfontconfig1:i386 (>= 2.9.0) but 2.8.0-3ubuntu9.1 is to be installed                      Depends: libxml2:i386 (>= 2.6.27) but it is not going to be installed                      Depends: libxt6:i386 but it is not going to be installed  google-chrome-stable:i386 : Depends: xdg-utils:i386 (>= 1.0.2) but it is not installable  libxml2 : Depends: liblzma5 (>= 5.1.1alpha+20120614) but 5.1.1alpha+20110809-3 is to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).


When did 1024x768 become the standard desktop screen resolution?

I need to justify my choice of screen resolution for a website that has to run on old PCs. When did 1024x768 first become popular? Are there stats somewhere about how far back you'd have to go to find a desktop with resolution smaller than 1024x768? Failing that, anyone want to take a guess?


grep AND feature from anywhere on the line

Is there any way for grep to have an AND feature? I mean something like this:  I have these lines:  I have this one line I don't have this other line I have this new line now I don't have this other new line This line is new   So I want for grep to find lines that contain BOTH the words "new" and "line", not only "new line". I know I can do this like this:  grep new file | grep line   But that's not what I'm looking for. I'm looking to do this with one single grep command. This is because this script will let the user input the two terms, and one of the terms might be null, which then throws a grep error and breaks the script.


Does anyone know the name of travel posters from the 1930s?

Is there a name for this design style - use of flat colours for dimension and shading - that was so prevalent in UK travel posters of the 1930s?


Why do certain Google+ profiles display in the right hand sidebar of the Google search results page for certain keywords?

I manage a number of sites for businesses and noticed that one companies Google+ profile was showing when a certain keyword was searched.  This is great but i'm interested in why this is happening and it doesn't seem to follow a pattern, i've read some other topics eg    These talk about searching for the company, in my case i'm searching a keyword that is something that the company does. The company is a successful exponent of the keyword but wouldn't be the only one yet it shows whereas others do not. Why does it show for a keyword at all? On the whole these listings seem to show when searching the company name directly. it isn't something i've targetted particularly..   I'm thinking that locality plays a big part and I can see that the result changes from different parts of the country. This led me to look at my other companies - for one a rival company shows for a particular keyword. This  company isn't very local at all, over 100 miles away from my company. Both companies have valid verified Google+ pages so why does one company show over the other?   Many thanks if anyone can help.


Making a directory tree of folders and files

How to draw the directory tree image shown below, indicating folders and files?     To draw the folder tree I used the code from , but there is no obvious option to include files, and I therefore edited the image in Inkscape, as indicated in red.  The replicated code from Gonzalo Medina post () is shown below      \documentclass[border=5pt]{standalone}     \usepackage{forest}      \definecolor{folderbg}{RGB}{124,166,198}     \definecolor{folderborder}{RGB}{110,144,169}      \def\Size{4pt}     \tikzset{       folder/.pic={         \filldraw[draw=folderborder,top color=folderbg!50,bottom color=folderbg]           (-1.05*\Size,0.2\Size+5pt) rectangle ++(.75*\Size,-0.2\Size-5pt);           \filldraw[draw=folderborder,top color=folderbg!50,bottom color=folderbg]           (-1.15*\Size,-\Size) rectangle (1.15*\Size,\Size);       }     }      \begin{document}      \begin{forest}       for tree={         font=\ttfamily,         grow'=0,         child anchor=west,         parent anchor=south,         anchor=west,         calign=first,         inner xsep=7pt,         edge path={           \noexpand\path [draw, \forestoption{edge}]           (!u.south west) +(7.5pt,0) |- (.child anchor) pic {folder} \forestoption{edge label};         },         before typesetting nodes={           if n=1             {insert before={[,phantom]}}             {}         },         fit=band,         before computing xy={l=15pt},       }       [system       [config       ]       [lib         [Access         ]         [Plugin         ]       ]       [templates       ]       [tests       ]     ]     \end{forest}      \end{document}


Show that $f$ is convex iff $f\left (\frac{1}{2}x + \frac{1}{2}y \right ) \leq \frac{1}{2} f(x) + \frac{1}{2} f(y)$

Let $\Omega \subset \Bbb R^n$ be a convex set and $f: \Omega \to \Bbb R$ be continuous. Show that $f$ is convex if and only if for all $x,y \in \Omega$, $$f\left (\frac{1}{2}x + \frac{1}{2}y \right ) \leq \frac{1}{2} f(x) + \frac{1}{2} f(y)$$ Give a counterexample to the same statement without the assumption that $f$ is continuous. $\Rightarrow$ is obvious but I am not getting any clue for the other side. I was trying to proceed using the bisection method e.g. for $f(\lambda x+(1-\lambda )y)$ I was trying to approach $\lambda f( x)$ by halving the numbers say $\frac{\lambda x+(1-\lambda )y}{2}$ and same with $(1-\lambda)f( y)$ but it seemed to be not working. Please help me with the proof and the counterexample.


Can a werewolf turn a muggle into another werewolf?

We  that, in all likelyhood, in HP universe, Lycanthropy is a contagion that has magical properties, and is not merely a virus (despite being a metaphor for one as intended by JKR).  As such, is there any canon evidence for what would happen should an HP werewolf bite and try to infect a Muggle? More specifically, would said Muggle have a chance of turning into a werewolf?


I am new to programming and here is a simple question about how passing by reference works. In this program, I am calculating roots of a quadratic equation.  void getCoefficients(double &a, double &b, double &c); void solveQuadratic(double a, double b, double c, double &x1, double &x2); void printRoots(double x1, double x2);  void error(string msg);  int main() {         double a,b,c,x1,x2;         getCoefficients(a,b,c);         solveQuadratic(a,b,c,x1,x2);         printRoots(x1,x2);         return 0; }   So, my question is I seem to be passing values to getCoefficients and solveQuadratic from main program but in the function definitions of getCoefficients and solveQuadratic, I seem to be accepting references as arguments and am confused as to how this works?


Getting NullPointerException while calling interface StationDao method through StationService class which has implemention in StationDaoImpl class

my code is like   public class StationService  { private  StationDao stationDao;  public StationService(StationDao stationDao) {      this.stationDao = stationDao; }  public void insertData(PoliceStationBeans beans) {     // TODO Auto-generated method stub     System.out.println("In Implementation:"+beans.getArea()+""+beans.getUserName()             +""+beans.getPassword()+""+beans.getEmail());       stationDao.insertData(beans); //Getting Error Here } }   How to resolve this error I reffered this question


Automatically make or update a copy real-time on another hard drive volume whenever files are saved to a particular folder

EDIT:  The main recommendations for Windows that were offered in answers to the question cited as the reason for closing this one as a duplicate, do not work in real-time.  I've downloaded Yardis and although it's been set up to recognize changes real-time, it does not do so. Same problem with DSynchronize, whose documentation indicates that this feature is "experimental".  So if we could re-open this question, that would be good.  Whenever I save or update a file to a particular designated folder on my C:\drive I would like to make or update a copy on my network-attached storage device, ideally saving the copy to the NAS as a version rather than overwriting a copy there, if possible.  I have Windows 7 x64 Ultimate. Is there any feature built-in that can accomplish this?  It has to be a real copy, not merely a pointer. I'm trying to achieve some redundancy for especially critical documents (in a variety of formats) that change frequently throughout the day.  P.S. I am looking for folder-level granularity; I wouldn't want this to happen for every file on the C: volume.


How to turn off screen overlay detection prom.. I have tried all ways which are on YouTube.. using Samsung galaxyj7

The real problem is this: nothing is working


Solve the following congruence: 2x ≡ 7 (mod 17)

Question Solve the congruence 2x ≡ 7 (mod 17). I have tried working out this problem but I am stuck midway. Could someone help me out by showing me or explaining how to proceed further? Here is the work that I have so far: Inverse of a modulo m is an integer b for which ab ≡ 1 (mod m), a = 2 m = 17 17 = 8 ⋅ 2 + 1 2 = 2 ⋅ 1 + 0 The greatest common divisor is the last non-zero remainder values, that is, gcd (a, m) = 1. Expressing the greatest commmon divisor as a multiple of a and m, gcd (a, m) = 1 = 17 - 8 ⋅ 2 = 1 ⋅ 17 - 8 ⋅ 2 The inverse would then be the coefficient of a = 2, which in this case, would be -8. And, since, -8 mod 17 = 9 , 9 is also the inverse of a modulo m. Solving the congruence 2x ≡ 7 (mod 17) by multiplying each side by the inverse 9, 9⋅2x  ≡ 9⋅7 (mod 17) 18x ≡ 63 (mod 17) And, this is the part where I am stuck. Could anyone help out? Thank you.


What's a good algorithm for calculating frames per second in a game? I want to show it as a number in the corner of the screen. If I just look at how long it took to render the last frame the number changes too fast.  Bonus points if your answer updates each frame and doesn't converge differently when the frame rate is increasing vs decreasing.


Is the set of all polynomials of degree at most 3 with integer coefficients a subspace of Pn (for n >= 3)?  Im thinking no, for the set in question has polynomials with degree 3 and below while Pn seems to contain 3 and above, at least that is how I interpreted the question. I appreciate it!


How can I prove the following sequence converges

Given the following n-th term sequence:  $$a_{n} = \sqrt[n]{1^2+2^2+...+n^2}$$  You're asked to evaluate the limit of the given sequence, justifying your operations.   What strategy should I take on this? I have considered taking some inequality in order to, eventually, be able to use the Squeeze Theorem.  I've tried exploring some initial terms, viz: $$ a_{1} = \sqrt[n]{1^2} = 1^\frac{1}{n}\\ a_{2} = \sqrt[n]{1^2 + 2^2} = 5^\frac{1}{n}\\ a_{3} = \sqrt[n]{1^2 + 2^2 + 3^2} = 14^\frac{1}{n}\\ \vdots\\  a_{n} = \sqrt[n]{1^2+2^2+...+n^2} = \sqrt[n]{k + n^2} = (k + n^2)^\frac{1}{n} $$ Supposing $k$ is the sum of all the $n-1$ terms of the sequence, rightly before $n²$. We can see that $a_{n}$ is always smaller than $a_{n+1}$ for any $n$ strictly positive.  I'm not sure, though, what else I can try. I would appreciate a hand here.   Answer is:      \begin{align}  1 \end{align}


I'm using \usepackage[style=verbose-ibid,backend=bibtex]{biblatex} to format my references with \footcite{} for the in text references, while also separating my chapters into individual tex files by using \include{ChapterName} in the main tex document.   However, I find that the footnotes seem to reset whever I start a new chapter; references in the first chapter are 1, 2, 3... but in the second chapter it also starts again from 1. I would like the numbering to be continuous, resuming from the last number in the previous chapter.   The other aspects I'm okay with, such as a shortened reference when referring to a reference that was referred to earlier in the document, and ibid when referring to the same reference again on the same page. Just the numbering should be continuous.   What would I need to add to the preamble for it to work like this?  Edit: My question was thought to be a duplicate of  . Instead, my question is the opposite - I want numbering to be continuous throughout the whole report, with chapters resuming the numbering from the previous chapter.   Edit 2: Here's a MWE:  \documentclass{MastersDoctoralThesis} \usepackage{style=verbose-ibid,backend=bibtex}[biblatex] \addbibresource{Bibliography.bib} \begin{document} \mainmatter \include{Chapter1} \include{Chapter2} \end{document}   The auxillary file contents are as follows:  Bibliography.bib:  @Article{gillies,   author = {Gillies, Alexander},   title = {Herder and the Preparation of Goethe's Idea of World Literature},   journaltitle = {Publications of the English Goethe Society},   volume = {9},   date = {1933},   pages = {46--67}} @Article{bertram,   author = {Bertram, Aaron and Wentworth, Richard},   title = {Gromov invariants for holomorphic maps on Riemann surfaces},   journaltitle = {J.~Amer. Math. Soc.},   volume = {9},   number = {2},   date = {1996},   pages = {529--571}}   Chapter1.tex:  Sample text\footcite{gillies}.   Chapter2.tex:  Some more\footcite{gillies} sample\footcite{bertram} text.


Ipad, using safari went to a porn site and now same flashing message keeps jumping up and down and cannot close out

Went to a porn site using safari and suddenly a flashing message came to the screen, Big mistake on my part but can it be fixed.  Two messages one says Print option and goes up the screen then down to disappear then up again like a jumping jack. The screen behind says at Top safari-securityalert.com and the actual screen says "Contact Support and gives a Telephone number Support  1 844 749-1071.  Also says my "iPad has been locked due to detected illegal activity. Call Immediately and says call Apple Support to unlock".  I very much doubt this is an Apple telephone number.      . I have not been able to exit the site as it keeps flashing and jumping and no matter how many times I hit the X, nothing happens. I have rebooted twice. Can this be a virus or malware from going to a Safari site? What to do to remedy.  Is this a virus? How can I get out of this cycle of jumping jack message?


How much currency do you get for a duplicate cosmetic?

When you open a loot crate and receive a cosmetic you already own, it is automatically turned into coins. How much do you get, exactly? Is it a constant amount, a fraction of its unlock cost, or something else?