I have list on my website like this:
     @foreach($profiles as $profile)
{{ $profile['name'] }}
     @endforeach

   When I add new element to this list using function below:  $("#addNewProfileButton").on("click", function () {     profileName = $("#newProfileInput").val();     $("#newProfileInput").val('');     $.ajax({         method: 'GET',         data: {             profileName: profileName         },         url: '/addNewProfiles'     }).success(function (newProfile) {         console.log(newProfile);         $("#listProfiles li:last").after('
' + newProfile.name + '
');      }).error(function (msg) {         console.log(msg);     }); });   it's added properly but not clickable using this:  $("#listProfiles li").click(function () {     profileId = $(this).attr('profileId');     $.ajax({         method: 'GET',         data: {             profileId: profileId         },         url: '/spiderProfileDetails'     }).success(function (msg) {         $('#profileResult').html(msg);     }).error(function (msg) {         console.log(msg);     }); });   All other elements are clickable. New element becomes clickable after refreshing the website. How to make it work without refreshing?

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


Sometimes, I want to mark a section of my manuscript for later inspection. So far I have been using a different color, but I really do not like it. I was wondering if I can draw a black strip on the margin. Ideally, it should work across pages and with equations. I believe it should be possible to do since draft mode already does something similar. But I do not know where to start.  MWE for testing:  \documentclass{article} \usepackage{lipsum} \newenvironment{marked}{}{}  \begin{document} \lipsum[1-4] \begin{marked}   \lipsum[5]   \[ x = y\]   \lipsum[6] \end{marked} \end{document}   Desired output:

I've seen on  several possibilities to include a line next to a paragraph. Like this: (the line is continuous)  text text text | text text text | text text text |   However, I would like to print that line on the margin, so that the original paragraph doesn't get any modification. In other examples the paragraph get an extra spacing with the next and previous paragraphs and the text is move a little to one side.  One of the other options I've seen is with the package pdfcomments, but I just want a real line, not a comment that will cause problems when printing. Is that possible? Maybe with Tikz?


how to calculate the size of this structure: struct Node{     int data;     char b;     char *c; };  when I run, it gives 16 bytes. can anyone explain?

Why does the sizeof operator return a size larger for a structure than the total sizes of the structure's members?


There are a couple of files in our git-controlled codebase that I'd like to rename.  Specifically, I just want to change the case of the file, so that sourceCode.java becomes SourceCode.java, for example.  The catch: I'm on a Windows box, and the filesystem thinks those are the same file name.  How can I get Windows and Git to recognize that change and check it in?

I'm not too sure what is going on here, but sometimes a particular file in my repository will change the case of its name. e.g.,: before: File.h after: file.h I don't really care why this is happening, but this causes git to think it is a new file, and then I have to go and change the file name back. Can you just make git ignore case changes? [edit] I suspect it is Visual Studio doing something weird with that particular file, because it seems to happen most often when I open and save it after changes. I don't have any way to fix bugs in VS however, but git should be a bit more capable I hope.


I created a mesh, then use particles to make grass on it. I just want to take the grass and grass's shadow on render, so I make the mesh's material become invisible (by using Transparent BSDF, alpha is zero).    But when the mesh become transparent, the grass's shadow is disappear too. How can I still get the shadow while the mesh is invisible?  I use Blender 2.70, Cycles Render

I am trying to render an animation in cycles without the background. However, every time I have it render, the background still shows up.  I used the compositor to add a background image so I can animate the object around the background. I set the output to RGBA and set the film to transparent.   Now I want to use it in After effects and I simply want to export/render it without the background and make it transparent.  How do I do that?


How much extra distance would a scientist have to travel to get to the event horizon of a mini black hole if they ever make one?

How much extra distance would I have to travel through space to get from Earth to a stellar mass event horizon? (compared to the same point in space without a black hole)


Is it possible to track an email sent to me already? I want to track the IP address of the person who sent me the email using the email just sent. Is it possible, or is email anonymous?

There is someone harassing me through emails and I need to know if there is a legal/legitimate way I can obtain their true IP address. They started masking their IP address after I used the email header to find out who it was initially. But now I'm at a loss. Any advice or suggestions or help would be tremendously appreciated. Thank you for your time.


Is it try what SAT for a boolean formula in CNF in NP-full?   And for DNF it is trivial?   But can we just transform any CNF to DNF?

The first well-known $NPC$ problem is the  which has a proof of being $NPC$ done by Cook (Cook-Levin Theorem).  The problem can easily be described the following way:     In complexity theory, the satisfiability problem (SAT) is a decision problem, whose instance is a Boolean expression written using only AND, OR, NOT, variables, and parentheses. So, we should give an answer 'yes' if there is a set of boolean variables which yield 'TRUE' for the given for the corresponding expression.   However, I have a question. The wikipedia article states the following:     SAT is easier if the formulas are restricted to those in disjunctive normal form, that is, they are disjunction (OR) of terms, where each term is a conjunction (AND) of literals (possibly negated variables). Such a formula is indeed satisfiable if and only if at least one of its terms is satisfiable, and a term is satisfiable if and only if it does not contain both x and NOT x for some variable x. This can be checked in polynomial time.   So, basically, if the expression is written in the DNF, this problem is not $NPC$, but simply $P$.  However, as far as I know, there is a $O(p(n))$ algorithm to transform any given boolean expression into DNF and DNF exists for any boolean expression.  What am I missing or misinterpreting? There is obviously an error in my logic, because it resulted in making the SAT problem $P$, but not $NP$.  Thank you!


Can anyone explain the difference between observed variables and unobserved variables (preferably in plain English ) ?

What is observed and what is observable? I found this two word frequently in the context of random variable and realization of random variable.  What is the difference between observed and observable?


I got virus on my computer. This is a list of executables of the virus:  Name              |Size  |Description ------------------+------+-------------  B06A.exe          |162   |B06A D3F2.exe          |217414|wYtRBdGyks E3DA.exe          |357190|TWunHOlqmZ NTDETECT.COM      |177152|Mail.Ru Агент ScreenSaverPro.scr|177152|Mail.Ru Агент temp.bin          |177152|  (none) ViewFiles.cmd     |177152|Mail.Ru Агент Zafgff.exe        |177152|Mail.Ru Агент   I have found the virus had done the following, but I haven't find actual damage yet:   Folders in my USB disk became hidden and system. Links with the same name with those folders were spawned. Clicking those links cause virus to run. Registry HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run was set to run this virus when I login.   Do anyone know this virus? What does it actually do? Or is it a new one? How can I report it?

What should I do if my Windows computer seems to be infected with a virus or malware?  What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware?   This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.


I would like to build a function that gives me two lists as an output:  def times_10(i):     out = i * 10     return out, i  outpt,inpt = [times_10(i) for i in range(1,8)] #doesn't work   I have one way of doing it, but I have a feeling there must be something simpler:  a = [times_10(i) for i in range(1,8)] outpt,inpt = list(map(list, zip(*a))) # this works   Expected output:  >>> outpt [10, 20, 30, 40, 50, 60, 70] >>> inpt [1, 2, 3, 4, 5, 6, 7]

I have a list of 2-item tuples and I'd like to convert them to 2 lists where the first contains the first item in each tuple and the second list holds the second item.  For example:  original = [('a', 1), ('b', 2), ('c', 3), ('d', 4)] # and I want to become... result = (['a', 'b', 'c', 'd'], [1, 2, 3, 4])   Is there a builtin function that does that?


Operand should contain 1 column  What wrong with my code is it mean AND I try to insert into activitynote table by selection   <?php    require_once('Connections/Thaymay.php');    mysql_select_db($database_Thaymay, $Thaymay);       $activityid = $_POST['select'];    if($_POST) {     foreach($_POST['namebox'] as $check) {              echo "$check \n ";              echo "<br> ";               $query_ReSeActi = " INSERT INTO `ph3`.`activitynote` ( `idmemberref`, `idactivity`, `manaferid`, `staffinput`) select (              idmemberref,    $activityid,    manaferid,  'system'  ) from activitynote where id = $check ;    ";             $RsActivitynoteMem = mysql_query($query_ReSeActi, $Thaymay) or die(mysql_error());      } }    ?>

I tried running the following statement:  INSERT INTO VOUCHER (VOUCHER_NUMBER, BOOK_ID, DENOMINATION) SELECT (a.number, b.ID, b.DENOMINATION)  FROM temp_cheques a, BOOK b WHERE a.number BETWEEN b.START_NUMBER AND b.START_NUMBER+b.UNITS-1;   which, as I understand it, should insert into VOUCHER each record from temp_cheques with the ID and DENOMINATION fields corresponding to entries in the BOOK table (temp_cheques comes from a database backup, which I'm trying to recreate in a different format). However, when I run it, I get an error:  Error: Operand should contain 1 column(s) SQLState:  21000 ErrorCode: 1241   I'm running this in SQuirrel and have not had issues with any other queries. Is there something wrong with the syntax of my query?  EDIT:  The structure of BOOK is:  ID  int(11) START_NUMBER    int(11) UNITS   int(11) DENOMINATION    double(5,2)   The structure of temp_cheques is:  ID  int(11) number  varchar(20)


So I am running terminator 0.98. I like fish shell but for some task it is handy to have bash (like for virtualenvwrapper). So I now have two windows that open when I start terminator. But I would like to have one that opens with fish and one with bash. Is this possible, if so: how?  I start terminator with my custom layout by changing my config file located ~/.config/terminator/config.   In the layout section of the config file I used this code.  [layouts]   [[default]]     [[[child0]]]       fullscreen = False       last_active_window = True       maximised = True       order = 0       parent = ""       size = 1280, 985       type = Window     [[[child1]]]       order = 0       parent = child0       position = 490       ratio = 0.5       type = VPaned

I would like to open a terminal, split it to lets say 9 parts (3x3) and execute some bash script. But for each terminal part different script.   Can this be done using perl, python or even bash?  How can I switch between those little terminals without using keyboard shortcuts?  Oh, by the way, I'm using terminator. And if there is some other terminal emulator that enables such a functionality, which is it?


Let's assume I don't know what my IP range is, or my default gateway, but I know my IP address is 192.168.5.38 and my CIDR Range is /23.  How do I know what my IP range is?  Is my range  192.168.4.0-192.168.5.255   or   192.168.5.0-192.168.6.255   Can we only work out this if we know the default gateway?  Please note I'm not asking what tools can provide this information, this is a thought exercise. I'm trying to understand how you would know the range when faced with a situation like this.  Thanks!  Answer:  thanks to @g_bor down below - they helped me understand how you work out the range. You do it by ANDing the binary outputs of both IP address and Subnet mask.   IP address: 192.168.5.38  Binary  11000000.10101000.00000101.00100110   Subnet Mask: /23 (255.255.254.0)  Binary:  11000000.10101000.00000100.00000000   If we AND them together (1 AND 1 = 1, 0 AND 0 = 0, 1 AND 0 = 0) we get  11000000.10101000.00000100.00000000   which is IP Range:  192.168.4.0

This is a  about IPv4 Subnets.      Related:               How does Subnetting Work, and How do you do it by hand or in your head?  Can someone explain both conceptually and with several examples? Server Fault gets lots of subnetting homework questions, so we could use an answer to point them to on Server Fault itself.   If I have a network, how do I figure out how to split it up? If I am given a netmask, how do I know what the network Range is for it? Sometimes there is a slash followed by a number, what is that number? Sometimes there is a subnet mask, but also a wildcard mask, they seem like the same thing but they are different? Someone mentioned something about knowing binary for this?


Let $A$ be the set of all rational numbers $p$ such that $p^2<2$, and let $B$ be the set of all rational numbers $p$ such that $p^2>2$. It can be shown that $A$ has no largest element and that $B$ has no smallest element by associating  to each $p>0$ the number $$q=p-\frac{p^2-2}{p+2}$$  and then proving that $p\in A \Rightarrow q\in A$ and $p\in B\Rightarrow q\in B$.   Where is this value of $q$ coming from?

First, my apologies if this has already been asked/answered.  I wasn't able to find this question via search.  My question comes from Rudin's "Principles of Mathematical Analysis," or "Baby Rudin," Ch 1, Example 1.1 on p. 2.  In the second version of the proof, showing that sets A and B do not have greatest or lowest elements respectively, he presents a seemingly arbitrary assignment of a number $q$ that satisfies equations (3) and (4), plus other conditions needed to show that $q$ is the right number for the proof.  As an exercise, I tried to derive his choice of $q$ so that I may learn more about the problem.  If we write equations (3) as $q = p - (p^2 - 2)x$, we can write (4) as   $$ q^2 - 2 = (p^2 - 2)[1 - 2px + (p^2 - 2)x^2]. $$  Here, we need a rational $x > 0$, chosen such that the expression in $[...]$ is positive.  Using the quadratic formula and the sign of $(p^2 - 2)$, it can be shown that we need   $$ x \in \left(0, \frac{1}{p + \sqrt{2}}\right) \mbox{ for } p \in A, $$  or, for $p \in B$, $x < 1/\left(p + \sqrt{2}\right)$ or $x > 1/\left(p - \sqrt{2}\right)$.  Notice that there are MANY solutions to these equations! The easiest to see, perhaps, is letting $x = 1/(p + n)$ for $n \geq 2$.  Notice that Rudin chooses $n = 2$ for his answer, but it checks out easily for other $n$.  The Question:  Why does Rudin choose $x = 1/(p + 2)$ specifically?  Is it just to make the expressions work out clearly algebraically?  Why doesn't he comment on his particular choice or the nature of the set of solutions that will work for the proof?  Is there a simpler derivation for the number $q$ that I am missing?


Trying to implement the following:  RewriteRule \.ttf$ - [E=cors:1] Header set Access-Control-Allow-Origin "*.example.com" env=cors:1 Header set Access-Control-Allow-Origin "*.sadface.com" env=!cors:1    Then requesting:  $ curl -I http://www.example.com/font.ttf ... Access-Control-Allow-Origin: *.sadface.com   UPDATE  Thanks to Jenny D I've figured out that the rewrite rules elsewhere were doing a local redirect to index.php so I've modified to the following:  # Set CORS domain for fonts. RewriteCond %{QUERY_STRING} \.ttf RewriteRule ^(.*)$ $1 [E=cors:1] Header set Access-Control-Allow-Origin "*.example.com" env=cors:1 Header set Access-Control-Allow-Origin "*.sadface.com" env=!cors:1   This provides the following log entry:  RewriteCond: input='q=font.ttf' pattern='\\.ttf' => matched   Despite this however I'm still getting Access-Control-Allow-Origin: *.sadface.com  UPDATE 2:  Looks like env=cors:1 isn't doing what I expect, changing to the following fixed the issue:  Header set Access-Control-Allow-Origin "*.example.com" env=cors

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


Refer to the sequence $S$ where $S_n$ denotes the number of n-bit strings that do not contain the pattern 00. By considering the number of n-bit strings with exactly i 0's, show that  $\displaystyle f_{n+2} = \sum_{i=0}^{\frac{n+1}{2}} \binom{n+1 - i}{i}$ for $n=1,2,\dots$ where $f$ denotes the Fibonacci sequence.  So I know the Fibonacci sequence consists of $0, 1, 1, 2, 3,\dots$ And $S_n=f_{n+2}$.  But what else?  Any help is appreciated.  Thanks!

The binomial sum   $$s_n=\binom{n+1}{0}+\binom{n}{1}+\binom{n-1}{2}+\cdots$$   satisfies the Fibonacci relation.   I failed to prove that $\binom{n-k+1}{k}=\binom{n-k}{k}+\binom{n-k-1}{k}$... Any hints or suggestions?


I have a binary dependent variable (infection + or -) and both continuous and categorical independent variables.  One continuous independent variable (BMI) seems to be nonlinear in that the lowest and highest BMI are more likely to be + and the BMI values in the middle are less likely to be +.  So when I plot BMI against the proportion that are +, I get U shaped line.  How do I incorporate that into the logistic regression?

Let's say I am building a logistic regression model where the dependent variable is binary and can take the values $0$ or $1$. Let the independent variables be $x_1, x_2, ..., x_m$ - there are $m$ independent variables. Let's say for the $k$th independent variable, the bivariate analysis shows a U-shaped trend - i.e., if I group $x_k$ into $20$ bins each containing roughly equal number of observations and calculate the 'bad rate' for each bin - # observations where y = 0 / total observations in each bin - then I get a U shaped curve.  My questions are:   Can I directly use $x_k$ as input while estimating the beta parameters? Are any statistical assumptions violated which might cause significant error in estimating the parameters? Is it necessary to 'linearize' this variable through a transformation (log, square, product with itself, etc.)?


In codeproject, i found a interesting program which implements a meaning of unit ,like  unsigned long long operator"" s(unsigned long long n) {     return n + 1; } int main() {     int x = 16s; }   x will be 17, so interesting. can someone tell me what magic this is?

introduces  which will allow the introduction of new literal syntax based on existing literals (int, hex, string, float) so that any type will be able to have a literal presentation.  Examples:  // imaginary numbers std::complex<long double> operator "" _i(long double d) // cooked form {      return std::complex<long double>(0, d);  } auto val = 3.14_i; // val = complex<long double>(0, 3.14)  // binary values int operator "" _B(const char*); // raw form int answer = 101010_B; // answer = 42  // std::string std::string operator "" _s(const char* str, size_t /*length*/)  {      return std::string(str);  }  auto hi = "hello"_s + " world"; // + works, "hello"_s is a string not a pointer  // units assert(1_kg == 2.2_lb); // give or take 0.00462262 pounds   At first glance this looks very cool but I'm wondering how applicable it really is, when I tried to think of having the suffixes _AD and _BC create dates I found that it's problematic due to operator order. 1974/01/06_AD would first evaluate 1974/01 (as plain ints) and only later the 06_AD (to say nothing of August and September having to be written without the 0 for octal reasons). This can be worked around by having the syntax be 1974-1/6_AD so that the operator evaluation order works but it's clunky.   So what my question boils down to is this, do you feel this feature will justify itself? What other literals would you like to define that will make your C++ code more readable?    Updated syntax to fit the final draft on June 2011


I want to obtain the PDF of $\theta1$ - $\theta2$ where $\theta1$ and $\theta2$ are both i.i.d Uniform RVs on [0,$2\pi$). The added condition here is that every operation is done modulo 2$\pi$. I tried to use convolution and follow a similar process as finding the PDF of X+Y but with no result. Any suggestion ??

I have 2 i.i.d Uniform random variables $\theta_{1}$ and $\theta_{2}$ on $[0, 2\pi)$. Here the problem pushes us to consider that all operations are made modulo $2\pi$. My question is how to obtain the joint PDF of $\theta_{1} - \theta_{2}$ and $\theta_{1}$ and then obtain the conditional PDF of $\theta_{1}$ given $\theta_{1} - \theta_{2}$??. For the second part It can be deduced from the first by writing it as the joint PDF divided by the PDF of $\theta_{1}$. But for the first part, A common idea that I saw is to derive the $\text{CDF}(x, y) = P(\theta_{1} - \theta_{2} \le x$, $\theta_{1} \le y$) and then perform derivations respect to $x$ and $y$. Is this a right approach? If yes, how to proceed with CDF especially with our uniform distribution restrictions?


This is the integral $$\int\frac{dx}{(x+1)(n-x)}=\int kdt$$ I just need some assistance on how to begin the left side integral and I will most likely be able to continue it from there thank you.

Could someone take me through the steps of decomposing  $$\frac{2x^2+11x}{x^2+11x+30}$$ into partial fractions?   More generally, how does one use partial fractions to compute integrals $$\int\frac{P(x)}{Q(x)}\,dx$$ of rational functions ($P(x)$ and $Q(x)$ are polynomials) ?    This question is asked in an effort to cut down on duplicates. See .  Also see .


I've downloaded Minecraft Forge for Minecraft v1.11.2 and I can't find the mods folder! Where do I look? I've looked in my %appdata% and clicked on .Minecraft and no Mods folder!

I've downloaded Minecraft Forge for Minecraft v1.6.4 and I can't find the mods folder! Where do I look? I've looked in my Forge folder but it wasn't there!


iPhoto starts launching when iPhone is connected even though it never used to before Yosemite. Steps described in:  does not work in Yosemite. Yosemite seems to ignore the iPhoto settings.

Whenever I connect my iPhone/iPad/iPod to MacMini, It automatically launches iTunes & start syncing every time. I am a developer & I frequently need to connect/disconnect different devices. So, whenever I connect device, I force quit iPhone & iTunes.   Can I eliminate the initial launch of iTunes and iPhoto when iOS devices connect over USB?


I have troubles using articles. I have not understood the algorithm when to use them. Could you review my older text and describe me, if an article is incorrectly used or omitted and why? Bold formatting is put where I think I missed some article.  I have developed and tested new web service. I used SoapUI for testing a local endpoint. Next step was to deploy the service into a/the testing environment. But suddenly I failed to connect to this endpoint. I was able to open its WSDL description in Firefox, but SoapUI failed with SSLPeerUnverifiedException: peer not authenticated. The setup was a network with a proxy and there was an Apache proxy translating URLs for the service. There were many similar complaints on web but no solution. I tried many proposals like trusting the certificate (because StartCom is not trusted certification authority in Java) but nothing helped. Until I posted a question on StackOverflow. It lead me to the solution: (Computer code solution follows)

How do I know whether to use the definite (the) or indefinite (a, an) article, and when to omit it altogether?


Given $\mathbf v=\begin{bmatrix}v_1\\v_2\\\vdots\\v_n\end{bmatrix}$ and $\mathbf A=\mathbf{vv}^\top$, find the eigenvectors and eigenvalues of $\mathbf A+\lambda\mathbf I$.   My current work progress is:  Since $(\mathbf A+\lambda\mathbf I)\mathbf v =\mathbf{Av}+\lambda\mathbf v=\mathbf v(\mathbf v^\top\mathbf v) + \lambda\mathbf v=\mathbf v \|\mathbf v\|+ \lambda\mathbf v=(\|\mathbf v\|+\lambda)\mathbf v$ ,  so one of the eigenvalue is $\lambda_1=(\|\mathbf v\|+\lambda)$ with corresponding eigenvector $\mathbf v_1=\mathbf v$.  I'd like to find out other pairs of eigenvalues and eigenvectors. I first calculate the trace.  $$\mathrm{Tr}\,(\mathbf A)=n\lambda+\|\mathbf v\|=\lambda_1+(n-1)\lambda$$  Hence, the rest of $n-1$ eigenvalues has sum $(n-1)\lambda$.   From here, I do not know how to proceed.   Can I assume the rest of eigenvalues are $\lambda$ with multiplicities $n-1$? Why? How to find corresponding eigenvectors?   [Note1] This is like a follow up question regarding .  [Note2] Found later on there is a  but people focus on linking it to Note1.

This question aims to create an ""  of numerous questions that ask about determinants of specific matrices (I may have missed a few):              The general question of this type is  Let $A$ be a square matrix of rank$~1$, let $I$ the identity matrix of the same size, and $\lambda$ a scalar. What is the determinant of $A+\lambda I$?  A clearly very closely related question is  What is the characteristic polynomial of a matrix $A$ of rank$~1$?


The laptop apparently is taking up ~87 gigabytes of space for system. I don't know how to dig into the details of why and to look into possibly freeing up some of that space as that seems rather excessive. I asked a friend and they only had ~11gb associated with system.  I did have a hard time upgrading from high sierra to mojave, and had to do a reboot into safe mode then hit some buttons on the app store to install mojave which eventually seemed to work.

Every few days I get notices on my MacBook that it's running or run out of hard drive space. Curiously, restarting the computer will enable me to recover gigabytes of space (this past time, it was able to recover about 2.2GB). However, I can't identify anything in my personal activity that consumed that space.  It's possible that it's a rogue iTunes podcast or a huge software update that my Mac is automatically downloading - would either of these reclaim the space upon a restart?  One possibility that I can think of is that FileVault has some sort of disk leak, allocating but not freeing files. Does this make sense? Is there a tool that I can run to determine where this space is going? Assuming it is FileVault, should I try to disable it? What's the best way to turn of FileVault on a nearly full computer?


I have the following code:  \documentclass{article}  \usepackage{hyperref} \usepackage{minted}  \begin{document}  A nice paper has the following things:  \begin{listing}   \begin{minted}{haskell}   data RCPoint = RCPoint {     _rcp_si :: Integer   }   \end{minted}   \label{ch1}   \caption{The RCPOINT Listing} \end{listing}  \begin{equation}   \label{eq:eqn1}   x^2 - 2 x \end{equation}  I like my equation in \ref{eq:eqn1}.  I also like my code in Listing \ref{ch1}.  \end{document}   which compiles normally, to produces::    The reference to the listing in the final line is missing. I get a warning for the final line of output:  (/usr/share/texmf-dist/tex/latex/amsfonts/umsb.fd)  Package hyperref Warning: Suppressing empty link on input line 55.  [1] (./nice-org-paper.aux) ) Output written on nice-org-paper.pdf (1 page). Transcript written on nice-org-paper.log.   How do I get the reference to work?

\documentclass{article} \usepackage{algorithm}  \begin{document} \setcounter{section}{54} \section{A section with no label} \begin{algorithm} \label{myalg} \caption{An algorithm with the label `myalg'.} \end{algorithm} Reference to myalg: \ref{myalg}. \end{document}   With this code, the reference givens 55 (the section number); if I move the label after the caption command, I get the correct reference (1).  Why should this be the case? I find it confusing: when thinking about an algorithm as an environment, you expect to be able to label it right after you began it. At the very least I would expect some kind of error or "??" to appear, rather than the previous environment or reference-able entity being used.


I have written the following PHP snippet to show some weird PHP behavior.   <?php $amount = "9.95"; var_dump($amount); // string(4) "9.95"  echo '
';  settype($amount, "float"); var_dump($amount); // float(9.95) echo '
';  $amount = $amount * 100; var_dump($amount); // float(995) echo '
';  settype($amount, "int"); var_dump($amount); // int(994) ?>   I expected the last output to be 995, but instead the result is 994. Why is this happening? Online snippet:

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


Let $G$ be a compact topological group (we don't assume any separation axiom here). For a subgroup $H$ of $G$, we may endow the quotient space $G/H$ with quotient topology. Now it is clear for me that openness of $H$ implies finiteness of $G/H$. My question is whether the converse is also true. If not, I would like to hear some counterexamples in the case of Lie groups and profinite groups.

If $G$ is a compact topological group, how to show that a finite index subgroup of $G$ is open ? I really don't know where/how to start...  PS : I precise that by "compact" I mean that it is hausdorff and that any recovering of $G$ by open sets has a finite sub-recovering (sorry if I wasn't unclear)


I have a MTB/Hybrid which I use for exercising and leisure purpose. It have installed MTB style mudguards. But when I get out with these my back is full of mud/water drops.   So what is the best position for these style of mudguards? Specially rear mudguard. I have attached the photo of my bike which shows the position of my mudguard. Can changing these position will improve the effectiveness?

For a 20" rear wheel with a this kind of fender, what would be the best angle to install it to minimize the spray on one's butt/legs?


does these new top-level domain names (.guru, .rocks, .ml, .tk) affect user experience? do they like to type generic top-level domain names only?

If you are not aware, ICANN has approved quite a few generic top level domains and they intend to approve more. By generic, they mean regular old words will replace the common .com or .net, so we will have the option for domains names that end in words like:   .photography .media .education .finance .vision     I personally like the idea and I think it's been too long, but I'm not convinced I should switch my site over to an optimized version using one of these new tld's just yet. I think the average user, especially in America, sees something wrong with non .com's. Whenever I see a .net I always wonder why they don't have the .com. Also, I can just see myself getting "Is this a website" questions for a while if I start printing this on my business card and things.  What are the general advantages and disadvantages of using these generic tld's? If they are currently not a good idea, when will they be, if ever? What will it take to convince the populace that .com is not the gold standard in domain names anymore?  In my specific scenario, my company name is DigiVision Media. Our current website is . Recently, I've purchased  and . My current thoughts are that the main site can be moved to digivision.media and I can use digi.vision as a link shortener. What are the advantages and disadvantages of using these specific tld's for my circumstances?


This is a question of my exam. What would a person experienced if he were put in any point inside the Earth that is hollow (all its mass is concentrated in the surface). Finding the gravitational field intensity, it turns out to be 0. I interpret it as if the person didn't experience any acceleration; as a result, He should stand still there where he was put in.   That's what I get to conclude. But, what do you think?

It is quite easy to derive the gravitational field intensity at a point within a hollow sphere. However, the result is quite surprising. The field intensity at any point within a hollow sphere is zero.   What exactly is the reason behind this? Except for, of course, the mathematics behind it. Is there any logic why the field intensity should be zero within a sphere? For example, it is logical to say that the field intensity would be zero at the center, as all the intensities cancel out. However, this cannot be the case for any point within the sphere.


I am currently trying to understand the JS prototype chain mechanism.   I have tried the following:   TestObject = function(){   this.sayHello();   this.sayGoodbye(); };  TestObject.prototype = {   sayHello:function(){     alert("Hi thereee");   } };  TestObject.prototype.prototype = {   sayGoodbye:function(){     alert("See yaaaaa");   } };   When I add   <script>var test = new TestObject();</script>   to my index.php, the following happens:   First, a window pops up, saying "Hi thereee", which is what I'd expect to happen. But then, the console tells me that the application crashed because 'sayGoodbye' is not a member of the test object.   So, my questtion is: what is happening here and how can I make actual prototype chains that are longer than just one single step?   Thanks a lot to everyone in advance.

I'm not that into dynamic programming languages but I've written my fair share of JavaScript code. I never really got my head around this prototype-based programming, does any one know how this works? var obj = new Object(); obj.prototype.test = function() { alert('Hello?'); }; var obj2 = new obj(); obj2.test();  I remember a lot discussion I had with people a while back (I'm not exactly sure what I'm doing) but as I understand it, there's no concept of a class. It's just an object, and instances of those objects are clones of the original, right? But what is the exact purpose of this ".prototype" property in JavaScript? How does it relate to instantiating objects? Update: correct way var obj = new Object(); // not a functional object obj.prototype.test = function() { alert('Hello?'); }; // this is wrong!  function MyObject() {} // a first class functional object MyObject.prototype.test = function() { alert('OK'); } // OK  Also these  really helped a lot.


I am trying to add a menu item which is supposed to be a separator which has a height set and divides items in the menu. I haven't managed to create a menu item which isn't a link.  add_action( 'admin_menu', 'add_admin_menu_separator' ); function add_admin_menu_separator() {     add_menu_page( '', '', 'read', 'test', '', 'none', '10000000' ); }   Doing this creates a menu item without any text or icon, but it is still a link to /test. Using # won't work either because I don't want it clickable at all.  Is there any workaround for this?  Thank you!

Does anyone know how to add an admin menu separator? I found  but it did not help.   Any ideas?


How do I find combos of a list of lists of lists? Here is an example below.  My list of lists of lists (where the 1st sublist can contain a single list or multiple lists):   [[5,6],[[2,4],[5,7]],[1,8],[[-1,-2],[1,0]]]   This what I want to get:  [5,6],[2,4],[1,8],[-1,-2]     [5,6],[2,4],[1,8],[1,0] [5,6],[5,7],[1,8],[-1,-2] [5,6],[5,7],[1,8],[1,0]   Basically looking for the combos for that 2nd level list. I believe it's possible using the itertools lib but unsure how to use it.

How can I get the Cartesian product (every possible combination of values) from a group of lists?  Input:   somelists = [    [1, 2, 3],    ['a', 'b'],    [4, 5] ]   Desired output:  [(1, 'a', 4), (1, 'a', 5), (1, 'b', 4), (1, 'b', 5), (2, 'a', 4), (2, 'a', 5) ...]


How can you see featured questions, i.e., questions with bounties, in the Stack Overflow Android app?

Can the Featured posts section be added to the Android app?  I think it would be a good option to make it available.


I'm brute forcing a ciphertext with a given dictionary to figure out which key was used. However, it's been hinted at that there is a way to narrow down the dictionary to a smaller subset of possibilities.  I know the plaintext, its ciphertext, and the IV (0). It was encrypted using AES-128-CBC and no salting was used during encryption.  At first I thought I was onto something because of: $C_j = E_k(P_j \oplus IV)=E_k(P_j)$ for IV = 0. But I was dead in my tracks right after. Is this situation even plausible or am I barking up the wrong tree?

If I have the plain text and its output after encryption with a key K1, is it algorithmically feasible to find K1?  I am specifically interested in the cases of DES and AES encryption algorithms.


I have a table that I want to insert on a page, but at least one (perhaps both) of the following conditions are met:   The table is too wide to fit within the text block or page. That is, I'm exceeding some horizontal restriction. The table is too tall to fit within the text block or page. That is, I'm exceeding some vertical restriction.   What are my options to make this table fit? If it doesn't fit, regardless of my attempts, what other options exist?


I'm very new to jquery and javascript, and I'm hoping anyone can help me find out how to count number of rows that has all their checkboxes checked.   I have a checkbox form with dynamic amount of rows and 3 checkboxes on each row. What I want to find out is how many rows that has all the 3 checkboxes checked. All the rows has id tr0, tr1, tr2 ...   This is what I have so far, it checks the first row (tr0) in my form and alerts "1" if all the boxes are checked in that row after you submit your table. When testing I have 3 tr rows + 1 header.   $(function howManyAreChecked() {   var checkedBoxes = 0;   //when the submit button under the table is clicked   $("#tabellSubmit").click(function howMany() {     var rowCount = $('#qaTabell tr').length;      //checks if row tr0 has all the boxes checked     if($("#qaTabell #tr0 input:checked").length > 2)        checkedBoxes = checkedBoxes +1;    alert(checkedBoxes);   checkedBoxes = 0;    }); });   What I need to know is how I can change the if-test to check tr0, tr1, tr2, tr3... up to tr(number of rows in the table) instead of only tr0.  Thanks in advance!

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


I wanna preventDefault a dynamically added link that is not getting recognized by the on() method. However, the static link which was already on the page preventDefault()'s itself with the same function. <!DOCTYPE html>       <title>         Testing Phase     </title>         <input type="text" id="txt" name=""> <input type="button" id="btn" name="" value="Add">
     This static link works with the on() method!


I would like to be able to dual boot on windows 10 and Ubuntu 14. First, I tried to install windows 10 after Ubuntu 14. I was not able to dual boot after that. I know that this is not the best way in this order. Here is what I tried to repair grub:  https:// help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows https:// sites.google.com/site/easylinuxtipsproject/6  Anything worked. I send the URL of the result of bootRepair to boot.repair@gmail.com but their service has stopped. Then, I have removed both OS and reinstalled windows, first, and then Ubuntu to get the dual boot. During Ubuntu installation I checked that I wanted grub as boot loader to be able to choose which partition I wanted to use each time my PC starts. But it didn't work either. Does anyone had the same issue? Any workaround? EDIT  is the bootRepair report for more details ============================= Boot Info Summary: ===============================   => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector      1028794648 of the same hard drive for core.img. core.img is at this      location and looks for (,gpt6)/boot/grub on this drive.  => Syslinux MBR (3.00-3.35) is installed in the MBR of /dev/sdb.

I installed Windows 7, which ate Ubuntu's boot file. When starting up the computer, it now goes straight to Windows, without giving me the option of booting Ubuntu.   How can I get Ubuntu back?


The idea of degrees of freedom is pretty well sunk into my head, but I was wondering could someone perhaps give me few easy examples on how one would determine the number of degrees of freedom?   For example: Lets say that we have a sample of $n$ observations $x_1, x_2, ..., x_n$ following some distribution.  Could someone come up artificial examples of different number of degrees of freedom with this sample, say: examples where degrees of freedom are:  $$\text{degrees of freedom} = n$$ $$\text{degrees of freedom} = n-1$$ $$\text{degrees of freedom} = n-2$$ $$\text{degrees of freedom} = n-3$$  This would help get a grasp on, how one would determine the actual number of degrees of freedom. Thank you! :)

From , there are three interpretations of the degrees of freedom of a statistic:     In statistics, the number of degrees of freedom is the number of   values in the final calculation of a statistic that are free to vary.      Estimates of statistical parameters can be based upon different   amounts of information or data. The number of independent pieces of   information that go into the estimate of a parameter is called the   degrees of freedom (df). In general, the degrees of freedom of an   estimate of a parameter is equal to the number of independent scores   that go into the estimate minus the number of parameters used as   intermediate steps in the estimation of the parameter itself (which,   in sample variance, is one, since the sample mean is the only   intermediate step).      Mathematically, degrees of freedom is the dimension of the domain of a   random vector, or essentially the number of 'free' components: how   many components need to be known before the vector is fully   determined.   The bold words are what I don't quite understand. If possible, some mathematical formulations will help clarify the concept.  Also do the three interpretations agree with each other?


Consider a random variable $X$ with continuous probability density $f(x)$ and compact support, say $[a,b]$ with $a<b$. Moreover, let $f(x)$ vanish at the boundary, i.e.  $f(a) = f(b) = 0$.  Question:  What is the maximum variance which such a random variable can take?  EDIT:   It should have been mentioned here, that this problem is already solved in literature for probability densities without any further restrictions and the solution is given by a disrete (non-continuous) probability with weight 1/2 at the boundary. See comments and the "duplicate-link". However, I'm asking for a continuous probability density instead, which is zero at the boundary.   With these two additionnal conditions, the question is completely different. Maybe, a solution does not exist. Then, maybe there is a sequence of continuous probability densities $f_n(x)$, $n=1,2,3...$, whose limes has maximum variance. But I don't know how to construct such a sequence which gets peaked at the boundary.

Is there a upper bound on the variance for a distribution that is confined say, in $[0,1]$, and has fixed mean $\mu \in [0, 1]$


Moderators have access to a user's profile/history to look at things necessary to perform our role - one of those is reviewing stuff. The system currently now only records on a user's profile if they were banned from review - but not if they failed audits.  We can work it out of course - but it's a lot of clicking through and combining stuff from other screens together.  Can we add to a user's profile "failed audit"?

We often get questions here on Meta or through other channels about why a particular user was banned from review by the system. Additionally, we frequently want to look into a user's review history when we see approved spam or other bad reviews in order to see if there's a larger problem with this user.  However, it's not all that easy for moderators to get a comprehensive view of a user's review history right now. We can look in their recent review activity within their profile, but that hides reviews on deleted posts (like spam or non-answers) and some types of audits. Failed audits aren't identified or listed anywhere. Moderators do get access to more detailed statistics on review, and can eventually look at each user's reviews within a given queue, but this is a laborious process. I usually have to construct a URL by hand to look at a particular user's reviews.  It would be really helpful for moderators to have quick access from a user's profile to a list of all of their recent reviews (including deleted posts), in the style of what we get from the review statistics view. Additionally, a list of audits with pass / fail status () would save a tremendous amount of time when researching this for a given user, instead of having to click through every single review to see if it was an audit.


Let $R$ a ring (with $1\in R$). I want to show that $R$ is a field $\iff$ it has exactly two ideals.    For $\implies $ it's obvious. Indeed, if $R$ is a field and $I\neq \{0\}$ an ideal, then, $I=A$ since $$x\in I\implies xx^{-1}\in I$$ and thus $1\in I$. In particular, if $x\in A$, then $x\cdot 1\in I$ and thus $x\in I$.   For the converse I don't really know how to do. My idea was the following one:  I show that if $R$ is not a field then it has more that two ideals. Indeed, let $R$ be not a field. Then, there is $x\in R$ that has no inverse. In particular, $(x)\notin \{R,\{0\}\}$. Indeed, if $(x)=(0)$ then $x=0$ which is a contradiction. If $(x)=R$, then $1\in (x)$ and thus there is $n$ s.t. $x^n=1$ what prove that $x$ is invertible and is also a contradiction.   Is it correct ? Is there a more direct proof ? i.e. like this:  Let $A$ and $\{0\}$ the two ideal of $R$. How can I show that all element of $A\backslash \{0\}$ are invertible ? By contradiction, if not, the $$xy\neq 1$$ for all $y\in R$. Therefore, $(x)$ doesn't contain $1$, and thus, $R$ has at least three ideal, which is a contradiction.  Is it correct ?

Let $R$ be a commutative ring with identity. Show that $R$ is a field if and only if the only ideals of $R$ are $R$ itself and the zero ideal $(0)$.  I can't figure out where to start other that I need to prove some biconditional statement. Any help?


I want hostile mobs to attack each other using commands. I know something like entity.setTarget will work, but I don't know where to put it (Where in the summon command).

I want to make an arena where mobs will fight each other and a player can bet on one side or the other. For example: There are 2 skeletons in dyed armor; red and blue. Each color representing a team. When they spawn I want them to fight each and then when one dies I want it to announce which team is the winner and give the player the "money" due. I'm just not sure how to get the skeletons to attack each other without a player instigating it.


Is there a phrase for situation where animal is suffering, and then someone kills it because that person don't want that animal to suffer anymore

"Mercy killing" is an act of killing someone who is already dying and in terrible pain, in order to reduce his or her suffering.    Is there any single word for "mercy killing"?


The proof of the Gauss's law for gravity provided by Wikipedia takes use of the divergence theorem.    Is it possible to arrive at the integral form of the Gauss's law in a way which doesn't require the use of divergence?    I'd like to derive it from the Newton's law. The main idea is: Assume that two points masses $m_1,m_2$ act on each other with force $F=\frac{Gm_1m_2}{r^2}$. Do something. Arrive at the integral form of the Gauss's law.   So it doesn't have much in common with the "duplicates"  I had one semester of analysis, so don't know anything about the Delta Dirac function and family

Is there an intuitive explanation why it is plausible that the gravitational force which acts between two point masses is proportional to the inverse square of the distance $r$ between the masses (and not only to the inverse of $r$)?


i have encountered a problem that is i have defined a static member variable inside a class with access specifier being private but whenever a constructor is called corresponding an object the compiler displays an error "undefined reference to MyObject::count" here is my class member variable declaration  class MyObject { private:         static int count;   public:       MyObject()          {            count=0;           }  };

Can anyone explain why following code won't compile? At least on g++ 4.2.4.  And more interesting, why it will compile when I cast MEMBER to int?  #include <vector>  class Foo {   public:       static const int MEMBER = 1;   };  int main(){       vector<int> v;       v.push_back( Foo::MEMBER );       // undefined reference to `Foo::MEMBER'     v.push_back( (int) Foo::MEMBER ); // OK       return 0; }


I have an ArcScene (10.8) document with shapefile layers. I would like to export the 2d view into adobe illustrator for editing, but it appears as a raster. I suppose I could try to vectorize it in Ai, but that seems like a cumbersome workflow. This same layer, when exported from ArcMap, correctly shows up as an editable vector layer in Ai. I see two similar questions from years ago that have not been answered:     Does anyone know if this is possible?

How can I export 2d vector graphic from ArcScene so I can edit it with Adobe Illustrator? I've tried changing the options when I export 2D scene as AI file or PDF file, but they always remain as a unique image that does not allow me to edit the lines and polygons.


Could anyone name the grammar rule that governs how "I would like to know what is your name." should be "I would like to know what your name is." If there isn't really a rule for that, could anyone explain why the verb and the noun should swap places for this type of sentence structure?

We always change subject and verb positions in whenever we want to ask a question such as "What is your name?". But when it comes to statements like the following, which form is correct?        I don't understand what are you talking about.   I don't understand what you are talking about.      Another example        Do you know what time is it?   Do you know what time it is?      Another example        Do you care how do I feel about this?   Do you care how I feel about this?


In Cookie Clicker, there is an upgrade called "One Mind".  Besides giving the usual bonus to something (in this case grandmas), it comes with a red warning: "Note: The grandmothers are growing restless. Do not encourage them."  If you try to purchase it the page pops up a warning:      Warning : purchasing this will have unexpected, and potentially undesirable results!   It's all downhill from here. You have been warned!   Purchase anyway?   With the options to purchase anyway or cancel.  So far, I've always canceled.  What happens if I buy "One Mind"?

There's a strong warning associated with the "One Mind" upgrade that says that "it's all downhill from here". As I'm still interested in playing, should I take this upgrade or wait?  Will appreciate spoiler-free answers if it's at all possible.


I have reached a confusion. We know $$F=-kx$$ in a spring. If an external mass $m$ is suspended to a spring and the spring extends by a length $x$ and the mass comes to rest,   external force, $~mg = \text{restoring force of spring} ~~kx$ ( talking about the magnitude only here)  Again, at the stopping point, work done by external force will me $mgx$ and potential energy gained by spring will be $$\frac{kx^2}2$$ These terms must be equal as the system is in rest  So $$k\frac{x\cdot x}2 = mgx$$ Cancelling out $x$, we get $$\frac{kx}2 = mg$$ These contradicts the original statement that $mg=kx$  Please help me. I am confused.

If a spring is stretched by a weight of mass m, (so the extension is $\Delta x$) then $ k = \frac W{\Delta x} = \frac {mg}{\Delta x}$. So $ k\Delta x= mg $.  When the Spring is stretched by distance $\Delta x$ (by the weight) then it looses gravitational potential enegry. ($ \Delta GPE= mg\Delta x$)  But, when we calculate the change in elastic potential energy, We get  $ U = \frac 12 k(\Delta x)^2 $. Since $ k\Delta x = mg$, $U=\frac 12 mg\Delta x$  At, equilibrium we have no kinetic energy $E_k = 0$  Doesn't that violate Energy Conservation?  Where does the rest of lost GPE goes?  Here's a illustration


I'm a single mother of 2. My daughter is 13 and my son is 7. My son's father shot himself 2 years ago. That's when things started to change. When his dad was alive, my son never wanted to go to his house. He would scream and cry and latch on to me. So I would keep him with me. I know his dad watched a lot of porn. And I'm wondering if he saw it.  At first I thought, "They're kids, and kids experiment." (I know I did when I was little.) In the past 2 years my niece and my son have been caught together more than a few times, and each time I would talk to them about it.   My son has been caught with his pants down and my 5-year-old niece sucking his penis. I instantly told them to stop. I explained that kids don't do stuff like that. I told them it was disgusting and they should never touch each other again. I talked to my niece about it and she said he told her to do it. It happened a couple other times except it got worse. He tried to stick his penis in her vagina. They are no longer allowed to be around each other. And my son isn't going to be around any other kids until I find out what is going on.   I'm just not sure why this is happening. I'm so scared he's going to be a bad person. I want to help him. When I talk to him about it he says, "I don't know, mom," and then changes the subject.  How can I help my child?

I am a 20 year old female student and I have a 5 year old son who is really sexually active. For instance, he kisses girls by force, he forces them to lick his penis, he "fingers" them, he speaks about sex openly with everyone except me, his father and my family.  There is a whole lot more that he does and the most frustrating part is that when teachers ask him where he saw those things, he says he learned it from me.  We do not even live together.  Currently I am in Cape Town doing my degree and he is in KZN with my mother.  Since he was 8 months old, he went to live with his father because I had to finish high school.  We never lived together. We have tried talking to him and it hasn't helped.  We've punished him but still he keeps on getting worse. What should I do?  I am really angry, embarrassed and confused. If I am not mistaken, this is his third year acting like this.


Let f:[0,1]->$\mathbb{R}$ be defined by f(x)=0 when x is irrational and f(x)=1/q when x=p/q with gcd(p,q)=1. Prove that f is integrable on [0,1]. What is $\int_{0}^{1}$f(x) dx? I only have knowledge of Riemann integrability conditions and results.The integral is obviously 0 i think but i really don't know how to do this. Any help would be appreciated!

Let $\displaystyle f: [0,1] \rightarrow \mathbb{R}$ given by   $$f(x) = \begin{cases} 0 & x \notin \mathbb{Q} \\ \\ 0 & x = 0 \\ \\ \frac{1}{q_x} & x = \frac{p_x}{q_x} \in \mathbb{Q} \backslash \{0\}, \ p_x \in \mathbb{Z}, \  q_x \in \mathbb{N}, \ \text{gcd}(|p_x|, q_x) = 1 \end{cases}$$  Is $\displaystyle f$ Riemann integrable?  I am trying to use the equivalent statements $\displaystyle g:[a,b] \rightarrow \mathbb{R}$ is Riemann integrable and $\displaystyle \forall \epsilon >0 \ \exists$ step functions $\displaystyle \rho, \psi$ with $\displaystyle \rho \leq g \leq \psi$ such that $\displaystyle \int_a^b (\psi - \rho) \leq \epsilon$.  I guess that means I would have to somehow show that given $\displaystyle \epsilon$, there exists only a finite amount of $\displaystyle x \in [0,1]$ with $\displaystyle f(x) \geq \epsilon$?   Is it recommended that I consider something else instead? If not, how should I do this?


I have a little issue with my ASUS UX31A. I just tried to do a clean install of Windows 7 64bit using a USB-Stick created using Rufus.  The laptop booted from the USB stick and opened the Windows installation, after a few clicks I got the message "A required CD/DVD drive device driver is missing. If you have a driver floppy disk, CD, DVD, or USB flash drive, please insert it now.".  I have tried literally every suggested trick (putting USB3 drivers on the stick, switching USB ports after error message...) but nothing works.  I have no idea how to proceed and would be happy for any helpful suggestions.

I have an Asus R500VD laptop which came with the preinstalled Windows 8. As actually this computer will be used by my grandmother (and she's only using win 7) I'd like to downgrade it.  Thanks to other thread here, I was able to successfully boot computer from Windows 7 USB stick, but unfortunately during install I got a message:  A required CD/DVD drive device driver is missing. (...)   and I can't get pass it... This is what I've done:   I've downloaded all drivers from Asus Website (), unzip and copied to visible location for windows 7 installation - I've picked each one of them, none has helped. As I belive it's some kind of problem with SATA/RAID/AHCI drivers I went to Intel site and downloaded various "Intel Rapid Storage Technology" drivers - a lot of them were recognized by win7, but none of them helped.   Does anyone have an idea what can I do next? Any help would be really appreciated.


If I want to write code that optionally uses a module how can I do it? For example, if I want to write code that warns Dumping an object if Data::Dumper is available or otherwise just warns, how can I do that?

I have Perl code which relies on Term::ReadKey to get the terminal width. My installation is missing this module, so I want to provide a default if the module isn't present rather than throw an exception. How can I conditionally use an optional module, without knowing ahead of time whether it is available. # but only if the module is installed and exists use Term::ReadKey; ...  How can I accomplish this?


If you copy and paste some code and accidentally forget to remove sensitive info, is there a way to get rid of that information, so even the revision history doesn't contain it?

I've observed several incidents where users inadvertently posted detailed, sensitive information. For example, a Server Fault user who posted a question with working login credentials to his actual production server, or the Stack Overflow user who posted actual medical records as example data for his question.   What should be the procedure for handling such cases?


I am an Indian Citizen applying for a UK visitor visa from the USA for myself and my family. Do I need to ship each application separately or can I send all of them together? Thanks for the help.

I am a permanent resident of USA. I am making a trip to India but planning a stop-over in London,UK for a week. For this stop-over , I am applying for a standard visitor visa. My biometric appointment has already been completed. Now I have to send applications for the visa for both me and my wife.  1.) Should I send both applications in same envelope? Maybe, put each application in small envelope and then put both applications in a bigger envelope?  2.) Should I put my financial documents (Bank statements , Pay Slips) in both applications(i.e. mine and my wife's)?  3.) I have an old passport which is expired. Is there any need to send this passport as well with my application?  Thanks!


I need to know the exact meaning of . I AM confused what it actually means.They say all types of energy comes under 2 types kinetic and potential so what is potential energy then?  My question ask for defination

I have a problematic question for which I have been unable to attain a satisfactory answer. What is  truly?   -  I have read about how potential energy can be seen as the "highering" of an object within a field, be it gravitational, electromagnetic, etc.   In a way, an object is lifted to a higher position, and when it eventually falls down again energy is released back.  The object does not even have to be "lifted" beforehand, as with the case of asteroids.   However, since energy cannot be destroyed, it must somehow be stored, yet how does energy truly store itself within a field? It seems hard for me to grasp that energy can physically be stored within the positioning of an object?  I can't really get my head around how a field conserves energy within it. Kinetic energy on the other hand, can be, for me, intuitively understood, as the object really is "moving" and energy manifests itself through motion.  Can anyone elaborate on this, perhaps give reasoning as to why a field can in fact "store" energy? Please point out any fallacious or naive views I seem to hold.


I'm tying to get expected rendering results from many days but not able to get it as seen in image. I have attached image of expected results.

Brand new to blender, and I'm trying to make a metallic object that is reflective.  There are lots of tutorials on youtube, however none of them are compatible with blender 2.71 with the cycles render.   Here are the tutorials I have tried:        All of these tutorials have a 'transparency' and a 'mirror' option in the outliner menu that I just don't seem to have.   How can I make this object reflective? Am I missing plugins or some other menu?


My Galaxy S3 just started notifying me of voicemails by stating out loud that I had a new voicemail. In addition, the alarm now states the time out loud as it plays the normal alarm music.   I have checked and the Driving Mode is turned OFF and the alarm is set for melody.  I receive no voice alerts for new emails, texts or incoming calls.  Please advise.

I use the native Clock app, and my alarm used to just have a normal ringtone. I assume there was some automatic update recently because this morning, in addition to the normal ringtone, there was a robotic voice saying "It is 7:25 AM." Then later I got a notification from the native Calendar app, and in addition to my normal ringtone, the robotic voice announced the text of the notification.  How do I shut this off? It's really annoying and I don't see an option in Settings.


What's more correct "is my hair" or "are my hair" when I'm referring to all my head hair? ("do my hair look bad" or "does my hair look bad" for example)   Thank you

When one says I was washing my hair, is it singular or plural? What is the singular for hair?


According to the De Broglie hypothesis, wavelength equals to h/mv(m-mass, v-velocity, h-Planck constant), so by moving at a slow speed, that is reducing the v(velocity factor) can human beings with such high masses(m) have a wavelength that is long enough to interfere?

Many introductory quantum mechanics textbooks include simple exercises on computing the de Broglie wavelength of macroscopic objects, often contrasting the results with that of a proton, etc.  For instance, this example, taken from a textbook:     Calculate the de Broglie wavelength for      (a) a proton of kinetic energy 70 MeV      (b) a 100 g bullet moving at 900 m/s   The pedagogical motivation behind these questions is obvious: when the de Broglie wavelength is small compared to the size of an object, the wave behaviour of the object is undetectable.  But what is the validity of the actual approach of applying the formula naively? Of course, a 100g bullet is not a fundamental object of 100g but a lattice of some $10^{23}$ atoms bound by the electromagnetic force. But is the naive answer close to the actual one (i.e. within an order of magnitude or two)? How does one even calculate the de Broglie wavelength for a many body system accurately?


On my Macbook Air A1466 the shift key seems to be constantly pressed, even during boot so it only boots into safe mode because of this.  The issue exists both before and after replacing the keyboard with a brand new one!  This is what I've tried:   Reinstalled MacOS Replaced the whole keyboard (painful process) Reset NVRAM (alt + cmd + p + r) during startup Hooked up an external keyboard (this one works fine, but shift is still held down) Tried Keyremapper:  which helps WITHIN the OS, but not during boot    Any ideas?  PS: This is not a duplicate of . There it's simply a keyboard hardware issue, which is not the case here since the keyboard has been replaced.

This is an attempt to write a canonical QA for this issue, as per the Meta post:   I expect it to be periodically edited with the goal of becoming a comprehensive information resource.  I have a MacBook Pro that has a key(Shift, Return,   Command, P, etc.) that doesn’t respond when pressed or is stuck in the down position.    It's possible that my favorite beverage was spilled (or some other liquid damage).  It's also possible that I have no idea what happened.  It was working yesterday and suddenly today it's no longer working.  Is there any way to bypass or remap the key?  Can I  have the system ignore it completely?  (This question can also apply to external USB keyboards or the Bluetooth keyboards)


Let $p$ be prime. Prove if $p|(a^p - b^p)$, then $p^2 | (a^p - b^p)$  don't know where to begin, any help appreciated

$a$ and $b$ are natural numbers and $p$ is a prime number. Prove that if $a^{p}-b^{p}$ is divisible by $p$, then it is also divisible by $p^{2}$.  My attempt: Based on Fermat's theorem $(a^{p}-a)$ and $(b^{p}-b)$ are divisible by p, therefore their difference is divisible by $p$. I.e. $(a^{p}-a)-(b^{p}-b)=(a^{p}-b^{p})-(a-b)$ is divisible by $p$. Since the left hand side of this equation is divisible by $p$, the right hand side also should be divisible by $p$. Based on the problem's assumption $(a^{p}-b^{p})$ is divisible by $p$ therefore we conclude $(a-b)$ must be divisible by $p$. Now We can factorize $(a^{p}-b^{p})$ $$(a^{p}-b^{p})=(a-b)(a^{p-1}+a^{p-2}b+....+b^{p-1})$$ we have to prove $(a^{p}-b^{p})$ is multiple of $p^2$ which means we have to show the right hand side should be multiple of $p^{2}$. But $(a-b)$ is multiple of p therefore we have to show  $(a^{p-1}+a^{p-2}b+\cdots+b^{p-1})$ is multiple of $p$ and I am stuck here. Any help would be appreciated.


So, I'm having problems with my code. I'm simply trying to run an example code to see how it works (I'm a newbie at C++) and this error is appearing everytime I call the List class.  Here's the code:  //main.cpp #include <iostream> #include "List.h" using namespace std;  int main() {     List<char> list;     // 5 types created using a 'for' loop      // and calling the ‘add’ function      for (int i = 101; i <= 105; i++)     {         list.add(char(i));     }     list.display();     // should output a, b, c, d, e      // in this example.     cout << endl;     return 0; }   And here's the List class  //List.h #pragma once #include "Link.h"  template <class F> class List { private:     Link<F>* head; public:     List();     int add(F theData);     void display(); };   and I'll also put List.cpp to help:  //List.cpp #include "List.h"  template<typename F> List<F>::List() {     // 'head' points to 0 initially and when the list is empty.       // Otherwise 'head' points to most recently      // added object head     head = 0; } template<typename F> void List<F>::display() {     Link<F>* temp;// 'temp' used to iterate through the list                   // 'head' points to last object added                   // Iterate back through list until last pointer (which is 0)     for (temp = head; temp != 0; temp = temp->Next)     {         cout << "Value of type is " << temp->X << endl;     } }  template<typename F> int List<F>::add(F theData) {     // pointer 'temp' used to instantiate objects to add to list      Link<F>* temp;      // memory allocated and the object is given a value     temp = new Link<F>(theData);     if (temp == 0) // check new succeeded     {         return 0;  // shows error in memory allocation     }     // the pointer in the object is set to whatever 'head' is pointing to     temp->Next = head;     // 'head' is re-directed to point to the last created object     head = temp;     return 1; }   When I run, It gives me these errors:    PS. I'm using VS2017 btw.  Thank you

I have some template code that I would prefer to have stored in a CPP file instead of inline in the header.  I know this can be done as long as you know which template types will be used.  For example:  .h file  class foo { public:     template <typename T>     void do(const T& t); };   .cpp file  template <typename T> void foo::do(const T& t) {     // Do something with t }  template void foo::do<int>(const int&); template void foo::do<std::string>(const std::string&);   Note the last two lines - the foo::do template function is only used with ints and std::strings, so those definitions mean the app will link.  My question is - is this a nasty hack or will this work with other compilers/linkers? I am only using this code with VS2008 at the moment but will be wanting to port to other environments.


Question:  If      A + B = 54   and  `AB = 629`,  find A and B   I am not sure how to approach this problem since the question itself does not give much clue.

Which two numbers when added together yield $16$, and when multiplied together yield $55$.   I know the $x$ and $y$ are $5$ and $11$ but I wanted to see if I could algebraically solve it, and found I couldn't.   In $x+y=16$, I know $x=16/y$ but when I plug it back in I get something like $16/y + y = 16$, then I multiply the left side by $16$ to get $2y=256$ and then ultimately $y=128$. Am I doing something wrong?


I've got a text mesh but i'm trying to make it so that it's not filled but instead is just an outline of text is there anyway to do this? This is the effect i'm trying to achieve:

How would one add outline to a text object? Do text objects even have outline support?   Should I instead create the text in GIMP or a similar program and import them in blender to replace the text objects?


in my program I have 2 headers (IP and MAC headers) that are 'sons' of GeneralHeader. All General, IP and MAC headers classes have PrintMe() function. In addition, I have a Packet class that holds list of GeneralHeaders (the list actually may have IP or MAC headers: (without IP defenition, to shorten):  //Packet.h      class GeneralHeader {     public:         bool Valid;         HeaderType_t HeaderType; // MAC or IP         virtual void PrintMe();     };      class HW_MACHeader: public GeneralHeader {     public:         long unsigned DestAddr:48;         long unsigned SourceAddr:48;         virtual void PrintMe();     };      struct NetworkPacket_t {         NetworkPacket_t();         list<GeneralHeader> Headers;//TODO GeneralHeader         void PrintMe();     };   I have dificulty to implement the PrintMe() method that will print the list of GeneralHeaders using the appropriate for MAC or IP PrintMe() method (not the base PrintMe() of GeneralHeader):  //Packet.cpp  //This implementation prints GeneralHeaders :( //(although MAC headers were added to the Headers list)  void NetworkPacket_t::PrintMe() {     list<GeneralHeader>::iterator it_H;     for (it_H = Headers.begin(); it_H != Headers.end(); ++it_H) {         it_H->PrintMe();     }; };   Another try was to cast the iterator it_H to appropriate MAC or IP header (according to HeaderType), but whichever way i tried to cast it, it did not work, e.g.:  //Packet.cpp //Casting implementation //Here I get run error:  //terminate called after throwing an instance of 'std::bad_cast'  void NetworkPacket_t::PrintMe() {     list<GeneralHeader>::iterator it_H;     for (it_H = Headers.begin(); it_H != Headers.end(); ++it_H) {         switch (it_H->HeaderType) {         case General_Header_type:             std::cout << " General Header " << endl;             it_H->PrintMe();             break;         case MAC_Header_type:             dynamic_cast<HW_MACHeader&>(*it_H).PrintMe();             break;         default:             std::cout << " default" << endl;         };     }; };   I really appreciate any help you can prvide

Someone mentioned it in the IRC as the slicing problem.


In a few weeks I'll travel from Europe to USA. I'll stay there for some months and in my fisrt period there I'll need a large ammount of money for living there (let's say 2000-3000$). So my question is: which one is the best way (trade-off between cheapness and security) to have money there? (Assuming that I'll open an account as soon I'll arrive there.)   Bring cash and deposit them in the American bank when I will arrive? Make a money transfer from my country back to the American one?

Recently my wife and I traveled to Italy and before we left we got about 85% of our money in travelers checks and the other 15% we carried on in cash. When we arrived there, no one would take our travelers checks and many places did not accept credit cards. Eventually, we found some currency exchange places that would take the travelers checks and give us Euro's, but at a 7-15% fee, which was not really a very fun surprise.   While I was under the impression that it is safer to use travelers checks, it seems that they were not really accepted (the usual explanation being fraud). So the question is, is it best to just exchange your currency at home and carry all of it with you when you travel or are there other alternatives to carrying cash that are safer and cost effective?


Let $A$ and $B$ be two finite sets with $\vert A \vert = \vert B \vert$ and $f$ be a function from $A$ to $B$. show that if $f$ is an injective (one-to-one) function then it is also a surjective function.  Answer: i don't know if this assumption right or wrong   By contradiction that function $f$ one to one $\Rightarrow$ onto we assume that $f$ is not onto function $\forall a \in A∶f(a)\neq b$  $\vert A\vert=\vert B\vert$,then there exist two different elements in $A$ such that have same image  one to one function then for  $\exists x \in A ,\exists y \in B ,f(x)=f(y)\land (x\neq y)$.  However Since $f$ is one to one function,$f(x)=f(y)$  implies $x=y$ $\exists x \in A ,\exists y\in B ,f(x)=f(y)\land (x\neq y)$.  by negation law we obtain that last statement is F(false)and we obtain contradiction thus $f$ is onto since it's one to one.

Suppose $X$ is a set and $f : X \to X$ is a function.  If $X$ is a finite set, prove that $f$ is injective if and only if $f$ is surjective. Show that when $X$ is an infinite set, the statement is not true in general.   For that, let $X = \mathbb{R}$ and find a function $f: \mathbb{R} \to \mathbb{R}$ which is injective but not surjective, and a function $g: \mathbb{R} \to \mathbb{R}$ which is surjective but not injective  My attempt at the first part   Suppose that the function is surjective but not injective. Let $a,b \in X$ such that $f(a)=f(b)$ but $a \not =b$. Now since this is a finite set mapping to itself then there are not enough elements in $X$ to map to $X$ since two elements were used to map to one element, thus the function can't be surjective. Therefore if the function is surjective it is also injective.   Now suppose that the function is injective but not surjective. Let $a \in X$ such that $f(b)\not =a$ for all $b \in X$. Since the function was assusmed to be injective each $a \in X$ must map to an element of $X$, thus must have two elemetns in $X$ mapping to the same element in $X$. Hence the function can't be injective, therefore if the function is injective it must be surjective.   Would an exponetial function work for injective but not surjective since can't map to negative numbers. And an example of a function that is surjective but not injective could be a log function since none of the negative numbers get mapped to anything?   Also I'm having trouble seeing why it has to be finite for the first part to work. I understand it has something to do with the pigeonhole principle but its not that clear to me.


Sorry im new to java, may i know how can i add extra time in here?   SimpleDateFormat timestampFormat    = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");  String currTimestamp  = timestampFormat.format(new Date()); System.err.println("currTimestamp=="+currTimestamp); //  2014/10/17 14:31:33

I'm working with a date in this format: yyyy-mm-dd.  How can I increment this date by one day?


Prove the triangle inequality |z+w|≤|z|+|w| where z,w ∈C by an invoice. When does equality hold? Interpret the triangle geometrically.  By definition for a complex number z=x+yi z=x+yi ,  |z|2=x2+y2=Re(z)2+Im(z)2 |z|2=x2+y2=Re(z)2+Im(z)2  From here,  |z|2≥Re(z)2and|z|2≥Im(z)2 |z|2≥Re(z)2and|z|2≥Im(z)2  And, finally,  |z|≥|Re(z)|and|z|≥|Im(z)| |z|≥|Re(z)|and|z|≥|Im(z)|  b)|z+w|2=(z+w)⋅(z+w)′ |z+w|2=(z+w)·(z+w)′  =(z+w)⋅[z′+w′] =(z+w)·[z′+w′]  =zz′+[zw′+z′w]+ww′ =zz′+[zw′+z′w]+ww′  =|z|2+2Re[zw′]+|w|2 =|z|2+2Re[zw′]+|w|2  ≤|z|2+2|zw′|+|w|2 ≤|z|2+2|zw′|+|w|2  =|z|2+2|z||w|+|w|2 =|z|2+2|z||w|+|w|2  =(|z|+|w|)2 =(|z|+|w|)2 .  c) Since both |z+w| |z+w|  and |z|+|w| |z|+|w|  are non-negative,  |z+w|≤|z|+|w| |z+w|≤|z|+|w|  What is next?

I was wondering how to prove the triangle inequality with complex numbers:  Verify that the function $d(z_1, z_2)$ is a distance funtion on $\mathbb{C}$ and also on any subdomain on $\mathbb{C}$.  I finished all but the inequality, which is what I need assistance with. I don't know how to prove the distance function inequality:  $d(z_1, z_3) \le d(z_1, z_2) + d(z_2, z_3) $


I'm trying to implement a Baudot character encoding.  Right now, I'm using 2 dictionaries which are simply mirrors of each other:  Dictionary<char, int> Lookup = new Dictionary<char, int> {     { ' ', 0x100100 },     { '-', 0x011000 },     { '/', 0x010111 },     { '0', 0x001101 },     { '1', 0x011101 },     ... };  Dictionary<int, char> Reverse = new Dictionary<int, char> {     { 0x100100, ' ' },     { 0x011000, '-' },     { 0x010111, '/' },     { 0x001101, '0' },     { 0x011101, '1' },     ... };   Is there a built in type that handles this already?  Something like:  var lookup = new Lookup<int, char>(); lookup.GetByKey(0x100100); lookup.GetByValue('c');   I couldn't find anything when I searched for 'reverse lookup' or 'lookup table', everything seemed to be related to DNS or LinqToSql.  (I'm using  because it's necessary for some  devices)

I am looking for a generic, bidirectional 1 to 1 Dictionary class in C# (2), ie. a BiDictionaryOneToOne<T, S> which is guaranteed to only contain one of each value and key (up to RefEquals anyway), and which can be searched using either key or value. Anyone know of one, or should I just implement it myself? I can't believe that I'm the first person to need this...  There is a BiDictionary in the answers to , but it is not for unique elements (and also does not implement RemoveByFirst(T t) or RemoveBySecond(S s)).   Thanks!


When an electron is excited to higher energy levels, it will jump back to the same level from which it was excited. Why does it develop "sentiment" with that level?

When an electron absorbs energy and jumps to the another excited state by absorbing the photon and why it is always said that the electron will come back to $\hbar\omega/2$?  Why doesn't the electron sit in the excited state ?   What is the actual reason for it to come back to ground state?


Which is correct? The Gardening Club holds its event on Monday or The Gardening Club holds their even on Monday?

I'd say Microsoft have a way of bending the rules and I know that McLaren have won the championship. While this sounds strange, I believe it is correct English (sorry, I'm not native).   But when it's a small company, would you still use it this way? Is a company always plural, or are small companies singular? I.e., would you say Bakery Johnson makes fine bread or Bakery Johnson make fine bread? Is it My book seller, Woody's, have moved or is it has moved?


Formatting tags with [tag:] does not work if the tag contains .  For example:   [tag:git] →  [tag:git*] → [tag:git*]

On the main site, you can (for example) ignore tags using this notation [tag:foo*], which will ignore stuff tagged as  but also .  The nice markdown highlighter for tags seems to have a problem with asterisks, though -- as you can see in this post.  I would have expected them to be highlighted the same way as they are on the front page.


I would like to restart two games, bubble safari and bubbleseason, from the beginning. When I delete the app and reinstall it from the App Store all my old data is on there and I start from the same level I left it at, I want to start all over from scratch.  Is this possible?

I have one particular game that saves data through the game center. Somehow the saved game data got messed up which causes the game not to work properly when I a connected to the internet (I.e. When the game center is accessible).   Is there some way to delete all the data belonging to that game only?


I graduated with a B.S. in "Computer & Information Sciences" from a small, insignificant liberal arts school. My overall CGPA was 3.86 and my major CGPA was 3.80. Average GPA, but I am worried about the quality of my studies, not the quantity. During my undergraduate studies I put just enough work into the CS classes to get the grade, and not any more. And I am guessing it is much harder to maintain such GPAs at state universities with more rigorous programs.   I have no extracurricular work to show: never participated in projects, and never done real research work.  Can I still apply to decent PhD programs? Will any PhD programs consider me seriously?  Thank you!

When applying to a PhD program in the US, how does the admissions process work? If an applicant is weak in a particular area, is it possible to offset that by being strong in a different area?  Note that this question originated from this . Please feel free to edit the question to improve it.


My problem is to get the sum of the area of all buildings inside a block.   There are a layer with the buildings (they contain an block_id to which block they belong and the area) and a layer with all blocks (they have a block_id). I want to sum the areas of all buildings with the same block_id and store this sum in a new column in the block-layer to the block with this block_id. I add an picture to clarify my question and structure of data. There are two blocks. The left on has the block_id = '078060' and the right one block_id = '078070'. Now all my buildings in the left polygon have an attritbute also called block_id with the value '078060'. I want then to sum up all the areas of the buildings in the block and store this value to my block layer.  I thought about calculation this with the field calculator in QGIS. But I don't know how.   The question "" is just a first step to solve my problem, because the calculated sum for the categories (block_id) should be added to a new column in the blocks_layer. I was looking for a possibility to automatically calculate the sum and store it to a new column.

I wish to know if there's a tool on QGIS equivalent to the Excel's "SUMIF".    I have a shapefile of a land use and cover that's classified by the attribute with the name of the classes, for example: "vegetation", "urban centers" and "pastures". My goal is to calculate the area of each class, but since it's composed by various polygons, I need to add up all the areas from all polygons that were put in the same class.  Like I mentioned in the beginning of the question, I know that Excel has a function that can do such thing for me, but it turns out that the sum made by excel doesn't match the area's total given by QGIS.  English is not my first language, so if the explanation isn't clear enough, I'll be glad to rephrase it.


I would like to create a ColorRamp node, but I don't know how it is called internally. import bpy  selection = bpy.context.object currentMaterial = selection.active_material currentMaterial.use_nodes = True nodes = currentMaterial.node_tree.nodes colorRamp = nodes.new(type = 'ShaderNodeColorRamp')  The 'ShaderNodeColorRamp' does not work, the string is wrong, how do I find it's correct name out?  When creating the node via the search menu, the info area only say: bpy.ops.node.add_search(node_item='69')

How can I create a ColorRamp for a Cycles material through Python?  I am able to create a new shader output node with nodes.new(type='ShaderNodeOutputMaterial'). Searching online, I see that it is only possible through C code (however, these pages dates back several years).  Is there a way to fake a ColorRamp (maybe with multiple Math nodes in greater/less than mode) or create a ColorRamp for a Cycles material through Python?


A phone charger is rated with input of AC 240v 50/60Hz 0.35 amps will it accept only 240 v 0.35 or will it take full 240 v 16 amps and step it down please I am very new to electrical stuff please help I am really confused.

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


I want to use CKEditor to edit page contents in my Drupal web site. The problem is after installing the newest version of CKEditor toolbar is not showing when I want to edit certain Block body. Is this a bug or editor itself requires more configuring ?

I have just moved my site from local machine to production, the wysiwyg editor based on ckeditor no longer show the complete toolbar. I have a minimal list of element. Can someone help, am trying everything, edit profile, check if all files are uploaded, i don't see any problem !


Let $f: (-1,1) \to R$ and $f'(0)$. Suppose that $-1 < a_n < 0 < b_n < 1$ and $a_n \to 0, b_n \to 0$ Show that $$D_n = \frac{f(b_n) - f(a_n)}{b_n - a_n}$$ goes to $f'(0)$. This is a specific case where we need to show that $f'(0)$ is the result, not a general point where the derivative is evaluated at. I'm not quite sure where to start. I'm not sure what $f'(0)$ is, all I'm told is that it exists. So I'm trying to show this quantity goes to that, when I don't even know what $f'(0)$ is equal to. That is throwing me off. I'm also not sure the relation to $f'(0)$ that $D_n$ has. Can anyone clarify the question for me and maybe get me started? Thank you!

Let $f$ be differentiable at $x=a$.   Prove that if $x_n \to a^+$ and $y_n \to a^-$ then:  $$\lim_{n\to \infty} \frac{f(x_n)-f(y_n)}{x_n-y_n}=f'(a).$$  Every option that I think about seems to my very trivial, so I believe that I am doing something wrong.  Both numerator and denominator approach zero as $n\to\infty$ as the case of the formal definition of derivative, but it isn't guaranteed that the limits are equal (“$\frac{0}{0}$”).   Any direction?


I was using list.index(element) method to find the index of an element in a list inside a for loop but suppose an element is repeated in the list then this method gives the index of first occurrence of the element only. So how can I get the index of current element in the list? For example consider the following code: nums = [1,2,3,4,3,4] for i in nums:     print(nums.index(i))  It's output is 0 1 2 3 2 3 instead of 0 1 2 3 4 5 Any help would be appreciable.

I could swear I've seen the function (or method) that takes a list, like this [3, 7, 19] and makes it into iterable list of tuples, like so: [(0,3), (1,7), (2,19)] to use it instead of:  for i in range(len(name_of_list)):     name_of_list[i] = something   but I can't remember the name and googling "iterate list" gets nothing.


I am getting the error below while downloading the apps from ubuntu software center.   E: dpkg was interrupted, you must manually run dpkg, configure a' to correct the problem.    How can I resolve it?

I was running an upgrade with the apt-get command, and it was taking an exceptionally long time because half way through my ISP hit me in the face with their fair usage policy.   After sitting outside & watching the rain for awhile my electronics regained consciousness, so I went back to complete the upgrade and my terminal scolds me with   "E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem."   The last bit of legible info was all this:  Installing (ri/RDoc) documention for (stuff and such) ERROR:  Could not find a valid gem 'watobo-0.9.8.724.gem' (>= 0) in any repository rm: cannot remove `watobo-0.9.8.724.gem': No such file or directory  Setting up metasploit (4.3.0-bt1) ... Upgrading Pre-Existing Installation... /opt/metasploit/postgresql/scripts/ctl.sh : postgresql  (pid 1191) already running prosvc is running metasploit is running [*] [*] Attempting to update the Metasploit Framework... [*]   So on it goes for miles, talking about gem caches, rubies, & stuff I wish I had. All up until:  A    lib/gemcache/ruby/1.9.1/gems/state_machine-1.1.2/gemfiles/active_record-2.1.2.gemfile.lock   ...and there it has sat, all night.    If I stop it, will I still get the dpkg error (on the off chance that I won't), or if so what do I need to to resume using apt-get commands and its Super Cow Powers?


I believe this is a syntax question. I'm sorry if this is the wrong tag.  Which is correct?   Through my education, volunteer work, and work experience, I have truly realized Tagore was right, service is joy. Through my education, volunteer work, and work experience, I have truly realized that Tagore was right, service is joy.   Cheers

In general, when can I omit that from a sentence?   Can I omit that (emphasized) in sentence (2) below?        We say that such algorithms handle concept drift and can learn from time-changing data streams.   When the statistical properties of the target variable change, we say that concept drift has occurred.   She told me that some of her classmates failed.      To me, sentences (1) and (3) sound better without that. If I omit that from (2), it just doesn't sound right when I read it out loud. (I should point out I'm not a native speaker.)  How do you decide when to omit it? Is it just a matter of taste? (I know that is sometimes mandatory.)  Can you think of sentences that "sound better" with that? Can you think of sentences that "sound better" without that? Can you think of a few sentences where it is wrong to omit that?


Let's say there are 2 characters vs a monster.  1 character is unconscious.   If the 2nd character decides to stabilize the first then are they subject to an opportunity attack? Or are attacks against them at Advantage?  Note, I've read this  but think this is a slightly different case as the 2nd character is still in combat but trying to heal their fellow party member.

What provokes an opportunity attack?  In 3.X moving out of a threatened square, standing up from prone, casting a spell (unless cast defensively), or making a ranged attack provoked, while in 4e moving out of a threatened square or making a ranged/area attack provoked.


I have a data set in which $y$ is roughly related to $\log(x)$. Now I wish to fit the curve $$y=A(1-\exp(BX))$$  When I use R and the nls2 function, then I encounter the error SINGULAR MATRIX at initial parameters.     I have tried to use a model with the $a$ parameter fixed, in which case it works fine   model2<-nls2(ynew~1000*(1-exp(bx)),data=sData,start = list(b=0.08),trace = TRUE,control = list(maxiter=1000))   But when I have both $a$ and $b$ as free parameters then I get the error  model1<-nls2(ynew~A*(1-exp(bx)),data=sData,start = list(A=10,b=0.08),trace = TRUE,control = list(maxiter=1000))    Some similar issue is explained in this thread  where they suggest to:   linearize to get better starting values in addition use the plinear method   How can I linearize my function? I can not rewrite into a linear function by taking the logarithm.   Below is an image of my function/data. I will try to post the subset of the data

I have some basic data on emission reductions and cost per car:  q24 <- read.table(text = "reductions  cost.per.car     50  45     55  55     60  62     65  70     70  80     75  90     80  100     85  200     90  375     95  600     ",header = TRUE, sep = "")   I know that this is an exponential function, so I expect to be able to find a model that fits with:      model <- nls(cost.per.car ~ a * exp(b * reductions) + c,           data = q24,           start = list(a=1, b=1, c=0))   but I'm getting an error:   Error in nlsModel(formula, mf, start, wts) :    singular gradient matrix at initial parameter estimates   I've read through  on the error I'm seeing and I'm gathering that the problem is probably that I need better/different start values (the initial parameter estimates makes a little more sense) but I'm not sure, given the data that I have, how I'd go about estimating better parameters.


Let us say I extract all tweets containing a certain hashtag (main subject of the tweet) and bin them by the hour i.e. count the number of tweets that occurred during a certain hour. I will then be obtaining a time series for this particular hashtag. I have recently come across the  which decomposes a given timeline into its seasonal, trend and error components and R provides a simple function stl to achieve this.  I am trying to understand if using this in my context (timeline of tweet counts) is appropriate. What I would like to examine is whether two given hashtags have a similar timeline and I was wondering what I can understand by using time series decomposition. Any suggestions?

I used stl() in R to decompose count data into trend, seasonal & irregular components. The resulting trend values are not integers anymore. I have the following questions:   Is stl() an appropriate way to deseasonalize count data? Since the resulting trend is not interger valued anymore, can I use lm() to model the trend components?


I understand that the number 0.3 cannot be exactly represented in binary, and thats why doing something like:  0.1+0.2==0.3   gives False as an answer.  However even if the number cannot be exactly represented, the result should still be True. Here's my reasoning:  Python will do the operation 0.1+0.2 and the result will not be exactly 0.3, it will be some number close to 0.3 that will be stored as the left operand of the comparison.  But then it has to take the right operand 0.3, convert it to a number, which will give again number not exactly equal to 0.3 and store it as the right operand of the comparison.  Finally compare both numbers.  So the result should actually give True, even if internally it will be comparing two numbers and none of them will actually be 0.3  What am I missing here? If the number cannot be exactly represented, then this must be true for both operands, so we will be comparing something like  0.1+0.2==0.3 0.30000000000000004 == 0.30000000000000004 True

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?