Background: I have recently begun answering more questions on Stack Overflow. I have already learned new things about programming languages I use on a daily basis and have had an overall excellent experience with answering questions. That being said, the more questions I answer, the more I see duplicate questions, which upon some research have already been very thoroughly answered. As I become better at answering questions, I see that for the good of the website, and to assist users, I should flag more questions as duplicates. Issue: However, here in lies the crux, as I get better at answering questions and identifying duplicates, I answer fewer questions, and flag more questions as duplicates. Therefore I answer fewer easy questions, receive less reputation, and get no thanks from the original poster. In other words, to play the devil's advocate, why should I flag a question as a duplicate? And as a direct consequence, do we need a mechanism to encourage flagging questions as duplicates? Extra details: I want to stress that the only factor isn't reputation. When I answer a question in a way that helps someone out and they respond with 'thanks', or accept my answer, I can't deny I feel some sense of accomplishment. I don't see many people saying 'thanks' if I vote to close their question as duplicates. I also don't feel like finding a duplicate question is a non-trivial task. Recently I saw an obvious duplicate about the JavaScript File API. It took me a few minutes to read the question, a minute to find the MDN reference page, and then 15 minutes to find a good Stack Overflow answer that describes the answer.

I only say duplicates but I think this could be extended to several other flagging reasons. Since accepted answers/upvotes don't get reverted on questions I see people sometimes cut and paste the answer from a duplicate question without flagging as duplicate. In the end they can usually score a few upvotes and even an accepted answer.  Found this related question:   Seems to have a lot of popularity but nothing ever happened  Jeff on Dupes     Those arguing for “remove reputation from dupes” have no idea of the   Frankenstein monster you’d be creating.      That would be an awesome rep-denial tool for griefing others, first of   all.      Second, it creates a MASSIVE disincentive to participation — even if   you had no idea there were duplicates, you could be bushwhacked at any   time even if you contributed a fantastic answer. Oops sorry dupe!   Zero rep, buddy! Bzzzzt! Go away! Take your awesome answer elsewhere!      Incentives are fine, but penalties are an incredibly bad idea and   would actively hurt users and the network.   I guess this answers my question, even if I disagree with jeff.


I'm trying to understand the reason for Heisenberg's uncertainty principle which I read is a "fact of nature" rather than an experimental limitation. I found this  in which the accepted answer talks about quantum objects as being wavepackets which seems to satisfy the criteria for HUP and how position and momentum can be related by Fourier transforms. However we can reach this result without even considering quantum objects as wave-packets from commutator relations between position and momentum. I'm aware of how to calculate the commutator of position and momentum from their definition in Schrodinger's equation. What I am seeking is the reason why they can't commute. The introductory textbooks (Griffith's: Introduction to Quantum mechanics and Arthur Beiser's: Modern physics) I've read so far don't seem to mention the reason why they don't commute and take it as an axiom. I would like some justification for it.

Imagine you're teaching a first course on quantum mechanics in which your students are well-versed in classical mechanics, but have never seen any quantum before.  How would you motivate the subject and convince your students that in fact classical mechanics cannot explain the real world and that quantum mechanics, given your knowledge of classical mechanics, is the most obvious alternative to try?  If you sit down and think about it, the idea that the state of a system, instead of being specified by the finitely many particles' position and momentum, is now described by an element of some abstract (rigged) Hilbert space and that the observables correspond to self-adjoint operators on the space of states is not at all obvious.  Why should this be the case, or at least, why might we expect this to be the case?   Then there is the issue of measurement which is even more difficult to motivate.  In the usual formulation of quantum mechanics, we assume that, given a state $|\psi \rangle$ and an observable $A$, the probability of measuring a value between $a$ and $a+da$ is given by $|\langle a|\psi \rangle |^2da$ (and furthermore, if $a$ is not an eigenvalue of $A$, then the probability of measuring a value in this interval is $0$).  How would you convince your students that this had to be the case?  I have thought about this question of motivation for a couple of years now, and so far, the only answers I've come up with are incomplete, not entirely satisfactory, and seem to be much more non-trivial than I feel they should be.  So, what do you guys think?  Can you motivate the usual formulation of quantum mechanics using only classical mechanics and minimal appeal to experimental results?  Note that, at some point, you will have to make reference to experiment.  After all, this is the reason why we needed to develop quantum mechanics.  In principle, we could just say "The Born Rule is true because its experimentally verified.", but I find this particularly unsatisfying.  I think we can do better.  Thus, I would ask that when you do invoke the results of an experiment, you do so to only justify fundamental truths, by which I mean something that can not itself just be explained in terms of more theory.  You might say that my conjecture is that the Born Rule is not a fundamental truth in this sense, but can instead be explained by more fundamental theory, which itself is justified via experiment.  Edit:  To clarify, I will try to make use of a much simpler example.  In an ideal gas, if you fix the volume, then the temperature is proportional to pressure.  So we may ask "Why?".  You could say "Well, because experiment.", or alternatively you could say "It is a trivial corollary of the ideal gas law.".  If you choose the latter, you can then ask why that is true.  Once again, you can just say "Because experiment." or you could try to prove it using more fundamental physical truths (using the kinetic theory of gases, for example).  The objective, then, is to come up with the most fundamental physical truths, prove everything else we know in terms of those, and then verify the fundamental physical truths via experiment.  And in this particular case, the objective is to do this with quantum mechanics.


Also tell if i need to mince the beef lumps before mincing the beef to make patties

As the title says; What is the secret of making a really juicy burger?


Hi guys I searched alot but not found any thing related to this. So if anyone tell me what's the reason for this.  I just purchased Google nexus 5 and upgraded from 4.4.2 to 4.4.4 and now waiting for 5.0 update on my device. But It has been over a month that I didn't received any updates and where others guys have received 5.0.1 as well. So anyone having same issue or something wrong with my device.  Thanks in advance

Android 5.0 (Lollipop) was officially announced on October 15th, 2014.  You can review the high-level changes at the  and the announcement on the official .  Of course, not all devices will get this update right away and others won't get it at all. Each manufacturer and carrier often choose to add their custom modifications which tend to delay the official release.  When will each device get Android 5.0, either officially or unofficially, if ever?  See also:


I am trying to install kdenlive through the official repository but I am getting this error telling me that libmlt++3 and libmlt6 are outdated. As result, I cannot install kdenlive. I found the newer version (6.6, kdenlive requires at least 6.13) but its impossible for me to install it. Can anyone help me? Using this command sudo apt install libmlt++3 just reinstalls vesrion 6.0... What am I to do?   Edit: The software centre doesn't work neither :(

If you go to the kdenlive download page:   Under      Ubuntu | LinuxMint | Elementary   It reads:     It is recommended to download the AppImage version until the release   of Ubuntu 18.04.   Ubuntu 18.04 has been released. What is the best way to get it installed?


Say I want to use the Tome of Battle maneuver Moment of Perfect Mind, a maneuver that replaces my Will save with the equivalent Concentration Check.   Out of combat, my warblade and an enemy wizard are negotiating over the price of ferrets. While we are talking he casts a quickened spell of Charm Person.   I have Moment of Perfect Mind readied. Can I use the counter to save as an immediate action, or am I considered flat-footed?

Can you initiate a maneuver outside of combat? This is specifically about the Moment of Perfect Mind maneuver, which allows me to substitute my Will save for a concentration check. My GM feels that I should not be able to initiate it outside of combat, since it effectively grants me a Will save that is better than my best save. I don't see why I should not be able to initiate it outside of combat. A Druid can Wildshape out of combat and a Wizard can still cast his spells whenever he wants. My Warblade should be no different.


I have been seeing that we could use extended data types like unsigned long long which consume 16 bytes of memory, i.e. sizeof(an unsigned long long variable) results in 16 on my 64 bit machine, I understand that largest possible data type is restricted by the architecture of the system, i.e. to 8 bytes on my 64 bit machine, I just wanted to know how is this data type handled on a machine whose CPU instruction set is only 64 bit long. Please help. Thanks

As per c99 standard, size of long long should be minimum 64 bits. How is this implemented in a 32 bit machine (eg. addition or multiplication of 2 long longs). Also, What is the equivalent of long long in C++.


I need to install , I am using the vanilla  from CTAN. I have another option to install it is from the OS (i.e. Ubuntu) repository, but it will install another copy of OS specific TeX stack which I do not want.    is not a latex macro/style file, it is an executable (like ). I can install xdvi using tlmgr, but not catdvi. Even my tlmgr gives detailed info on the xdvi status --  > tlmgr info xdvi package:     xdvi category:    TLCore shortdesc:   A DVI previewer for the X Window System. longdesc:    The canonical previewer for use on Unix and other X-windows based systems. The distribution has been integrated with that of xdvik (no longer separately available), so that it will build with web2c "out of the box". In practice, it is usually distributed via Tex-live. installed:   Yes revision:    30339 sizes:       doc: 261k, run: 37k, bin: 1145k relocatable: No cat-version: 22.86 cat-date:    2013-05-08 11:16:41 +0200 cat-license: other-free collection:  collection-basic   But tlmgr gives nothing on catdvi --  > tlmgr info catdvi tlmgr: package repository http://mirrors.ibiblio.org/pub/mirrors/CTAN/systems/texlive/tlnet tlmgr: cannot find package catdvi   But both of them are in the  directory.  How do I install it through TeXLive?   Please also note that I have another option to directly download and compile the catdvi from the sourceforge , but I do not want to do that.

Debian and Ubuntu have very good texlive packaging. But I'd like to use tlmgr to have a more fine-grained control about upgrades and which packages I want to be installed.   So how do I install "vanilla" TeXLive on Debian/Ubuntu?   Also how do I make dpkg aware that I have TeXLive installed?


I have joined my first open source project, and with these projects, obviously come packages containing modules.   Before I delve in, this is the file structure of the project:  -Opensource-Project     -README.md     -main.py     -modules         -__init__.py         -src             -lyrics.py         -tests             -test_lyrics.py   Now inside of test_lyrics.py:  import modules  def test_lyrics():     assert('lyrics' == modules.process_query('paradise lyrics')[0])   When I run this file, I get:  ImportError: No module named modules   I have done research, and have found many past questions suggesting this:  export PYTHONPATH="${PYTHONPATH}:/home/Opensource-Project/modules"   Now, I do this, because this is where the highest level init.py is, in the modules directory.   On top of that when I run:  >>import os >>os.environ["PYTHONPATH"]   It returns   >>:/home/Opensource-Project/modules   And yes, it just remains the variable for the session; once I close the terminal, it is gone.   Lastly, I check .bashrc and .profile, and it is not included in there.   What can I do to permanently add this path for the project and have python recognize these packages? Keep in mind, I am new to professional software development.   Thanks

What are correct places for:   Global environment variables meant to affect all users? User-specific environment variables?


I'm tasked with proving that $\sum_{i=1}^{n}e_i X_i = 0$ in the context of simple linear regression. We have that $e_i X_i = (Y_i - \hat{Y}_i)X_i = (Y_i - \hat{\beta}_0 - \hat{\beta}_1X_i)X_i.$ It follows that $$ \sum e_i X_i = \sum X_iY_i - \hat{\beta}_0 \sum X_i - \hat{\beta}_1 \sum X_i^2. $$ Now use the fact that $\hat{\beta}_0 = \bar{Y} - \hat{\beta}_1 \bar{X}$. It follows that \begin{align} \sum e_i X_i & = \sum X_iY_i - (\bar{Y} - \hat{\beta}_1 \bar{X}) \sum X_i - \hat{\beta}_1 \sum X_i^2 \\ &= \sum X_iY_i - \bar{Y}\sum X_i - \hat{\beta}_1 \bar{X} \sum X_i - \hat{\beta}_1 \sum X_i^2 \\ &= \sum X_iY_i - \frac{\sum Y_i \sum X_i}{n} - \frac{\Bigl(\sum X_i\Bigr)^2}{n} - \hat{\beta}_1 \sum X_i^2. \tag{*} \end{align} Now I've noticed that equation $(*)$ looks a lot like the expression for $\hat{\beta}_1$ (a solution to the normal equations), which makes me think I'm on the right path, because in proving that $\sum e_i = 0$ we use one solution to the normal equation, but I can't seem to manipulate the expression into the answer. Thanks for any help.

I'm taking a course on regression models and one of the properties provided for linear regression is that the residuals always sum to zero when an intercept is included.   Can someone provide a good explanation for why this is the case?


How can I move everything but the last n files, from dir1 to dir2?.   I currently do this, setting the time as an approximate for n, in my case n=2 each 10 minutes.  find /dir1/ -name '*.txt*' -mmin +10 -type f -exec mv "{}" /dir2/ \;   A similar command, could work, but i am not certain, could somebody confirm how should adapt this?  ls -1tr | head -n -2 | xargs -d '\n' mv -f --

In Linux, one folder is created every morning and 5 files are created in that folder.  At the end of the day (Midnight), the last two files in that folder have to be deleted. How can I accomplish this?


Which sentence is right?  A group of people that are  OR  A group of people that is  I am aware that there is this grammar rule concerning relative pronoun that states something along the lines if 'X of Y that ABC' then ABC must agree in tense of the Y and not the X. However, I am not sure if this is also applicable for a group of people that ... because a number of people that (in this case must be) are...  It would be great if you guys could help explain!

I'm under the impression that the correct verb to use is "are," but my colleagues believe it to be "is."  And what about just: "over half our board [are/is] people of color" ?  Another case: "over half the stadium [are/is] people of color"  We're tripping over these examples, any help appreciated!


The Mahalanobis distance is a distance metric used to measure the distance between two points in some feature space. Unlike the Euclidean distance, it uses the covariance matrix to "adjust" for covariance among the various features.  The Mahalanobis distance formula uses the inverse of the covariance matrix. What if the covariance matrix is not invertible?

I have a cluster of p-dimensional points and given a new p-dimensional point $x$ I want to determine whether or not it is likely to belong to this cluster.   The cluster is made up of $n$ p-dimensional points, I am making the assumption that these points are drawn from a multivariate Gaussian distribution with sample mean ${\hat{\mu_X}}$ and sample covariance matrix $\hat{\sigma_X}$.  Given a new point $x$ I am trying to decide if it is likely to belong to this cluster using the following threshold on the : $$\frac{n}{(n-1)^2}\left(X_i-\hat{\mu}_X\right)'\hat{\sigma}_X^{-1}\left(X_i-\hat{\mu}_X\right)>B_{0.95}\left(\frac{p}{2},\frac{n-p-1}{2}\right)$$  However, some clusters have very few sample points $n$ in which case calculating the inverse covariance matrix $\hat{\sigma_X}^{-1}$ becomes impossible.  Are there any other equivalent or more appropriate measure I can use in this case?


I made clean install of Windows 7, left some space unallocated on SSD and during subsequent Mint 18.3 install with default "Alongside" option did not got Windows in grub boot menu.  I write this mainly duplicate because the solution was simpler than in other questions I found here, see my answer.

I installed Windows on my computer, followed by an installation of Ubuntu. However, now I'm unable to boot into my Windows install.  What can I do to fix this?


I am not finding a way to change the contact that the community user is associated to.  I have tried the following:   1) Upload/Download via Data Loader - FAIL - Data Loader cannot see ContactId on update   2) Workbench Active or Inactive Community User - FAIL - I get a un-known exception when I try to change ContactId.  Is there a way to do this?

When I attempt to change the field User.ContactID in order to connect a User to a different Contact, I get the error message 'Field is not writeable: User.ContactId'.  Is there any way to do this?


While adding the validations in the application, should we add those in models or through JavaScript and what is the difference in both these kinds of validation? What is good practice and how they differ?

Which is better to do client side or server side validation?  In our situation we are using    jQuery and MVC.   JSON data to pass between our View and Controller.     A lot of the validation I do is validating data as users enter it. For example I use the the keypress event to prevent letters in a text box, set a max number of characters and that a number is with in a range.   I guess the better question would be, Are there any benefits to doing server side validation over client side?    Awesome answers everyone. The website that we have is password protected and for a small user base(<50). If they are not running JavaScript we will send ninjas. But if we were designing a site for everyone one I'd agree to do validation on both sides.


I tried to install ubuntu 14, but after a screen appears that reads "ubuntu" (ubuntu loading), my computer screen artifacts (not visible picture or writing)   computer: proc: amd fx8350, ram : 10GB, VGA : msi ati 7730

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


I am trying to write \sum_{x \in \Chi, y \in \Upsilon} to denote a summation whose index is with small x in big Chi, and small y in big Upsilon (summation over all possible values of two discrete random variables X, Y that take values in big chi and big upsilon). However, writing \Chi right after writing \in causes an undefined control sequence. How could I fix this?  Thank you!

I'm compiling with XeLaTeX and in my document, when I put \Chi, or \Alpha, or any normal symbol it raises the error Undefined control sequence This is my preamble:  \usepackage[utf8]{inputenc} \usepackage{fontspec} \usepackage[spanish]{babel} \usepackage[left=3cm, right=2cm, top=3cm, bottom=3cm]{geometry} \setmainfont{Arial} \setmonofont{Inconsolata}   Update: I added \usepackage{unicode-math}, now there is no error but in the PDF there is a white space (Because Arial doesnt have greek letters). How can I set a different font for unicode-math?


I was reading a text about quantum scattering, and I faced a notation I don't understand. The equation is the following: $$ \nabla \psi_{\text{scattered}} = \frac{i k f(\theta) e^{ikr}}{r} \mathbf{\hat{r}} + \mathcal{O}\left(\frac{1}{r^2}\right) $$ and I do not know the meaning of the $\mathcal{O}\left(\frac{1}{r^2}\right)$ portion.

In the highest upvoted answer to   the author writes the following equation:   $$ U^\dagger U=(\mathbb I+\epsilon^* A^\dagger)(\mathbb I+\epsilon A)=I+\epsilon^*A^\dagger+\epsilon A+\mathcal O(\epsilon^2) $$  What does that last term mean? It looks a lot like the  from asymptotic analysis.


I'm really struggling with some exercise my professor left me about fundamental group so I think I need some clarification. During one of them I found that any loop $\omega$, where $\omega$ belongs to the fundamental group of a connected space, it is homotopic to its inverse $\omega^{-1}$, but what does that means? In my opinion the only way that could happen is that they are both contractible. Am I missing any other possibility?

A loop in a topological space $X$ based at $a\in X$ is a continuous function $\rho: [0,1]\rightarrow X$ such that $\rho(0)=\rho(1)=a$.   The reverse of $\rho$ is $\overline{\rho}$ such that $\overline{\rho}(s)=\rho(1-s)$ for each $s\in [0,1]$. Clearly $\rho$ is also a loop based at $a$.  It seems rather obvious that $\rho$ is homotopic to $\rho$, i.e. there exists a continuous function $H:[0,1]\times [0,1]\rightarrow X$ such that $H(0,t)=H(1,t)=a$, $H(s,0)=\rho(s)$, and $H(s,1)=\overline{\rho}(s)$, but I'm not sure how to define/construct such a homotopy?


Let's assume that $a_{1},a_{2},...,a_{n}$ are positive. How to prove this inequality:  $(a_{1}+a_{2}+...+a_{n})(\frac{1}{a_{1}}+\frac{1}{a_{2}}+...+\frac{1}{a_{n}})\geq n^{2}$  My effort: I don't know where to begin.

If $x_1,...,x_n$ are positive real numbers and if $y_k=1/x_k$, prove that $$\left(\sum^n_{k=1}x_k\right)\left(\sum^n_{k=1}y_k\right)\geq n^2.$$   I've been learning induction, and I've come across this problem that I really can't even break down and begin to think about. I've been told it has something to do with Cauchy-Schwarz, but I cannot figure out how to apply it. I would appreciate help figuring out how to go about and formulate this proof. Thanks!


I often see hallway lights or street signs made from translucent plastic shapes inside of which is a light. The light doesn't spread through the thicker parts of the plastic, and some angles are materialized by being dimmer such as in these photos:      The darker areas help see the object's volume and its structure, and I am trying to reproduce the same thing in Blender.   I have tried to make a material that is a mix of translucent and transparent, and also transparent and volume absorption, but I cannot seem to get it right.     (Shared screenshot and version are shareable, dumbed-down versions of the current project).  Also, all the edges aren't outlined the same way, and it's hard to tweak their appearance.  Either the darker areas are too sharp, or the material looks like smoke more than plastic.  How could I make this effect in Blender?

i want an object to emit light, but still be recognizable as the object, like in this picture.    i tried using Luts in the colour management and tried to make only a second, weaker emitter be visible to the camera.  The problem is, that as soon as the object is emitting light, doesnt matter how strong, its not recognizable as 3D-object anymore.  I also tried to plug the node into volume and not surface, but then, it gets  transparent.  please halp much thanks


$$\sqrt{1+\sqrt{2+\sqrt{3+\sqrt{4+\sqrt{5+\sqrt{ \dots }}}}}}$$   I don't understand how to solve that. I mean I don't know where to begin. Tell me if this infinite radical has a solution or converge to a number. Thanks.


Need to contact rockstar game services because my vehicle was replaced with another and I can’t get my car back

Recently, Rockstar Social Club has been hacked and thousands of people's login data has been stolen. I'm pretty sure I'm a victim, as I have progressed only about 1-3 levels in online. Now I'm almost level 10, lost my 1,000,000 pre-order bonus dollars, have a completely new outfit (at least the cat shirt is nice) and own a garage on an abandoned beach. I have travelled about only 5 miles in-game, so I have never been there.  This is really bugging me. I looked on their website, but I only can find the knowledge base, FAQ and so on - no customer support.  I would like to send them an email with my issue, or maybe a live online chat.  Where and how can I contact Rockstar's customer support?


I have an account with secondary group membership in a group that owns a directory.  The directory is chmod 760, which should allow writing to the directory, but not listing it.  However, this is not allowed.  Can somebody explain why?  Rationale: mostly academic; trying to understand permissions in detail.  I recognize that I could make the permissions 770 and allow this; I'm not an idiot (at least I don't think so).  I just want to understand what write permissions actually mean for a directory, if not file creation.  Code example:  powerdave@dhirsch-centos:/tmp >groups powerdave wheel share powerdave@dhirsch-centos:/tmp >ls -alh total 124K drwxrwxrwt.  5 root      root      4.0K Feb 23 15:08 ./ dr-xr-xr-x. 23 root      root      4.0K Feb 23 14:57 ../ drwxrw----.  2 guest     share     4.0K Feb 23 14:52 test/ powerdave@dhirsch-centos:/tmp >touch test/file touch: cannot touch `test/file': Permission denied

In my CMS, I noticed that directories need the executable bit (+x) set for the user to open them. Why is the execute permission required to read a directory, and how do directory permissions in Linux work?


This morning i got on minecraft and it wouldnt let me break anything. I know you hold the blocks to break them but it switches to the 1st item  i have in my inventory. I dont know if its a glitch or what. But please try to help me.

I'm playing on a Survival world with cheats on, "easy" difficulty, and at night in-game. I didn't have a sword or anything to make a sword with, and I was starving, so I switched to Creative to give myself a stack of food and a bed to set my spawn point. When I switched back to Survival, I couldn't destroy or place blocks. I'm on single player, and my Internet is fine, and I can destroy blocks still if I switch to creative. I've tried resetting the button one, and reloading the map, and it still doesn't work. I've even tried deleting everything I gave myself in Creative. This happened before on a different world and I ended up deleting it.  This only happens on this world. How do I fix it?  If I know I'm in the correct game mode, what else can cause this?  Are there different causes in multiplayer?


I've got a study book split into multiple individual books. To continue chapter and part numbers across volumes, I've used the solution by Werner provided here:   It's excellent! One problem: the command to store counters generates output in the document. The command works for my situation, but it produces extra output upon saving the counters. My question is: how can I get rid of the extra output?  MWE (which gives a "Missing number, treated as zero" error but does produce a PDF if you power through by pressing enter):  \documentclass[a4paper,10pt,fleqn,openany]{book}  % --------------------------------------------------------------------------- % load chapter/part counters from previous workbooks  % https://tex.stackexchange.com/questions/129312/carrying-counters-over-to-another-file % =========================================================================== \usepackage{refcount,xr} \externaldocument{book1} \externaldocument{book3} % ---------------------------  % command for storing part/chapter counters % --------------------------- \makeatletter \newcommand*{\storecounter}[2]{%   % updated as per egreg's comment   \edef\@currentlabel{\the\value{#1}}% Store current counter value in \@currentlabel   \label{#2}% Store label } \makeatother  % command to get value of counters % --------------------------- \newcommand*{\getcounter}[2]{%   \setcounterref{#1}{#2}% Retrieve label value and store it in a counter }  % have a counter for chapters and for parts from volume 1 % --------------------------- \newcounter{bookonecounter} \getcounter{bookonecounter}{parts} \setcounter{part}{\thebookonecounter}  \begin{document}  \part{A part} \part{Another part}  % =========================================================================== % Save chapter/part counters for use in further volumes % XXX: this currently outputs "value in X" % --------------------------- \setcounter{bookonecounter}{\thechapter}\storecounter{bookonecounter}{chapters} \setcounter{bookonecounter}{\thepart}\storecounter{bookonecounter}{parts} % ===========================================================================  \end{document}   Using this example (volume 2) when you have volume 1 as "book1.tex" will correctly continue the part number. E.g., for a book1.aux that contains  \newlabel{chapters}{{4}{154}} \newlabel{parts}{{2}{154}}   it compiles (with the complaint as noted above) into a pdf which continues the count. However, it adds a page to the end of the PDF which contains IV:   Commenting out the two setcounter/storecounter lines removes this from the pdf.  edit: egreg's proposal is definitely an improvement. The screenshot is the result of using his definition. Unfortunately, there's still an extra, unwanted page with some text on it on account of the \setcounter..\storecounter lines.  Any ideas on how to prevent the lines with \setcounter{}..\storecounter to produce an extra page?

I have two files, say file1.tex and file2.tex. file1.tex is the first of a series of files, and it begins with counters (say chapter 1 for instance, although my counters are not used for chapters). Then at the end of file1, the counter for chapters is at say 7 ; I want to carry the value of the counter to file2.tex so that I can use a counter which will have the value 7 in file2.tex. In this way I could possibly carry on the counter in file2.tex to a counter in some file3.tex and so on.   I assume I would need to compile file1.tex first, and then file2.tex, and then file3.tex... of course.  Is that possible? And if so, how? I couldn't think of anything.


I have been given an optional challenge problem at the end of one of my earlier tutorials that I am unsure how to solve. It is a question with three parts, but I would like to tackle them separately with a little help on part a.  a function $f$ is even if $f(-x) = f(x)$ for all $x$, and odd if $f(-x) = -f(x)$ for all $x$.  Now I am told to show that every polynomial is the sum of both an even and an odd function, but have no idea how to go about this.  Is the key to this question that $f(-x) = x^2$ will always $= f(x)$ $\therefore$ $x^2$ is even? I understand that, and if a secondary function was $g(-x) = x$, where x is only positive, then it would make sense that this is a odd function, but it is for all x, and therefore a negative x value in g(-x) would become positive and it wouldn't be an odd or an even function.

While working on a proof showing that all functions limited to the domain of real numbers can be expressed as a sum of their odd and even components, I stumbled into a troublesome roadblock; namely, I had no clue how one divides the function into these even and odd parts.  Looking up a solution for the proof, I found these general formulas for the even and odd parts of a function $f(n)$:  $$\begin{align*} f_e(n)&\overset{\Delta}{=}\frac{f(n)+f(-n)}{2}\\ f_o(n)&\overset{\Delta}{=}\frac{f(n)-f(-n)}{2} \end{align*}$$  While I understand that in an even function $f(n) = f(-n)$ and that in an odd function $f(-n) = -f(n)$, I still don't get how these general formulas for the even and odd parts were obtained. Can someone guide me through the logic?


I need to use InfoStat for one of my classes, but there's only a Windows version available for download. I've tried using it through Wine, but it doesn't work properly. Is there any software available for Linux that offers the same (or at least similar) features? (Please keep in mind that I've just moved to Linux and I'm slowly learning my way around it). Thanks!

PSPP is an open source alternative to SPSS. Because of licensing issues it isn't in official Ubuntu repositories.  I have found downloads available for Ubuntu 20.10 and 18.04 at  but I run 20.04 and don't want to upgrade.  Am I out of luck or is there a safe choice for me?  (I can follow directions but am not really adept at Linux yet - just switched over.)  Thx.


The below script is not working.   cd desktop/quoteUpdate while true do  curl-o quotes.txt -s "http://download.finance.yahoo.com/d/quotes.csv?s=goog,aapl&f=sl1"  sed -i '.bak' 's/,/ /g' quotes.txt echo UPDATED: date sleep 10 done   When I try and run the executable I get this error and no txt file is created in my desktop folder.  UPDATED: Wed 14 Jan 2015 15:33:30 GMT      /Users/chrisdorman/Desktop/quoteUpdate/runNow: line 4: curl-o: command not found     sed: quotes.txt: No such file or directory

What can I add to the below script so that it fetches the stock data and brings it back WITHOUT any commas and spaces? For example GOOG Outstanding shares is 675,000,000.   I desire the output of 675000000 for my txt file. (no spaces or commas or punctuation). I need decimal functionality however for share prices though).   cd desktop/quoteUpdate while true do  curl -o quotes.txt -s "http://download.finance.yahoo.com/d/quotes.csv?s=avxl,goog,aapl&f=snl1c6j2s6f6"  sed -i '.bak' 's/,/ /g' quotes.txt # replace commas with spaces echo UPDATED: date sleep 10 done


My first name is pretty common, but in Spanish it is accentuated.  I've seen people keeping their names accented and people who don't. I wonder if there's a formal recommendation on this matter.

In German, as well as in other languages, people have Non-English characters in their names. e.g. ß, the umlauts etc..    I frequently face problems when flying, opening bank accounts, etc., particularly abroad, since replacing the ß with ss changes more more than 25% of my family name as compared to how it's written in my passport.  Obviously it is desirable to write one's name for submissions, the way one's name is written correctly. Can one expect to run into problems, and will sooner or later end up with different publications being published under different spellings of the name, or is it safe to go for the correct spelling?


From the video , we can see that the serve has given a point. I wonder if they revenge back by serving the tennis ball back by hitting the player, and make the whole game like dodgeball. What would happen after all?

If a player decides to employ a strategy of deliberately hitting his opponent to try to intimidate or injure them, it would be considered unsportsmanlike but would it be against the rules?  If not, has anyone actually tried this at a professional level? Cause I'm thinking, especially in doubles where one player is at the net, given that a tennis ball can be hit at 200km/h+ - it would actually be an effective strategy to mess with your opponent and maybe win the point if you can hit them on the full.


Made array of boards..wanted a Spec length of 24" in Array with a 1/2 gap. Array did not work(?) Entered 24" in my Transform Menu but my array length box = 60" x = 48" y = 24" z = 1.6"

I just found out about the Mesh Display : Length feature in the "N" panel (thanks to ) that allows one to measure the length of a face or vertice.  But my first encounter with this tool gives me complex feelings of love and hate, see how, as I was trying to measure the aspect ratio of this TV screen, I am getting WIDTH = 20.33 and HEIGHT = 37.57.  These values seem awfully wrong, since my betrusted eyes tell me the height should be shorter than the width.    I have tried measuring the single vertices as well, to identical results.


I know there's some way to do this, but when I press the guide button, a short hold goes to the Xbox One home and a long hold goes to turn the controller off.

With Rare Replay, it includes the 360 versions of some games to "show off" the Backwards compatibility in action. I can get 360 style notifications and achievements, but pressing the xbox button brings me to the XB1's home instead.  How do I get the 360 guide to show up? It was advertised as being able to do so.


I've been doing daily snapshots on a btrfs subvolume for nearly 3 years, resulting in over a thousand snapshots. I am experiencing occasional small stalls (a few seconds) in basic filesystem operations such as creating new folders and moving files. There is plenty of free and unallocated space left. filefrag does not report excessive fragmentation on a random sample of files I've tested.  I've not been able to find any published gotchas on snapshots being the root cause of this issue, but is there any issue with making and keeping a large number of them?

I am considering using btrfs on my data drive so that I can use , or something like snapper, to take time based snapshots. I believe this will let me browse old versions of my data. This would be in addition to my current off site backup since a drive failure would wipe out the data and the snapshots.  From my understanding btrfs snapshots do not take up much space (meta data and the blocks that have changed, plus maybe some overhead), so space doesn't seem to be a constraint.  If I have a million snapshots (e.g., a snapshot every minute for two years) would that cause havoc, assuming I have enough disk space for the data, the changed data, and the meta data?   If there is a practical limit on the number of snapshots, does it depend on the number of files and/or size of files?


I don't have an internet connection in my Ubuntu. I would like to install tkinter. So is there any way to install tkinter and its dependencies offline ?  Note: I don't have any Ubuntu system that is connected to the internet.

I have a friend who has got a computer that is not connected to the Internet. Is there any way to install software offline easily?


Not sure it technically should have any, but a Big Brother style pop competition feels like quite a mouthful as it is so I’m wondering whether hyphens might help.  Also want to check the capitalization of Big Brother is accurate.

For example, "file system" and "related". Is it "file system-related"? It will appear as if it is a compound of "file" and "system-related", won't it?


When I do apt-get update I get the following error:  E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)  E: Unable to lock directory /var/lib/apt/lists/  W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)  W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)   I'm brand new to linux so I'm not so sure about the safety of adding sudo to the front of that command... Any suggestions?

I get this error whenever I try to install programs using the terminal:  home@ubuntu:~$ apt-get install myunity E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?   Also I'm unable to install updates using the terminal.


Menu bar   Right click context menu in Chrome for example - (Note: the issue is not limited to chrome. it affects the context menu in every app)    Either the logout or shut down dialog - I can't tell   This happens randomly between once a month and once a week. The only way out is a hard reboot.  It would be nice to figure out how to permanently fix it.  macOS High Sierra 10.13.6 Apple MacBook Pro "Core i7" 2.7 13" Touch/2018

So after working on my Macbook for a while. Menus will start blanking out.     Right click on Chrome in dock:    Top menu bar totally blank:    Right click on desktop:     Clicking the black Apple icon in the top left corner of menu bar:    Any idea what's causing it? I have to reboot or log out each time, which is no easy task given menus are blank.


when I input any number into my scanner, it returns the else statement ALWAYS, and i'm stuck in an infinite loop. Can anyone help me out? I need to make the storyChoice variable String, and not Int because I plan on adding more else if statements that require the user input to be a string.       String storyChoice = keybd.next();       //This loop checks the scanner to see if the user has inputted an      //appropriate answer, as soon as the user inputs an appropriate answer     //The while loop terminates.      while(storyChoice != "1"|| storyChoice != "2" || storyChoice != "3")      {         if(storyChoice == "1")         {             Sword story = new Sword();             story.intro();             break;          }         else if (storyChoice == "2")         {             System.out.println("Not coded yet, so stay tuned!");              break;         }         else if(storyChoice == "3")         {             System.out.println("Not coded yet, so stay tuned!");              break;         }         else         {             System.out.println("Please choose an appropriate answer");              storyChoice = keybd.next();          }     }   Thank you.

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


How to split a list in a list of x lists in python ?  Exemple with list splited in 2 lists:  elements = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -> ([0, 1, 2, 3, 4], [5, 6, 7, 8, 9])   Exemple with list splited in 3 lists (note the third list of tuple, containing "division rest"):  elements = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -> ([0, 1, 2], [3, 4, 5], [6, 7, 8, 9])   etc ...

I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive.  I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators.  I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though.  Related question:


I have a 6 inch and a 10 inch skillet that I can't keep from burning foods. High heat low heat. NOTHING. I am trying to use the 6 inch pan for eggs, and they stick. Using butter or Chefs Secret spray... HELP

I'm having the hardest time preventing scrambled eggs from sticking to stainless steel cookware. I've tried bringing the eggs to room temperature before cooking, slowly heating the pan, loads of butter (tasted great, still stuck), adding milk to the eggs. How can I prevent scrambled eggs from sticking to stainless steel?


I'm trying to establish why a process keeps unexpectedly stopping, and one possibility is that the server is running out of memory, but I'm not sure I understand memory and Linux properly.  Take the following output from the free command (taken from the same machine with the issue I'm trying to fix):               total       used       free     shared    buffers     cached Mem:           991        827        163          0        107        361 -/+ buffers/cache:        358        633 Swap:            0          0          0   The top line suggests that this machine is indeed using a lot of memory (only 163 Mb free) and so if a few more processes fire up (which they do) then we could have an out of memory situation with various processes being killed.  However, I've always been led to believe that as Linux makes great use of buffers and caches in memory which can be used if needed, that the figure I should be paying more attention to is the second line which suggests that ~633 Mb is free, in which case I think it's unlikely that this machine is running out of memory.  So can you clarify my understand of Linux and memory, and help me understand when Linux actually runs out of memory?  PS - this machine is a single purpose machine - it runs the background process for a large web application, that's all it does. No web server, no database, just one huge Ruby on Rails app running as a background process. Occasional cron jobs fire up for specific application tasks which would temporarily create another instance of the rails app in memory.

This is a  about how Unix operating systems report memory usage.   Similar Questions:                    I have production server that is running Debian 6.0.6 Squeeze  #uname -a  Linux debsrv 2.6.32-5-xen-amd64 #1 SMP Sun Sep 23 13:49:30 UTC 2012 x86_64 GNU/Linux   Every day cron executes backup script as root:  #crontab -e  0 5 * * * /root/sites_backup.sh > /dev/null 2>&1   #nano /root/sites_backup.sh  #!/bin/bash str=`date +%Y-%m-%d-%H-%M-%S` tar pzcf /home/backups/sites/mysite-$str.tar.gz /var/sites/mysite/public_html/www mysqldump -u mysite -pmypass mysite | gzip -9 > /home/backups/sites/mysite-$str.sql.gz cd /home/backups/sites/ sha512sum mysite-$str* > /home/backups/sites/mysite-$str.tar.gz.DIGESTS cd ~   Everything works perfectly, but I notice that Munin's memory graph shows increase of cache and buffers after backup.  Then I just download backup files and delete them. After deletion Munin's memory graph returns cache and buffers to the state that was before backup.  Here's Munin graph:  Externally hosted image was a dead link.


What mean 00:00:00:00:00:00 MAC address in arp table? On my OpenWRT router on interface connected to ISP I have seen 24 entries with this MAC address and on local network there are 7 entries. What these entries means or indicate?

I have a pretty much out of the box setup of openwrt, though I followed the 'securing your router guide', so password set, ssh on different port (so security through obscurity). However, I see some odd IP address connected to the WAN interface:  root@OpenWrt:~# cat /proc/net/arp IP address       HW type     Flags       HW address            Mask     Device 192.168.1.67     0x1         0x0         00:00:00:00:00:00     *        eth0.2 192.168.1.115    0x1         0x0         00:00:00:00:00:00     *        eth0.2 192.168.1.4      0x1         0x0         00:00:00:00:00:00     *        eth0.2 192.168.1.1      0x1         0x2         00:1f:90:XX:XX:XX     *        eth0.2 ...   I know 192.168.1.1 is my ISPs router which I connect my OpenWRT router to, but I'm unsure what the others are. Also they have a weird MAC address. Does anyone know what that might be? My set top box has a 192.168.1 address but it is not one of these currently one of these. Could it be that it has been assigned different IP addresses at different times and ended up in my ARP table?  I'm using BARRIER BREAKER (14.07-rc3, r42056)


Isn't that bubble supposed to have something in it? Maybe an E?  For comparison, Programming Puzzles and Code Golf has PCG:    The HTML element looks just like any other:

   The label does show up in stackexchange.com:    But not in Ask Ubuntu. Another example:    This happens consistently, after repeated refreshing (both F5 and CtrlF5).

A question from  popped up in the "Hot Network Questions" list, and I couldn't help but notice that its icon is a little bit... lacking.        Shouldn't there be some letters there or something? Maybe "Ec"? Both the main site and the meta are equally nondescript.             As pointed out by  in the comments, this is a high-DPI specific issue.     This is another one of those "shows up on normal DPI, but breaks on high DPI" bugs because  is missing the Ec, but  is not.


If the first character(s) of an XML attribute are capitalized, they don't get colored in the usual attribute way:  <element InitialCap="1" initialLower="2" ALLCAPS="3" SOMEcaps="4" />   It would be nice to have the entire attribute name consistently colored.

I noticed that sometimes my code gets highlighted in different colors when rendered.   What is syntax highlighting? How does it work? Why isn't my code being highlighted correctly? How do I report a bug or request a new language? How do I use syntax highlighting? What languages are currently available on Stack Exchange?


I'm making a presentation with beamer and have noticed that letters written in math mode look exactly the same as letters written in normal mode; in other words $K$ looks in the PDF exactly like K, while when you write a paper using, for example, article letters in math mode look italicized. Why is this happening? In case you wonder, my preamble is this:  \documentclass{beamer}  \usetheme{AnnArbor}   \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage[spanish]{babel} \usepackage{amssymb} \usepackage{amsthm} \usepackage{placeins} \usepackage{amsmath} \usepackage{amscd} \usepackage{graphicx}  \newtheorem{defi}{Definici\'on} \newtheorem{ejem}{Ejemplo} \newtheorem{teo}{Teorema}    Thanks for the help.

In a LaTeX article, the math characters are more "curvy" than the text characters:  \documentclass[12pt]{article} \begin{document}  $x^2 + y^2 = z^2$ \end{document}     In a beamer presentation, the math characters do not have the same curves:  \documentclass{beamer} \begin{document} \begin{frame}  $x^2 + y^2 = z^2$ \end{frame} \end{document}     Question  How can I get the beamer math to look just like the article math?  I would prefer if the solution was a single line (that I could place at the top of my LaTeX file) as opposed to something that needs to appear next to every piece of math.


Is there any way to check what instances classes are collected by GC and what are not? The one option i found is by checking class by Test as described here:

In relation to , I need to check whether a component that will be instantiated by Castle Windsor, can be garbage collected after my code has finished using it. I have tried the suggestion in the answers from the previous question, but it does not seem to work as expected, at least for my code. So I would like to write a unit test that tests whether a specific object instance can be garbage collected after some of my code has run.  Is that possible to do in a reliable way ?   EDIT  I currently have the following test based on Paul Stovell's answer, which succeeds:       [TestMethod]     public void ReleaseTest()     {         WindsorContainer container = new WindsorContainer();         container.Kernel.ReleasePolicy = new NoTrackingReleasePolicy();         container.AddComponentWithLifestyle<ReleaseTester>(LifestyleType.Transient);         Assert.AreEqual(0, ReleaseTester.refCount);         var weakRef = new WeakReference(container.Resolve<ReleaseTester>());         Assert.AreEqual(1, ReleaseTester.refCount);         GC.Collect();         GC.WaitForPendingFinalizers();         Assert.AreEqual(0, ReleaseTester.refCount, "Component not released");     }      private class ReleaseTester     {         public static int refCount = 0;          public ReleaseTester()         {             refCount++;         }          ~ReleaseTester()         {             refCount--;         }     }   Am I right assuming that, based on the test above, I can conclude that Windsor will not leak memory when using the NoTrackingReleasePolicy ?


Even though I have files placed in my var/www/ folder and apache2 is running, I don't get any files listed. Also I can't access any files directly and inserting an index.html file does nothing.  I'm on trusty 64

I recently installed Ubuntu 14.04, then I installed lamp-server and placed my webpages in /var/www directory, but when I opened localhost in the browser there was nothing. I think that happened because Zend updated Apache.  Whatever the reason may be, I want to know where to keep my php files so that I can access them from my browser.


I am prepending inputs on a dom element div as shown below:

Add inputs

  <input type="text">   function addInputs() {   $("#inputsContainer").prepend("<input type='text'>"); }  $("input").focusin(function(){   $(this).css("background-color", "#FFFFCC"); });   This focusin works on hardcoded inputs, but does not trigger on prepended inputs. Let me know where I am going wrong.

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 am trying to analyze data which there were two groups, control and treatment.  Both groups were given a pre-test and post-test.  The control group received differentiated instruction and the control group received teacher directed instruction.  Trying to find out if there is a difference in student achievement. I am trying to use SPSS program

Imagine the following common design:   100 participants are randomly allocated to either a treatment or a control group the dependent variable is numeric and measured pre- and post- treatment   Three obvious options for analysing such data are:   Test the group by time interaction effect in mixed ANOVA Do an ANCOVA with condition as the IV and the pre- measure as the covariate and post measure as the DV Do a t-test with condition as the IV and pre-post change scores as the DV   Question:    What is the best way to analyse such data?  Are there reasons to prefer one approach over another?


Hello all,  I'd like more information as to why a question deemed Localized is grounds for closing.  An example:   I find the notion somewhat disturbing since the target of the question is irrelevant as long it is on topic. On many programming forums (or user forums if we drive a parallel to Super User where this question  for the same reason) I must say, in near 20 years, I cannot remember a question ever being closed by its moderators on grounds of being "too localized".  Another thought: On both cases, before the question was closed, apparent valid or useful answers were given, which does show the ability of the forum users to provide valuable information on this type of questions. This displaces the notion this type of question may not find any interest, or may not be answerable.  Finally, I cannot see any information on the FAQ with "Localized" as a type of question to avoid.

What is the definition of "too localized" for closing a question? I see several suggestions, but nothing definitive or specific.


celArray.push(cel.slice()); //celArray [][][]  cel [][]  I add many different values of cel in celArray but the problem is that when I change the external cel all values in celArray change to cel even if I used slice() to copy by value and not by reference .

What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but . I've done things like obj = JSON.parse(JSON.stringify(o)); but question the efficiency.  I've also seen recursive copying functions with various flaws.  I'm surprised no canonical solution exists.


When I bought my XPS13 9333 I got angry with Windows, wiped it, and installed Ubuntu.  My son now wants Windows for gaming (thanks Lego World!).  I don't know my product key (but expect I can get it from Dell) and need a detailed "how to" on partitioning and installing Windows.  I think I wiped it so clean that I can't restore it to factory settings and don't have any recovery disks (may need to order from Dell).  Any help is appreciated! /M

I have a computer which is currently running Ubuntu 14.04. I would like to dual boot with Windows 8. I can not find any instructions for installing Windows after Ubuntu is already installed. I am only finding instructions for doing the opposite, Installing Ubuntu after Windows 8.


It has been well established that stargates use 6 points in space and 1 point of origin to establish a wormhole in the same galaxy(7 chevron address, has been told repeatedly in SG-1) for models later than destiny stargates, but how are wormholes established with destiny-era stargates?  The gates put by seed ships before the destiny was launched use abstract symbols rather than actual constellations. It is hard to get 7 points in space when the ship is moving through billions of light years (said in first episode of SGU). Galaxies move as well as the planetary systems, reason it is hard to have 7 points in space. Destiny-era gates only dial gates in close vicinity rather than later models.

Simple question - What is the address they dial to connect with the Ancient ship Destiny in Stargate Universe from Icarus base.  I have found the address on  - however they have an unconfirmed order, and not sure of the validity of this.  Any help deciphering the above would be great!


In PyQt5 there are many ways to instantiate a QSlider.  (1) With no arguments, it will construct the default vertically oriented slider with no parent.  slider = QSlider() # Equivalent to # slider = QSlider(orientation=Qt.Vertical, parent=None)   (2) With a Qt.Orientation argument.  slider = QSlider(Qt.Horizontal) # Equivalent to # slider = QSlider(orientation=Qt.Horizontal, parent=None)   (3) With both Qt.Orientation and QWidget arguments.  window = QWidget() slider = QSlider(Qt.Horizontal, window) # Equivalent to # slider = QSlider(orientation=Qt.Horizontal, parent=window)   This is all understandable, but then how is it also possible to pass just the second argument as a non keyword argument?  (4) With a QWidget argument.  window = QWidget() slider = QSlider(window) # Equivalent to # slider = QSlider(orientation=Qt.Vertical, parent=window)   Is this an ability available to PyQt classes because they are really C++ classes with overloaded functions, or can this be emulated just in Python? I suppose for this particular case you can check the type of the first argument, and the constructor might look something like this:  class QSlider(QAbstractSlider):      def __init__(self, orientation=Qt.Vertical, parent=None):         if isinstance(orientation, QWidget):             parent = orientation             orientation = Qt.Vertical         super().__init__(parent)         # do stuff   But if both arguments accept the same type of object, then it doesn't work. So must a different type of object be used for each argument, or is there another way that this is achieved? If I want to subclass QSlider with another optional argument, and still retain all the possible QSlider constructors above, then more type checks are needed. Is the type checking the best way to enable constructing the class with all those options? The more arguments added the more tedious this becomes.  class MySlider(QSlider):      def __init__(self, x=1, orientation=Qt.Vertical, parent=None):         if isinstance(orientation, QWidget):             parent = orientation             orientation = Qt.Vertical         if isinstance(x, Qt.Orientation):             orientation = x             x = 1         elif isinstance(x, QWidget):             parent = x             x = 1         super().__init__(orientation, parent)   And now there is a problem due to Qt.Vertical/Qt.Horizontal also being integers:  >>> Qt.Horizontal 1 >>> isinstance(Qt.Horizontal, int) True   Meaning QSlider(1) would result in a horizontal slider. So someone calling MySlider(1) might expect the same behavior, but in reality the 1 would be assigned to x, and the orientation would still be vertical.

Let's say I have a class that has a member called data which is a list.    I want to be able to initialize the class with, for example, a filename (which contains data to initialize the list) or with an actual list.  What's your technique for doing this?  Do you just check the type by looking at __class__?  Is there some trick I might be missing?  I'm used to C++ where overloading by argument type is easy.


With the launch of the new tagging system in OS X Mavericks, the ability to color the actual folder line in the finder appears to be gone.   Is there anyway to bring this back??

I used to be able to color code each folder in Finder.   I know I can use tags in Mavericks, but is there a way to restore the ability to actually color code folders?  Thanks.


Essentially, this code should take input from user for:trip description, miles of trip, and gallons of gas used.  That info should be placed into an array for each, then have the MPG for each trip calculated. In the end I want it to display a listing that includes: name, miles traveled and the MPG for each trip.  The problem I am having is that the code compiles, but when executed I receive:     Exception in thread "main" java.lang.NullPointerException       at week6challenge.Week6Challenge.main(Week6Challenge.java:25)   Java Result: 1"   I am still VERY new to programming and I have searched for solutions all over, but I cannot find how to fix it. I learned what the problem is, but an clueless as to how to fix it. Any help would be GREATLY appreciated. Thanks!  Code:  import java.util.Scanner; public class Week6Challenge {      public static void main(String[] args) {         Scanner scan = new Scanner (System.in);         int count = 0;         String[] tripName = null;         double[] tripMiles = null;         double[] tripMPG = null;         double miles = 0, gallons = 0;          while (count <= 10){             System.out.println("Enter a description of this trip");             tripName[count] = scan.next();             count++;              System.out.println("How many miles did you drive?");             tripMiles[count] = scan.nextDouble();              System.out.println("How many gallons of gas did you use on this trip");             tripMPG[count] = answer(miles, gallons);         }         int k = 0;         System.out.println("Trip Name \t Miles Traveled \t MPG");          while(k < 10){             System.out.println(tripName[k]+ "\t" + tripMiles[k] + "\t" + tripMPG[k]);             k = k++;         }     }      public static double answer(double num1, double num2){         return (num1 / num2);     }     }

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


How to modify and apply concatination on the following result  This is the first table:  DECLARE @item_tbl TABLE ( ItemId INT,Title NVARCHAR(20)) INSERT INTO @item_tbl VALUES (1,'Title 1'),(2,'Title 2') ,(3,'Title 3'),(4,'Title 4'),(5,'Title 5')   This is the second table:  DECLARE @item_ref TABLE (ReferenceId INT, FromItemId INT, ToItemId INT)  INSERT INTO @item_ref VALUES(1,1,2),(2,1,3),(3,4,5),(4,5,1)   There is some interelation between table 1 & table 2  SELECT AA.Title, ISNULL(BB.Hasreferenceto,'') Hasreferenceto, ISNULL(CC.Isreferencedfrom,'') Isreferencedfrom FROM   @item_tbl AA LEFT JOIN ( SELECT A.FromItemId, B.Title Hasreferenceto FROM @item_ref A LEFT JOIN @item_tbl B  ON A.ToItemId =B.ItemId  ) BB ON AA.ItemId = BB.FromItemId LEFT JOIN ( SELECT C.ToItemId, D.Title Isreferencedfrom  FROM @item_ref C LEFT JOIN @item_tbl D ON C.FromItemId = D.ItemId ) CC ON AA.ItemId = CC.ToItemId   This is giving me:  +---------+------------------+--------------------+ | Title   | Hasreferenceto   | Isreferencedfrom   | +---------+------------------+--------------------+ | Title 1 | Title 2          | Title 5            | +---------+------------------+--------------------+ | Title 1 | Title 3          | Title 5            | +---------+------------------+--------------------+ | Title 2 |                  | Title 1            | +---------+------------------+--------------------+ | Title 3 |                  | Title 1            | +---------+------------------+--------------------+ | Title 4 | Title 5          |                    | +---------+------------------+--------------------+ | Title 5 | Title 1          | Title 4            | +---------+------------------+--------------------+   What i want is:  +---------+------------------+--------------------+ | Title   | Hasreferenceto   | Isreferencedfrom   | +---------+------------------+--------------------+ | Title 1 | Title 2, Title 3 | Title 5            | +---------+------------------+--------------------+ | Title 2 |                  | Title 1            | +---------+------------------+--------------------+ | Title 3 |                  | Title 1            | +---------+------------------+--------------------+ | Title 4 | Title 5          |                    | +---------+------------------+--------------------+ | Title 5 | Title 1          | Title 4            | +---------+------------------+--------------------+   Can someone help in this please?

I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).  In the original app, we used almost entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's group_concat function fairly frequently.  group_concat, by the way, does this: given a table of, say, employee names and projects...  SELECT empName, projID FROM project_members;   returns:  ANDY   |  A100 ANDY   |  B391 ANDY   |  X010 TOM    |  A100 TOM    |  A510   ... and here's what you get with group_concat:  SELECT      empName, group_concat(projID SEPARATOR ' / ')  FROM      project_members  GROUP BY      empName;   returns:  ANDY   |  A100 / B391 / X010 TOM    |  A100 / A510   So what I'd like to know is: Is it possible to write, say, a user-defined function in SQL Server which emulates the functionality of group_concat?   I have almost no experience using UDFs, stored procedures, or anything like that, just straight-up SQL, so please err on the side of too much explanation :)


Is there any method to configure linux kernel in such way (just an example):  make config CONFIG_OPTION=y && make config CONFIG_OPTION1=no CONFIG_OPTION3=64 CONFIG_OPTION4=/path/   and all the dependencies and alternatives of these configuration options will be set automatically in non-interactive mode.

I want to automate a Linux build but eventually get to a point where I need to run what seems to be a very manual step: make menuconfig.  This seems to synchronize configs between the OS and kernel configs?  cp git-tracked-config .config make defconfig  make menuconfig # <- how to automate/script this? make V=s   Basically, how can I remove the call to make menuconfig for a build script?  As an aside, this is in reaction to a build error that seems to happen when I run without ever calling make menuconfig:  make[1]: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'.  Stop.   Which seems to be there is a missing rule in a makefile perhaps because the makefile itself does NOT exist or the makefile has not been generated/morphed to contain that rule but that is a separate question.  There could be a smarter way to approach this alltogether.  Are there other configs that I'm not tracking but should (e.g. oldconfig)?


If you cast let's say Magic Missile, and then used your bonus action to Quicken Spell let's say Eldritch Blast, would that not work because of this?:     A spell cast with a bonus action is especially swift. You must use a   bonus action on your turn to cast the spell, provided that you haven’t   already taken a bonus action this turn. You can’t cast another spell   during the same turn, except for a cantrip with a casting time of 1   action.   If you cast a non-cantrip spell as your action, does that just negate your ability to use spells in your bonus action, cantrip or not?  Or is it in order where you only have to cast a spell with your main action first, and only then can you still have your bonus action?  But then that would mean you still had your bonus action, and since you already cast a spell with your main action, can you then use a bonus action to cast a non-cantrip spell, since it only prohibits the casting of non-cantrip spells after a bonus action spell has been used (and it hasn't been yet)?  Similarly: If you cast a bonus action cantrip first, does that mean you are unable to then cast a non-cantrip spell for your action?  I was always under the assumption that you were only unable to cast non-cantrip spells with either full action or bonus action if the other has already been used to cast a non-cantrip. (hence why Action Surge spellcasting works as that is another full action rather than a bonus action)  In case the question is a bit too badly written by myself to parse, some examples: Are these valid, if not, which of them are?:  1)     Action: Fireball      Action Surge: Fireball      Bonus Action: Shillelagh   2)     Action: Fireball      Bonus Action: Shillelagh      Action Surge: Fireball   3)     Bonus Action: Shillelagh      Action: Fireball      Action Surge: Fireball

When casting a spell as a bonus action, you can't cast another spell on the same turn except a 1-action cantrip - can the order be "reversed"? Can you cast a cantrip first as a bonus action, then any other spell? If not, would it be broken to allow it?  I'm thinking a Sorcerer casting a Quickened true strike, then casting a leveled spell requiring a touch attack. Seems like a great use of the cantrip + Metamagic feature, but it seems like it is not allowed.


I want to switch from ubuntu to windows 7  using usb  because I don't have a dvd/cd drive pls help

I don't have cd burner, so I want to install W7 on my 2nd computer via an USB-Drive. I just copied the files from the iso but it won't boot. So I installed ms-sys and did a ms-sys -7 /dev/sdb but it just says "Boot error".  How can I install it the right way? Tried many different tutorials by now but none worked.


The diameter of sand grains in a special sand roof, measured in mm, can be considered as a random variable X with probability density $$f(x)=\begin{cases} k(x-x^2) & \text{if 0≤x≤1 }  \\ \newline 0 &\text{otherwhise} \end{cases}$$ A) Determine the constant k so that this becomes a valid probability density $1=k\int _0^1x-x^2dx$ $k=6 $ B)Find the expectation $E (4X + 3)$ and the variance $V (4X + 3)$ I should be able to find the expectation and the variance, but what do I do now? $\int _0^1\left(6\left(x-x^2\right)\right)\: = 1$ Is this the way? $$\mathsf E(4X+3) = 4\mathsf E(X)+3\\\mathsf{Var}(4X+3)=4^2\mathsf{Var}(X)$$ any tips/solutions? thanks in advance

The diameter of sand grains in a special sand roof, measured in mm, can be considered as a random variable X with probability density $$f(x)=\begin{cases} k(x-x^2) & \text{if 0≤x≤1 }  \\ \newline 0 &\text{otherwhise} \end{cases}$$ A) Determine the constant k so that this becomes a valid probability density $1=k\int _0^1x-x^2dx$ $=\int _0^1xdx-\int _0^1x^2dx$ $\int _0^1xdx = \frac{1}{2} $ $\int _0^1x^2dx = \frac{1}{3}$ $=\frac{1}{2}-\frac{1}{3}= \frac{1}{6}$ $k = 0.16666$ B)Find the expectation $E (4X + 3)$ and the variance $V (4X + 3)$ Does anyone know how to go about these two questions? on a) I am pretty sure that I got the correct answer. on b I'm pretty much clueless... any tips/solutions? thanks in advance


I'am trying to print my timestamp formated date & time from mysql database in php Codeigniter but this will give me a error message : A non well formed numeric value encountered  My code: if ($userTasks) {    foreach ($userTasks as $key) {        echo time_convert($key->t_time);    } }   public function time_convert($timestamp){    return date('l Y/m/d H:i', $timestamp); }

I have a datetime column in MySQL.   How can I convert it to the display as mm/dd/yy H:M (AM/PM) using PHP?


Let $X$ be a vector space, equipped with two norms $\|\cdot\|_1$ and $\|\cdot\|_2$ Which are equivalent.   What is the easiest way to prove that these two equivalent norms induce same topology?

Note that (1) all norms on finite dimensional vector space are equivalent.  And here (2) norms on vector space are equivalent iff they have same topology.   Question : How can we prove (2) ? Please recommend reference  Thank you in anticipation


I have created a bounty on a question. None of the answers I believe are adequate because they do not address my questions. My problem has been asked many times before so I was kind enough to link ALL of the previous none answer questions in my question and make a big bounty for someone to answer it.. but this is what happened:  FYI the question is here:    One of the answers is someone actually even clearly saying that they are making a general comment Another answer was someone saying they are not an expert in the field but this might work.   Clearly both are absurd answers. The other answer was someone who made an attempt but it was a hack and even suggested so. All are poor answers - well not even considered as answers in my view!  I have flagged to have the question moved the more associated Meta (to gain more response) a few times but no response.  Since it has had views and interest - it is not fair to reward the answer or auto reward the bounty to someone as the answers are poor. I am happy to give the bounty to someone worthy as I want a good answer. Those people who have posted have clearly shown no respect and it is not fair to all the people who have bookmarked my question, voted my question higher as it is a need within the Magento commnuity for them to answer:   Why do you need to turn a live production website off to deploy new code? Possibly loose sales Why do you need deploy all static cache files to make one change to CSS which takes 35-45mins

Shouldn't there be a way to prevent automatic awarding of a bounty? For example, if someone provides an answer that sounds good but is totally wrong, it may happen that it gets a score of +2, but doesn't deserve the bounty. If no one else answers, half the bounty will automatically go to this person. Automatic awarding is good if an inactive user offers a bounty, but I think there should be a button that basically means "I know the bounty should now be awarded, but I have read the answers and none of them deserve the bounty".  The button should obviously not refund the bounty, just let it go to /dev/null instead of awarding it to someone who doesn't deserve it.


Currently, I am using tabularx what enables me to set columnwidth. The only thing that I would like to change is to align all text on the left side, instead of how it is now (centered in some cases). For example: "primary functional goals" is in a centered (?) way aligned, instead of on the left side, what I prefer. In the images you see my code and the result. Thank you!

I would like to create a table with some columns' width specified, while the text in those columns should be centered both horizontally and vertically. I found out that  \usepackage{array} \begin{tabular}{| c | c | m{5cm} |}   vertically centers the text in the last column, but justifies it horizontally (like text in normal paragraphs).  Update: With Jake's method, it seems both \\ and \hline cause an error. How to fix it?


Recently, I came across a beautiful question. I tried several ways of solving it, but I could not reach anywhere. The question goes like:  Prove that:  $$a\sin x+b\cos x=\sqrt{a^2+b^2} \sin\left(x+\tan^{-1}\left(\frac{b}{a}\right)\right)$$  Please give me a hint. Thanks in advance.

I don't understand this. These identities are given in the online notes for MIT's 18.01 calculus class. It's related to taking the sum of two trig functions and transforming them into a single trig function. I can use the formulas to do this, but I am having trouble finding anything on the internet to use a proof for my understanding.  Thanks for any responses!  EDITED (added after the first answer):  Sorry, the identity goes like this:  $A\sin{k(x-c)}=a\sin{kx}+b\cos{kx}$ ,  with the relationships  $a=A\cos{kc}$ , $b=-A\sin{kc}$ , $A=\sqrt{a^2+b^2}$ , and $\tan{kc}=-b/a$


My drive storage is almost full, so I'm not sure whether that is the cause of this particular issue.  This is on Ubuntu 18.04.

My Ubuntu cloud server has left only 900MB of disk space.   I'll just empty the directory /tmp and wondering if there is any other location to clean up.


I have just installed Ubuntu 14.04 and it got to the prompt which said it had finished installing and needed to be restarted. When booting it shows a purple screen then the monitor switches off after with no video response. I can boot using recovery mode, so I think it might be graphics card related.  Is it possible to edit the settings to make the normal boot use default video drivers?

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


When you create a C++ console application under Windows you automatically get the console window created for you and std::cout outputs to the console window.  I have a GUI application for which I also want to create a console window. I can create the console window using the  AllocConsole() function, but how do I redirect / attach std::cout to the console so that the output appears in the console window?

I have an application which is a relatively old. Through some minor changes, it builds nearly perfectly with Visual C++ 2008. One thing that I've noticed is that my "debug console" isn't quite working right. Basically in the past, I've use AllocConsole() to create a console for my debug output to go to. Then I would use freopen to redirect stdout to it. This worked perfectly with both C and C++ style IO.  Now, it seems that it will only work with C style IO. What is the proper way to redirect things like cout to a console allocated with AllocConsole()?  Here's the code which used to work:  if(AllocConsole()) {     freopen("CONOUT$", "wt", stdout);     SetConsoleTitle("Debug Console");     SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED); }   EDIT: one thing which occurred to me is that I could make a custom streambuf whose overflow method writes using C style IO and replace std::cout's default stream buffer with it. But that seems like a cop-out. Is there a proper way to do this in 2008? Or is this perhaps something that MS overlooked?  EDIT2: OK, so I've made an implementaiton of the idea I spelled out above. Basically it looks like this:  class outbuf : public std::streambuf { public:     outbuf() {         setp(0, 0);     }      virtual int_type overflow(int_type c = traits_type::eof()) {         return fputc(c, stdout) == EOF ? traits_type::eof() : c;     } };  int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) {     // create the console     if(AllocConsole()) {         freopen("CONOUT$", "w", stdout);         SetConsoleTitle("Debug Console");         SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED);       }      // set std::cout to use my custom streambuf     outbuf ob;     std::streambuf *sb = std::cout.rdbuf(&ob);      // do some work here      // make sure to restore the original so we don't get a crash on close!     std::cout.rdbuf(sb);     return 0; }   Anyone have a better/cleaner solution than just forcing std::cout to be a glorified fputc?


I have an Aspire E14 with dual boot, first option Ubuntu and then Windows 10. I want to upgrade, the message appears on the start screen. But my concern is what can I hope with the dual boot and my files in Windows? Windows OS has some critical info for me and I don't want to lose it.

I am planning to upgrade from 8.10 to 10.04. But I am wondering whether there will be data loss during the upgrade.  For example:   Will the applications that I have installed on 8.10 still be there after upgrade? Will the settings of application such as the bookmarks for Firefox and for Google Chrome be preserved? Will all the personal files under my home directory be preserved?   Is there anything else I need to know about upgrading?


I'm writing a program that involves reading data from a database and displaying it in a table in a GUI. I'm trying to convert a 2D ArrayList to a 2D array, by doing 1 column at a time, but when the list is converted, it's only returning a reference of some kind. I don't understand why this is and how I can fix it  The code I am trying is:      System.out.println(columns);     Object[] column0 = new String[15];     column0 = columns.get(0).toArray();     System.out.println(column0);   The arrayList in question, columns, is  [[802018    , 800319    , 800319    , 800319    , 800319    , 800319    , 802112    , 802112    , 802112    , 802002    , 802002    , 802002    , 802003    , 802003    , 802013    , 802013    ], [5C92      , 1C19      , 1A33      , 1C36      , 1K71      , 5K71      , 1C05      , 1A92      , 5A92      , 1A14      , 1C84      , 5C84      , 1A85      , 5A85      , 1C81      , 5C81      ], [505, 1515, 1838, 2337, 515, 759, 805, 1500, 2048, 1053, 1303, 1900, 1101, 1640, 1203, 1755]] and the column0 list is only showing as [Ljava.lang.Object;@436e852b

In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]


To fans (myself included) seeing a lot of the old cast return was a huge leap back to my childhood. But for some, the role wasn't all that exciting. In a lot of interviews about the return to the role of Han Solo, Harrison Ford provided a few statements that came across (with his usual "grumpy" attitude) that the role was not all that exciting.  “Well, I didn’t have a job,” he says with a wry grin. [...]At 73, Ford is one of the few action heroes who can also claim senior citizen status, which might explain his hesitation at returning to this iconic role.   As well as a bit of a joke line from the movie that branches off from a real-life experience that  covers:  "Are you Harrison Ford?"/"Are you Han Solo?" "I used to be..."  There was also another interview that involved him, Daisy Ridley and John Boyega in which he refused to talk about his role, and instead focused on the Ridley and Boyega's involvement in the movie (with some excitement, from memory). So my question is:   Whose idea was it to kill off Han Solo?

Towards the end of the new Star Wars film The Force Awakens,      Kylo Ren kills his father, Han Solo.   This event caused a lot of grief among fans who were devastated to see this character go, and the filmmakers surely anticipated such a reaction.  Why, out of universe, was the decision made to kill off this character?


Input:     blalasdl8ujd "key":"value", blblabla asdw   "alo":"ebobo",blabla"www":"zzzz"   or     blalasdl8ujd key [any_chars_here] "value", blabla asdw   "alo":"ebobo", bla"www":"zzzz"   I'm tring to extract value having only key and knowing that value is covered with "  Following regex key.*"(.*?)" returns the last match covered with " ("zzzz"). I need to fix it to return first.

I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?


The lognormal density function is usually plotted on a linear x axis. I find it useful to visualize the lognormal density on a logarithmic x axis (for example when choosing a lognormal prior in a Bayesian model). To do so, initially I would simply take the log of the x axis and plot the density, but I soon realized that this didn't look right (the median on the linear x axis plot wouldn't match the mean on the log x axis plot). After some study I realized that changing the coordinates is equivalent to transforming the random variable, and I needed to scale the lognormal density by a factor of $x$ in order to plot it on a logarithmic x axis as shown in the graph below:  meanlog = 0; sdlog = 1 par(mfrow=c(1,2)) xlim = c(qlnorm(0.001, meanlog=meanlog, sdlog=sdlog),           qlnorm(0.999, meanlog=meanlog, sdlog=sdlog)) x = seq(xlim[1], xlim[2], length.out=10000) y = dlnorm(x, meanlog=meanlog, sdlog=sdlog) plot(x, y, type="l", xlab="x", ylab="Density",       main="Linear x axis") abline(v=exp(meanlog)); text(exp(meanlog)+1.8, 0.405, "Median")  plot(log(x), y*x, type='l', xlab="x", ylab="Density", xaxt="n",       main="Logarithmic x axis") abline(v=meanlog); text(meanlog+0.5, 0.405, "Median") lims = par("usr")[1:2]; base = exp(1) lims = base^lims     minPow = floor(log10(lims[1]));  maxPow = ceiling(log10(lims[2])) powSeq = seq(minPow, maxPow);  axSeq = 10^powSeq axis(1, at=log(axSeq, base=base), labels=as.character(axSeq)) for (i in 1:length(axSeq)){    bb = (1:10)/10; a = (bb*10^powSeq[i]);       axis(1, at=log(a, base=base), tcl=-0.25, labels=F) }     The rationale for the scaling factor is provided below:  Suppose that $W$ is lognormally distributed, and $X = \ln(W)$, so $e^X = W$. The distribution function of $X$ is:  $F_X(x) = P(X \le x) = P (X \le \ln(w)) = P(e^X \le w) = P(W \le w) = L_X(e^x)$  where $L_X(x)$ is the lognormal distribution function. The density function of $X$ can be obtained by differentiating its distribution function:  $f_X(x) = \frac{d}{dx} L_X(e^x) = e^x l_X(e^x) = w l_X(w)$  where $l_X(x)$ is the lognormal density function.  Although I'm fairly confident that the arguments above are correct I'm not a statistician or mathematician, and I would appreciate if more qualified users could either confirm them or correct them.

To understand what I mean, let's use two well-known distributions: the normal and lognormal ones.  From the dataset point of view, if you take normally-distributed data and take their exponential, you get lognormally-distributed data (norm -exp-> lognorm).  So the "idea" was: why not using the PDF directy and transform the normal PDF to the lognormal one by taking the exponential of its x-axis. The reasoning was that this x-axis represents my data: taking the exponential of these data or the exponential of the x-axis of the corresponding PDF should do the same.  But I did not even bother to do it: mathematically, this is not how one can transform the normal PDF to the lognormal one!  What I don't understand is why just taking the exponential of the x-axis of the PDF does not work. I mean, not mathematically (I get that there is a $1/x$ in the lognormal PDF!), but what is conceptually wrong with "just stretching" the axis?


The code below leads to this table:    where the right hand side goes off the page but the last column of data is not displayed. The table should fit on the page -- it is not too wide, except that the right column is inexplicably extended off of the page. For instance, the caption is wider than where the last column of data should be, and that caption easily fits in the page. What am I missing?  \begin{table}[ht]   \caption{Site and structural characterization data for the samples in this study.}   \begin{center} \begin{tabular}{c c c c c c} \hline  \multicolumn{1}{p{1.5cm}}{\centering Sample} & \multicolumn{1}{p{1.5cm}}{\centering Si/Sn \\Ratio \\ (AAS)$^a$\\} & \multicolumn{1}{p{1.5cm}}{\centering Si/Sn\\ Ratio \\ (EDS)$^b$} & \multicolumn{1}{p{1.5cm}}{\centering V\textsubscript{ads, micro}\\(cm$^3$ g\textsuperscript{-1})} & \multicolumn{1}{p{1.5cm}}{\centering DRUV \\Band \\ Center\\ (nm)$^e$} & \multicolumn{1}{p{1.5cm}}{\centering DRUV\\ Edge \\Energy\\ (eV)$^e$} \\\hline  Sn-CHA-F-60&59&65&0.16$^c$&219&4.33\\ Sn-CHA-F-70&70&65&0.15$^c$&223&4.12\\ Sn-Beta-F-116&116&122&0.23$^d$&222&4.23\\  Sn-xerogel&110&130&0.02$^c$&245&4.37\\ Si-CHA-F&n.m.*&n.m.*&0.23$^c$&n.m.*&n.m.*\\\hline \multicolumn{6}{l}{$^a$Bulk composition determined by atomic absorption spectroscopy (AAS).} \\ \multicolumn{6}{l}{$^b$Composition determined by energy dispersive X-ray spectroscopy (EDS).} \\ \multicolumn{6}{l}{$^c$Micropore volume determined from Ar adsorption isotherms (87 K). } \\ \multicolumn{6}{l}{$^d$Micropore volume determined from N$_2$ adsorption isotherms (77 K). } \\ \multicolumn{6}{l}{$^e$Diffuse reflectance UV-Vis spectra (band center at maximum F(R) intensity) and Tauc plots for samples after dehydration at 523 K (Section \ref{sec: chas5}). } \\ \multicolumn{6}{l}{*n. m., not measured} \\ \end{tabular}   \end{center}   \label{ta: cd3cn1} \end{table}

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 found that if the series $\sum {a_n}$ convergences conditionally, there exists the convergent rearrangement series $\sum {b_n}$.  For example, Let rearrangement of $$\sum {(-1)^{n+1} \frac{1}{n}} = ln2$$ is  $$ 1 - \frac{1}{2} - \frac{1}4 + \frac{1}3 - \frac{1}6 - \frac{1}8 + \cdots $$  Can I roughly associate some terms like this?  $$ \left( \frac{1}1 - \frac{1}2 - \frac{1}4 \right) + \left(  \frac{1}3 - \frac{1}6 - \frac{1}8 \right ) + \cdots $$  so, the normal term is  $$ \frac{1}{2n - 1} - \frac{1}{4n-2} - \frac{1}{4n} $$  like this?  If I calculate like this, the result is $\frac{1}{2} ln2$  But, can I assure that the associative property is valid for this rearranged series? I even don't know this series converges or diverges. Would you please give me the right, strict and reliable answer?  I want to show the possibility of associative property in this rearranged series. Because normally, the associative property is invalid in infinite series. Is it OK to associate some terms if the original form is convergent conditionally?

I was looking through my lecture notes and got puzzled by the following fact: if we want to find the value of some infinite series we are allowed to rearrange only the finite number of its terms. To visualize this consider the alternating harmonic series: $$\sum_{n=1}^\infty(-1)^{k-1}\frac1k=1-\frac12+\frac13-\frac14+\frac15-+\dots=0.693147...$$  But if we rearrange the terms as follows the value of the series gets influenced by this action: $$1+\frac13-\frac12+\frac15+\frac17-\frac14+\dots=1.03972...$$  So commutativity of addition isn't true on infinity? How was it obtained and how can it be proved?


I am facing a very specific problem when trying to implement a generic queue in C++. Here is the code:  template <class T> class Queue  {      private:         T * queue;         int front;         int back;         int MAX_SIZE;      public:         Queue(){             Queue(SOME_PREDEFINED_CONSTANT);         }          Queue(int size){             queue = new T[size];             MAX_SIZE = size;             front = 0;             back = 0;             cout << "inside constructor:" << " back= " << back <<  " front=" << front << endl;          }          void push(const T entry){              if(back < MAX_SIZE){                 queue[back] = entry;                 back++;             }         }          T peek(){              return queue[front];          }          void pop(){              if(size() > 0){                 front++;             }             if(front==back){                 front = 0;                 back = 0;             }         }          int size(){             cout << "size:" << " back=" << back <<  " front=" << front << endl;             return (back-front);         } };   When I am initializing the queue, like this: Queue <int> q;, I get the correct values of back and front inside the constructor; The output:     inside constructor: back=0 front=0   But when I am asking for the size of the queue, like this: q.size() (without any push/pop operation), I get very weird values of back and front. One sample output:     size: back=32766 front=-746749592   Can anyone please point out what I am doing wrong here?

As a  developer I'm used to running through constructors:    class Test {     public Test() {         DoSomething();     }      public Test(int count) : this() {         DoSomethingWithCount(count);     }      public Test(int count, string name) : this(count) {         DoSomethingWithName(name);     } }   Is there a way to do this in C++?  I tried calling the Class name and using the 'this' keyword, but both fail.


I am writing a story and would like to know which one is correct:  a) "...and it was impossible to know who was sheltering whom."  b) "...and it was impossible to know who was sheltering who."  I tried to apply the 'replace who by he/him' method, but I didn't figure out yet.  I appreciate your help.

I know that who is used when asking about a subject (Who is at the door?) and whom is used when asking about an object (By whom was the door opened?). How do you determine which one to use when the object becomes the subject of another clause?   For example, take the sentence:      I gave the prize to ____ deserved it most.   Would it be whomever because it's the object of "gave," or would it be whoever because it's the subject of "deserved"? Is their a hard-and-fast rule to rely on in situations like this?


Question: Let $n > 1$ be a natural number and $p$ be a prime such that $p\mid n^3-1$ and $n\mid p-1$. Prove that $4p-3$ is a perfect square.   My solution: Given that $p\mid(n^3-1)$, thus we have $p\mid(n-1)$ or $p\mid(n^2+n+1)$. We also have $n\mid(p-1)$. Let us make cases.   Case 1: $p\mid(n-1)$ and $n\mid(p-1)$. Since $p-1\ge 1$ and $n>1$. Thus we can conclude that $p\mid(n-1)\implies p\le n-1$ and $n\mid(p-1)\implies n\le p-1$. Thus we have $n\le p-1\le n-2\implies n\le n-2\implies 0\le-2$, which is a clear contradiction. Hence $p\not\mid(n-1)$.   Case 2: $p\mid(n^2+n+1)$ and $n\mid(p-1)$. Thus, $\exists k\in\mathbb{Z},$ such that $pk=n^2+n+1$ and $\exists q'\in\mathbb{Z}$, such that $p=nq'+1$. Now $n^2+n+1\equiv 1\pmod n$ and $p\equiv 1\pmod n\implies pk\equiv k\pmod n\implies k\equiv pk=n^2+n+1\equiv 1\pmod n\implies k\equiv 1\pmod n.$   Thus $\exists q\in\mathbb{Z}$, such that $k=nq+1$. Hence we have $$p=nq'+1 \text{ and } k=nq+1\\ \implies pk=n^2qq'+n(q+q')+1=n^2+n+1\\\implies n(1-qq')=q+q'-1.$$   Now $p=nq'+1\implies nq'=p-1$ and $p-1\ge 1$. Thus $nq'\ge 1$. Now since $n>1$, hence $q'\ge 1$. This again implies that $nq'>1\implies p>2\implies p\ge 3.$   Now $pk=n^2+n+1>3\implies pk>3.$ Now $p\ge 3\implies k\ge 1.$ Now again we have $k=nq+1$. Since, $k\ge 1\implies nq+1\ge 1\implies nq\ge 0\implies q\ge 0$ $(\because n>1).$   Thus $q\ge 0,q'\ge 1\implies qq'\ge 0.$ Also $q+q'\ge 1\implies q+q'-1\ge 0.$ This implies that $n(1-qq')=q+q'-1\ge 0\implies n(1-qq')\ge 0\implies 1-qq'\ge 0 \implies qq'\le 1.$   Therefore, we simultaneously have $qq'\ge 0$ and $qq'\le 1$, which implies that $qq'=0$ or $qq'=1$.   Let us make cases.   Case 1: $qq'=1\implies q=1$ and $q'=1$. Thus $q+q'-1=1$ and $n(1-qq')=0\implies n(1-qq')\neq q+q'-1$, which is a contradiction to the fact that $n(1-qq')=q+q'-1$. Hence $qq'\neq 1$.   Case 2: $qq'=0\implies q=0$. Thus $n=q'-1\implies q'=n+1$, which in turn implies that $p=n(n+1)+1.$ Thus $4p-3=4n(n+1)+1=4n^2+4n+1=(2n+1)^2$.   Hence after analyzing all the cases we can conclude that $4p-3$ is a perfect square and is equal to $(2n+1)^2$, and we are done.   P.S.: I have edited the post and have attached the correct solution to the question.

I really need some help at this problem:     Let $p$ be a prime number and $n$ a natural number, $n\ge2$ such that $n  \mid  p-1$ and $p \mid  n^3-1$. Prove that $4p-3$ is a square.   So $p \mid (n-1)(n^2+n+1)$  What if $p \mid n-1$?   Treating the cases wasn't too efficient. I was thinking about Fermat's theorem but it didn't helped really much.   A hint would be really apreciated. Thanks!


My database value is Ã‰cole Polytechnique FÃ©dÃ©rale de Lausanne. I cannot convert to html characters. I tried to convert using following method,  echo html_entity_decode(Ã‰cole Polytechnique FÃ©dÃ©rale de Lausanne'); echo html_entity_decode($Event['Event_speaker']);   Ist statement i got the actual result and the second one display exactly same as db value.  In my header am using  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta charset="utf-8">   Can someone help??

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.