Custom admin column disappearing when using Quick Edit

I have added a featured image column to my posts in the WP admin. This all works fine except when using the Quick Edit feature. Upon update, the column disappears, or rather isn't returned by the ajax save function. The column header remains, but the row being updated no longer has a featured image cell, resulting in a "blank" cell at the end of the row (all the default cells shifts left).  I'm unsure where to look to address this issue and haven't had any luck finding an answer.  Thanks for any help.  EDIT: Here is the code to add the custom column. The filter and action are called in the plugin's __construct      // Set featured image columns     add_filter('manage_edit-post_columns', array($this, 'set_custom_columns'));     add_action( 'manage_post_posts_custom_column', array( $this, 'set_custom_column_data' ), 10, 2 );      /**      * Function to create featured image column      * @param $columns      * @return array      */     public function set_custom_columns($columns)     {          if ( !is_array( $columns ) ) {             $columns = array();         }          $new_columns = array();          foreach( $columns as $key => $label ) {             if ( $key == 'title' ) { // Put the Thumbnail column before the Title column                 $new_columns['featured-image'] = __( 'Image', $this->plugin_slug );             }              $new_columns[$key] = $label;         }          return $new_columns;     }      /**      * Display custom column data      */     public function set_custom_column_data( $column_name, $post_id ) {          // If featured image column and a featured image exists, display it         if ( 'featured-image' == $column_name ) {             if ( has_post_thumbnail( $post_id ) ) {                 echo get_the_post_thumbnail($post_id, 'thumbnail');             }         }     }


How to prove that this limit approaches derivative of f at point c?

Suppose that $f$ is a function that is differentiable  at point $c$. Sequences $\{a_n\}_{n=1}^\infty$, $\{b_n\}_{n=1}^\infty$ have the property that for each $n$, $a_n < c < b_n$ and $\lim_{n \to \infty} a_n = \lim_{n \to \infty} b_n = c$. Prove that $\lim_{n \to \infty} \dfrac{f(b_n) - f(a_n)}{b_n - a_n} = f'(c)$.  I tried to do some manipulation inside the limit of left side to make it related to $f'(c)$, but it didn't work. Can someone give me a hint of the solution?


Someone is attacking my website via SQL-Injection. What should I do?

I have a website which has a search box. Some jerk is trying to run sql injection through the search box. I'm escaping it using mysqli_real_escape_string... but I want to know is there anything else i can do to make sure it is safe. and what can i do with that jerk. I only have his ip. I tried to find his location through whatismyipaddress.com and there's already a report pointing that he/she is known for attacking website via sql injection.  He tried the following codes:  '\' and \'x\'=\'x' i  AND 1=1  2121121121212.1  and 1=1  and 1>1


I've installed Skype and it's running all OK but I want it to start automatically when I log with my user.  How can I do that?


Why does frequency remain the same when waves travel from one medium to another?

I was reading about reflection and refraction on BBC Bitesize and I can't understand why frequency is a constant in the wave speed equation. I can't visualise the idea of it. I know that wave speed and wavelength are proportional to each other but how can I tell the speed of a wave by looking at a random oscillation?  Here's where I got confused:  (the bottom of the page about the water)


How does systemd use /etc/init.d scripts?

I just switched to debian jessie, and most things run okay, including my graphical display manager wdm.  The thing is, I just don't understand how this works. Obviously my /etc/init.d/wdm script is called, because when I put an early exit in there, wdm is not started. But when I alternatively rename the  /etc/rc3.d directory (my default runlevel used to be 3), then wdm is still started.  I could not find out how systemd finds this script and I do not understand what it does to all the other init.d scripts.   When and how does systemd run init.d scrips? In the long run, should I get rid of all init.d scripts?


I have a pgf picture which I insert with:  \input{m1.pgf}   But the image is too big. Instead of regenerating a smaller image, I'd rather take advantage of vector graphics, and have XeLaTeX scale it. How do I set the width of pgf picture (keeping its aspect ratio)?  MWE  tex:  \documentclass{article}  \usepackage{fontspec} % enagles loading of OpenType fonts \usepackage{polyglossia} % support for languages  % fonts: \defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text} % without this XeLaTeX won't turn "--" into dashes \setmainfont{DejaVu Sans} \setsansfont{DejaVu Sans} \setmonofont{DejaVu Sans Mono}  % pgf: \usepackage{pgf}  \begin{document}  \input{m1.pgf}  \end{document}   Sample pgf:  (it's too big to cite it here, and I can't make much smaller).


I'm having trouble finding a simple answer to this question (maybe because there isn't one), but I'm just confused about how the Schrödinger Equation would look for two electrons. I understand that it would exist in 6 dimensional configuration space, but how does the potential look? It's confusing that the potential would be different for each electron depending on where the other one is.


For what pair of integers $(a,b)$ is $3^a + 7^b$ a perfect square.

Problem: For what pair of positive integers $(a,b)$ is $3^a + 7^b$ a perfect square.  First obviously $(1,0)$ works since $4$ is a perfect square, $(0,0)$ does not work, and $(0,1)$ does not work, so we can exclude cases where $a$ or $b$ are zero for the remainder of this post.  I have a few observations made but not much room for a full solution.   First, since powers of an odd number are odd, and the sum of two odd numbers is even, so the base of the square must be an even number.  Secondly, the last digit of the powers of $3$ are $\{1,3,7,9 \}$ , whereas the last digits of the powers of $7$ are $\{7,9,3,1 \}$.  From here I am not sure how to proceed and any hints much appreciated. I'm not sure if there a finite amount of pairs or not either.


Why is the sizeof of a structure larger than the sum of its parts?

typedef struct{        short age;        int money;        char c;         }Persoana;            int main(void){        Persoana *a = malloc(sizeof(Persoana));        printf("%ld   %ld",sizeof(a->money),sizeof(a->age));        printf("   %ld\n",sizeof(*a));   } ~   The code prints "4212".4 and 2 are ok but how so 12???


I'm completely new to LINQ, i want to rewrite some of mine SQL querys into LINQ (just to learn) and i'v already stuck at the beginning.  Here is SQL query :  declare @typMon varchar(200) set @typMon = 'moneta'  select *  from [db1].[dbo].[Picking]  where number = 1000 and Group IN (Select grupa                from [db2].[dbo].[groups]                where typ = @typMon)   Subquery returns 3 output rows :   And here is what i'v write in LINQ   This part works ok :  var query = from x in db.grupyTowarowes             where x.typ == typMoneta             select new             {                 x.grupa             };   Problem is here:  var test = from z in dbContext.PICKINGs            where z.Number == 1000             && z.group IN output from 1st query            select new            {                z.id            };


I have been feeling this way for a while, looking at task manager mentally ballparking how much physical memory should be in use, and noticing a large disparity. I finally got around to measuring it. Taking the results of tasklist and adding, gave about 3.87 GB. Task manager told me I was using 4.6 GB of memory. This seems like a large disparity. Where did it go?  EDIT: So its clear, it is not going to prefetch. It has also been suggested that its part of the OS, but not part of any of the system processes. If this is true, please find a way to get the OS to tell me how much memory is getting used. Since I want to find out where the memory went, asking me to look at the difference does nothing for me.  EDIT 2: It is not the following:   The kernel The cache Hardware reserved memory   Picture of resources taken up. Not quite sure what it will do but...


How to rotate an object like a notebook lid? Using R does not rotate around the bottom of the object.  You can see the exact example .


Shapefile attributes to Autocad Annotation

How can I export the attribute information for the shapefile/feature class to Autocad Annotation/Text?  I'm able to export the shapefile to autocad but unable to get the attributes in annotation.   Also Let me know if there any any way we can append attributes in autocad without using blocks.


Proving that the intersection of Sylow p-subgroups is normal?

Let $\{K_1, K_2, ..., K_n\}$ be the set of all Sylow $p$-subgroups in a finite group $G$. Prove that $$ H = \cap_{i=1}^{n} K_i $$ is a normal subgroup in G.   Proof attempt:  We will proceed by using induction on $n$.  Suppose $n = 1$.  If there is only one Sylow $p$-subgroup of G, that group must be normal. So $H = K_1$ is normal.  Assume that the result is true for $n \geq 1$ Sylow $p$-subgroups. Then we want to show it must be true for $n+1$ Sylow $p$-subgroups.   Case 1: There are $n+1$ unique prime factors of $|G|$. Then each $K_i$ (with $i = 1, ..., n+1$) has a unique prime (or prime-power) order. By uniqueness of prime factorization, then: $$ H = \cap_{i=1}^{n+1} K_i = \{e\} $$ Clearly, this is a normal subgroup.  Case 2: We do not have uniqueness of prime factors. This is where I get stuck. My idea is that this should fall out from the fact that all Sylow p-subgroups are conjugate with each other, but I'm not exactly sure how to proceed.    Edit: I see the related question, but I'm hoping to receive feedback on my attempt at the solution, and whether this is a possible alternative way to prove the result.


How to delete just one type of entity on the ground

How can I delete just one type of entity from the ground? I am only killing creepers using the /kill @e[type=creeper] command in a repeating command block, but it litters the ground with gunpowder. I want to delete only gunpowder from the ground but not any other ground item. Ideas?  I'm using Minecraft 1.12.2.


Minimum distance between $e^x$ and $ln x $

We have to find minimum distance between $e^x$ and $ln x$  I thought they are mirror image along $y=x$ .  So the point which would be at minimum distance would have slope -1 .   from that I got the answer as $\sqrt 2$ . which is correct .  But I want to kno2 ifbthere is some other good method .


How do I backup and restore iPhones with ubuntu

Okay so I want to know how do I backup and restore iPhone data using ubuntu cause I know I can't download and use iTunes and i know you can get like Linuxplay or something like that but is there something else that's works fine?


how to remove apache2 in ubuntu its still running on localhost

How to uninstall apache2 ?  I needed to install phpmyadmin, but it got errors so i decided to uninstall it and reinstall mysql php and apache.   But I am unable to uninstall apache.  I uninstalled it the following way:          $ whereis apache  $ apache:  $ which apache  $     still I'm getting  "Ubuntu Logo Apache2 Ubuntu Default Page" at localhost


Getting a window's PID by clicking on it

Is there any package which shows PID of a window by clicking on it?


I have three time series data $(X_1, X_2, X_3)$ that are correlated with $Y$ as follows: $0.95, 0.75, 0.65$. I want to make a weighted mean of the three time series based on their correlation with $Y$ to make $X_4$. In effect, $X_4$ is the ensemble mean but weighted according to their correlation with $Y$. To make a simple mean is counter-intuitive to the fact that $X_1$ has the highest correlation with $Y$ and its effects will be diluted by $X_3$.


I can upvote/downvote some questions twice. Is it a bug?

I can upvote/downvote some questions(not all)(, ) asked by  two times; Is it okay? or bug?   Initial vote (It was 120)        I clicked once on upvote button,and the upvote button didn't changed its color to blue(Now the vote is 121)        I again clicked (two times)Now the vote is 122


16.04 drops wireless activity every few minutes

I can connect to and use wireless access points.  After several minutes, however, I can no longer use them.  The task bar applet shows a connection, but I can't send or receive data.  Using service network-manager restart fixes the problem, but only temporarily, and I'm getting very tired of having to do it constantly.  I've read page after page on this site and elsewhere of lists of commands to run.  Here's a summary of the information I've found as a result:  logical name: wlp4s0 driver=iwlwifi 04:00.0 Network controller: Intel Corporation Wireless 8260 (rev 3a)   I'm on a Lenovo ThinkPad T560.  iwconfig indicates Power Management is on.  rfkill indicates nothing is blocked, hard or soft  I've blocked IPv6 by adding  net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1   to the /etc/sysctl.conf config file and rebooting, but that did nothing.  For the present, I'm more interested in learning how to figure out what the problem is than in fixing it.  How do I find out what's going wrong?  Info Edit 1: When this happens, I suddenly cannot load web pages.  I cannot ping my default gateway (100% packet loss), and I cannot ping sites by name ("unknown host").  Info Edit 2: I tried turning Power Management off using $ sudo iwconfig <wlan0> power off.  The problem recurred, even as I confirmed using iwconfig that Power Management remained off.  The problem also happens regardless of whether I'm on battery or cable power.  When the disconnection happens, there is little change in the output of iwconfig.  In particular, these parameters stay nearly constant:  Bit-rate=866.7 Mb/s Tx-Power=22 dBm Link Quality=70/70 Signal level=-40 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0   Access Point remains a constant, valid MAC address throughout.  The only output that changes is Invalid misc, which increases in count noticeably and continuously after the disconnection.  Meta Edit: Someone has linked to a similar question at .  That user seems to have a more severe problem than I do.  I don't lose sight of networks or have the applet icon change, I just stop being able to send and receive internet data, as if the connection is being throttled down to nothing.  In any event, I emphasize that there is no resolution or accepted answer on that question, and no activity in nearly a year.  The existence of this similar question does not help me solve my problem.


I have an arithmetic sequence, $a+dn$, where $a$ and $d$ are constants and $n$ is the term number. How would I efficiently calculate solutions to the following equation, $$ (a+dn)\%b=0 $$ where $b$ is also a constant. (and $\%$ means modulo) I attempted the question myself and found out that I really just need to find the smallest $n$ that satisfies the equation and find the rest by adding ${kb\over GCD(d,b)}$ to $n$, where $k$ is any integer. I also noticed that the smallest solution will always be less than $b$ and if no solution exist within this range, then there is no solution. So I tried to find the solution by brute forcing from 0 to $b$, until I got a solution. But this method is not nearly as efficient as I need it to be.


Setting new command in LaTeX for the differential

I am writing a document in LaTeX and since I use quite often the command ${\rm d}$ for inserting the differential in the integrals , I decided to make a new command and insert in the preamble.   I wrote it as: \newcommand{\d}{d} but it does not compile. It say "your command has been ignored. What am I doing wrong here? How can I insert the command to work properly ?


How to email UK border control to know whether I need a transit visa or not

I have a flight from Beirut to London then Boston in two days and I will need to pass through immigration. I have an immigrant visa to the US, a connecting flight to Boston, and my mother and brother are US residents, so the EU travel ban doesn't apply to me. I'll get to London at 18:30 May 22, and I'll have to leave at 11:15 May 23. Who can I contact to know whether I need a transit visa or not? The airlines that is flying me from Beirut to London wants proof that I will be able to enter... Should I contact UK embassy or border control or whom? I can only contact border control by mail, not by phone.


Because of the recent Web accessibility Law in my region, I need to ensure I'm designing with an appropriate contrast ratio.  WCAG says the value of this ratio is 4.5:1    How do I figure this out in in Photoshop and Illustrator?


Create a screen, launch a command in it and detach

I'd like to do a one line bash command that automatically does this:  screen -S myserver  python myserver.py  # inside the new screen CTRL A, D (detach)   I think this won't work:  screen -S myserver && python myserver.py   because python myserver.py won't be started inside the screen.


I love the "Hot Network Questions"... so much that I am looking up real work and the next thing I know 45 minutes have gone by and I have not even read what I came for.  This happens multiple times a day -- you can do the math.  Is there a way to turn them off or hide them from my normal view?    Sorry, I just found  (which was highly downvoted???) And it sounds like my answer is "fat chance".  Thanks.  I guess this can be closed/deleted.


Don't show answers when voting to close as duplicate on mobile

This originally started bothering me when voting to close as duplicate of a question which had deleted answers. I thought to myself, "Why on Earth am I being shown the deleted answers for this?" Why do I want to scroll through a bunch of deleted content that the average user won't even see when they get there?  After dealing with it more, it really doesn't seem clear to me why it loads answers at all. A mobile device just isn't friendly enough to be loading extremely long blocks of text like this. The question itself will suffice. If I wa t to see the answers, I can go to the question itself. Seriously, you try to close a question as a duplicate of the Formatting Sandbox on the mobile layout, see where that gets you...  Can the answers please be removed from the vote to close as duplicate dialog on the mobile layout?


What are the main differences between undergraduate, master's, and doctoral theses?

When I did my undergraduate thesis, my adviser was expected big on students expecting them working really hard, so it ended up as a reduced master's thesis (most of the reviewers said that it was an overkill for a B.E).  So because of this, I did my master's thesis pretty much in the same way I did my bachelor's thesis; the PhD dissertation was a different story.  What are the principal differences between these three pieces of research?


No custom off topic message when flagging on SO

I have less than 3000 rep on StackOverflow. Now that the new closing changes are live, I cannot supply a custom off topic message:    I can enter a custom off topic flag message without issue here on meta, though it only has three canned off topic reasons, rather than five.  I'm not sure if this is the same for users with enough rep to vote to close directly, but the lack of a custom message eliminates the ability to use the correct flag reason in some cases.  For example, I wanted to flag , which is simply off topic on SO. However, I can't use a custom message, and none of the canned ones are appropriate.    appears to be the most up to date official information on custom reasons, and indicates that they are remaining in play for now.  supports that.  If this is by design, how should I flag such questions? This is not a case worth bothering the mods over, so I don't want to use a custom diamond attention flag.


where do I find an image of 15.10 to install on my desktop.

until I get 15.10 on the machine, I cannot perform a network upgrade to 16.10.  The DVD with 16.10 on it fails on the reboot to to use the S/W


Two pictures, side by side on even and odd page

I am formatting a twopage book on latex and I have a diagram divided on two almost page size images. (Two captions).  What can I do for putting the first image on an even page and the second on the following page so that way one can open that pages and wiew the whole diagram without passing pages? The two parts of the diagram are in two different files, as opposed to the post . In other words, I would like the same as the above post, but just much less functionality, such as dividing the picture into wo parts automatically and such. It would be nice, if the picture waits to be outputted until the next even side begins.  I tried using the following command before the two pictures, but that doesn't seem to work, cf. .  \newcommand{\newevenside}{     \ifthenelse{\isodd{\thepage}}{\newpage}{     \newpage     \phantom{placeholder} % doesn't appear on page     \thispagestyle{empty} % if want no header/footer     \newpage     } }   The problem is that it would place both figures on the left side, two different doublepages.  The code which I use for putting the images on the document is  \newevenside  \begin{figure}[hp!] \includegraphics[width=18cm,angle=90]{figuras/project1.eps} \caption{My caption.} \label{fig:gantt1} \end{figure}  \newpage  \begin{figure}[hp!] \includegraphics[width=18cm,angle=90]{figuras/project2.eps} \caption{My caption.} \label{fig:gantt} \end{figure}


Is Poincare recurrence relevant to our universe?

If the theory of everything indicates a singularity-free and finite universe, will  be relevant to the universe? If so, is there any interesting physical consequence, e.g. in superstring or quantum gravity?


Why are some apps on the market incompatible with my device?

I own a Motorola Flipout, Android 2.1 stock ROM. According to the market the app "" is not compatible with my phone. The required Android version is 1.5 or above. How can I tell why the app will not work for me?    The Flipout has a comparably small screen. Is it possible that the publisher just forgot to mark my phone's display resolution as supported?  Note: Users from outside Germany see a different message. I believe, those country-restriction are unrelated.


Combinatorics summation proof involving binomial coefficients

Prove that   $$\sum_{k=0}^{n}\binom{n}{k}(-1)^kk^n = (-1)^nn!$$  Please can anyone help me out here?


I've gone through all the similar posts to this but can't find something with the same suggestion. I'm noticing a trend where OPs think that upvoting an is answer is marking it as answered.  I understand the reasons for them to be able to upvote an answer and not mark it as answered. However it might be helpful if, when the OP is upvoting an answer, they are reminded to and given the option to mark it as answered.


Was Elrond, in Tolkien's opinion, more inherently powerful than Galadriel?

I always thought it was the other way around, but then I read this (Letter 246):     "Of the others only Gandalf might be expected to master him – being an emissary of the Powers and a creature of the same order, an immortal spirit taking a visible physical form. In the 'Mirror of Galadriel', 1381, it appears that Galadriel conceived of herself as capable of wielding the Ring and supplanting the Dark Lord. If so, so also were the other guardians of the Three, especially Elrond. But this is another matter. It was part of the essential deceit of the Ring to fill minds with imaginations of supreme power."   This "especially Elrond" confuses me. I don´t think that Elrond is inherently more powerful than Galadriel, who is described as the greatest of the Noldor, except for Fëanor (and possibly even his equal).  A quote from Unfinished Tales says:     "...In this he (Tolkien) emphasized the commanding stature of   Galadriel already in Valinor, the equal if unlike endowments of   Fëanor; and it is said here that so far from joining in Fëanor's   revolt she was in every way opposed to him."   Furthermore,      "A queen she was of the woodland Elves, the wife of Celeborn of   Doriath, yet she herself was of the Noldor and remember the Day before   days in Valinor, and she was the mightiest and fairest (so even   fairer than Arwen I would guess) of all the Elves that remained in   Middle-earth."   (The Silmarillion, of the Rings of Power)  And again...     "Galadriel was the greatest of the Noldor, except Fëanor maybe, though   she was wiser than he, and her wisdom increased with the long years."   (the Shibboleth of Fëanor)  Restating it:     "These two kinsfolk (Fëanor and Galadriel), the greatest of the   Eldar in Valinor, were unfriends for ever." "Who together with the   greatest of all the Eldar, Luthien Tinuviel, daughter of Elu Thingol,   are the chief matter of the legends and histories of the Elves."   (Unfinished Tales)  The latter means that Luthien, Fëanor and Galadriel are the chief matter of the history and legends. It seems to me that Tolkien thought of those three as the creme de la creme of the elven crop.  Reading all that I have serious problems believing that Elrond could be superior to her. As great as Elrond is, descending from Melian, he is no equal of Fëanor, who is said to be the mightiest of all elves, and if Galadriel is his equal, then there is no way that Elrond would be mightier than her.  Maybe I just read this "especially Elrond" wrong; it could as well mean that especially Elrond was deceived into thinking that he could master the ring, because that was the deceit of the ring. And Tolkien said explicitly that only Gandalf could possibly master it.  So, what do you think?


$A$ a proper subset of $[0,1]$ and $m(A \cap [a,b])\leq \frac{b-a}{2}$ for every interval $[a,b]$

Let $A \subset [0,1]$ measurable and $m(A \cap [a,b])\leq \frac{b-a}{2}$ for every interval $[a,b]$.  Show $m(A)=0$.   I have two ideas on how to approach this, but I don't think either of them have enough momentum to be pushed forward.  (1)  First I wanted to pick a countable, disjoint set of intervals $\{I_k\}$ where $l(I_k)<\frac{b-a}{n}$ and $A \subset \cup I_k$.  (2)  Another strategy I thought about was breaking $A$ into disjoint sets via $A_n := A \cap [a_n, b_n]$.  However, I think this approach may be messy.


Make clicking “Recommend Deletion” in the VLQ queue automatically upvote the correct comment

When I select “Recommend deletion” in the VLQ queue, it will automatically add a comment to the post with my reason, if someone hasn’t already. I’m suggesting that the system automatically upvote the comment on my behalf to indicate that multiple users agree with the comment.


I am working on my thesis and I would like to make a simple "technology timeline", probably something like this (although I prefer horizontal timelines):     Are there useful packages that I can use?  Do you prefer Tikz or PSTricks for such a job?


Let f, g, h ∈ F[X] with h a greatest common divisor of f and g. Show that  (i) f /h and g/h are coprime,  (ii) fg/h is a least common multiple of f and g.


Let $P$ be a $n$-degree real polynomial having $n$ simple roots $x_1, x_2, \cdots,x_n$.  The problem asks to prove that   $$ \displaystyle\sum_{k=1}^n \frac{P''(x_k)}{P'(x_k)} =0$$  I tried writing $P$ as the product of $x−x_i$ and differentiating it twice but the calculations are too hard to carry out. Thanks in advance.


I've been working on this question for the final exam, yet I could not come to a closure. I'd appreciate if you can help me.     What is $$\lim_{x\to 0} \frac{\sin(\sin(\sin x)) - x}{x^3}\qquad?$$


Could anyone advise me a good study book for partial differential equations?

I want to start learning partial differential equations, but I know that for me the joy of self-study depends a lot on the book/material (I really liked James Stewart's calculus but hated some of my statistical books just by the way they handled the topics and how 'dry' they brought it).   Naturally, I am aware that this is a matter of taste and there is probably no study book that is universally liked. However, I would still love some advice and hear which book you found good on this topic. Preferably something that is more on applications and exercises than on proofs and theories. Also since I am doing it for self-study I really need something for which I can buy a solution manual or for which solutions to exercises can be found online.   Lastly, if it possible it would be nice if it also covers the basics of differential equations as a refresher.


Problem involving maximum and minimum of a continuous function

Let $f:\mathbb{R}\to\mathbb{R}$ be a continuous function. We denote, for every $x\in\mathbb{R}$, with $m(x)$ and $M(x)$ the minimum and maximum of $f$ on the interval $[x-1,x]$. Show that, if $m(x)+M(x)=0,\forall x\in\mathbb{R}$, then the functions $m$ and $M$ are constant.  I have tried to prove that $f$ is periodic, but I didn't managed to do it; I'm not sure it's even true...


How big is the tax penalty for a dual income couple?

Multiple articles online alludes to this tax penalty, claiming that dual income couple "can, often, may" suffer from it without giving any concrete sense of the magnitude.   Could we do an illustrative numerical example to figure this out?


Java: how do I check if a Date is within a certain range?

I have a series of ranges with start dates and end dates. I want to check to see if a date is within that range.  Date.before() and Date.after() seem to be a little awkward to use. What I really need is something like this pseudocode:  boolean isWithinRange(Date testDate) {     return testDate >= startDate && testDate <= endDate; }   Not sure if it's relevant, but the dates I'm pulling from the database have timestamps.


Why do each of the pages after the first drop down a little?

I tried to do a custom header on the first page and then just a regular footer on every page by copying things from other people's questions.  But when I compile the first page looks fine but all the ones after that have too big of a top margin and too small of a bottom margin.  How can I fix this?  \documentclass[12pt]{article}  \usepackage[letterpaper]{geometry} \usepackage{times} \geometry{top=1.0in, bottom=1.0in, left=1.0in, right=1.0in}  \usepackage{setspace} \doublespacing  \usepackage{rotating}  \usepackage{fancyhdr} \pagestyle{fancy} \lhead{} \chead{} \rhead{}  \lfoot{} \cfoot{\thepage} \rfoot{} \fancypagestyle{firststyle} { \fancyhf{} \fancyhead[L]{Firstie McLastName \\ Subject \\ SubSubject} \fancyhead[R]{Word Count: \#} \fancyfoot[C]{1} } \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} %To make sure we actually have header 0.5in away from top edge %12pt is one-sixth of an inch. Subtract this from 0.5in to get headsep value \setlength\headsep{0.333in}  \usepackage{lipsum}  \begin{document} \begin{flushleft}  \thispagestyle{firststyle}  $ $\\ \begin{center} \underline{Title} \end{center}  %%%%Changes paragraph indentation to 0.5in \setlength{\parindent}{0.5in}  \lipsum[1-10]  \end{flushleft} \end{document}


Is there a reduced de Broglie wavelength symbol for mathjax?

I am working in a Jupyter notebook environment (which uses MathJax to typset math symbols in a Markup cell) writing mathematical physics equations and often related Python Numpy Sympy code in subsequent cells. It is driving me crazy that I cannot find a symbol for the so-called reduced de Broglie wavelength. It is a '\lambda' but with a short horizontal line (like the $\hbar$ version of Planck's constant $h$) midway on the riser of $\lambda$.


When assigning function to object inside another function, what really happens in javascript?

Look at this code for example:   var arr = [];  var assignFunction = function() {   for (var i = 0; i < 3; i++) {     arr[i] = function() {       console.log(i);     }    } }  arr[0]; arr[1]; arr[2];   You would expect it will assign a function that you can call/run, but its not. I'm looking for good explanation what its really doing. arr[i] is typeof function, meaning it is being assigned, but will never run and print anything to console.


When did "while" and "whilst" become interchangeable?

I think most folk happily use either "while" or "whilst". I've a vague recollection that at one time "while" indicated the passing of time and "whilst" was essentially the same as "whereas" or "although".  So using while for time passing...     While I was walking down the street the sun was shining.   ... and whilst for whereas/although...     Whilst I was walking down the street I often prefer to hop.   Any views?


Is there a way to prevent spreadsheet from updating the date to today's date in formula?

I'm trying to print the date when I change the value on a cell (status column). But spreadsheets update the date to today's date. I wish it could save the date from when the status was changed. The code to print the date: function TIMESTAMP() {    var today = new Date();   var date = Utilities.formatDate(today, 'GMT-3', 'dd/MM/yyyy');   return date;  }  In the spreadsheet, the column D is where I set the status and columns H to J print the date from when the status was changed.  The code for column H is the following: =ARRAYFORMULA(IF(ROW(H:H)=1;"Logística";IF(ISBLANK(D:D);;IF((D:D>=3)*(D:D<6);TIMESTAMP();IF(D:D<1;"Aguardando Pagamento";IF(D:D=2;"Aguardando Etiqueta";IF(D:D=6;"Cancelado";"Aguardando Faturamento")))))))  The codes for columns I and J are similar to H. So, how to print the date from when the status in column D was changed and keep spreadsheet from updating to today's date?


How to compute the  formula $\sum  \limits_{r=1}^d r \cdot 2^r$?

Given $$1\cdot 2^1 + 2\cdot 2^2 + 3\cdot 2^3 + 4\cdot 2^4 + \cdots + d \cdot 2^d = \sum_{r=1}^d r \cdot 2^r,$$ how can we infer to the following solution? $$2 (d-1) \cdot 2^d + 2. $$   Thank you


Full body VR sim where characters are trapped in a fantasy world

I read this sometime in the late 90s, borrowed from the local library. The basic plot was that people couldn't exit the VR sim(s), so the authorities brought in one of the original designers of the fantasy realm (as that's where the trouble started) to get to the bottom of it all. (It was a fairly generic D&D/VR ripoff, but trying to remember it has been bugging me.)  Other bits I remember:   There were several VR realms, one of the others was a War sim - a general was mentioned as being trapped there. The main character's class was a bard, whereas normal users could only pick from warrior/wizard/rouge He was forced out of the VR company after creating the fantasy realm, and is reluctant to assist He's introduced in the book at a sword-fighting lesson (possibly fencing) He has a pegasus that's under the illusion of being an old nag He defeats a dragon by lassoing it's mouth shut on it's own fireball He has some root level systems access (a backdoor that he left in for himself), even within the sim The fantasy realm has some partial scenarios based on myths - he escapes from a snow white type scenario on his pegasus (which was depicted on the cover IIRC) VR tech was of the full body immersion tank type, with some sort of neural feedback At the start a bit character has his hand cut off in game, and on waking up can't feel anything in that hand The computer running the sim has achieved some sort of sentience and separated into id, ego and superego personas Someone was suffering from brain cancer IRL, so uploaded himself to the sim and suffers from persistent headaches. His attempts to hack the system from the inside using magic are probably the root cause of the problems.   Any ideas would be appreciated, my google-fu has failed me. (oh, and it's not the Otherland series — that's far more complex and interesting)


I am trying to create ceramic material, similiar to the one on the picture:    However I can't figure out, how to add shadow from behind the ceramic part. Translucency nor SSS don't do the trick.  As you can see there is no shadow comming from Suzanne's chin.     Any idea?  Folowwing your advices, this is the result:    And here is the node tree


Questions with 10k+ votes are abbreviated to have 1/10 as many

In the Android app, I sorted the questions by votes.  The odd thing was that the top result said it had 1.5k votes, but the third said that it had 7,688.  Either that's ordered wrong, or it's displayed wrong.    I opened the questions, and it turns out that the questions whose votes round to 10k or more show up in the search results with 1/10 the number of votes.  That "1.5k" question is actually 15k.


Weak \ Unstable WiFi Signal using Qualcomm Atheros AR9485 Wireless Network Adapter in Ubuntu 19.04

Network controller: Qualcomm Atheros AR9485 Wireless Network Adapter (rev 01) Kernel :Linux Inspiron-3521 5.0.0-21-generic  I am using Dell Inspiron 3521 and it has Qualcomm Atheros AR9485 Wireless Network Adapter, recently switched to Ubuntu 19.04 from Windows 10. I am getting very weak signal strength and wifi connection is not stable it frequently disconnects, however in Windows 10 it was working perfectly.  Please help me resolve the issue.


Get Blender X,Y,Z and Bounding Box with script

I need to get the x,y,z values of an object as well as the bounding box through a script. So far I have the area and volume with the following code:  bm = bmesh.new() bm.from_object(bpy.context.object, bpy.context.scene) area = str(sum(f.calc_area() for f in bm.faces)) volume = str(bm.calc_volume())   I tried something like this for the bounding box:  bb = str(bm.dimensions())   or  bb = bpy.data.objects["test2-2"].dimensions   but neither have worked. As far as the x,y,z values go I'm stumped. Please let me know if you have any suggestions.  Thanks!


E: The repository 'http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu disco Release' does not have a Release file

I have been trying to install Devstack and this happened while  "./stack.sh".


Can we install a package through a shell script?

I'm trying to write a shell script so that when I reinstall my Ubuntu again. I could just run script and retain all the packages. And I'm planning to pass password in form of argument.  My question here is how can i enter into sudo domain without manually entering password. As I'm also planning to design a UI where it can't access the terminal there.  Ex:  ./recover.sh password


What will happen if a plane trys to take off whilst on a treadmill?

So this has puzzled me for many a year... I still am no closer to coming to a conclusion, after many arguments that is. I don't think it can, others 100% think it will.   If you have a plane trying to take off whilst on a tread mill which will run at the same speed as whatever the planes tires rotation speed is will it take off?  [edited to be more clear]  The question is simple. Will a plane take off if you put this plane onto a treadmill that will match whatever speed the plane wheels are moving at. So the plane should not be able to move.  This is a hypothetical situation of course. But I am very interested.


Is the linearity of transformation of intervals postulate in SR?

Let $O$ and $\overline{O}$ be inertial frames, $A$ and $B$ be events, the interval between $A$ and $B$ be $(\Delta t, \Delta x, \Delta y, \Delta z)$ in $O$ and $(\overline{\Delta t}, \overline{\Delta x}, \overline{\Delta y}, \overline{\Delta z)}$ in $\overline{O}$.  Is the linearity of the correspondence between $(\Delta t, \Delta x, \Delta y, \Delta z)$ and $(\overline{\Delta t}, \overline{\Delta x}, \overline{\Delta y}, \overline{\Delta z)}$ a postulate in the special relativity theory?


How do I efficiently get "the most recent corresponding row"?

I have a query pattern that must be very common, but I don't know how to write an efficient query for it.  I want to look up the rows of a table that correspond to "the most recent date not after" the rows of another table.  I have a table, inventory say, which represents the inventory I hold on a certain day.  date       | good | quantity ------------------------------ 2013-08-09 | egg  | 5 2013-08-09 | pear | 7 2013-08-02 | egg  | 1 2013-08-02 | pear | 2   and a table, "price" say, which holds the price of a good on a given day  date       | good | price -------------------------- 2013-08-07 | egg  | 120 2013-08-06 | pear | 200 2013-08-01 | egg  | 110 2013-07-30 | pear | 220   How can I efficiently get the "most recent" price for each row of the inventory table, i.e.  date       | pricing date | good | quantity | price ---------------------------------------------------- 2013-08-09 | 2013-08-07   | egg  | 5        | 120 2013-08-09 | 2013-08-06   | pear | 7        | 200 2013-08-02 | 2013-08-01   | egg  | 1        | 110 2013-08-02 | 2013-07-30   | pear | 2        | 220   I know one way of doing this:  select inventory.date, max(price.date) as pricing_date, good from inventory, price where inventory.date >= price.date and inventory.good = price.good group by inventory.date, good   and then join this query again to inventory. For large tables even doing the first query (without joining again to inventory) is very slow.  However, the same problem is quickly solved if I simply use my programming language to issue one max(price.date) ... where price.date <= date_of_interest ... order by price.date desc limit 1 query for each date_of_interest from the inventory table, so I know there is no computational impediment.  I would, however, prefer to solve the whole problem with a single SQL query, because it would allow me to do further SQL processing on the result of the query.  Is there a standard way to do this efficiently? It feels like it must come up often and that there should be a way to write a fast query for it.  I'm using Postgres, but an SQL-generic answer would be appreciated.


Getting null object reference but ArrayList is initialized

My ArrayList has been initialized, as you can see from the below code, but I am still getting a null object reference error.  String name; int health; int stamina; int magic; int strength; Integer picture; Integer croppedPicture; static ArrayList<item> treasures = new ArrayList<>();  public item(String name, int health, int stamina, int magic, int strength, Integer picture, Integer croppedPicture, ArrayList<item> treasures){     this.name = name;     this.health = health;     this.stamina = stamina;     this.strength = strength;     this.magic = magic;     this.picture = picture;     this.treasures = treasures;     this.croppedPicture = croppedPicture; }  static item[] adventurers = {new item("Forhum", 100, 5, 5, 20,R.drawable.forhum,R.drawable.forhum_cropped, treasures),         new item("Triton", 100, 5, 5, 20,R.drawable.triton, R.drawable.triton_cropped, treasures),         new item("Meravan", 100, 5, 5, 20,R.drawable.meravan, R.drawable.meravan_cropped, treasures)};  static item[] treasureList = {new item("Ring of Health", 10, 0, 0, 0, R.drawable.ring_of_health, null, null),     new item("Ring of Stamina", 0, 5, 0,0, R.drawable.stam_green, null, null),     new item("Ring of Strength", 0,0,0,5, R.drawable.ring_of_strength, null, null),     new item("Cup of Magic", 0,0,4,0, R.drawable.cup_of_magic, null, null),     new item("Invisible Necklace", 0,0,0,0, null, null, null),     new item("Necklace of Harming", -10, 0,0,0, R.drawable.necklace, null, null)};  public String getName(){     return name; }  public int getHealth(){     return health; }  public int getMagic() {     return magic; }  public int getStamina() {     return stamina; }  public int getStrength() {     return strength; }  public ArrayList<item> getTreasures() {     return treasures; }  public void setHealth(int health) {     this.health = health; }  public void setMagic(int magic) {     this.magic = magic; }  public int getPicture() {     return picture; }  public void setTreasures(int treasure) {     treasures.add(treasureList[treasure]); }  public Integer getCroppedPicture() {     return croppedPicture; }   It is getting the int from a combat class using this method:      public void turn(){        setText();        if(monsterHealth > 0) {           if (monsterMagic >= 5) {             monsterUseMagic();             setText();           } else {             monsterAttack();             setText();           }           if(item.adventurers[personNumber].getHealth() > 0) {             item.adventurers[personNumber].setMagic(item.adventurers[personNumber].getMagic() + 1);             monsterMagic++;             setText();           }           else{             died();           }        }        else {           Intent won = new Intent(this, itemSelect.class);           int treasure = rand.nextInt(6);           int view = 2;           won.putExtra("view", view);           won.putExtra("thing", treasure);;           item.adventurers[personNumber].setTreasures(treasure);           startActivity(won);        }   }   This is the error that I am getting.  2019-10-17 18:20:21.903 7907-7907/com.example.treasurehunt E/AndroidRuntime: FATAL EXCEPTION: main  Process: com.example.treasurehunt, PID: 7907  java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.util.ArrayList.add(java.lang.Object)' on a null object reference      at com.example.treasurehunt.item.setTreasures(item.java:75)      at com.example.treasurehunt.CombatScreen.turn(CombatScreen.java:118)   There is a lot more to the program that I" am making, but none of it pertains to this error. Any help is appreciated. Thanks in advance.


Theory that gets rid of dark matter/energy

Is there any physics theory that either groups together gravity and dark energy/dark matter or eliminates dark energy/dark matter by modifying standard understanding of gravity or any force? If so, is there any theory that still matches with all correct predictions of standard physics theories?


Test Class - Contract Creation, Null ContractNumber Field

I'm working on developing a test class for my apex. I'm stuck with creation of Contract records contractnumber field. In test class, I use the following code:     Contract c = new Contract();     c.Name = 'Test Contract';     c.AccountId = acc.Id;     c.Status = 'Draft';     insert c;     //I'm creating a draft contract and then activating it.     c.status  = 'Activated';     update c;     system.debug('contract debug:'+c.contractnumber);  Contractnumber field on object is Autonumber, but in the log I get null for contractnumber. I see the whole contract record is created with null ContractNumber. What am I doing wrong?


Let A be an mxn matrix of rank 1. Show that there exist non zero vectors.

Let A be an $mxn$ matrix of rank 1. Show that there exist non zero vectors $x ε R^m$ and $y ε R^n$ so that $A = xy^T$.(Hint: Try a simple case. Also compute $xy^T$ for some simple choices x,y.)  Attempt:  I know rank = 1 means that there is 1 linearly independent row but I am confused on how to resolve this question.  I would appreciate the help thanks.


Why is the interline space not as expected?

Here is my MWE:  \documentclass{article}  \begin{document}  \begin{center} \begin{minipage}{8cm} {\Huge  The interline spaces are too small between some of the lines. Why so? This is the continuation of the text.} \end{minipage} \end{center}  \end{document}


Ideal decomposition for commutative rings

Let $S$ and $T$ be commutative rings each having a multiplicative identity and let $R=S\times T$. Prove that every ideal $I$ of $R$ is of the form $J\times K$ where $J$ is an ideal of $S$ and $K$ is an ideal of $T$.   This problem seems like it should be really straightforward, but I'm not sure I'm interpreting it right. Here are my thoughts:  Elements of $R$ are ordered pairs $(s,t)$ where $s\in S$ and $t\in T$. So if $I$ is an ideal of $R$, then given some $(a,b)\in I$, we have that $(a,b)\cdot(s,t)\in I$. So clearly $a\in S$ and $b\in T$. Then we need to show that, given some ideals $J$ and $K$ of $S$ and $T$ respectively, $a\in J$ and $b\in K$.  Is this the right idea? If so, how can I come to the desired conclusion from here?


Integer coefficients in de Rham Cohomology

It can be shown that $H_{dR}^*(X,\mathbb R)$ and $H^*(X,\mathbb R)$ (singular cohomology) are isomorphic for smooth manifolds. I was told that under that isomorphism closed differential forms whose integral over the generators of the homology of $X$ returns integer values, lets call them $H^*_{dR}(X,\mathbb Z)$, then correspond to $H^*(X, \mathbb Z)$.   But why does $H^*_{dR}(X,\mathbb Z)$ even carry a ring structure? If $\alpha, \beta\in H^*_{dR}(X,\mathbb Z)\subset H^*_{dR}(X,\mathbb R)$, then why is $\alpha \wedge \beta \in H^*_{dR}(X,\mathbb Z)$, i.e. why is $\int_C \alpha \wedge \beta\in \mathbb Z$ for $C$ a generator of the homology group of appropriate degree?


Does space curvature automatically imply extra dimensions?

Total newbie with basically no physics knowledge here :) I would welcome any correction to the steps of my reasoning that lead to my question, which could easily turn out to be invalid :)  My current understanding is that General Relativity is definitely accepted by the vast majority of scientists, and that according to General Relativity spacetime is curved by the presence of mass.  I also seem to understand that not as many scientists (although probably still the majority) agree that extra dimensions of space exist.  But if we agree that spacetime can "curve", aren't we automatically saying that extra dimensions of space exist?  I mean, if I grab a stick and I bend it, it becomes curved with respect to our good old 3D space. The stick needs to be in a 3D space, with respect to which it can be straight or curved.  So, if the thing that gets curved is not an object in space but space itself, doesn't space need to be in "another" space in order to be curved?  I apologize in advance if I used inaccurate terms here, which I most likely did :)


Assigning next pointer in a structure definition = NULL, throws error

Why this error is being thrown for below code.  Error: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘=’ token   struct node_s *next=NULL;   Code:  #include<stdio.h> #include<stdlib.h>  typedef struct node_s {     int data;     struct node_s *next=NULL; } node;


Verify if symmetric matrices form a subspace

I need to verify if the symmetric matrices form a subspace. But I don't know how to represent a general symmetric matrix. I know that the matrix $A$ is symmetric if $A = A^t$ but I can't write a general one and add with another to verify the conditions for a subspace.


Joint distribution of a Normal and Truncated Normal

I have a random variable $X\sim \text{Normal}(\mu,\sigma)$ and have the transformation $Y=\max\{0,X\}$.  Is the distribution of $Y$ a truncated normal where it is truncated to live on the positive half of the real line?  Secondly, is there a closed form solution for the joint distribution of a Normal random variable and a truncated Normal random variable?


What is it exactly that conflicts when trying to unify all 4 fundamental forces?

Everyone knows that there are 4 fundamental forces:   Gravity Electromagnetic Weak Strong   At school and university you're taught that no one has been able to unify these 4 fources. However, not a single person really explains what is it that can't be unified. What happens when you try to unify them? Many have tried and failed. Do you arrive at a contradiction when you join the equations? Like when you reduce left hand side and right hand side you get 1=2 or something similar? What is the general approach to unifying forces?  This is a lot of questions but I'm a very curious person. I'd love if someone with deep knowledge explained this.


As I understand 0.0.0.0 means all network interfaces of this host (including 127.0.0.1).  Suppose I have three interfaces 192.0.2.40, 203.0.113.150 and 127.0.0.1 on some host (OS linux).  On 192.0.2.40:777, I have ServerA. On 203.0.113.150:777, I have ServerB. How does the OS resolve a request to connect to 0.0.0.0? I mean when the same port (777) is listening on different interfaces what server(ServerA or serverB) and why will be connected when I will do in terminal  of this host telnet 0.0.0.0 777


Why use FREERTOS instead of the interrupt mechanism on a microcontroller?

This might be a very stupid question.   I have experience with embedded software on bare-metal and just started with FREERTOS. However I don't really understand why one would use FREERTOS instead of the built in interrupt mechanism. The goal of multitasking is to give the impression some sort of parallellization is going on on a single core (similar to multithreading). If you have a main function that is running specific functions continuously, next to this you can have different interrupt routines with different importance levels that can interrupt that main function and then return to the main function. With an embedded OS you have some task running and it then gets interrupted to run a task with a higher priority.  So far in my eyes the final result seems pretty similar, could someone correct me and/or give some more explanation?


Windows 7 May 2017 Updates specific differences?

For Windows 7, what, specifically, is included in the May 2017 Security Monthly Quality Rollup that is not included in the May 2017 Security Only Quality Update?


How well does jQuery support backward compatibility?

We have had issues with Mootools not being very backward compatible specifically in the area of drag and drop functionality. I was wondering if anyone has had any similar problems with jQuery not being backward compatible. We are starting to use it quite heavily and are thinking about upgrading to a newer version to start using several plugins that require it. Will we have any issues if we get rid of the older version?


Flight cancelled but doesn't show up on status

I booked a SpiceJet flight from Dubai to Ahmedabad on Dec 16 (SG-16) scheduled to depart at 7:25 PM. At noon I received an SMS from SpiceJet to advise me that my flight has been delayed by 4h 50m. Sure enough, when I checked flight status on SpiceJet's website, that was the case. But on other websites like flightstats.com and dubaiairports.ae, the status was that flight was "delayed by 2h 25m".    At 5 PM, I got an SMS that flight had been cancelled. I double checked on Spicejet's website and that too showed the flight to be cancelled. But both flightstats.com and dubaiairports.ae still showed the flight as delayed by 2h 25m.    I went to the airport and met SpiceJet officials. Sure enough, the flight was cancelled. But somehow, the flight cancellation status never made it to the system. I have a Tripit Pro account, and even that never sent me an alert for that. I contacted the travel agent through which I booked my flight (makemytrip) for a refund, and they said that their system doesn't show that flight was cancelled. Now, even the Spicejet website has removed the cancellation status from that flight.    Apart from the SMS, I now have no proof that my flight was cancelled.    Can someone tell me, how can I proceed with a refund claim?


How to curve the mesh without using bezier?

i have a little problem in blender. How can i curve the mesh like the image below without using bezier.    Thanks !


If I leave the US how long do I have to be out of the country before I can return?

I am planning a trip to the US next year and will be travelling around. My idea was to spend a total of six months in the country. I appreciate that under the VWP I will have 90 days initially.


Can you check the instanceOf an object dynamically?

Updated after several answers and comments, to clarify the requirements I have an Open Source library and am looking to implement a method that will check if an object is an instance of a given type.  That type needs to be specifiable as a parameter. It needs to work throughout hierarchies, and with both SObjects and Objects (although the latter could be handled with two different methods). So, for example:  Checking a Contact against the type 'Contact' would match. Checking a Contact against the type 'SObject' would match. Checking a Contact against the type 'Account' would not match. Checking an instance of a Class against that Class's type would match. Checking an instance of a Class against any of that Class's supertypes or interfaces would match. Checking an instance of a Class against 'Object' would match. Checking an instance of a Class against 'SObject' would not match.  Because of the requirement to be able to check within the class hierarchy, retrieving the type of an object and comparing it directly to a type cannot be the answer.  In that situation, checking Contact against SObject would fail, when Contact is an instance of an SObject. With instanceof, you can check if an object is of a particular type. For example: Sobject con = new Contact(); System.debug( con instanceOf Contact ); // true  Whereas the following won't even compile, because, as the compiler says: Contact con = new Contact(); System.debug( con instanceOf SObject );  Operation instanceof is always true since an instance of Contact is always an instance of SObject  It feels like what I am looking for is the ability to check the instance of an object against a dynamic type, for example, along the lines of: Sobject con = new Contact(); Type conType = Contact.class; System.debug( con instanceOf conType ); // true  The above doesn't work, but is there an incantation that does? Update There are some good answers already, but none quite hit the mark, and maybe this isn't possible in Apex (yet). The issue is that the method I want to write will form part of an Open Source library and so the solution needs to be bulletproof, and ideally work with objects of any type (ideally including primitives). It may be possible to implement a solution that includes several methods. E.g. public Boolean isInstanceOfSobject( SObjectType sobjectType )  and public Boolean isInstanceOfObject( Type objecttype )  But, as I say, it would need to be bulletproof and deal with namespaces, hierarchies and suchlike. For those interested in why: it would form part of Amoss (an Apex Mocking Framework):    And implement an 'instanceOf' parameter checker as per this issue:


How to Instantiate a class in a generic class in java

public class DictionaryBase<T extends IData> {     protected Map<String, T> mdic = new HashMap<>();      protected T Add(String Name) {         T objNew = new T();          objNew.Name(Name);         mdic.put(Name, objNew);          return objNew;     }   On new T() I have the Error. What is the correct way to do this?


How can I convert a PNP to NPN transistor?

I have a circuit which requires a PNP transistor.  I only have an NPN transistor.  Is there a way to convert one to the other given that they have the same characteristics (apart from the npn/pnp part?)  And for others after me... can the reverse also be done? e.g. how does one convert a PNP transistor to its NPN equivalent?


How do you react when someone votes down your question?

What do you do?  Is it natural to be upset when you ask a question in the spirit of learning and people vote you down?


Multiple letters without spacing in Math

Is there something I can add to the preamble of my document such that multiple letters without spacing in a Math environment (such as $NP$) do not have extra spacing between them and are not considered multiple distinct variables? Right now, I have to use $\mathit{NP}$ to prevent any extra spacing, but I feel that it is more natural to add a space between the letters if they are a different variable ($N P$). For example, if I want the multi-letter variable NP, I want to be able to say $NP$ which would automatically be replaced by $\mathit{NP}$. If I want N and P to have the proper inter-variable spacing, I want to do that only when they are separated by a space, like so: $N P$. Is there a way to achieve this? Would it break something that I'm unaware of? Edit: Here's a screenshot that shows what I mean:  So basically, is it possible for line 1 to automatically give me line 3 and for line 2 to give me line 2?


In answering a telephone call, why do you say "Who is this?" instead of "Who is that?"

On the telephone, the person answering it may say "Who is calling?" or "Who is this?" Why do you say "this" to the caller on the other end of the phone? Is is wrong to say "Who is that?"


Columns of matrix $A_{m \times n}$ span $\mathbb{R}^{m}$

I am having trouble understanding the following theorem given in my textbook:  Let $A$ be an $ m \times n $ coefficient matrix. Then the following statements are logically equivalent (That is, for a particular $A$, either they are all true or all false statements.) a) For each b in $\mathbb{R}^{m}$, the equation $A$ x = b has a solution. b) Each b in $\mathbb{R}^{m}$ is a linear combination of the columns of $A$.  c) The columns of $A$ span $\mathbb{R}^{m}$.  d) $A$ has a pivot position in every row.  I understand that a, b, c are restatements of each other. I would like some intuition on why statement d and the others (particularly c) are logically equivalent.


Windows disappeared from grub menu after deleting Ubuntu partition

I was having problem with booting Ubuntu. Then I used Easeus partition manager to delete the partition that has Ubuntu. Maybe I have done it wrong. Because now I have also lost Windows. Luckily I came to know of a tool called boot repair from this forum. I used and here is the result from it . Can someone please decipher what this says and possibly help me out. Thanks.


Why did Stack Overflow choose Microsoft technology?

I have always had the (most likely biased) idea that the Microsoft platform is, in general, lower quality when compared with other options (mainly, Unix-based) - specially on the server-side.   Why does Stack Overflow use Microsoft technology?  Perhaps the easy answer is: because, just like you have a personal preference for Unixes (most likely due historical factors), so have the creators of such site.  If that is the case, then my question would become: why or how did the awesome authors/creators of Stack Overflow become Microsoft lovers? Is it just because they wanted to have more job opportunities/coverage or because they truly admire MS products?   I would be very interested in reading the story.


I am writing a thesis and this is what I have in my title:  \title{ {Trading Strategies Performance and Risk Evaluation Methodologies Investigation} \\         {\large Institution} \\         {\includegraphics[scale=0.3]{inst_logo.jpg}} \\         {\medium Supervisor: Prof Someone} \\         \hfill \break         \hfill \break         \hfill \break         {\small A dissertation submitted in partial fulfillment of the requirements for the degree of}         }   Now, the \hfill \break does work but I get errors in my latex file. Is there a better way to create an empty line?


Can an adjective change the use of zero versus definite article?

I have a little issue with the use of zero versus definite article, since I tend to abuse the former one.  Consider the following sentences:        The issue described above influences the quality of software.   This general issue affects the speed of applications.   This affects the reliability of hardware.      The use of software, applications and hardware seems to me 'general', so according to what I know about english grammar, zero article should be used.  Suppose to add an adjective to 'specialize' such nouns, but still staying relatively general (i.e., not referring to specific applications).        The issue described above influences the quality of the? produced software.   This general issue affects the speed of the? deployed applications.   This affects the reliability of the? produced hardware.      In these last cases, is it mandatory to use the definite article or is zero article still acceptable? Is there grammar reference that justifies the answer?


Can someone help with an explanation and some references, in order to understand the nature of return pulses within a LiDAR system.


How to do Remote App Installs from iTunes in Macbook to iPhone

After the iTunes version 12.7 it seems impossible to install an app from iTunes and sync it to the iPhone:   However, there still exists the option in settings of iOS 9.3.5 on my iPhone 4s. Is it redundant?    Is there any way at all to install an app in my iPhone from my MacBook Air? From web browser, iTunes or otherwise?


Need to truncate the %username% variable in windows 7 to seven characters

I use a script that generates a session name for out AS400 sessions based on the system %username%, the problem is that if the username is over 7 characters long the connection will fail. The session names get one character appended and the connection supports a total lengh of 8 characters.  Any ideas?


What's the equivalent of the "cls" command from Windows/DOS?

I used to use cmd back in windows, and the command line I used a lot, was cls. It's kind of like the clear command used in Linux, but it cleans the screen permanently.  If you use the clear command, it just scroll down, so that you don't see the command you where working on.  I like both a lot, but my question is, how do i get a cls like command, that clears the screen, and can't browse up, to see the command you where working on?


Theming blocks individually, by region, or by module

I want to create a bock template for a certain region & a certain module. Drupal 8 does not offer these hook suggestions. In Drupal 7 it was .  I want to create block--[region]--[module].html.twig. How can I add this theme suggestion?


What happens now to reputation points when questions are moved between 'stacks'?

After the 'great recalc', do migrated questions and answers, and comments, and flags, and votes et al now count for reputation points on the destination site? This wasn't made completely clear in the blog post...


I removed Python 3.4 physically, is there anything I can do to avoid having to reinstall system?

While trying to install a python package I made a horrible mistake and removed Python 3.4 (if you are interested in how did I come up with it below is the link to my question on StackOverflow).    Anyway, now I can't run sudo apt-get install --reinstall python3.4, which is pretty bad I guess. Is there any way I could make my ubuntu 14.04 work again without having to lose files on my computer?  EDIT: Btw. I still have Python 2.7 (which I thought was the one used by the system), perhaps there is some way to use it to recover the rest?


Suppose that $f:A\rightarrow B$ and $g:B \rightarrow C$ are both one-to-one and onto. Prove that $gf$ is one-to-one and onto. Prove further that $(gf)^{-1} = f^{-1}g^{-1}$.   I have already proven the first part, but the second part has always puzzled me. I have tried assuming $x \in (gf)^{-1}$ but that doesn't lead to nowhere. Nor does $x \in (gf)^{-1}(t)$ and showing $x = t$. How to prove?


How to assign an icon to an executable on windows (or visual studio)

I would like to use a custom icon (a .ico file) for an executable, on windows (XP). The executable is a C++ program created thanks to visual studio (2008).  How can I change the icon from the executable, to the .ico file I want?


Are Force Sensitivity and Blood Lines Connected?

This has been discussed in at least one  before, but not directly addressed, at least not on this site.  Is there any actual connection between blood lines and Force sensitivity? We certainly see hints of that with both of Anakin's children showing Force sensitivity.  Do patterns like that show in other families?  Is there any indiction that Force sensitivity can be hereditary in some species or in some families?  (I'm not asking if it is always hereditary or always following blood lines, but is there enough to show this can be a notable factor in whether someone is sensitive or not.)


I'm playing with p-adic valuations, and find that the odd harmonic sums, $\tilde{H}_k=\sum_{i=1}^{k}\frac{1}{2i-1}$, has 2-adic valuation $||k^2||_2=2||k||_2$.   E.g.) $\tilde{H}_4=\frac{176}{85}$ has $||\tilde{H}_4||_2=||176||_2=4=2||4||_2$.  $\tilde{H}_6=\frac{6508}{3465}$ has $||\tilde{H}_6||_2=2$. $||\tilde{H}_8||_2=||\frac{91072}{45045}||_2=6$. $\cdots$  How can I prove this?  (Some simple observation I have tried: As , $||H_k||_2=||H_{2k}||_2+1=||\frac{1}{2}H_k||_2$. Thus ultrametric ineq for $\tilde{H}_k=H_{2k}-\frac{1}{2}H_k$ doesn't help at all, yielding trivial result $\tilde{H}_k\in \mathbb{Z}_2$.)  (That $||\tilde{H}_k||_2=2||k||_2$ for odd $k$ is almost trivial, so the problem can be reduced to show $||\tilde{H}_{2k}||_2=||\tilde{H}_k||_2+2$, still have no idea)  (I've checked this holds up to $\sim 1000$ using Mathematica, and Mathematica spits the result almost immediately for $n\sim 1000$ and takes about a minute for $n\sim 10000$. )   For anyone interested : I've used the following Mathematica code, try it yourself  a = Table[    IntegerExponent[      Numerator[HarmonicNumber[2 n] - HarmonicNumber[n]/2], 2]/2, {n,      10000}]; b = Table [IntegerExponent[n, 2], {n, 10000}]; NonNegative[Min[a - b]]


"in any situation" vs "in any situations"

I am writing an affirmation to motivate myself to be more assertive.  Choice 1: "I am assertive in any situation."  Choice 2: "I am assertive in any situations."  The question is: Should I use the word situation in singular or plural form?


I have a website with an index.php file (rhys.ddns.net/php/index.php). Whenever I try to access said file in my browser it is getting served as a download. I have checked my sites-enabled/default file and made changes suggested by others about exactly the same issue yet nothing is changing in behavior.  Server details: Raspberry Pi B+ [  Nginx/1.14.1 :  PHP7.2-FPM ]  Here are my config files (they are hosted separately as I am experiencing problems with the StackOverflow codeblocks)  /etc/nginx/nginx.conf -   /etc/nginx/sites-enabled/default -   /etc/php/7.2/fpm/php.ini -   /etc/php/7.2/fpm/pool.d/www.conf -   As always your help is appreciated and if U want me to post more files just comment :)


Prove: $33|mn(m^{10}-n^{10})\forall m,n\in\mathbb Z$

Prove: $$33|mn(m^{10}-n^{10})\forall m,n\in\mathbb Z$$   Apart from the trivial cases: $$3|m\;\lor\;3|n\;\;\&\;\;11|m\;\lor\;11|n$$ If $3\nmid m\;\land 3\nmid n$  Let $x\in\mathbb Z$ s.t.  $$x\equiv 1\pmod{3}\implies x^{10}\equiv 1\pmod{3}$$ $$x\equiv 2\equiv-1\pmod{3}\implies x^{10}\equiv 1\pmod{3}$$ $$\implies m^{10}\equiv n^{10}\pmod{3}\;\forall m,n\in\mathbb Z\implies m^{10}-n^{10}\equiv 0\pmod{3}$$ $$\implies 3|mn(m^{10}-n^{10})$$  $11\nmid m\;\land\;11\nmid n$  Let $x,y\in\mathbb Z$ s.t.  For each of the cases: $$x\equiv y\pmod{11},\;y\in\{1,\ldots, 10\}$$ by the Fermat's little theorem: $$x^{10}\equiv y^{10}\equiv 1\pmod{11}$$ $$\implies m^{10}\equiv n^{10}\pmod{11}\implies m^{10}-n^{10}\equiv 0\pmod{11}$$ Finally, $$\implies 33|mn(m^{10}-n^{10}),\;\forall\;m,n\in\mathbb Z $$ $$Q.E.D.$$  Is this correct?


How do we use zero conditional and first conditional to talk about things in the past

Enter the reasons why I asked: From my understanding, zero conditional is used to talk about facts or habitual stuff, and the first conditional is used to talk about a specific event or case. (Source: ) I am wondering how to use zero and first conditional when talking about things in the past. Do we just need to backshift the verbs and modal verbs? I came up with some examples below.  My examples: Example 1 - zero conditional in the past to talk about a general fact)  When I was young, my parents were strict with me. Unless I received good scores in school, they didn't allow me to play video games.  Example 2 - first conditional in the past to talk about a specific event)  I once played a truth-or-dare game with my friends and sister. My sister ended up sharing a lot of secrets with us. She wanted me to keep her secrets. As long as I kept her secrets, she would reward me by telling our parents that I did well in school.  Example 3 - first conditional in the past about to talk about a specific event)  A Few years ago, I met a lovely girl at the beginning of school. Unless I talked to her, I would not have a chance to make friends with her. So I talked to her.   My questions: Question 1:  In my examples, I used "would" when it is first conditional and simple past when it is zero conditional. Are my examples correct? Do we just need to backshift the verbs and modal verbs?  Question 2:  When using zero and first conditional in the past, do we also use zero conditional to talk about general or habitual stuff and first conditional to talk about a particular case?


Missing Open context option for multiple MP3 files

When multiple MP3 files are selected in Windows Explorer on windows 7 there is no Open option. I have an Open and Edit option via the . This has nothing to do with the "Open with" sub-menu. How do I restore the context option when multiple files are selected?


Which one of the following is correct use? If both are correct, what difference does this change make in a conversation?   Do you know when is this being used? Do you know when this is being used?


First I asked this at AskUbuntu:     I've been trying to install .deb chrome file google-chrome-stable_current_amd.64.deb. It is saved in my Downloads, so I tried this command      sudo apt-get install ~/Downloads/google-chrome-stable_current_amd.64.deb   After reading the package list it responds:      E: Unsupported file /home/stockton/Downloads/google-chrome-stable_current_amd.64.deb given on command line   I don't know why it says E: file, I though Linux drives and files are not named after letters like Windows drives, for example 'C:' but idk I can still be wrong. I did have Windows 10 before I booted Ubuntu.      Any help will be great.   And then someone suggested I perform this command:      The conventional way is to install using dpkg. It is a new feature of apt to install from deb files. That's why the correct syntax is not always clear. man apt doesn't tell much either.      So a guaranteed way is to copy the deb file to your Home directory and running      sudo dpkg -i google-chrome-stable_current_amd64.deb   If it is the first time you install Chrome, you will get some error messages regarding missing dependencies. You can fix it by      sudo apt install -f   Instead of copying to Home you can use the path      sudo dpkg -i ~/Downloads/google-chrome-stable_current_amd64.deb    Now when I tired the sudo apt -i command, the computer was processing the downloaded chrome files and puts on the screen: Errors were encountered while processing: google-chrome-stable I don't know what to do now please help me.


I have an attribute called catdet_sector which is of type text. The problem is that the values of this attribute appear in parentheses as shown in the attached figure. I present a personalized form which presents the values, but when the attribute is in parentheses it does not present them.  I tried the replace function but it did not work, the problem is because of the type of object I use in the form. When I use the ratio of values or value map in edit mode, the parentheses appear. On the other hand, when I use text editing the parentheses disappear and the data is displayed correctly


Characterization of 1-dimensional manifolds.

My intuition tells me that the only connected 1-dimensional topological manifolds are the real line $\mathbb{R}$ and the circle $S^1$.   Is this true?   If yes, is it possible to prove it from first principles, or is it something that needs some highly technical theorems?  If no, do we have an example of connected 1-dimensional manifold not homeomorphic to $\mathbb{R}$ or $S^1$?


let $p$ be a prime number; then  how many distict subrings (with unity) of cardinality $p$ does the field $F_{p^2}$ have?  1.$0$  2.$1$  3.$p$  4.$p^2$  I think it will have only one subring of cardinality $p$. Am I right?


I am struggling answering this question for myself: How can i prove that a Group $G$ is abelian, if $$g\circ g=e \ \forall g \in G $$  A group is abelian if this is true: $$a\circ b = b\circ a\ \forall a,b \in G$$ But i dont understand how to prove this.  Hope someone can help me out with this!


Let $U: \mathbb C \to \mathbb R$ be a harmonic function such that $U(z)\ge 0 \ \forall z\in \mathbb C$ ; then $U$ is constant.    I don't know about simply connected domain. Can we do it without using that?  Edit: The more elementary the proof, the better. I'm working my way through a complex analysis workbook, and by this exercise, the substantial things covered are Lioville's theorem, Maximum modulus theorem.


Convergence of $\sum \frac{\sqrt{a_n}}{n^p}$

For $a_n \geq 0$, and $\sum a_n$ convergent, show that  $\sum \frac{\sqrt{a_n}}{n^p}$ is also convergent for $p > 1/2$?  What bugs me more is why isn't $\sum \sqrt{\frac{a_n}{n}}$ convergent??  Clearly it converges for $p > 1$, and $a_n$ somehow helps out in $p \in (1/2,1)$.  Only hints are welcomed  Thanks in advance..


Java palindrome checker giving wrong answer

Java Noob here, I wrote the following code to check if a given string is palindrome or not: import java.io.*; import java.util.*;  public class Solution {      public static void main(String[] args) {          Scanner sc=new Scanner(System.in);         String A=sc.next();          StringBuilder str = new StringBuilder(A);         StringBuilder original = new StringBuilder(A);         str.reverse();         if(str == original)         {             System.out.println("Yes");         }          else             System.out.println("No");     } }  for input 'madam' it's saying NO? What is wrong with the code?


Am I affected by the travel ban - getting a US visa for Syrian citizens?

I am a Syrian citizen who obtained a visa to travel to the US one week before the travel ban was implemented. Since then I have successfully entered and left the US twice (last time being March 2019). My visa (B1/B2) has expired and I am planning to apply for a new one.    Am I now affected by the travel ban placed on Syrians travelling to the US?


Does reusing my own code from one project to an other count as plagiarism?

I am currently a under graduate and will be going into my final year of a Computer science course in October.   The final year consists of a large programming project. Over the last 6 months I have been working on ideas for the project. To the point where I have a nearly finished application.   If I was to use large chunks of code that I have written over the last 6 months in the project would this count as Plagiarism? It doesn't feel right been able to just copy and past code to get a head start on the project even though I had written the code in the first place.


What is the difference between square brackets and double parentheses in Bash?

I notice in  that one answerer used double parentheses where the other used square brackets:  if (( $(fileSize FILE1.txt) != $(fileSize FILE2.txt) )); then   ...  if [ $(fileSize FILE1.txt) != $(fileSize FILE2.txt) ]; then   I haven't seen double parentheses before - and googling doesn't help. Do they have exactly the same meaning? Any difference in portability? Reason to prefer one over the other?


So as you can see there is some very weird lighting on the body of my model. My initial thought was that it was the normals, however after recalcualting and checking manually that they were facing the correct direction, still nothing changed.  Thoughts? Also, sorry if it's an obvious answer, i'm new to blender


Is it safe to replace dynamic_cast with static_cast?

For a data analysis program I am using a library which solely uses dynamic_cast instead of static_cast. After profiling and optimizing my own code, valgrind shows me that my program is spending roughly 50% of the time doing dynamic_cast in library code. As this library is open source I have replaced all relevant dynamic_cast with static_cast. The library builds just fine, but as I do not have a deeper understanding of the library code I do not know if I have broken anything.   Can I break anything by replacing dynamic_cast with static_cast? (besides the build process) If yes, which cases are foolproof and for what kind of problems do I have to look out for? Is my impression correct, that I can considerably improve the run time of my program by doing this replacement? Or am I just shifting problems around?


Let $a_n \to +\infty$, and let $b_n \to +\infty$. Show that $a_n + b_n \to +\infty$

I know how to show $a_n$ diverges, or $b_n$. I know the sum of two convergent limits is the sum of the limits. But how do we show that two divergent limits are divergent?


Help with installing Nvidia-410 drivers on Ubuntu 18.04

I have been having trouble installing the latest nvidia-410 driver to use with CUDA.  I can install them directly from Nvidia's website but it means that the package manager doesn't recognize that the official drivers are installed.  Attempts to install them via the terminal have failed as I get the following error.  Obviously I have done something wrong somewhere but not sure what.  Any help is appreciated.  nathan@BB-8:~$ sudo apt -f install Reading package lists... Done Building dependency tree        Reading state information... Done Correcting dependencies... Done The following additional packages will be installed:   nvidia-410 The following NEW packages will be installed   nvidia-410 0 to upgrade, 1 to newly install, 0 to remove and 307 not to upgrade. 2 not fully installed or removed. Need to get 0 B/96.9 MB of archives. After this operation, 394 MB of additional disk space will be used. Do you want to continue? [Y/n] Y (Reading database ... 179510 files and directories currently installed.) Preparing to unpack .../nvidia-410_410.79-0ubuntu1_amd64.deb ... Unpacking nvidia-410 (410.79-0ubuntu1) ... dpkg: error processing archive /var/cache/apt/archives/nvidia-410_410.79-0ubuntu1_amd64.deb (--unpack):  trying to overwrite '/usr/lib/x86_64-linux-gnu/libGLX_indirect.so.0', which is also in package libglx-mesa0:amd64 18.0.5-0ubuntu0~18.04.1 Errors were encountered while processing:  /var/cache/apt/archives/nvidia-410_410.79-0ubuntu1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)   Ninja Edit:  Worth adding this is the error I get with the manually installed Nvidia drivers  Reading package lists... Done Building dependency tree        Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies.  aptitude : Depends: aptitude-common (= 0.8.10-6ubuntu1) but it is not going to be installed             Depends: libcwidget3v5 but it is not going to be installed             Depends: libsigc++-2.0-0v5 (>= 2.8.0) but it is not going to be installed  libcuda1-410 : Depends: nvidia-410 (>= 410.79) but it is not going to be installed  nvidia-opencl-icd-410 : Depends: nvidia-410 (>= 410.79) but it is not going to be installed E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).


Prove a combinatorial identity with a combinatorial argument

$$\sum_{k=1}^{n}{k^2}\cdot\dbinom{n}{k} = n(n+1)2^{n-2}$$  Attempt:  I have re-written in it as follows: $$\sum_{k=1}^{n}\dbinom{k}{1}\dbinom{k}{1}\dbinom{n}{k} = \dbinom{n}{1}\dbinom{n+1}{1}  2^{n-2}$$  the LHS seems like a case where a committee of k people is to be formed from n people. We choose a president in k ways. Then, we choose a secretary in k ways again. Which means that the president could be chosen as a secretary as well? (probably not the best example).  How can I use the RHS to show the same thing?


Why do so many login webpages seperate email and password fields?

I've been noticing that many popular login pages separate email and password fields on separate "sections" or pages. Is there a UX benefit or reason for this that I'm not aware of?


How to add span tag in to webform element label?

I am trying to style my webform checkboxes and radio buttons differently. For this reason I want to insert span element in to the label and use it instead of original checkboxes.   Found this module :  , but non of the listed options appear in my webform field settings.  Does any body know good solution to accomplish this ?


Investing in a leveraged index ETF for retirement.  Risky?

I'm 23, and in addition to my 401k at work, I have a few thousand saved in an IRA. Right now I have it sitting in Treasurys earning around 3%.  Over the past 50 years the S&P has averaged around 11% per year in total returns. I'm perfectly willing to invest it in an index (like the S&P) or in a few bellwether-style single stocks (think Warren Buffet: KO, BAC, JNJ, etc). Most mutual funds underperform the market, so I'm not really interested in trying to pick those out at this point (unless you have a convincing argument).  I'm looking for feedback on the idea of investing the IRA balance in a 3x leveraged S&P ETF, specifically UPRO. My thinking: If the S&P averages 11%, this should average ~33%, minus fees of about 1%. The balance of the IRA is about $5k, and I'm not drawing retirement for another 40 years, so if somehow I "lose everything" it's not going to ruin my life. My future contributions to this IRA will probably be put in something safer, but I'm willing to take a risk now.  Is my thinking on how this 3x leveraged ETF works correct, or am I missing something?


Let $\phi(x) = x^p$ be the Frobenius automorphism on $\mathbb F_{p^n}$. We can view $\mathbb F_{p^n}$ as an $n$-dimensional vector space over $\mathbb F_p$. In this case, $\phi$ is a linear transformation. What are its characteristic and minimal polynomials? What are its Jordan and rational canonical forms? I know that $\phi$ satisfies $x^n - 1$, so its minimal and characteristic polynomials must divide this one. But, I can't seem to make much progress beyond this. Any suggestions?


H to check if proportions in two small samples are the same

I have two small samples denoting if something occured or not. For example:  $s_1=\left(1,1,1,0,0,1\right)$  $s_2=\left(1,0,0,0,0,1,1,0\right)$  I want to test if proportions of occuring $1$ are the same. I cannot use proportion test for two samples, as samples are too small. Can I use Chi square homogenity test and get the robust outcome?


Can we detect the existence of outliers using mean and median?

Suppose, I have a data set with eight features in my hand.  I have juxtaposed their means and medians row by row.              f1       f2        f3        f4        f5        f6        f7        f8 mean      2.5000    0.1868    0.0148    0.2105    0.2088   79.6583    1.0604    0.0091 median    2.5000    0.1826    0.0001    0.0002    0.0000   -0.0000    0.0000   -0.0000   Can we tell anything about the existence of outliers from these information?


Validating a non-empty String in Lo-Dash

[Use-case: portable Lo-Dash code]  I've been looking for an elegant Lo-Dash empty-string validator in our nodeJS projects for some time now, because  only handles Arrays and Objects. So I always ended up doing it with the ugly old-fashioned likes of:   if (typeof(myString) !== "undefined" && myString.trim() !== "") {   // handle the string }   ... Until I stumbled upon , which returns '' for null and undefined. So I created a mixin in our extendedLodash.js helper that uses only Lo-Dash methods. However I'm uncertain of caveats; any comment on what I might be overseeing is welcome:   'use strict';  const _ = require('lodash');  /**  * Extension of _.isEmpty(), which will return `true` for   *   "", 0, [], {}, false, undefined and null  * @param stringOrObjectOrNull  * @returns {boolean}  */ function empty(stringOrObjectOrNull) {   return _(stringOrObjectOrNull).toString().trim() === ""       || _.isEmpty(stringOrObjectOrNull); }  _.mixin({   empty });  module.exports = _;   Now we can use this:   const _ = require('../lib/helpers/extendedLodash');  if (!_.empty(myStringOrObject)) {   // handle the string ( ...or object ;-| ) }   And test:     console.log('is empty `[]`: ' + _.empty([]) + " -> " + "`" + _.toString([]) + "`");   console.log('is empty `{}`: ' + _.empty({}) + " -> " + "`" + _.toString({}) + "`");   console.log('is empty `""`: ' + _.empty("") + " -> " + "`" + _.toString("") + "`");   console.log('is empty `"    "`: ' + _.empty("    ") + " -> " + "`" + _.toString("    ") + "`");   console.log('is empty `0`: ' + _.empty(0) + " -> " + "`" + _.toString(0) + "`");   console.log('is empty `false`: ' + _.empty(false) + " -> " + "`" + _.toString(false) + "`");   console.log('is empty `null`: ' + _.empty(null) + " -> " + "`" + _.toString(null) + "`");   console.log('is empty `undefined`: ' + _.empty(undefined) + " -> " + "`" + _.toString(undefined) + "`");   Note: Going over this code again, I realize this behaves just as fuzzy as PHP's  method ... I'm not sure that is appropriate; I just want to avoid necessity of catching undefined where variables might not be declared (...)


I am trying to make an article (elsarticle) uses English as main language and some Arabic words embedded using arabtex but this error is generated:  Missing } inserted. \end{abstract}   I wish some one know about it, and has a solution.  \documentclass[preprint,12pt]{elsarticle}  \usepackage{arabtex}  \usepackage{amssymb}  \usepackage{lineno}  \journal{Journal Name}  \begin{document}  \begin{frontmatter}  \title{Unncessarily Complicated Research Title}  \author{John Smith} \address{California, United States}  \begin{abstract} here some text \end{abstract}  \begin{keyword} Science \sep Publication \sep Complicated \end{keyword} \end{frontmatter}  \bibliographystyle{model1-num-names}  \bibliography{Biblio}  \end{document}


Find out what is starting firefox on windows starup

Something set up firefox on windows machine to start and go to certain url as user logins into system.   In process explorer I see, that Firefox is started as "firefox.exe -osint -url "somenastything" and cmd window flashing briefly as I login. I can see pid of the parent, which is (4300) or something. I enabled event history in task scheduler, but from the logs, I don't see process with corresponding pid. How does this thing managed to auto-start then?


$R$ is simple iff $M_n(R)$ is simple for rings without identity

Let $R$ be a ring without identity and $n$ be a positive integer. Prove that  the ring $R$ is simple iff $M_n(R)$ is simple.  When $R$ is unital ring (i.e. with identity) it is easy because we know the structure of two-sided ideals in $M_n(R)$. So we can consider the case, when $R$ is non-unital.


Inserting a pdf file after a title causes the tile to be on one page and the pdf to start on the next

I have a new page, with title. I want my pdf file to show up under the title. However, the pdf shows up on the following page. I want the pdf to be under the title page. Is the issue the size of the pdf? Here's my code:  \newpage \section{Requirements Document} \includepdf[pages=-]{requirements_xlsx.pdf}


Integral domain with fraction field equal to $\mathbb{R}$

I wonder if there is an integral domain $A\subseteq \mathbb{R}$ which is not a field, and such that the field of fractions of $A$ is equal to $\mathbb{R}$?  Edit: here as a possible direction: it is known that there is no finite field extension $k\subseteq \mathbb{R}$. Given such an $A$, can we produce such a $k$, contradicting this theorem?


Implementing pinch/double tap to zoom for a UIImage

I am trying to workout how to implement a UIImage that has pinch/double tap to zoom. Is this possible with a standard UIImageView?    Looking at other questions at documentation it has to be completed with a UIScrollView?    Source:     The issue I see is that the above link suggests using initWithImage on the scrollView, but that is not available?   I am looking to implement an Image that is full screen (no larger), if the image is larger it should scale Aspect to Fit into the full screen. The user can then double tap or Pinch to zoom into the image. What is the correct approach for this?


Calculate $\int _{x=0}^{\infty} \frac{\sin(x)}{x}$ with the function $\frac{e^{iz}}{z}$

I want to calculate $\int _{x=0}^{\infty} \frac{\sin(x)}{x}$ with the function $f(z) = \frac{e^{iz}}{z}$.  I thought about using the closed path $\Gamma = \gamma _1 + \gamma _R + \gamma _2 + \gamma _{\epsilon}$, when:  $\gamma_1 (t) = t, t \in [i\epsilon, iR]$  $\gamma_R (t) = Re^{it}, t \in [-\frac{\pi}{2}, \frac{\pi}{2}]$  $\gamma_2 (t) = t, t \in [-iR, -i\epsilon]$  $\gamma_{\epsilon} (t) = \epsilon e^{it}, t \in [-\frac{\pi}{2}, \frac{\pi}{2}]$  I use the fact that $\frac{\sin(x)}{x}$ is an even function and has an anti derivative, so the integral on a closed path is zero.  I managed to show that $\int_{\gamma _{\epsilon}} f = -i\pi$ when $\epsilon \to 0$.  However I am struggling to show that $\int_{\gamma _R} f = 0$ when $R \to \infty$  Help would be appreciated


Show that Function Compositions Are Associative

My intent is to show that a composition of bijections is also a bijection by showing the existence of an inverse.  But my approach requires the associativity of function composition.  Let $f:  X \rightarrow Y, g:  Y \rightarrow Z, h:  Z \rightarrow W$ be functions.  $((f \circ g) \circ h)(x) = h((f \circ g)(x)) = h(g(f(x)))$, and $(f \circ (g \circ h))(x) = (g \circ h)(f(x)) = h(g(f(x)))$.  However, I am having problems in justifying that the two compositions, $(f \circ g) \circ h$ and $f \circ (g \circ h)$, have the same domain and range.  When I consulted ProofWiki, whose link is at the bottom, I got even more confused.  Specifically, for $(f \circ g) \circ h = f \circ (g \circ h)$ to be defined, ProofWiki requires that dom$g =$ codom$f$ and dom$h =$ codom$g$.  First of all, I think that it should be dom$g =$ range$f$ ....  Moreover, as you can see in the example below, you actually have to adjust domains and ranges of $f, g, h$ for the requirement to hold true.  Let $f: \mathbb R \rightarrow \mathbb R$ be $f(x) = 2x$, $g: \mathbb R^+ \rightarrow \mathbb R$ be $g(y) = ln(y)$, $h: \mathbb R \rightarrow \mathbb R$ be $h(z) = z - 10$.   Then $((f \circ g) \circ h)(x) = ln(2x) - 10 = (f \circ (g \circ h))(x)$, with dom$((f \circ g) \circ h) = \mathbb R^+$ = dom$(f \circ (g \circ h))$.  As a result, we need to set dom$f = \mathbb R^+$, range$f = \mathbb R^+$; dom$g$, range$g$, dom$h$, and range$h$ remain the same.  Am I allowed to do that?  This adjustment implies that when we say dom$f = X$, $f$ must be defined for all elements in $X$, but $X$ may not be the entire set of elements for which $f$ is defined.


MS word: a macro to turn ON/OFF some proofing settings

What macro could turn ON/OFF some proofing settings? (Unfortunately macro recording doesn't record the setting change)  I'm looking for a way to turn ON/OFF 2 proofing settings (at the same time):    check spelling as you type mark grammar errors as you type


Use a Delayed Choice Quantum Eraser to communicate Faster Than Light

In the , photons reach D0 and shows a pattern, before its quantum entangled counterparts reach one of D1, D2, D3, or D4. The pattern differs based on what happens at the beam splitters (BSa and BSb) and whether the which-path information is lost.  What if, instead of installing beam splitters BSa and BSb, we install either pure glass panels or pure silver mirrors. Now imagine we place the splitter part of the setup light-years away from earth, with an astronaut who can decide if she wants to put 2 mirrors or 2 glass panels at BSa and BSb. By shooting photons and observing the patterns on D0 on earth, we could instantly tell which decision the astronaut has made. She can then expand this further, encode any information into bits, and achieve FTL communication.  It will be something like: we keep shooting photons at D0 and keep seeing interference pattern, until one day we go, "yep, it starts to look like a diffraction pattern now, she must have switched the panels moments ago!"  Since no information can travel FTL, I'm sure my idea is flawed, but what's wrong with it?


Running a program in background using command-line

How do I run a program in the background from a shell, with the ability to close the shell while leaving the program running which should not disturb the window i am working on? Lets say my UI is having problems or for some reason, I need to boot up a program from the terminal window.  The program should not disturb my window in which i am working on but it should be opened from the command line and i should be able to get access to it using the normal shortcut ALT+TAB.  Even the command line should exit during this process.  I tried this ....  "gedit file-name & exit"  this is working fine but the gedit file is opening in the foreground i.e it is focused.  (let i be working on some application like mozilla. After running the command ..... gedit file is bieng focused rather than mozilla which should not happen)  It is fine if the answer also comes in a script.


$\sum_{n=1}^\infty \ln\left(\frac{n}{n+1}\right)$ convergence or divergence

This sum is convergence or divergence?  $$\sum_{n=1}^\infty \ln\left(\frac{n}{n+1}\right)$$  What I 've tried   Divergent test : inconclusive, limit is $0$ Comparison Test : inconclusive, larger term is divergent   $$\sum_{n=1}^\infty \ln\left(\frac{n}{n+1}\right) < \sum_{n=1}^\infty \frac{n}{n+1}$$   Limit Comparison Test : inconclusive, limit is $-1$ for $b_n = 1/n$ Ratio Test : inconclusive, using L'hopital's rule and the limit is $1$


I only have Internet connection from LAN through Linux PC.  How can I connect my Android 2.1 to the Internet though USB cable?


Are two independent events $A$ and $B$ also conditionally independent given the event $C$?

If we know that two events $A$ and $B$ are independent, can we say that $A$ and $B$ are also conditionally independent given an arbitrary event $C$?  $$P(A\cap B) = P(A)P(B) \overset{?}{\Rightarrow} P(A\cap B|C) = P(A|C)P(B|C)$$


Is a vacuously true argument a valid argument?

From what I know, given some argument, the argument is valid when it has true premises that lead to a true conclusion. Now, what if the premises were false? I mean, the conclusion would be vacuously true, but does that make the argument valid? It sounds rather odd, since taking the argument to be valid is essentially accepting some ridiculous statement. But I don't know, I'm just a bit confused.


Assigning values to same lists, but get different results

I create two same zero lists. Yet the results are different when the lists are assigned to same values. Here are my code and result.  code:  m1 = [[0] * 4] * 4 m2 = [[0 for j in range(4)] for i in range(4)] m1[0][1] = 1 m2[0][1] = 1 print('m1:', m1) print('m2:', m2)   result:  m1: [[0, 1, 0, 0], [0, 1, 0, 0], [0, 1, 0, 0], [0, 1, 0, 0]] m2: [[0, 1, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]   Or maybe the two lists are not the "same"? Any help would be appreciated.


Prove that for any set of $2n+3$ integers from the interval $[-2n-1,2n+1]$ there is a triple $(x,y,z)$ such that $x+y+z=0$.    Example  : Choose $5$ number from $\{-3,-2,-1,0,1,2,3\}$ there are $x,y,z$ with $x+y+z=0$.


Does there exist a positive-only distribution such that the difference of two independent samples from this distribution is normally distributed? If so, does it have a simple form?