When I run this code on Android Studio and select the login button, I encounter the following error:  Process: com.example.barbershop, PID: 26295 java.lang.NullPointerException: Attempt to invoke virtual method 'int com.example.barbershop.models.LoginResponse.getError()' on a null object reference     at com.example.barbershop.activities.LoginActivity$1$1.onResponse(LoginActivity.java:53)     at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:70)   and this is my code   @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_login);      final EditText emailEditText = findViewById(R.id.input_email);     final EditText passwordEditText = findViewById(R.id.input_password);     Button signInButton = findViewById(R.id.btn_signin);     final SharedPreferences sharedPreferences = getSharedPreferences(MainActivity.LOGIN_SHARED_PREF,MODE_PRIVATE);       signInButton.setOnClickListener(new View.OnClickListener() {         @Override         public void onClick(View v) {             final ProgressDialog progressDialog = new ProgressDialog(LoginActivity.this);             progressDialog.setMessage("Authenticating...");             progressDialog.show();             String email = emailEditText.getText().toString();             String password = passwordEditText.getText().toString();             // Login             ApiInterface apiInterface = ApiClient.getClient().create(ApiInterface.class);             Call<LoginResponse> loginCall = apiInterface.login(email,password);             loginCall.enqueue(new Callback<LoginResponse>() {                 @Override                 public void onResponse(Call<LoginResponse> call, Response<LoginResponse> response) {                     progressDialog.hide();                     if (response.body().getError() == 0){                         Intent intent = new Intent(LoginActivity.this, MainActivity.class);                         intent.putExtra(MainActivity.SPOT_ID_KEY, response.body().getId());                         sharedPreferences.edit().putInt(MainActivity.SPOT_ID_KEY, response.body().getId()).apply();                         startActivity(intent);                     }                       else {                         Toast.makeText(LoginActivity.this, response.body().getMessage(), Toast.LENGTH_LONG).show();                     }                 }   I want to connect to the server and log in, but I am currently encountering this error.  this is a LoginResponse class code  @SerializedName("error") public int error; @SerializedName("message") private String message; @SerializedName("id") private int id;  public int getError() {     return error; }  public int getId() {     return id; }  public String getMessage() {     return message; }  public void setError(int error) {     this.error = error; }  public void setId(int id) {     this.id = id; }  public void setMessage(String message) {     this.message = message; }   and this is a link for response class code     Any help would be appreciated, Thanks


How can I record video of the iPhone screen without jailbreaking the phone?

Is it possible to record video of the iPhone screen, and if so how?  I'm talking about video screen capturing, not using a camcorder or any app that requires jailbreaking my phone.


How can I pass a value from one constructor to another constructor?

I'm working with Java. I have a class with 2 constructors. The first constructor takes an int value as a parameter and sets an int variable as that value. The second constructor takes a string and prints it out. The idea is that when I call the first constructor from my main class, it sets an integer value. And when I call the second constructor in the main class, it takes the string representation of int variable of the first constructor and prints it out.  Here's how I made the constructors:  public class Test {    int val;     public Test(int x)    {       val = x;       return val; //I know this won't work. So I'm looking for an alternative    }     public Test(String y)    {       System.out.println("The value is " + y);    } }   And the main method (in a different class) looks like this:  public static void main(String [] args)     {         Test t1 = new Test(6);         Test t2 = new Test(String.valueOf(t1)); //This won't work because the first constructor can't return a value     }   So how exactly can I change the contents of the constructors so that I can pass val into the 2nd constructor?


How can I search the APT man page for options to install

I read the answer  and learn a command   sudo apt-get install -y hardinfo    then I tried to find the option -y in the man page  me@alpha:~$ man apt-get | grep '-y' Usage: grep [OPTION]... PATTERN [FILE]... Try 'grep --help' for more information. me@alpha:~$ man apt | grep '-y' Usage: grep [OPTION]... PATTERN [FILE]... Try 'grep --help' for more information. me@alpha:~$ man install | grep '-y' Usage: grep [OPTION]... PATTERN [FILE]... Try 'grep --help' for more information. me@alpha:~$ man 'apt install' No manual entry for apt install   How could I get a manual about options to apt install?


Chrome start page: no "Most Visited" nor "Apps", just "Blank" wanted

Google Chrome Version 22.0.1229.79 on OS X 10.8.2   How can I get just a plain blank page as my home page, not just a list of "Most Visited" sites or "Apps" installed, please?  I did try using the about:blank and/or javacript:void() workaround from these sources:       Note the UI has changed since this and I am confused:      I prefer not to install extensions from unknown sources, like recommended here:


how to prove: $\sum\limits_{k=1}^n k\binom{n}{k}=n \cdot 2^{n-1} $

need help to prove this: $\sum\limits_{k=1}^n k\binom{n}{k}=n \cdot 2^{n-1} $ where $n$ is integer $\geq 1$.   Question also said taking the derivative of $(1 + x)^n$ would be helpful which I've found to be $n(1+x)^{n-1}$  any help appreciated, thank you.


Why is the sky never green? It can be blue or orange, and green is in between!

I, like everybody I suppose, have read the  why the colour of the sky is blue:     ... the two most common types of matter present in the atmosphere are   gaseous nitrogen and oxygen. These particles are most effective in   scattering the higher frequency and shorter wavelength portions of the   visible light spectrum. This scattering process involves the   absorption of a light wave by an atom followed by reemission of a   light wave in a variety of directions. The amount of multidirectional   scattering that occurs is dependent upon the frequency of the light.   ... So as white light.. from the sun passes through our atmosphere,   the high frequencies become scattered by atmospheric particles while   the lower frequencies are most likely to pass through the atmosphere   without a significant alteration in their direction. This scattering   of the higher frequencies of light illuminates the skies with light on   the BIV end of the visible spectrum. Compared to blue light, violet   light is most easily scattered by atmospheric particles. However, our   eyes are more sensitive to light with blue frequencies. Thus, we view   the skies as being blue in color.   and why sunsets are red:     ... the light that is not scattered is able to pass through our   atmosphere and reach our eyes in a rather non-interrupted path. The   lower frequencies of sunlight (ROY) tend to reach our eyes as we sight   directly at the sun during midday. While sunlight consists of the   entire range of frequencies of visible light, not all frequencies are   equally intense. In fact, sunlight tends to be most rich with yellow   light frequencies. For these reasons, the sun appears yellow during   midday due to the direct passage of dominant amounts of yellow   frequencies through our atmosphere and to our eyes.      The appearance of the sun changes with the time of day. While it may   be yellow during midday, it is often found to gradually turn color as   it approaches sunset. This can be explained by light scattering. As   the sun approaches the horizon line, sunlight must traverse a greater   distance through our atmosphere; this is demonstrated in the diagram   below. As the path that sunlight takes through our atmosphere   increases in length, ROYGBIV encounters more and more atmospheric   particles. This results in the scattering of greater and greater   amounts of yellow light. During sunset hours, the light passing   through our atmosphere to our eyes tends to be most concentrated with   red and orange frequencies of light. For this reason, the sunsets have   a reddish-orange hue. The effect of a red sunset becomes more   pronounced if the atmosphere contains more and more particles.   Can you explain why the colour of the sky passes from blue to orange/red skipping altogether the whole range of green frequencies?  I have only heard of the legendary 'green, emerald line/ flash'     that appears in particular circumstances     Green flashes are enhanced by mirage, which increase refraction... is more likely to be seen in stable, clear air,... One might expect to see a blue flash, since blue light is   refracted most of all, and ... is   therefore the very last to disappear below the horizon, but the blue   is preferentially scattered out of the line of sight, and the   remaining light ends up appearing green   but I have never seen it, nor do I know anybody who ever did.


Meaning of 'no earlier than X days after Y'

I am having trouble understanding the following notice on the American Airlines AAdvantage (miles account) :     Note: Mileage credit requests can be submitted no earlier than 15 days   after all travel is completed.   What does it exactly mean? Which of the following statements is the correct interpretation?   I have to wait for 15 days after all my travel is completed before I can request my mileage credit If I want to request my mileage credit, I have to do so within 15 days after my travel is completed Something else   In any case, I wonder, is the original statement grammatically correct?


How can I remove this seam down the middle after mirroring?

Yo,  I'm new to Blender and I'm trying to make a humanoid figure. I followed . I have completed one half of the character but when I mirror it there is a seam down the middle. Clipping is on, too, and all the answers I found are to do with turning it on. I'm stumped.    Thanks in advance,  M~


What Happened to the Malfoys after the Second Wizarding War?

All I can find about Lucius or Narcissa Malfoy, or their life after the Second Wizarding War, is that they were not sent to Azkaban and that they had a grandchild.  Is there any information about what happened to them and what they did after the Second Wizarding War?  Were they ostracized by friends because they left the Death Eaters publicly?  Were people scared to trust them?  Has J. K. Rowling given any information about what their life was like after the war?


Occasionally, you can see little tufts of leaves blowing in spots on the map      Do these mean anything?


How do you build the complex numbers from foundations?

Id like to know how the complex numbers are derived from axioms. Most textbooks talk of them as starting from the complex plane. Is there a way to derive the complex properties from say the properties of fields or is there some peano axiom like system for complex numbers.


Product of two subgroups the whole group?

I think I remember seeing a theorem about this in my Abstract Algebra class, but I cannot seem to find the reference for it anymore.   Let $G$ be a group and let $H$ and $K$ be non trivial subgroups of $G$. Are there any sufficient conditions on $H, K$ and $G$ such that $G = HK$? (In other words $\forall g \in G$, there exist $h \in H$ and $k \in K$ such that $g = hk$)


I am working on an e-commerce website (similar to e-bay) where users can buy or sell products. The urls for buying a product are like: example.com/browse/cars example.com/browse/toys etc  And the urls for selling products are like: example.com/post-ad/cars example.com/post-ad/toys etc  When selling a product, user just need to fill a form and click on Save. Also user needs to be logged-in, in order to sell a product, therefore I have decided to prevent this page from being crawled and added the following to my robots.txt Allow: /  Disallow: /*/post-ad Disallow: /account/login?ReturnUrl=*  Now I am getting the following warning in Google Search Console, for of of the post-ad pages:  Indexed, though blocked by robots.txt  How can I resolve this issue?


Existence of totally real number fields of any degree

Are there simple/canonical examples for totally real number fields of degree $n$ for any natural number $n \in \mathbb{N}$? Of course, the question can be reformulated by asking if there exists an irreducible polynomial of degree $n$ with real roots only, i.e. all roots in the algebraic closure $\mathbb{C}$ are real.  Currently, I just started to read about field theory, but in the standard books (and soucres) I could not find an answer to my question.   $\mathbb{Q}(\cos(2\pi/n))$ is an example of degree $\varphi(n)/2$. In the Paper  of Ichimura one can find a construction of such polynomials (with some additional properties), using Hilbert's Irreducibility Theorem.    My question arose from Geometry of Numbers/Analytic Number Theory: Any totally real number field gives rise for an 'admissible lattice' $\Lambda$, that means $\inf_{(m_1,\ldots,m_n) \in \Lambda \setminus \{0\}} |m_1 \cdots m_d| >0$ in standard coordinates, as follows. Under the map $\mathbb{K} \rightarrow \mathbb{R}^n$, $x \mapsto (\sigma_1(x),\ldots,\sigma_n(n))$, where $\sigma_1,\ldots,\sigma_n$ denote all embeddings (which are real since $\mathbb{K}$ is totally real) of the number field $\mathbb{K}$, the image of the ring of integers $\mathcal{O}_{\mathbb{K}}$ is an admissible lattice.  Skriganov has shown in  that 'admissible lattices' are very uniformly distributed in parallelepipeds. (The remainder term is only of type $\log^{d-1}{r}$.)


How to instantiate a derived class object in Java?

In this code  class Foo {      public int a = 3; }  class Bar extends Foo {      public int a = 8; }  public class HelloWorld {      public static void main(String[] args) {         Foo f = new Bar();         Bar f = new Bar();     } }   What is the difference between   Foo f = new Bar();    and   Bar f = new Bar();   Thank You


How can I rename a lot of files using a regex?

I want to rename a lot of files on Mac OS X (10.7.2).. I don't have the perl package for the rename command.  My files have names like "T452-102456-0.png" and I want to delete the "-0" part. I know I can do this action by writing my own php-cli script, but I would like to know of an easier and faster solution.


Any way to get sublime text to save settings files without running as sudo

I installed Sublime Text 2 the following way, but what I do not like about it is that I have to run it as sudo to save the user settings files.  Any ways around this?  Thanks,  Colin  sudo add-apt-repository ppa:webupd8team/sublime-text-2 sudo apt-get update sudo apt-get install sublime-text


Getting incorrect slope values from an ASTER DEM in QGIS?

I have a DEM layer from ASTER satellite and I want to get the slope information from it.  I use terrain analysis > slope, but the output is so wrong. Why is that?  Here is the DEM:     And here is the "Slope" that is totally wrong. It should stretch the values from 0 - 89.9097 but it does not.


So, I'm new to C++ and SDL... And I get the linking error : (in SDL_Game.exe, the compiled version of these codes)  LNK 1120 : Unresolved Externals   And I also get these 2 errors :   Error   2   error LNK2001: unresolved external symbol "public: static bool SDL_main::isRunning" (?isRunning@SDL_main@@2_NA) C:\Users\MyName\Desktop\SDL_Game\SDL_Game\Input.obj SDL_Game   Error   3   error LNK2001: unresolved external symbol "public: static bool SDL_main::isRunning" (?isRunning@SDL_main@@2_NA) C:\Users\MyName\Desktop\SDL_Game\SDL_Game\main.obj  SDL_Game   My application type is set to console, so that's not the problem.   I probably did something really stupid...   (Note : There's probably a  lot of mistakes in here, you have been warned...)  So, here's my source codes :  main.cpp :  #include "Graphics\Window.h" #include "Input\Input.h" #include <string> #include <iostream> #include <main.h>  void Debug(std::string text);  int main(int argc, char* argv[]) {     main::isRunning = true;     Window C_Window;     Window window();     Input input();      if (SDL_Init(SDL_INIT_EVERYTHING) < 0)     {         main::isRunning = false;         std::cout << "SDL Video Initialization Failed : " << SDL_GetError() << std::endl;         std::cout << "Press enter to quit..." << std::endl;         system("PAUSE"); // Only works on windows.      }     else      {         while (main::isRunning)         {             SDL_UpdateWindowSurface(C_Window.GetWindow());         }     }     SDL_UpdateWindowSurface(C_Window.GetWindow());     Debug("SDL_winsurupd called in main");     system("PAUSE"); // Only works on windows.     SDL_Quit();      return 0; }  void Debug(std::string text) {     std::cout << text << std::endl; }  main::~main() {  }   main.h :  #pragma once #include <SDL.h> #include <iostream> #include <Graphics\Window.h>  class main { public:      static bool isRunning;      main();      ~main();  private:    };   Window.h  #pragma once #include <SDL.h> #include <iostream>  class Window { public:      Window();      SDL_Window* GetWindow();      ~Window();  private:      SDL_Window* window = nullptr;  };   Window.cpp  #include "Window.h"   Window::Window() {     window = SDL_CreateWindow("Engine Title", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_SHOWN);     if (window == NULL)     {         std::cout << "Window Creation Failed : " << SDL_GetError() << std::endl;         system("PAUSE"); // Only works in windows.     }     else      {         SDL_UpdateWindowSurface(window);     } }  SDL_Window* Window::GetWindow() {     if (window != NULL)     {         return window;     }     else      {         std::cout << "Could not get window since it was not created yet." << std::endl;         system("PAUSE");     } }   Window::~Window() { }   Input.h  #pragma once #include <SDL.h> #include <iostream> #include <Graphics\Window.h>  class Input { public:      Input();      ~Input();  private:      SDL_Event evnt;  };   Input.cpp  #include "Input.h" #include <main.h>   Input::Input() {     while (main::isRunning)     {         while (SDL_PollEvent(&evnt) != 0)         {             if (evnt.type == SDL_QUIT) {                 SDL_Quit();             }         }     } }   Input::~Input() {  }


Counting train stops using combinatorics

There are 12 intermediate stations on a railway line between 2 stations. Find the number of ways a train can be made to stop at 4 of these so that no two stopping stations are consecutive.   My attempt:  Initially I found the maximum allowed stop number for the first stop that satisfies the consecutive station condition.  $$A \quad 1 \quad 2 \quad 3 \quad 4 \quad 5 \quad 6 \quad 7 \quad 8 \quad 9 \quad 10 \quad 11 \quad 12 \quad B$$  I can have a stop at stations 8, 10, 12. Hence the train can travel a maximum of 6 stations before coming to its first stop, so number of ways $= 6 \cdot 1 \cdot 1 \cdot 1 = 6$.  Then I shift the first stop to station number 5. Now I have 5 options for stop 1 and 2 possible options for any of the next three stops. Hence number of ways $= 5 \cdot 2 \cdot 3 \cdot 1 = 30$.  Again, I shift the first stop to station number 4. Now I have 4 options for stop 1 and 3 possible options for any of the next 3 stops. Hence number of ways $= 4\cdot 3\cdot 3 = 36$.  Continuing the same logic, I arrive at an answer of 156. But the answer I have with me is 126.  Help appreciated. Thanks in advance.


Error automatically apply special formatting to selected words in text (XeLaTeX)

I need to color a specific word in my document  compiled with XeLaTeX engine,  following this answer .  \documentclass{article} \usepackage{color,xesearch}  \SearchList*{redwords}{\textcolor{red}{#1}}{hello}  \begin{document} This is hello and this is hellow. \end{document}   I have Error     ! Undefined control sequence.  \xdef \xs@String   {\xs@String h}\xs@LearnLetter l.7 Thi s is hello and this is hellow.   The control sequence at the end of the top line of your error message   was never \def'ed. If you have misspelled it (e.g., '\hobx'), type 'I'   and the correct spelling (e.g., `I\hbox'). Otherwise just continue,   and I'll forget about whatever was undefined.


Equivalence Relation: Property 1 is implied by Properties 2 and 3

Let $x \sim y$ be defined as meaning that the ordered tuple $(x, y)$ is in some set $S$. If this is the case, an equivalence relation on the set $S$ is defined as a subset of $S \times S$ with the following properties:   For all $x$ in $S$, $x \sim x$. If $x \sim y$, then $y \sim x$. If $x \sim y$ and $y \sim z$, then $x \sim z$.   I think this is an over-determined definition, because (1) is a consequence of (2) and (3), as long as it contains anything in addition to the empty set:  Assume that the equivalence relation contains at least point, $x \sim y$. By (2), it contains $y \sim x$. By (3), since $x \sim y$ and $y \sim x$, we also have $x \sim x$. Since we put no constraints on $x$ except that it be a part of the relation, this implies that for any point $x \sim y$, we have $x \sim x$. (We also have $y \sim y$, since $x \sim y$ implies $y \sim x$.) So why do we need to specify (1)?


How to find out SSD type for replacement?

How can one find out on a 7/24 machine which SSD type (connector) is used? I know that I'll run out of disk space in a certain time and I'd like to order a replacement SSD.   If it's not absolutely necessary I'd prefer not to shutdown and open the computer just to examine which SSD with which connector is used.  How can I find out:   either exact type of used SSD  or which connector is used for the SSD   Thank you for your suggestions!


I would like to present an application of Gröbner bases.  The audience is a class of first year graduate students who are taking first year algebra.    Does anyone have suggestions on a specific application that the audience would appreciate?


MBP shuts down at 40%~ battery, and recalibration didn't help

EDIT: I don't think this is a duplicate question. My MBP is only 2 years old and its battery cycle count is only 90.  I have a MacBook Pro (13-inch, 2017, Four Thunderbolt 3 Ports) with macOS 10.12.6, and there is a battery issue.  It shuts down when there is still 40%~ battery left.  I tried to  and . I followed all the instructions, but I don't even know how I can be sure if the SMC reset was successful.  More importantly, the recalibration was not helpful at all.  macOS still gives me the warning "Service Battery", and as shown in the screenshot attached, coconutBattery reports 60%~ in the "Design Capacity" section. It shuts down at 40%~ battery as before.  Why is the MBP battery like this despite the not-that-high battery cycle count (90)?  Is going to an Apple service center the only option I have? Are there any other things I can try by myself?  Thank you.


Partitions with at most k parts, each of at most l

I'm taking a course on Analytics Combinatorics (based on Flajolet's and Sedwick's book), and i'm trying to solve note I.16 of the book, that is, verify:  $$ P^{(\leq l, \{1,\ldots,k\})}(z) = \frac{(1-z)\ldots(1-z^{k+l})}{((1-z)\ldots(1-z^{k}))\cdot((1-z)\ldots(1-z^{l}))} $$ Where the left hand means the generating function of the class of partitions with at most k parts, each $ \leq l $ Truth is I already tried by multiple ways, but with no success:  First, looking at the formula I guessed that: $$ P^{(\leq l, \{1,\ldots,k\})} \times P^{(\{1,\ldots,k +l\})} \tilde = P^{(<l)} \times P^{(\{1,\ldots,k\})} $$ but i couldn't understand why.  Secondly, using the same reasoning as to find that p(k,l,n) = p(l,k-1,n) + p(l-1,k,n -k), I thought that:  $$ P^{(\leq l, \{1,\ldots,k\})}  \tilde = P^{(\leq l, \{1,\ldots,k-1\})} +\mathcal Z^k \times P^{(\leq l - 1, \{1,\ldots,k\})}  $$  but i could't solve the recurrence.  and so on...  As you can see, I'm quite confused... can someone give a tip that put me in my way?  thank you in advanced!


how can I find out the surface area of my mesh in blender 2.9?

Without Python, if that's available. I need help with this for 3D printing and I have no idea how to find out the area. So if you know how to do it please help me.


XML and AMPscript -- how do I "BuildRowSetFromString" using data from my API post?

I'm trying to build a confirmation email whereupon we create a rowset from a string within the API post.  We currently do this without issue when evaluating data from a Data Extension, but I can't connect the dots when we move this over to an API post.  Current State:    %%[     SET @itempartnumber = LookUp("Data_Extension","Product IDs","EmailAddress",EmailAddr)     SET @productRows = BuildRowsetFromString(@itempartnumber,"|") ]%%   I want to still use BuildRowSetFromString, and the attribute in the XML is , so how do I make the declaration to build that row set from the attribute?  Any and all assistance is greatly appreciated!


Why is cross product only defined in 3 and 7 dimensions?

Why $3$ and $7$? I know from some reading that Hurwitz's Theorem explains this, but can someone help me build some intuition behind this or perhaps provide a simpler explanation? It still seems mysterious to me.


Lost password because of changed minlength

I changed my password min length and it made my current password not work. I can not sudo or anything. How do I recover it or is there a way? thanks


There is a way to reverse-unrap in Python?

I am trying reverse-unfold the mesh in 3D view comforming with the UV map, But I couldn't even get to acess the UVs. Is there a way to do that?


Passing arraylist in function and changing its reference, does not work outside the function

import java.io.IOException; import java.util.ArrayList;  public class CheckClass {     static ArrayList<String> curr2=new ArrayList<>();     public static void main(String[] args) throws IOException     {     ArrayList<String> curr=new ArrayList<>();     System.out.println(curr);     CheckArr(curr);     System.out.println(curr);     }     private static void CheckArr(ArrayList<String> curr) {         curr2.add("hi");         curr=curr2;         System.out.println(curr);     } }  Its output is : [] [hi] []  Can anyone explain how i can change the reference of curr to curr2. I just switched from C++ to java. I think it has something to do with internal pointer mechanism of java, can you explain this concept.


Error: (sudo: unable to change to root gid: Operation not permitted)

I have installed Oracle VirtualBox on my Windows 10 machine. As a guest OS I installed Ubuntu 16.04.04.  When I open the terminal on Ubuntu and run a command like:  sudo apt-get update   I get the following errors:  sudo: unable to change to root gid: Operation not permitted sudo: unable to initialize policy plugin   Actually I can't execute any sudo command. Any one knows how to diagnose/solve the problem?  I should metion that I am logged in using the guest account. So when I enter groups I get   guest-rqj3wa


Recolor Artwork: single swatch to multiple swatches

I have an Illustrator document with a lot of objects. All the objects are black, same swatch.  I have a swatch group with a few dozen coloured swatches. I wish to apply these swatches to all the many black objects. It doesn’t have to be in any particular order, but each object should be coloured individually—I don’t just want to change black into some other colour, but to dozens of other colours. What I really want to avoid is having to select each object individually and then applying a different swatch to each.  I’ve never quite managed to get my head properly around the Recolor Artwork feature in Illustrator, and I cannot for the life of me get it to do anything like this. The “New” box in the Recolor Artwork dialogue box appears to accept only one colour.  Is there some way to do this using the Recolor Artwork feature? Or using some other feature that I’m not aware of? Bonus points if there’s a way to control the order in which the colours are applied; e.g., specifying an order and then click on each object in turn to apply each swatch being ‘iterated’ through in that order.  (I would prefer to avoid having to script it, but I will if there’s no other way.)


How can I filter data based on items in a list?

How can I filter entries containing any specific word in a list of words? For example, I have a list of road names in Singapore.  Amoy Street, Singapore Ann Siang Hill Anson Road Arab Street Armenian Street, Singapore BBaghdad Street (Singapore) Balestier Road Banda Street Bartley Road Beach Road, Singapore Bencoolen Street Bernam Street Boat Quay Boon Tat Street Boundary Road, Singapore Bras Basah Road Bugis Street Bukit Batok Road Bukit Pasoh Road Bukit Timah Road CCantonment Road, Singapore Choa Chu Kang Road Clarke Quay Clementi Road Club Street Collyer Quay Connaught Drive Craig Road (Singapore) Cross Street  and many more  My spreadsheet has a large number of entries like the following, which may or may not contain road names mentioned in my list:   Saw an accident at Thomson Road Found this by accident 6 vehicles crashed at Balestier Road I wanna crash now. So tired. Bus collides with bicycle at Arab Street. Accident at City Road. You can crash my house later.   How do I filter to return entries that contains any road name identified in the list of names? How do I introduce an array/list of road names into Microsoft Excel and then relate it to a filter function?


Automatic field should take the required entry

We are preparing a Asset request list in sharepoint. We have different department with specific system configuration. For Ex, If user will select "sales department" automatic the system configuration field should taken required system configuration details.  For Ex: Department : Sales         System configuration: i5,8GB RAM, 512GB SSD.  Please help me on this.


I changed nothing with any of my settings, extensions, etc. and Chromium decided to randomly start crashing right when I tried to reopen it after closing it. I get the following output:  aiman119@aiman119-HP-Pavilion-dv5-Notebook-PC:~$ chromium-browser Using PPAPI flash.  --ppapi-flash-path=/usr/lib/adobe-flashplugin/libpepflashplayer.so --ppapi-flash-version= Received signal 11 SEGV_MAPERR 000000000010 #0 0x7fee452bd425 base::debug::StackTrace::StackTrace() #1 0x7fee452bd80b <unknown> #2 0x7fee455e8390 <unknown> #3 0x56323eba2dc8 <unknown> #4 0x56323eba5656 <unknown> #5 0x56323eba5df9 <unknown> #6 0x56323eba6143 <unknown> #7 0x7fee45338821 <unknown> #8 0x7fee452beeea base::debug::TaskAnnotator::RunTask() #9 0x7fee452e7e90 base::MessageLoop::RunTask() #10 0x7fee452e997d base::MessageLoop::DeferOrRunPendingTask() #11 0x7fee452ea83d <unknown> #12 0x7fee452eb300 base::MessagePumpLibevent::Run() #13 0x7fee452e6f15 base::MessageLoop::RunHandler() #14 0x7fee45311628 base::RunLoop::Run() #15 0x7fee4533de36 base::Thread::ThreadMain() #16 0x7fee45338726 <unknown> #17 0x7fee455de6ba start_thread #18 0x7fee2ec8d3dd clone   r8: 000000000000002e  r9: 00005632405f96ec r10: 0000000000000000 r11: ffffffffdedbf3f9  r12: 00007fedc1d4bff0 r13: 0000000000000008 r14: 0000000000000008 r15: 00007fedc1d4beb0   di: 0000000000000000  si: 00007fedc1d4beb0  bp: 00007fedc1d4bf00  bx: 00007fedc1d4beb0   dx: 000000000000005f  ax: 0000000000000000  cx: 00007fedd4009690  sp: 00007fedc1d4be60   ip: 000056323eba2dc8 efl: 0000000000010206 cgf: 0000000000000033 erf: 0000000000000004  trp: 000000000000000e msk: 0000000000000000 cr2: 0000000000000010 [end of stack trace] Calling _exit(1). Core file will not be generated.   I found  and attempted to use that solution with the same result. I am running Ubuntu 16.04.2 Xenial LTS. Any ideas? Thanks.


Do you need to have the same mods locally in order to play on a modded server?

I want to get onto a Pixelmon server, but I'm wondering if I need the mod installed locally in order to be on the server?


When clicking between "Week", "Month", "Quarter", "Year" and "All" on the users page, the name I have typed in to filter on disappears. I feel like it should stay there, so that I can type in my name, and see how I've done in a week/month/etc.


Set default permissions by file type (at least in Vim)

When I create a new script, I always have to manually add executable permissions with chmod +x foo.sh. My default permissions are set to 644, and but I'd like any file with extensions like .sh .py to automatically be set to as soon as they're saved so that I don't have to chmod them every time. I've seen several articles relating to how to change default permissions for all files in a folder or directory, but none discussing differentiating by file extension.  I use Vim. I would accept an explanation of what to put in my .vimrc to accomplish this as an answer.


I am trying to prove the following using induction, and kind of stuck. I used a computer to validate this sentence. Using $n = 1$ gave the correct result. I assumed that this is true for some $n = k$, but how do I prove for $n = k+1$. Should logarithms be used? $$2\leq \left(1+\frac{1}{n}\right)^{n}\leq 3$$ I've seen similar solutions, but none with induction, I need a solution using the natural numbers, without limits and calculus.


We have been taught that anything occupying space/volume has mass. Light has both a particle nature-photon and wave nature. Since It has an momentum of h/λ, energy of hc/λ. Since a photon carries energy and experiments have put an upper limit to its mass of 1e-18 eV/c^2, does it possess dimensions, a shape ?


I am receiving upvotes, but my reputation is not increasing. Why does that happen?  Take a look at  and  for example.


Subscribe for certain tags in review queue

In its current form the review queue is quite useless. There some random people meet random questions on the topics they have no clue about. As a result, in its current form, the review queue is good only for grammar issues, or even harmful, when people tend to vote randomly when they have no idea how to vote at all.   Personally, I feel very uneasy when I get into the queue on occasion. Thinking "what are all these questions? Who are all these people? What do I have to do with them?" I am just trying to get out as fast as possible.   I am somewhat a narrow specialist, I have great knowledge in some areas, but even in my own language I am not a pro in everything. So, unlike most folks here, I want to participate only in the areas I can be useful and effective. This applies to the review queue as well.  Thus, such a feature would be nice to implement: a tag subscription for the review queue.   Say, having some proven expertise for a certain tag (e.g. a silver badge), I am being able to subscribe for the review queue for this tag. From now on I will be a willing participant in a review process.  A step in the privileges ladder would be also nice to add, for advertising purposes - to let people know that they now can use this feature.  By implementing this feature, the network would profit from two main benefits:   Put a lot more people in a review process. At last make the review process relevant and professional.   P.S. Some weight for the vote from a pro would be also nice, but I quite realize it will never be implemented.  Update. It seems it's already implemented. Then it needs to be better advertised.


Segmentation fault (core dumped) in a C program

#include<stdio.h> #include<string.h> #include<stdlib.h>  char *Change(char *str,int start,int end)   {   if(start==end || start>end){     return str;   }    else{     char temp=str[start];     str[start]=str[end];     str[end]=temp;     return(Change(str,start++,end--));   }   return str; }   char *Reverse(char *str) {    int length=strlen(str);   return(Change(str,0,length-1)); }  int main() {    printf("%s\n",Reverse("program"));    return 0; }   I am trying to write a recursive function to reverse a string,but it comes the linking error.Please help.I had tried so many times and searched in the Internet,but it can't help. I guess the most probably place causing the problem is in function Change,but I can't solve with it.


I have data collected from an experiment organized as follows:  Two sites, each with 30 trees. 15 are treated, 15 are control at each site. From each tree, we sample three pieces of the stem, and three pieces of the roots, so 6 level 1 samples per tree which is represented by one of two factor levels (root, stem). Then, from those stem / root samples, we take two samples by dissecting different tissues within the sample, which is represented by one of two factor levels for tissue type (tissue type A, tissue type B). These samples are measured as a continuous variable. Total number of observations is 720; 2 sites * 30 trees * (three stem samples + three root samples) * (one tissue A sample + one tissue B sample). Data looks like this...          ï..Site Tree Treatment Organ Sample Tissue Total_Length     1        L  LT1         T     R      1 Phloem           30     2        L  LT1         T     R      1  Xylem           28     3        L  LT1         T     R      2 Phloem           46     4        L  LT1         T     R      2  Xylem           38     5        L  LT1         T     R      3 Phloem          103     6        L  LT1         T     R      3  Xylem           53     7        L  LT1         T     S      1 Phloem           29     8        L  LT1         T     S      1  Xylem           21     9        L  LT1         T     S      2 Phloem           56     10       L  LT1         T     S      2  Xylem           49     11       L  LT1         T     S      3 Phloem           41     12       L  LT1         T     S      3  Xylem           30   I am attempting to fit a mixed effects model using R and lme4, but am new to mixed models. I'd like to model the response as the Treatment + Level 1 Factor (stem, root) + Level 2 Factor (tissue A, tissue B), with random effects for the specific samples nested within the two levels.   In R, I am doing this using lmer, as follows  fit <- lmer(Response ~ Treatment + Organ + Tissue + (1|Tree/Organ/Sample))    From my understanding (...which is not certain, and why I am posting!) the term:  (1|Tree/Organ/Sample)   Specifies that 'Sample' is nested within the organ samples, which is nested within the tree. Is this sort of nesting relevant / valid? Sorry if this question is not clear, if so, please specify where I can elaborate.


When polynomials f(x) and f'(x) are relatively prime, f(x) has no repeated roots. Why?

The problem is to show that a polynomial $f(x) \in F[x]$ (F is a field) has no repeated roots if and only if f(x) and f'(x) (the derivative of f(x)) are relatively prime. I've managed to prove one direction of this equivalence (if there are no repeated roots, f(x) and f'(x) are relatively prime), but the other one gives me headaches... can anyone help out?


I have created a fresh db dump from a production server with the --data-only and --column-inserts flags, so I only have a bunch of insert statements to insert data when performing a restore on a staging server.  pg_dump -h localhost -U adminuser --data-only --column-inserts maindb > maindb.sql   How do I delete all data in the staging server database first, before restoring the data from the production dump?   I want to delete all data only so I don't have to drop and create the database and all that stuff. I just want to remove data and insert new data that is all.  I don't have the option to drop and create the database for several reasons. I will have to remove all data and just insert only, so whatever it takes to find how to do this, am willing to go for it but need help obviously to start with.  I also need to automate this process. Will automate "dumping data from production db", then "deleting data on staging db", and then "restoring data to staging db". I just need help on the "deleting data on staging db" part.  I am running on PostgreSQL 9.5.2


I'm no expert in Scandinavian languages (Norwegian and such) but I've been wondering where actually does their Santa (Julenissen) live (city)? I've been able to find ambiguous answers on this matter over the Internet in English language that mentioned cities like Oslo, Bergen, Drobak, Svalen and Trondheim. Maybe someone can deliver me with proper information? That would give me some clue on planning my trip.


"There are currently N bounties, worth X reputation" dynamic ad and the new sidebar width

You've probably seen this sidebar ad on one or more -enabled Stack Exchange sites over the years:    The image is dynamically generated from a non-officially SE app that uses the Stack Exchange API to fetch the bounties from a given site.  As far as I understand, the rendered image automatically scales to the allotted ad space - when the sidebar ads were 220x250, it would render in the sidebar as a 220x250 image while still looking quite oversized in the  meta (as it does right here).  With the new 2016 campaign starting, can we test whether this awesome dynamic ad works with the new sidebar width?


Here is my output after running df -h --total:  Filesystem      Size  Used Avail Use% Mounted on udev            3.9G     0  3.9G   0% /dev tmpfs           784M  9.9M  774M   2% /run /dev/nvme0n1p3  216G  182G   24G  89% / tmpfs           3.9G   33M  3.8G   1% /dev/shm tmpfs           5.0M  4.0K  5.0M   1% /run/lock tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup /dev/nvme0n1p1  496M   28M  469M   6% /boot/efi cgmfs           100K     0  100K   0% /run/cgmanager/fs tmpfs           784M     0  784M   0% /run/user/0 tmpfs           784M  104K  783M   1% /run/user/1001 /dev/mmcblk0p1   60G  1.4G   59G   3% /media/joe/3666-6537 total           290G  183G   96G  66% -   I have a lot of photos and videos on this drive, which are clearly all being kept in /dev/nvme0n1p3. I've recently cleared some space, but certainly not 96G worth (The total Avail). Before I did cleanup (of around 20G, which agrees with the Avail amount on /dev/nvme0n1p3), I was not able to export from photo editing applications or render any videos, having been given warnings bout my disk being full. Obviously, this was only the /dev/nvme0n1p3 filesystem that was full.  So why do I have so much storage in these other dev and tmpfs partitions (is partition the right word here?) that seems to being going unused? I assume that the tmp directories fill up with junk when the system is in heavy use? And what is /dev/mmcblk0p1, which is using hardly any of it's allotted 60G of storage?


How To Change OS From Windows 7 to Ubuntu 16.04 (Xenial)

ROS answers said the following was an askubuntu question:  Upgraded (overwrote) one of my Windows 8.1 OS machines to 1TB Ubuntu/ROS training box to run ROS Melodic on Ubuntu 18.04 LTS. Previously completing all Kenetic (and subsequent Melodic) basic training + sims. Passed Gazebo basics with successful sims, including Velodyne. Having more recent Unix experience would have helped.  Want to go back and load ROS/Gazebo robot sims that require legacy Ubuntu 16.04.4 LTS/ROS Kenetic.  ROS Answers explained simply use a docker to continue on my training box (which I was/am about to do) when I received a windows 7 quad-core box from storage that works great, and certified for new life.  Would prefer not to clutter my lab's Ubuntu 1TB 18.04 training/research box with a docker: Just run released Gazebo sims on a separate machine. My old Windows 7 box's system boot OS was boot-user-programmed to boot from USB stick, but after USB flashing lights (signaling a USB OS search was underway), software says no operating system found (on the blinking USB stick). Was not Windows 7 the a non-Unix OS when ROS Kenetic was under development?  Would prefer not to upgrade or buy new lab computers until  robot simulation tests are completed. Thank you in advance for your recommendations. - -  PS.  Flash drive file: (“ubuntu-16.04.6-desktop-amd64.iso” was downloaded and ported to the USB before the attempt to upgrade Windows 7 quad-core box)


I am getting this error, I have quoted it below, please guide me, in removing them

E:\>javac Cconv.java Note: Cconv.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.   Here Cconv.java is my main class. These are two errors on command screen.


Cursor is set to move by increments. how to reset to normal?

My cursor is moving by every selection by large increments!  Normally when I use Blender, I am able to select and move objects to any coordinate. Now, all of the sudden, when I select an object or mesh the selection moves by an inch or so in each direction.  How do I reset it to normal?


Saving an Adobe illustrator file as a pdf - are fonts embedded? If so, why does Adobe illustrator say I don't have the font when I open it?

If I have an Adobe Illustrator file, and I save it as a .pdf - it looks like the fonts are included in that .pdf file. (I think this because when I open the .pdf file in Reader it looks the way I expect it to.) However, when I open this same .pdf file on a different computer (or workstation) with Adobe Illustrator - Illustrator says I 'don't have the font I need'. This doesn't make sense to me because - If I can see the document correctly in reader, I would expect it to be there for Illustrator as well. Can someone explain why this is? I am asking because saving a file as a .pdf for print seems to handle most font troubles that come up - but sometimes I need to change the text in a file before I print it... I am hoping there is a way to open a .pdf so that .ai recognizes that the font is in there.  But I am unsure on the details of saving as a .pdf in Illustrator, how fonts are handled, and what is possible.


Determine an equation of the plane containing the lines $\frac{x-1}{2}=\frac{y+1}{-1}=\frac{z-5}{6}$; $r=\lt1,-1,5\gt+t\lt1,1,-3\gt$.   I calculated the cross product between the directional vector of both lines to find the normal vector $n$, but when I looked for an intersection point $r_0$ to apply the formula: $\lt r-r_0\gt \bullet \ \ n$, I did not find any.  Can I use the point $\lt1,-1,5\gt$ given in the line $r$? Or is it not possible to find an equation of the plane containing two lines that do not intersect?


As shown, there is a comment which said, "Repeat Spammer. Flagged as spam." But the answer was posted few days ago, so this would have been deleted. So I immediately knew that this was an audit. Could all comments be disabled on audits?


I upgraded from 16.10 to 17.04 and my laptop connects to home wifi but acts as if the network is not working, no website would load. It's not the browser, none of the apps work. A dozen reboots of laptop and router did nothing. Other laptops (win7), phones and tv use this network without issues. All was fine this morning but then the home wifi just stopped working on ubuntu (after waking it from sleep). For a few minutes it worked fine connected to the extender of that home wifi but then stopped that too.  Ubuntu connects and uses my mobile hotspot without issues, so far. Any ideas? None of the fixes in previously asked similar questions worked for me so I was told in another thread to ask my own question.


I bought Johnson motors for making bot and its max load current is 9A.My batterys are 12V 1.3AH. I gotta problem with my motor driver circuit.It has L293D(2A peak). If load increases on motor current may increase damaging the IC so I am thinking to limit current drawn by motor to 1.8A. Will it work even if load increases and only 2A current is provided? Will Any of the component get damaged?What should i do? Thanks..


Are there any good character animation courses out there there are detailed and go into advanced material?

So I recently bought a blender animation course from bloop animation and it covered the very basics. I know the principles of animation and the basics of 3D bone animation, what I'm looking for is tips and tricks on how to improve my work/get character movements to look more realistic/rigging tricks to make animation easier, etc. Right now, my animations look very robotic, my keyframes get messy and weird things start to happen, and trying to get my character to move through an environment is very clunky, I was looking for recourses on learning after learning the basics other than trial and error. Because I am having quite the time (A bad time) learning through trial and error. Thanks in advanced for any help!


Is it possible to insert both start-page-number and end-page-number in ToC? It should look like this:


How to make a prefill line with read command?

I tried to write my first bash script, so I have a question. I tried to google it, but found nothing.  I collected some data from user with read command.  read creates empty line for user input. But what if I want to make prefilled line?   For example, part of my script:  printf "${WONWARN} Please enter user dial plan ${NORMAL} %s\\n" "$Number" read -rp "For example, 'test'> " Number; echo   I have default dial plan named "default", and in very rare case it must be changed to other plan.  I want to make prefill input line with "default", so user can just press enter without any typing (or delete this "default" and input their custom dial plan name).


How to indicate that a local variable in C# will not change?

It can be useful when reading some source code to know that after initialization, a variable will not change. For example in the following code sample:  for (int i = 0; i < Height; ++i) {     for (int j = 0; j < Width; ++j)     {         int index = i * Width + j;  // This variable never changes later. Or will it? [TrollFace]         float myValue = ComputeValue(i, j);         // ...         myArray[index] = myValue;      } }   It would be nice for code reviewers to be able to tell them not to care too much about the index variable because its value will never change. Obviously you can do it in a comment, but comments are not always updated and not necessarily reliable. In some languages, a keyword can be used to ensure the assertion "the value of this local variable will not change after initialization". Is there such a keyword in C#?


My website is under attack by malware. How can I remove it and prevent its recurrence?


Why Didn't the Borg Attack the Federation Earlier?

In the series finale of Star Trek: Voyager, we hear Lt. Barclay mention that there's a transwarp aperture forming about a light year from Earth. This was from the Borg's transwarp hub in the Delta Quadrant, and the Federation looked to be prepping for the Borg vessels that would come through.  My question is, if the Borg had the ability to do this all along, why didn't they do this much earlier, destroy the Federation, and be done with it?  From The Next Generation we do know that they destroyed the majority of the Federation fleet during the battle of Wolf 359. So doing something like that again wouldn't be a difficult task for the Borg.  It just doesn't seem very realistic that they would never use such an advantage against their foe, then again it's a TV show :).


how to make a square at each zero? as an example in the picture \begin{table}[!ht]     \begin{center}         $\begin{NiceMatrix}             & M_1   & M_2 & M_3     & M_4   \\             J_1 & 0  & 0  & 0.12  & 0     \\             J_2 & 1.66  & 0  & 0  & 0.66     \\             J_3 & 0  & 0.34  & 0.12  & 0.67  \\             J_4 & 2.66  & 0  & 0.12  & 0     \\             \CodeAfter             \tikz{                 \node (f) [draw, inner xsep=1em, inner ysep=0.3em, fit=(2-2) (5-5)] {};             }         \end{NiceMatrix}$     \end{center} \end{table}


Determine the set of points $z$ that satisfy the condition $|2z|>|1+z^2|$  I tried to redo this problem and got to this point  $|2z|>|1+z^2|$ $\Rightarrow$ $2|z|>1+|z^2|$ $\Rightarrow$ $2|z|>1+z\overline z$  Let $z=x+iy$ then   $$2\sqrt{x^2+y^2}>1+(x+iy)(x-iy)$$  $$2\sqrt{x^2+y^2}>1+(x^2+y^2)$$  $$0>1-2\sqrt{x^2+y^2}+(x^2+y^2)$$  $$0>(1-\sqrt{x^2+y^2})^2$$  since $x,y$ are real number , so there is no solution for this inequality?


Is it possible for an expected value not to exist?

A probability density family for $x\in\mathbb{R}$ is  $$f(x) = k(\theta)\left[1 + (x/\theta)^2\right]^{-1}$$  parameterized by $\theta \gt 0$.  I am supposed to find $k(\theta)$ and then both $E(X)$ and $\text{Var}(X)$.  I have found that $k =1/(\theta\pi)$. When I try to evaluate $E(X)$ I get that the corresponding integral diverges. Is this possible and does it imply that the variance diverges too?


Suppose $\mathbf{X, Y}$ are independent random vectors. Are their components independent?

Let $\mathbf{X} = (X_1, \dots, X_p)^\top$ and $\mathbf{Y} = (Y_1, \dots, Y_p)^\top$ be independent. Does it then follow that $X_i$ is independent with $Y_j$ i.e. cov$(X_i, Y_j) = 0$?


i have a login page i have used    <?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>   now i was trying an whenever i enter     http://www.twekr.com/login.php/%22%3E%3Cscript%3Ealert('hacked')%3C/script%3E   & it gaved me this error   You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hacked')%3C/script%3E', 0)' at line 2  What should i do now?    $uemail = "";   $upass = "";   if ($_SERVER["REQUEST_METHOD"] == "POST")   {     $uemail  =  test_input($_POST['email']);   $upass   =  test_input(md5($_POST['password']));     if(empty($uemail) or empty($upass)){   $message = "Please enter email or password";    } else {   $check_login = mysql_query("SELECT username FROM users WHERE email    ='$uemail' AND password ='$upass'");     if(mysql_num_rows($check_login) ==1) {         $get = mysql_fetch_array($check_login);   $_SESSION['username2'] = $get['username'];       $_SESSION['semail'] = $uemail; header('Location:http://twekr.com/');exit;     }else {           $message = "Wrong email or password";      }  }   }   ?>


How to ensure different colors for surrounding polygons?

Currently in the client I have an array of colors that is looped through for a given set of geometry features. Features are grouped together on the map  and each group has a color assigned to it.  It is not taking into account adjacent group polygons such that two adjacent groups may have the same color if the array of groups is longer than the color array.   Is there a simple way to assign colors such that no two adjacent groups have the same color?


Bisecting K-means using Dynamic Time Warping

I'm trying to cluster time series of different length and I came up to an idea to use DTW as a similarity measure, which seems to be adequate, but the thing is, I cannot use it with K-means, since it's hard to define centroids based on time series which can have different length/phase. So I was thinking about Hierarchical clustering, since it seems appropriate to combine with DTW, but it's not scalable. So my next thought is to try with bisecting k-means that seems scalable, since it is based on K-means step repetitions. My idea is next, by steps:   Take two signals as initial centroids (maybe two signals that have smallest similarity, calculated using DTW) Assign all signals to two initial centroids Repeat the procedure on the biggest cluster   In this way I could use DTW as distance measure, that could be useful since my data may be shifted, skewed, and avoid calculating centroids. At the end I could take one signal from each cluster that is the most similar with others in cluster (some kind of centroid/medioid).  What do you think about this approach and about the scalability?


Minimize/close button design in “Join” box is broken

For communities where you still don’t have an account you do see the Join box at the top of the page. This box currently contains a broken minimize/close button:        You can see the same for any site opened in browser private mode.


Characterizing all ring homomorphisms $C[0,1]\to\mathbb{R}$.

This is something I've been trying to work out this evening.      Let $R$ be the ring of continuous real-valued functions on $[0,1]$ with pointwise addition and multiplication. For $t\in [0,1]$, the map $\phi_t\colon f\to f(t)$ is a ring homomorphism of $R$ to $\mathbb{R}$. I'm trying to show that every ring homomorphism of $R\to\mathbb{R}$ has this form.   Suppose otherwise, that there is some $\phi\neq\phi_t$, and thus there is some $f_t\in R$ such that $\phi(f_t)\neq \phi_t(f_t)=f_t(t)$. Define $g_t=f_t-\phi(f_t)1\in R$. Here $\phi(f_t)1$ is the constant function sending $[0,1]$ to $\phi(f_t)$. Then $g_t(t)\neq 0$. My first small question is why does $\phi(g_t)=0$? It seems only that $\phi(g_t)=\phi(f_t)-\phi(\phi(f_t)1)$.  I would like to conclude that there are only finitely many $t_i$ such that $g(x)=\sum g_{t_i}^2(x)\neq 0$ for all $x$. Then $g^{-1}=1/g(x)\in R$, but $\phi(g)=0$, contradicting the fact that homomorphisms map units to units. How can we be sure there are only finitely many $g_{t_i}$ such that the sum of their squares is never $0$? Thanks.


Rendering my freshly created diamond gives no good result

I am a beginner at Blender and very enthusiastic about the enormous possibilities. It is a flood of options. I started with the creation of a sparkling diamond as a part of a logo for my daughters business. I found a perfect youtube tutorial and succeeded making the diamond. After making the diamond I let turn the animated diamond. It looks very realistic! I am proud at myself! But... When I start rendering the diamond animation or rendering the image I got a very strange result. See my image from the result. I tried in my opinion everything but no result. I run Blender on my iMac Pro. Who can help me?  The image shows the diamond animation in layout. It was constructed using a youtube video (Making Awesome Diamond Shader in Eevee - Blender Tutorial by VFX Mastro). It looks for me as a perfect diamond! Render animation shows on the left the red diamond output using the Evee engine and the output setting on the right side.


Python one-liner to make strings lowercase and leave numbers as is

Is there a way to write a one-liner which converts strings to lowercase and leaves numbers alone? So far I have this:  names = ["a","Abc","EFG",45,65] newlist = [n.lower() for n in names if isinstance(n, basestring)] print newlist   >>>['a', 'abc', 'efg']   I would like this  >>>['a', 'abc', 'efg', 45 ,65]


Suppose I have this:   $\frac{6^{666}}{2^{6}}$ (mod $125$)  I saw it is possible to reduce only the numerator's power modulo Euler's phi function. Can someone explain why is that possible?  It is essentially this:   $\frac{6^{666 \space (mod \phi(125))}}{2^{6}}$ (mod $125$)


Turning separate lines into a comma separated list with quoted entries

I have the following data (a list of R packages parsed from a Rmarkdown file), that I want to turn into a list I can pass to R to install:  d3heatmap data.table ggplot2 htmltools htmlwidgets metricsgraphics networkD3 plotly reshape2 scales stringr   I want to turn the list into a list of the form:  'd3heatmap', 'data.table', 'ggplot2', 'htmltools', 'htmlwidgets', 'metricsgraphics', 'networkD3', 'plotly', 'reshape2', 'scales', 'stringr'   I currently have a bash pipeline that goes from the raw file to the list above:  grep 'library(' Presentation.Rmd \ | grep -v '#' \ | cut -f2 -d\( \ | tr -d ')'  \ | sort | uniq   I want to add a step on to turn the new lines into the comma separated list. I've tried adding tr '\n' '","', which fails. I've also tried a number of the following Stack Overflow answers, which also fail:      This produces library(stringr)))phics) as the result.      This produces ,% as the result.      This answer (with the -i flag removed), produces output identical to the input.


A table consisting of mathematical expressions

The following is my code, but it didn't work, do I miss some package? Please, give me advice and correct code. Thanks for your help!  \begin{tabular}{|c|c|c|c|} \hline & x<0 & x=0 & x>0\\ \hline y<0 & x^2-y^2 & x^2+y^2 & x^2-y^2\\ \hline y=0 & x+y & x^2-y^2 & x^2+y^2 & x^2-y^2\\ \hline y>0 & x^2+y^2 & x+y & x^2+y^2\\ \hline y<0 & x^2-y^2 & x^2+y^2 & x^2-y^2 \end{tabular}


On some pictures from the Internet there are colors in terminal. Even Cygwin under Windows has colors in its terminal. Here a pic from the Internet, for example:    I have installed Xubuntu and my terminal is like Windows cmd - has only two colors: background and text color. Name of user is not green. Only folders are shown in blue on ls command. No more any colors.  How to enable colorful terminal in Xubuntu 13.04?


Question: Let $p$ and $q$ be distinct odd prime numbers.  By considering primitive roots, we need to show $\exists c\in\mathbb{Z}$ with the property that:  $\bullet$ $c^n\equiv 1\pmod{p}$ whenever $n$ is a multiple of $p-1$, and   $\bullet$ whenever $n$ is not divisible by $q-1$, then $c^n\not\equiv 1\pmod{q}$  I am only interested with the beginning of this answer.  Answer: We let $c$ be a primitive root modulo $q$.  We are going to use Fermat's little theorem so we need $(c,p)=1$  If $(c,p)\neq 1$, then we have $p\mid c$, but then we have $(c+q, p)=1$  and since $c+q$ is a primitive root modulo $q$, we can replace $c$ with $c+q$ for $(c,p)=1$ for using Fermat's little theorem.  I understand the general method and argument, but...  Contention: Why is $c+q$ still a primitive root modulo $q$?  When is this generally true? Is there an identity for when things remain a primitive root?  Why is $(c+q)^{\phi(q)}\equiv 1\pmod{q}$?


In the proof of the lemma     For every limit ordinal $\alpha$, $\textrm{cf } \alpha$ is a regular cardinal    Jech says that     It is easy to see that if $\alpha$ is not a cardinal, then using a mapping of $|\alpha|$ onto $\alpha$ one can construct a cofinal sequence in $\alpha$ of length $\leq |\alpha|$, and therefore $\textrm{cf } \alpha < \alpha$.    I've spent a while trying to construct this cofinal sequence and was wondering if I was on the right path:   From a bijection $f$ between $\kappa = |\alpha|$ and $\alpha$ take $S = \{\beta \in \kappa : \ f(\gamma) < f(\beta)$ for all $\gamma < \beta\}$ then if $\xi$ is the order type of $S$ and $g$ is the isomorphism from $\xi$ to $S$ the function $f\circ g$ is a cofinal sequence in $\alpha$ and $\xi < \alpha$.   Is this on the right track, or is there an easier way of doing it?


I have worked here for five years.   I had worked here for five years.   I worked here for five years.   Which one is gramatically correct. Does the first sentence mean that he worked here and is still working? And the 2nd and 3rd indicate something happened in past. And when to use these. Is there any difference between these two?


I'm trying to find the last two digits of ${2012}^{2012}$. I know you can use (mod 100) to find them, but I'm not quite sure how to apply this. Can someone please explain it?


A tire manufacturer believes that the tread-life of its snow tires can be described by a normal model with a mean of 32 thousand miles and standard deviation of 2.5 thousand miles. Based on this information answer the following questions   What fraction of these tires can be expected to last less than 30 thousand miles   What fraction of these tires can be expected to last between 30-35 thousand miles   In planning a marketing strategy, a local tire dealer wants to offer a refund to any customer whose tires fail to last a certain number of miles. However, the dealer does not want to take too big a risk. If the dealer is willing to give refunds to no more tan 4% of customers, for what mileage can he guarantee these tires to last?      I need to know the steps in reaching these answers please!


Is there is another way to Sync Between Computers?

I try so many time for more than 1hr to create and account in Ubuntu One to use only the feature Sync Between Computers but is impossible to read the security code and always get the error Wrong Captcha Solution. Is there is another solution to sync apps between computers beside Ubuntu One? even if I have to pay for it. Is so impossible to create and simple account.


What is the status of generating LaTeX from handwriting (i.e., OCR)?

I type fast enough that for most things it's not a pain, but I have a few big stacks of old course notes I'd like in LaTeX which I'm dreading having to go through. So, I'm just wondering what the best solution for handwriting -> LaTeX is so far, if any.


Question on a proof of $\Bbb Z^n \cong \Bbb Z^m \implies n=m$

I've read the following argument (on Wikipedia, IIRC) :     Suppose that $\Bbb Z^n \cong \Bbb Z^m$ as abelian groups. Then quotienting both sides by $(2\Bbb Z)^n$ and $(2\Bbb Z)^m$ respectively, we get the group isomorphism $\Bbb F_2^n \cong \Bbb F_2^m$, which implies $2^n=2^m$ i.e. $n=m$ [NB : we just compare cardinalities, we can't conclude $n=m$ because of some vector space isomorphism].   I have the following question : Why can we ensure that the image of $(2\Bbb Z)^n$ under the given isomorphism is $(2\Bbb Z)^m$ ? I want to use $A/I \cong B/f(I)$, where $f : A \to B$ is an injective group morphism. But I don't know how.  Thanks!


Area under a guassian with two known points using error function

I am interested in a nice function to find the area of a section of a normalized Gaussian distribution. Let's say I have a normalized Gaussian distribution of standard deviation $\sigma$, mean $\mu$, and I am interested in the area centered at $\mu$ between +/- $t$ ( see below)   Is there a simple way to express this for any given $t$ using the erf? The ref from which I found the above figure uses  $$a_1 = 2 \mathrm{erf}\left(\frac{t}{\sigma} \right)  $$  But I don't think this expression is true for a normalized guassian. Moreover, can the $\textit{total}$ area be expressed by an error function?  Thanks, very new to statistics.


C++ Help: Trying to display each individual integer and running average, read from input file

I'm new to C++ so I've been having a bit of trouble getting used to and learning how to deal with it. So pretty much, what I'm trying to is write a program that would open a textfile containing 5 lines of text, each with 5 integer numbers separated by spaces, then write to the console each individual integer from each line one at a time followed by a comma and the running average. I've managed to get the console to display the whole line of integers and the running average from the first integer of each line. Any help or advice would be appreciated :)  #include <iostream> #include <fstream> #include <string> #include <stdlib.h> using namespace std;  int main() {     string filename;     string mystring;     double average = 0;     double total = 0;     int i = 1;      cout << "Enter name of file to open: " << endl;     cin >> filename;      ifstream inputfile;     inputfile.open(filename.c_str());      if (!inputfile)     {     cout << "Error opening file: " << filename << endl;     return -1;     }      while (!inputfile.eof())     {     getline(inputfile, mystring);     total = atof(mystring.c_str()) + total;     average = total / i;      cout << mystring << " , " << average << endl;      i++;     }      inputfile.close(); }


Why put something in the middle of the pan would prevent soup coming out during cooking?

I see a website which teach people to put something on top of the pot during cooking soup to prevent the soup coming out during cooking. What is the physical theory behind that?


How can I make a more realistic glass shader?

Here's a sample scene:  A room with a window, a point light to project light into the room, an HDR environment outside the room and a nice Image by Rembrandt that should be somewhat reflected on the glass:    Using a standard glass shader on the window, the direct light from the lamp does not shine into the room, regardless of how bright that light is. So I can't recreate the impression of hard day light, with clearly defined areas of light and shadow.    Adding a transparent shader to the glass shader I get a very pleasing result. The light from the lamp illuminates into the room creating defined shadows, transparency seems unaffected, to see the HDR in the background, the refection seem correct to me (I also like how I get double reflections from the thick glass).    Even though I am quite happy with this solution, I've gotten a few comments on making a setup with light path nodes controlling the mix of transparent and glass. The biggest issue is that the reflections on the glass are brighter than what they should be.  So the question is: By using this approach am I messing up any of the qualities of glass? And if so, what would make a proper glass shader that is realistic, in terms of letting direct light through, while keeping reflections, refraction and transparency?  A file to play with:    The HDR image used was created by


Apart from the dialect form used in the Southern US, "y'all," has English ever had a plural "you"?  If not, how does English get around using this form?


Understanding Quantum Mechanics in short term

I have been told by professors that in order to understand physical interpretation of Wave function and De Broglie Wave, one must understand the history of Quantum Mechanics that started with the 'Blackbody radiation'. But 'Blackbody radiation' is followed by many other topics (different experiments that were being carried and their results during the end of 1800) of interest and most importantly 'importance'. There are too many. I would love to go through all of them one by one but I have to keep up with my teachers in order to take my semester. Alongside, I don't want to skip any topic that is necessary to understand the physical interpretation of wave function. So I need the experts' recommendations upon this i.e. what 'selected' topics should I go through and in what 'sequence'. Like there are given many in a book that tries to introduce you to the Modern Physics (example; 'Introduction to Modern Physics by Kennard, Cooper..') but I want to identify only those which are most needed and kind of enough to understand what I want to understand.  Also, I have tried to understand, directly, the physical interpretation of wave function from different books and articles and forums but it didn't work.  And, if this question had already been posted so kindly share the link and ask me to remove this so that I could check that page (link) out and tell if it helped or not. If it helps me out, I will remove this post myself otherwise, kindly, don't rush to remove it.


I have $x$ darts that I randomly throw on a dartboard with $y$ slots (the v shaped slices like you get when you cut a cake). Now I select a particular slice on the dartboard . What's the probability that no dart would have hit that slice?


Which player gets the assist in this situation?

I've been collecting stats for a soccer team.   I'm using definition of assist from  which is, an assist is awarded for a pass leading directly to a goal.   I have two situations I'm looking for answers on,  1st Situation  - player A passes ball to player B  - player B strikes the ball, shot is blocked  - player B strikes the ball again and scores  Do you award A with an assist?  2nd Situation  - player X serves the ball  - player Y strikes the ball off which is deflected by player Z, ball goes into the goal  Whom gets the assist?


Find all real solutions to the equation$4^x+6^{x^2}=5^x+5^{x^2}$

Find all real solutions to the equation:$$4^x+6^{x^2}=5^x+5^{x^2}$$  Obviously $0$ and $1$ satisfy this equation, but here $x$ is a real number, and I do not know how to do the next step, in fact, I guess this equation is not in addition to $0$ and $1$ other than the root. But you know, I need a proof! Could anyone help me? Thanks a lot!


How can I get my Qgis area calculations in metres rather than degrees? My shapefiles are projected using WGS 1984 UTM fuseau 35 Sud

I am using Qgis 1.7.4 to calculate the area of polygons. My shapefiles have been projected using the coordinate system WGS 1984 UTM fuseau 35 Sud, but my area calculations are still displayed in degrees. how do I get them in metres?


Why do native speakers use the present continuous tense when talking about people in a picture? Why not the past continuous tense?

I took this photo by the lake last Saturday, Grandma. It looks lovely.   Do you know any of these people?      Yes, I do. The man who’s reading the newspaper is William.      He’s wearing a nice hat.      He is, isn’t he? Grandpa knows him, I think!   Why don't they say "he was wearing a nice hat" because that was happening in the past?  Can we use the present tense to describe people in a video?  For example, "Look at you in this video! You are smiling and swimming in a bathtub".


Equivalence between Hamiltonian and Lagrangian Mechanics

I'm reading a proof about Lagrangian => Hamiltonian and one part of it just doesn't make sense to me.  The Lagrangian is written $L(q, \dot q, t)$, and is convex in $\dot q$, and then the Hamiltonian is defined via the Legendre transform  $$H(p,q,t) = \max_{\dot q} [p \cdot \dot q - L(q, \dot q, t)]$$  Under the right conditions there exists a function $\dot Q (p,q,t)$ such that  $$H(p,q,t) = p \cdot \dot Q(p,q,t) - L(q, \dot Q(p,q,t), t)$$  i.e. when some $\dot Q(p,q,t)$ satisfies $p = \frac{\partial L}{\partial \dot q}\rvert_{(q, \dot Q(p,q,t), t)} = \frac{\partial L}{\partial \dot q}(q, \dot Q(p,q,t), t)$  (Finding this function is usually called "inverting p")  By taking partials in the $p$ variable and using the relationship, we can obtain the relationship  $$\dot Q = \frac{\partial H}{\partial p}$$  Because of the notation I chose, I get the strong urge to say $\dot q = \frac{\partial H}{\partial p}$  , and in fact this is what the textbook does. But have we proved this?    In other words, how can we deduce that  $$q'(t) = \frac{\partial H}{\partial p}(p(t), q'(t), t)$$ for any differentiable vector valued function $q$? (or maybe there are more conditions we need on $q$? Here  $$p(t) = \frac{\partial L}{\partial \dot q}(q(t), q'(t), t)$$ according to Lagrange's equations.


This is what Angier says to Borden when the latter asks him "What do you know about sacrifice?":  "It takes courage to walk into the machine... Not knowing if I'd be the Prestige or the man in the box."  My interpretation is that the machine makes a clone and his consciousness ends up in one and he doesn't know which one. This means some days he dies.  Can somebody clear this up for me? Because there is something wrong with this explanation: The clones in The Prestige are sentient.    So how does that work? Which clone is real Angier? Is his consciousness split among the various clones and he feels both dying and being the Prestige?


How to find derivative of $\sin\sqrt{x}$ using difference quotient?

The definition of derivative of a function $f(x)$ is $$\lim_{h\to0} \frac{f(x+h)-f(x)}{h}$$  Using this definition, the derivative of $\sin\sqrt{x}$ will be:  $$\lim_{h\to0} \frac{\sin\sqrt{x+h}-\sin\sqrt{x}}{h}$$  $$\lim_{h\to 0} \frac{\cos\left(\frac{\sqrt{x+h}+\sqrt{x}}{2}\right)\sin\left(\frac{\sqrt{x+h}-\sqrt{x}}{2}\right)}{h}$$  Now i got stuck. How to find the limit or simplify this expression?  I get intuition that we have to use $$\lim_{x\to0}\frac{\sin x}{x} = 1$$  but that too is leading no where. I am unable to remove h from denominator.  NOTE  I know the derivative of $\sin\sqrt{x}$ is $\frac{\cos\sqrt{x}}{2\sqrt{x}}$ using chain rule, but this exercise was given to us for practice using division quotient.


Where does the term "fun fact" originate?-- namely, not with the compositional meaning but rather with the idiomatic usage to introduce some sort of unusual, esoteric, absurd or otherwise "controversial" fact?


Terminix: No protocol specified Unable to init server: Could not connect: Connection refused

I am using Ubuntu Budgie and using Terminix as terminal alternative.   I have two users a and b, when I login with user a and use 'gedit .bashrc', gedit works.  However, when I switch to user b using 'su b' and run 'gedit .bashrc', I am getting the following error.  ****No protocol specified Unable to init server: Could not connect: Connection refused (gedit:7211): Gtk-WARNING **: cannot open display: :0****   I tried to use the fix this by following methods.   Manually set display variable.  export DISPLAY=:0.0 //Doesn't work.    I even tried adding the line to .bashrc and sourcing it. Doesn't work either.   Tried setting xTerm.  xhost +local: No protocol specified xhost:  unable to open display ":0"    Still same error is shown.   Copy .Xauthority of one user to other. This too doesn't work.   Seems I am unable to launch any text editor (Atom,Sublime etc.) from terminix.


Install Canon 2900 driver in Ubuntu 16.04

I want to install a Canon 2900 printer driver in Ubuntu 16.04.  Please show screen shots of the full procedure.


How can I split a polygon by network line in QGIS?

I have a road network as line layer and a land cover as polygon layer, I want to find number of subpolygon for each polygon that divided by line layer in QGIS?  I used union function in Geoprocessing Tools in Vector menu of QGIS and then polygonize function to convert union result to polygon but in table of new polygon there is NULL data.


Show a time-stamp in one cell when another cell is updated in Google Sheets

I want to time stamp when a cell was filled out in the column to the right of only certain columns.  We use a simple spread sheet to keep inventory and I'd like to know when someone takes something or checks it back in for accountability reasons.  I found a script that adds a note, but that gets very annoying when I only want it to apply in certain areas.  So when someone updates columns C,D,I, or J with their initials, I'd like a time-stamp to show up in column E or K.  Is this possible with a script?  I've attached an image for an idea with the red squares showing where I'd like the time/date showing.


I only recently started using Latex for my university documents and for my current one I am using a template provided by them.  I am using bibtex to manage my sources. Here is an example bibtex-entry:  @misc{webpage1,    shorthand = {CompanyName},    author = {Company Name Ltd.},    title="The company's webplatform",    howpublished = "\url{http://company.com/}",    lastchecked = {01.01.2013},    year = 2013 }  @misc{webpage2,    shorthand = {OtherCompanyName},    author = {Some other Company Name Ltd.},    title="Another company's webplatform",    howpublished = "\url{http://other-company.com/}",    lastchecked = {01.01.2013},    year = 2013 }   In my Latex document I use the following code to create a bibliography:  \bibliography{references}    % this causes the references to be listed (file: references.bib) \bibliographystyle{alpha}   My problem is now that when I compile my document, the result is that the bibliography has the following format:  [Ltd13a] Full Company Name Ltd. [Ltd13b] Some Other Company Name Ltd.   I already tried putting a comma between the name and the Ltd. like so:  author = {Company Name, Ltd.}   but this results in this  [FC13a] Ltd. Full Company Name   I have read that shorthand is supposed to help, but I did not succeed.


Grep the lines between the occurrence of the same pattern

I would like to grep the lines between the same occurrence of a pattern and then save each matching lines in a different file. For example, I have this:  name aaa bbb bbb ccc name aaa1 bbb1 ccc1 name ...   I would like to have   name aaa bbb bbb ccc   in file1  name aaa1 bbb1 ccc1   in file 2, and so on.  I tried with a flag inversion in awk like that:  awk '/^name/ {flag=!flag; next} flag {print}'   but I'm not getting what I want.  Do you have any suggestion to do that?


Book title with a harsh alien world and buoyant balloon-like beings

I specifically remember that those buoyant explosive gas filled balloons were an annoyance for flying ships. This is mentioned several times in the book. At the end they seemed to play a very important role in the plot. I also remember ground based predators named Dashers, other named Swifters and the like. I read it in the '90s, it but could be older.


Why is the neutral tied to ground in my home's electrical panel?

What keeps the Electric from shorting to ground?  On my electric panel the Neutral is tied to the ground. The ground is a bare copper wire run back to my water main.  a.  Electricity chooses the path of least resistance.  Is the current happier to go back to the power supply rather then ground which is right there in the house basement?   Why does the AC that comes into the house have 2 wires for the Hot leg and 1 un-shielded wire for the Neutral Leg? If it’s tired to ground I guess it doesn’t need to be shielded. But it will still have the same amount of current flow on it as the Hot leg. The Neutral wire is live wire...  Is neutral supposed to be wired/bonded to ground ?


The first Vertex Slide tool took an additional click, but you could push the vertex beyond the end of the edge. Is there a setting or method to achieve that with 2.68?  The old method of placing the cursor at the opposite vertex and scale away from it is wonderfully nostalgic, but a bit time consuming.


Selecting a whole word with CTRL + SHIFT + arrow keys

I have the habbit to select a whole word by standing at the first character of the word and doing CTRL + SHIFT + right arrow key. But when the word has capitals then it stops at each capital.  Can I disable this behaviour?


Why do camera bodies and some lenses both have autofocus / manual switches?

Why is it that lenses come with an AF option when the camera has the same? Which controls the AF? One would think that they contend with each other for control. Why have two entities doing the same single task? A  photographer friend of mine said to set the lens to Manual. If every photographer does why offer lenses with this setting?


Reduction modulo homomorphism from Z_m to Z_n

Consider positive integers $m>n$ and function $\phi (x)$ from $Z_m$ into $Z_n$ equal to the remainder when $x$ is divided by $n$. Is $\phi$ a homomorphism? I.e is $\phi(x+y)=\phi(x)+\phi(y)$ for every $x,y \in Z_m$  Fraleigh asks a number of these questions with concrete $m,n$ that can be proved by inspecting cases but this is messy and it seems that if $n|m$ than $\phi$ is a homomorphism but I am not sure how to prove it in the general case. I can prove that if gcd(m,n)=1 that it is not a homomorphism.


Assignment methods are not aliased properly

Consider the following code:  class Cattr   attr_accessor :attr   alias_method :a_attr, :attr   alias_method :a_attr=, :attr=   def attr ; a_attr ; end   def attr= value ; a_attr= value ; end end ca = Cattr.new #⇒ #<Cattr:0x000000018974b0> ca.attr #⇒ nil ca.attr = 42 #⇒ 42 ca.attr #⇒ nil   What? The problem is not with aliasing method, defined by attr_accessor, aliasing getter works pretty fine:  class Cattr   attr_accessor :attr   # alias_method :a_attr=, :attr=   alias_method :a_attr, :attr # still aliased   # def attr= value ; a_attr= value ; end   def attr ; a_attr ; end     # still aliased end  ca = Cattr.new #⇒ #<Cattr:0x000000018974b0> ca.attr #⇒ nil ca.attr = 42 #⇒ 42 ca.attr #⇒ 42   # sic!   Sidenote: aliasing attr? method works pretty fine too.  My question would be: is it a known ruby behaviour (aliasing setters is prohibited,) or I am missing something obvious?


Windows 8 turns program sound volume down randomly

I recently upgraded to Windows 8 from Win 7 64 bit and have started to encounter a strange issue. When I have any program running which plays sound, such as a game or spotify, after a random interval (usually around 5-10 minutes) the program sound will set itself really low.    If I Alt-Tab to the desktop and check the Mixer I can see that the Application volume has automatically set itself really low - the other volume levels (i.e. the Device speakers) stay the same.  I'm able to just set the application volume back to a reasonable level and it stays that way for another 5 - 10 minutes then goes quiet again.  My sound is Realtek High Definition Audio and my machine is an Acer Aspire 5738G if that helps in any way.  Any help much appreciated!


What will be the effect of nitrogen if it filled in two wheelers tube?

What if I fill liquid nitrogen in tube of two wheeler?? Is it OK?


Get current time with/in milliseconds from OS X command line

I'm trying to get the current time from OS X command line to work with in AppleScript to output the elapsed time.  Currently I'm using this script:  set timea to do shell script "date +%s" ##something is executed set timeb to do shell script "date +%s" set runningtime to timeb - timea   But it is too unprecised, so I'm looking for a way how to get the elapsed precisely with milliseconds or somethin.  Thanks. :)


Individual 401(k) and Contribution Limits

For an individual who was self-employed part of this year and contributed to an .  Now the individual is employed and covered under a standard 401(k).    Does the solo 401(k) contribution lower the 18K contribution limit to the 401(k)?


Hosting windows updates locally or on a network

A common fix for many computer problems, is formatting a hard drive, and reinstalling the operating system. And, to help protect from future problems / be sure that all drivers are installed, I always update a computer after reinstalling the operating system. This is a various tedious, time-consuming process, especially when you have more than 3 computers to be repairing. I'm wondering if there's any way to have windows update from a local server / from a removable storage to save time, power, and bandwidth.


Why can't I /give a renamed 'paper' item in Minecraft Bedrock?

I am attempting to give a player a 'paper' item with the name "left" but it isn't working. This is the command I'm using: /give Fireblade8409 paper 1 0 {display:{Name:"left"}}  The error I'm getting is:  Line 1, Column 2 Missing '}' or object member name  How do I fix this?


Let $ f : \mathbb{C} \rightarrow \mathbb{C} $   such that $ |f(z)| \leq |sin(z)| $ for   every $ z \in \mathbb{C}$. Prove  that  there  exist $ C \in \mathbb{C}$ such that $|C| \leq 1$   such that $ f(z) = C sin z $ for  every $ z \in \mathbb{C}$. How  to  proceed?


What are the finite-dimensional spaces $W$ of differentiable functions with this property: If $f$ is in $W$, then $\frac{df}{dx}$ is in $W$.


Can we calculate $2^k$ using this easy Taylor series?

Trying to calculate $2^k$ by hand for $k\in[0,1]$, it's tempting to use the Taylor expansion of $x^k$ around $x=1$, to get: $$2^k = 1^k + \frac{k (1)^{k-1}}{1!} + \frac{k(k-1) (1)^{k-2}}{2!} + \ldots =1+k +\frac{k(k-1)}{2!}+\ldots =\sum_{n=0}^\infty\binom{k}{n}$$ Unfortunately, $2$ lies exactly on the the radius of convergence $r = 1$, so in theory this may not converge.   Can we prove this converges to the correct value for all $k$? Numerically it does seem to. What can be said about the rate of convergence? It seems quite slow. Can we bound the convergence?


How to clear/wipe an Android phone before selling it?

I have two phones, the  and , both using Android 2.1, and I intend to sell them in the near future.  Before selling (just like before selling a HDD), I want to wipe all the personal DATA from the phones.   Question: Does a "factory reset" (from the Android phones "menu") surely wipe all the personal data? Or will there be something left to use? (ex.: contact list, Gmail password, etc.?)


Problem:  Suppose $f: \mathbb R \to \mathbb R$ is Borel measurable. Define $\mathcal A$ to be the smallest $\sigma$-algebra containing the sets $\{ x : f(x) > a\}$ for every $a \in \mathbb R$. Suppose $g: \mathbb R \to \mathbb R$ is measurable with respect to $\mathcal A$, which means that $\{x : g(x) > a\} \in \mathcal A$ for every $a \in \mathbb R$. Prove that there exists a Borel measurable function $h: \mathbb R \to \mathbb R$ such that $g= h\circ f$.  What I've looked into so far:  I'm thinking $h = g\circ f^{-1}$. This would mean I would need to prove that for any Borel measurable set $B$, we have $h^{-1}(B) = f(g^{-1}(B))\in \mathcal B$. Since $g$ is $\mathcal A$-measurable, $g^{-1}(B) = A\in \mathcal A$. Can we say that since $f$ is Borel measurable, $\{x: f(x) > a\} \in \mathcal B$, and $\mathcal A \subset \mathcal B$? However, I'm not sure what I can say about $f(A)$ besides that I need it to be Borel measurable.   Should I approach this differently, or am I on the right track?


UNSUPPORTED_CLIENT: TLS 1.0 has been disabled in this organization. Please use TLS 1.1 or higher when connecting to Salesforce using https

Critical Updates there is no Update Name   (Require TLS 1.1 or higher for HTTPS connections" in that list)   any help will be appreciated


Cycles render engine is not rendering anything

I've looked everywhere in SE for a solution, nothing seems to be working. For no obvious reason cycles rendering is not working, as you can see in the screenshot, here's what I've tried to do:   check/uncheck sequencer in post processing tab. changing between global and local view. switching between layers.   is there anything else I can try?    here's the blend file:


I have two csv files:  sub_compiler.to_csv('sub_compiler.csv') sub_compiler.head()     and   sub_opt = pd.read_csv('sub_opt.csv') sub_opt.head()     and what I would like to do is to create a csv file where I have something of the form   compiler, opt   How could I do this? I need to do this to make a submission.  Thank's in advance.  [EDIT] Thank you for the answers. Now I have obtained :    don't understand why I have the columns called unnamed.   My objective is to get a csv file that contains only the columns compiler and opt. How could I do this? Thank's again.  [EDIT 2] I have solved my problem but if I open the csv file manually, so just click on the file, I have the following:    s it contains only 11 lines, but it contains 3000 lines in jupyter. Is it there something wrong?  [EDIT 3] I tried to to the following:  import pandas as pd  test = pd.read_csv('1495927.csv') test   and I have:    where 1495927.csv is the csv file I have created and that is in the image where I have 11 elements.


Why is there a large gap between imported png and caption?

Why the spacing between the caption and image is large and why it is not where I wanted it but somewhere else? How to make it next to it as I would normally expect a caption to be?   I placed the png as shown:  An overview of the development process is graphically shown:  \begin{figure} \centering \includegraphics[height=60mm]{diagram.png} \caption{Development Framework} \label{Framework} \end{figure}  \begin{list}{.}{} \item Mathematica - Monte Carlo pricing development \item Mathematica server - Initializing FinancialData indices \item Excel VBA - importing of pre-saved financial data \end{list}     But location of the image is reversed?  EDIT: I changed from pdf to png file imported.


How to move the Panel to the bottom on Ubuntu 17.10?

The title says it all, how do I move the Panel on Ubuntu 17.10 to the bottom?


After upgrade to 16.10 ethernet stopped working

Network Manager reports:  device not managed   Output of sudo lshw -C Network:  *-network DISABLED            description: Ethernet interface    product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller    vendor: Realtek Semiconductor Co., Ltd.    physical id: 0    bus info: pci@0000:02:00.0    logical name: enp2s0    version: 15    serial: 2c:60:0c:f6:97:a6    size: 10Mbit/s    capacity: 1Gbit/s    width: 64 bits    clock: 33MHz    capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation    configuration: autonegotiation=on broadcast=yes driver=r8168 driverversion=8.042.00-NAPI duplex=full latency=0 link=no multicast=yes port=twisted pair speed=10Mbit/s    resources: irq:47 ioport:4000(size=256) memory:c4404000-c4404fff memory:c4400000-c4403fff *-network    description: Wireless interface    product: QCA9377 802.11ac Wireless Network Adapter    vendor: Qualcomm Atheros    physical id: 0    bus info: pci@0000:03:00.0    logical name: wlp3s0    version: 30    serial: 48:e2:44:46:07:ab    width: 64 bits    clock: 33MHz    capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless    configuration: broadcast=yes driver=ath10k_pci driverversion=4.8.0-34-generic firmware=WLAN.TF.1.0-00267-1 ip=192.168.1.101 latency=0 link=yes multicast=yes wireless=IEEE 802.11    resources: irq:53 memory:c4200000-c43fffff   Output of nmcli d:  DEVICE  TYPE      STATE      CONNECTION              wlp3s0  wifi      connected  FASTWEB***************  enp2s0  ethernet  unmanaged  --                      lo      loopback  unmanaged  --      Output of ifconfig:  lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536         inet 127.0.0.1  netmask 255.0.0.0         inet6 ::1  prefixlen 128  scopeid 0x10<host>         loop  txqueuelen 1  (Local Loopback)         RX packets 2487  bytes 383935 (383.9 KB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 2487  bytes 383935 (383.9 KB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  wlp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500         inet 192.168.1.101  netmask 255.255.255.0  broadcast 192.168.1.255         inet6 2001:b07:6452:4630:d631:dc14:aa32:46e7  prefixlen 64  scopeid 0x0<global>         inet6 fe80::7932:6d1f:e49b:9b8d  prefixlen 64  scopeid 0x20<link>         ether 48:e2:44:46:07:ab  txqueuelen 1000  (Ethernet)         RX packets 29742  bytes 30300740 (30.3 MB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 22589  bytes 4019841 (4.0 MB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0   Output of ip a:  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     inet 127.0.0.1/8 scope host lo        valid_lft forever preferred_lft forever     inet6 ::1/128 scope host         valid_lft forever preferred_lft forever 2: enp2s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000     link/ether 2c:60:0c:f6:97:a6 brd ff:ff:ff:ff:ff:ff 3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000     link/ether 48:e2:44:46:07:ab brd ff:ff:ff:ff:ff:ff     inet 192.168.1.101/24 brd 192.168.1.255 scope global dynamic wlp3s0        valid_lft 42392sec preferred_lft 42392sec     inet6 2001:b07:6452:4630:d631:dc14:aa32:46e7/64 scope global noprefixroute         valid_lft forever preferred_lft forever     inet6 fe80::7932:6d1f:e49b:9b8d/64 scope link         valid_lft forever preferred_lft forever   How do I fix this?


How can I fix a "no such partition Grub Rescue" error?

Earlier I installed Ubuntu 10.04 from a USB flash drive.  Since the system was unable to detect Ubuntu in the initial menu that appears on reoboting, I deleted the partition onto which I had installed Ubuntu while in Windows 7.  I then installed PowerISO which prompted me to reboot the system.  Now however I get the following error:  error: no such partition grub rescue>   How can I fix this?


Any evidence that subdomain can help with domain authority and vice-versa?

Many articles about subdomain vs subfolders report that subdomains can help with the domain authority of the parent domain and vice versa (I am assuming one owns both domain names). Yet, I cannot find confirmation of this.  It seems like every articles is repeating what other articles are saying. Anyone has hard evidence to share supporting this claim? Or is it just a myth? My understanding is that a subdomain is treated separately from the parent domain, even if you own both domain names.


Is there any way I can take a URL of an image and find the attachment or post id of that image in the database?  Here is the situation:  I'm in a loop going over all the 'img' tags that are surrounded by 'a' tags in my post content. if the src attribute of the 'img' tag does not match the href attribute of the outer 'a' tag, then i want to replace the 'img' tag. In doing this, if the 'img' that is to be removed is in the gallery, i want to delete that post, and then put my replacement 'img' in its place. I tried using a function like this:   function find_image_post_id($url) {   global $wpdb;   $postid = $wpdb->get_var($wpdb->prepare("SELECT DISTINCT ID FROM $wpdb->posts WHERE guid='$url'"));   if ($postid) {     return $postid;   }   return false; }   This apparently is not right because the guid is ironically not globally unique. I had (earlier in the same script) uploaded a file with the same name (why? because it was higher resolution and i am trying to replace low resolution versions of the same image) and although wordpress will save the image with a different name in the directory, the guid's were set to be the same. (possibly a bug).  Is there another technique I can use?


Don't we have single sign-on for all Stack Exchange sites?

I would like to use many sites in the Stack Exchange network, but I need to login to each site separately. Though it's easy, can't we solve this problem? I know each site has a different url :( but is there any way?


What is the word for popular brands becoming nouns in common lexicon? For example, Kleenex, Xerox, q-tips etc


Sitemap Error: some URLs redirect to other locations

I have a site that is generating this warning:     When we tested a sample of URLs from your Sitemap, we found that some URLs redirect to other locations. We recommend that your Sitemap contain URLs that point to the final destination (the redirect target) instead of redirecting to another URL".   Why is this a problem, and how do I correct it?


When I launch an app, the focus doesn't move to the opened app

Let's say I have Gthumb open, and then launch Nautilus from the Unity launcher (in 12.04). Why does it sometimes not focus the mouse on Nautilus, which I just launched? Instead, the focus remains on Gthumb while Nautilus opens in front of Gthumb (and not being focused on).  Is this correct behaviour?


Does the  file format use a serious encryption (such as )?  Will it take unfeasibly long to brute force a password?  If not, what tools do you suggest that do so automatically?