I use huge data files, sometimes I only need to know the number of lines in these files, usually I open them up and read them line by line until I reach the end of the file  I was wondering if there is a smarter way to do that


How can I best take a tripod on a plane trip?

I'm traveling by air on Ryanair to UK, then off to Spain.  I don't feel safe putting my tripod in the checked luggage, and I've had problems carrying it in hand luggage.  How do I make sure that my tripod survives the plane trip? I had a tripod stolen from my luggage and don't fancy that happening again.


How to encode game files or pack to one file like game_data.dat

I am a beginner C++ programmer. I am creating a custom Open Tibia Server and I use  the alternative Tibia client ().  I want encode game files (image, sound, lua, etc.) or pack all files into one. Can anyone help me with this?


Attempt to invoke virtual method 'java.lang.Object android.os.Bundle.get(java.lang.String)' on a null object reference

I am currently working on an Android app with Android Studio. I followed a Tuto to add the facebook login functions with picture and username . Then I created a new Activity once the Login is successful. But when I start the app, the app crash within 5 seconds with the message Attempt to invoke virtual method 'java.lang.String android.os.Bundle.getString(java.lang.String)' on a null object reference  Main activity :  public class MainActivity extends AppCompatActivity {  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main);      Bundle inBundle = getIntent().getExtras();      String name = inBundle.get("name").toString();     String surname = inBundle.get("surname").toString();     String imageUrl = inBundle.get("imageUrl").toString();       if (AccessToken.getCurrentAccessToken() == null) {         TextView nameView = (TextView)findViewById(R.id.nameAndSurname);         nameView.setText("" + name + " " + surname);         new DownloadImage((ImageView)findViewById(R.id.profileImage)).execute(imageUrl);          goLoginScreen();     } }  private void goLoginScreen() {     Intent intent = new Intent(this, LoginActivity.class);     intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);     startActivity(intent); }  public void logout(View view) {     LoginManager.getInstance().logOut();     goLoginScreen(); }   Activity_main.xml :  <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="tech.alvarez.androidfacebooklogin.MainActivity">   <TextView     android:id="@+id/nameAndSurname"     android:layout_width="77dp"     android:layout_height="wrap_content"     android:layout_above="@+id/profileImage"     android:layout_centerHorizontal="true"     android:layout_gravity="center_horizontal"     android:layout_marginBottom="-143dp"     android:textSize="22dp"     android:textStyle="bold" />  <ImageView     android:id="@+id/profileImage"     android:layout_width="87dp"     android:layout_height="101dp"     android:layout_alignParentBottom="true"     android:layout_centerHorizontal="true"     android:layout_gravity="center_horizontal"     android:layout_marginBottom="190dp" /> <Button     style="@style/Widget.AppCompat.Button.Colored"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_alignParentBottom="true"     android:layout_centerHorizontal="true"     android:onClick="logout"     android:text="@string/logout" />


How do I ensure a piece of code runs only once?

I have some code that I only want to run once, even though the circumstances that trigger that code could happen multiple times.  For example, when the user clicks the mouse, I want to click the thing:  void Update() {     if(mousebuttonpressed) {         ClickTheThing(); // I only want this to happen on the first click,                          // then never again.     } }   However, with this code, every time I click the mouse, the thing gets clicked. How can I make it happen only once?


In  I noticed a mention of a "focusing rail". I've never heard of such device.  What is it, and in what circumstances is it useful?


Implement quick sort algorithm with faulty results. Details of what I want to do can be found at the video:  Does break command take me out of inner loop or both loops? Below you'll find the code, any help will be welcome.  int main (void) {  // Array of integers to be sorted int list[] = { 3, 9, 8, 5, 7, 6, 4, 2, 1}; int arrayIndexLimit = (sizeof (list) / sizeof (int)) - 1; int temp = 0;  // "J" separates sorted part of array from unsorted one  for (int j = 0; j < arrayIndexLimit; j++) {      // Find smallest value in unsorted part of array     for (int i = j; i <= arrayIndexLimit; i++)     {          // Put smallest value in jth position          if (list[i] < list[arrayIndexLimit])         {             temp = list[j];             list[j] = list[i];             list[i] = temp;             break;         }            // Pivot (last item of array) is the smallest         if (i == arrayIndexLimit)         {             temp = list[i];             list[i] = list[j];             list[j] = temp;             break;         }     }  // Print sorted list }


I tried to disable some of the services, but this didn't work out. I'd really appreciate some help on this.


I am in need to theme webform in D7.  How can I do that ?  In the search I've come to know that by using web-form-nid.tpl.php we are able to theme a drupal individual form.  Could any one guide me in this case to theme a webform.


At work, I access both a remote system via SSH and some web interfaces that login through LDAP. I use 1password to manage my passwords, but I can't seem to find a simple way to input the password from the password manager to SSH. I saw sshpass but it can show the password in ps, which is really bad security, and also doesn't work in my case. Is there any way to input a password from an external program or script through SSH directly, or are there facilities within SSH that I can leverage and keep the passwords in sync? Such as keeping a key file that I unlock for SSH that has the same password, which is updated whenever I update the password. Note I can't directly use keys to log into the system because it's not built to support it.  Edit: One commenter pointed out that sshpass will show the password in ps, which is a no-go. I also can't directly alias ssh to something like sshpass ... ssh because I do still log into systems that use keys.   Edit 2: I got confirmation that a password manager is okay, and I attempted to use sshpass with a file descriptor to log into the server but it doesn't seem to work -- instead of giving me a prompt to enter my RSA token, I just get nothing, which makes me think it doesn't run through the same code and won't accept sshpass.


The position of "always" in different sentences

I want to know about the position of always in different sentences. For example:      Always she is tidy and on time.   Is it correct or not?


Login link from codegolf.xyz not working; redirecting to codegolf.xyz/users/https

I attempted to log in from the "Login" link on the StackExchange bar, and it just redirects to , which is a 404. I am able to login from , but not codegolf.xyz    I'm in Firefox on Linux (Ubuntu 15.10), here's the network tab from the devtools:     I was able to reproduce in an Firefox private browsing tab, as well as Chromium, in both regular and incognito.


Understanding (theoretical) computing power of quantum computers

I am very new to quantum computing and just try to understand things from a computer scientist's perspective.  In terms of computational power, what I have understood,      100 ideal qubits ...  to [$2^n$ pieces of information]   Now Rigetti Computing has  a 128 qubit computer.   Let's imagine they indeed release it next year.  This leads me to the following thoughts, please correct me if I am wrong:   let's say hypothetically due to the noise about 28 qubits can't be taken into consideration (as used for the fault tolerance for example) that is, we could work with 100 qubits as in the example above.   Could we say then, we have an analog of  i.e. say  64 qubits go for memory and 32 qubits for the instruction set (say remaining 4 are reserved).  Does this mean then (oversimplified!):   we get 2^32 bits equivalent ~ 537 MB worth of "register bits" for CPU instructions, altogether with caches (no idea who might need that but could probably become a many-core "die" see for example ), compared to say 512KB=2^15 bits cache for one level on a classical computer and for "RAM", we get remaining 2^64 bits equivalent = 2.3 exabytes worth memory? (way more than current supercomputers have; Google had though  total disk storage of 10 exabytes in 2013)


I'm programming a window where the user has to type a date on a input field but I don't know how to check if the day or month are coherent or not (like day between 1-31 and month between 1-12)      String string = "26/03/2017";     DateFormat format = new SimpleDateFormat("dd/MM/yyyy") ;      try {         Date date = format.parse(string);     } catch (ParseException e) {         e.printStackTrace();     }   This is the piece of code where I'm formatting the Date, but I have no idea to check what I said before.


How to restore a git reset --hard HEAD@{1}

I do a   git reset --hard HEAD@{1}   But I removed some things wrongly. I try solve it  git fsck −−lost-found   But it no found the "revert"  Thanks...


how to change element of struct in a list c#?

public struct rectangle {    public decimal a; }   that is my struct  and i have a list of struct rectangles  list<rectangle> dataRectangle= new list<rectangle>();   now i have already added some structs into the list now i would like to change the value of a struct present in a list like   dataRectangle[0].a=0;   it says   cannot modify the return value ' list<form4.rectangle>.this[int] ' because it is not a variable   help why is this coming and is there another way to modify


Windows 10 doesn't shut off properly (power light remains on) after long period of use

I've recently upgraded to Windows 10, but I'm encountering an issue with the shut down of the computer everyday. If I stay on Windows 10 for a long period of time (~2 hours or longer) say doing office work or browsing the web etc etc, I would have trouble shutting down the machine completely. The screen would go black, but the power light would stay on. I would have to press the power button for roughly 10 seconds to do a hard shut off. However, if I turn on the computer and turn it off within 10 minutes or so, the computer would shut down completely without problem.  I've researched on the issue, and turned off the fast startup. I also followed the solutions from this  on Superuser addressing a similar or almost the same problem, but none of the solution has worked in my case. Is there anything else I can do to resolve the issue? Thank you!


Let $n$ be any positive integer and let $x \in (0, \pi)$. Prove that $\sin x+ \frac{\sin 3x}{3} + \cdots +\frac{\sin(2n-1)x}{2n-1}$ is positive.

I came across the following problem in a high school calculus exam paper. I do have the solution, but it took me quite a while to work it out and I think it's very clumsy. I'm curious to know if there is a simpler solution.  Problem  Let $n$ be any positive integer and let $x \in (0, \pi)$. Prove that  $$\sin{x} + \frac{\sin{3x}}{3} + \frac{\sin{5x}}{5} + \cdots +\frac{\sin{(2n-1)x}}{2n-1}$$ is positive.


Trying to center some text in a div that cover the whole page. Any horizontal adjustments that I make are fine yet vertical adjustments either do not work or push the text below the center of the page.     .home{  max-width:100%;  height:100%;  text-align:center;  background:url(desktop_1.jpg) no-repeat center center;    -webkit-background-size: cover;    -moz-background-size: cover;    background-size: cover; } .home .text{  height:100%;  width:100%; }  .home .text h1{  vertical-align:middle; }

 MOSTACK

 Lorem ipsum dolor sit amet
     ENTER SITE

     Understand that this may seem as a dupliacte yet tried solutions on other posts and none are working  EDIT- SOLVED used the following css    .home{  width:100%;  height:100%;  text-align:center;  background:url(desktop_1.jpg) no-repeat center center;    -webkit-background-size: cover;    -moz-background-size: cover;    background-size: cover; } .home .text{  max-width:100%;  height:50%;  position: absolute;     margin: auto;     top: 0;     left: 0;     right: 0;     bottom: 0; }  .home .text h1{  font-family:'Raleway', sans-serif;  padding-top:30px;  padding-bottom:100px;  font-size:60px;  color:black;  max-width:100%;  height:40%;  position: absolute;     margin: auto;     top: 0;     left: 0;     right: 0;     bottom: 0; }  .home .text a{  text-decoration:none;  padding-top:100px;  font-size:20px;  color:black;  max-width:100%;  height:0%;  position: absolute;     margin: auto;     top: 0;     left: 0;     right: 0;     bottom: 0; }

 MOSTACK
     ENTER SITE


Find a basis of clopen sets for the topology on $X$

The problem states: Let $X$ be a completely regular space such that $|X|<c=|\mathbb{R}|$. Prove that there exists a basis $\mathcal{B}$ for the topology on $X$ such that for all $B\in\mathcal{B}$, $B$ is both open and closed.  I let $\mathcal{B}$ be the collection of all clopen sets since any other choice for $\mathcal{B}$ would yield a coarser topology. It is easy to verify that $\mathcal{B}$ forms a valid basis. Let $\tau$ be the topology on $X$ and let $\tau_\mathcal{B}$ be the topology generated by $\mathcal{B}$. Then clearly $\tau_\mathcal{B}\subset\tau$. I couldn't figure out how to show that $\tau_\mathcal{B}=\tau$, so I assumed it wasn't and tried coming to a contradiction. If $\tau_\mathcal{B}\neq\tau$, then that means there must exist an open set $U\in\tau$ and a point $x\in U$ such that every clopen set containing $x$ must intersect $X\setminus U$. I thought that maybe using this along with the completely regular condition, I could prove the existence of some surjective function $f:X\to[0,1]$, thus contradicting the cardinality restriction, but I couldn't find any way of doing that. Any ideas?


How can I make this insertion secure from MySQL injection?

I'm new to PHP and database programming and have been attempting to add data from a form to MySQL database. It works fine but is this open to my MySQL injection? I've read plenty of tutorials and I'm thinking PDO prepared statements. How can I do this for my comments field for example? This field (it's a text field) will be fairly open to whatever the user wants to put. How can I write this in order to make it more secure?  <?php ob_start(); $username = 'name';  $password = 'pass';  $host = 'localhost';  $dbname = 'map';    try { $dbh = new PDO("mysql:host=$host;dbname=$dbname", $username, $password); // set the PDO error mode to exception $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "INSERT INTO Incidents (           protocol,         jurisdiction,         date,         time,         comments,         video,         lat,         lng                )          VALUES (           '".$_POST["protocol"]."',         '".$_POST["jurisdiction"]."',         '".$_POST["date"]."',         '".$_POST["time"]."',         '".$_POST["comments"]."',         '".$_POST["video"]."',         '".$_POST["lat"]."',         '".$_POST["lng"]."'           )          ";  // use exec() because no results are returned $dbh->exec($sql); header("Location: map1.php");   } catch(PDOException $e) { echo $sql . "<br>" . $e->getMessage(); }  $dbh = null;     ob_end_flush(); ?>


This is the script that I've written. The first click function works fine but the other two don't work as expected. The  tags follow the href link and the function for its click doesn't work. Is it because they have been created by jQuery and are not in the original html page?  $("#edit-description").click(function(){     $("#add-description").replaceWith( "
<textarea cols='43' rows='9' placeholder='Add a description...'></textarea>UpdateCancel
" );     return false;   });     $("#add-description-cancel").click(function(){     $("#add-description").replaceWith( '
Write a description about the college.
');     return false;   });     $(".u-update").click(function(){     $("#add-description").replaceWith( '
Write a description about the college.
');     return false;   });


Throughout the site abbreviated dates are used (Apr 21 at 9:12). This works great for dates within the current year but it seems that as the years roll by it'll become important to include the year in the date. I am not sure that having the time is of value for a post that is a year old. Maybe at a certain threshold replacing the time with the year is appropriate.


How can I make this PHP snippet accessing SQL secure?

Problem  I have the below snippet in a website that I'm building at the moment. I know it is not secure due to SQL injection etc. but what is the correct way to solve that? I see related questions asking the same thing but with MySQL, and for that there is PDO, but PDO_OCI is experimental so I don't want to use it.  What other options do I have? Do I just create a function to strip certain characters and wrap that around the $_POST, something like str_replace(';', '', $_POST['username']);?  The below snippet is the only part of the website that actually takes user input, $_POST, in a query so I just need to make sure that I get the below correct.  Code  <?php  if (!empty($_POST)) {    $stid = oci_parse($conn, "SELECT CustomerNo FROM Customers WHERE Username = '" . $_POST['username'] . "' AND Password = '" . $_POST['password'] . "'");   oci_execute($stid);    $row = oci_fetch_array($stid, OCI_NUM);   if (!empty($row['0'])) {      session_start();     $_SESSION['customer'] = $row['0'];     $_SESSION['username'] = $_POST['username'];    }    oci_free_statement($stid);   oci_close($conn);  }  ?>


RSA encryption with private key and decryption with a public key

When using the RSA cryptosystem, does it still work if you instead encrypt with the private key and decrypt with the public key? What about in the case of using RSA for sender authentication?


Property of Integral of a strictly increasing function

Let $0 < a < b$. Let $f > 0$ be continuous and strictly increasing on $[a, b]$. Prove that $\int_a^b f + \int_{f(a)}^{f(b)} f^{-1} = bf(b) - af(a)$ By drawing the graph I can see and prove the theorem holds. Area of Outer rectangle - inner rectangle gives the sum of two integrands. How to prove theoretically?


Under what condition on $\sigma$ is $dM_t = \sigma(M_t,t) dW_t$ a martingale?

Let $(W_t)$ be a Brownian motion. Under what minimal condition on the function $\sigma$ can we say that the solution of $$dM_t = \sigma(M_t,t) dW_t$$ is a martingale with regard to its own filtration? Same question if $(W_t)$ was a generic martingale, not necessarily a Brownian motion.


I am using tmux 2.1 on Ubuntu 16.04.  I would like to have the background have some transparency.  A lot of times I need to reference something at the same time I use the terminal.    I have looked at   and   this seemed to suggest that setting bg=default would do it but it gives me the default solid purple. I tried using a hex code of #80FFFFFF which tmux rejected.  edit: The old post noted above does not explain how to set the transparency in tmux- at least not to me :(  Help greatly appreciated.


I'm trying to make papermodels out of my Blender projects. Google's only remotely useful result was the program Papakura, which I cannot get because I have Linux. I'm not able to run it with WINE. I want to be able to print my unwraped mesh (UV map) in a way so I can make a paper model. Is Blender capable doing this?


Derivatives with Two Indices in Electromagnetic Lagrangian

I was reading about the derivation of Maxwell's equations from an electromagnetic Lagrangian density from Sean Carroll's Spacetime and Geometry: An Introduction to General Relativity. The Lagrangian density $\mathcal{L}$ is given by  $$ \mathcal{L} = -\frac{1}{4} F^{\mu\nu}F_{\mu\nu} + A_{\mu}J^{\mu}, $$ where the symbols have their usual meanings.   In eq. (1.166) he writes the following equation:   $$ \frac{\partial F_{\alpha\beta}}{\partial(\partial_{\mu}A_{\nu})} = \delta^{\mu}_{\alpha} \delta^{\nu}_{\beta} - \delta^{\mu}_{\beta} \delta^{\nu}_{\alpha}. $$  As $F_{\alpha\beta} = \partial_{\alpha}A_{\beta} - \partial_{\beta}A_{\alpha}$, the following results is used:   $$ \frac{\partial (\partial_{\alpha} A_{\beta})}{\partial(\partial_{\mu}A_{\nu})} = \delta^{\mu}_{\alpha} \delta^{\nu}_{\beta} $$  How to prove this result?


Recently saw someone commending another user on their use of sizeof var instead of sizeof(type). I always thought that was just a style choice. Is there any significant difference? As an example, the lines with f and ff were considered better than the lines with g and gg:   typedef struct _foo {} foo;   foo *f = malloc(count * sizeof f);  foo *g = malloc(sizeof(foo) * count);   foo **ff = malloc(count * sizeof *ff);  foo **gg = malloc(sizeof(foo*) * count);   In my opinion, the first set is just a matter of style. But in the second pair of lines, the extra second * can easily be confused for a multiplication.


How to change directories in ubuntu using bash shell script?

I was trying to use cd in shell script to change directories . But it's not happening ? Why is it so ? What can be the other ways to change the directories in shell script ?


Does Magic Resistance work against Turn Undead?

Magic Resistance:     The flameskull has advantage on saving throws against spells and other magical effects.   Turn Undead:     Each undead that can see or hear you within 30 feet of you must make a Wisdom saving throw.   Is Turn Undead magical?


I've been using TeXLive and Texmaker 4.5 with XeLateX, and the use of the fontspec package slows everything down.  More precisely, it takes 21 seconds to compile this :    \documentclass[11pt,a4paper]{article}  \usepackage{fontspec}  \usepackage{xunicode}  \usepackage[french]{babel}  \begin{document} test \end{document}     If I take out the \usepackage{fontspec}, it takes no more than a second.   What can I do ? What are the alternatives ? Can it be related to the fact that on texmaker parameters , my DVI viewer is MikTeX (it says "C:/Program Files/MiKTeX 2.9/miktex/bin/yap.exe" %.dvi) ? Seems strange to me since I installed and am using TeXLive. I don't remember installing MikTex, but it's not impossible. What is the correct path if I want to use TeXlive ? Just the main TeXLive folder ?   As you can tell, I'm a beginner and non-english speaker, thank you for your understanding.


I'm working on an Earth model and when I apply its textures I get them repeating instead of being applied only once. Im still new to Blender, I would appreciate some help


Derive from class template which is nested in class template, all withing a class template

I'm trying to get this to work:  template<template<typename> class... Attributes> struct Skills {     template<class DERIVED>     struct Create : public Attributes<DERIVED>...     {}; };  template <class T, class SKILLS> class Tester : public typename SKILLS::Create<Tester<T,SKILLS>> {}   but the compiler complains with:  error C2518: keyword 'typename' illegal in base class list; ignored  This works fine if I don't derive within a class template, however.  Is there any chance to derive from the nested template class?  Why do I need that? I'm trying to implement a nicer interface for a CRTP-class template, which allows doing something like:  using MyClass = ClassWithAttributes<Skills<Plus,Minus,Equal,Clear,Size>>


Is there any way to save helpful questions on S.O. for easy retrieval?

I bookmark the crap out of stackoverflow, but i'm wondering if there's a way to save the questions directly in my account or something so I can browse them later if I need to. I dont like having the bookmarks associated with a particular browser or computer.  Sorry if this has been asked before


$$\frac{\mathrm{d}}{\mathrm{d}t} \left ( \frac {\partial  L}{\partial \dot{q}_j} \right ) =  \frac {\partial L}{\partial q_j}.$$  I don't understand partial derivative by "function" (e.g. $q_j$). $q$ can be displacement. Then $\dot{q}$ is velocity. Both can be represented in terms of $t$. So by eliminating $t$, $q$ can be represented in terms of $\dot{q}$  vice versa. Hence, all $q$ terms in $L$ can be replaced with $\dot{q}$ terms making  RHS of the above equation $0$. What's wrong with this?


Aligning multiple points to line in QGIS?

I would like to align multiple points to a line, or lines within a layer, using a specified tolerance or buffer around the line objects. Please refer to the sample sketch attached.  For the sake of this example, the points closest to the line in the BEFORE picture are within 5 map units of the line, while the outermost points are over 10 map units away. I would like to snap the closest points onto the nearest line, using a tolerance of 5 map units to achieve the result in the AFTER picture.


How use lerp python function at driver expression?

I'm trying to use a lerp function, but Blender gives an error. What is the problem? The problem appears exactly when I try to do something with a lerp. The rest of the driver works fine.


Explicit bijection between the successor of $\alpha$ and $\alpha$ (infinite ordinal).

I would like to construct an explicit bijection from $\alpha^*$ to $\alpha$, where $\alpha$ is an infinite ordinal. I have been told a possible bijection would be:  \begin{equation} f(\beta) = \begin{cases} 0 & \text{if } \beta = \alpha \\ \beta^* & \text{if } \beta \text{ is finite} \\ \beta & \text{otherwise} \end{cases} \end{equation}  I don't understand how this is constructed, or why it is a bijection.


Display data from postgresql on click map

I work with openlayers and geoserver. I'm searching for code that when I click on a point of a layer on the map, a popup window appears that contains information from the database (postgres) for this point.   Can you help me please?


This is a  about  the use of a *AMPP's stack.    I recently had a talk with some experienced people and they suggested to me not to use a WAMP stack, and instead install apache, mysql and php separately.  I don't understand why they have suggested this, though, so can anyone tell me?  Is there a particular disadvantage of WAMP, or a particular advantage to installing all of them separately?  Since a WAMP stack itself is composed of apache, mysql and php, then what's the difference between using the WAMP stack and installing them all separately?


In my intro E&M class, we were given an example problem to determine the voltage within a cylindrical capacitor as a function of radius. A diagram of such a cylindrical capacitor is below.  The solution from my instructor is as follows.  Let the outer, negatively-charged surface be denoted by “b” and the inner, positively-charged surface be denoted by "a”. So, we have $$\begin{align}\Delta V & = V_a - V_b\\&= -\int_{r_b}^{r_a} \vec{E}\cdot\text{d}\vec{s}\\ &= -\int_{r_b}^{r_a}E\cos\theta\text{ d}s\end{align}$$ Now we note that $\cos\theta = -1$ in this case and then make the substitution $\text{d}s = - \text{d}r$. $$\begin{align}\Delta V &= -\int_{r_b}^{r_a} E\cos\theta\text{ d}s\\&= \int_{r_b}^{r_a} E\text{ d}s\\&= -\int_{r_b}^{r_a} E\text{ d}r\end{align}$$   When we actually substitute in the expression for the electric field as a function of $r$, we get the correct answer. However, my concern with this solution is in the nature of the order of substitution. When I approached this problem, instead of first making a substitution for $\cos\theta$, I first made the substitution $\text{d}\vec{s} = -\text{d}\vec{r}$. To me, this vector substitution made more sense than the scalar substitution of differentials since this would be more indicative of the opposite direction between the "direction of integration" and the radial vector. So, using this approach, we get $$\begin{align}\Delta V & = V_a - V_b\\&= -\int_{r_b}^{r_a} \vec{E}\cdot\text{d}\vec{s}\\ &= \int_{r_b}^{r_a}\vec{E}\cdot\text{d}\vec{r}\\&= \int_{r_b}^{r_a} E\cos\theta\text{ d}r\end{align}$$ Now, since the differential radial vector and the electric field are parallel, $\cos\theta = 1$, so we get $$\begin{align}\Delta V &= \int_{r_b}^{r_a} E\cos\theta\text{ d}r\\&= \int_{r_b}^{r_a} E\text{ d}r\end{align}$$ This is the negative of my instructor's solution, which obviously leads to the wrong solution. Where do I go wrong? Why can I not simply reverse the order in which my teacher makes substitutions?


How to increase the size of /home in a vmware ubuntu?

The result of df -h is like this:  Filesystem               Size  Used Avail Use% Mounted on udev                     3.9G     0  3.9G   0% /dev tmpfs                    797M   88M  710M  11% /run /dev/mapper/vgroot-root   25G   18G  5.8G  76% / tmpfs                    3.9G  106M  3.8G   3% /dev/shm tmpfs                    5.0M  4.0K  5.0M   1% /run/lock tmpfs                    3.9G     0  3.9G   0% /sys/fs/cgroup /dev/sda1                945M   75M  806M   9% /boot /dev/mapper/vgroot-home   15G   14G   56K 100% /home vmhgfs-fuse              239G  200G   40G  84% /mnt/hgfs tmpfs                    797M     0  797M   0% /run/user/999 tmpfs                    797M   64K  797M   1% /run/user/500   I see /home directory is 100% full, but don't know how can I enlarge it?  I tried resize2fs /home 50G and got     open: Is a directory while opening /home   Then I tried mount -o remount,size=50G /home but I got     mount: /home not mounted or bad option   Then I run gparted in the ubuntu client, the info is like this:  /dev/sda1   ext4        /boot  976MB /dev/sda2   extended           299GB   /dev/sda5 lvm2 pv     vgroot 299GB unallocated unallocated        1MB   This is for my vmware disk, in vmware, the Ubuntu's disk is set to 300G as the max size.  Should /home be listed here? Do I need to mount it?  sudo lvdisplay is:  --- Logical volume ---   LV Path                /dev/vgroot/root   LV Name                root   VG Name                vgroot   LV Status              available   # open                 1   LV Size                25.00 GiB   - currently set to     256   Block device           253:0    --- Logical volume ---   LV Path                /dev/vgroot/swap   LV Name                swap   VG Name                vgroot   LV Status              available   # open                 2   LV Size                4.00 GiB   - currently set to     256   Block device           253:1    --- Logical volume ---   LV Path                /dev/vgroot/home   LV Name                home   VG Name                vgroot   LV Status              available   # open                 1   LV Size                15.00 GiB   Read ahead sectors     auto   - currently set to     256   Block device           253:2    LV size is 15GB.  sudo pvdisplay:  PV Name               /dev/sda5   VG Name               vgroot   PV Size               299.04 GiB / not usable 0      Allocatable           yes    PE Size               4.00 MiB   Total PE              76555   Free PE               65291   Allocated PE          11264   pvscan is:  PV /dev/sda5   VG vgroot          lvm2 [299.04 GiB / 255.04 GiB free]   Total: 1 [299.04 GiB] / in use: 1 [299.04 GiB] / in no VG: 0 [0   ]   I need to increase the size of /home, but how?


How to call drupal_bootstrap from custom file in subfolder?

I'm trying to call drupal_bootstrap from 'temp.php' in a subfolder called 'custom' my code as follow:  chdir('../'); define('DRUPAL_ROOT', getcwd()); require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);   Once I call the temp.php I get Drupal homepage.   I also tried an explicit physical path but with no use, code as follow:  define('DRUPAL_ROOT', '/var/htdocs/drupal7'); require_once '../includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);   temp.php located under the following folder structure:  - var -- htdocs --- drupal7 ---- custom  ----- temp.php


Do relativistic frames imply different realities?

From Einstein's principle of relativity space-time and mass are relative to the frame from which they are being observed.  Now would that mean a ball moving at the speed of light wrt to earth would become a black hole for an observer on earth but stay normal for an observer moving with the ball at same speed?  If not then how would you justify the observation of infinite relative mass ball not turning into a black hole from the earth frame of reference?


Expression for talking pseudo-smart, but not saying something of value?

What do you say when someone uses many words, without getting to the point and without saying something really of value with regard to a particular topic? I'd like to emphasize that it's really a lengthy statement with only little content which is actually relevant to what has been asked. It can seem sophisticated, but when you look closely it's either trivial conclusions or doesn't even answer the question.  I've heard the expression "mental masturbation", but maybe there are better ones.  EDIT: It is not merely lengthy or long-winded. It is rather off-topic or not relevant. It can be rather focussed and condensed - just on things which are irrelevant. Often the talker believes he is being very clever by mentioning complicating stuff.


Let's imagine a asteroid that travels with 0.99999999999999999c.  (I know it's impossible).  Anyway... Relativistic mass of such object would be almost equal to earth's stationary mass.   Now let's imagine that such object passes closely to me (assuming I'm immortal etc.). According to $F_g=GMm/r^2$ (Where M is relativistic mass of this asteroid and m is my mass) such an object would attract me.  So would I gravitate after it? Would I gain it's speed constantly falling on it? Or maybe it would just pulled me for a moment, but then I would return to my ol' good non-relativistic speed in "everyday reference system"?  Or maybe something else would happen? What happens with gravity of relativistic, NON ACCELERATINNG objects? (Let's assume that there's something that makes this asteroid speed constant).


Asking your script to accept arguments which contains whitespace

I'm really stuck on my scripting because of this problem. I need my script to accept arguments and give me the result but since i have spaces it only displays the first word. eg.  cat open.sh echo My name is $1  export start=`date +"%b %d %k:%M:%S %Y"`  [oracle@spiderman scripts]echo $start Jul 01 3:03:18 2016  [oracle@spiderman scripts]$sh open.sh `echo $start` The time is Jul   I need the output as The time is Jul 01 3:03:18 2016.  I need to pass the same output to another complex script.


I'm using Ubuntu 16.04 with Chrome 53.0.2785.101, and am experiencing the problem,that whenever I boot my laptop and open up Chrome, I'm logged out. I see a yellow triangle next to my name and have to reenter my password. This happens every time, and I don't know why. I don't delete my cookies etc. after I close chrome, but have to log into every website again (Facebook is pretty annoying because of 2FA).  Things I considered why this could happen:   I recently changed my password.  I'm using a WiFi connection (Can't use wired atm)   How do I find out what's the problem here and why this is happening? On my desktop pc I don't have the problem.   Update This is not a duplicate of  because the accepted answer didn't work. Maybe I should try one of the others in that thread?  Update 2 After the weekend, I had the same problem again. :( Online account is still connected though, but I was still logged out from every site and my Google account.


Correction for serial voting not received yet

I got my reputation back for the questions marked with green marker, but not for the questions marked with red color.  This is not a duplicate.  I saw that link before. I didn't get my reputation back.


Does convergence in mean imply convergence in mean square?

I know that convergence in probability does not imply convergence in mean. However, does convergence in mean imply convergence in mean square? I can't think of any counter-examples of this so I don't know if it is true or not.


Verbatim environment with catchfilebetweentags package

I would like to use a verbatim environment inside an ExecuteMetaData call from the catchfilebetweentags package.  The use case is that my econometric software creates a fixed-width table that I don't want to convert to a proper table, yet. I can wrap this fixed-width table in tags and send it to a log file. I would like to also wrap the table in verbatim so that the table is more legible, but when I add the verbatim environment I get a Runaway argument? error. I would like to use the catchfilebetweentags package so that I can avoid manually trimming the header and footer from each table (or counting line numbers).  Can I somehow combine fixed-width type with the catchfilebetweentags package?  Here's my MWE.  \documentclass{article} \usepackage{catchfilebetweentags}  \begin{document} \ExecuteMetaData[inner]{table} \end{document}   Where inner.tex is as follows.  %<*table> \begin{verbatim} col1    col2 1   2 3   4 \end{verbatim} %</table>


On Arch, I could just makepkg -s and get the files I needed to change, then makepkg -sci. I'm sure the same can be accomplished on Ubuntu for those who want to alter the code to suit their needs like dmenu or i3-wm for me so the i3bar and dmenu look the same. Is there a wiki on Ubuntu I could find to do this or what would I need to install? Many thinks for reading and hope to find an answer soon :-)


Prove that a group of order $p^2$ where $p$ is prime is Abelian.

I have to prove the statement in the title. As a lengthy hint the following is given:      Hint: let $a \in G$ $\not= e$. Suppose $a$ has period $p$ (for period   $p^2$ the answer is trivial), then consider the subgroup $H = <a>$.   Prove $b \notin H$ implies $G = <a, b>$. Is $H$ normal? Prove $a$ and   $b$ commute and conclude $G$ is abelian.   Getting to the point where I prove that $G = <a,b>$ is no problem. However, I don't see on how to proceed to prove that $H$ is normal and assuming that, that $a$ and $b$ commute. Some help would be greatly appreciated.


Why doesn't English have a separate word for "head hair"? (head hair vs. body hair)

The answer can be "Because it doesn't!" or "It wasn't needed!" in short but there might be a historical or linguistic explanation behind this. (Of course, every language might be lacking a word that another language has and you can give the meaning in a context.)  This question came up mainly because there are several languages which has separate words for head hair and body hair. For example, head hair is capelli in Italian, saç in Turkish, cheveu in French and kopfhaar in German. But in English, hair is like a hypernym for head hair and body hair.  When we check the , the origin is related to the German word haar. And interestingly, German language came up with kopfhaar which literally means headhair.     Old English hær "hair, a hair," from Proto-Germanic *khæran (cognates: Old Saxon, Old Norse, Old High German har, Old Frisian her, Dutch and German haar "hair"), perhaps from PIE *ghers- "to stand out, to bristle, rise to a point" (cognates: Lithuanian serys "bristle;" see horror).    When we dive into , we can see that there are structural differences between body hair and head hair but they are composed of the same substance, keratin. Though, there is a distinction in terminology:     Androgenic hair, colloquially body hair, is the terminal hair that develops on the human body during and after puberty. It is differentiated from the head hair and less visible vellus hair, which are much finer and lighter in color.   And a twist ending: Wiktionary has a definition (and even an etymology) for "":     From Middle English *heed-heer, from Old English hēafodhǣr (“hair of the head, headhair”), equivalent to head + hair. Cognate with Dutch hoofdhaar (“headhair”), German Haupthaar (“headhair”), Danish hovedhår (“headhair”), Swedish huvudhår (“headhair”).   I can see that "" is used in a few sources but it is not common. Personally I haven't encountered this word before I did this research.    How come both "hair" and "headhair" emerged (for the same meaning)? Why didn't "headhair" gain a common usage? What happened in the history? Does "headhair" have a current usage? (only in technical sources?)     Note: Just to emphasize, the question is not only about finding words, its about the history and origin of the words as well. Also, the question can be: "Why doesn't English have a common separate word for “head hair”? (head hair vs. body hair)"


Probability of a set permutation without matching contiguous pairs

Today for some reason I dreamed about this problem, but I dont remember reading it anywhere. I was curious to know if the problem has a name and what the solution is. I'm no mathematician so I hope I don't make many expression blunders. Given a random permutation of a set of n elements, Where each element has one, and exactly one matching element in the set different from itself. Find an expressión that calculates the probability of the set, for a given n, to not have any matching pairs contiguous to each other, and the probability of having exactly 1 matching pair contiguous. Do this assuming that the pair relations are not necessarily reciprocal, and again assuming that they are. Thanks in advance. Edit: Lets take for example the case in which the relations are never reciprocal. Using the alphabet, lets asume that each letter matches the next one, for a list of size n, and that the last one matches the first one (otherwise the last element wouldn't have a match, even if the previous element has this one as his matching element, because the relations are never reciprocal). This can be understood as some kind of love triangle, A likes B, B likes C and C likes A. I made a small program to check all combinations and the number of valid permutations by changing the size n, maybe this will make things a bit more clear: N = 2 | Valid combinations: 0 | Example: None | Combinations: 2 | Probability: 0.0% N = 3 | Valid combinations: 0 | Example: None | Combinations: 6 | Probability: 0.0% N = 4 | Valid combinations: 0 | Example: None | Combinations: 24 | Probability: 0.0% N = 5 | Valid combinations: 10 | Example: ECADB | Combinations: 120 | Probability: 8.3333% N = 6 | Valid combinations: 60 | Example: FDBECA | Combinations: 720 | Probability: 8.3333% N = 7 | Valid combinations: 462 | Example: GECFBDA | Combinations: 5040 | Probability: 9.1667% N = 8 | Valid combinations: 3920 | Example: HFDGCAEB | Combinations: 40320 | Probability: 9.7222% N = 9 | Valid combinations: 36954 | Example: IGEHFCADB | Combinations: 362880 | Probability: 10.1835% N = 10 | Valid combinations: 382740 | Example: JHFIGECADB | Combinations: 3628800 | Probability: 10.5473% N = 11 | Valid combinations: 4327510 | Example: KIGJHFDBECA | Combinations: 39916800 | Probability: 10.8413% It seems like the probability of a permutation with no contiguous matching non reciprocal pairs increases as the size increases, which makes sense (I wonder what the probability is for the size of 7 billion). This is not the same as this question  because in that question the new list has no matching elements in it, but in this one the list does have all, but ordered in such a way that they arent contiguous. The formula is not appliable. I did a search of the sequence generated by the permutations, and seems to be similar to the Hertzsprung problem, the specific OEIS sequence for this: .


I generated a series of local BLAST databases using makeblastdb of metagenomic data and am searching for the presence of a particular gene. While I can do the normal BLAST analysis looking at e-values, % identity, etc. I haven't been able to figure out how to determine how many times a given sequence exists in the database.  So: given a BLAST database of metagenomic data where a particular gene may exist multiple times, how do I determine the copy number of a given BLAST hit?  Thanks in advance.


How does the Mounted Combatant feat interact with Infernal War Machines?

The new Baldur's Gate - Descent into Avernus hardcover features a brand new mechanic: Infernal War Machines! A few things caught my eye - first off, that they have a stat block:     An infernal war machine's statistics function like those for creatures   Then, that their opportunity attack mechanics function a lot like those of mounts:     Infernal war machines provoke opportunity attacks as normal. When an infernal war machine provokes an opportunity attack, the attacker can target the vehicle or any creature riding on or inside if that doesn't have total cover and is within reach.   Also, that their driver can control their movement much like a mounter controls a (non-intelligent) mount's movement:     While the vehicle is moving, the driver can steer it along any course.   And that they can make the vehicle Dash/Disengage (in a similar but different manner that a mounter commands a mount to do so):     As a bonus action, the driver can do one of the following: […] Cause the infernal war machine to take the Dash or Disengage action while the vehicle's engine is running.   In summary, Infernal War Machines seem similar, in certain points at least, to mounts. What I'm wondering here is: how would a driver with the Mounted Combatant feat interact with these Machines? Would the feat's benefits work with the Machines or not?  Reminder on the Mounted Combatant feat:     You are a dangerous foe while mounted. While you are mounted and aren't incapacitated, you gain the following benefits:         You have advantage on melee attack rolls against any unmounted creature that is smaller than your mount. You can force an attack targeted at your mount to target you instead.   You can force an attack targeted at your mount to target you instead.   If your mount is subjected to an effect that allows it to make a Dexterity saving throw to take only half damage, it instead takes no damage if it succeeds on the saving throw, and only half damage if it fails.      From a thematic standpoint, I think it would make sense for a specialized "Helldriver", so to speak, to gain benefits from that feat while driving an Infernal War Machine, but actual-mechanics-wise, I am unsure.


How do I enable pgadmin4 (PostgreSQL12) to read and write files in directories of other Linux Users on RHEL8/CentOS8

While trying to export a query result set from PGAdmin4 on PostgreSQL12 to a CSV I am encountering the following error: ERROR:  could not open file "/home/linuxusername/Downloads/data.csv" for reading: Permission denied HINT:  COPY FROM instructs the PostgreSQL server process to read a file. You may want a client-side facility such as psql's \copy. SQL state: 42501  I'm somewhat new to PGAdmin but am familiar with Linux and SQL. Is there a configuration setting that I'm unaware of to allow PGAdmin to read and write to files and directories of Linux users? Using the /tmp works fine, but it's a pain to have to keep moving files to and from other directories and it's seriously cramping my work flow and slowing me down. Any help is much appreciated.


trying to understand multiplication + reduction in binary finite fields

The wikipedia.org article on  provides an example of multiplying $83$ and $206$ in $\mathbb{F}_{2^8}$ with $x^8+x^4+x^3+x+1$ as the reducing polynomial (in fact it is the reducing polynomial for AES). Quoting it:  Multiplying $83$ and $206$, whilst ignoring the carries, yields $16,254$ or (in binary) 11111101111110.  The reducing polynomial is then converted to binary (100011011), shifted forward to match the length of the number being reduced (eg. multiplied by a power of two) and then XOR'd (subtracted) against the number to be reduced. It seems like it's supposed to do this until the number being reduced is less than the reducing polynomial (in binary).  Here's the example wikipedia gives:        11111101111110 (mod) 100011011      ^100011011             1110000011110       ^100011011             110110101110        ^100011011             10101110110         ^100011011             0100011010           ^100011011              00000001   My question is...  why is the last XOR done? 0100011010 is less than 100011011..


I would like to know math websites, that are useful for students, PhD students and researchers (useful in the sense most of the students or researchers -of a particular area- are using it). Maybe you can share which math websites you sometime use and why you use it. Let me give my websites and why I use them: MathOverflow and StackExchange: Very good to look up questions about how to do mathematics, what mathematics is, how it evolves, and of course to have an exchange with smart people, who can help you if you stuck at something. arXiv: I don't use it now, but I think that's the main website to read papers and to publish (research level) The Stacks Project: It is very useful for me to loop algebraic things ups with more explanation as in some lectures... MathSciNet: To search for papers, that may help you. Number Theory Web: Since I want to become a number theorist, this site helps me to see which kind of things exist. Have you more websites, that help you to understand maybe mathematics, or just to connect to other mathematicians? Everything is welcome, just post it as an answer and not a comment. Thank you in advance!!


I'm trying to move a site and I'm really baffled with the problems I'm having trying to sort out the encoding issues with the database.  The database on new server is using utf8 and all tables imported have utf8. Checking the exported sql file with 'file db.sql' it also says: UTF-8 Unicode text as well as it has it defined in the sql queries in the sql file.  in php.ini I've set default_charset = "UTF-8" and apache.conf I've set AddDefaultCharset UTF-8 as well have I added to the sites-enabled (regular and https) in Apache:    AddDefaultCharset UTF-8   In the HTML/PHP document header I have:    <meta http-equiv="content-type" content="text/html; charset=UTF-8">   I've checked the PHP documents served by the new web server with 'file' and these as well are: HTML document, UTF-8 Unicode text  Besides all of this, encoding is not correct neither in the mysql client nor when served via the web server. For example, ö becomes Ã¶, å becomes Ã¥ and ä becomes Ã¤. utf8_decode in PHP does display the text properly so it seems to be correct encoding at least?  If someone can give me a hint to where I might have gone wrong it would be greatly appreciated. I'm completely clueless. To me it all seems to have been set to UTF-8 yet these issues persist.  EDIT/add: Response headers when fetching a document from the new server also says: Content-Type    text/html; charset=UTF-8  EDIT 2: Stackoverflow suggests that this has already been solved, but I do not find a solution that works from the link provided.


Draft watermark image just in a \section

Is it possible to have a draft watermark only in a \section?  EDIT:  I have in a document more then one \section, and I need the draftwatermark just in some \section. Unfortunately the section with and without the draftwatermark share the page. For example I want the draftwatermark under the text of just one of these sections A,B,C  \documentclass{article}  \usepackage{kantlipsum} % supply mock text  \begin{document}  \section{A}  \kant[2]  \section{B}  \kant[2-4]  \section{C}  \kant[2]  \end{document}


Error when displaying page in PDF viewer or Printing

I try to print a PDF which includes some TIKZ figures but the printing service has an issue to print them.  To find the cullprit we try to reduce our template to a minimum and found an problem with TIKZ shadows and the svg package.  We are not able to reproduce the error and the printing service has Acrobot Pro 9, which only complains when printing is started. It shows an error page content can not be shown.  So to get hold of the problem we found out that watching the files with an old adobe 8.3 reader does not render the files and show only a blank page.   following a MWE  \pdfminorversion=3 \documentclass[ border=5pt ]{standalone}  \usepackage{pgfplots} \pgfplotsset{compat=newest}  \usetikzlibrary{shadows}  % removing svg solves the problem \usepackage{svg}  \begin{document}%  \tikzstyle{abstract}=[ fill=black!15!white,  drop shadow, ]      \begin{tikzpicture}[node distance=1cm, auto]%     \node[abstract](iasPortObj){\textbf{MinimaTestObject}};%     \end{tikzpicture}% \end{document}%   Also enforcing pdf version 1.3 does not help.  When removing the svg packet the page also shows in acrobat 8.3.  When removing shadows it also works when svg is loaded.  It seems there is a issue with tikz produced figures and svg packet.     The problem is that all our PDF viewer show the PDF properly. We can print it on our printer.  The error is issued when the print service try to print this PDF.  We have this issue with multiple pdf.   Converting them with ghostscript solved the problem for some of them, but not all.  gs -dSAFER -dBATCH -dNOPAUSE  -sDEVICE=pdfwrite -sOutputFile=out.pdf in.pdf   1.) Is this a known incompatibility of svg and TKIZ or shadows?  2.) We search a proper way to ensure a finelizing process which garantees that the printing service will have no problem and the printed version looks like we see it.  Thanks in advance


SQL Server: Join all tables from a table listing their names

I have a table that contains a list of metrics and their IDs in the format:  L6Metrics | ID   | Name            | -------------------------- | 734  | L6A_Velocity    | | 736  | L6B_Velocity    | | 738  | L6A_Target_Rate | ...   Each of these metrics has its own corresponding table containing timestamped historical data. If the metric has ID X, then its historical data's table name is History_tX. These history tables have the format:  History_t734 | DateTime                       | Value | ----------------------------------------- | 2018-05-04 19:17:41.972 -05:00 | 33.9  | | 2018-05-04 19:17:51.972 -05:00 | 36.3  | | 2018-05-04 19:18:01.972 -05:00 | 35.1  | ...   Assuming that the timestamps across all of the history tables align, how can I use the L6Metrics table to join all of the history tables on DateTime to get the following:  | DateTime                       | History_t734 | History_t736 | ... ----------------------------------------------------------------  | 2018-05-04 19:17:41.972 -05:00 | 33.9         | 34.9         | | 2018-05-04 19:17:51.972 -05:00 | 36.3         | 37.4         | | 2018-05-04 19:18:01.972 -05:00 | 35.1         | 36.5         | ...   There are 75 rows in L6Metrics (representing 75 history tables) so there would be 76 columns in my result. I have the ability to modify L6Metrics if needed.


Is there a software to LaTeX a hand written equation?

Typing equations in LaTeX takes time and I was wondering if there is a software that converts a handwritten equation (on a tablet or a scanned paper) into typed equation in LaTeX  Does such a software exist?


Strange Text After Passing Suggested Edit Audit

Not entirely sure what's happening here but it definitely looks wrong:    The message popped up at the same time as the Congratulations message.     Our system has identified this edit as possible spam; please review carefully   It doesn't show up if you load up  now so possibly this is no-repro or possibly it only happens when you initially pass a review, or perhaps most likely it's always done it and I'm missing the point entirely. In any case if it is a bug it is certainly minor.  Using Safari 7.0.1 Mac OS X.


I am having Samsung Galaxy S3 I9300XXELLA (O.s JB 4.1.2). Its update not available throught phone. So can I manually download JB 4.3 of I9300XXU. will it work or my phone with I9300XXELLA.


Evaluate following limit: $\lim_{x \to 0}\frac{\sin x}{x}$

I am asked to solve following limit problem:     $\lim_{x \to 0}\frac{\sin x}{x}$   It is pretty straightforward using :  Since $$ \lim_{x \to 0}\frac{\sin x}{x} = \frac{0}{0}$$ Then we take derivative of the numerator and denominator, getting: $$ \lim_{x \to 0}\frac{\cos x}{1} =1$$  However, I would like to know whether there is a way to solve the limit problem above without L'Hôpital's rule. Is there?


while I have no errors in the Text, I get a few warnings, from which most are similar: LaTeX Warning: You have requested package 'moderncvheadii', but the package provides 'moderncvheadii'. To me this warning seems rather weird...  Here a short section:  \documentclass[12pt,a4paper]{moderncv} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage[ngerman]{babel} \usepackage[scale=0.8]{geometry} \usepackage{graphicx} \moderncvtheme[blue]{casual}    The rest of the script is simple and repetitive (section, subsection, cvline).  PS: I use TeXnicCenter if that might be useful.


How to prove that every regular ordinal is a cardinal?

I know that an ordinal is regular if its equal to is cofinality, but how is that related to cardinal?


Creating a list of lists containing specific values of a list in python

I Have a list A: A=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]  I want to code a function that will return a list of lists B: B=[[4,5,6],[10,11,12],[16,17,18]]  I tried this: def listing():     A=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]     ans= [A[i:len(A)] for i in range(0, len(A), 3)]     return ans     But it gives me a very long and incorrect output, how could I fix this?


I have a simple visualforce page that is meant to give a location for admins to disable a trigger and schedule a batch. I have not been able to get any test coverage when I run the test. I've ran the same tests in a developer org as part of a package and got 100% coverage. I added it to another orgs sandbox to push it up to production, and when I run the test I don't even get a response that a test has been ran. Any ideas what is missing?  Controller  public class CMRulesController {  public CM_Rule_Settings__c sett {get; set;}   public CM_Rule_Triggers__c settTrig {get; set;}    public CMRulesController(){     this.sett = CM_Rule_Settings__c.getOrgDefaults();     this.settTrig = CM_Rule_Triggers__c.getOrgDefaults(); }  public PageReference saveSett() {     //update sett;     CM_Rule_Settings__c settOld = CM_Rule_Settings__c.getOrgDefaults();      upsert sett;     // upsert settTrig;     return Page.CMRulesSettings; }  // schedules hourly batch job for CM Rules public void scheduleCMRules(){     CMRuleBatch batchable = new CMRuleBatch();     String CRONSTRING = '0 0 * * * ?';     System.schedule('CM RULE BATCH_'+System.today(), CRONSTRING ,batchable);  }     }   Test Class  @isTest public with sharing class TestCMRulesController {  public static testMethod void settingsTest(){      CM_Rule_Triggers__c settTrig = new CM_Rule_Triggers__c();     settTrig.name = 'Trigger Setting';     settTrig.Enable_Email_Summary_Rollups__c = TRUE;     insert settTrig;      CM_Rule_Settings__c sett = new CM_Rule_Settings__c();     sett.Name = 'CM Rule Configuration';     sett.Batch_Size__c = 35;     sett.Last_Run_Batch_Date_Time__c = datetime.parse('10/6/2019 12:00 AM');     insert sett;      CMRulesController cmr = new CMRulesController();        test.startTest();     cmr.SaveSett();     cmr.scheduleCMRules();      List<CM_Rule_Settings__c> t = CM_Rule_Settings__c.getAll().values();     boolean bSize = null;     if(t[0].Batch_Size__c == 35){         bSize = true;     }     system.assertEquals(bSize, True);      test.stopTest();  }     }


Download a file from System.Io.Stream class C# asp.net

I am trying to download a file from my onedrive using the microsoft graph api. I have managed to get to the point where i can retrieve the item from the GraphServiceClient. However, once i get the file using /me/Drive/Items/{itemid}/Content it returns to me a System.IO.Stream object.  How do i use this System.IO.Stream object to download the file?  Here is the code i have now for getting the file (for security purposes i did not put the itemid in the sample code, but i can assure you it is correct.) :  public async Task<ActionResult> OneDriveDownload() {     string token = await GetAccessToken();     if (string.IsNullOrEmpty(token))     {         // If there's no token in the session, redirect to Home         return Redirect("/");     }      GraphServiceClient client = new GraphServiceClient(         new DelegateAuthenticationProvider(             (requestMessage) =>             {                 requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);                  return Task.FromResult(0);             }));      try     {         var stream = await client.Me.Drive.Items[ItemID].Content.Request().GetAsync();         return View(stream);     }     catch (ServiceException ex)     {         return RedirectToAction("Error", "Home", new { message = "ERROR retrieving messages", debug = ex.Message });     } }   Additionally, i would like to create a button that can execute this download in the view.


A weird bug was occurring in production which I was asked to look into. The issue was tracked down to a couple of variables being declared within a For loop and not being initialized on each iteration. An assumption had been made that due to the scope of their declaration they would be "reset" on each iteration. Could someone explain why they would not be)? (My first question, really looking forward to the responses.) The example below is obviously not the code in question but reflects the scenario:  Please excuse the code example, it looks fine in the editor preview?? for (int i =0; i< 10; i++) {     decimal? testDecimal;     string testString;      switch( i % 2  )     {         case 0:         testDecimal = i / ( decimal ).32;         testString = i.ToString();             break;         default:             testDecimal = null;             testString = null;             break;     }      Console.WriteLine( "Loop {0}: testDecimal={1} - testString={2}", i, testDecimal , testString ); }   EDIT: Sorry, had to rush out for child care issue. The issue was that the prod code had was that the switch statement was huge and in some "case"'s a check on a class' property was being made, like if (myObject.Prop != null) then testString = myObject.Stringval... At the end of the switch, (outside) a check on testString == null was being made but it was holding the value from the last iteration,hence not being null as the coder assumed with the variable being declared within the loop. Sorry if my question and example was a bit off, I got the phone call about the day care as I was banging it together. I should have mentioned I compared IL from both variables in and out the loop. So, is the common opinion that "obviously the variables would not be reinitialized on each loop"? A little more info, the variables WHERE being initialized on each iteration until someone got over enthusiastic with ReSharper pointing out "the value is never used" and removed them.  EDIT: Folks, I thank you all. As my first post I see how much clearer I should be in the future. The cause of our unexpected variable assignment can me placed on an inexperienced developer doing everything ReSharper told him and not running any unit tests after he ran a "Code Cleanup" on an entire solution. Looking at the history of this module in VSS I see variables Where declared outside of the loop and where initialized on each iteration. The person in question wanted his ReSharper to show "all green" so "moved his variables closer to assignment" then "Removed redundant assignment"! I don't think he will be doing it again...now to spend the weekend running all the unit tests he missed! How to do mark a question as answered?


Let $\emptyset = A \subset \mathbb R $ where A is bounded above, and A has a supremum that is not contained in A. Prove the existence of an $(x_n)_{n\in\mathbb N}$ in A such that $\lim_{n->\infty}$ $x_n = supA$.  I'm guessing we can construct an example with the information given. I have been playing around with the idea the that we can order A such that $a_i \leq a_j$ for all $i \leq j$ and define $(x_n)_{n\in\mathbb N}$ such that $x_l = a_l$ for all $l \in \mathbb N$. Hence $x_i\leq x_j$.  I also believe, the actual definition of the limit will have to come in, but here I do not know how to continue.  Any help is appreciated.


How did the house elves start serving wizards?

How/Why/When did the house elves start serving wizards? I tried on my own to find the answer but I couldn't find anything relevant to my subject but I am bad at searching.


I have created the Bottom sheet dialogue model and its getting crash only in Oreo devices. Hereby I attached my code along with log error which throwing only in Oreo oriented devices. Kindly suggest some possible solutions solve this problem.   private void socialBottomMenu() {     // TODO Auto-generated method stub      sheet = new BottomSheet.Builder(Mica.this).sheet(             R.menu.create_account_bottom_sheet).show();      menu = sheet.getMenu();       for (int i = 0; i < menu.size(); i++) {         MenuItem item = menu.getItem(i);         SpannableString s = new SpannableString(item.getTitle());         s.setSpan(                 new ForegroundColorSpan(getResources().getColor(                         R.color.poptextcolor)), 0, s.length(), 0);         item.setTitle(s);     }     menu.getItem(0).setOnMenuItemClickListener(             new MenuItem.OnMenuItemClickListener() {                  @Override                 public boolean onMenuItemClick(MenuItem item) {                     // TODO Auto-generated method stub                       return true;                 }             });     menu.getItem(1).setOnMenuItemClickListener(             new MenuItem.OnMenuItemClickListener() {                  @Override                 public boolean onMenuItemClick(MenuItem item) {                     // TODO Auto-generated method stub                      return true;                 }             }); }   //Log error directed me here ActionMenuItem.java      @Override  public MenuItem setNumericShortcut(char numericChar, int numericModifiers) {       return null;  }   //Log error  java.lang.NullPointerException: Attempt to invoke interface method 'android.view.MenuItem android.view.MenuItem.setNumericShortcut(char, int)' on a null object reference     at android.view.MenuInflater$MenuState.setItem(MenuInflater.java:477)     at android.view.MenuInflater$MenuState.addItem(MenuInflater.java:541)     at android.view.MenuInflater.parseMenu(MenuInflater.java:193)     at android.view.MenuInflater.inflate(MenuInflater.java:114)     at com.paytronix.client.android.app.bottomsheet.BottomSheet$Builder.sheet(BottomSheet.java:704)


Plotting polyline trail using slope raster with least change in slope and ArcMap

How do I plot a trail in ArcMap so that it runs from point A to point B? This is part of a larger model I am working on that takes various variables into account and creates a cost layer that I then can use to run a cost path analysis to determine the "cheapest" path between 2 points. Up until now, slope hasn't been too important. I am just now working with slope in the model, and I am trying to think of a method that would create a preference map of sorts to influence the trail to be plotted perpendicular to the slope. It is fine if the trail has a change in elevation, as that is pretty typical, but I want the slope to influence the trail and cause the generated trail to more closely conform to be perpendicular to the slope.


Where can I find cpu temperature and frequency without any specific command?

I want to make a shell script that runs as a daemon process and every X minutes read the temperature of every cpu core to report it later with GNU plot. And here is my question, Is there  any file in /sys or /proc or any other location which this info be uniformly placed across several UNIX systems (not only in Linux)?  If not, tell me at least, where can I find these files in Linux.


After installing Ubuntu 16.04 LTS, I found that gcc 5.3 installed by default but I don't receive any updates to gcc. I opened up  and I found the new release 6.1. How do I update?  Output of gcc --version:  gcc (Ubuntu 5.3.1-14ubuntu2.1) 5.3.1 20160413 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Show that the number of spanning trees of the complete graph $K_n$ is $n^{n−2}$

Let's suppose that $n$ is a natural number representing the number of vertices in a graph. How would we show that the number of spanning trees of the complete graph $K_n$ is $n^{n−2}$? I tested out a few values on $n$ and it makes sense logically, but how would we prove this?


Good gray font: Do metafont proofs have to look this bad?

The old gray seen in  has ... issues.  shrink factor 8:   shrink factor 9:   So, even when using shrink factor 8, which given the 4x4 pixel pattern used for pixels in grayf.mf seems like it should put 2x2 proof pixels on one display pixel, something goes wrong and we get rows of missing pixels, and when we use an unrelated shrink factor we get something much worse :-(  What gray font / xdvi flags should I use to get my metafont proofs to render correctly?


Distribution of number of Bernoulli trials before some large number of sucess

We repeatedly make an experiment where we count the number $n$ of Bernoulli trials of known probability $p$, until some number of successes $s$ is reached. I'm willing to restrict to $p<0.01$ and $s>100$.  I want the distribution of $n$; or just its variance, for I'm confident the distribution is close enough to a Gaussian of mean $s/p$.  Up to the last moment before hitting post I hoped the answer would emerge from memory, reasoning, web search, or a reference, but..    I get that the distribution of the number of success after some fixed number $m$ of trials (not directly what I want) follows a Binomial distribution of parameters $m$ and $p$, which can be approximated by a Poisson distribution with $\lambda=m\cdot p$; and because $\lambda$ is large (about $s$), another valid approximation in the region of practical interest is a Gaussian distribution of mean $m\cdot p$ and standard deviation $m\cdot p(1-p)$. But I fail to progress from there.


Importing OpenStreetMap data in ArcGIS for Desktop?

It is possible to import data in QGIS but ArcGIS has more features and easy to use, so is there any way to import OSM data and we can use ArcGIS tools for analysis and database creation?


Label legend interval with number of elements in ArcMap?

I have made a series of  in ArcMap 10. When I classify the interval the bottom of the dialogue tells how many elements are in the class.  Is it possible to have this number automatically places beside my class labels?


What is the benefit of leveling up the dwellers?  It doesn't seem to give any benefit, in fact it is detrimental as higher level dwellers cost more caps to revive.  The only reason I can see to level up a dweller, is so that you can select and drag them around.


How to remove jQuery from render blocking resources?

Is there any possibility to remove jquery.js and jquery-migrate.min.js scripts from render blocking resources? I see this error only on mobile, not on desktop. Scores in Google Page Speed Insights are hight, I know that is unnecessary but if there is any way I want to try...


zeroes of non-zero holomorphic function form an atmost countable set

One of my assignment questions which I could not solve was following.  Question : If f is a holomorphic function on a region X which is not identically zero show that the zeroes of the function form an atmost countable set .  I was confused while solving the question . So I search MSE and found this solution :  Answer of User : Daniel Roberts says:"If the set {z∈U|f(z)=0} were uncountable, then it would have an accumulation point "  My question: Why any uncountable set must have a limit point ? Can anyone please give a rigorious proof.


Something bugged me about that icon every time I saw it and I know why now.  The falling stack (excluding the one piece neatly placed in the box) is off to the left by 1 px.  Seems to be stretched slightly too.  Compared to the meta stackoverflow icon, you can clearly see the misalignment.  Observe the gif below.


"How many ways are there to arrange the letters in the word 'MISSISSIPPI' in such     a way that there are no three consonants in a row?"  I am thinking like this. The following are 'slots' for the letters of our word: _ _ _ _ _ _ _ _ _ _ _.  There are 21 consonants in total (English). The first slot as 21 possibilities, the second also has 21, but the third has only 5 possibilities. So how many ways can I place vowels within this word... I don't know.  I can try to enumerate all of the place the I's can go, but there has to be a better way than doing that.


Finding all homomorphisms between $\mathbb{Z}/m\mathbb{Z}$ and $\mathbb{Z}/n\mathbb{Z}$

I want to find all group homomorphisms $\varphi: \mathbb{Z}/ m \mathbb{Z} \to \mathbb{Z}/n\mathbb{Z}$, with $m$ and $n$ natural numbers.  Clearly $\varphi(0)=0$ since the identity in $\mathbb{Z}/m\mathbb{Z}$ must map to the identity in $\mathbb{Z}/n\mathbb{Z}$, and it follows that $m \varphi(1)=0$, so is $mx \equiv 0 \bmod n$?  This as far as I get. How can I find all the homomorphisms?


How to remove elements from a HashMap without getting ConcurrentModificationException

I am comparing every entry in a HashMap to every other entry in the same HashMap. While iterating the HashMap I remove some elements based on some conditions. However I keep getting the ConcurrentModificationException.      Iterator<Entry<String, String>> i = map.entrySet().iterator();      while (i.hasNext()) {         Entry<String, String> next = i.next();          for (Entry<String,String> e : map.entrySet()) {              if (e.getKey() != next.getKey()){                                String[] positions_e = fields_e[1].split("-");               int start_e = Integer.parseInt(positions_e[0]);               int end_e =  Integer.parseInt(positions_e[1]);                String[] positions_next = fields_next[1].split("-");               int start_next = Integer.parseInt(positions_next[0]);               int end_next =  Integer.parseInt(positions_next[1]);              if (start_e <= start_next || end_e <= end_next )) {                   i.remove();                    }          }     }


Ssh keeps asking for passphrase several times

I have a remote machine, with which I have set up public-key ssh auth - that is, I can ssh to it without typing in password each time. And I have a set of actions in a script, which use that ssh connection.  But when I run that script via cron, it keeps asking passphrase for each action - and since I have more that ten of them, it gets quite boring.  I tried running ssh-add before those actions and got:  Could not open a connection to your authentication agent.   What can I do to reduce number of passphrase retypes?


First time user getting "This looks like spam" when trying to post

I tried posting my question here (which I thought was the correct place to post false positives for spam) but it tells me that it looks like spam here too.   EDIT After posting the above simple post, I was able to post my entire post below. Should this be how I post my original question?   I tried editing my question and remove links to some of my research outside the stack overflow site, but I still get error. It's gotten to the point of removing useful information to try to make my post shorter.      Question Title: If I change my MX records to point to Google Apps, will my email start going to my existing gmail account?       Body: I currently forward my business e-mail to my gmail account (I send and receive business e-mail under my business e-mail, but from within gmail). I also use the gmail address itself for personal use. I like having all my e-mail in one gmail account (aka I don't really want to have two separate gmail accounts). I would like to switch my current business email to a google apps account.       Over the years I have deleted a lot of email off my business email server (it's hosted by 1and1) because the 10-20mb attachments I receive from my customers adds up to the 2gb limit quite quickly. All that email is stored in my gmail account and it is very useful to have around (I dig up stuff from 3+ years ago for reference from time to time).       My question is: If I change my domain MX record per the Google Apps instructions () will my email just magically start going to my existing gmail account? Will no migration be necessary since I already forward all my email to my existing gmail account? While I do have other accounts at the same domain name (one for each of my two employees) they are not heavily used and they can suffer a little bit of interrupted service, but I'd like my email to continue flowing as well as possible during the migration.       I have a searched around a bit but I'm having particular trouble phrasing this search (which I assume is a very very common case) and getting good results. 5+ years of finding awesome answers on stack overflow and I've never had to ask a question because I've been able to find the answer. If this question has been answered before, I'd love to know how it was found (to improve my google-fu). One search phrase used was 'migrating from "forwarding to gmail" to "google apps for business"'.      Here's what I've found related (and why it doesn't quite answer my question):        (forwarding gmail account to a business account)       (this question seems quite related but it seems that they were using gmail in the first place, and not forwarding to gmail from a third party provider. I suppose they are also changing email addresses from user@gmail.com to user@company.com and creating entirely new gmail accounts).


I have modeled a sled and now I want to animate it going down from mountain, so is there any way to make sled stick to terrain and then animate it going down the mountain?


Where is the mistake in the following rationament

Well... kind of hard to translate in English so bare with me :).  Let's consider a wheel that spins in the void. Each point of the wheel has the speed $v = ω r$.  That means that for any $ω$, there is an $r$ sufficiently big that $c = ω r_c$. That would mean that for an $r > r_c$, the speed of the point would be higher than $c$.  But we also know that c is limit. So... where is the mistake?  I'm presuming that it has something to do with the "limit" between classic mechanic approach and relativistic approach.


How does QFT interpret the Negative probability problem of the real scalar fields' Klein-Gordon equation?

I am totally a beginner in QFT, here's the problem that I got: for the real scalar fields, are there any elementary particles descriped by them. If so, how to understand the negative probability problem?


If $f$ is a nonconstant entire function such that $|f(z)|\geq M|z|^n$ for $|z|\geq R$, then $f$ is a polynomial of degree atleast $n$.

I have a question in my assignment :     If $f$ is a nonconstant entire function such that $|f(z)|\geq M|z|^n$   for $|z|\geq R$ for some $n\in\mathbb N$ and some $M$ and $R$ in   $(0,\infty)$ show that $f$ is a polynomial of degree atleast $n$.   Now , I defined a function    $\ g(z) = \frac {1}{f(z)}\ $ such that $\ |g(z)| \le \frac{1}{M{|z|}^n}.$  Now , by using the cauchy inequality  $$|g^{(n)}(z)| \le  \frac{n!}{R^n |z|^nM}.$$    Considering that $ g(z) $ is an analytic function , it has a radius of convergence $ \infty $  $ \implies\  g^{(n)}(z) = 0.$    But if we go by this approach , then $ g^{(n)}(z) = 0 \ $ for any n . Also how can we be so sure that $ f(z) \neq 0 $ for any z ?  Is my reasoning correct or is there some other way to solve it ?


Are there any downsides to starting a domain name with a digit?

In response to ,  said:     Something about having a domain name begin with a digit just feels ... off  to me.    Does it affect site ranks on search engines?  Do you think people will be less likely to visit it? Is this just a programmer response, since most variable names can't start with a digit?


It seems to be forbidden (based on a meta question) but I don't see that in the Help. If it is, why?   Can this feature be added?


I'm using a PDF reader, iAnnotate, that allows one to search a document using java.util.regex.Pattern regexps.  Unfortunately, iAnnotate ignores case in all searches.  This happens even if you use an expression like [A] (it also finds "a"), and even if you specify the character in unicode (\u0041 means "A", but iAnnotate also finds "a").  Java regexps are not designed to ignore case by default, and I don't see any way to use them to override ignore-case behavior in the , but maybe there's something I'm not thinking of.  Any suggestions for possible regexp tricks to force a regexp to be interpreted with a specific case?  I know that this is strictly speaking an iAnnotate question, but I am interested in possible Pattern regexp solutions.


How do you clone a Git repository into a specific folder?

Executing the command git clone git@github.com:whatever creates a directory in my current folder named whatever, and drops the contents of the Git repository into that folder:  /httpdocs/whatever/public   My problem is that I need the contents of the Git repository cloned into my current directory so that they appear in the proper location for the web server:  /httpdocs/public   I know how to move the files after I've cloned the repository, but this seems to break Git, and I'd like to be able to update just by calling git pull. How can I do this?


Can't use "userspace" cpufreq governor and set cpu frequency

I'm trying to change the cpu frequency on my laptop (running Linux), and not having any success. Here are some details:    # uname -a Linux yoga 3.12.21-gentoo-r1 #4 SMP Thu Jul 10 17:32:31 HKT 2014 x86_64 Intel(R) Core(TM) i5-3317U CPU @ 1.70GHz GenuineIntel GNU/Linux  # cpufreq-info cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009 Report errors and bugs to cpufreq@vger.kernel.org, please. analyzing CPU 0:   driver: intel_pstate   CPUs which run at the same hardware frequency: 0   CPUs which need to have their frequency coordinated by software: 0   maximum transition latency: 0.97 ms.   hardware limits: 800 MHz - 2.60 GHz   available cpufreq governors: performance, powersave   current policy: frequency should be within 800 MHz and 2.60 GHz.                   The governor "powersave" may decide which speed to use                   within this range.   current CPU frequency is 2.42 GHz (asserted by call to hardware). (similar information for cpus 1, 2 and 3)  # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors performance powersave   I initially had the userspace governor built into the kernel, but then I also tried building it as a module (with the same results); it was loaded while running the above commands (and I couldn't find any system messages when loading it):  # lsmod Module                  Size  Used by cpufreq_userspace       1525  0 (some other modules)   And here are the commands I tried for changing the frequency:  # cpufreq-set -f 800MHz Error setting new values. Common errors: - Do you have proper administration rights? (super-user?) - Is the governor you requested available and modprobed? - Trying to set an invalid policy? - Trying to set a specific frequency, but userspace governor is not available,    for example because of hardware which cannot be set to a specific frequency    or because the userspace governor isn't loaded?  # cpufreq-set -g userspace   Error setting new values. Common errors: - Do you have proper administration rights? (super-user?) - Is the governor you requested available and modprobed? - Trying to set an invalid policy? - Trying to set a specific frequency, but userspace governor is not available,    for example because of hardware which cannot be set to a specific frequency    or because the userspace governor isn't loaded?   Any ideas?


If $A$ is idempotent, then the eigenvalues of $A$ are $0$ or $1$

If $A$ is idempotent (defined by $AA=A$) then the eigenvalues of $A$ are $0$ or $1$.   Proof: $$Ax = \lambda x$$ $$\Rightarrow Ax = AAx = \lambda Ax = \lambda^{2}x.$$  Then in the lecture notes, it says that the above implies that $\lambda^{2} = \lambda$ which implies $\lambda = 0$ or $\lambda = 1$.   I don't quite follow how it is deduced that $\lambda^{2} = \lambda$ from the above calculations.


When to use a linked list over an array/array list?

I use a lot of lists and arrays but I have yet to come across a scenario in which the array list couldn't be used just as easily as, if not easier than, the linked list.  I was hoping someone could give me some examples of when the linked list is notably better.


Failing to restart my laptop after installing Ubuntu 18.04.2 LTS and "bug: soft lockup" appears

I have installed Ubuntu 18.04.2 LTS on my laptop Asus Vivobook s15, 8gb ram,i5-8256U CPU,256 Gb SSD.  After installation, this shows up:    I am new to using Ubuntu and I don't know what this means. Does anyone know what this means and how to solve it?   I tried powering off manually and then starting my laptop once again. But my booting screen freezes. Does this have anything to do with this image?


A detailed solution will be helpful. Given that $a_1=3$ and $a_{n+1}=3^{a_n}$, find the remainder when $a_{2004}$ is divided by 100.


Partial match of first file content from another and write in third file

Given file 1...  2/26a- 6 23/26a- 20z 23/26A-18   and file 2...  2/26a-6 23/26a- 20Z 23/26A-18 25/2a -18 22/34B-19   How can I search file 2 for the contents of file 1 ? Here the output should be:  2/26a-6 23/26a- 20Z 23/26A-18   (So not an exact match, but there is some shared content). Matching should be case-insensitive.


Currently when I execute the date command from bash I get the following displayed  Thu May 17 12:21:00 IST 2012  Below is my timezone config based on executing dpkg-reconfigure tzdata     Current default time zone: 'Europe/Dublin'   Local time is now: Thu May 17 12:32:52 IST 2012.   Universal Time is now: Thu May 17 11:32:52 UTC 2012.     Any idea how I change from IST to UTC/GMT?


I'm in trouble adding a different PATH. When I add it like that :  export PATH=$PATH:/opt/file/base/bin/linux-x86_64   It works fine for the current terminal. But when I close it and open again, it doesn't work.Each time I want to use commands in that directory,I have to export PATH.  Is there any way to do that ? I don't want to export it each time.  Thanks in advance.. Best Regards..


i am building a program as a cpu process handler and each process have doubles value there are no static methods or variables in process class and bursttime is randomly generated, the method i have is to compute the waiting time as a double counter, from an array of processes i add each process as an object to arraylist to add them to jtable but it gives me a null pointer exception in   process1[0].setWaitingtime(waittimecounter + process1[0].getWaitingtime());   why is this happening can any one give me a solution to try? thank you  this is my code   public class start extends javax.swing.JFrame {      public int processnumber = 100;     //public int processnumber = 100;     public int degree = 20;     public int contextswitch = 2;     public int timecountom = 10;      /**      * Creates new form start      */     public start() {         initComponents();         addRowToJTable();     }      public ArrayList listprocess() {         ArrayList<process> list = new ArrayList<process>();         process[] p = new process[processnumber];         fcfs(p);         for (int i = 0; i < processnumber; i++) {             list.add(p[i]);         }         return list;     }      public void addRowToJTable() {         DefaultTableModel model = (DefaultTableModel) jTable1.getModel();         ArrayList<process> list = listprocess();          Object rowData[] = new Object[4];         for (int i = 0; i < list.size(); i++) {             rowData[0] = i;             rowData[1] = list.get(i).getBursttime();             rowData[2] = list.get(i).getWaitingtime();             rowData[3] = list.get(i).getTurnaroundtime();             model.addRow(rowData);         }     }      public void fcfs(process[] proces) {         double turnaroundtimecounter = 0;         double waittimecounter = 0;         double turnaroundcounter = 0;         int index = degree - 1;         double avgwaitingtime = 0;         double avgturnaroundtime = 0;         process[] process1 = new process[degree];         for (int i = 0; i < degree; i++) {             process1[i] = proces[i];         }         //for(int j=0;j<processnumber;j++)         for (int i = 0; i < processnumber; i++) {             process1[0].setWaitingtime(waittimecounter + process1[0].getWaitingtime());             turnaroundcounter = process1[0].getBursttime() + turnaroundcounter;             process1[0].setTurnaroundtime(turnaroundcounter);             waittimecounter = process1[0].getBursttime() + waittimecounter;             proces[i] = process1[0];             for (int f = 0; f < degree; f++) {                 process1[f] = process1[f + 1];             }             if (index < 100) {                 process1[19] = process1[index];                 process1[19].setWaitingtime(-waittimecounter);                 index++;             }         }         avgwaitingtime = waittimecounter / processnumber;         avgturnaroundtime = turnaroundcounter / processnumber;     }


95% of my RAM is being used (Windows 10)

I'm on an HP Envy m7, with 16GB of RAM.  I recently did a clean install of Windows 10 on this computer. But for the past month, i've noticed that when Idle, the system uses way too much RAM.  I have checked for both malware and rootkits (MalwareBytes, Bitdefender, Avast, Kaspersky (for rootkits), and none have been found.  When I checked the processes on Task Manager, the used memory simply doesn't add up.  I then used RamMap to determine it.      While RamMap shows that the vast majority of my RAM is being used for Process Private and Page Table, I am still at a loss. When I check the processes tab on RamMap and check the Private Tab, the Usage still doesn't add up to the 15GB being used on my system.  Can anyone help diagnose this issue? Could this be a memory leak in some software? I am running out of options here.


I accidentially deleted apt on my Ubuntu. How can I reinstall it somehow or do I need to reinstall the whole system?  I tried   sudo apt install apt [sudo] password for jaakko:  sudo: apt: command not found (base) jaakko@jaakko-GL553VW:~/Downloads$


In what episode of TNG was an ancient Vulcan psionic weapon discovered? If I recall correctly, the device had 3 parts: life, death and balance in between. It worked only against aggression (to the best of my recollection).


Why is there no implicit conversion when using FORMAT vs CAST/Convert in CONCAT

When we have the following table: CREATE TABLE Test1 (     Name NVARCHAR(50) NOT NULL     , Code SMALLINT NOT NULL )  With only 1 row for demo purpose: INSERT INTO Test1(Name, Code)  VALUES ( 'ABC', 1)  And the following queries: SELECT CONCAT(Name, ' - ', Code) FROM Test1  SELECT CONCAT(Name, ' - ', CONVERT(NVARCHAR(2), Code)) FROM Test1  SELECT CONCAT(Name, ' - ', CAST(Code AS NVARCHAR(2))) FROM Test1  SELECT CONCAT(Name, ' - ', FORMAT(Code, '0')) FROM Test1  The first 3 queries have a warning:  Type conversion in expression (...) may affect "CardinaltiyEstimate" in query plan choice.  But why is FORMAT behaving differently ? What happens behind the scenes to eliminate the implicit conversion? Is there any other way then format so you are not impacted by the implicit conversion?


Consider the following code:   \begin{document}    \begin{figure} \begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=5 cm, scale = 1, transform shape]   \node[initial,state] (A)                                    {$s_0$}; \node[state]         (B) [right of=A]                       {$s_2$}; \node[state]         (C) [above of=B]                       {$s_1$}; \node[state]         (D) [below of=B]                       {$s_3$};  \path[->] (A) edge [left]       node [align=center]  {$ c = c + 1 $} (C)       (A) edge [above]      node [align=center]  {$ c = c + 5 $} (B)       (A) edge [left]       node [align=center]  {$ c = c - 1 $} (D)       (B) edge [right]      node [align=center]  {$ c = c - 1 $} (D)       (C) edge [loop above] node [align=center]  {$ c = c + 1 $} (C)       (D) edge [loop below] node [align=center]  {$ c = c - 2 $} (D);  \end{tikzpicture} \caption{An example of SST} \end{figure}  \end{document}   I get the following automaton :    How can I draw S2 and S4 as final states (double circle)?


I am using QGIS 3.2 and I need to create an area to form a polygon shapefile using latitude and longitude, not using Python as I am just a beginner. How to do this?


Calculate ${2^{n + 1}}\prod\limits_{k = 1}^n {\cos \frac{{\pi k}}{{n + 1}}} $

Calculate $${2^{n + 1}}\prod\limits_{k = 1}^n {\cos \frac{{\pi k}}{{n + 1}}}  $$  It's task in theme "Eigenvectors and eigenvalues" (linear algebra book) I have no idea.   Any advice? (How to solve it with linear algebra or mathematical analysis)


Driving transistor with the output of CMOS inverter

This is kind of a follow-up question to my last question (). I have succesfully used an Arduino digital output pin. The output pin drives IN1 and IN3 inputs of an L298N engine driver (with max 100 microA input current), as well as a CD4049 hex inverter input. The hex inverter output drives the other 2 inputs of the driver (IN2, IN4). This has worked without a problem. When I try to drive another load from the inverted output is when I get a problem.         – Schematic created using   I tried to drive at the same time the 2 inputs (IN2 and IN4) of the L298N and the base of a NPN BJT transistor 2N2222. When the inverter input was high everything worked well, and when the inverter input was low, neither the L298N driver worked or the 2 LED's through the transistor. I then though that maybe the base current was too high, so I thought I would switch with an N-channel MOSFET BS170. I replaced it Gate-Base, Drain-Collector and Source-Emitter. If the input went low, the output would go high on the CD4049. But when the input went high again, the output stayed high as well.  What am I doing wrong here? How do I correctly drive a NPN BJT or N-channel MOSFET from the output of a CMOS inverter like the CD4049?


Do Alexius Meinong's impossible worlds describe all impossible worlds/things?

Does his impossible worlds category include (and can describe) literally all impossible things/worlds?  Inconsistencies, paradoxes, impossible solutions to problems (and impossible problems); really impossible things (as there are philosophers that told me that paradoxes, for example, are not really/truly impossible things because otherwise they could not exist; "Obviously, impossible things are not, in any situation, possible. But if by "impossible things" you mean "contradictory things" or "paradoxical things," then yes. Depends on what you mean by "really impossible." If you mean things that are physically impossible, then obviously we can describe these things using logic. If you mean things that are logically impossible, then this question (is there any logic system/method or anything else that can find and describe impossible things?) doesn't make any sense.") Can it describe all the impossible worlds that even logic systems that allow impossibilities (like paraconsistent logics, dialetheism, trivialism...etc) cannot describe (due, for example, to their limitations)?  Russell's set paradox cannot have a solution (solution in the sense of representing the contents of Russell's set paradox) in a way that makes sense in naive set theory (classical logic), it is impossible and cannot exist: as a scientist told me once,  "The contents of a Russel-type set are not just non-computable in that you can't figure out the answer. You can arrive at it by exhausting all possibilities, either. That is, if you take every possible state the human brain can be in, none of them include the computation of Russel's Set's contents. That is, not only can the contents not be computed, they cannot even be represented. No stimulus can cause us to comprehend Russel's Set, since such comprehension is not possible to begin with. The solution to Russell's set does not exist. It cannot exist. There is no arrangement of atoms in the universe that spells out the solution. There is no pattern of neuronal activity in the brain that could ever represent the solution. It's like asking what democracy tastes like. It doesn't make any sense."  So could we find an impossible world from Alexius Meinong's impossible worlds where this solution would exist and could be found and represented?


When I open the DXF file in LibreCAD, then it shows the correct size of an object, but when I import that file in Blender, then the size of that object becomes very large.


What parentheses are doing after declaration of a function (last line)?  var a = 0;   function foo(a) {       alert(a);   } (a);


Python regular expressions - how to capture multiple groups from a wildcard expression?

I have a Python regular expression that contains a group which can occur zero or many times - but when I retrieve the list of groups afterwards, only the last one is present. Example:  re.search("(\w)*", "abcdefg").groups()  this returns the list ('g',)  I need it to return ('a','b','c','d','e','f','g',)  Is that possible? How can I do it?


How can I realistically compare the Cost of Living for two locations?

I've recently applied for a position with a company and I think I have a fair shot at getting a job.  If hired, I should have the option to move to one of two locations.  However, I'm having a tough time evaluating what the cost of living adjustment will be for my family if we were to move to either location.  I know that there are many online comparison calculators (i.e. BankRate, BestPlaces.net, etc.) but, IMHO, these seem a bit too generalized.  You select two locations, plug in your current salary and they output "How much you need to earn in city X."    It can't be (and I won't believe) that CoL comparison is that simple.  Each person (or family) has their own set of circumstances around their lives that affect their CoL.  Furthermore, I think some of the CoL metrics can be skewed if a certain region (especially certain rural communities) contain REALLY expensive properties that tend to elevate the average home price.  My question is simple.  How does one effectively gauge cost-of-living when considering a move, beyond the simple online calculators that are available everywhere?  Is there anything else that I can do when trying to make the most informed decision for my family?