How to create a backwards sentence and words?

Hey guys I'm new here and a programming noob so bear with me here. This is for my C++ class which sadly my teacher is terrible at teaching so many things confuse me so I need some help here. We have a lab that is called 'Reverse Sentence' and this is what it wants In this lab. Write the function "ReverseSentence" that takes a string parameter and changes it, by reversing it. For example:  INPUT: the first test OUTPUT: tset tsrif eht  The function must not use an extra string, but must reverse the elements of the input string. #include <iostream> #include <string> using namespace std;  void ReverseSentence( string& inputSentence){     /* Body of Function Here */  }  int main(){    string inputSentence;    cout << "Input your sentence: ";    getline(cin, inputSentence);    cout << endl;     ReverseSentence(inputSentence);    cout << "Reversed Sentence:" << endl;    cout << inputSentence << endl;     return 0; }  Can someone please help me what function is because I'm having trouble with it.


Apologies if this is duplicate, I've dug around and can't find it.  If you leave a sponge/cloth out to dry for a while it eventually becomes slightly stiff. Upon wetting again, however, it softens up again. That is, until it dries out once more.  Why does a cloth/sponge soften up when it's saturated with water?


What are requirements for Ubuntu Studio?

I have an Acer Aspire 3682 WXMi laptop, 40gb HD, 512mb ram.  Will this take Ubuntu, or more specifically Ubuntu Studio?


Proving that $\mathbb{A}=\{\alpha \in \mathbb{C}: \alpha \text{ is algebraic over } \mathbb{Q} \}$ is not a finite extension

It is true that all finite field extensions are algebraic. It is not true however that all algebraic extensions are finite.   In lectures we were given the example of the field extension  $$\mathbb{A}=\{\alpha \in \mathbb{C}: \alpha \text{ is algebraic over } \mathbb{Q} \}$$  I want to prove to myself that this is indeed a non-finite algebraic extension.   I have shown that $\mathbb{A}$ is a subfield of $\mathbb{C}$. Now I consider roots of the equation $x^n-2$ for $n \geq 1$. Clearly such roots are in $\mathbb{A}$ by definition. I think that if I show that for a given $k$, the root of $x^k-2$ (say $\psi_k$) does not lie in $\mathbb{Q}(\psi_1,...,\psi_{k-1})$, then I have proven the extension is not finitie (since this will hold for all $n$).  Can someone please confirm this reasoning and suggest how the proof could be finished.


Is this a way to instantiate a class in javascript?

Starting to learn javascript but am confused as to how to define a class.  Is the following a way to define a class?   var bar = function (a, b) {     var product = a*b;     var sum = a+b;      return function() {return product / sum}; };   I think that it is just a function but was told that it was also a class.


I have designed an encryption algorithm. The algorithm will probably use CFB mode. The algorithm can encrypt any block size and this does not change the size of the key. There are always about $20$ rounds and the key is always around $128$-bits.  However, the algorithm works much slower when it works on $128$-bits blocks, than on about $32$-bits blocks. What are the block size limitations for a secure cipher? If the key is $128$-bits, can it be encrypted in about $32$-bit blocks? Is it secure?  The only  condition I found is that $n!$ should be greater than $2^{128}$, where $n$ is the block size.


I'm working on an addon that generates buildings based upon a base mesh.  Presently, I'm hoping to add a feature that allows the user to very quickly create the base mesh using a modal operator, whereby they would be able to extrude the base mesh in fixed increments by clicking and dragging the faces they want to extrude.  I want the operator to check if the mouse cursor is over a face on the base object, and set that face as the active selection. Anyone done something like this before? Any help you could offer would be greatly appreciated!  (Note: If there's a more efficient means to the same end, I'm very open to suggestions!)


Referencing text from one cell into an equation in Excel

I have text in a cell (A1) that is also the name of a worksheet within my workbook. How do I go about referencing a specific cell on that sheet? I want it to look like the formula below without having to type in the text manually.  ='Tab Name'!D16


how do you get a crimson biome in a corruption world?

so, I have a corruption world and I want to beat the BOC in terreria.  which means I have to get something that can spread crimsion.  can u guys help me out?


Can I still eat my bean sprouts that I left unrefrigerated?

I forgot a grocery bag in my trunk, and didn't realize it until 24 hours later.  I had bean sprouts in the bag, and it says to keep refrigerated.  Are they safe to eat? I am not sure what happens to bean sprouts if left unrefrigerated.


How could this user edit only one character?

Someone  in one of my posts.  Much appreciated, but it was just deleting one character. How could he do that? I thought there was a minimum of 6 characters for an edit to go through? (A rather silly rule if I may say so, but how did the user bypass the rule?)


Are there any examples of viruses that have powered motion or do they all rely on passive diffusion?

Swimming, or any locomotion will presumably require energy which will in turn require metabolism which viruses lack supposedly.   Are they general able to direct their movement in any manner (e.g like sailing) or are they strictly limited to Brownian-like motion? If not, are there any exceptional examples that indeed can control their motion?


Is there an elementary way to see that there is only one complex manifold structure on $R^2$?

Is there an elementary way to see that there is only one complex manifold structure on $\mathbb{R}^2$? (Up to biholomorphism, naturally.)  Elementary in the sense of not appealing to the uniformization theorem.


Can i install lubuntu on a netbook only with my usb?

My netbook's xp os doesn't work so i want to install lubuntu but what i have to do? Download the llubuntus latest version and then my netbook's drivers and that's it? Help   Netbook (Acer a0531h)  Thanks 😟


Minimal polynomial of restriction to invariant subspace divides minimal polynomial

I'm trying to prove this:  $T : V \to V$ linear transformation. $W$ subspace of $V$. If $W$ is $T$-invariant then the minimal polynomial for the restriction operator $T|_W$ divides the minimal polynomial for $T$.


Difference between (type) name and name as type c#

In C# it is possible to cast variables using the following two syntaxes:  (Type)name or name as Type  I have looked around online and can't seem to find an answer, is there any fundamental difference in these two methods and, if not, why are both available (i.e. are there some cases where one would be more appropriate than the other).


What's a word or phrase for a prearranged situation seeming otherwise?

What's a word or phrase for a situation in which, for example, people in authority pretend to be serious in selecting a new member, whereas they have already decided who to choose?  I googled it but to no avail.


When I open bash and press the up arrow I see the last command I have typed. Continues presses of the up arrow will show a series of commands typed on the past.  How do I find one specific command from that list, instead of having to press the up arrow n times?


Express symmetric polynomial $\prod_{i < j} (X_i+X_j)$ in terms of elementary symmetric functions

Exercise: Define a polynomial $\Sigma(X_1,\ldots,X_n)$ as \begin{align*} \Sigma(X_1,\ldots,X_n) = \prod_{i < j} (X_i+X_j) \end{align*} This is a symmetric polynomial, quite clearly. I want to express $\Sigma$ as a polynomial in the elementary symmetric functions, for $n=2,3,4$. Case $n=2$ is trivial: $\Sigma(X_1,X_2)= \sigma_1 = X_1+X_2$. Case $n=3$ is easy. I write $\Sigma$ as follows: \begin{align*} \Sigma(X_1,X_2,X_3) = (\sigma_1 - X_1)(\sigma_1 - X_2)(\sigma_1 - X_3), \end{align*} then apply  formally, obtaining \begin{align*} \Sigma(X_1,X_2,X_3) = \sigma_1^3 - \sigma_1 \sigma_1^2 + \sigma_2 \sigma_1 - \sigma_3 = \sigma_2 \sigma_1 - \sigma_3. \end{align*} The case $n=4$ seems harder to me, and I'm unable to work it out. I hope there is some trick to avoid unnecessary computations. My attempt is to write down $\Sigma$ completely: \begin{align*} \Sigma = (X_1+X_2)(X_3+X_4)(X_1+X_4)(X_2+X_3)(X_2+X_4)(X_1+X_3) \end{align*} and then multiply factors in groups of two, obtaining: \begin{align*} \Sigma = (\sigma_2 - X_1X_2-X_3X_4)(\sigma_2 - X_1X_4 - X_2X_3)(\sigma_2 - X_2X_4-X_1X_3), \end{align*} but it doesn't seem to help much. How can I solve the exercise?


Let $G$ be a finite group and $\alpha$ be an automorphism of $G$ which fixes only the unit of $G$ (if $\alpha(a)=a$, then $a=1$). And $\alpha^2=1$. Show that $G$ is abelian.   I think it is enough to prove $\alpha(a^{-1}b^{-1}ab)=a^{-1}b^{-1}ab$, but don't know how to get it.


Answering a protected question on a different site

I'm mainly a Stack Overflower, but sometimes stray to darker sides of Stack Exchange. I get the customary 100 rep bump since I'm a 'trusted member'. However, on a recent site I visited (), I couldn't post an answer to a protected question because I didn't have 10 rep points on that specific site. So what was the purpose in giving me the 100 rep bump? More of a curiosity than anything and wondering if that's intentional or an oversight.


necessary and sufficient condition for trivial kernel of a matrix over a commutative ring

In answering  I was surprised how hard it was to find anything on the Web about the generalization of the following fact to commutative rings:     A square matrix over a field has trivial kernel if and only if its determinant is non-zero.   As Bill demonstrated in the above question, a related fact about fields generalizes directly to commutative rings:     A square matrix over a commutative ring is invertible if and only if its   determinant is invertible.   However, the kernel being trivial and the matrix being invertible are not equivalent for general rings, so the question arises what the proper generalization of the first fact is. Since it took me quite a lot of searching to find the answer to this rather basic question, and it's  to write a question and answer it to document something that might be useful to others, I thought I'd write this up here in an accessible form.  So my questions are: What is the relationship between the determinant of a square matrix over a commutative ring and the triviality of its kernel? Can the simple relationship that holds for fields be generalized? And (generalizing with a view to the answer) what is a necessary and sufficient condition for a (not necessarily square) matrix over a commutative ring to have trivial kernel?


Is this proof of $\liminf E_k \subset \limsup E_k $ correct?

I am wondering if my proof is correct? Thank you for whoever willing to take a look at it for me.     Proof $\liminf E_k \subset \limsup E_k $   If $\{E_k\}_{k=1}^\infty$ is a sequence of sets, we define \begin{align*} \limsup E_k & = \bigcap_{j=1}^\infty\left(\bigcup_{k=j}^\infty E_k\right)\\ &= \bigcap_{j=1}^\infty(E_j \cup E_{j+1} \cup \cdots)\\ &= (E_1 \cup E_2 \cup \cdots) \cap (E_2 \cup E_3 \cup \cdots) \cap \cdots. \end{align*}  Therefore, $\limsup E_k$ consists of those points in $\mathbb{R}^n$ which belong to infinitely many $E_k$. \begin{align*} \liminf E_k & = \bigcup_{j=1}^\infty\left(\bigcap_{k=j}^\infty E_k\right)\\ &= \bigcup_{j=1}^\infty(E_j \cap E_{j+1} \cap \cdots)\\ &= (E_1 \cap E_2 \cap \cdots) \cup (E_2 \cap E_3 \cap \cdots) \cup \cdots. \end{align*} Therefore, $\liminf E_k$ consists of those points in $\mathbb{R}^n$ which belong to all $E_k$ for $k \geq k_0$.  Now consider $x \in \liminf E_k$, then $x \in E_1 \cap E_2 \cap \cdots$, or $x \in E_2 \cap E_3 \cap \cdots$ and so on, that is to say, $x \in E_{k_0} \cup E_{k_0+1} \cup \dots$ for some $k_0$. More specifically, $x \in E_k \forall k \geq k_0$. Therefore, $x \in (E_1 \cup E_2 \cup \cdots) \cap (E_2 \cup E_3 \cup \cdots) \cap \cdots$, so we showed $x \in \limsup E_k$.


Let's say, I write the file testFunc.py, containing  def helloWorld():     print['hello world']   When I run inside the python interpreter (v. 3.5.2)  >>> import testFunc >>> testFunc.helloWorld()   as expected I get the error message  ... error ... line 2, in helloWorld print['hello world']   If I correct the code to  def helloWorld():     print('hello world')   and rerun only the command without closing python in the meanwhile, I get the following error message:  >>> testFunc.helloWorld()  ... error ... line 2, in helloWorld print('hello world')   So I get an error message, even though the code appearing inside the error message would be correct. Apparently Python stored the binary of the function somewhere and didn't recompile it. On the other hand, Python reads out the new source file, which doesn't contain the error anymore.  So why does Python do this? I find this behavior highly misleading. Why does Python not compare the time stamps of the source code and the temporary binary and recompile the source if it has been edited since? Is it because another instance of Python may be currently executing the temporary binary?


Who provides the Internet service to Internet Service Providers (ISPs)?

I've been wondering recently about how the infrastructure of the Internet really works.    I know that I have an Internet Service Provider (ISP) that supplies my connection to the Internet.   But what I don't know is: Who provides the Internet to the ISP?  And who supplies it to them? Is there a never-ending loop that eventually connects us all together?


What's it called when you lose contact with reality when watching a movie?

Sometimes, when I watch a (real good) movie, I feel like the movie "sucks me into the screen". I feel that I am really inside the movie, really watching real persons acting in real situations. I do not really see what happens around me anymore, I get some kind of tunnel view and see only the screen. It's like being in John Malkovich's Head, just not seing the borders that are around me from that weird cave.  I wanted to know if there is a word for this kind of experience.  Also, I'd like to know if there is a word for "re-gaining" reality. After a few seconds or minutes in this weird state, I feel like my field of vision is growing larger and larger (just as if I was about to leave Malkovich) and then I'm "back in reality".   It's a hard to describe experience for me, not only because my mothertongue is not english but german, but also because, afaik, german lacks words for this, too. But when I have the english words, I believe, I may find the german ones as well.


How can I find the sum and multiplication table of a $F_4$ field?

From the field $\{0,1,A,B\}$ I know that, by exhaustion, $A\cdot B=1$ but how do I get $A \cdot A $ and $B\cdot B$? How can I get the sum table? We haven't been thought almost anything about fields in class yet so I am stuck even with the other answers on the internet. I need a full explanation. I don't know what cyclic means or anything pretty much about fields.


If $G$ is a convex set, prove that $\mathbb{C}\cup\{\infty\}\setminus G$ is connected.

Let $G$ be a convex set. I want to prove that $G$ is simply connected. This is my definition of simply connected:     A domain $G$ in $\mathbb{C}$ is said to be simply connected if $\overline{\mathbb{C}}$, its extended complement, is connected.   A domain is a nonempty, connected, open subset of $\mathbb{C}$.    I know this problem has been posted on this site, but I haven't found on using this definition. This definition is from Sarason's complex analysis and I do not much (or, really, any) topology to follow the other answers.   I know this problem must be easy (the author asserts the the reader will easily verify this), but I really have no idea on how to start.   I thought about the particular case where $G$ is the unit disk. Then if I imagine $G$ on the Riemann sphere, it's not clear to me why the complement of $G$ cannot be written as the disjoint union of open sets.


let $0<a\le b\le c\le d$, and such $abcd=1$,show that   $$a+b^2+c^3+d^4\ge \dfrac{1}{a}+\dfrac{1}{b^2}+\dfrac{1}{c^3}+\dfrac{1}{d^4}$$   it seems harder than


In terms of the difference  between neural network and deep learning, we can list several items, such as more layers are included, massive data set, powerful computer hardware to make training complicated model possible.  Besides these, are there any more detailed explanation regarding the difference between NN and DL?


What happens if my ESTA expires on the day of arrival?

I'm French and will travel the 14th of June to the US. My ESTA expires the 14th of  June 2013 and I'm wondering if my ESTA will be valid when I'll land in the US on the 14th of June 2013.  Does someone know anything about that?


How to cut one group of faces with another group of faces?

First off, I would like to apologize for any mis-terming or anything of the like, as this is my first blender project. I'm trying to make a mesh model, and I like to have everything neat and connected. I have run into one problem multiple times, that is that I need to connect two parts of the mesh at a certain point, which is inside another face. Is there any way that I can use both face to "cut" each other, sort of making a cross a corner? I have some screenshots below for clarification.


Is it always possible to compare the cardinality of two sets in ZF

I know that in ZFC, we can always compare the cardinality of two sets, because every set is equipotent to some ordinal. But without AC, can we say that for two sets $x$ and $y$, either there exists an injection from $x$ to $y$ or an injection from $y$ to $x$?


Let $p(x)$ be a polynomial of the real variable $x$ of degree $k\geq 1$ .Consider the power series $$f(z)=\sum_{n=0}^{\infty}p(n)z^n$$ where z is a complex variable .Then the radius of convergence of $f(z)$ is ?


#include all .cpp files into a single compilation unit?

I recently had cause to work with some Visual Studio C++ projects with the usual Debug and Release configurations, but also 'Release All' and 'Debug All', which I had never seen before. It turns out the author of the projects has a single ALL.cpp which #includes all other .cpp files. The *All configurations just build this one ALL.cpp file. It is of course excluded from the regular configurations, and regular configurations don't build ALL.cpp I just wondered if this was a common practice? What benefits does it bring? (My first reaction was that it smelled bad.) What kinds of pitfalls are you likely to encounter with this? One I can think of is if you have anonymous namespaces in your .cpps, they're no longer 'private' to that cpp but now visible in other cpps as well? All the projects build DLLs, so having data in anonymous namespaces wouldn't be a good idea, right? But functions would be OK?


Write a function identity(n) that returns the n identity  matrix. For example: identity(3) outputs [[1,0,0][0,1,0][0,0,1]] I have tried as follow:  def identity(n): matrix=[[0]*n]*n i=0 while i<n:     matrix[i][i]=1     i+=1 return matrix   Also I tried with range but it did'n work like this  def identity(n):     matrix=[[0]*n]*n     k=matrix[:]     i=0     for i in range(1,n):         matrix[i][i]=1         i+=1     return k print(identity(5))   But it output for n = 5:  [[1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1]]


How to find the Galois group of a polynomial?

I've been learning about Galois theory recently on my own, and I've been trying to solve tests from my university. Even though I understand all the theorems, I  seem to be having some trouble with the technical stuff. A specific example would be how to find the Galois group of a given polynomial. I know some tricks, and I manage to solve some of those questions, but some not.  For example, one of the tests asks to find the Galois group of $x^{4}-4x+2$.  I can see that it is irreducible over $\mathbb Q$ (Eisenstein), but I have no clue as to how to find its Galois group over $\mathbb Q$. Can someone tell me how to do this? General techniques concerning this sort of problems are also welcome :).  Thanks!


Dynamic evaluation of a formula with operatos like Max , Min, Avg, Mean, Medium and Operands count can be more than 2

Is there a way in c# where I can get the result of the formula inside the string with multiple values and with Add, Subtract, Max, Min, Average, Mean, Median operators where Operands in any sub-expression can be more than 2? Something like var result = Eval("Max(1,2,3, Avg(4,5,6,7), 9+10+9.9, 11/12)")  or any other way (without splitting the string or evaluating each operation separately)? I tried to search but did not get any complete solution. I found that RegEx, DataTable.Computer or Math library do not support operations with more than two values.


How do I select vertices that are directly under the other?

I'd like to select vertices that are directly beneath the one I am selecting to save me the trouble from moving out of ortho view. It's mostly on simple shapes like the cube below.  Notice how the first image has two vertices selected. However, if the other side is not.    I want to be able to select vertices like so without coming out of ortho mode:    Is there a way to do this?


How do I install VMWare Workstation on Ubuntu 19.04?

I'm trying to create a virtual machine to follow a course and I don't have much practice in Ubuntu. The machine in this case is VMWare Workstation and I don't know exactly how to do it.  I have seen several questions about this on this site, but they are old and from very earlier versions of Ubuntu. Is there any new way to install this machine on my PC?


require help regarding brightness adjustment

i adjust the brightness to a lower level after logging in but this goes back to full after restarting. is there a way to stop this from happening?i am new to ubuntu and did a clean istall of ubuntu 14.10 on dell n5010(2012 model)


How do I resize partitions and filesystems on them?

How can I resize partitions from the command line? I've heard of , but I don't want to use a GUI program.


Group by's in materialized views and query planning

In part out of curiosity, I wondered if I could use an indexed (materialized) view to speed up a count query on some base table.  The query is something like  SELECT COUNT(*) FROM BaseTable WHERE Slot = ?;   so I created a view  CREATE VIEW IndexedView WITH SCHEMABINDING AS SELECT bt.Slot, COUNT_BIG(*) AS COUNT FROM dbo.BaseTable bt GROUP BY bt.Slot;   with a clustered index  CREATE UNIQUE CLUSTERED INDEX IX_Main ON IndexedView (Slot);   And that works, I can now write the original query as  SELECT COUNT FROM IndexedView WHERE Slot = ?   and get the desired result much faster.  Alas, it's hardly much use for me, as my queries are usually not hand-crafted. I really need the original query to become faster by using the indexed view as some kind of index for BaseTable - and I think I read somewhere that this can happen in some circumstances, but according to my tests, not in this one.  So my question(s) would be:   Can indexed views still help me in this scenario somehow? Can anybody recommend sources/literature than explains in which cases indexed views do get used for optimizations of queries on the tables they are based on?   EDIT: On the duplicate question - I'm more interested in the GROUP BY and aggregate aspect of indexed views. The answer helped me find a stupid mistake I made, it's now working for me as well.  JOYOUS ADDENDUM: Now that I got it working, I successfully tested that it even works in cases where the query contains a left join in those cases where the left join can in fact be optimized away (ie. the on-clause covers a unique index in the joined table).  That is really awesome, because it means that even in cases of a query with left joins one can design the schema in such a way that getting a total row count of everything or specific groupings is fast.


Converting a polygon into a raster using R

I'm trying to convert a shapefile into a raster within R. My approach is to read in the raster as follows:  library(rgdal) # Loads SP package by default demo <- readOGR('F:/data/', 'shapefile') # Creates a SpatialPolygonsDataFrame class (sp)   This works fine, and I can plot it. However it is a large shapefile and I want to convert it into a raster. I've tried the following:  r <- raster(ncol=180, nrow=180) Demo_ras = rasterize(r, demo, 'pop')  # pop is an integer here   Error message:  Error in function (classes, fdef, mtable)  :    unable to find an inherited method for function "rasterize", for signature "RasterLayer", "SpatialPolygonsDataFrame"   I'm slightly confused which is the correct order of the arguments. I've also tried this:  Demo_ras = rasterize(demo, r, 'pop')   Which results in the follow error:  Error in .polygonsToRaster(x, y, ...) :    polygon and raster have no overlapping areas   While it makes sense that a raster cannot be generated for an area that does not cover the SpatialPolygonsDataFrame, I'm not sure what information I need to specify so that the raster should contain the SpatialPolygonsDataFrame area.


I'm attempting to setup a query through php to a MySQL database. Within the query string I have placed functions and thus have used the dot (.) operator with string closures as seen below. The issue is that my query is not going through and try as i might I can't seem to make out the error. Thanks for any help in advance. :)   $query = "INSERT INTO `foo` (`ip`, `time`, `date`, `reason`) VALUES ('".strval(getUserIpAddr())."', '".$time."', '".$date."', '".$reason."')";


What is a general solution to a differential equation?

I understand how to find the general solution of a differential equation, for complex roots, simple roots, nonhomogeneous equations etc... but I still don't really know what the general solution is?   As in, what is the purpose of it? What is it used for? thanks...


What is the purpose of running a command with eval? What kinds of commands can eval run? I find it can run builtin command, external executable command, pipeline, script. Can it run all kinds of commands which can be run in a shell directly? Compare running a command directly in a shell and indirectly via eval. Is the difference only in that ?  Compare running a command via eval and via command. Assume that the command can be run by both. What differences are between the two ways?


Windows 10 on Surface Pro 4 Candy Crush Soda Saga will not uninstall from start list

I uninstalled Candy Crush Saga and Candy Crush Soda Saga from control panel.  Then I went to regedit and deleted both under HKEY_CLASSES_ROOT.  I went to Windows PowerShell and the program is not there.  The Candy Crush Soda Saga App is still showing up on my desktop list. I right click and choose Don't show on list, but nothing happens.  The program does not open if I click on the app.  What else can I do?  The reason I want to remove all of it is because this past update was causing critical issues.


How to add some of my /home memory to /(root)

I am running Ubuntu 18.04 as dual boot along with windows 7. I got a message that my root directory is almost full. Here is the screenshot -   I want to resize my home directory to 80GB and rest I want to add to root. When i click on resize i get a message saying -  "Minimum size: 161765 MiB      Maximum size: 161765 MiB"   and I am unable to resize it. Can anybody guide me through this. This is my first post. I am sorry for any mistakes. Please tell me if you need any other information.


Why is glmnet ridge regression giving me a different answer than manual calculation?

I'm using glmnet to calculate ridge regression estimates. I got some results that made me suspicious in that glmnet is really doing what I think it does. To check this I wrote a simple R script where I compare the result of ridge regression done by solve and the one in glmnet, the difference is significant:  n    <- 1000 p.   <-  100 X.   <- matrix(rnorm(n*p,0,1),n,p) beta <- rnorm(p,0,1) Y    <- X%*%beta+rnorm(n,0,0.5)  beta1 <- solve(t(X)%*%X+5*diag(p),t(X)%*%Y) beta2 <- glmnet(X,Y, alpha=0, lambda=10, intercept=FALSE, standardize=FALSE,                  family="gaussian")$beta@x beta1-beta2   The norm of the difference is usually around 20 which cannot be due to numerically different algorithms, I must be doing something wrong. What are the settings I have to set in glmnet in order to obtain the same result as with ridge?


set a BASH variable equal to the output from 'top' command?

I know how to set a BASH variable equal to the output from a command, but it doesn't work in case of 'top' command for me, see below  cat aTOPFWK.sh OUTPUT = $(top -b -n 1 | egrep 'fwk3' |  awk '{print $9}') echo "${OUTPUT}" ./aTOPFWK.sh: line 3: OUTPUT: command not found


I can't seem to find the  solutions to  $z^4+1=0 $. $z$ is in the complex plane.   The solutions show four roots; however, how do I find them once $z^4 = -1$?


Can i apply normal map & bump map & a texture on the same object

So I have these    I want to combine them all. Is it possible?


how do I insert a api json to my database

good day im trying somethings with php and a api json to make te info from the api to a json array an then to mij database but it doesn't do anything can some one help me   this is my script  <?Php $connect = mysqli_connect("localhost","test","test","beers"); $url = file_get_contents("https://api.punkapi.com/v2/beers"); $json = json_decode($url, true);   foreach ($json as $row) {           $sql =  "INSERT INTO Brewdog (naam, tagline, omschrijving) VALUES ('".$row['name']."','".$row['tagline']."',,'".$row['description']."')";         mysqli_query($connect, $sql);     } echo "klaar is kees"; ?>


What are the differences between  $ nohup foo   and  $ foo &   and  $ foo &  $ disown


The upgrade needs a total of 27.4 M free space on disk '/boot'. Please free at least an additional 9,027 k of disk space on '/boot'. Empty your trash and remove temporary packages of former installations using 'sudo apt-get clean'.  How to get free space for installing new updates?  I checked the boot in the file system. There were different versions of the same thing. Can I just delete older versions by myself to get free space?


What does "had had" mean? How does this differ from "had"?

For example, what is the difference between the following two sentences:     I had a bad day      I had had a bad day


Where is it best to store a reference of the user-selected default?

Consider a user can have multiple addresses. There is a users table, an addresses table, and a user_addresses table that links addresses and users with a many to many relationship. Users can define what their default address is. Is it best to have the users table have a default_shipping_id column linking to the appropriate entry on user_addresses, or should the user_addresses table have a is_default column? Users table     ID name default_user_address_id     -------- -------------- --------------     v.s. User_addresses table     ID user_id address_id is_default     -------- -------------- -------------- --------------     What's the better approach here?


Is there a Python2 module that has more accurate Windows OS information than the sys module?

The following code will generate different values, on the same Windows 10 OS, based on what version of python you are using: import sys info = sys.getwindowsversion() major = info.major  On a Windows 10 machine, in python2: major == 6  (which is not the correct value) On a Windows 10 machine, in python3: major == 10  (the correct value) I'm in the unfortunate position of needing to use python2 here, but the values it is returning are not accurate.  Is there a module, available in python2, that will give me the accurate values for windows version information?


Why does `md5sum` not give the same hash as the Internet does?

I want to find the md5 hash of the string "a", but running echo "a" | md5sum gives me another hash than what I get if I search the internet (for example using  or ).  Running echo "a" | md5sum gives me "60b725f10c9c85c70d97880dfe8191b3", but it should be "0cc175b9c0f1b6a831c399e269772661".  If I make a reverse hash lookup for "60b725f10c9c85c70d97880dfe8191b3", I do however get "a".


How can I make my terminal's command prompt shorter to increase line realestate?

I would like to make my terminal's command prompt shorter. Currently I am using Python 's virtualenv and virtualenvwrapper so that is causing lots of extra text to be displayed in my command prompt. I need to shorten that up to the bare minimum so I'd like to take this:  (pytutorial)sez@sez-laptop:~/.virtualenvs/nettuts/firstblog$   and ideally turn it into   (pyt)sez:~/.virtualenvs/nettuts/firstblog$   or maybe something shorter perhaps. Right now I am using Gnome Terminal 2 & bash.   Any suggestions?


Biblatex: How to make maxcitenames to work with Custom styles?

I was trying to use different  with Biblatex, but seems that maxcitenames=2 is not properly working with biblatex-apa. The option is working with build-in style (e.g. authoryear,verbose), following these post  and .  File test.tex  \documentclass[11pt,a4paper]{article}  \usepackage[american]{babel} \usepackage[backend=biber,style=apa,maxcitenames=2]{biblatex} \usepackage[utf8]{inputenc} \usepackage{csquotes} \DeclareLanguageMapping{american}{american-apa}  \bibliography{Biblatex.bib}  \begin{document}  Test \cite{campbell2007}, \cite{Goldetal08}.  \printbibliography  \end{document}   File Biblatex.bib  @article{Goldetal08,     title = {A room with a viewpoint: Using social norms to motivate environmental conservation in hotels},     volume = {35},     shorttitle = {A room with a viewpoint},     issue = {3},     pages = {472-482},     journaltitle = {Journal of Consumer Research},     author = {Goldstein, {N.J.} and Cialdini, {R.B.} and Griskevicius, V.},     date = {2008},     file = {Google Scholar Linked Page:files/599/Goldstein et al. - 2008 - A room with a viewpoint Using social norms to mot:} }  @article{campbell2007,     title = {"Says who" How the source of price information and affect influence perceived price (un) fairness},     volume = {44},     issue = {2},     pages = {261-271},     journaltitle = {Journal of Marketing Research},     author = {Campbell, {M.C.}},     date = {2007},     file = {Google Scholar Linked Page:files/912/jmkr.44.2.html:text/html} }   And I get this output,      So the maxcitenames=2 option seems to fail, any suggestions how this can be done? Is this a problem related to the specific style ("apa")?


Is it possible to apply graduate program in a different major?

I'm a business student and I'm really fond of computer science and engineering. Is it possible to apply for cs major in computer science? If not, is it possible to apply for MaSc in Master of Business Analytic then continue to study in CS?


Prove that if A and B are two compact subsets of R, then A + B is compact. Where A + B = {x + y; x ∈ A, , y ∈ B}.


Could someone please tell me if "That" should be capitalized in the following title:  Learn the Winning Formula That Ironman Triathletes Use to Create Unstoppable Sales Success


How to redirect old page link to new link when using new CMS for website

We are doing a new website and the current  website www.domains.com has been running for almost 3 years and is quite visible on search engines.  Now we are working on new website with multilingual features and we are also using custom cms that is developed using asp.net webform.  and we have new url for which will render old url useless.  for example in current website internship page can be accessed via two url  Internship    and Employment page can also be accessed via two url     Now with new cms following for the above mentioned internship page we use following url    since new website actually doen't contain folder internship i was thinking of  creating a folder internship and default.aspx and make it 301 redirect  from http://www.domain.com/internship/Default.aspx to http://www.domain.com/en/internship/1/21/internship  is this approach correct.  I looked for best approach on net and found this article which has also confused me  as it now showing any practical example. as other article save we should use 302 redirect etc...  Please advise how can i make a redirect from the old website link which is http://www.domain.com/internship/Default.aspx TO new website link http://www.domain.com/en/internship/1/21/internship which basically has same contents.  appreciate reply on this


Determine whether the series converges for $\frac{1}{2} < p \leq 1$  $$\sum_{k=2}^\infty \Bigl(\sum_{j=1}^{k-1} \frac{(-1)^k}{[j(k-j)]^p} \Bigr)$$  I've been stuck on this for a while now, and I'm not quite sure how to proceed with this. My assumption is that it does converge. However, the problematic thing is trying to prove the series satisfies the Alternating series test (the part where the term is eventually decreasing). How can I show that the term inside the bracket is decreasing? Or if this series diverges, can anybody give a hint? Thanks.


If I'm in some folder, but need to download exactly to /home/username folder, how to run a command like wget to download in ~ or /home/user folder?

If I'm in another folder, how do I run a command like wget to download in ~ /home/user folder with name it has already? So that in since we dont know user home name is it /root or is it /home/user1 or /home/user2 Like wget www.website.com/.tmux.conf -O ~


$\phi \times \theta$ is faithful iff $(|Z(H)| ,|Z(K)|)=1$ for faithful characters $\phi \in Irr(H)$ and $\theta \in Irr(K)$ .

Let $G = H \times K$. Let $\phi \in \operatorname{Irr}(H)$ and $\theta \in \operatorname{Irr}(K)$ be faithful. Show that $\phi \times \theta$ is faithful iff $(|Z(H)| ,|Z(K)|)=1$.  Problem 4.3 of Isaac's character theory.


Just how random is $\pi$? If somehow converted to ASCII, would it contain the complete works of Shakespeare?

If we take the infinite monkey theorem: , and with a bunch of "infinites" and "randoms", we can generate any text we wanted. What about $\pi$? If we wrote down $\pi$ to an infinitely large file, and somehow converted the digits to ASCII values, would that file (and, with some transformation also $\pi$) contain all the Shakespeares works? And Harry Potter 8 book and 4k movie? Or is there some property of $\pi$, that makes that impossible? What about other numbers, eg 'e'?


Why is SPF being validated against my mail server's IP instead of sender's IP?

I have a mail server "example.com" which forwards all emails with recipient "me@example.com" to "me@gmail.com". My mail server runs Postfix and it uses the virtual_alias_maps mechanism to perform the forwarding. I also have SPF records installed for "example.com":  v=spf1 a include:aspmx.googlemail.com ~all   The problem is, whenever someone delivers mail to "me@example.com", Gmail validates the example.com SPF records against example.com's IP address! I thought it's supposed to validate against the original sender's IP address.  For example, I'm on my laptop on my home Internet connection. I connect to example.com's mail server as follows:  $ telnet example.com 25 20 example.com ESMTP Postfix (Debian/GNU) HELO my-laptop.local 250 example.com MAIL FROM:<me@gmail.com> 250 2.1.0 Ok RCPT TO:<me@example.com> 250 2.1.5 Ok DATA 354 End data with <CR><LF>.<CR><LF> From: me@gmail.com To: me@example.com Subject: test  test . 250 2.0.0 Ok: queued as CE5F42200F9   Now when I open that mail in Gmail and view its source, I see the following headers:  Delivered-To: me@gmail.com Received: by 10.231.219.195 with SMTP id hv3csp61494ibb;         Sat, 14 Jul 2012 02:15:58 -0700 (PDT) Received: by 10.229.135.5 with SMTP id l5mr2360326qct.5.1342257358291;         Sat, 14 Jul 2012 02:15:58 -0700 (PDT) Return-Path: <me@gmail.com> Received: from example.com [EXAMPLE.COM's IP ADDRESS HERE]         by mx.google.com with ESMTP id u9si4262071qcv.89.2012.07.14.02.15.58;         Sat, 14 Jul 2012 02:15:58 -0700 (PDT) Received-SPF: neutral (google.com: [EXAMPLE.COM's IP ADDRESS HERE] is neither permitted nor denied by domain of me@gmail.com) client-ip=[EXAMPLE.COM's IP ADDRESS HERE]; Authentication-Results: mx.google.com; spf=neutral (google.com: [EXAMPLE.COM's IP ADDRESS HERE] is neither permitted nor denied by domain of me@gmail.com) smtp.mail=me@gmail.com Date: Sat, 14 Jul 2012 02:15:58 -0700 (PDT) Message-Id: <500138ce.c995e50a.6e4a.ffffd12aSMTPIN_ADDED@mx.google.com> Received: from my-laptop.local ([LAPTOP's IP ADDRESS HERE])     by example.com (Postfix) with SMTP id CE5F42200F9     for <me@example.com>; Sat, 14 Jul 2012 09:15:44 +0000 (UTC) From: me@gmail.com To: me@example.com Subject: test   As you can see in Received-SPF and Authentication-Results, the SPF records are being validated against [EXAMPLE.COM's IP ADDRESS] instead of [LAPTOP's IP ADDRESS].  Why does this happen, and how do I fix this problem?


What can my ISP see when I use an elite proxy server in my browser?

Let's say I've configured my chrome browser to use an elite proxy for browsing downloading etc,. What information can my ISP see about the connection? Thanks in advance.


How to find out the reason a command/code was executed on Linux?

I have a complex embedded Linux software running on a gentoo derivative, on which a certain piece of code gets executed regularly every ~84 minutes. Sweeping through the main code to find places where this code might get executed was unsuccessful, and crontab also seems no possible explanation.   My question: Is it possible, by modifying the code in question, to find out which other process/code/file/service started it in the first place? Are there some information in the /proc directory I can use? Or is it impossible to find out the process that executed the given code?


Dual citizen without a valid US passport

I am a dual British/US citizen and hold both passports.  However, my recently renewed US passport has not arrived yet and I leave in 48 hours.  Can I get an ESTA and travel on my British passport?


If I were to keep increasing the mass of particles I throw at a double slit, at what point would it stop creating an interference pattern?

Why don't things like tennis balls create interference patterns when thrown at double slits?  Where's the limit where it stops interfering?


Python list of tuples to dictionary where keys of dictionary come from another list


What does a priori mean in a math paper?

Sometimes, in a math paper, we read something like "Although a priori this statement could be true, it is in fact false, as proven by this theorem". But aren't all mathematical statements a priori? So why include that misleading bit of language in the beginning?


Can we apply for a Schengen tourist visa while visiting another country on a short-stay visa?

We are Indians and will be visiting UK on short-stay visas for about five months.  Can we apply for Schengen tourist visas while we are in London?


How to evaluate the following items in mathematical methods in physics?

I had taken a long break from math and physics for months due to stress and an illness so when I returned to it and tried answering problems given, I had difficulty figuring out how to do some of them all over again. Here were the items I had encountered:  1) Evaluate $\sum_{n=0}^{\infty} {p^n}{sin(2nx)}$  2) Solve for x(t): $\frac{dx}{dt} = x_o =-cos(t)x + t^3, x(t=0)$  3) Evaluate $\int_{0}^{\pi} \frac{d\theta}{(a+cos\theta)^2}, a>1$  4) Evaluate $\int_{-\infty}^{\infty} {x^6 e^{-x^2}} dx$  5) Evaluate $L_n(0)$ given the generating function for Laguerre polynomials is $g(x,t) = \sum_{n=0}^{\infty} L_n(x) t^n = \frac {e^{xt/(1-t)}}{1-t}$  6) Solve: $y'' + x^2 y'+(x-1)y = 0$  -> For this, I tried the Frobenius method but didn't get far.  Some weren't taught in my previous class but I was expected to already know it for my course this coming semester. I have tried searching already but I have not gotten far for these. I am not expecting all of these to be answered. I just really need help getting started again so any help for any of these would be really appreciated. You can just choose one among them. If you could perhaps give me a way I can try, step-by-step, or a really good reference for me to look at so I can self-study.


closed form expression for the sum of the first s items of alternating binomial coefficients

Is there a closed form expression for the following sum:   $$\sum_{k=0}^s (-1)^k {n \choose k}, $$  where $s \in \{0,1,2,...,n\}$  -- which is basically the first $s$ terms in the alternating binomial coefficients series.   I know if $s=n$, the sum is zero, but I cannot figure out a general closed form expression in terms of $s$.


Blender 2.80 Beta wierd vewport behavior

I have a model about 83mm wide that I am working on, I can't zoom in too close to it because the viewport chops part of the model even though I am not zoomed all the way into it. Does anyone by chance know why it is doing this and is there a setting I can change to fix it?  Thanks


I want to add specific word on Title bar how to do this

I want to add "Buy" word in Just Title tab not in post Title Which show in image  how can do this can some one help on it??


Trying to understand random dynamical systems

Let $\{\theta_t : \Omega \mapsto \Omega \  | \  t \in T \}$ be a family of measure preserving transformations on the probability space $(\Omega, \mathcal{F}, \mathbb{P}).$  A measurable random dynamical system on the measurable space $(X, \mathcal{B})$ over $(\Omega, \mathcal{F}, \mathbb{P}, \theta_T)$ is a mapping $$\phi : T \times \Omega \times X \mapsto X$$ so that the mappings $\phi(t,\omega, \cdot) : X \mapsto X$ form a cocyle over $\theta(\cdot)$. I admit it: this is over my head. I think I understand the basic idea of a random dynamical systems. We take some point $x_0$, and map it some other point. But, the maps are random so each map is different, hence the word "random" in "random dynamical system."  (is this correct?) However, I am not seeing that in this definition. I was wondering if someone could explain this in somewhat less rigorous manner, even if the itty gritty details are missed. So, if someone could provide a pretty detailed explanation of this definition, with less rigor, and maybe an example, that would be great! Edit: There is a question similar to this but the answer did not help.


there is a famous proverb in Nepal, i.e. कागले कान समात्यो भन्दैमा  म कागको पछि लग्नु. The meaning of this proverb to believe other blindly.  For example: "The man said someone that the crow grabbed his ear, and he without checking his ear chases the crow." The moral is we should not believe what other people say immediately. And I want proverb in this. Is there some PROVERB in English related to this scenario? Thanks 🙂


How I can make a TabPage in a TabControl visible/hidden and enabled/disabled?


Suppose I have a polynomial ring $k[x_0,\cdots,x_n]$ and let $k[x_0,\cdots,x_n]_m$ denote the homogeneous part with degree $m$. How can I see that this $k[x_0,\cdots,x_n]_m$ has dimension $\binom{m+n}{m}$? Or more exactly, why does this give the Krull dimension?


Each time I save (sometimes I have to press save more than once to actually save the document) one aditional file is created "document.tex.something". Does anybody know why this happens? How can I solve this?   I use TeXstudio, by the way.


Creating a proof and finding the real roots of unknown function

The curve of the function $f (x)$ is given.  Find the real roots of the equation $f (4-3x^2)=0.$  I know the possible solution:  From  the equations $4-3x^2=-2$  and  $4-3x^2=4$ we have $ x=\left\{0,\sqrt 2,- \sqrt 2\right\} $.  Now, I want to create a little proof for the alternative solution before moving on to the calculation. It is obvious that, we don't know directly what the explicit form of $f(x)$ is. Goal:  I want to find a new $ g (4-3x ^ 2) = 0 $ equation that will definitely give the same real solutions as the equation $f (4-3x ^ 2) = 0.$  Let's define the function $g:\mathbb{R}\longrightarrow \mathbb {R}$. For any $x\in\mathbb {R}$ if $f(x)=0$, then $g(x)=0$ and if $f(x)≠0$, then $g(x)≠0$ and there exist at least one $x=r, r\in \mathbb{R}$, which gives $f(r)≠g(r)$. According to our definition of $g(x)$, we deduce that for any $x\in\mathbb{R}$, if  $f(4-3x^2)=0,$ then $g(4-3x^2)=0$  and if  $f(4-3x^2)≠0,$ then $g(4-3x^2)≠0.$ Finally, we can deduce that solving the equation $ f (4-3x ^ 2) = 0 $ is equivalent to solving the equation $ g (4-3x ^ 2) = 0. $ In other words, the real roots of the equation $ f (4-3x^2) = 0 $ are the same as the equation $ g (4-3x^2) = 0$. So, it is enough to solve the equation  $g (4-3x^2) = 0$.   Let, $g(x)=(x+2)(x-4)$. Then we have, $$g(4-3x^2)=0 \Longrightarrow  (4-3x^2+2)(4-3x^2-4)=0 \Longrightarrow -3x^2(6-3x^2)=0 \Longrightarrow x=\left\{0,\sqrt 2,- \sqrt 2\right\} $$  Question: Is my proof-solution correct?


Regex only checks first character in string C#

Why does the following method only check the first character in the supplied string?  public static bool IsUnicodeSms(string message) {    var strMap = new Regex(@"^[@£$¥èéùìòÇØøÅå_ÆæßÉ!""#%&'()*+,-./0123456789:;<=>? ¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑÜ§¿abcdefghijklmnopqrstuvwxyzäöñüà^{}\[~]|€]+$");    return !strMap.IsMatch(message); }   So for example the following string returns false: "abcლ" but "ლabc" returns true.


How can I determine whether a PC has 1 CPU with 6 cores, or 6 CPUs (without opening the case)?

When I log in remotely to a Windows box (using Windows Remote Desktop), I can see that the Computer Management applet shows 6 "Intel Xeon CPU" entries under "Processors", as shown below.    (Based on ramhound's comment this amount of "Processors" is because of HT is not enabled.)  The Lenovo X1 Carbon laptop that I am using, on another hand, has the Intel's Core i5 CPU. Considering that this is a rather lightweight laptop, I would assume that this is just one CPU with 4 cores. The cores are listed in Computer Management applet as shown below.    I would like to know if the remote computer has multiple processors or just 1 processor with multiple cores. It is not close by so I am not able to get to it and open up the case.  Thus the question I wanted to ask is: How can it be determined if a Windows PC has multiple processors or just 1 processor with multiple cores, without opening the computer case?


Summary List of all subsites with relevant LISTS data

Is it possible to view data of all subsites / sub project site from the parent site.  Example:  Project Site : ABC  Sub-Project sites:  1) xyz  2) pqr c) def  All the sub-project sites contains multiple lists.  Project owner would like to view selective content from all lists hosted in the sub-projects once logged on the parent site.  I`m not sure how it can be achieved. Please share relevant article that explains with examples if possible.


I'm not sure whether this is exactly the same bug as  or whether this is a new bug.  If you up vote a question and then attempt to add it to favorites too you get Question is already favorited:    This also happens if you up vote on the web site and then try to favorite it from Android. If you don't up vote or if you favorite it first and then up vote it appears to work fine.


When I try to use multicolumn inside a tabularx environment, I get this weird behaviour; where the column doesn't fill the whole width.  Anyone know why this is happening, and how I can fix it?  \documentclass[12pt]{article} \usepackage{tabularx,lipsum}  \begin{document}  \begin{tabularx}{\textwidth}{|X|X|}      \hline     \multicolumn{2}{|X|}{\sffamily Lorem ipsum dolor sit amet,}\\\hline     \multicolumn{2}{|X|}{\lipsum[2]}\\\hline      \sffamily Lorem av:&\sffamily Ipsum:\\     foo&bar\\\hline  \end{tabularx}  \end{document}


lighting problems, sun isn't working on render

I am trying to create an indoor enviroment. I made two windows, added a sun and rotated it so that it could go throug the window and lighten the sofa and part of the wall. But I don't see the sun light anywhere.  I checked on settings and is not invisible to the render but it just not reflecting any light. The only light I get is from the image background.  This is the picture with sun    and this is when I delete the sun   Can anybody tell me please why is this?  Thanks in advance


FFMPEG to extract first 15 seconds of a stream of mov or mp4

Is there a way to use ffmpeg to extract say first 15seconds of a video file (mov or mp4)? The input file will be passed in as a stream.  I've looked at this , but not sure if supports stream input. Thanks for any advice in advance!


5 Lagrangian points: why isn't there a line of stability between $L_1$ and $L_4$ and $L_1$ and $L_5$ respectively?

Given the 5 Lagrangian points of two large orbiting bodies:      (from ),  why isn't there a line of stability between L1 and L4 and L1 and L5 respectively (as depicted in red in the modified picture)?:


What is the difference between ubuntu-13.10-desktop-amd64.iso and ubuntu-13.10-desktop-amd64+mac.iso?

My current assumption is that the mac version has drivers particular to the mac ecosystem?   Does that mean that I can't create a live system with the non mac iso to boot my mac over USB?


Null Pointer Exception in an Activity's onCreate() method

I started to work with Java and AS 2 days ago. i've done everything according to instructions, but when running app in emulator he quits it and shows error  `java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.user.project1/com.example.user.project1.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference`   I tried to create ListView with three TextViews. Here is the code:  package com.example.user.project1;  import android.app.Activity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.ListView; import android.app.ListActivity; import android.widget.Toast; import android.view.View; import android.widget.SimpleAdapter; import java.util.ArrayList; import java.util.HashMap;  public class MainActivity extends Activity {      @Override     protected void onCreate(Bundle savedInstanceState) {         ListView lv = (ListView) findViewById(R.id.list);         super.onCreate(savedInstanceState);         setContentView(R.layout.rowlayout);         ArrayList<Contact> list = new ArrayList<Contact>();         list.add(new Contact("Surdialx", "Status","Available Works"));         list.add(new Contact("Surdial", "Status","Available Works"));         list.add(new Contact("Surdialx", "Status","Available Works"));         list.add(new Contact("Surdial", "Status","Available Works"));         list.add(new Contact("Surdial", "Status","Available Works"));         list.add(new Contact("Surdialxx", "Status","Available Works"));         SimpleAdapter adapter = new SimpleAdapter(this,list, R.layout.content_scrolling, new String[]{Contact.Serial,Contact.Status,Contact.WorkSt}, new int[]{R.id.tvSerial,R.id.tvStatus,R.id.tvWorkSt});   //As i understood problem appears here, but i can't resolve it.          lv.setAdapter(adapter);     }     public class Contact extends HashMap<String, String> {          public static final String Serial = "Serial";         public static final String Status = "Status";         public static final String WorkSt = "WorkSt";          public Contact(String Ser, String Stat, String Work) {             super();             super.put(Serial, Ser);             super.put(Status, Stat);             super.put(WorkSt, Work);         }     } }


Write author instead of dash in references with Biblatex

I use   \usepackage[style=authoryear-ibid, maxnames=1, maxbibnames=6, minbibnames=6, backend=biber]{biblatex} \addbibresource{references.bib} \DeclareNameAlias{sortname}{last-first}   to format my references. This will display it as follows:    Now I would like the last reference (TRCRC (2015b)) to be displayed as such and not just a dash -- (2015b). I found similar questions but many people ask how to write a dash instead of the author, I would like to do the opposite.


If velocity is constant, how can $p = F\cdot v$ be non zero?

If an airplane of mass $m$ is flying at a constant speed $v$, the power of the airplane is  $$P = m\cdot v\cdot g $$ where $g$ is the acceleration of gravity and therefore:  $$ F = m\cdot g, $$ but, if the velocity is constant, there is no net force as well as no work done. Then how can the magnitude of power be non-zero?


How much does the Earth's population affect the force of gravity?

If everyone on earth except one person were to gather up in one location, say the North Pole, and jump at the exact same time and stay airborne for about 1.5 sec. And that one person who did not jump would stand on a weigth scale, would he/she see any difference to their weight assuming the scale can messure weight to a $10^6th$($10^6 $ because I figured that a  number with a higher accuracy would change due other changes in the earth or the solar system, such as the gravitational pull of other celestial masses, no?) of a kilogram?  My assumption here is that the force acting on an object from the earth differs if a big mass would suddenly rise from the surface of the remaining mass(the  earth), does that make sense? $$F = \frac{Gm_{earth}m_{standing\space person}}{r^2}$$ $F$ would become smaller when $m_{earth}$ becomes decreases due to the jump.


"No Such file or directory" when using cat with a variable filename in a bash script

I'm writing a bash script that reads a variable number of log files that contain user process data and am getting an error when I try to use variables for my range values.   The command: cat ./logfiles/logfile{4..6}.txt (using actual numbers 4 and 6 instead of variables containing them) works perfectly when I enter that directly into the command line.  Here's the full code for context:  #!/bin/bash fileNum=0 nSeconds=$1 nLogs=$(expr $nSeconds / 10) nUsers=$2  while true do     ((fileNum++))     ps -eo user=|sort|uniq -c >logfiles/logfile${fileNum}.txt      if [ $((fileNum % 6 )) == 0 ]; then         lower=$(expr $fileNum - $nLogs + 1)          cat ./logfiles/logfile{${lower}..${fileNum}}.txt    <---- this line     fi;      sleep 10 done   When cat ./logfiles/logfile{$lower..$fileNum}.txt is executed, I get the following error: cat: ./logfiles/logfile{4..6}.txt: No such file or directory.   Is it treating the brackets defining the range as part of the filename? How do I fix this?


I'm a system administrator in our company. I have purchased some HP servers.  I asked my local vendor to install CentOS on them using original images.  When I went to server room today to install them, I saw some strange label     on every new server.  In addition, program glat-client was installed. After uploading this label, it started spamming the following message every hour:     This copy of GNU/Linux is not activated. You may be a victim of software counterfeiting. See ...... for details.   What does this label mean?


Concept of performing a t-test while controlling/adjusting for one or more variables?

Could someone please help me understand the concept of performing a t-test while controlling/adjusting for one or more variables?  E.g.: Say I have a hypothetical data set, with the following variables sex, age, smoker, weight, height, bmi, smoking_duration, max_oxygen_uptake. Let us say I want to test if smokers have a higher max_oxygen_uptake, than non-smokers?  Then in R I would write: t.test(subset(myData,myData$smoker==0)$max_oxygen_uptake,subset(myData,myData$smoker==1)$max_oxygen_uptake)  But max_oxygen_uptake will likely also depend on e.g. age, bmi and smoking_duration. Maybe also sex. Therefore I am looking for something along the lines of: t.test(var_a,var_b,adjust=c(var_c,var_d,var_e)).  Questions:   How do I perform a t-test, while controlling/adjusting for other variables? How do I decide which variables should be controlled/adjusted for?   I know it has something to do with lm(), but I am having conceptual problems in connecting the t-test to creating a linear model?


I am trying to centre a div but having difficulty. Beneath the chart in  I have a table which I want to centre under the chart.  I have tried the class below, I also set the width but it doesn't seem to work. It looks to me like the right hand side of the table is centred to the middle of the chart rather than the middle of the chart. I am not fully understanding the behaviour.  html

             <button class="ui-button ui-widget ui-corner-all">Paint</button>

         <button class="ui-button ui-widget ui-corner-all" data-range="5">5d</button>         <button class="ui-button ui-widget ui-corner-all" data-range="20">MTD</button>         <button class="ui-button ui-widget ui-corner-all" data-range="999">Max</button>

       css  .indexChart{     clear: both;     height: 500px; }  .centerDiv{     margin: auto; }  .content {     height: 1000px;   background-color: #F5CF8E;   overflow: hidden; }


How do I change 'displaystyle' manually?

I have used the following command      $\displaystyle\bigoplus_{i=1}^n M_i$      to get superscript and subscript form of the lower limit and upper limit. But it  it looks like very bigger. I want to control this size of this displaystyle manually. Is there any way to do this ?


Find if the sequence $\left((-1)^n + \frac1n\right)_{n\geq 1}$ converges or diverges

I am trying to find out if the following sequence $(a_n)_{n\geq 1}$ will either converge or diverge. $$ a_n = (-1)^n + \frac1n $$  If the limit converges, I need to find its limit.   I tried plugging in various numbers for n besides 1, but I am not entirely sure if it really does converge.


Is it pythonic for a function to return multiple values?

In python, you can have a function return multiple values.  Here's a contrived example:  def divide(x, y):     quotient = x/y     remainder = x % y     return quotient, remainder    (q, r) = divide(22, 7)   This seems very useful, but it looks like it can also be abused ("Well..function X already computes what we need as an intermediate value.  Let's have X return that value also").  When should you draw the line and define a different method?


Windows 10: How to change a theme slideshow time interval?

It's all int the title; I find myself unable to set a precise time interval defining how often the background pictures of the theme I am currently using change.  The only similar option available in Windows 10 settings applies only to single background images and not to multiple background images included in a theme.  Thanks in advance,  N.


I've been playing the heck out of this game for the past few days, and I noticed some players had some nice shiny golden guns.  What conditions do I need to fulfill in order to unlock these weapons? (Are the they tied to the story mode, Amiibo, etc.)?


Take most recent (or concatenate) edit comments when editing during grace period

Recently, I edited  to update a link to a better resource. I clicked "Save" without entering a description of the edit (edit #1).  Then I realised that the question was asked by a new user who may not be able to easily identify the change that was made. So I edited it again, this time only to add a detailed edit description (edit #2).  Since edit #2 was made during the grace period (within 5 minutes of edit #1), the system has merged them into a single edit, but only the edit comment from edit #1 was recorded in the revision history, whereas edit #2's comment was simply discarded/ignored.  I'd suggest that either the most recent (non-default) edit comment is taken or that the comments are concatenated to provide a more useful edit history


Store output of a command into a ring-buffer

I've got a long-running command that generates a lot of output on stdout. I'd like to be able to retain, for instance, only the last three days or the last gibibyte (avoiding cutting lines in the middle), and, if possible, in file chunks not larger than 20 MiB. Each file chunk is being named with a numeric suffix or a timestamp.  Something like:  my-cmd | magic-command --output-file-template=my-cmd-%t \                        --keep-bytes=1G \                        --keep-time=3d \                        --max-chunk-size=20M \                        --compress=xz   Would write:  my-cmd-2014-09-05T10:04:23Z   When it's reaching 20M, it would compress it and open a new one, and so on, and after a while would it starts deleting the oldest files.  Does such a command exist?  I'm aware of logrotate and its ability to manage files written by other applications, but I'm looking for something simpler that doesn't involve having to set up a cron job, specify rules, suspend the process, etc.


When does a function NOT have an antiderivative?

I know this question may sound naïve but why can't we write $\int e^{x^2} dx$ as $\int e^{2x} dx$? The former does not have an antiderivative, while the latter has.  In light of this question, what are sufficient conditions for a function NOT to have an antiderivative. That is, do we need careful examination of a function to say it does not have an antiderivative or is there any way that once you see the function, you can right away say it does not have an antiderivative?


I recently added, to my "main" Gmail account, another account:    I want to detach those accounts from each other (not deleting) but can't find this option.  Where is it?


Does $a_n \sim b_n$ imply $\sum_n a_n \sim \sum_n b_n$ for $a_n, b_n>0$?

I am almost embarrassed to asked to this question, but after considering it for a while I realize I need some help.  In the following $a_n, b_n >0$.  So, by limit comparison test if $a_n = O(b(n))$ or, for a stricter case that I am interested in, $\frac{a_n}{b_n} \to_n 1$ both $S_1 = \sum_n a_n$ and $S_2 = \sum_n b_n$ either diverge or converge or, in other words, $S_1 = O(S_2)$ or $\frac{S_1}{S_2} \to_n O(1)$.   How about a stricter condition: does this convergence imply that $\frac{S_1}{S_2} \to_n 1$ or $S_1 \sim S_2$?. For example, $S_1 \sim n \log n + O(1)$ and $S_2 \sim n \log n  + n + \frac{1}{n}$.   I think the answer is not in general, I tried to compare $\sum_k \log (1+\frac{k}{n})$ and $\sum_k \frac{k}{n}$ (they are $\sim$ if Taylor series is used). And I got the first constant to be $\log \frac{4}{e}$, and the second, of course, $\frac{1}{2}$.   Any suggestions?   EDIT:  After reading the solution, I went through my calculation again and what I get is  $$ \sum_{k=1}^{n} \log (1+\frac{k}{n}) = \log (2n)! - \log n! - n \log n  $$ Either using Stirling's approximation or $\sum_{k=1}^{n} \log k  \sim \int_{1}^{n} \log x dx$ I get the front term equal to $\log \frac{4}{e}$, which is different to $\frac{1}{2}$ from $\sum_{k=1}^{n} \frac{k}{n}$. Where is the mistake?


Driving with a rental car from Larnaca to Northern Cyprus

I am travelling to Republic of Cyprus. I am planning to rent a car in Larnaca and travel to Northern Cyprus as well. I have called several big rental companies (Hertz, Sixt, Europcar) and learned that while it is allowed to drive to Northern Cyprus, neither of those rental companies provide insurance for the rental car. I would have to buy a third-party insurance at the border. In case of an accident or car breakdown I have to organize towing the car from the Northern Cyprus part back to the Republic of Cyprus. And since the insurance is not valid in the Northern Cyprus, I am personally fully liable for any car damage.   Has anyone else travelled with a rental car from Republic of Cyprus to Northern Cyprus? Any issues with that? Any recommendations / suggestions on how to handle the insurance? What is the approx price of the insurance? Has anyone experienced any car breakdown / accidents with a rental car from Republic of Cyprus in Northern Cyprus? In general, how safe it is to drive a car from Republic of Cyprus to Northern Cyprus? I assume the car plates are different. Are there any alternatives? Such as taking a bus from Republic of Cyprus and renting a car in Northern Cyprus instead?


What makes a weapon magical, for the purpose of immunity to non-magical weapons?

I am planning on having an encounter with a monster that has immunity to basically any attack from a non-magical weapon. Now, my players mostly have weapons with magical qualities, but they are not all combat related (like a shortsword that gives +1 to charisma checks, or a staff that grants the ability to cast druidcraft once a day).  So my question is:  Does any weapon with magical qualities (regardless if they're combat related or not) negate damage resistances or immunity a monster may have from non-magical weapons?


How can I tell what is "real" Motley Fool advice?

I clicked on a link and was taken to , which troubled me a bit and is a bit different from what I expect of the Motley Fool, of which people have presented as offering advice like "Live below your means." The video, masterfully presented to be grabbing and engaging, offers a free lunch by revealing the revolutionary new secret sauce technology powering possibly the next Apple Watch and some of its competitors, and while it makes no direct claim (at least in the portion before I closed it down) about what your ROI will be for following this stock tip, it keeps telling how it is riding on the coattails of perceptive investment decisions that have returned a hundredfold.  I looked and did not notice any statements that this was a paid advertisement and did not represent Motley Fool.  Has Motley Fool jumped the shark, or is this something separate from what I understand to be a good source of financial advice? (Is this a classy pump-and-dump?)


I flagged  ("convert my perl code to PHP") as "Too localized and off topic". My flag was declined.  The reason I flagged it that way instead of using the closing tool is that I had used my 50 closings for one day.  Since I flagged it, the question was closed as "too localized", which seems to prove that I wasn't the only one thinking that it was.  Can someone explain me why this flag got declined? I don't really mind as my accepted/declined flags ratio is high enough, but I'd like to understand.


What's a good way to filter a text file to remove empty lines?

I have a .csv file (on a mac) that has a bunch of empty lines, e.g.:  "1", "2", "lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum   lorem ipsum ","2","3","4" "1", "2", "lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum   lorem ipsum ","2","3","4"   Which I want to convert to:  "1", "2", "lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum ","2","3","4" "1", "2", "lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum  lorem ipsum ","2","3","4"   I know there must be a one liner but I don't know awk or sed. Any tips greatly appreciated!


Is it possible to perform a complete reinstall on an Android smartphone?

I occasionally perform such a reinstall on my Windows PC. I repartition my hard drive, format the partitions, and then install Windows on a blank partition. Can this be done on an Android smartphone? (I have an unlocked Sony Xperia S.)


In Firefox 66.0.1 (and for a few versions by now), many user icons fail to load on Stack Exchange pages. For example, on , the asker's icon and the icon for the writer of  fail to load, while with Jenayah, the most recent editor of the question, her icon loads.  This problem doesn't occur on Chrome. Right-clicking and reloading the images doesn't work; viewing them in a new tab shows that the browser is able to display the files. This may be a problem with Stack Exchange's inner workings cooperating with Firefox, or something may just be wrong with my download of the browser.


When no model comparison, should I use REML vs ML?

I'm running LMM, and I will make no comparison of models. Could I ask which one should I use between REML and ML?


Should I monitor my child's internet usage?

This question was inspired by this one:  which was deemed off topic.  Hopefully this is more on topic as I'm not interested in the specifics of how to monitor what my kids do on the internet.  But what general approach I should take, and what approaches others have used?


Consider $[0,1]$ with addition modulo one is an abelian group. Subgroup generated by $\sqrt2$ is dense in $[0,1]$. I think this generator set is $\{\sqrt2 n|n\in \mathbb Z\}$ I know that any closed subgroup of $[0,1]$ which is infinite is equal to $[0,1]$. But I cannot show for any interval centered at any element in $[0,1]$ intersects with $\{\sqrt2 n|n\in \mathbb Z\}$ I have seen the trick using taking power of $\sqrt2-1$ but this is an additive group and we need to approach it in group way not rings.


Monitor setup during login is different to after login

I have two monitors plugged into my machine. Monitor 1 connects via HDMI, and Monitor 2 connects via DVI. Physically, Monitor 1 is on the left of Monitor 2. In Screen Display Settings, Monitor 1 is set to be to the left of Monitor 2.  Now, when I boot into Ubuntu 14.04, at the login screen, the login box is shown on Monitor 2. Also, Monitor 1 is setup to be to the right of Monitor 2. This is the opposite to what I want.  But then after logging in, things switch round: Monitor 1 is the main screen with the desktop icons, and Monitor 1 is set up to be to the left of Monitor 2. This is how I want it.  So, the situation after logging in is as I want it, but at the login screen, things are the reverse. How can I change it so that both during and after login, my set up is as I want it?


Show that $\sqrt{n^2+1}-n$ converges to 0

I want to use the definition of the limit to show that $\sqrt{n^2+1}-n$ converges to 0.  The definition is as follows: if $\sqrt{n^2+1}-n$ converges to 0, then $\forall \epsilon>0$, there exists an $N>0$ such that $n\ge N \implies \mid\sqrt{n^2+1}-n\mid<\epsilon$.  Now I want to start backwords in order to figure out how to pick N. I know:   $\mid\sqrt{n^2+1}-n\mid=\sqrt{n^2+1}-n$   since $n$ is a natural number and $\sqrt{n^2+1}>n$. So I need to pick an N such that $\sqrt{n^2+1}-n<\epsilon$. I tried multiplying $\sqrt{n^2+1}-n$ by $\frac{\sqrt{n^2+1}+n}{\sqrt{n^2+1}+n}$ but that didn't really seem to help.   Do you have any ideas on how to find this N?  Thanks


How do I set default accounts for YouTube and Gmail?

I have an email for school and an email for personal use. How can I make it so that, in Chrome, when I go to YouTube it logs me into my personal account but when I go to Gmail it logs me into my school account?


Why do light disappears the moment we switch off the source (inside the wooden box)?

I am failing to explain why light won't remain inside the wooden box in the following situation. I considered a wooden box closed from all the sides, with a bulb inside it. If we switch on the bulb, light will be emitted from the bulb inside the box, if we switch off the bulb, I assumed the light to disappear, which I practically assume to be true. If I am wrong here, please explain. So, practically I assumed light to disappear if we switch off the bulb, after being switched on for a while. I got a question here, why light has to disappear the moment we switch off the bulb?      Thinking about the above situation, I considered the case of bullet being fired into the wooden face from the inside of the same box. No doubt, bullet smashes the wooden face into pieces and comes out. Here bullet has high speed and even has mass, so that, it disappears out of the wooden box. I considered the photons now, I thought photons have high speed much greater than bullet, but they have very less mass (I am not sure with rest or relativistic), so I thought that, photons should remain into the wooden box after colliding the wooden face. If they would had, I thought that there should have been light inside the box even after the bulb was switched off, but it is not. Is it that photons are piercing into the voids between the atoms with high speed to get out of wooden box?      If we say photons are getting out of the wooden box piercing into the voids, why won't it be in total internal reflection phenomenon. If we assume light to be incident at the interface from the denser medium to the rarer medium, at an angle greater than critical angle, photons should even then pierce into the voids. But, my teacher has taught me that, in total internal reflection there would be no refraction. By this even my assumption of photon getting out of the box from the voids also falls down. As radiation is a form of energy, it can't be lost with out being utilised or else it can't be lost without getting emitted out of the box so as to avoid violation of conservation of energy. Is here, the light absorbed inside the box by the medium? I don't know whether I have misunderstood here or whether  we could explain from wave nature of light, so as to why light disappears from the box?


Is There A Cycles Alternative For The Halo Material Effect?

Just wondering if there is a cycles alternative for the 'halo' material effect only found in Blender Internal? This halo effect turns an object into small glowing orbs instead of one solid object. I am looking for this effect to include in a cycles animation, however the halo option is not available for cycles at all.  I've attached the .blend file to show the halo effect I'm trying to achieve in cycles.  Cheers!


With FFmpeg, I divide 1 video into 675 parts, this process can take a long time depending on the video quality. There are slowdowns towards the middle of the process. I think I'm experiencing freezes because the cpu cache is full. For this, I divided the process in two and added the codes to 2 separate bat files. All I want is to run the 2.bat file after the 1.bat file is running and finished. start 1.bat start 2.bat exit When I do this way, the 2bat file is running at the same time.


Can I switch the alt and ctrl keys on my keyboard?

I'm a long time Mac user, but I just built a PC. Not liking the ctrl and alt keys locations. I'm always expecting the ctrl key to be where the command key is on my Macbook. Can I moved swap these somehow? I'm running Windows 10, and I'm up to date.


I was about to install opencart on my Ubuntu 14.04 LTS.  I will describe my exact steps-   Extracted the opencart.zip. gksudo nautilus Pasted the opencart folder into /var/www/html Now while accessing localhost/open, it says Forbidden Access.   I checked the permission of /open, it was drwx------ 7 root root 4096 Oct 26 17:26 open. So basically, it was 700 (I'm not sure though), but I got a sense that permissions needed to be provided to access them.  So I fired terminal, and went on a spree to give all folders a permission of 755 and files - 644.  Three questions-   Was I right till here or not ? If yes, what is the correct way to set permissions ? I did chmod for all folders & files individually (with the help of wildcards, obviously). This is actually a very hectic step. There are hundreds of files and folders, so this must not be the right way. What am I missing ? Even last time, I messed up with some permissions of some folders in /www, and it rendered me to install Ubuntu. Either there has to be a way to fiddle with /www or should I go with changing default /www-data directory ? (No idea how to go ahead with that).   I really want to stick with Linux but this permission thingy is always nagging me.  PS: Right now, if I access /open, it opens a blank page.  Thanks, help much appreciated.


Does forward current of diode has any affect on forward voltage?

In datasheet I observed that forward voltage of diode given as between two values (min and max). In my application the current though the diode is not constant it switches every 15 min(may be more or less).    Is it that the forward voltage remains constant even if the forward current changes ? Does current has any affect on forward voltage?


Understanding MCMC and the Metropolis-Hastings algorithm

Over the past few days I have been trying to understand how Markov Chain Monte Carlo (MCMC) works. In particular I have been trying to understand and implement the Metropolis-Hastings algorithm. So far I think I have an overall understanding of the algorithm but there are a couple of things that are not clear to me yet. I want to use MCMC to fit some models to data. Because of this I will describe my understanding of Metropolis-Hastings algorithm for fitting a straight line $f(x)=ax$ to some observed data $D$:  1) Make an initial guess for $a$. Set this $a$ as our current $a$ ($a_0$). Also add $a$ at the end of the Markov Chain ($C$).  2) Repeat the steps bellow a number of times.  3) Evaluate current likelihood (${\cal L_0}$) given $a_0$ and $D$.  4) Propose a new $a$ ($a_1$) by sampling from a normal distribution with $\mu=a_0$ and $\sigma=stepsize$. For now, $stepsize$ is constant.  5) Evaluate new likelihood (${\cal L_1}$) given $a_1$ and $D$.  6) If ${\cal L_1}$ is bigger than ${\cal L_0}$, accept $a_1$ as the new $a_0$, append it at the end of $C$ and go to step 2.  7) If ${\cal L_1}$ is smaller than ${\cal L_0}$ generate a number ($U$) in range [0,1] from a uniform distribution  8) If $U$ is smaller than the difference between the two likelihoods (${\cal L_1}$ - ${\cal L_0}$), accept $a_1$ as the new $a_0$, append it at the end of $C$ and go to step 2.  9) If $U$ is bigger than the difference between the two likelihoods (${\cal L_1}$ - ${\cal L_0}$), append the $a_0$ at the end of $C$, keep using the same $a_0$, go to step 2.  10) End of Repeat.  11) Remove some elements from the start of $C$ (burn-in phase).  12) Now take the average of the values in $C$. This average is the estimated $a$.  Now I have some questions regarding the above steps:   How do I construct the likelihood function for $f(x)=ax$ but also for any arbitrary function? Is this a correct implementation of Metropolis-Hastings algorithm? How the selection of the random number generation method at Step 7 can change the results? How is this algorithm going to change if I have multiple model parameters? For example, if I had the model $f(x)=ax+b$.   Notes/Credits: The main structure of the algorithm described above is based on the code from an MPIA Python Workshop.


What is the best way to write data to the text console at arbitrary locations on the screen and with custom fore/background colors?


How to prove that $\frac{b-a}{\sqrt{1-a^2}}<\sin^{-1}b-\sin^{-1}a<\frac{b-a}{\sqrt{1-b^2}}$ by using Mean Value Theorem?

Given Question is Prove that  $$\frac{b-a}{\sqrt{1-a^2}}<\sin^{-1}b-\sin^{-1}a<\frac{b-a}{\sqrt{1-b^2}}$$ when $0<a<b<1$ using Mean Value Thoerem.  I considered $f(x)=\sin^{-1}x $ when $x\in(0,b)$ and used LMVT and established that $\frac{b}{\sqrt{a-c^2}}=\sin^{-1}b$ where $c \in (0,b)$.  But I don't know how to proceed after this. Please guide.


I was using my PC in darkness.Brightness of PC was too shiny. I downloaded  software. I scanned it on . It says 1 threat detected(STOPzilla). I searched on Google that what is it.I got nothing except anti-STOPzilla. I visited the following page but it was not understand-able to me cause I am not too professional at english:  Can Anybody help me that what virus is it?


Can I save destiny progress to another xbox live account with a usb?

So, my xbox live account glitched out and I cannot enter in xbox live any more. I was wondering if I can use a usb or flash drive or what ever I can transfer data too, to save my destiny progress on another account. Is this possible?


Why are my wallpaper settings, tile, zoom, center, scale, fill or span options no longer available?

Up until a couple months ago, if I changed my wallpaper/background image, I could choose between tile, zoom, centre, scale, fill or span.  These options no longer appear in GUI for changing the background image. I am using Ubuntu 17.10.


Why is Leia okay with being tracked to Yavin?

In A New Hope, after Han and Luke fight off the TIE Fighters while escaping from the Death Star, these exchanges happen:             INT. DEATH STAR - CONTROL ROOM             Darth Vader strides into the control room, where Tarkin is             watching the huge view screen. A sea of stars is before him.                                   TARKIN                      Are they away?                                   VADER                      They have just made the jump into                       hyperspace.                                   TARKIN                      You're sure the homing beacon is                       secure aboard their ship? I'm taking                       an awful risk, Vader. This had better                       work.             INT. MILLENNIUM FALCON - COCKPIT             Han, removes his gloves and smiling, is at the controls of             the ship. Chewie moves into the aft section to check the             damage. Leia is seated near Han.                                   HAN                      Not a bad bit of rescuing, huh? You                       know, sometimes I even amaze myself.                                   LEIA                      That doesn't sound too hard. Besides,                       they let us go. It's the only                       explanation for the ease of our                       escape.                                   HAN                      Easy... you call that easy?                                   LEIA                      They're tracking us!                                   HAN                      Not this ship, sister.             Frustrated, Leia shakes her head.                                   LEIA                      At least the information in Artoo is                       still intact.                                   HAN                      What's so important? What's he                       carrying?                                   LEIA                      The technical readouts of that battle                       station. I only hope that when the                       data is analyzed, a weakness can be                       found. It's not over yet!   Leia doesn't even know if there is a weakness, let alone whether they'll find one. If she (correctly) realizes that they're being tracked, why doesn't she suggest that the Millennium Falcon go somewhere besides Yavin 4 instead of just frustratedly shaking her head? I know the plans , but it seems unlikely that continuing to fly to the secret Rebel base in the ship she's certain is being tracked is the only option. They are already in hyperspace when this conversation happens, but they apparently have time to talk for a little while after, so presumably they'd have time to stop and reroute.


How can I make Ubuntu to run only one application on startup

I am currently developing a quad copter controller that is touch screen and powered by Raspberry Pi. I already know how to program using Python, but I am having trouble making it run my only app on start up...any suggestions?


Show that set of all invertible $n\times n$ matrices with real entries (denoted by $GL_n(R)$) is open set in $M_n(R)$.   My attempt: by open set I think it means neighborhood of every point in set is contained in set, but this definition doesn't seem to help solve this question. Any other approach?


Intersection of Closed and Compact Set is Closed

Fact  The intersection of a closed set $A$ and a compact set $B$ is closed.  Background  I wanted to prove that the intersection of closed and compact sets is compact. There might be other ways, but I am not interested in them for now and am looking to prove the above statement.  Relevant Facts  I don't have much idea what to use. $A^c$ is open. Every cover $\cup_{i\ge1}U_i$ of $B$ contains a subcover $\cup_{i=1}^kU_i$. I might want to prove $A\cap B^c$ is open. Limit points may be another points to consider but I don't get any idea in that direction.  I also don't have that $B$ is closed otherwise it would be trivial.  Some Clarification  I am aware that compact sets are not closed in arbitrary topological spaces. The reason why I was motivated to believe tha intersection of closed and compact set is compact is true is: See Matt E.'s Answer      So if $K$ is compact in an arbitrary topological space (which is just to say that   it is a compact topological space when given its induced topology) and     $L$ is closed then $K \cap L$ is a closed subset of $K$ in its induced topology   Is it true if $A$ and $B$ are not whole spaces?  I would appreciate any hints.


Can a hidden attacker shoot around the corner?

In our D&D 5e games, I am not sure how to handle the following situation relating to stealth:  Enemies are in a room. The rogue stays outside, stepping to the side in order to be able to hide. Now, can he attack the enemies inside the room with his bow while getting advantage and sneak attack?  In favor of sneak attacking one might say, that the enemies don't see him prepare and have little time to react to his attack.  On the other hand, they know where he is, they just can't see him.  Is the situation different with a pile of boxes, where they know he's hidden behind the boxes, but not from which end he will attack?


Is there any way to resize the tiles in MetroUI in Windows 8?

Well I really love the MetroUI in Windows 8 but is there any possibility to resize the tiles ?


According to the special theory of relativity, distant simultaneity depends on the observer's reference frame.  And, according to the quantum theory, in the case of two entangled particles, a measure on one of the particles simultaneously affects the second one. Under which reference frame is this simultaneous?


Can you ready disengage to avoid opportunity attacks on your turn?

Edit: This question isn’t asking wether you can ready to disengage. That question has been fully answered in a forum linked in a comment below. What this question is asking is, if you ready disengage, then when it does get to your turn are you already disengaged, and so can move away without provoking opportunity attacks? Below is the question as originally stated:  Can you ready the disengage action (say when the enemy gets within 5 feet of you), so that on your turn you can move away from that enemy without provoking opportunity attacks as you have already disengaged?  In other posts I have seen that readying disengage is legal, but I’ve not seen this particular question asked before.


How do you make Vim unhighlight what you searched for?

I search for "nurple" in a file. I found it, great. But now, every occurrence of "nurple" is rendered in sick black on yellow. Forever.  Forever, that is, until I search for something I know won't be found, such as "asdhfalsdflajdflakjdf" simply so it clears the previous search highlighting.  Can't I just hit a magic key to kill the highlights when I'm done searching?


What happens to Bucky's arm at the end of Infinity War?

Bucky (Winter Soldier) has a metal arm (possibly made from vibranium?) but it's an attachment to his body as far as I understand. Why, when Thanos destroys half of the universe at the end of Infinity War, does his metallic arm also disappear with him? Shouldn't it be left behind as his gun did?


How to check the return value of the first function in jQuery

Why does the following code return an empty array as a result ([])?  $('#non-existing-id').first();   I thought that it should return null or undefined.  How can I check for the success then? I don't see anything about it in the documentation.


Axiom of choice is equivalent to every relation includes a function with the same domain

The axiom of choice asserts that for any set $X$ there exists a function $f : (2^X − \{\emptyset\}) \rightarrow X$ such that for any nonempty $A \subseteq X$, $f(A) \in A$. Show that this is equivalent to the assertion that every relation includes a function with the same domain. I am given this problem in my assignment. My approach is following. I have a set $X$. Then it has a choice function $g : \mathcal{P}(X) \setminus \left\{\emptyset\right\} \rightarrow X$. Suppose $X$ has a relation $R \subseteq X \times X$. $dom(R) \subseteq X$. Then the required function $f : dom(R) \rightarrow X$ is $$f(x) = g(\{y\ |\ (x, y) \in R\})$$ Conversely, suppose $X \supseteq Y$ is a non-empty subset. Let $$R_Y = \{(x, y)\ |\ y \in Y, x \in Y, (p, q) \in R_Y \Rightarrow p = x\}$$ Then there is a function $f_Y : dom(R_Y) \rightarrow X$. But $dom(R_Y)$ is singleton from the definition of $R_Y$. Then $im(f_Y)$ is also singleton. We define our choice function as $f = \{(Y, y)\ |\ y \in im(f_Y)\}$ Are my arguments correct?  Edit.1: what I tried to do for converse is, for any subset $Y$, I construct a relation $Y_1 \times Y$ where $Y \supseteq Y_1 = \{y\}$. Then there is a function $f_Y : Y_1 \rightarrow Y$. Then if $f$ is my choice function I define $f(Y) = f_Y(y)$. May be I should define $R_Y$ as $$R_Y = \{(x, y)\ |\ y \in Y; x \in Y; (p, q), (p', q) \in R_Y \Rightarrow p = p'\}$$ I understand there may be multiple $R_y$'s. But can't I define a singleton set as $\{s\in S\ |\ a, b \in S \Rightarrow a = b\}$? This can be $\{s\}$ $\forall s \in S$. But isn't it a valid specification?  Edit.2: This is the final solution with the help from @Asaf.  If we assume axiom of choice then for any $X$ there is a choice function $f : \mathcal{P}(X) \setminus \left\{\emptyset\right\} \rightarrow X$ such that $f(A) \in A$. Suppose $R$ is a relation between $P$ and $Q$. Then we have a choice function $f_Q$ for $Q$. Let $f_R(p) = f_Q(\{q\ |\ pRq\})$. The function $f_R : P \rightarrow Q$ and $dom(f_R) = dom(R)$. So this is our required function.  Conversely, if every relation includes a function with same domain. Let $R$ be a relation between $\mathcal{P}(X) \setminus \left\{\emptyset\right\}$ and $X$ such that $aRb \Rightarrow b \in a$. Now $R$ includes a function $f : \mathcal{P}(X) \setminus \left\{\emptyset\right\} \rightarrow X$. Then $xRf(x) \Rightarrow f(x) \in x$. So $f$ is the choice function for $X$.


How to prove $\lim\limits_{n \to \infty} (1+\frac1n)^n = e$?

How to prove the following limit?   $$\lim_{n \to \infty} (1+1/n)^n = e$$    I can only observe that the limit should be a very large number!   Thanks.


Getting only the name of the session in screen?

How to get only the session names in screen -ls?


Proof that a continuous map to $S^n$ whose image is a proper subset of $S^n$ is null-homotopic

I am attempting to prove the following:  If $g:X \to S^n$, $n \ge 1$, is a continuous map whose image $g(X)$ is a proper subset of $S^n$, then $g$ is null-homotopic.  Just before this I proved that if $Y$ is contractible, then every continuous map $f:X \to Y$ is null-homotopic.  Therefore I'd like to show that any proper subset of $S^n$ is contractible.  What is the best way to do this?  I wanted to use that $S^n$ is an $n$-manifold to associate it with an open set in $\mathbb{R}^n$, which, if it is convex, is contractible.  However, I don't think this works, and it seems like overkill anyway.  What is the best way to show that a proper subset of $S^n$ is contractible?  Thanks.


.openPopup() in Geojson data in Leaflet?

Why .openPopup() is not working in case of GeoJSON data in Leaflet? I want to use this as labeling in my map.      ////////////// for Popup label  function onEachFeature(feature, layer) {     // does this feature have a property named popupContent?     if (feature.properties && feature.properties.Name && feature.properties.Lat && feature.properties.Lon) {         layer.bindPopup(feature.properties.Name+"("+feature.properties.Lat+","+feature.properties.Lon+")");     } } /// for Show in map marker style and popup     L.geoJSON(geojsonFeature, {     pointToLayer: function (feature, latlng) {         return L.circleMarker(latlng, geojsonMarkerOptions);     },      onEachFeature: onEachFeature  }).addTo(map);


There is problem installing Ubuntu on my computer.   Error : Failed to load ldlinux.c32   This error occurs when it starts to boot.


Can I claim school expenses including tuition that was paid out of pocket on my taxes

As I stated above I am wondering if I can claim my school expenses on my taxes for this year's taxes. If it is possible how would I do so and will I get a better return because of it? I am in the United States.


Favorite questions on Stack Overflow I feel is highly unused feature of all the features provided on the site. (This again is my personal opinion)  I have favorited around 90 question till date and it gets very very very difficult if I want to search for a question which I remember I have favorited, which defeats the entire purpose of one favouriting a question, so here is my small suggestion.  Favorites by tags  Screen 1        Screen 2        Please share your opinions on this.


Making a LaTeX text R logo. How maintain the proportions?

I tried to mimic the R logo in jpg format  only with LaTeX in order to make it scalable with the context without external files.   This is the result at tiny, normal and huge size, compared with the jpg at scale 25%, 50 and 100%:    Evidently, the LaTeX logotype is far from perfect in many areas even at normal size, but the worst is that the proportion between character R and the background circles (\bircirc) is not constant, although everything is defined in em units. Why?  Could be a better way to construct a pretty inline R logo? Of course, it should be not the jpg file nor a scalable vector graphics (SVG) converted to pdf, nor a simple format of the R character, like \newcommand{\R}{\textbf{\textup{R}}}  This is the MWE code:  \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{xspace} \usepackage{xcolor} \usepackage{graphicx} \definecolor{Rcolor}{RGB}{150,160,190}  \newcommand{\R}{% \raisebox{.3em}{\hspace{1.2em}% \llap{\resizebox{1.09em}{.5em}{\color{black}$\bigcirc$}}% \llap{\resizebox{1.199em}{.55em}{\color{darkgray}$\bigcirc$}}% \llap{\resizebox{1.19em}{.52em}{\color{gray!50}$\bigcirc$}}% \llap{\resizebox{1.1em}{.5em}{\color{gray}$\bigcirc$}}% \llap{\resizebox{1.25em}{.55em}{\color{gray}$\bigcirc$}}% }% \hspace{-.85em}% \textbf{% %\resizebox{.55em}{1.5ex}{\textcolor{black!80}{\textsf{R}}}% \textcolor{black}{\textsf{R}}% \hspace{-.025em}\raisebox{.01em}{\llap{\textcolor{Rcolor}{\textsf{R}}}}% }% \xspace}  \begin{document}  Bitmap logo:  \includegraphics[scale=.25]{Rlogo.jpg} \includegraphics[scale=.5]{Rlogo.jpg} \includegraphics[scale=1]{Rlogo.jpg}  \LaTeX\ logo:~~  \tiny{\R}  \normalsize{ \R}  \Huge{\R}   \end{document}