I have Samsung Galaxy Note 3. I wanna install Ubuntu on my phone. Is that possible ? My phone has 64G SD Card. Thanks.

With the announcement of the Ubuntu Phone OS I'd like to know what phone (and tablet) models are supported at this time.  Note from foss & Oli: We are making this the master question for all future "Will this work on <insert random tablet/phone/device here>?!" questions


Let $k$ be an infinite field, and let $f$ be a nonzero polynomial in $k[X_1,\cdots,X_n]$. Show then, that there exist $a_1,\cdots,a_n\in k$ such that $f(a_1,\cdots,a_n)\ne 0$.   Is there something illuminating about this exercise?  We say that $f\ne 0$ in $k[X_1,\cdots,X_n]$, and hence there exist $b_1,\cdots,b_n\in k$ such that $f(X_1,\cdots,X_n)=b_1X_1+\cdots+b_nX_n\ne 0$  Then the result follows immediately. Is there something I am missing?

Let $f$ be polynomial in $n$ variables. If we have $f(a_1,\ldots,a_n) = 0, a_i \in S_i$ and $S_1,\ldots,S_n$ are infinite subsets of a field $k$, how can I show that $f=0$?


The following packages have unmet dependencies:  libnss3-nssdb: Depends: libnss3 (= 2:3.15.4-1ubuntu7) but 2:3.16.3-1ubuntu1 is installed   I am trying to do a repair, but it's cannot be, any idea? because i am following by

Occasionally, when I'm installing stuff, I get an error like the following:  Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  package1 : Depends: package2 (>= 1.8) but 1.7.5-1ubuntu1 is to be installed E: Unable to correct problems, you have held broken packages.   How can I resolve this?


He was certainly more resistant to the Ring than any other character in The Lord of the Rings. He could have handled the Ring with greater ease throughout the journey, especially in Mordor, as compared to Frodo.  Does this idea not come to anyone's mind or is there some deeper reason?

There is evidence that Tom Bombadil is unaffected by the One Ring's power and he has magical ways about him that can't be explained.  It seems that Tom did not participate actively in the War of the Ring, even though he was clearly more powerful than others.  Is it possible that Tom Bombadil could have used his magic to defeat Sauron?


The giraffe, who was the tallest in the zoo, towered over the other animals.  Is it correct to use the relative pronoun who to relate to "the giraffe", an animal?

Possible Duplicate:             Is the use of "who", as applied to non-human animals, ever considered grammatically correct? Would it be correct to refer to a cat as "the same cat who I saw yesterday" instead of "the cat that I saw yesterday", or is this considered incorrect?


I'm using my DSL-Business-connection for a small office. I just installed a Mac Mini Server with mail-support and try to send an email to googlemmil, but this mail is getting marked as spam. This is the header of my mail.  The IP is static and I set up the PTR and SPF.  What else can I do?  Delivered-To: testmailadresse12345-456789-1012345@gmail.com Received: by 10.202.7.193 with SMTP id 184csp174199oih;         Fri, 31 Oct 2014 03:42:56 -0700 (PDT) X-Received: by 10.112.97.135 with SMTP id ea7mr25452495lbb.46.1414752175877;         Fri, 31 Oct 2014 03:42:55 -0700 (PDT) Return-Path: <ich@meinedomain.de> Received: from buero.meinedomain.de (buero.meinedomain.de. [80.147.xx.xxx])         by mx.google.com with ESMTPS id ri5si15978175lbb.115.2014.10.31.03.42.55         for <testmailadresse12345-456789-10@gmail.com>         (version=TLSv1 cipher=RC4-SHA bits=128/128);         Fri, 31 Oct 2014 03:42:55 -0700 (PDT) Received-SPF: pass (google.com: domain of ich@meinedomain.de designates 80.147.xx.xxx as permitted sender) client-ip=80.147.xx.xxx; Authentication-Results: mx.google.com;        spf=pass (google.com: domain of ich@meinedomain.de designates 80.147.xx.xxx as permitted sender) smtp.mail=ich@meinedomain.de Received: from localhost (localhost [127.0.0.1])     by buero.meinedomain.de (Postfix) with ESMTP id C17275486E9     for <testmailadresse12345-456789-10@googlemail.com>; Fri, 31 Oct 2014 11:42:53 +0100 (CET) X-Virus-Scanned: amavisd-new at meinedomain.de Received: from buero.meinedomain.de ([127.0.0.1])     by localhost (buero.meinedomain.de [127.0.0.1]) (amavisd-new, port 10024)     with ESMTP id GUEFHVd811Ma for <testmailadresse12345-456789-10@googlemail.com>;     Fri, 31 Oct 2014 11:42:53 +0100 (CET) Received: from [192.168.2.30] (unknown [192.168.2.30])     by buero.meinedomain.de (Postfix) with ESMTPSA id 9DAF75486DB     for <testmailadresse12345-456789-10@googlemail.com>; Fri, 31 Oct 2014 11:42:53 +0100 (CET) From: =?utf-8?Q?Mein_Name9Fler?= <ich@meinedomain.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Eine Testemail Message-Id: <F7485894-1928-4091-B857-1E554F4F1FFF@meinedomain.de> Date: Fri, 31 Oct 2014 11:42:52 +0100 To: testmailadresse12345-456789-10@googlemail.com Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) X-Mailer: Apple Mail (2.1990.1)  Hallo,  dies ist eine Testemail. Bitte vergesse den Termin am Sonntag nicht.  Danke Dir!`

This is a  about how to handle email sent from your server being misclassified as spam.  For additional information you may find these similar questions helpful:                    Sometimes I want to send newsletters to my customers. The problem is, that some of the emails get caught as spam messages. Mostly by Outlook at the client (even in my own Outlook 2007).  Now I want to know what should be done to create "good" emails. I know about reverse lookup etc., but (for example), what about a unsubscribe link with an unique ID?  Does that increase a spam rating?


I was asked to show that the answer is 3. I don't have any idea on how to proceed. Thanks!

I think I have sort of a proof of the following nested radical expression due to Ramanujan for $x\ge 0$.     $$\large x+1=\sqrt{1+x\sqrt{1+(x+1)\sqrt{1+(x+2)\sqrt{1+\cdots}}}}$$ for $ x\ge -1$   I just want to know if my proof is okay or there is a flaw, and if there is one I request to give some suggestions to eliminate them. Thank you. The proof is the following:  Proof: Let us define $$ a_n(x)=\underbrace{\sqrt{1+x\sqrt{1+(x+1)\sqrt{1+(x+2)\sqrt{1+\cdots}}}}}_{n \ \mbox{terms}}$$ for $x\ge 0$ so that $$ a_1(x)=\sqrt{1+x},\ a_2(x)=\sqrt{1+x\sqrt{1+(x+1)}},\ a_3(x)=\cdots$$    and so on. Since $x\ge 0$ each one of the $a_n$ is defined (I am taking only the positive square root). Also, we note that $$a_{n+1}^2(x)=1+xa_{n}(x+1)$$  Now, we note that $\{a_n(x)\}$ is an increasing sequence and that $$a_n(x)<x+1$$ $\forall n\ge 1$, this is easy to prove by induction as below:  For $n=1$, $a_1(x)=\sqrt{1+x}<1+x$ since $x\ge 0\Rightarrow 1+x\ge 1$. SO it is true for $n=1$. Similarly, the truth can be proved for $n>1$.  Then $a_n(x)$ converges to $$l(x)=\sup_{n}a_n(x)\le x+1$$ Now I make the following claim:  Claim: $l(x)=x+1\quad \forall i\ge 0$  Proof: Fix $x$. Let $l(x)<x+1$. Then, $l(x)=x+1-\epsilon$ for some $\epsilon>0$. Now, I claim that there must be a $n$ such that $$x+1-a_n(x)<\epsilon$$, and if that is true then $$a_n(x)>x+1-\epsilon=l(x)$$ which is a contradiction since $$l(x)=\sup_{n}a_n(x)$$ and then it implies that $$l(x)=x+1$$ To prove my claim it requires $$x+1-a_n(x) <  \epsilon$$ Now, \begin{align} x+1-a_n(x) = & x+1-\sqrt{1+xa_{n-1}(x+1)} \\ \ =& \frac{(x+1)^2-({1+xa_{n-1}(x+1)})}{x+1+\sqrt{1+xa_{n-1}(x+1)} } \\ \ =& x\frac{(x+1)+1-a_{n-1}(x+1)}{x+1+\sqrt{1+xa_{n-1}(x+1)} } \\ \ <& \frac{x}{x+2}((x+1)+1-a_{n-1}(x+1))\\ \ <& \frac{x}{x+2}\cdot\frac{x+1}{x+3}((x+2)+1-a_{n-2}(x+2))\\ \ <& \frac{x}{x+n-1}\cdot \frac{x+1}{x+n} ((x+n-1)+1-a_{1}(x+n-1))\\ \ <& \frac{x}{x+n-1}\cdot \frac{x+1}{x+n}(x+n-\sqrt{x+n})\\ \ <& \frac{x(x+1)}{x+n-1} \end{align}  Now, if one is able to find $n$ such that $$\frac{x(x+1)}{x+n-1}<\epsilon \Rightarrow x< \frac{-(1-\epsilon)+\sqrt{(1-\epsilon)^2+4\epsilon(n-1)}}{2}$$ then we're done.   Now from the upper bound it seems that there always exists some $n$ that satisfies this requirement. Hence the claim is proved.


I'm using documentclass report with options twoside and openright. The pagestyle is headings. This is a minimal working example:  \documentclass[twoside,openright]{report}  \usepackage{blindtext}  \pagestyle{headings}  \begin{document}   \chapter{Chapter}    \blindtext \blindtext    \section{Section}     \blindtext \blindtext  \end{document}   Why is the page number at the first page of the chapter centered at the bottom and not on the right even though the document style headings works on all other pages? How to move the page number on the first page of a chapter to the right side as it should be using the document option openright?

I am working on a long document in LaTeX with documentclass book. I need the page number to always be in the upper right corner of each page, even if that page is the first page of a chapter (right now on 1st pages of chapters, the page number is bottom-centered, on all other pages it's top-right).  I control the position of the page number with fancyhdr:  \usepackage{fancyhdr} \pagestyle{fancy} \lhead{} \chead{} \rhead{\thepage} \lfoot{} \cfoot{} \rfoot{} \renewcommand{\headrulewidth}{0pt}   Also, I don't know if the problem is related but my chapters do not start from the top of the page. There is a white area, then comes chapter X, then a newline with the chapter line. What I also want is the chapter to start from the top of the page.  The main question here is how I can get the page number to always appear in the upper right corner, I mention the thing with the chapter title position only in case that might be related.


Minitoc is really great when using it within various chapters. But what should be used when a toc is required, which lists only parts and chapters? I called it abstracttoc to show the position where it should be applied.  e.g.  \begin{document}  A few words initially.  \abstracttoc % only parts and chapters  And a few words. \tableofcontents % as usual \part{One}  \chapter{A}  a few words  \section{SEC A}  a few words \section{SEC AA}  a few words \chapter{B}  a few words  \section{SEC B}  a few words \section{SEC BB}  a few words \part{Two}  \chapter{Z}  a few words  \section{SEC ZZ}  a few words \section{SEC ZZZ}  a few words    \chapter{C}  a few words  \section{SEC CC} a few words \section{SEC CCC} a few words \end{document}

Suppose a book has only 4 chapters. Suppose each chapter has a ridiculously large number of sections, say, 100.  A table of contents with depth=0 for this book will take only 1 page, whereas a table of contents with depth=1 will run to 20 pages.  For such a book, it would be great to have 2 consecutive tables of contents: the first would refer to chapters only, and the second would break down chapters into sections.  How could I do this?  In the following example, the second TOC gets blank.  \documentclass{book} \begin{document}  \setcounter{tocdepth}{0} \tableofcontents  \setcounter{tocdepth}{1} \tableofcontents  \chapter{One} \section{a} \section{b} \section{c} \section{d} \section{e} \chapter{Two} \section{a} \section{b} \section{c} \section{d} \section{e} \chapter{Three} \section{a} \section{b} \section{c} \section{d} \section{e} \chapter{Four} \section{a} \section{b} \section{c} \section{d} \section{e}  \end{document}


Below is the code to retrieve last 10 posts from DB and return a List.  I am facing Null Pointer exception at posts.add(doc) line.  Am I doing anything wrong?  public List<Document> findByDateDescending(int limit) {      List<Document> posts = null;     Bson sort = Sorts.descending("date");     MongoCursor<Document> cursor =  postsCollection.find().sort(sort).limit(limit).iterator();     try{         while(cursor.hasNext()){             System.out.println("Whats wrong with code");             Document  doc = cursor.next();             System.out.println(doc);             posts.add(doc); ----Null pointer exception         }     }     finally {        cursor.close();     }     return posts; }

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


I am getting an the java.lang.nullpointerexception error in my code. Though I am not sure why it is not correct. I should be a quick fix, but I can't seem to figure it out. It seems that the array in line 45 is giving me the error. Any help would be greatly appreciated. Thank you in advance.  import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner;  class readFile {     private String fileName;     private double lowestNum;     private double highestNum;     private double totalNum;     private double averageNum;     private int[] array;      public readFile(String input)     {         fileName = input;         lowestNum = 0;         highestNum = 0;         totalNum = 0;         averageNum = 0;     }      public void readArray() throws FileNotFoundException     {         Scanner s = new Scanner(new File(fileName));         array = new int[s.nextInt()];         for(int i = 0; i < array.length; i++)         {             array[i] = s.nextInt();         }         s.close();     }     \\ERROR IS HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!     public void findLowest()     {         lowestNum = array[0];         for(int i = 1; i < array.length; i++)         {             if(array[i] < lowestNum);             lowestNum = array[i];         }         System.out.println("Lowest number: " + lowestNum);     }      public void findHighest()     {         highestNum = array[0];         for(int i = 1; i < array.length; i++)         {             if(array[i] > highestNum);             highestNum = array[i];         }         System.out.println("Highest number: " + highestNum);     }      public void findTotalNum()     {         for(int i = 0; i < array.length; i++)         {             totalNum = totalNum + array[i];         }         System.out.println("Total of all numbers: " + totalNum);     }      public void findAverage()     {         averageNum = (totalNum / array.length);         System.out.println("Average of all numbers: " + averageNum);     } }  public class NumberAnalysis  {     public static void main(String[] args) throws FileNotFoundException      {         String fileName = "Numbers.txt";          readFile myClass = new readFile(fileName);         myClass.findLowest();         myClass.findHighest();         myClass.findTotalNum();         myClass.findAverage();     } }


I use Chrome as my primary browser but must use Internet Explorer to be able to remote in to my work via Remote Desktop web client (since it uses ActiveX plugins). To start an app, I would often type out the name from the start menu unless I had a pinned link or shortcut handy. But if I type "internet" as if I were trying to start Internet Explorer, I will always be recommended Edge and have it highlighted by default.  I will never be able to use Edge here so stop recommending it... can this behavior be disabled somehow? Not even pinning the Internet Explorer link to the start menu prevents this. If I had any other shortcuts that started with the word "internet," it still offers Edge and is preselected. At least if I type in "chrome," Chrome is selected first. Windows 10 Pro 1909 (18363.900)

I am trying to disable Windows 10 start menu search web results on Windows 10 professional v2004 slow ring preview release build 19033.1.  Here is a list of things that do not work for me:  [DISABLE WINDOWS WEB SEARCH ON REGISTRY EDITOR]  I've googled how to get rid of windows 10 search web results and tried the suggested registry editor hacks on:|  Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Search    Setting CortanaConsent and BingSearchEnabled to DWORD32  value 0 but they are not working.   [REWRITE ENDPOINTS]   I've even tried to rewrite all bing.com endpoints in windows (WTF most of them are HTTP, not HTTPS! Anyone can sniff those searchs on an unsecured WiFi network!) but they are restored on windows restart.   [REMOVE EDGE AS DEFAULT APP]   I've tried to restrict edge in every way I could and removing it from default apps but the bastard keeps popping up every time I make a typo while trying to search/run something on my local system.   [RESTRICT CORTANA AND EDGE USING FIREWALL RULES]   I've disabled windows firewall rules allowing outbound and inbound connections for Edge and Cortana. Still no effect.   Are there any other more current hacks that would work on this release?


On executing sudo-apt get update it gives me the following:  Err:4 https://deb.torproject.org/torproject.org bionic InRelease                              The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 74A941BA219EC810 Err:7 http://in.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages                   Hash Sum mismatch   Hashes of expected file:    - Filesize:563484 [weak]    - SHA256:922599efa85df1c8960535da907026555b19006ab321005918b75de76cae422b    - SHA1:19064dc18593afe6046b03a6506e0a01784ce544 [weak]    - MD5Sum:4dd7ac9ab795941bc74b13ec681f17c2 [weak]   Hashes of received file:    - SHA256:fd3c8f7b50c7f36970d1afd8233694a07cab0fb387de60ff185d7743757db679    - SHA1:18b139b4eb060ba013cac731aa0d4c6e0f5113c9 [weak]    - MD5Sum:acf7d58d48ce5177419214c8196b9745 [weak]    - Filesize:563484 [weak]   Last modification reported: Sun, 28 Jul 2019 01:57:06 +0000   Release file created at: Mon, 29 Jul 2019 07:43:31 +0000 Reading package lists... Done                                    W: GPG error: https://deb.torproject.org/torproject.org bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 74A941BA219EC810 E: The repository 'https://deb.torproject.org/torproject.org bionic InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.   After this error, somebody suggested me to execute the following  : sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 74A941BA219EC810  And this is what is output on the terminal:  Executing: /tmp/apt-key-gpghome.serEMDJCIi/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 74A941BA219EC810 gpg: packet(13) too large gpg: read_block: read error: Invalid packet gpg: no valid OpenPGP data found. gpg: Total number processed: 0   Kindly help!

I added some extra repositories with the Software Sources program. But when I reload the package database, I get an error like the following:     W: GPG error:  trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8BAF9A6F   I know I can fix it using apt-key in a terminal, according to the official Ubuntu documentation. But I would have liked to do it graphically. Is there a way to do this without using a terminal?


My device (Samsung S4 mini i9195) carries a 4.2.2 version. When I ask for a software update manually, it says that the latest version is already installed. How can I force it to accept the actual latest version (4.4.2) as depicted in this ?

This Community Wiki question is designed to be the "canonical question" for questions asking how to upgrade one's device to a new Android version.   I want to get a newer version of the OS for my Android device. How can I do that?  See also:


Evaluate the infinite continued fraction $$\xi = [1,2,3,4,5\cdots] = 1+\dfrac{1}{2+\dfrac{1}{3+\dfrac{1}{4+\vdots}}}$$   There is no periodic behavior of this continued fraction, I am not even sure that $\displaystyle\lim_{n \to \infty} [1,2,3,\cdots,n]$ exists or not. Any hints on how to solve this problem?

What is $1+\cfrac{1}{2+\cfrac{1}{3+\cfrac{1}{4+\cdots}}}$ ?  What is $1+\cfrac{2}{1+\cfrac{3}{1+\cdots}}$ ?  It does bear some resemblance to the continued fraction for $e$, which is $2+\cfrac{2}{2+\cfrac{3}{3+\cfrac{4}{4+\cdots}}}$.   Another thing I was wondering: can all transcendental numbers be expressed as infinite continued fractions containing only rational numbers? Of course for almost all transcendental numbers there does not exist any method to determine all the numerators and denominators.


When i install a custom post type as plugin,it will create 3 default category automatically like apple,sony,nokia. How is it possible ? My custom post & taxonomy code:  function brands() {     $labels = array(         'name' => _x( 'Brands', 'brands_creator' ),         'singular_name' => _x( 'Brand', 'brands_creator' ),         'add_new' => _x( 'Add New Brand', 'brands_creator' ),         'add_new_item' => _x( 'Add New Brand', 'brands_creator' ),         'edit_item' => _x( 'Edit Brand', 'brands_creator' ),         'new_item' => _x( 'New Brand', 'brands_creator' ),         'view_item' => _x( 'View Brand', 'brands_creator' ),         'search_items' => _x( 'Search Brands', 'brands_creator' ),         'not_found' => _x( 'No Brands found', 'brands_creator' ),         'not_found_in_trash' => _x( 'No Brands found in Trash', 'brands_creator' ),         'parent_item_colon' => _x( 'Parent Brand:', 'brands_creator' ),         'menu_name' => _x( 'Brands', 'brands_creator' ),     );      $args = array(         'labels' => $labels,         'hierarchical' => true,         'description' => 'Brands filterable by genre',         'supports' => array( 'title', 'editor','thumbnail','revisions'),         'taxonomy' => 'brand_type',         'public' => true,         'show_ui' => true,         'show_in_menu' => true,         'menu_position' => 5,         'menu_icon' =>get_bloginfo('url').'/wp-content/plugins/brands-creator/images/brand.png',         'show_in_nav_menus' => true,         'publicly_queryable' => true,         'exclude_from_search' => false,         'has_archive' => true,         'query_var' => true,         'can_export' => true,         'rewrite' => true,         'capability_type' => 'post'     );      register_post_type( 'brands_creator', $args ); }  add_action( 'init', 'brands' );  function brand_taxonomy() {     register_taxonomy(       'brand_type',         'brands_creator',         array(         'labels' => array(                 'name' => 'Brands Type'                 ),          )     );  } add_action( 'init', 'brand_taxonomy');  # Default Category that will create automatically# function default_brand_type() {     wp_insert_term(         'Example Category',         'brand_taxonomy',         array(           'description' => 'MFG Product taxonomy.',           'slug'        => 'dmfg'         )     );     wp_insert_term(         'EMFG',         'brand_type',         array(           'description' => 'EMFG Product taxonomy.',           'slug'        => 'demfg'         )     );     wp_insert_term(         'OMFG',         'brand_type',         array(           'description' => 'OMFG Product taxonomy.',           'slug'        => 'domfg'         )     ); } add_action( 'after_setup_theme', 'default_brand_type' );

Made this custom taxonomy that'll control layout on single posts, basically I want to add two options, Layout 1 and Layout 2.  // Register Custom Taxonomy function custom_taxonomy() {      $labels = array(         'name'                       => _x( 'Layout', 'Taxonomy General Name', 'text_domain' ),         'singular_name'              => _x( 'Layout', 'Taxonomy Singular Name', 'text_domain' ),         'menu_name'                  => __( 'Taxonomy', 'text_domain' ),         'all_items'                  => __( 'All Items', 'text_domain' ),         'parent_item'                => __( 'Parent Item', 'text_domain' ),         'parent_item_colon'          => __( 'Parent Item:', 'text_domain' ),         'new_item_name'              => __( 'New Item Name', 'text_domain' ),         'add_new_item'               => __( 'Add New Item', 'text_domain' ),         'edit_item'                  => __( 'Edit Item', 'text_domain' ),         'update_item'                => __( 'Update Item', 'text_domain' ),         'separate_items_with_commas' => __( 'Separate items with commas', 'text_domain' ),         'search_items'               => __( 'Search Items', 'text_domain' ),         'add_or_remove_items'        => __( 'Add or remove items', 'text_domain' ),         'choose_from_most_used'      => __( 'Choose from the most used items', 'text_domain' ),         'not_found'                  => __( 'Not Found', 'text_domain' ),     );     $capabilities = array(         'manage_terms' => 'foobar',         'edit_terms'   => 'foobar',         'delete_terms' => 'foobar',         'assign_terms' => 'foobar'      );     $args = array(         'labels'                     => $labels,         'hierarchical'               => true,         'public'                     => true,         'show_ui'                    => true,         'show_admin_column'          => false,         'show_in_nav_menus'          => false,         'show_tagcloud'              => false,         'capabilities'               => $capabilities,     );     register_taxonomy( 'Layout', array( 'post' ), $args );  }  // Hook into the 'init' action add_action( 'init', 'custom_taxonomy', 0 );   Capabilities are set to invalid values to stop terms from being edited, but I can't get wp_insert_term working.  Adding two terms to my custom taxonomy can't be so hard, right?  Using this to insert a term doesn't work, although if I changed my custom taxonomy name to 'category', ie WP default it works just fine. What gives?  function example_insert_category() {     $parent_term = term_exists( 'layout' ); // array is returned if taxonomy is given $parent_term_id = $parent_term['term_id']; // get numeric term id     wp_insert_term(         'Example Category',         'layout',         array(           'description' => 'This is an example category created with wp_insert_term.',           'slug'        => 'example-category'         )     ); } add_action( 'after_setup_theme', 'example_insert_category' );


I'm using below code for shared preferences.        private Context mCtx;    private static SharedPrefManager mInstance;     public SharedPrefManager(Context context) {             mCtx = context;         }     public static synchronized SharedPrefManager getInstance(Context context) {         if (mInstance == null)             mInstance = new SharedPrefManager(context);         return mInstance;     }     void SaveNotificationType(String strNotificationType) {             SharedPreferences sharedPreferences = mCtx.getSharedPreferences(Shared_Pref_Name, Context.MODE_PRIVATE);             Log.d(TAG, "SaveNotificationType: shared preferences is" + sharedPreferences);             try {                 if(sharedPreferences != null) {                     SharedPreferences.Editor editor = sharedPreferences.edit();                     editor.putString(notificationType, strNotificationType);                     editor.apply();                 }             } catch (Exception e) {                 e.printStackTrace();             }             //editor.commit();         }     When I run above code, I get an error which is given below:    java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.SharedPreferences android.content.Context.getSharedPreferences(java.lang.String, int)' on a null object reference         at com.example.durga_bikkina.storageunitburnstatus.SharedPrefManager.SaveNotificationType(SharedPrefManager.java:41)         at com.example.durga_bikkina.storageunitburnstatus.MyFirebaseMessagingService.storeReceivedMessage(MyFirebaseMessagingService.java:125)         at com.example.durga_bikkina.storageunitburnstatus.MyFirebaseMessagingService.onMessageReceived(MyFirebaseMessagingService.java:36)         at com.google.firebase.messaging.FirebaseMessagingService.handleIntent(Unknown Source:340)         at com.google.firebase.iid.zzg.run(Unknown Source:29)         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)         at java.lang.Thread.run(Thread.java:764)     How do I define context here?


I have a .sh script which contains a set of functions. I have made the script executable (chmod 777).  If I want to run a function as my current user I simply do:  . /path/to/script/functions.sh && fc_number1 "${item1}" "${item2}" &   This works fine. However I have another function, that needs to be run by a different user with different privileges.   I have tried:  sudo -unewuser . /path/to/script/functions.sh && fc_number2 "${item1}" "${item2}" "${item3}" sudo -unewuser -c "bash -c fc_number2 ${item1} ${item2} ${item3}"   Neither of which works. I simply get sudo: .: command not found or bash: export: fc_number2: not a function, or some other error.  Is there something else I need to do to make this work. Everything I read basically comes back to one of the two options I have tried above.

I have a script that does a number of different things, most of which do not require any special privileges. However, one specific section, which I have contained within a function, needs root privileges.  I don't wish to require the entire script to run as root, and I want to be able to call this function, with root privileges, from within the script. Prompting for a password if necessary isn't an issue since it is mostly interactive anyway. However, when I try to use sudo functionx, I get:  sudo: functionx: command not found   As I expected, export didn't make a difference. I'd like to be able to execute the function directly in the script rather than breaking it out and executing it as a separate script for a number of reasons.  Is there some way I can make my function "visible" to sudo without extracting it, finding the appropriate directory, and then executing it as a stand-alone script?  The function is about a page long itself and contains multiple strings, some double-quoted and some single-quoted. It is also dependent upon a menu function defined elsewhere in the main script.  I would only expect someone with sudo ANY to be able to run the function, as one of the things it does is change passwords.


I have a problem in photoshop.. everytime i upload a picture , it would always be put into layer and not background. I am a beginner so yeah lol.. Help!

The background layer is locked by default. When I unlock it, PS creates a new layer layer0 and deletes the background layer.   Is this a bad thing to do. Does the background layer have any special significance or properties that it shouldn't be deleted/replaced? Should I instead copy of the contents of the background to another layer and leave the background layer alone?   I noticed that when I open an image, PS automatically puts the image on the background layer. How do you handle opened images before working on them.


I need to prove the following:     Let $G$ be a group.   Then it's simple if and only if there is only surjective homomorphism $G \to G'$ for $G' = \{ e \}$ or $G' \cong G$.   Not sure how to approach this problem. So far I only have proved that if $G$ is simple and a homomorphism is surjective, then so is $G'$, but I'm not sure this is relevant.  The question is not a duplicate, since it also asks how to prove ($G$ is simple, $\phi: G \to G'$ is a surjective homomorphism) $\Rightarrow$ ($G' = \{ e \}$ or $G' \cong G$).

A finite simple group is one which has no homomorphic images apart from itself and the trivial group. However, the  tag does not include the condition "finite". My question is the following.  Is the following true? Claim: A simple group is one where the only homomorphic images are itself and the trivial group.  However, I am asking this question not because of the tag wiki, but because I think any counter-example would be interesting, especially if it was finitely generated (and especially especially if it was finitely presented). That is,  Does there exists a (finitely presented) group $G$ which is not simple but where the only homomorphic images are itself and the trivial group?  Such a counter-example would be , and would be sort-of-simple, by the definition of a simple group that we want to exist. Thus the title of the question.


We choose 10 cards at random from a standard deck of 52 cards. Find EV of the number of aces.  If we pick a card and then replace it back EV is 10*1/13.   Why the EV is also 10*1/13 when we get an ace and don't put it back , why don't we need to cover all possibilities here?  EV : Expected Value

We had this question arise in class today and I still don't understand the answer given. We were to assume that drawing cards are independent events. We were asked what the probability that the second card drawn is a queen if we take two from the deck. The answer given was 4/52, which seems counter-intuitive to me. How is the probability still 4/52 if there was a card drawn before it? What if the first card drawn was a queen?


i'm looking for an alternative to Landscape, Spacewalk (for RHEL), or CTL to perform a specific job. I need to control and apply OS upgrades on ubuntu systems, for 100+ servers, and so far i wasn't that lucky. I've tried Approx tool (similar to apt-proxy), but it just caches the content, and what i really need to do is set update milestones, apply the upgrades to QA servers, validate, then Stage environment, and so on to Production. I hope I was clear enough, any answer will be much appreciated.

Recently I got in charge of managing 2 computer labs (currently 35 workstations, could double in a month or two) in university with total control over software stack as long as I install a bunch of commonly used scientific software (Mathematica and friends).  I plan to use Ubuntu for various reasons.   Installing Ubuntu and managing updates etc by hand is certainly an option, But I want to know if there is a more efficient way to do this stuff in and a more "Don't Repeat Yourself" manner?  Tasks   Ubuntu installation Installation (duplication) of same software stack and configuration over each workstation Keeping them updated


I'm trying to make use of the \replacecmpd command of the chemnum package in LaTeX in combination with eps files produced by ChemDraw. While this works great for the automatic numbering of chemicals by numbers, it will not let me choose my own label although the CTAN provides an example of how to do this.    The EPS file shows 2 chemical compounds with "TMP1" and "TMP2" underneath them I can replace them by "1" and "2" using the standard \replacecmpd{X1} command What I want though, is for LaTeX to write "Compound 1" instad of "1" both in the figure as well as in the text whenever I refer to that compound by \cmpd{X1}.   I'd greatly appreciate any help, thank you guys! :)  Here's my minimal example:  \documentclass[12pt,a4paper,titlepage,twoside,numbers=noenddot,openright,BCOR12mm]{scrreprt}  \usepackage[utf8]{inputenc} \usepackage{pdfpages} \usepackage{graphicx} \usepackage[crop=off]{auto-pst-pdf}  \usepackage{chemnum}  \usepackage{psfrag}   \setchemnum{init,log=verbose}  \graphicspath{{../EPS/}{../Compounds/}}  \begin{document}  \begin{center} \begin{minipage}{\linewidth} \centering \replacecmpd[tag=Compound1]{X1} \replacecmpd[tag=Compound2]{X2} \includegraphics{Compounds.eps} \end{minipage} \end{center}  \end{document}   edit: I also noticed that I cannot reproduce the example provided in the CTAN manual about chemnum. Any ideas why that might be the case?

When using:  \documentclass{standalone} \usepackage{graphicx,auto-pst-pdf,chemnum} \begin{document} \cmpd[counter-representation=bar]{foo} \end{document}  I get "1" as label output. I would like to define an own label with foo being the internal descriptor and bar being the label's output when called. Pre-1.0 I was using \cmpd[cmpd-label=foo]{bar} which did what I wanted.


I recently moved and didn't properly mark a couple of power supplies before I packed them up. I have a turntable and a pre-amplifier that both use 15v power supplies. One of the two power supplies outputs 15v 250mA and the other outputs 15v 550mA. The documentation for both devices just says "15v". I have done an exhaustive search online to see if I can find which adaptor belongs to which device, and have come up with nothing.   I'm at the point where I'm going to have to just guess. But both of these components are fairly expensive, so I'm concerned about using the wrong power supply and damaging the device. I'm not understanding exactly what the difference in mA means, and what is the risk of plugging the wrong one in.

Power supplies are available in a wide range of voltage and current ratings.  If I have a device that has specific voltage and current ratings, how do those relate to the power ratings I need to specify?  What if I don't know the device's specs, but am replacing a previous power supply with particular ratings?  Is it OK to go lower voltage, or should it always be higher?  What about current?  I don't want a 10 A supply to damage my 1 A device.


Is it correct to assume that there is an infinite number of combinations of weights that a neural network can have in its connections in order to produce a specific output when given a certain set of inputs?  In other words, when we are training a neural network using backpropagation, does it mean that we are not looking for the only possible ideal configuration but rather for one out of an infinite number of ideal configurations?  Is there proof for either of the situations?

It's quite intuitive that most neural network topologies/architectures are not identifiable. But what are some well-known results in the field? Are there simple conditions which allow/prevent identifiability? For example,    all networks with nonlinear activation functions and more than one hidden layer are not identifiable all networks with more than two hidden units are not identifiable   Or things like these. NOTE:I'm not saying that these conditions prevent identifiability (though they seem pretty good candidates to me). They are just examples of what I mean with "simple conditions".  If it helps to narrow down the question, feel free to consider only feed-forward and recurrent architectures. If this is still not enough, I'd be satisfied with an answer which cover at least one architecture among MLP, CNN and RNN. I had a quick look around on the Web but it looks like the only discussion I could find was on Reddit. Come on, people, we can do better than Reddit ;-)


I am a web developer and we have no one specialising in the wellbeing of the server or the network currently at our office. Usually I can sort many of the issues that arise with my basic knowledge but currently, we have some strange things happening and I have no idea what is going on so I'm looking for some advice from someone a lot more knowledgeable than me to shed some light if possible.  We have an ecloud server hosted by UK Fast (Linux server) and it holds a VPS server and lots of client sites. Yesterday, the server randomly went down and when we realised, we called them up and they said someone had SSH'd in and run the command  sudo rm TSG-server.pub which essentially removed our whole server. UK fast managed to get us an IP of where the user who did this was accessing it from but 1. I don't know how this helps at all and 2. they could have been using a VPN anyway.  The weird thing is that they had a login attempt ad it was successful... So whoever it was, knew the password or got it from somewhere. The only place we have our password is on LastPass and no one else knows it. So we restored the backup and got everything back, changed the password and called it a day.  So cut to this morning and it happened again... except this time they didn't leave any trace of who it was because they made sure they deleted the logs as well...  How could they possibly be doing this and how can we stop this? I don't even know where to begin...  Does anyone have any idea of how this might be happening, please.

This is a  about Server Security - Responding to Breach Events (Hacking)   See Also:                  Canonical Version I suspect that one or more of my servers is compromised by a hacker, virus, or other mechanism:   What are my first steps? When I arrive on site should I disconnect the server, preserve "evidence", are there other initial considerations? How do I go about getting services back online? How do I prevent the same thing from happening immediately again? Are there best practices or methodologies for learning from this incident? If I wanted to put a Incident Response Plan together, where would I start? Should this be part of my Disaster Recovery or Business Continuity Planning?   Original Version       2011.01.02 - I'm on my way into work at 9.30 p.m. on a Sunday because our server has been compromised somehow and was resulting in a    attack on our provider. The servers access to the Internet   has been shut down which means over 5-600 of our clients sites are now   down. Now this could be an FTP hack, or some weakness in code   somewhere. I'm not sure till I get there.      How can I track this down quickly? We're in for a whole lot of   litigation if I don't get the server back up ASAP. Any help is   appreciated. We are running Open SUSE 11.0.            2011.01.03 - Thanks to everyone for your help. Luckily I WASN'T the only person responsible for this server, just the nearest. We managed   to resolve this problem, although it may not apply to many others in a   different situation. I'll detail what we did.      We unplugged the server from the net. It was performing (attempting to   perform) a Denial Of Service attack on another server in Indonesia,   and the guilty party was also based there.      We firstly tried to identify where on the server this was coming from,   considering we have over 500 sites on the server, we expected to be   moonlighting for some time. However, with SSH access still, we ran a   command to find all files edited or created in the time the attacks   started. Luckily, the offending file was created over the winter   holidays which meant that not many other files were created on the   server at that time.      We were then able to identify the offending file which was inside the   uploaded images folder within a  website.      After a short cigarette break we concluded that, due to the files   location, it must have been uploaded via a file upload facility that   was inadequetly secured. After some googling, we found that there was   a security vulnerability that allowed files to be uploaded, within the   ZenCart admin panel, for a picture for a record company. (The section   that it never really even used), posting this form just uploaded any   file, it did not check the extension of the file, and didn't even   check to see if the user was logged in.      This meant that any files could be uploaded, including a PHP file for   the attack. We secured the vulnerability with ZenCart on the infected   site, and removed the offending files.      The job was done, and I was home for 2 a.m.            The Moral   - Always apply security patches for ZenCart, or any other CMS system for that matter. As when security updates are released, the whole   world is made aware of the vulnerability.   - Always do backups, and backup your backups.   - Employ or arrange for someone that will be there in times like these. To prevent anyone from relying on a panicy post on Server   Fault.


I have a flight from mumbai to London with 3 hrs layover(change of planes at Dubai), both Mumbai to dubai and dubai to london flight is of Emirates only and terminal is also same. (T3)  do i reuqire transit visa for the same?

Do I need a transit visa for a layover via airports in the UAE, such as Dubai International Airport or Abu Dhabi International Airport? If so, what are the requirements for such a visa? Can I get the transit visa on arrival?


How does one compute the limit of the sequence:  $$\sum_{k = 0}^{n}\frac{1}{3k+1} - \frac{\ln(n)}{3}$$  I would apreciate a hint.

How may one calculate  $$\lim_{n\to\infty} \ \left(\left(\sum_{k=1}^{n} \frac{1}{3k-1}\right) - \frac{\ln n}{3}\right) \ ?$$


I'm trying to format a document following my organization's style guide. I'm using XeLaTeX for the font flexibility. I made a minimal document \documentclass{article}     \usepackage{xltxtra} %% For XeTeX font commands \setmainfont[Ligatures=TeX]{Frutiger LT Std 45 Light} \usepackage[includeheadfoot, margin = 0.5in]{geometry}  \begin{document} Main font, no styling, \emph{with emphasis}, \textbf{and bolded}. \end{document}  and the \emph{} and \textbf{} text comes out just fine, but the rest is garbled:  The part where it's probably my fault I needed to use this font in some graphs generated in R. I have several fonts in the Frutiger family installed on my (Windows) machine, and they're OTF fonts. To get the font to work in R, I need to use the extrafont package, which only works with TTF fonts. So I fed Frutiger LT Std 45 Light into an online OTF to TTF converter, and reinstalled the TTF version. It works great for my R figures, but maybe that has something to do with my XeTeX font problems. If I run the above example with \setmainfont{Frutiger LT Std 55 Roman} instead of using the TTF-converted light face, nothing is garbled, it's just too heavy. My compilation report for the example above says 0 Errors, 0 Warnings; the .log file reports ................................................. . fontspec info: "defining-font" .  . Font family 'FrutigerLTStd45Light(0)' created for font 'Frutiger LT Std 45 . Light' with options []. .  . This font family consists of the following shapes: .  . * 'normal' with NFSS spec.: . <->"Frutiger LT Std 45 Light/ICU:script=latn;language=DFLT;" .  . * 'bold' with NFSS spec.: . <->"Frutiger LT Std 45 Light/B/ICU:script=latn;language=DFLT;" .  . * 'italic' with NFSS spec.: . <->"Frutiger LT Std 45 Light/I/ICU:script=latn;language=DFLT;" .  . * 'bold italic' with NFSS spec.: . <->"Frutiger LT Std 45 Light/BI/ICU:script=latn;language=DFLT;" .................................................  Any help/pointers?

Prompted in part by the question , I started wondering if the \underset (from amsmath) and \underaccent (from accents) commands work equally when using XeLaTeX instead of pdflatex. The following code and associated output show that this is not the case for the XITS Math package:  \documentclass{standalone} \usepackage{amsmath,accents} \usepackage[no-math]{fontspec} \usepackage{unicode-math}    \setmathfont[version=cambria]{Cambria Math}    \setmathfont[version=lm]{Latin Modern Math}    \setmathfont[version=asana]{Asana Math}    \setmathfont[version=xits]{XITS Math} \newcommand\undersetunderaccent{$\underset{x}{A} \ \underaccent{x}{A}$} \begin{document} \Huge  \noindent \mathversion{lm}Latin Modern Math:       \undersetunderaccent\\ \mathversion{cambria} Cambria Math:      \undersetunderaccent\\ \mathversion{asana}   Asana Math:        \undersetunderaccent\\ \mathversion{xits}    XITS Math:         \undersetunderaccent \end{document}     Clearly, the output of the two commands is rather different [!] when "XITS Math" is the math font. Does the XITS Math package have to be loaded with special options to suppress this behavior, or should I plan on sending a bug report to the maintainers of the XITS Math font and/or the maintainers of the unicode-math package?  Addenda: (i) I can generate the output above using both TeXLive 2011 and MiKTeX 2.9 (both updated yesterday); the OS is Windows Vista; all math fonts on my system are the latest ones available. (ii) The problems with "XITS Math" do not arise if I run the example code above under luatlatex instead of under xelatex.


How to install Crunch Wordlist on 12.10 32-bit?    I used  tar -zxvf crunch-3.4.tgz cd crunch-3.4 sudo make sudo makeinstall   A directory /pentest/passwords/crunch was created but I cannot seem to know how to run Crunch.

I have downloaded tar.gz files. But I don't know how to install it. How do I install this kind of file?


If $\gcd(a,n) = 1$ and $\gcd(b,n) = 1$, then $\gcd(ab,n) = 1$. Also... $a,b$ and $n$ are natural numbers.  I feel I should begin with EEA to multiply out the gcd's, but I don't know where to go from there...

Let $a,b,n$ be integers such that  $\gcd(a,n)=\gcd(b,n)=1$. How to show that $\gcd(ab,n)=1$?   In other words, how to show that if two integers $a$ and $b$ each have no non-trivial common divisor with and integer $n$, then their product does no have a non-trivial common divisor with $n$ either.     This is a problem that is an exercise in my course.   Intuitively it seems plausible and it is easy to check in specific cases but how to  give an actual proof is not obvious.


I know that $\Bbb R$ has the same cardinality as $\Bbb R^2$, but can someone give me a bijective or even just a surjective function $f:\Bbb R \to \Bbb R^2$?

Please don't sign this as a duplicate of , they aren't. I am interested about the actual algorithm, not a proof of the existence.  Does a such mapping exists? I think, it must, because both of them have the same cardinality ($\aleph_1$).  My actual suggestion for a such mapping were simply merge the digits of the real numbers. For example, from $\pi$ and $e$ we could got  $3.1415...$ and $2.7182...$ would lead to $32.17411852...$ .  Although I am not sure it were ok. Maybe a better, clearer solution also exists?


I have read several articles on math.stackexchange.com, and also this article:   I still can't quite understand why one of the numbers can't be even. Especially this part: "Since any choice of even values of a and b leads to a ratio a/b that can be reduced by canceling a common factor of 2, we must assume that a and b are odd, and that the ratio a/b is already reduced to smallest possible terms."  Isn't 2/3 or 3/2 smallest possible terms as well?

It is well known that $\sqrt{2}$ is irrational, and by modifying the proof (replacing 'even' with 'divisible by $3$'), one can prove that $\sqrt{3}$ is irrational, as well.  On the other hand, clearly $\sqrt{n^2} = n$ for any positive integer $n$.  It seems that any positive integer has a square root that is either an integer or irrational number.        How do we prove that if $a \in  \mathbb N$, then $\sqrt a$ is an integer or an irrational number?      I also notice that I can modify the proof that $\sqrt{2}$ is irrational to prove that $\sqrt[3]{2}, \sqrt[4]{2}, \cdots$ are all irrational.  This suggests we can extend the previous result to other radicals.        Can we extend 1? That is, can we show that for any $a, b \in \mathbb{N}$, $a^{1/b}$ is either an integer or irrational?


I have a .NET 3.1 Core app. I am learning to use the Task Parallel library. To do this, I want to create a basic Task. I want to run this Task via an extension method. At this time, I have the following: var tasks = new List<Task<int>>();       // Used to track the calculated result var details = new List<Details>();       // Used for debugging purposes  var random = new Random();               // Used to generate a random wait time var offset = 10;                         // This value is used to perform a basic calculation  // The following tasks should run the tasks OUT OF ORDER (i.e. 4, 5, 2, 3, 1) var stopwatch = Stopwatch.StartNew();    // Keep track of how long all five calculations take for (var i=1; i<=5; i++) {   var shouldBe = i + offset;   var d = new Details();    var t = new Task<int>(() => {     var ms = random.Next(1001);    // Choose a wait time between 0 and 1 seconds     Thread.Sleep(ms);     d.SleepTime = ms;      var result = i + offset;     Console.WriteLine($"{i} + {offset} = {result}  (over {timeout} ms.)");     return result;   });    tasks.Add(t.ExecuteAsync<int>());   details.Add(d); } stopwatch.Stop();  Task.WaitAll(tasks.ToArray()); foreach (var t in tasks) {   Console.WriteLine($"Result: {t.Result}"); }  // Calculate how long the whole thing took var totalMilliseconds = 0.0; foreach (var log in logs) {   totalMilliseconds = totalMilliseconds + log.TotalMilliseconds; } Console.WriteLine($"Runtime: {stopwatch.Elapsed.TotalMilliseconds}, Execution: {totalMilliseconds}");  MyExtensions.cs namespace System.Threading.Tasks {   public static class MyExtensions   {     public static async Task<T> ExecuteAsync<T>(this Task<T> code, Details details)     {       T result = default(T);        Stopwatch stopwatch = Stopwatch.StartNew();       code.Start();       await code.ConfigureAwait(false);        result = code.Result;       stopwatch.Stop();        return result;     }   }    // The following class is only for debugging purposes   public class Details   {      public int SleepTime { get; set; }       public double TotalMilliseconds { get; set; }   } }  When I run this app, I see something like the following in the Terminal window: 6 + 10 = 16 (over 44 ms.) 6 + 10 = 16 (over 197 ms.) 6 + 10 = 16 (over 309 ms.) 6 + 10 = 16 (over 687 ms.) 6 + 10 = 16 (over 950 ms.) Result: 16 Result: 16 Result: 16 Result: 16 Result: 16 Runtime: 3.5835, Execution: 2204.62970000004  Based on this output, it appears I have five tasks running asynchronously. The sleep time changes each time (which is good). The runtime is less than the execution time, which implies the tasks are running in parallel. However, it's almost like the tasks get ran after the 'for' loop has finished. That's the only place I can see where the 6 is coming from. But, I don't understand why, or how to fix it. The results should be more like: 4 + 10 = 14  5 + 10 = 15  2 + 10 = 12  3 + 10 = 13  1 + 10 = 11  What am I doing wrong? Why is the same i value used each time? How do I fix this? Thank you so much for your help!

I met an interesting issue about C#. I have code like below.  List<Func<int>> actions = new List<Func<int>>();  int variable = 0; while (variable < 5) {     actions.Add(() => variable * 2);     ++ variable; }  foreach (var act in actions) {     Console.WriteLine(act.Invoke()); }   I expect it to output 0, 2, 4, 6, 8. However, it actually outputs five 10s.  It seems that it is due to all actions referring to one captured variable. As a result, when they get invoked, they all have same output.  Is there a way to work round this limit to have each action instance have its own captured variable?


I create new form with info path for sharepoint 2013 list, I need to get current week from system calendar. I have javascript to do that!! but I have no idea that where is code must be add? I open list by sharepoint designer 2013. these code must be add to NewForm or Views??  Thanks for your advice

how to place JS-code to NewForm.aspx of a list in SharePoint 2013 APP.  In sharepoint 2010 we can use this list definition to add JS:  <List ...>   <MetaData>     ...     <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" UseDefaultListFormWebPart="False">         <WebParts>           <AllUsersWebPart WebPartZoneID="Main" WebPartOrder="1">             <![CDATA[              <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2"                 xmlns:sfwp="http://schemas.microsoft.com/WebPart/v2/SimpleForm">               <Assembly>Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>                                        <TypeName>Microsoft.SharePoint.WebPartPages.SimpleFormWebPart</TypeName>               <FrameType>None</FrameType>               <Title>JS1</Title>               <sfwp:Content>ANY HTML YOU NEED HERE               </sfwp:Content>             </WebPart>             ]]>           </AllUsersWebPart>           <AllUsersWebPart WebPartZoneID="Main" WebPartOrder="2">             <![CDATA[             <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">               <Assembly>Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>                                        <TypeName>Microsoft.SharePoint.WebPartPages.ListFormWebPart</TypeName>               <PageType>PAGE_NEWFORM</PageType>             </WebPart>             ]]>           </AllUsersWebPart>         </WebParts>       </Form>     </Forms>   </MetaData> </List>   How to do the same for Sharepoint 2013?


i am using a macbook air and with yosmite os  At first I could still switch between desktops, just that i could not swipe up/down to access mission control and app exposé. I tried typing in killall Dock into terminal to restart dock, but now i cant switch desktops either and the background is completely black. killall dock just tells me it can't find the process for this user. when i typed in killall -s dock it showed only one process.  is there a way to force dock to start and fix mission control?

Mission Control isn't working on my Mac. I've tried killing the Dock through Terminal and Activity Monitor multiple times, but nothing seems to be working. Even shortcuts or Hot Corners don't work anymore.  What do I do?


My furnace is old and only has 4 wire connections, but I require a C wire. How can I create one based on this diagram?  I do have 5 wires running between the furnace and thermostat.

So, the spiffy new wi-fi thermostats want power on the C wire from thermostat, but the old thermostat doesn't have a C wire at it.  What's the easiest way to add the C wire/24 volt to the thermostat location?


I'm using package "color" to have a green text box with black text, and my code is -  \textbf{\fcolorbox{black}{green!30}{black text on a boxed green background}}   How can I get it to wrap lines please?  If it can't wrap with 'fcolorbox', what command would have the same effect and would wrap please?

LaTeX has soul. ConTeXt, of course, , where you can put sweet hightligher under your text for free!    In the pictured example, you can see highlights that not only highlight, but that do it with cool edges that look so good, you can smell fumes! The fearless author says he'll show how that was done in another post; this one shows only how to lay down a straight, yellow box. But, it is possible to do word-wrapped highlighting with cool-shapped boxes within ConTeXt, presumably.  The trouble for me is that getting into the ConTeXt world is steep climb right now, given the state of documentation and the flux of changes, so I need to continue with LaTeX. But the real problem is that now I can't live without the Organic-Looking Highlights of Awesomeness in that picture!  As I said, Non-Organic-Looking Highlights of the Ordinary are easy with the soul package:  \hl{Some awesome text that word wraps fine.}   It just taunts me on the page with its straight lines. So, if I sacrifice word wrapping, I can use PGF/TiKz and create the following macro:  \newcommand\hl[1]{%     \tikz[baseline,%       decoration={random steps,amplitude=1pt,segment length=15pt},%       outer sep=-15pt, inner sep = 0pt%     ]%    \node[decorate,rectangle,fill=navcolor,anchor=text]{#1\xspace};% }%   Which creates something like this:    Now, my color is too dark and my randomness needs adjusting, but you see that a similar effect could be achieved.  My trouble is that I don't understand TeX enough to dig into the Soul package and add the TiKz/PGF goodness that it so sorely needs. So, I leave it to you guys. Anyone want to tackle this?   Or is it yet another piece of fruit, just a touch out of reach, that shall have to wait until ConTeXt settles down?


Is it correct to say that $\emptyset\in\{\emptyset\}$? By definition, the empty set does not contain anything so how can we say that empty belongs to the empty set. And also whether it is right to say that the empty set is contained in empty? I am really confused about this. Please help.

I am on set section right now and I have questions about empty set  is an empty set an element of {empty set}? is an empty set a subset of {empty set}? is an empty set a proper subset of {empty set}?  I am just wondering because on the textbook didn't mention about these three? please bear with me I am really doubt a lot of things.  I got the questions online and I am practicing it right now so please     correct me if I am wrong.    a) {empty set} is an element of {empty set} = false    b) {empty set} is a subset of {empty set} = false    c) empty set is an element of {empty set,{empty set}}= true    d) {empty set} is an element of {{empty set}} = true    e) {{empty set}}is a proper subset of {empty set,{empty set}} = false   I hope I get em all right after you explained to me.  thank you :)


Is there a google chrome shortcut for opening a link on a new tab so we don't have to right-clivk? I'm looking at something like ctrl+click link and then page will open on a new tab similar to the way we can shift+click link to open page in a new window.

Is is possible to open a link in a new background tab in Google Chrome with a keyboard shortcut?  (I know it's possible with Ctrl+click and middle click, and I know that Shift+Enter opens the link in a new browser window.)


I am new in python and clustering problem. I need some help for visualization of clustered data.  I have some unlabeled data with 15 attributes and 30161 instances. I took 70% data for clustering and cluster those data into 2 cluster. I also added one column after clustering named 'cluster' and the column '<=50k' was label column. Now I need to plot those data except label column, How can I plot it ? Here's the sample of my code and data.  Data:    cols_x=train.columns[0:14] cols_y = train.columns[14] X = train[cols_x] y = train[cols_y]  from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.30,random_state=10)  kmeans = KMeans(n_clusters=2)  train["cluster"] = kmeans.fit_predict(train[X_train.columns[0:14]]) train.head(10)

I'm using R to do K-means clustering. I'm using 14 variables to run K-means   What is a pretty way to plot the results of K-means?  Are there any existing implementations? Does having 14 variables complicate plotting the results?    I found something called GGcluster which looks cool but it is still in development.  I also read something about sammon mapping, but didn't understand it very well. Would this be a good option?


I am trying to install Ubuntu but I get no partitions showing up in the installer and running sudo fdisk -lu /dev/sda gives me:  Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: dos Disk identifier: 0x38a2f2da Device     Boot      Start        End    Sectors   Size Id Type /dev/sda1  *          2048     206847     204800   100M  7 HPFS/NTFS/exFAT /dev/sda2         93851793  204796619  110944827  52.9G  7 HPFS/NTFS/exFAT /dev/sda3        204802048  757762047  552960000 263.7G  7 HPFS/NTFS/exFAT /dev/sda4           206849 1953521663 1953314815 931.4G  f W95 Ext'd (LBA) /dev/sda5           206912   93851729   93644818  44.7G  7 HPFS/NTFS/exFAT /dev/sda6        757764096 1310724095  552960000 263.7G  7 HPFS/NTFS/exFAT /dev/sda7       1310726144 1953521663  642795520 306.5G  7 HPFS/NTFS/exFAT Partition 2 does not start on physical sector boundary. Partition 4 does not start on physical sector boundary. Partition table entries are not in disk order.   I'm a total beginner with Unix and know this is because of WD's Advanced Formatting by Googling the issue but I have no idea how to fix it. I have a free partition that I want to install Ubuntu to but only /sda shows up as an whole block in the installer.

I've one HD on my laptop, with two partitions (one ext3 with Ubuntu 12.04 installed and one swap).  fdisk is giving me a Partition 1 does not start on physical sector boundary warning. What is the cause and do I need to fix it? If so, how?    This is sudo fdisk -l:  Disk /dev/sda: 750.2 GB, 750156374016 bytes 255 testine, 63 settori/tracce, 91201 cilindri, totale 1465149168 settori Unità = settori di 1 * 512 = 512 byte Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Identificativo disco: 0x5a25087f  Dispositivo Boot      Start         End      Blocks   Id  System /dev/sda1   *          63  1448577023   724288480+  83  Linux Partition 1 does not start on physical sector boundary. /dev/sda2      1448577024  1465147391     8285184   82  Linux swap / Solaris   This is sudo lshw related result:   *-disk                 description: ATA Disk                 product: WDC WD7500BPKT-0                 vendor: Western Digital                 physical id: 0                 bus info: scsi@0:0.0.0                 logical name: /dev/sda                 version: 01.0                 serial: WD-WX21CC1T0847                 size: 698GiB (750GB)                 capabilities: partitioned partitioned:dos                 configuration: ansiversion=5 signature=5a25087f               *-volume:0                    description: EXT3 volume                    vendor: Linux                    physical id: 1                    bus info: scsi@0:0.0.0,1                    logical name: /dev/sda1                    logical name: /                    version: 1.0                    serial: cc5c562a-bc59-4a37-b589-805b27b2cbd7                    size: 690GiB                    capacity: 690GiB                    capabilities: primary bootable journaled extended_attributes large_files recover ext3 ext2 initialized                    configuration: created=2010-02-27 09:18:28 filesystem=ext3 modified=2012-06-23 18:33:59 mount.fstype=ext3 mount.options=rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered mounted=2012-06-28 00:20:47 state=mounted               *-volume:1                    description: Linux swap volume                    physical id: 2                    bus info: scsi@0:0.0.0,2                    logical name: /dev/sda2                    version: 1                    serial: 16a7fee0-be9e-4e34-9dc3-28f4eeb61bf6                    size: 8091MiB                    capacity: 8091MiB                    capabilities: primary nofs swap initialized                    configuration: filesystem=swap pagesize=4096   These are related /etc/fstab lines:  UUID=cc5c562a-bc59-4a37-b589-805b27b2cbd7 /               ext3    errors=remount-ro,user_xattr 0       1 UUID=16a7fee0-be9e-4e34-9dc3-28f4eeb61bf6 none            swap    sw              0       0


One of the members of our group likes to choose characters with personal agendas or secret motives that prevent him from cooperating with the rest of the team.  He will sit out of missions entirely if he feels like they go against his character's motives.   This would be alright if he did not affect the other players, but that isn't always the case. Once during an important battle, he targeted a player character instead of fighting with us. (He tied this player up, making it impossible for them to do anything except try to escape on their turn. They were in a pretty sour mood because of this.) The GM did their best to make sure we weren't punished because of him, but everyone got pretty frustrated and we had to call the game. The players and the GM have talked with him about this, but he has made it clear that this is how he enjoys playing campaigns.   Is this something anyone has dealt with before? How should we deal with an overly stubborn player?

I've been reading forum posts and blogs who mention "my guy" syndrome as a specific type of difficult player, but I can't seem to find a solid definition for the term. Can someone explain this particular kind of problem player to me? How do you deal with this kind of problem?


I'm trying to write a bash script to prompt a user for a filename, and if the file exists, allow them to overwrite or append the file.  For some reason, I keep getting returned with a syntax error despite having an issue.  Unfortunately, I am not as familiar with Bash as I am with Python, and find myself confusing the syntax of the two.  Nevertheless, please see below:  #!/bin/bash echo "Please enter the name of your destination file: " read destFile if [ -f "$destFile" ]; then     echo "This file exists." fi echo "Please enter the name of your source file: " read sourceFile echo "Do you want to 1) Overwrite, 2) Append, 3) Exit?" echo "Please select your option: " options=("Overwrite" "Append" "Exit") while [ -e "$sourceFile" ]; do     select opt in "${options[@]}"; do         case "$opt" in         "Overwrite")             cp "$sourceFile" "$destFile"             echo "Copy Completed."               ;;         "Append" )             cat "$sourceFile" >> "$destFile"             echo "Append Completed."             ;;         "Exit" )             echo "Script Terminated"             break             ;;         esac         break     done done

Is there any way to debug bash script without using echo and logging?  I'm talking about using breakpoints and stuff like that.


Can a MWE be given showing the difference, relationship and usage of \makeatletter and \makeatother ? The existing answer explain these commands but do not provide a useful MWE which would show the usage of them. They say \makeatletter % changes the catcode of @ to 11 <your changes here> \makeatother % changes the catcode of @ back to 12

Many LaTeX “hacks” begin with \makeatletter and end with \makeatother. What do these commands do?


<% if @questions_counter == 2 %>    <% if @finish == 0 %>     $("#initial-question-frame").fadeOut('fast');     $("#next-question-frame").html("<%= escape_javascript(render(:partial => "question", :locals => {:question => @question, :finish_btn => @finish_btn })) %>").fadeIn();   <% else %>     $("#next-question-frame").html("<%= escape_javascript(render(:partial => "grade", :locals => {:correct_answers => @correct_answers, :grade => @grade, :total_questions => @total_questions })) %>").fadeIn();   <% end %> <% else %>    <% if @finish == 0 %>     $("#next-question-frame").html("<%= escape_javascript(render(:partial => "question", :locals => {:question => @question, :finish_btn => @finish_btn })) %>").fadeIn();   <% else %>     $("#next-question-frame").html("<%= escape_javascript(render(:partial => "grade", :locals => {:correct_answers => @correct_answers, :grade => @grade, :total_questions => @total_questions })) %>").fadeIn();   <% end %> <% end %>  $(document).ready(function(){     $(":checkbox").on('change',function() {       var that = this;        if (!$(this).parent().hasClass("remember-label")){         $(this).parent().css("background-color", function() {             return that.checked ? "#C0E9F7" : "";         });       }      });      $("input[type=radio]").on('change',function() {       $(this).parents().eq(1).siblings().css("backgroundColor","");       $(this).parents().eq(1).css("backgroundColor","#C0E9F7");      });  });   Under normal circumstances the javascript code if the page is reloaded properly it works. If its like this though it does not work. When i click on label which wraps the inputs and it has correct for attribute, nothing happens not even the checkbox/radio button gets checked.  <label for="choice_<%= choice.id %>">             <%= radio_button_tag("choice","#{choice.id}",false,class:"radio big-radio") %>             <% if choice.image? %>               <%= image_tag rewrite_url(choice.image_url(:resized)), class:"choice-image" %>             <% else %>               <%= choice.description %>             <% end %>            </label>

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


Let $f$ be a function that has a continuous derivative over the interval $[a,b]$ and let $f(a)=f(b)=0$.  Prove that $$\max\:\left|f'\left(x\right)\right|\ge \frac{4}{\left(b-a\right)^2}\int _a^b\:\left|f\left(x\right)\right|dx$$  I proceeded by splitting up the integral into 2 parts i.e from $a$ to $(a+b)/2$ and from $(a+b)/2$ to $b$, but got stuck, please help?

Let ${\rm f}:\left[a, b\right]\to\mathbb{R}$ be twice differentiable, and suppose   $$\lim_{x\to a^{+}} \frac{{\rm f}\left(x\right) - {\rm f}\left(a\right)}{x - a} = \lim_{x\to b^{-}}\frac{{\rm f}\left(x\right) - {\rm f}\left(b\right)}{x - b} =0 $$  Show that there exists $\xi \in \left(a, b\right)$ such that $\displaystyle{% \left\vert\vphantom{\Large A}\,{\rm f}''\left(\xi\right)\right\vert \geq \frac{4\left\vert\vphantom{\Large A}% \,{\rm f}\left(a\right) - {\rm f}\left(b\right)\right\vert} {\left(b - a\right)^{2}}}$.  I don't know how to start. Any hints ?.


I believe I recently had some comments deleted by a moderator from an answer I wrote and just wondered if there is any way for me to see my own (or others) deleted comments?  I understand from  on Meta that aside from a user deleting their own comment, this can also be done by a moderator (either of their own volition, or as a response to flagging of that comment), but didn't realise that there was no audit left to help me realise this had been done - leaving me initially scratching my head and wondering if the comments were even there in the first place!  I'm not disputing that the comments in this particular instance should have been deleted (they involved another user helpfully suggesting a possible issue with my answer, which I then corrected) - hence why I have not included a link to the answer - but it would still be helpful to be able to know that they used to exist.   Plus I can easily imagine situations where the deletion of one or more comments might be objectionable to the commentor, questioner or answerer relevant to the comment - do we just have to trust the moderators here, without any ability to audit what they've deleted (whether that be our own comments, or comments on our own questions/answers)?  Perhaps my answer is , but that question is several years old, so I hope it's not unacceptable to ask this similar question now to confirm all is still the same.

Do 10k (and moderator) users have the ability to read deleted comments (are comments deleted forever, or never really deleted like questions and answers)?


To find the unique path from starting (origin) to end in a M x N matrix I am able to do a backtracking recursion implementation. I tried extending the approach with dynamic programming using the memorization technique. Can some one point to the problem/issue with the below code? class Solution():     def uniquePaths(self, m, n):         """         :type m: int         :type n: int         :rtype: int         """         self.dp = [[-1] * n] * m         return self.getuniquePath(0, 0, m, n)      def getuniquePath(self, row, col, m, n):          if row == m or col == n:             return 0         if row == m - 1 and col == n - 1:             self.dp[row][col]=1             return 1          if self.dp[row][col] != -1:             return self.dp[row][col]         self.dp[row][col] = self.getuniquePath(row + 1, col, m, n)+ self.getuniquePath(row, col + 1, m, n)          return self.dp[row][col]  s1=Solution() print s1.uniquePaths(3,3)

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


As I am not expert in handling of dates in java but I am unable to understand this behaviour.Here is my code  Date from = new SimpleDateFormat("dd/MM/yyyy").parse("05/07/2013"); System.out.println(from);     which gave me this output    Sat Jul 05 00:07:00 PKT 2013   And this is 2nd another code snippet   Date from = new SimpleDateFormat("dd/mm/yyyy").parse("05/07/2013"); System.out.println(from);    which gave me this output: Sat Jan 05 00:07:00 PKT 2013   Now the thing which is considerable is format. This format dd/MM/yyyy which have MM gave me correct output but this format dd/mm/yyyy which have small mm gave me wrong output (always give jan in month).I read the doc where it is mentioned that samll m is for minutes and capital M is for month My question is Can I never use small m here? if no , then why it is giving the result and on which basis it is giving jan everytime I know this is a basic question but after searching and after not finding any understandable thing , I posted it.Thanks

I have a String representation of a date that I need to create a Date or Calendar object from. I've looked through Date and Calendar APIs but haven't found anything that can do this other than creating my own ugly parse method. I know there must be a way, does anyone know of a solution?


I shutdown my MBP when it had 1% battery after that when I turn it on, I get this screen, anyone knows what to do? I know my password. When I choose forgot password it wants to restart to a recovery mode. I'm panicked to lose my data.

Something came up today that bugged me a bit, I left my laptop on battery power before going to bed. When starting it up the battery was dead. I plugged it in, and here is what happened:  The startup progress bar came up for a while and then a forgot password prompt came up, with questions like: "set a new password" + 2 other options that I can't remember (they weren't relevant) and a previous and next arrows.  Puzzled, I hit previous and the dialog froze. I proceeded to restart again and ended up on the same dialog, I reset my password to the same as my previous and that was it.  Any idea what might have happened?


The short version of my question: What is $\langle x | p \rangle$ and why does it look like it looks?  Now the long version: Let $|x\rangle$ be the orthonormalized eigenstates and of the spatial operator $\hat x$ with eigenvalues x and $|p\rangle$ be the orthonormalized eigenstates and of the momentum operator $\hat p$ with eigenvalues p. I'm "guessing" that $$ \tag{a}\label{eq:x_on_p} \langle x | p \rangle = \frac 1 {\sqrt{(2 \pi)^d \hbar}} e^{ipx/\hbar},  $$ where $d$ is the number of spatial dimensions, but I haven't found a convincing proof for this. So I tried to find one on my own, which has a problem that I want to share, hoping to find a solution with your help.  As a postulate I'm assuming that $$  \tag{b}\label{eq:x_on_p_operator} \langle x | \hat p = -i \hbar \nabla \langle x |. $$  Using this, I now want to find out how $\langle x | p \rangle$ looks. Starting with the equation $$ \hat p | p \rangle = p | p \rangle,$$ multiplying it with $\langle x|$ from the left and using \eqref{eq:x_on_p_operator} leads to $$   -i \hbar \nabla_x \langle x|p \rangle = p \langle x|p \rangle. $$ This ODE has the solution $$   \tag{c}\label{eq:unnormalized_solution}   \langle x|p \rangle = C \exp\left( i p x / \hbar \right) $$ with $C$ being a constant. Now let's assume that $| q \rangle$ are the same eigenstates of $\hat p$ as our $|p\rangle$, but of course with eigenvalues $q$. Then $$ \tag{d}\label{eq:one_equals} 1  =  \int \text{d} q \ | q \rangle \langle q | \int \text{d} x \ | x \rangle \langle x | \int \text{d} p \ | p \rangle \langle p | \overset{\eqref{eq:unnormalized_solution}} =  |C|^2 \int \text{d} q  \int \text{d} p \ | q \rangle \langle p |  \int \text{d} x \ e^{i(p-q)x/\hbar} . $$ Now I'm using the fact, that the delta distribution has a representation $$ \delta(p-q) = \frac 1 {(2\pi)^d \hbar} \int \text d x \ e^{i(p-q)x/\hbar}, $$ where $d$ is the number of dimensions of the argument $(p-q)$. Plugging that into \eqref{eq:one_equals} yields $$ |C| = \frac 1 {\sqrt{(2 \pi)^d \hbar}}. $$  This looks very close to what I wanted to proof, but i'm stuck at this point. How can I show that $C$ has no imaginary party? Usually when textbooks on QM come to this point, it's said that the complex phases of the eigenstates don't matter and can therefore chosen that $C$ appearing in \eqref{eq:unnormalized_solution} is real valued. But I think this is not the true story in this case. My thoughts go like this: Take an arbitrary $|x_0\rangle$. Then we can modify all of our $|p\rangle$s so that $C$ in $\langle x_0 | p \rangle$ is real valued. By doing so, the phases of all our $|p\rangle$ are now fixed. Now lets take a different spatial eigenstate $|x_1\rangle$. Of course we can adjust it's phase, that for some specific $|p_0\rangle$ the $C$ in $\langle x_1 | p_0\rangle$ is real, but what we need is $\langle x_1 | p \rangle$ to be real for ALL $|p\rangle$. Summing it up, it seems as the problem of making $C$ real valued can not be solved by modifying the phases of the spatial and momentum eigenstates.  Is there another way to show that $C$ is real?

I'm curious whether I can find the overlap $\langle q | p \rangle$ knowing only the following:   $|q\rangle$ is an eigenvector of an operator $Q$ with eigenvalue $q$. $|p\rangle$ is an eigenvector of an operator $P$ with eigenvalue $p$. $Q$ and $P$ are Hermitian. $[Q,P] = i \hbar$.   I'm asking because books and references I've looked in tend to assume that $Q$ is a differential operator when viewed in the $P$-basis, then show that it satisfies the commutation relation. (I haven't read one yet that proves that the form given for $Q$ is the only possible one.) I've heard, though, that we can work purely from the hypothesis of the commutation relation and prove the properties of $Q$ and $P$ from it.


I want to go from:   www.website.com/directory/results?category=10&dir=asc   to   www.website.com/staticfile.html   I tried the following and it doesn't seem to catch:   RewriteRule "^directory\/results\?category=10&dir=asc" "\/staticfile\.html" [R, L]   I can get it to redirect using:   RewriteCond %{REQUEST_URI} "^directory\/results" [NC]  RewriteCond %{QUERY_STRING] category=10&dir=asc  RewriteRule (.*) "\/staticfile\.html"   But then it appends the parameters after html in the last example.

This is a  about Apache's mod_rewrite.   Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes such things as:   Changing HTTP to HTTPS (or the other way around) Changing a request to a page which no longer exist to a new replacement. Modifying a URL format (such as ?id=3433 to /id/3433 ) Presenting a different page based on the browser, based on the referrer, based on anything possible under the moon and sun. Anything you want to mess around with URL   Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask!  How can I become an expert at writing mod_rewrite rules?   What is the fundamental format and structure of mod_rewrite rules? What form/flavor of regular expressions do I need to have a solid grasp of? What are the most common mistakes/pitfalls when writing rewrite rules? What is a good method for testing and verifying mod_rewrite rules? Are there SEO or performance implications of mod_rewrite rules I should be aware of? Are there common situations where mod_rewrite might seem like the right tool for the job but isn't? What are some common examples?   A place to test your rules  The  web site is a great place to play around with your rules and test them. It even shows the debug output so you can see what matched and what did not.


I need a site without page style at the end of a document. But the command doesn´t work. How can I solve this?      \documentclass[BCOR=10mm,DIV=11] {scrreprt} \usepackage{setspace} \usepackage{blindtext} \usepackage[     automark,                               %% Kapitelangaben in Kopfzeile automatisch erstellen     headsepline,      footsepline,      plainheadsepline,      plainfootsepline ]{scrlayer-scrpage}  \setkomafont{captionlabel}{\bfseries}           %% Label-Bildunterschrift fett \setkomafont{pageheadfoot}{\small}          %% Kopfzeile klein %\setheadsepline{0.4pt}                         %% Kopf-Linie %\setfootsepline{0.4pt}                         %% Fuß-Linie  \pagestyle{scrheadings} \ihead[]{} \chead[]{} \ohead[\headmark]{\headmark}  \ifoot[]{} \cfoot[\pagemark]{\pagemark} \ofoot[]{}  \AfterTOCHead{\singlespacing} \onehalfspacing \KOMAoptions{DIV=last}  \begin{document}  \begin{spacing}{1} \title{Titel} \author{1} \end{spacing}  \begin{spacing}{1} \maketitle \end{spacing}  \tableofcontents  \chapter{Test} \subsection{1} \subsection{2} \Blindtext  \chapter{Test1} \subsection{1} \subsection{2} \Blindtext  \chapter{Test2} \subsection{1} \subsection{2} \Blindtext  \chapter{Test3} \subsection{1} \subsection{2} \Blindtext  \chapter{Test4} \subsection{1} \subsection{2} \Blindtext  \chapter{Test4} \subsection{1} \subsection{2} \Blindtext  \chapter{Test4} \subsection{1} \subsection{2} \Blindtext  \chapter{Test4} \subsection{1} \subsection{2} \Blindtext  \chapter{Test4} \subsection{1} \subsection{2} \Blindtext  \chapter{Test4} \subsection{1} \subsection{2} \Blindtext  \thispagestyle{empty} \chapter*{Erklärung} %\begin{flushleft} \vspace*{10ex} %\noindent\textit{Hiermit versichere ich, dass ich die vorliegende Abschlussarbeit selbstständig verfasst und keine anderen als die angegebenen Quellen und Hilfsmittel verwendet %habe.} \par\vspace{1ex} %\noindent \noindent\textit{Ich erkläre hiermit eidesstattlich, dass ich die vorliegende Arbeit selbständig angefertigt habe. Die aus fremden Quellen übernommenen Gedanken  sind als solche kenntlich gemacht. Die Arbeit wurde bisher keiner anderen Prüfungsbehörde vorgelegt und auch nicht veröffentlicht. Ich bin mir bewusst, dass eine unwahre Erklärung rechtliche Folgen haben kann.}\par\vspace{3ex} \noindent \rule[0.0cm]{4.3cm}{0.4pt}\par \noindent \par\vspace{8ex}  \noindent\textit{Seitens des Verfassers bestehen keine Einwände, die Arbeit für die öffentliche Nutzung zur Verfügung zu stellen.} \par\vspace{3ex} \noindent \rule[0.0cm]{4.3cm}{0.4pt}\par \noindent %\end{flushleft} \end{document}

I am having some issues with the hyperref package. I would like to create a Introduction chapter without a number so I use \chapter*{Introduction} and \addcontentsline{toc}{chapter}{Introduction} because I want it in the table of contents (see example).  But then the link in my PDF viewer gets it wrong and also the automatically created header is no longer correct (see picture). The table of contents shows the right page number (p.1) but the link is also wrong.   What is my mistake here?  \documentclass{scrbook}  \usepackage{hyperref} \usepackage{blindtext} \usepackage{glossaries}   \makeglossaries  \newacronym{eg}{e.g.}{% for example }   \begin{document}   \frontmatter  % abstract before the table of contents \chapter*{Abstract} \addcontentsline{toc}{chapter}{Abstract} \blindtext  \tableofcontents  % chapter with acronyms \cleardoublepage \phantomsection  \printglossary[type=\acronymtype] \addcontentsline{toc}{chapter}{Glossary}  \cleardoublepage \mainmatter   \phantomsection % \chapter{Introduction} % with this everything is correct but I don't want the number \chapter*{Introduction} \addcontentsline{toc}{chapter}{Introduction}  \blindtext  \pagebreak  \blindtext  % first chapter \chapter{Chapter1}  \gls{eg} \blindtext  \pagebreak  \blindtext   \end{document}


I would like to know if there's an "automated" (non manual) way to allow footnotes to be displayed on a different (say, adjacent) page from the one where the marker appears. I ask this because I am writing a thesis with a lot of footnotes and some of them are very long and related to words close on the main text so that, being unable to put both footnotes on the correct pages, the compiler just send the main text (where the footnotes appear on close words) to another page, leaving a lot of blank space on the previous page; I would just prefer if the main text and the footnote marker could be kept on the "first" page and the relative footnote text be displayed at the bottom of the next page. I'm using report document class  \documentclass[a4paper,12pt,oneside]{report}  and the only package footnotes-related I added is footmisc  \usepackage[bottom]{footmisc}  Also, the following commands are included in the preamble (I don't know if this is relevant)  %Set space between footnotes and main text \setlength{\skip\footins}{0.7cm} %Set space between footnotes \setlength{\footnotesep}{0.4cm}  Thanks in advance for your help!

If a document has very long footnotes close to each other in the main text, LaTeX start to compensate for this by breaking the page (see the first picture below).  I am grateful that TeX makes an effort to put footnotes close to the corresponding mark, but no thank you, TeX, this is too much. No matter what, it should not break the page, nor make the paragraph skips longer (which is almost as ugly) or use any of its other usual, dirty tricks; I prefer having the footnote five pages after the mark if that is what it takes. Can someone find a way to make TeX stop breaking the page like this?  I tried experimenting with both bigfoot and interfootnotelinepenalty=0, which changed the input, but did not remove the problem. Furthermore, bigfoot caused the nightmare shown on the second picture below. Notice that the footnotes run out of the page itself.  Note that memoir is not the problem either; change to article and load geometry, and exactly the same happens. Also, the A5 format is not the issue either; it just makes the problem even worse than when using A4.  A MWE:  \documentclass[a5paper]{memoir}  \usepackage{lipsum} %\usepackage{bigfoot} %\interfootnotelinepenalty=0  \begin{document}     \lipsum[1]\footnote{\lipsum[1-10]}     \lipsum[1]\footnote{\lipsum[1-15]}     \lipsum[1]\footnote{\lipsum[1-10]}     This needs a footnote\footnote{\lipsum[1-10]}, and it is very necessary in order not to cause confusion. \end{document}   The output:    The output with bigfoot:


I don't know anything about this topic. Can you explain and describe standard error of the mean?

I'm struggling to understand the difference between the standard error and the standard deviation. How are they different and why do you need to measure the standard error?


At the beginning of 'Force Awakens', Kylo easily holds a blaster shot in-air, but towards the end, he does not stop Chewbacca's Bowcaster shot.  Why?

How does Kylo Ren stop the blaster shot in the beginning when being shot at by Poe, only to be unaware of the coming blaster shot from Chewbacca, which seems much more predictable.   I am sure he knew Chewbacca, Rey and Finn where there as Chewbacca turns with the opening of the doors when Rey and Finn come in.  EDIT in regards to Richards Answer: I just want to expand a little more on question. What I don't understand is that Kylo Ren uses the force, so it is just not a matter him not hearing. When Poe shoots him from behind, he makes no sound, but yet he turns and stops the blaster and Poe. That has to be due to the power he commands in the Force.  And this is from Obi-Wan Kenobi:     "Well, the Force is what gives a Jedi his power. It's an energy field   created by all living things. It surrounds us and penetrates us; it   binds the galaxy together."―Obi-Wan Kenobi —   So it seems to me that it would be very hard for him even in a weakened state to not even notice that he was being shot at by virtue of the force being a part of Sith and Jedi's alike. Even if he was too weak to actually stop the blaster, the Force should have been able to warn him.


Just in case this is relevant: I've set up git on a Windows PC and every time I edit and save a change in a LaTex file (using Tex Studio) a new .tex file is created. See here:    'The_Cult' is the original LaTex file and the file below it is the new file.  Every time I make any edit and save one of these files is created.  This makes for a very messy work folder.  Any ideas why this is happening and how I can prevent it?

I need to compile between two and four times before I see changes I make in the editor (TeXstudio) and each time I compile, a new .tex file is created with random letters and numbers at the end.   For example, If I create the file hello.tex and compile two to four times I'll get the file,   hello.tex.QU6664      then I make some small changes in the editor and compile two to four times I'll get the additional file,   hello.tex.Ak6664   After continuing to do this (each time compiling between two to four times before I see the changes I made), I now have many files that look like  hello.tex.QU6664, hello.tex.Ak6664, hello.tex.YX6664, hello.tex.sN6664, hello.tex.Ss6664, ...   A little bit of additional information (in case it's relevant): Everything was working fine up until a few days ago, i.e. only needed to compile once and only the file hello.tex was created. I still only get one .aux,  .synctex and .pdf files. I use TeXstudio to write and compile. I don't think it has anything to do with the bibliography (I tried removing bibliography altogether and still having the same problem).  How do I prevent these additional files from appearing and only compiling once like I used to? Has anyone had a similar problem?


I am creating a program written in Java using Eclipse, and JDK 8. I have created a Scanner using this code: Scanner input = new Scanner(System.in);  I then created a String using the code String command = "no";  I planned on using this string to control a while loop in my code, and a switch within the while loop. The loop starts with: while(command = "no") and within the while loop, I use the Scanner I created earlier to get the user to define values for a String and an int, which when the code is executed, works. After that (but still within the while loop, I put command = input.nextLine();, followed by input.close(); on the line below, to set the value of the command string, and close the Scanner. But when I execute the code, it seems to skip that, and the switch which I put directly after that (which should also be controlled by the command string), and go on to code after the while loop, even though command is still set to "no", which should make the while loop start again.  How do I make the code pause and wait for something to be entered at command = input.nextLine();, and how do i make the switch work like it should?  Here is the entire code:  `import java.util.Scanner;  class Human {     private String name;     private int age;      public void setName(String name) {         this.name = name;     }      public void setAge(int age) {         this.age = age;     }      public String getName() {         String name = this.name;         return name;     }      public int getAge() {         int age = this.age;         return age;     } }  public class Asdfghjkl {      public static void main(String[] args) {          Scanner input = new Scanner(System.in);          String command = "no";          int age;         String name;          while(command == "no") {             System.out.println("Welcome to HUMAN CREATOR");             System.out.println("What is the human's name?");             name = input.nextLine();             System.out.println("Okay, its name is " + name + ".");              System.out.println("What about its age?");             age = input.nextInt();             System.out.println(name + " is " + age + " years old.");             System.out.println("Is this correct?");             command = input.nextLine();              switch (command) {             case ("yes"):                 System.out.println("Great! Lets make the human!");                 Human h1 = new Human();                 h1.setAge(age);                 h1.setName(name);              case ("no"):                 System.out.println("Okay, lets start again.");             }         }         System.out.println("qwerty");             input.close();     } }

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I have a simple script which displays current memory usage, disk usage, and CPU load within a terminal. Here is the code so you can see what I mean:  free -m | awk 'NR==2{printf " | Memory Usage: %s/%sMB (%.2f%%)|\n", $3,$2,$3*100/$2 }'  df -h | awk '$NF=="/"{printf " | Disk Usage: %d/%dGB (%s) |\n", $3,$2,$5}'  top -bn1 | grep load | awk '{printf " | CPU Load: %.2f |\n", $(NF-2)}'   The problem is that it only runs that code within the script 1 time. I need to automatically keep running that script every 1 second without having to keep reloading the script. So basically I just want it in some sort of continuous loop while the script can do other stuff.   The reason I want it to continue to refresh every 1 second, is because it only shows the CPU usage 1 time right when you run the script, but CPU changes frequently, so I need it to keep displaying current data.

I am trying to make a timer in Bash which countdowns 20 minutes and then starts a 10 minute break immediately after the previous. Then the loop  continues and returns again to 20 minutes.   #!/bin/bash MIN=20 BREAK=10 while [[ 0 -ne $MIN ]]; do     echo "$MIN"     sleep 1     MIN=$[$MIN-1] done WHILE [[ 0 -ne $BREAK ]]; do     echo "$BREAK"     sleep 1     BREAK=$[$BREAK-1] done   I made it with seconds here. So 20 seconds pass by and then the 10 seconds start immediately. But when the 10 seconds expire the script stops. Is there a way to start again with 20 minutes?  Thank you!


I've read a number of questions on stackoverflow regarding implicit and explicit constructors, but I'm still having trouble distinguishing between an implicit and explicit constructors.  I was wondering if someone could give me a good definition and some examples or maybe direct me to a book / resources that explains this concept well

What does the explicit keyword mean in C++?