body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
How to show $A \times (B \cup C) = (A \times B) \cup(A \times C)$, where $A$, $B$, and $C$ are sets. i.e. If $A=\{1,2\}$, $B=\{2,3\}$ then $A \times B = \{(1,2), (1,3), (2,2), (2,3)\}$. I started with the proposition, suppose $x$ is an element of $LHS$, i.e. $A \times (B \cup C)$. Help is appreciated! Thanks. | How do I prove or disprove $X \times (Y \cup Z)= (X \times Y) \cup(X\times Z)$ for all sets $X$, $Y$, and $Z$? I'm lost on the steps here. |
Here's an image of what's happening: I can't change any of the things. Restarting Blender does nothing. This has never happened to me before and I'm unsure to why this is happening now. I saw other people with this problem but they just said that restarting would help but it didn't. Anyone experienced this problem before or knows how to fix it? Thanks in advance. UPDATE: Also tried re-installing which didn't help. Tried deleting all addons which also didn't help. Also found out that when I try move something to another layer I can't use the numbers on my keyboard which is another thing which randomly changed recently. UPDATE 2: Turns out there was an answer. Just had to search other terms into google. If anyone else is having the problem then go User Preferences, Editing and then enable global undo. Don't remember disabling it but I must of at some point. the question where I found the answer. Sorry for wasting anyone's time if they were writing an answer :/ | Sometimes when adding an object to the scene I see that all options (on toolbar or in window after pressing F6) are disabled. Can anyone tell me when can this happen? What is causing it and how to revert it - make it enabled again. It worked for me when I restarted Blender and reloaded the scene. However I would really like to know what can cause it? |
Unable to install flash player on Ubuntu 16.04. I tried locating on Software Center. Didn't help. Tried updating Ubuntu. Didn't help. Tried going through the process of downloading .tar.gz from Adobe. That didn't help either. I tried all three steps on wikihow. Didn't worked for me. What should I do? [Update:] This might help. When I tried running command sudo apt-add-repository multiverse && sudo apt-get update, I get the following message: N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension | I know, it's been asked before but I couldn't really get a satisfying answer for some details/backgrounds and I guess it's an important question for many. Some application seem only to be running with Adobe Flash 15 (or at least I know it does, because I have that version on my Windows Partition). The official Adobe website says: NOTE: Adobe Flash Player 11.2 will be the last version to target Linux as a supported platform. Adobe will continue to provide security backports to Flash Player 11.2 for Linux. Some search on the web like "Ubuntu Adobe Flash 15" or similar does not return any good websites. I found something that says (using a "pepper-based version"), and . Is it impossible to use this for Firefox too? Would it be a privacy risk? Are there no alternative projects (I know it's closed source but there are so many so very bright people out there using something similar to wine but just for the plugin....)? How about the Mac-Version? Shouldn't someone be able to port that one to Linux? |
I am having Ubuntu 14.04 LTS. While trying to install crossvc, I am getting broken package error. I tried to find solutions and tried all the suggested steps in different posts. But no success. LOGS for sudo apt-get install crossvc Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: crossvc : Depends: libqt3-mt (>= 3:3.3.8-b) but it is not installable E: Unable to correct problems, you have held broken packages. LOGS for sudo aptitude install crossvc The following NEW packages will be installed: crossvc{b} libfam0{a} 0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 1300 kB of archives. After unpacking 4048 kB will be used. The following packages have unmet dependencies: crossvc : Depends: libqt3-mt (>= 3:3.3.8-b) which is a virtual package. The following actions will resolve these dependencies: Keep the following packages at their current version: 1) crossvc [Not Installed] Accept this solution? [Y/n/q/?] n *** No more solutions available *** The following actions will resolve these dependencies: Keep the following packages at their current version: 1) crossvc [Not Installed] Accept this solution? [Y/n/q/?] LOGS when installing using Ubuntu Software Center Package dependencies cannot be resolved This error could be caused by required additional software packages which are missing or not installable. Furthermore there could be a conflict between software packages which are not allowed to be installed at the same time. Details: The following packages have unmet dependencies: crossvc: Depends: libc6 (>= 2.4) but 2.19-0ubuntu6 is to be installed Depends: libgcc1 (>= 1:4.1.1) but 1:4.9-20140406-0ubuntu1 is to be installed Depends: libqt3-mt (>= 3:3.3.8-b) but it is not going to be installed Depends: libstdc++6 (>= 4.2.1) but 4.8.2-19ubuntu1 is to be installed Other option tried Even I tried with doing the below for resolving broken package [referred from different posts] but no success. sudo dpkg --configure -a sudo apt-get clean && sudo apt-get update dpkg --get-selections | grep hold [ no package listed ] | Occasionally, when I'm installing stuff, I get an error like the following: Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: package1 : Depends: package2 (>= 1.8) but 1.7.5-1ubuntu1 is to be installed E: Unable to correct problems, you have held broken packages. How can I resolve this? |
I'm newer to this forum, and I'm learning English. My teacher has taught me that we must use gerund after "enjoy", as in: I enjoy swimming. Now, if we use a verb after gerund, which verb should I use: base from or infinitive or gerund? for example: I enjoy helping you improve your English. I enjoy helping you to improve your English. I enjoy helping you improving your English. Thanks in advance. | Given the following sentences: They helped us frame some experimental evaluations. They helped us to frame some experimental evaluations. They helped us in framing some experimental evaluations. They helped us on framing some experimental evaluations. Are all them grammatically correct or not? Are there any semantical nuances introduced by each alternative (and why), or do they mean exactly the same? Are there any other alternatives besides these 4 to convey the same meaning? Finally, which alternative is the best one, or does it depend on the context or writing style? |
I have a fork in my github account and I cloned the fork to my local computer. Now I have made some commits, and pushed it to origin. Then, I updated the readme.md file in the fork directly in GitHub, not in the local clone. I made a commit called Updated readme.md file. Now I wanted to sync it with my local computer. So I ran git pull. This gave me the error: Cannot pull with rebase: You have unstaged changes. Please commit or stash them. After the last commit I have modified 2 files on my local computer. But I no longer want the changes. So, I wanted to remove any changes made to these 2 files and to get in sync with origin. On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: scripts/filename.js Untracked files: (use "git add <file>..." to include in what will be committed) scripts/anotherfile.js no changes added to commit (use "git add" and/or "git commit -a") | How do I discard changes in my working copy that are not in the index? |
What is wrong with the following code? It is not printing the publisher name in 2nd bibliographic entry. What is wrong here? I am using TexStudio with MikConsole. main file: \documentclass[12pt, twoside]{report} \usepackage[utf8]{inputenc} \usepackage[a4paper,width=150mm,top=25mm,bottom=25mm, bindingoffset=6mm]{geometry} \usepackage{graphicx} \usepackage{fancyhdr} \usepackage{lipsum} \usepackage{mwe} \pagestyle{fancy} \usepackage{caption} \usepackage{subcaption} \usepackage{array} \usepackage{amsfonts} \usepackage[style=numeric, sorting=none]{biblatex} \addbibresource{ref.bib} \begin{document} test example \nocite{*} \printbibliography \end{document} ref.bib file: @article{einstein, author = "Albert Einstein", title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German}) [{On} the electrodynamics of moving bodies]", journal = "Annalen der Physik", volume = "322", number = "10", pages = "891--921", year = "1905", DOI = "http://dx.doi.org/10.1002/andp.19053221004", keywords = "physics" } @article{understandingPrivacy, author = "Solove Daniel J", title = "Understanding privacy", publisher = "Harvard University Press", year = "2008", } @book{dirac, title={The Principles of Quantum Mechanics}, author={Paul Adrien Maurice Dirac}, isbn={9780198520115}, series={International series of monographs on physics}, year={1981}, publisher={Clarendon Press}, keywords = {physics} } | Why is there no publisher field on the article entry type in biblatex? I am using biblatex to create my bibliography, however I can't seem to figure out how to reference a publisher in an article Entry Type. For example: The Golden Ratio: A Contrary Viewpoint Clement Falbo The College Mathematics Journal Vol. 36, No. 2 (Mar., 2005), pp. 123-134 (article consists of 12 pages) Published by: Mathematical Association of America How should I include the information about Mathematical Association of America in my entry? |
Prove the following : $$ {{n}\choose{7}}-\left \lfloor{\frac{n}{7}}\right \rfloor $$ is divisible by 7. | This is an exercise from Apostol, which i have been struggling for a while. Given a prime $p$, how does one show that $${n \choose p} \equiv \biggl[\frac{n}{p}\biggr] \ (\text{mod} \ p)$$ Note that $\Bigl[\frac{n}{p}\Bigr]$ denotes the integral part of $\frac{n}{p}$. I would also like to know as to how does one try to solve this problem. Well, what we need is to show is whenever one divides ${n \choose p}$ by a prime $p$ the remainder is the integral part of $\frac{n}{p}$. Now, $${ n \choose p} = \frac{n!}{p! \cdot (n-p)!}$$ Now $n!$ can be written as $$n!= n \cdot (n-1) \cdot (n-2) \cdots (n-p) \cdots 2 \cdot 1$$ But i am really struggling in getting the integral part. |
I often wonder what is the proper pronunciation of "lives", like how would I pronounce "human lives", am I suppose to pronounce it like: Leeves Like i in thing. Or more like: Laives Like i in I'm. I usually say the "Leeves" way, but I mostly hear people say the "Laives" version. I would like to know the proper pronunciation of "lives". | I know that live has several meanings, and two different pronunciations (/lɪv/ and /laɪv/), but I don't know which pronunciation I should use in each case. Can anybody clarify this? |
I'm wondering what is the actual verb in this sentence: "I have to study". Is the verb "have" or "study" ? Is the verb "have" and "to study" the infinitive? | A friend of mine is telling me that " have to " is not a modal verb, even thought I have learned that it is. So is the " have to" a modal verb or not? If not which are the reasons? |
My friend and I had a huge debate about whether the trajectory of a projectile thrown upwards will be affected by the rotation of the earth. We finally concluded after detailed explanations that it should be independent of whether earth is rotating or not. I can't "explain" the reason here (its basically related to the fact that the centripetal force due to gravity would act on it even if it is projected). This question can be simplified to: Whether a ball thrown upwards will come back to the same position if we consider the effect of rotation of the earth? We feel it should reach the same point but then the term Coriolis force struck our minds and we got confused...Can someone clear our confusion? Edit My explanation: When the ball is on the ground, it rotates with the earth due to the centripetal force experienced due to gravity. Similarly, when the object is in air the only difference is that it has lost contact with the earth's surface. It already has a tangential velocity as it was projected from the ground and a centripetal acceleration towards the center of the earth. Therefore, it should still rotate around the axis of the earth as it was earlier (when it was on the ground). I now know that this doesn't happen from some posts on SE but am not clear with why this explanation is false. | If I'm standing at the equator, jump, and land 1 second later, the Earth does NOT move 1000mph (or .28 miles per second) relative to me, since my velocity while jumping is also 1000mph. However, the Earth is moving in a circle (albeit a very large one), while I, while jumping, am moving in a straight line. How much do I move relative to my starting point because of this? I realize it will be a miniscule amount, and not noticeable in practise, but I'd be interested in the theoretical answer. |
I am trying to create a sample app that draws the route between two locations (like the uber app) I have a toggle switch to turn the location on or off in the app.The app works fine and draws the route but when i just launch the app and toggle the location switch to on and then toggle it to off the app crashes showing a nullpointerexception at handler.removeCallbacks(drawPathRunnable); I tried to figure out the error but I failed. Here's my code @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_welcome); // Obtain the SupportMapFragment and get notified when the map is ready to be used. mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this); location_switch = (MaterialAnimatedSwitch)findViewById(R.id.location_switch); location_switch.setOnCheckedChangeListener(new MaterialAnimatedSwitch.OnCheckedChangeListener() { @Override public void onCheckedChanged(boolean isOnline) { if(isOnline) { startLocationUpdates(); displayLocation(); Snackbar.make(mapFragment.getView(),"You are online", Snackbar.LENGTH_SHORT) .show(); } else { stopLocationUpdates(); mCurrent.remove(); mMap.clear(); handler.removeCallbacks(drawPathRunnable); Snackbar.make(mapFragment.getView(),"You are offline", Snackbar.LENGTH_SHORT) .show(); } } }); I have declared handler at the top of my code private Handler handler; Please explain the answer and the cause of the error. | What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? |
I understand that $x_{1} \ mod \ x_{2} : x > 0$ is the remainder after dividing $x_{1}$ by $x_{2}$ ex: $5 \ mod \ 256 = 5$ but what does it mean to say $-x_{1} \ mod \ x_{2} : x > 0$ or $-5 \ mod \ 256$, I thought that it will be $-5$ but it's $251$, also the other way $x_{1} \ mod \ -x_{2} : x > 0$ or $5 \ mod \ -256$. | Since $16 \div{-3} = -5.\overline{3}$, I thought I could also express this as $16 \div{-3} = -5\:R\:1$ or in other words $16\mod{-3} = 1$. My calculator tells my it is in fact $-2$. Along the same lines, I see that $-16\mod{3} = 2$. So, while the true answer evaluates to $-5.\overline{3}$ again, the "remained notation" is $-6\:R\:2$ here, and $-6\:R\:-2$ in the first example. Why do we go "past" $15$ to $18$ (or in the second example, past $-15$ to $-18$) and calculate the remainder from there? Further warping my brain, $-16\mod{-3} = -1$, so it looks like we "stop" at $-15$ in this example. |
When you use the \intertext in the \align* environment with the amsmath package, it has a small vertical space between the displayed text and equation even though it is still coded on the same line as the equation. In a regular line of code, you can type \intertext{text} (generic equation) on the one line. Yet, when it is compiled, it visual output shows a small vertical space between the text and the equation that I did not add manually. I am using \intertext because it is left-aligned and I don't want the equation itself to be left-aligned, just the text, but it should also be on the same displayed line as the \intertext. | I have a document I am trying to copy to learn TeX. Here is what I have encountered: How can I have the "or" in the equation. This is what I have right now: \[ f = ma; \] But $a$ is the change in velocity, \[ f = m \frac{dv}{dt};\] \[ f = m \frac{d^2y}{dt^2};\] Edit: Trying out Stefan's answer |
This question is based on this . Consider the problem of having $\mathbb N$ players. Each is wearing a hat (white, or black), and has to guess his own hat color; however player $i$ can only see the hats of players $j$ with $j>i$. Here's the proposed solution from the blog: If they can make a strategy before hand, they can make equivalence classes of functions $f: \mathbb N \to \{0,1\}$ with the relation $f \sim g$ iff they agree in all but a finite number of coordinates. Using AC, pick a representative of each equivalence class. Once on the line, since player $i$ can see all players $j$ with $j>i$ then he can tell in which equivalence class they ordering is. Player $i$ the just guesses his hat according to the representative previously picked. Since the representative agrees in all but a finite number of coordinates, then all players guess correctly except a finite number of players. My question is if the use of the axiom of choice is necessary here. Naively, since these equivalence classes have a lot of structure inside them, it seems to me that I can pick each representative by other means. For example, it's possible to pick a countably infinite number of these representatives: If $\langle 0,1,0,1,0... \rangle$ is in that equivalence class then pick it. If $\langle 0, 0,1,1,0,0,1... \rangle$ is in that equivalence class then pick it. And so on. Of course this is not enough as there are uncountably infinite of these sequences. I would like a prove that AC is necessary here, or if not which weaker version of AC is necessary. (Maybe DC?) | The link to Wikipedia describes the puzzle, and the solution. The axiom of choice is used to pick a sequence from each equivalence class, which the prisoners memorize beforehand. However, the answer says "When they are put into their line, each prisoner can see what equivalence class the actual sequence of hats belongs to." Why not wait until the prisoners see which equivalence class they are in. Then, pick a sequence from this equivalence class? This would avoid having to use the axiom of choice, or am I mistaken? |
How can I calculate $$ \int{\sec\left(x\right)\tan\left(x\right) \over 3x + 5}\,{\rm d}x $$ My Try:: $\displaystyle \int \frac{1}{3x+5}\left(\sec x\tan x \right)\,\mathrm dx$ Now Using Integration by Parts:: We Get $\displaystyle = \frac{1}{3x+5}\sec x +\int \frac{3}{(3x+5)^2}\sec x\,\mathrm dx$ Now My Question is How Can I calculate (II) Integral. Please explain this to me. | Cruising the old questions I came across juantheron asking for $\int \frac {\sec x\tan x}{3x+5}\,dx$ He tried using $(3x+5)^{-1}$ for $U$ and $\sec x \tan x$ for $dv$while integrating by parts. below is his work. How can I calculate $$ \int {\sec\left(x\right)\tan\left(x\right) \over 3x + 5}\,{\rm d}x $$ My Try:: $\displaystyle \int \frac{1}{3x+5}\left(\sec x\tan x \right)\,\mathrm dx$ Now Using Integration by Parts:: We get $$= \frac{1}{3x+5}\sec x +\int \frac{3}{(3x+5)^2}\sec x\,\mathrm dx$$ Here he hit his road block. I tried the opposite tactic Taking the other approach by parts. let $$U= \sec x \tan x$$ then$$ du= \tan^2 x \sec x +\sec^3 x$$ and $$dv=(3x+5)^{-1}$$ then $$v=\frac 1 3 \ln(3x+5)$$ Thus $$\int \frac {\sec x \tan x}{3x+5}\,dx= \frac {\ln(3x+5)\sec x \tan x}{3} - \int \frac {\ln(3x+5) [\tan^2 x \sec x +\sec^3 x]}{3} \,dx$$ As you can see I got no further than he did. So how many times do you have to complete integration by parts to get the integral of the original $\frac {\sec x \tan x}{3x+5} \, dx$ or is there a better way? |
Using the following command I am able to parse strings except for some mismatch: re.compile("(?P<Date>\d{2}[.-]\d{2}[.-]\d{4})\s(?P<Item_Name>.+)\s(?P<Transaction_Amount>[\d,\.\s\d]+)\s(?P<Balance>[\d,\.\s\d]+)") If I apply this to a list of strings: ['07-10-2019 BIL/INFT/somenumbers/82D3/ AJAY KUMAR 6,080.00 2,46, 287.08', '08.10.2019 MOBILE BANKING MMM TiMPS/somenumbers/ SIHDFC 4,411.00 250,698.08'] the output is [{'Date': '07-10-2019', 'Item_Name': 'BIL/INFT/somenumbers/82D3/ AJAY KUMAR 6,080.00', 'Transaction_Amount': '2,46,', 'Balance': '287.08'}, {'Date': '08.10.2019', 'Item_Name': 'MOBILE BANKING MMM TiMPS/somenumbers/ SIHDFC', 'Transaction_Amount': '4,411.00', 'Balance': '250,698.08'}] So, the second dictionary output is correct . In the first output, it seems due to an extra space in 2,46, 287.08, the number 6.080.00 is getting clubbed with Item_Name and Transaction_Amount , Balance is incorrect. Any way to rectify this? | 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}? |
I try to modify @Mico as follows: \documentclass{article} \begin{document} \[ V = \int_0^2(4-x^2)\,dx = 4\int_0^2\!dx - \int_0^2\!x^2\,dx = 4\left[x\middle]_0^2 - \middle[\frac{1}{3}x^3\right]_0^2 \] \end{document} but to my surprise I got the following result: Is this a bug? I expect that at both term indices will be on the same position regarding bracket. The same result is also if instead x is for example if in brackets is \frac{1}{x}. | I'd like to write this formula with all parenthesis of the same size N = \left( \frac{s}{2} \right)^2 - \left( \frac{d}{2} \right)^2 so I tried N = \left( \frac{s}{2} \middle)^2 - \middle( \frac{d}{2} \right)^2 The two results are the following: Is there a way to achieve my goal without using \big( and similar? Thanks |
Problem. Suppose that $f$ has an isolated singularity at the point $a$, and $f'/f$ has a first-order pole at $a$. Prove that $f$ has either a pole or a zero $a$ This is a problem from a past qualifying exam in the institution I'm attending now which might appear in the final exam on tomorrow.(so if asking this is a problematic, then let me know, I'll delete it.)Because $f$ should have pole or removable or essential singularity at $a$, I checked that if $f$ has removable singularity at $a$ then $f(a)$ has to be $0$ to satisfy the condition in the problem, and also checked that if $f$ has pole at $a$ then $f$ satisfies the condition in the problem. So, I was trying to show that $f$ can't have essential singularity at $a$, and tried to use Casorati-Weiestrass theorem to derive some contradiction and it didn't work. I also tried to just plug in Laurent series expanded at $a$ in $f'/f$ and do calculation to eliminate some coefficients with negative indices but calculation would result infinite system of linear equations so I gave up doing it. Therefore, I'm stuck and please give me some hint. | The following is an old qualifying exam that I cannot solve: Suppose $f$ is holomorphic on the punctured unit disk and $ \frac{f '}{f} $ has a simple pole at $0$. Show that $f$ does not have an essential singularity at $0$. |
My question is quite elementary but I need help understanding the basic concepts. In the following example from the Mathworks of the princomp function load hald; [pc,score,latent,tsquare] = princomp(ingredients); pc,latent we get the following values for: pc = -0.0678 -0.6460 0.5673 0.5062 -0.6785 -0.0200 -0.5440 0.4933 0.0290 0.7553 0.4036 0.5156 0.7309 -0.1085 -0.4684 0.4844 latent = 517.7969 67.4964 12.4054 0.2372 score = 36.8218 -6.8709 -4.5909 0.3967 29.6073 4.6109 -2.2476 -0.3958 -12.9818 -4.2049 0.9022 -1.1261 23.7147 -6.6341 1.8547 -0.3786 -0.5532 -4.4617 -6.0874 0.1424 -10.8125 -3.6466 0.9130 -0.1350 -32.5882 8.9798 -1.6063 0.0818 22.6064 10.7259 3.2365 0.3243 -9.2626 8.9854 -0.0169 -0.5437 -3.2840 -14.1573 7.0465 0.3405 9.2200 12.3861 3.4283 0.4352 -25.5849 -2.7817 -0.3867 0.4468 -26.9032 -2.9310 -2.4455 0.4116 Legend: latent is a vector containing the eigenvalues of the covariance matrix of X. pc is a p-by-p matrix, each column containing coefficients for one principal component. The columns are in order of decreasing component variance.** score is the principal component scores; that is, the representation of X in the principal component space. Rows of SCORE correspond to observations, columns to components. Can somebody explain whether the values of score are genetrated somehow using the values of pc and if this true, what kind of computation is perfomed ? | Given a data matrix $\mathbf X$ of $12 \times 7$ size with samples in rows and variables in columns, I have calculated centered data $\mathbf X_c$ by subtracting column means, and then computed covariance matrix as $\frac{1}{N-1} \mathbf X_c^\top \mathbf X_c$. The dimensions of this covariance matrix are $7 \times 7$. After that I have calculated the eigenvalue decomposition, obtaining eigenvector matrix $\mathbf V$ with eigenvectors in columns. Now I want to know about projections (i.e. principal component scores in PCA): is it $\mathbf{V}^\top \mathbf{X}_c$ or $\mathbf{X}_c \mathbf{V}$? mean_matrix = X - repmat(mean(X),size(X,1),1); covariance = (transpose(mean_matrix) * mean_matrix)/(12-1); [V,D] = eig(covariance); [e,i] = sort(diag(D), 'descend'); V_sorted = V(:,i); |
Is it possible to indent blocks of code in vim instead of going to each line and indenting a line at a time? Maybe highlight the code and execute a command that will indent the highlighted code? | It should be trivial, and it might even be in the help, but I can't figure out how to navigate it. How do I indent multiple lines quickly in vi? |
I have a hosted VM with about 20 client websites on board. Many use a database which is currently SQL Server 2008 R2 (not an evaluation). Because of upcoming licensing issues, I need to change to the Web Edition of SQL Server with my current host. Is it possible to install SQL Server Web Edition on a box that already has SQL Server 2008 R2 installed? If it's not possible, could someone suggest best process for this switch? | We are running a SQL Server 2008 R2 Standard Evaluation version. The client has decided they don't want to pay for full SQL Server standard and feel the Web edition is suitable. Can I downgrade SQL Server 2008 R2 Standard Evaluation to Web Edition? Obviously I need to put a licence on it. Can I just put the Web edition licence on it and it will become a Web Edition server or does it require a re-install. |
Let $X = \mathbb{R}$ equipped with usual topology $\tau$, then $\tau = 2^\mathbb{R}$ Does this imply that the cardinality of $\tau$ is greater than continuum? | Calculate the number $o(\mathbb{R})$ of open subsets of the real line. I know that the answer is $\mathfrak{c}$ but I don't know how my lecturer got this. I am doing an introductory topology course, so I know a few topological concepts. Such as that the set of all open intervals forms a base for the real numbers. Is this somehow relevant in showing that $o(\mathbb{R}) = \mathfrak{c}$? |
Generalized linear models (GLM's) are apparently widely used, but I'm having some trouble to find comprehensive but still simple resources to explain it to someone who is not a statistician but has a basic background on statistics. Currently I have found the following references: Wikipedia GLM article This book (I didn't have access to it yet):MCCULLAGH, Patrick; NELDER, John A. Generalized linear models. 2nd ed. London: Chapman & Hall/CRC, 1995. 511 p. This paper (very hermetical): McCullagh, Peter. "Generalized linear models." European Journal of Operational Research 16.3 (1984): 285-292. Looking for websites, books or research papers. | I am looking for an introductory to intermediate level book on Generalized Linear Models. Ideally, in addition to the theory behind the models, I would want it to include applications and examples in R or another programming language - I hear SAS is also a popular choice. I intend to study it on my own and so it would help if it provided the answers to its own exercises. You can assume I have taken the traditional year-long courses in calculus and probability theory. I am also familiar with the basics of regression analysis. |
I have a little problem, I'm in this situation: I have a json that I parse with no problems with json_decode making an object, in this array I have various values, in particular I have an array called "message" then I want to add values to this $jsonObj->message for example: $jsonObj->message->hello = 'example'; now I want to add another object to $jsonObj->message without removing other values then, what I want is: $jsonObj->message->hello; // this is auto generated from the json $jsonObj->message ADD $json2; So I should have $jsonObj->message->somethingIntoJson2 and $jsonObj->message->hello too; Thank you. | We have two PHP5 objects and would like to merge the content of one into the second. There are no notion of subclasses between them so the solutions described in the following topic cannot apply. //We have this: $objectA->a; $objectA->b; $objectB->c; $objectB->d; //We want the easiest way to get: $objectC->a; $objectC->b; $objectC->c; $objectC->d; Remarks: These are objects, not classes. The objects contain quite a lot of fields so a foreach would be quite slow. So far we consider transforming objects A and B into arrays then merging them using array_merge() before re-transforming into an object but we can't say we are proud if this. |
As far as I understand bash is the default shell in Ubuntu, so why does /bin/sh point to /bin/dash? | I am wondering what the point of sh being symbolic linked to dash is? I understand that dash is supposed to be faster than bash, but I am uncertain why the original sh shell isn't present in sh. Or if anything why isn't sh linked to bash? |
Why can black bodies emit all wavelength radiations? Also, in Wein's law of displacement, how do we sat that wavelength corresponding to the max intensity of the radiation is inversely proportional to the temperature? | The (unlike the quantized emission seen from atomic spectra), is continuous over all frequencies. Many objects approximate ideal blackbodies and have radiation curves very similar in shape and continuity to that of an ideal black-body (often minus some emission and absorption lines from the atoms in an object, such as radiation curves seen from stars). I am wondering what exactly gives rise to a basically continuous black-body radiation curve in real objects? Since atomic energy states are quantized, it seems real life black-body curves would have some degree of measurable quantization to them (or perhaps the degree of quantization is so small the radiation curves look continuous). |
In my view port full model is showing, but in camera view and also in render view the full view of model is not showing. | I have created a simple model here When rendering it the end of it is cut off How can I get the camera to render a longer distance? |
I have burned a Ubuntu DVD to install. I want to install it on my alternative, internal D drive, NOT my normal C drive! When I reboot and put in the DVD it starts my windows on C drive again. What should I do? | I would like to see a full how-to guide on how to install Ubuntu. |
I am trying to center an icon in my header navigation. I have the basics down but the center changes depending on if there are multiple icons in the same header. How can I keep the center icon centered even if the left or right icons are removed? HTML <br> <br> <div class="mp-myheader"> <div class="mp-center-wrapper"> <i class="mp-icon-hamburger mp-icon-xsm mp-float-left"></i> <i class="mp-icon-hamburger mp-icon-xsm"></i> <i class="mp-icon-hamburger mp-icon-xsm mp-float-right"></i> </div> </div> <br> <div class="mp-myheader"> <div class="mp-center-wrapper"> <i class="mp-icon-hamburger mp-icon-xsm"></i> <i class="mp-icon-hamburger mp-icon-xsm mp-float-right"></i> </div> </div> CSS .mp-center-wrapper{ text-align: center; } .mp-myheader { background: #015688 !important; width:100% } .mp-icon-hamburger { background-image: url("http://icons.iconarchive.com/icons/klukeart/summer/128/hamburger-icon.png"); background-position:center; background-repeat:no-repeat; } .mp-icon-xsm { width: 25px; height:25px; background-size: 25px; display:inline-block; } .mp-float-left { float:left; } .mp-float-right { float:right; } | How can I horizontally center a <div> within another <div> using CSS? <div id="outer"> <div id="inner">Foo foo</div> </div> |
My UK visit visa got refused and nw I want to apply again immediately. I had applied for UK visit visa but it got refused due to some reasons as mentioned in refusal letter. The mistake I did is that I forgot to submit my salary account statement but apart from this.they raised some more concern regarding my trip. Please see the attached refusal letter and advice me. I had submitted the imvitation letter from my brother in law with all required docs(his account statement, invitation, letter, passport copy,telephone bill). My suggest me what all things i should consider for reapplying and content for cover letter. This was my first visa and have no visa history. They refused my visa under paragraph V4.2(a), (c) and (e) of Appendix V of the immigration letter. Should I apply it again immediately or not? Thnaks] | I'm married have a job with stable income.I have 2 kids. I have applied for UK visit visa about 7 years ago and was refused. I can't remember what exactly was the reason for refusal. I want to travel for tourism to spend 9 days and my budget is around 1300GBP for the trip. I would be spending part of my annual leave in the UK. I have the following people in UK: Mother, Dad, Sister(she's married), Brother (married), Uncle and Aunt. I'm travelling alone since my wife is pregnant. I haven't travelled since I was in school then. I will be on my yearly 21 days annual leave during which I will be spending 9days in UK. I can't think of anything more about my circumstance. So what should a cover letter look like? secondly I have just 1 account where my salary is paid in monthly and my savings.I will be submitting the 6 months bank statement for the account. Additional question: In the income & expenditure where one is asked to indicate if I have income and savings,should I click Yes or No. And if Yes should state the ending balance as at the time of my application. |
Is it true that in Javascript the order of the for in loops is determined by the priority field in the objects? var objs={ foo:{priority:0,name:"foo"}, bar:{priority:1,name:"bar"}, } for(key in objs){ console.log(objs[key].name) } First I see bar, then foo. So is it true? | Does the "for…in" loop in Javascript loop through the hashtables/elements in the order they are declared? Is there a browser which doesn't do it in order? The object I wish to use will be declared once and will never be modified. Suppose I have: var myObject = { A: "Hello", B: "World" }; And I further use them in: for (var item in myObject) alert(item + " : " + myObject[item]); Can I expect 'A : "Hello"' to always come before 'B : "World"' in most decent browsers? |
On my website I have a button that I hope visitors would use to share my content by mail. It's simple, it uses the mailto protocol and it works. However the message within the mail sucks because it's plain text. I know there are emails with a html body that makes sharing stuff easier and you can add things like Twitter Cards, Facebook Open Graph and Google+ Markup. However it seems the two doesn't combine or am I missing something? I want to be able to send rich HTML emails using the mailto protocol. I'm currently using a CMS-platform called indexhibit and simply changing to wordpress or something else is not an option. | I have not had to mess with mailto links much. However I now need to add a link in the body of a mailto if it is possible. Is there a way to add a link or to change the email opened to an html email vs a text email? Something like: <a href="mailto:[email protected]?body=The message's first paragraph.%0A%0aSecond paragraph.%0A%0AThird Paragraph.%0A%0ALink goes here">Link text goes here</a> |
I'm plotting experimental data with pgfplots and wonder how I can add smaller ticks to the axis which are not annotated. Every data analysis software (even Excel) makes this, but I didn't find a way to do it easily in pgfplots. I must have overlooked it. I hope there is a way to tell pgfplots to split every "big" step (0-5, 5-10, ...) into, lets say, five smaller steps. | I'm trying to plot an easy function and I would like to enable the minor grid. But it seems that this instruction is ignored. I used the grid=both option but it has no effect. The only grid I can see is the major grid. I could not find anything helpful on the internet. Thanks for any advise. \documentclass[11pt]{amsart} \usepackage{geometry} \geometry{a6paper} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage{amssymb} \usepackage{amsmath} \usepackage{epstopdf} \usepackage{pgfplots} \usepackage[german]{babel} \usepackage{tikz} \usetikzlibrary{shapes.misc} \usetikzlibrary{decorations.markings} \title{Control} \begin{document} \begin{tikzpicture} \begin{axis}[grid=both,xlabel={error},ylabel={power}] \addplot[mark=none,domain=4:30,samples=200]{55/(1.3*(ln(x)/ln(10)))}; \end{axis} \end{tikzpicture} \end{document} |
I am not sure how to approach this problem. if you could help it would be great. | Show that the set of all finite subsets of $\mathbb{N}$ is countable. I'm not sure how to do this problem. I keep trying to think of an explicit formula for 1-1 correspondence like adding all the elements in each subset and sending that sum to itself in the natural numbers, but that wouldn't be 1-1 because, for example, the set {1,2,3} would send to 6 and so would the set {2,4}. Multiplying all the elements in each subset and sending that product to itself in the natural numbers wouldn't work either since, for example, {2,3} would send to 5 and so would the set {1,5}. Any ideas? |
I am reading from a txt file and populating a core data entity. At some point I have read the value form the TXT file and the value is @"0.9". Now I assign it to a CGFloat. CGFloat value = (CGFloat)[stringValue floatValue]; debugger shows value as 0.89999997615814208 !!!!!!????? why? bug? Even if it things [stringValue floatValue] is a double, casting it to CGFloat should not produce that abnormality. | Consider the following code: 0.1 + 0.2 == 0.3 -> false 0.1 + 0.2 -> 0.30000000000000004 Why do these inaccuracies happen? |
I tested the program using static allocation and the compiler gives me an error when I had changed the value . But when I used dynamic allocation, the value changed . class Test{ private: int *value; public: Test( int v ){ value = new int; *value = v; } int getValue() const{ *value = 110; return *value; } ~Test(){ delete value; } }; int main(){ Test t1(7); cout<<t1.getValue()<<endl; } | class String { private: char* rep; public: String (const char*); void toUpper() const; }; String :: String (const char* s) { rep = new char [strlen(s)+1]; strcpy (rep, s); } void String :: toUpper () const { for (int i = 0; rep [i]; i++) rep[i] = toupper(rep[i]); } int main () { const String lower ("lower"); lower.toUpper(); cout << lower << endl; return 0; } |
Let $W=\operatorname{M}_{n\times n}(\mathbb{F})$ (square matrices $n\times n$ over $\mathbb{F}$), and $f\in W^*$. If $f(AB)=f(BA)$ for every $A,B\in W$ and $f(I)=n$ prove that $f(A)=\operatorname{tr}A$ for every $A\in W$. I can understand why it's true, the only part in $AB$ that is the same in $BA$ is the diagonal, and together with $f(I)=n$ it is pretty obvious. But how can I prove it? I tried writing the base for $W$ and then writing $I$ as a linear combination of that base, but I got stuck. Thank you. | We know that the trace of a matrix is a linear map for all square matrices and that $\operatorname{trace}(AB)=\operatorname{trace}(BA)$ when the multiplication makes sense. On the , under properties, it says that these properties characterize the trace completely in the following sense: If $f$ is a linear function on the space of square matrices satisfying $f(xy)=f(yx)$, then $f$ and $\operatorname{tr}$ are proportional. A of the page gives the justification, but I do not understand the logic of it. Thanks |
I tried to use the grep command to search for a string like -R in a file. But the command thinks, that I am trying to hand over an option like -i for ignore case. | I wrote the following command in order to match $a with $b, but when the value includes "-", then I get an error. How can I avoid that? # a="-Xmx5324m" # b="-Xmx5324m" # # # echo "$a" | grep -Fxc "$b" grep: conflicting matchers specified |
I'm currently in the process of developing some shell scripts but have run into a problem: whilst I am able to execute numerous commands on my Mac, when I try to run it on other people's computers I get Command not found errors indicating that they do not have the specific command line tools installed. It is my belief that many of these tools come as a result of installing Xcode and other package managers like Homebrew. My question is: is there a list or another way of finding out if a specific command (tool) is pre-installed on a standard Mac computer (without Xcode installed) without having to manually test it on someone else's computer? For example, post hints that git is pre-installed which is only the case if you have installed Xcode, otherwise, git is unavailable. P.S. For my specific case, I am wondering if hexdump is pre-installed or not (without Xcode) | I am trying to setup a bunch of development projects in my Mac. I have to run various tools like python, ruby, scala, groovy etc. To see if a tool is available I use options like ruby --version. Instead I would like to see all the list of tools available in Mac terminal via a single command. What is the command/options for it? |
I'm using: \begin{acronym} \acro{URL}{Uniform Resource Locator} \end{acronym} with package \usepackage[printonlyused]{acronym} But my acronyms are not alphabetical sorted , and I want it. How can I make this? | I am using acronym package to create the list of Acronyms. I am using Acronym1.tex containing the definition of all the acronyms. However here is the list of problems I am facing. I have to sort the list manually every time I need a sorted list in the pdf. I am not aware of the options with usepackage. I am currently using \usepackage[printonlyused,withpage]{acronym} Is it possible to order the Acronym list? Currently what I am getting is <short>:<Description>..........<Page Number> I would prefer something like this : <short>\t<Description>..........<Page Number> Example: \documentclass{article} \usepackage[colorlinks]{hyperref} \usepackage[printonlyused,withpage]{acronym} \begin{document} \section{Intro} In the early nineties,\ac{TDMA}, \ac{IEEE} , \ac{GSM}, \ac{WPAN} \ac{FPGA} \section{Acronyms} \begin{acronym} \acro{TDMA}{Time Division Multiple Access} \acro{WPAN}{Wireless Personal Area Network} \acro{GSM}{Global System for Mobile communication} \acro{FPGA}{Field Programmable Gate Array} \acro{IEEE}{Institute of Electrical and Electronics Engineers} \end{acronym} \end{document} If you are using acronym package and know the options on how to use it, that will be really helpful. I could not find any relevant information, in . |
I am currently trying to solve some beginners exercises but I am stuck at the point where I am supposed to expand an existing function and also add the string that allows me to ignore upper and lower cases. I do really do not know where in the function I should be adding this last information. I am also supposed to find all the lines where the words appear ('Heaven', 'all', 'you'). Here is what I have now: def all_line_numbers(text, word): """ Returns the line numbers (beginning with 1) where the word appears in :param text: Text in which the word is searched for :param word: A word to search for :return: List of line numbers """ lines = text.splitlines() i = 0 for line in lines: i = i + 1 if word in line: return i return [] and it ends with: # print() print("exercise") words = ['Heaven', 'all', 'you'] for word in words: num = all_line_numbers(it_rains, word) if num: print(f"The word {word} is in the following lines {num}.") else: print(f"The word {word} was not found!") Thank you very much in advance! | How can I do case insensitive string comparison in Python? I would like to encapsulate comparison of a regular strings to a repository string using in a very simple and Pythonic way. I also would like to have ability to look up values in a dict hashed by strings using regular python strings. |
I made a mistake that resulted in the deletion of /etc/pam.d, how do I restore the PAM configuration to the state that would be generated for my currently installed packages when I don't know the specific files to restore? | I would like to restore LightDM to its default state, because for some reason /etc/lightdm/unity-greeter.conf is now an empty file. Deleting /etc/lightdm/unity-greeter.conf and then running sudo apt-get install --reinstall unity-greeter doesn't create a new config file as you might expect. How can I restore a missing config file? |
What is wrong with this solution of find the least value of $ \sec^6 x +\csc^6 x + \sec^6 x\csc^6 x$ They all are positive terms so arithmetic mean is greater than equal to geometric mean. $$ \sec^6 x +\csc^6 x + \sec^6 x\csc^6 x\geq 3( \sec^6 x \csc^6 x \sec^6 x\csc^6 x)^\frac{1}{3} $$ $$ \sec^6 x +\csc^6 x + \sec^6 x\csc^6 x \geq 3( \sec x \csc)^4 $$ $$ \sec^6 x +\csc^6 x + \sec^6 x\csc^6 x\geq \frac{3 * 2^4}{\sin ^4 2x} $$ Clearly least value is 48, but something is wrong here, as the answer is 80, if I use other methods. | Find the least value of $$ \sec^6 x +\csc^6 x + \sec^6 x\csc^6 x$$ I tried AM greater than equal to GM But that's for finding maximum value. This can probably be solved with calculus but I don't know for some reason I can't find the answer . Which is $80$. |
I was messing around with some computer files and accidentaly deleted my .minecraft folder. There was alot of important stuff in there, and I don't know how to get it back. Can anyone help? | So I deleted my .minecraft folder thinking, "oh yeah it'll all just Re-Download when i start minecraft up". I was wrong. I looked in my .minecraft folder and all that is in there is the bin folder and the last login file. I have no idea what to do... Can someone help me with this? Just letting you know that I emptied my recycle bin after I deleted it. I also have a premium account and it worked fine for the past year. |
I have an account with close to 100 reputation on . - When I get 200 reputation, will the site association bonus apply to already existing accounts (like my meta.se - this account), or Does it only apply to new communities joined thereafter? And if I do get it on previous accounts, will I get +100 rep or enough to make my balance 100? | I was just awarded +100 reputation on all of my Stack Exchange accounts. What is this bonus for? It simply says "Association Bonus" on my reputation overview. Also: What privileges does the association bonus grant users? Can I lose the association bonus? Does it make my reputation 101 everywhere? Can I earn the association bonus on sites I haven't joined yet? Does it matter which site I earn the 200 reputation on? Will I get an association bonus every time my reputation on a site crosses 200 points? Does the association bonus allow me to answer protected questions? Does the association bonus count towards the reputation cap? Can I get the association bonus if I only have a profile on one site? What else is there to know about the association bonus? |
I'm performing a nested grep like this: grep -ir "Some string" . |grep "Another string I want to find in the other grep's results" This works perfectly as intended (I get the results from the first grep filtered by the second grep as well), but as soon as I add an "-l" option so I only get the list of files from the second grep, I don't get anything. grep -ir "Some string" . |grep -l "Another string I want to find in the other grep's results" This results in the following output: (standard output) I guess piping doesn't work when I just want the list of files. Any alternatives? | I would like to get the multi pattern match with implicit AND between patterns, i.e. equivalent to running several greps in a sequence: grep pattern1 | grep pattern2 | ... So how to convert it to something like? grep pattern1 & pattern2 & pattern3 I would like to use single grep because I am building arguments dynamically, so everything has to fit in one string. Using filter is system feature, not grep, so it is not an argument for it. Don't confuse this question with: grep "pattern1\|pattern2\|..." This is an OR multi pattern match. |
I was trying to activate network sharing on my computer and I had this error message from the terminal Your wireless card or driver does not support Access Point mode. My wireless card info is as follows description: Wireless interface product: Centrino Advanced-N 6200 vendor: Intel Corporation physical id: 0 bus info: pci@0000:03:00.0 logical name: wlan0 version: 35 serial: 00:27:10:80:db:30 width: 64 bits clock: 33MHz capabilities: bus_master cap_list ethernet physical wireless configuration: broadcast=yes driver=iwlwifi driverversion=3.13.0-29-generic firmware=9.221.4.1 build 25532 latency=0 link=no multicast=yes wireless=IEEE 802.11abgn" I am not a comp guru but can follow instructions very well, please help. | I am a new Ubuntu user and have installed Ubuntu 12.04 LTS on my Acer Aspire One D255 netbook with an Intel Centrino N1000 Wireless Card. All I want is to set my netbook as wifi hotspot for my android devices. This worked well for me in Windows 7 using Connectify but I am trying to make hotspot in Ubuntu using hostapd () but getting following error: ali@ali-AOD255:~$ sudo hostapd ~/hostapd-test.conf Configuration file: /home/ali/hostapd-test.conf nl80211: Failed to set interface wlan0 into AP mode nl80211 driver initialization failed. ELOOP: remaining socket: sock=4 eloop_data=0x8178910 user_data=0x8178e80 handler=0x807c5e0 ELOOP: remaining socket: sock=6 eloop_data=0x817ac98 user_data=(nil) handler=0x8086770 All I want is to setup a wifi hotspot using my netbook so that my android devices can view and connect to it. |
So given a m*n matrix represented as columns, I'm supposed to increment one index at a time to fill a specified amount of row and column, say if I'm supposed to increment (2,0), it'll ONLY increment (2,0). So I wrote this code: for i in range(row): for j in range(col): print("X") print(matrix) content = matrix[i][j] matrix[i][j]=content+1 print("matrix ({},{}) = {}".format(i,j,matrix[i][j])) I added several prints to debug the code, and on the first index it outputs: X [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]] matrix (0,0) = 1 [[1, 0, 0, 0], [1, 0, 0, 0], [1, 0, 0, 0]] it's supposed to increment (0,0) to 1 so it's supposed to look like this: [[1, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]] but as you can see....it increments an entire row at once... I don't know why it happened, did I miss something? | I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3 The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]] Then I changed one of the innermost values: my_list[0][0] = 5 Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]] which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it? |
I am suddenly having a strange issue with circles within an axis environment. Any circles drawn inside an axis become weirdly stretched, as in the following example: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \begin{document} \begin{tikzpicture} \begin{axis}[xmin=-5,xmax=5,ymin=-2,ymax=2,axis equal] \node[fill=black,inner sep=3pt] (a) at (0,0) {}; \draw (0,0) circle[radius=1]; \end{axis} \end{tikzpicture} \end{document} The issue persists even with the axis equal image option, and, weirdly, it seems that no matter what the bounds on the x-axis are, the drawn path does not "fit" into the coordinate system. On the other hand, the circle command works properly outside of an axis environment. Also, the arc command draws proper circles both in and outside of an axis environment (and with using axis coordinates and units), but I would obviously prefer to use the simpler syntax. I should mention that I only have a single PC with this issue; my other computer compiles the exact same file properly. They are both running MiKTeX v. 2.9.7300 and have pgfplots v. 1.16. I cannot say exactly when this issue appeared, but it should be within the last two months or so. It might be related to , but I cannot say. | With a fresh installation of TeX Live (updated just before writing this post), circles in axis environments are distorted. Consider the following MWE: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.16} \begin{document} \begin{tikzpicture} \begin{axis}[ ymin=-3, ymax=3, xmin=-3, xmax=3 ] \draw (1,0) circle [radius=1.5]; \fill (1,0) circle [radius=1]; \end{axis} \end{tikzpicture} \end{document} The output looks like this: Obviously, the circles aren't even circles. I haven't encountered this problem before. Did I do anything wrong while setting up my new system? EDIT: It's not an issue of using axis equal or not since the axes are scaled more or less equally already. Instead, the circles appear as rotated ellipses that are strongly stretched out in one dimension. EDIT 2: Here's the output of \listfiles: article.cls 2019/12/20 v1.4l Standard LaTeX document class size10.clo 2019/12/20 v1.4l Standard LaTeX file (size option) pgfplots.sty 2018/03/28 v1.16 Data Visualization (1.16) graphicx.sty 2019/11/30 v1.2a Enhanced LaTeX Graphics (DPC,SPQR) keyval.sty 2014/10/28 v1.15 key=value parser (DPC) graphics.sty 2019/11/30 v1.4a Standard LaTeX Graphics (DPC,SPQR) trig.sty 2016/01/03 v1.10 sin cos tan (DPC) graphics.cfg 2016/06/04 v1.11 sample graphics configuration pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex tikz.sty 2020/01/08 v3.1.5b (3.1.5b) pgf.sty 2020/01/08 v3.1.5b (3.1.5b) pgfrcs.sty 2020/01/08 v3.1.5b (3.1.5b) everyshi.sty 2001/05/15 v3.00 EveryShipout Package (MS) pgfrcs.code.tex pgfcore.sty 2020/01/08 v3.1.5b (3.1.5b) pgfsys.sty 2020/01/08 v3.1.5b (3.1.5b) pgfsys.code.tex pgfsyssoftpath.code.tex 2020/01/08 v3.1.5b (3.1.5b) pgfsysprotocol.code.tex 2020/01/08 v3.1.5b (3.1.5b) xcolor.sty 2016/05/11 v2.12 LaTeX color extensions (UK) color.cfg 2016/01/02 v1.6 sample color configuration pgfcore.code.tex pgfcomp-version-0-65.sty 2020/01/08 v3.1.5b (3.1.5b) pgfcomp-version-1-18.sty 2020/01/08 v3.1.5b (3.1.5b) pgffor.sty 2020/01/08 v3.1.5b (3.1.5b) pgfkeys.sty pgfkeys.code.tex pgfmath.sty pgfmath.code.tex pgffor.code.tex tikz.code.tex l3backend-pdfmode.def 2020-02-03 L3 backend support: PDF mode supp-pdf.mkii epstopdf-base.sty 2020-01-24 v2.11 Base part for package epstopdf epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live |
I got some problems that my result not right (i think it's not UTF-8). This is input(CSV file) This is output (in phpmyadmin) Please Help! $file_data = $this->upload->data(); $file_path = 'upload/file_csv/'.$file_data['file_name']; if ($this->csvimport->get_array($file_path)) { $csv_array = $this->csvimport->get_array($file_path); foreach ($csv_array as $row) { $insert_data = array( 'firstname'=>$row['tea_name'], 'lastname'=>$row['tea_surename'], 'teacher_id'=>$row['teacher_id'], ); $tea_id = $insert_data['teacher_id']; $fname = $insert_data['firstname']; $lname = $insert_data['lastname']; for($i=0;$i<sizeof($insert_data);$i++){ $sql = "select * from teacher where teacher_id = '$tea_id' "; $result = $this->db->query($sql)->num_rows(); } if($result>0){ $sql="UPDATE `dvp`.`teacher` SET `firstname` = '$fname', `lastname` = '$lname' WHERE `teacher`.`teacher_id` = '$tea_id'"; $this->db->query($sql); }else{ $sql="INSERT INTO `dvp`.`teacher` (`teacher_id`, `firstname`, `lastname`) VALUES ('$tea_id', '$fname', '$lname')"; $this->db->query($sql); } } | 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. |
I dropped my external Seagate 2 TB hard drive on the floor. It seems to work fine. But I want to scan for bad sectors just to be safe. I use this drive for all of my TimeMachine backups. The post is about checking your hard drive and has tools you can buy (recommended by the community), or things you can try which I tried and which did not work. On a Windows machine, you can take any connected drive, run scandisk on it, and detect/repair bad sectors. Is there a way to do this for my drive on Macintosh (without purchasing third party tools)? More info: Disk Utility -> Info says that SMART status is "unsupported". The drive is formatted as HFS | I'm planning on selling a used external HDD on eBay. Are there any applications for Mac out there (preferably free) that can show me statistics about the usage history for the drive so that I can let potential buyers know the condition more precisely? |
In my program I have an html form that takes in a name as user input: <form action ="view_process.php" role = "form" method = "post"> .... <input type="text" name="name_in" class="form-control" placeholder="Name here" maxlength = "30"> .... </form> and then I have php code that puts the user input into a variable $name_in = trim($_POST['name_in']); All of this is working, but when I issue the following query to a MySQL database, $query = "SELECT * FROM students WHERE SID = $id_in AND name = $name_in;"; it only returns the database entry/tuple if the user inputs their name in quotes. What is causing this and how can I fix it? I realize I could write a function to add quotes to the input but I want to understand why this is happening and that does not seem like a good solution. I did some research and tried using addslashes(), stripslashes(), and turning on magic quotes, but nothing fixed it. EDIT: I don't think this is a duplicate of: because I am using mysqli and not prepared statements. | If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example: $unsafe_variable = $_POST['user_input']; mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')"); That's because the user can input something like value'); DROP TABLE table;--, and the query becomes: INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--') What can be done to prevent this from happening? |
I will be defending my dissertation in this Summer and I'm planning to give a gift to my advisor. I'm not quite sure what would be the best and meaningful gift for a professor receiving from his/her student. Main reason I'm asking this questions is that I'm an international student and not sure what would be most suitable. It's usually a general understanding in my homeland that we give some gifts to the professors that stays for long time. In other words, we avoid giving Champagne, Wine, or something to eat rather a shirt, pen set, etc. Any idea from the american life perspective will be appreciated. | I am nearing the end of my PhD and I would quite like to buy a "thank you" gift for my supervisor (although, she's the socially awkward type who I'm sure will be greatly embarrassed to receive one). I'm just wondering whether a gift is the done thing? And if so, what sort of gift seems appropriate? I suppose a bottle of wine would be a safe choice? |
I'm trying to cite some chapters in a book in a .bib file however when I compile the .tex file, I got some of the chapters without the authors names. I don't know the reason and how to fix this. Any suggestions? Code: @inbook{bitam2014bio1, title={Bio-inspired Routing Protocols for Vehicular Ad-Hoc Networks}, author={Bitam, Salim and Mellouk, Abdelhamid}, chapter = {Vehicular Ad Hoc Networks}, year={2014}, publisher={John Wiley \& Sons} } @inbook{bitam2014bio2, title={Bio-inspired Routing Protocols for Vehicular Ad-Hoc Networks}, author={Bitam, Salim and Mellouk, Abdelhamid}, chapter = {Routing for Vehicular Ad Hoc Networks}, year={2014}, publisher={John Wiley \& Sons} } @inbook{bitam2014bio3, title={Bio-inspired Routing Protocols for Vehicular Ad-Hoc Networks}, author={Bitam, Salim and Mellouk, Abdelhamid}, chapter = {Conventional Routing Protocols for VANETs}, year={2014}, publisher={John Wiley \& Sons} } @inbook{bitam2014bio4, title={Bio-inspired Routing Protocols for Vehicular Ad-Hoc Networks}, author={Bitam, Salim and Mellouk, Abdelhamid}, chapter = {Bio-inspired Routing Protocols for VANETs}, year={2014}, publisher={John Wiley \& Sons} } Output: | I am using Jabref and \IEEEtrans package. I try to cite same author for different source in the reference (twice). It appears twice but only once time appears Author name. I want like this [1] M. Shapiro, “Tire manufacturing,” 2012. [2] M. Shapiro, “Thermodynamic properties,” 2012. Need help \documentclass[a4paper,12pt]{article} %------------------------------------------------------------------ \usepackage{ragged2e} \usepackage{gensymb} \usepackage{tabto} \usepackage[none]{hyphenat} \usetikzlibrary{calc} \usepackage{soul} \usepackage{datetime} \newdate{date}{23}{09}{2016} \date{\displaydate{date}} \newcommand\HRule{\rule{\textwidth}{1pt}} \usepackage{tabularx} % extra features for tabular environment \usepackage{graphicx} % takes care of graphic including machinery \usepackage[left=3cm,right=1in,top=1in,bottom=1in]{geometry} % decreases margins \usepackage{cite} % takes care of citations %\usepackage{biblatex} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhead{} \fancyfoot{} \fancyfoot[R]{\thepage} \begin{document} this is \cite{Shapiro1,Shapiro2} \bibliographystyle{IEEEtran} \bibliography{LiteratureReveiw} \end{document} @TechReport{Shapiro1, author = {Shapiro, M.}, title = {Development of the enthalpy storage materials, mixture of methyl stearate and methyl palmitate}, institution = {Florida Solar Energy Center}, year = {1989}, } @TechReport{Shapiro2, author = {Shapiro, M.}, title = {Development of the enthalpy storage materials, mixture of capric acid and lauric acid with fire retardants}, institution = {Florida Solar Energy Center}, year = {1989}, } |
How to prove $$\hat{p}|x\rangle=i\hbar\frac{\partial}{\partial x}|x\rangle,$$ using $$[\hat{x},\hat{p}]=i\hbar~?$$ The question seems to be uncomplete because for any $f(x)$ $$[\hat{x},\hat{p}+f(x)]=i\hbar.$$ However, there is a seemingly right answer: $$ \hat{Q} = e^{-i \frac{u}{\hbar} \hat{p}},[\hat{x},\hat{Q}]=u \hat{Q} $$ $$ \hat{x}\hat{Q}|x\rangle = (x+u)\hat{Q}|x\rangle $$ $$ \hat{Q}|x\rangle = |x+u\rangle $$ $$ \hat{T} = e^{i \frac{u}{\hbar} \hat{x}},[\hat{p},\hat{T}]=u \hat{T} $$ $$ \hat{p}\hat{T}|p\rangle = (p+u)\hat{T}|p\rangle $$ $$ \hat{T}|p\rangle = |p+u\rangle $$ Therefore $$ \langle x | p \rangle = e^{i\frac{px}{\hbar}} \langle 0 |_x |0 \rangle_p $$ $$ \delta(p-p') = \langle p | p' \rangle = 2\pi \hbar |\langle 0 |_x |0 \rangle_p|^2 \delta(p-p') $$ $$ \langle 0 |_x |0 \rangle_p = \sqrt{\frac{1}{2 \pi \hbar}}$$ $$ \hat{p}|x\rangle = \int \hat{p} |p\rangle\langle p |x\rangle= \int \hat{p} |p\rangle e^{-i\frac{px}{\hbar}}\sqrt{\frac{1}{2 \pi \hbar}} = i\hbar\frac{\partial}{\partial x}|x\rangle $$ Which assumption is made here? | How to prove $$\hat{p}|x\rangle=i\hbar\frac{\partial}{\partial x}|x\rangle,$$ using $$[\hat{x},\hat{p}]=i\hbar~?$$ The question seems to be uncomplete because for any $f(x)$ $$[\hat{x},\hat{p}+f(x)]=i\hbar.$$ But that's my homework. Can someone add some appropriate assumptions and prove the question? Here is a seemingly right answer: $$ \hat{Q} = e^{-i \frac{u}{\hbar} \hat{p}},[\hat{x},\hat{Q}]=u \hat{Q} $$ $$ \hat{x}\hat{Q}|x\rangle = (x+u)\hat{Q}|x\rangle $$ $$ \hat{Q}|x\rangle = |x+u\rangle $$ $$ \hat{T} = e^{i \frac{u}{\hbar} \hat{x}},[\hat{p},\hat{T}]=u \hat{T} $$ $$ \hat{p}\hat{T}|p\rangle = (p+u)\hat{T}|p\rangle $$ $$ \hat{T}|p\rangle = |p+u\rangle $$ Therefore $$ \langle x | p \rangle = e^{i\frac{px}{\hbar}} \langle 0 |_x |0 \rangle_p $$ $$ \delta(p-p') = \langle p | p' \rangle = 2\pi \hbar |\langle 0 |_x |0 \rangle_p|^2 \delta(p-p') $$ $$ \langle 0 |_x |0 \rangle_p = \sqrt{\frac{1}{2 \pi \hbar}}$$ $$ \hat{p}|x\rangle = \int \hat{p} |p\rangle\langle p |x\rangle= \int \hat{p} |p\rangle e^{-i\frac{px}{\hbar}}\sqrt{\frac{1}{2 \pi \hbar}} = i\hbar\frac{\partial}{\partial x}|x\rangle $$ Which assumption is made here? |
Instantaneous velocity is defined as the limit of average velocity as the time interval ∆t becomes infinitesimally small. Average velocity is defined as the change in position divided by the time interval during which the displacement occurs. When the time interval is infinitesimally small, there shouldn't be any considerable change in position. Thus the instantaneous velocity should be 0. | We have the image below displaying the uniform velocity by time-distance graph. At every point velocity is constant but what if distance and time both become zero as at origin in the graph is? The velocity must become undefined as $\frac{0}{0}$ is undefined in mathematics or shall we call it zero? If zero then why? |
I've been busy trying to answer this question for several hours now and I've thought of looking for when it is eventually increasing or decreasing, but it doesn't seem to ever be either. It came with the hint that $x_n\geq 0$ and $1\leq x_n^2\leq 3$ for all natural numbers n. I understand that the limit would be $\sqrt{\frac{3}{2}}$, but showing that the sequence is Cauchy is the part I'm struggling with. Please help. | For any $a > 0$, I have to show the sequence $x_{n+1}$ $=$ $ \frac 12$($x_n+ $ $ \frac {a} {x_n}$) converges to the square root of $a$ for any $x_1>0$. If I assume the limit exists ( denoted by $x$) then, $x$ $=$ $ \frac 12$($x+ $ $ \frac {a} {x}$) can be solved to $x^2 = a$ How could I show that it does exist? |
My apologies if this has been asked already, I've searched but couldn't find it... Let $x$ such that for every $y \in N$, $y^x$ is an integer. Does that necessarily mean that $x$ is an integer? | Supposing that a real number $c$ is given, is the following true? "If $n^c$ is a natural number for every natural number $n$, then $c$ is a non-negative integer." Though this seems true, I can't prove that. Can anyone help? |
I have had to read so many papers, and papers on writing papers, that I noticed how engaging and more pleasant to read a publication is when the author inserts the occasional funny remark. I'm also writing so many project papers lately (mathematics bachelor) that I am actually developing an enjoyment for writing and attempting to come up with my own style. It's something I'd like to improve and I'd love to write more in the future and as I further my studies. And so I wondered. How appropriate is it for a student to sometimes be funny in his or her reports? I have stumbled on so many half-assedly written assignments that it makes me think that many students simply don't care about nice writing at all, so I don't have any example to base an opinion on. Thoughts? | I was reading titled "Optimal Symmetric Rendezvous Search on Three Locations." While talking about the history of search problems, the author mentions the following anecdote in passing. In 2007 a letter writer to the Guardian newspaper queried, “I lost my wife in the crowd at Glastonbury (a music festival). What is the best strategy for finding her?” A reader replied, “Start talking to an attractive woman. Your wife will reappear almost immediately.” While I found it quite amusing to read this, I do not often come across papers with such witticisms. Is there an unwritten rule about the tone of sobriety that is considered appropriate in academic papers? Are jokes or anecdotes fine as long as they do not appear forced? |
In it is shown that slicing is faster than anything in terms of making a copy of an item. Using: list1 = ['foo','bar'] copy1 = list1 * 1 list1.pop() print 'list1: ' + list1 print 'copy1: ' + copy1 I get: list1: ['foo'] copy1: ['foo', 'bar'] Any particular reason to stay away from making copies like this? | I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3 The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]] Then I changed one of the innermost values: my_list[0][0] = 5 Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]] which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it? |
I just installed Ubuntu 14.04.1 onto a drive with existing partitions. I want to make a link/shortcut to one of my games installed on one of the partitions (/media/emily/ Gaming). After making a link of the .jar file (FTB.jar) and moving that link to desktop it works. But after restart it says the link is broken and asks me to trash it. The drive currently says it's mounted. Any suggestions as to why this is happening? I'm very new to linux, so a detailed description of what might be happening and suggestions to fix it would be appreciated. After restart: $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 298.1G 0 disk ├─sda1 8:1 0 28G 0 part / ├─sda2 8:2 0 1K 0 part ├─sda3 8:3 0 6.5G 0 part [SWAP] ├─sda4 8:4 0 65.6G 0 part /home ├─sda5 8:5 0 100G 0 part └─sda6 8:6 0 98G 0 part sr0 11:0 1 1024M 0 rom $ cat /etc/fstab # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda1 during installation UUID=2fee48ec-8d63-4125-9eca-5b2e1061602d / ext4 errors=remount-ro 0 1 # /home was on /dev/sda4 during installation UUID=b3804a77-7d80-40a6-8f92-212bed16a151 /home ext4 defaults 0 2 # swap was on /dev/sda3 during installation UUID=8fff87b8-2128-48ae-bfd4-bc959458f99d none swap sw 0 0 After making a link from the gaming partition: $ mount /dev/sda1 on / type ext4 (rw,errors=remount-ro) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) none on /sys/fs/cgroup type tmpfs (rw) none on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) udev on /dev type devtmpfs (rw,mode=0755) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755) none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880) none on /run/shm type tmpfs (rw,nosuid,nodev) none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755) none on /sys/fs/pstore type pstore (rw) /dev/sda4 on /home type ext4 (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev) systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd) gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=emily) /dev/sda5 on /media/emily/ Gaming type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096) | I'm using ubuntu 14.04 LTS. When I start my pc and click on any bookmark from the file manager it shows this error: Unable to find the requested file. Please check the spelling and try again. Unhandled error message: Error when getting information for file '/media/angel/DOC/edu': No such file or directory But when I open DOC drive and again clink on the same bookmark it works properly. Can anybody tell me why is this happening and how to solve this issue? Edit: Output of lsblk is following: (ubuntu is installed in sda5) NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 119.2G 0 disk ├─sda1 8:1 0 91.3G 0 part ├─sda2 8:2 0 1K 0 part ├─sda5 8:5 0 24.1G 0 part / └─sda6 8:6 0 3.8G 0 part [SWAP] sdb 8:16 0 465.8G 0 disk ├─sdb1 8:17 0 93.2G 0 part ├─sdb2 8:18 0 1K 0 part ├─sdb5 8:21 0 93.2G 0 part ├─sdb6 8:22 0 89.3G 0 part ├─sdb7 8:23 0 93.2G 0 part ├─sdb8 8:24 0 93.2G 0 part └─sdb9 8:25 0 3.8G 0 part sr0 11:0 1 1024M 0 rom After opening the disk drive the output of lsblk is bellow: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 119.2G 0 disk ├─sda1 8:1 0 91.3G 0 part ├─sda2 8:2 0 1K 0 part ├─sda5 8:5 0 24.1G 0 part / └─sda6 8:6 0 3.8G 0 part [SWAP] sdb 8:16 0 465.8G 0 disk ├─sdb1 8:17 0 93.2G 0 part ├─sdb2 8:18 0 1K 0 part ├─sdb5 8:21 0 93.2G 0 part ├─sdb6 8:22 0 89.3G 0 part /media/angel/DOC ├─sdb7 8:23 0 93.2G 0 part ├─sdb8 8:24 0 93.2G 0 part └─sdb9 8:25 0 3.8G 0 part sr0 11:0 1 1024M 0 rom The output of sudo blkid gives the following information about sdb6: /dev/sdb6: LABEL="DOC" UUID="04280A22280A12FA" TYPE="ntfs" |
History enthusiasts can bask in historical enclaves scattered throughout the island while beach lovers can relax and enjoy sea sports along the 3.2 kilometres stretch of Siloso, Central and Tanjong Beaches. This sentence is from an article about "Travel in Southeast Asia". The phrase "the 3.2 kilometres stretch of Siloso" is a question to me. I think it should be "the 3.2- kilometer stretch of Siloso" as I have learn that" When Noun + noun is used in measurements, with a number before the first noun,the number is usually joined to the first noun by a hyphen (-)." Please give me some advice on it. Thanks in advance. | Could you explain me please, why sometimes the word "mile" is used in singular, sometimes in plural, while in both cases it refers to several and not 1 mile. Example: They took part in a 26 mile long swimming race. After 12 miles he got tired. Thanks in advance to those who can enlighten me! |
Is the uncertainty principle a technical difficulty in measurement or is it an intrinsic concept in quantum mechanics irrelevant of any measurement? Everyone knows the thought experiment of measuring the position of an electron. One can detect electron's position by hitting it with a photon, due to Compton scattering the collision of the photon with electron will change electron's momentum. This experiment is used to explain uncertainty principle to layman, but it is over simplified, isn't it? It also gives an impression that if there was a better suited experimental method the uncertainty principle becomes irrelevant. I personally think it is intrinsic as it arises from the non-zero commutator of position and momentum operators irrespective of the measurement process. Am I right? EDIT: My question is similar to certain extent to and . The answers there are nice but they focus on explaining basics of quantum mechanics more than they comment on the technical difficulty part. In the answers of question 2 there are statements like "So, it's not a knowledge limit" and "you're sort of correct when you say it's an observational limit" without further comments To summarize, assume hypothetically we managed to find a way in the future where we can have a look at an electron without disturbing it by measurement or causing its wave function to collapse, would the uncertainty principle still hold in such a case?? Why/Why not? | From what I understand, the states that there is a fundamental natural limit to how accurately we can measure velocity and momentum at the same time. It's not a limit on equipment but just a natural phenomenon. However, isn't this just an observational limit? There is a definite velocity and momentum, we just don't know it. As in, we can only know so much about the universe, but the universe still has definite characteristics. Considering this, how do a wide range of quantum mechanical phenomena work? For example, quantum tunneling - its based on the fact that the position of the object is indefinite. But the position is definite, we just don't know it definitely. Or the famous light slot experiment? The creation of more light slots due to uncertainty of the photon's positions? What I am basically asking is why is a limit on the observer, affecting the phenomenon he is observing? Isn't that equivalent to saying because we haven't seen Star X, it doesn't exist? It's limiting the definition of the universe to the limits of our observation! |
For example: ArrayList<Integer> a = new ArrayList<Integer>(); while(a.size() < 50){ a.add(1); a.add(2); a.add(9); } System.out.println(a); I would like to remove all the excess 1's, 2's, and 9's, but keep one of each. Not cleared: [1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9, 1, 2, 9] Cleared: [1, 2, 9] Ideally I would like this to work for any x value that occurs any n number of times in the ArrayList. My partial solution just returns whether or not a value occurs more than once (true if it occurs more than once, false if it doesn't) public static boolean occ(ArrayList<Integer> l, int s) { int n = 0; boolean t = false; for (int p : l) { if (p == s) { n++; } } if (n > 1) { t = true; } return t; } Method implementation: occ(ArrayList, Selected Int Value to be Checked); If I change to a HashSet or Set, would I be able to implement the ArrayList methods clear() and size()? | I have an ArrayList<String>, and I want to remove repeated strings from it. How can I do this? |
What would be the factors that one should consider when deciding at what age to give a child their fist cell phone? Assume that the phone can (if needed) be somewhat secured, with a curated list of applications. | It seems everybody and his cat has a smartphone today. (I'm guilty too.) My son will probably demand his own phone somewhere between the age of 7 and 12. I know I can't compare to when I was a kid because the world is completely different today. So how can I decide? When should kids get their own cellphone? What factors are relevant for the decision? Smartphone, or plain cellphone? Why? |
Is there some g for which g(x mod 1) is not periodic? If so, please tell me what it is. | I want to know all sets of single-variate functions that fulfill the following qualities: $\forall_{f:R^2 \to R^2} \forall_{g \in CAF} \forall_{h \in CAF} \exists_{k\in CAF} k(x) = f(g(x),h(x))$ where CAF is the set I am wishing to find. I know that the set of constants and the set of piece wise constants each satisfy that equation. Do any others? |
I have built two simple triggers, both of which cannot be deployed to production as they fail for a bad test class that has some broken SOQL in it. My current thoughts are to just delete the bad test class from production so these triggers will pass and deploy. I plan to use Eclipse to do this. Any thoughts or previous experiences? Thank you for the link on how to delete classes, however I am really interested in the community's experience with bad test classes. Thanks! | I was recently told ( ): You cannot delete a class in production directly. You will need delete the class from your sandbox and then deploy the deletions to your production org. When you deploy from sandbox to production, the missing classes will come up in red and you can choose to deploy these deletions to Production. However, I'd like some clarification because finding information on how to do this is like pulling teeth, unfortunately. Am I supposed to: Delete the Trigger in Sandbox Make a deployment package in Sandbox Add the Trigger which is going to be listed in RED now Deploy (and that deletes it from Production)? I am not seeing deleted Triggers in Red in Sandbox. Are they NOT listed under "Triggers" for deployment, but elsewhere? Frustrated = true. Does this ONLY apply to Classes?? UPDATE: I just tried again, with a CLASS, and it still doesn't show up at all as a Deployable package (red or not) after I delete it in the Sandbox. UPDATE 2: I was just able to delete a class, that I know was written via IDE from a third party, in both Sandbox and Production. So now I'm wondering if it has to do with where it was originally deployed from (if from IDE, IDE can delete it - it from Sandbox, you have to jump through hoops). :-( |
We used to work with a local Apache instance (WAMP) as a development environment, but we installed recently a PRTG server on the same machine, so it listens to the same port, as it is a web-based tool. We are not able to reach our Apache server anymore as web requests on the server IP keep going to PRTG. I changed the PRTG listening port to 8080 so that we would have 2 web servers listening to 2 dfferent ports. It doesn't seems to work well: when I try to reach xxx.xxx.xxx.xxx:80 with a browser (Firefox, Chrome) it instantly changes to xxx.xxx.xxx.xxx:8080, and I get to PRTG home page. Why does it changes from what I requested ? Should I use a totally different non-standard port ? What solutions do I have ? | This is a about the use of a *AMPP's stack. I recently had a talk with some experienced people and they suggested to me not to use a WAMP stack, and instead install apache, mysql and php separately. I don't understand why they have suggested this, though, so can anyone tell me? Is there a particular disadvantage of WAMP, or a particular advantage to installing all of them separately? Since a WAMP stack itself is composed of apache, mysql and php, then what's the difference between using the WAMP stack and installing them all separately? |
I would like to calculate Cohen's d for 2x2 ANOVA interaction (nationality: Germany, France; gender: male, female). Someone asked similar question earlier (), and got an advise to calculate Cohen's d using (a1 - b1) - (a2 - b2) as a numerator and the square root of the MSE from the ANOVA as a denominator. Could someone please tell me a reference, where I could find more information how to calculate Cohen's d using this formula? I really cannot find any. What would a1, a2, b1 and b2 be in my case? | I have a significant 2x2 interaction in a between-subjects design. I would normally report omega-squared as my effect-size measure, but I've been asked to provide Cohen's d instead? Can Cohen's d be computed for an interaction? If so, how? |
I wish to write the name of pdfTeX's author: I am not able to figure out how to write the middle name. I triedTh\'{\^{e}}, but it doesn't return the desired output. It's different from the similar double accent question: since the answer there (using TIPA) doesn't work here. This is a very specific situation. | As linguistics student, I have to put more than one thing on a character every now and then. For example, I need to type ā̆. I thought I could simply do that by typing \={\u{a}}, but then the macron is placed above an empty space in front of the character. How can I solve this? Thanks P.S. I'm using MiKTeX 2.9, running on Windows 8; in case it might be of use. |
Is there an easier way to determine if a variable is equal to a range of values, such as: if x === 5 || 6 rather than something obtuse like: if x === 5 || x === 6 ? | What is the most concise and efficient way to find out if a JavaScript array contains a value? This is the only way I know to do it: function contains(a, obj) { for (var i = 0; i < a.length; i++) { if (a[i] === obj) { return true; } } return false; } Is there a better and more concise way to accomplish this? |
I have a 32bit window server running 2003 that I need to update to linux. I run a website on it. Will the newest server version run on a 32 bit machine? | Please help! I have 3 desktops and 1 laptop and bring the laptop everywhere and keep the 3 desktops at home and they all have Ubuntu on them and I would like to access media and any kind of files I have on all of them through or with my laptop when I'm traveling! All 3 desktops and 1 laptop are all 32 bit systems! So how can I install and run Ubuntu Server on 32 bit systems? |
Kaggle defines the log loss function as: $$f(w) = \log \Pr(y_t|y_p) = y_t \log(y_p) + (1 - y_t) \log(1 - y_p)$$ Let $y_t \in {0, 1}$, and $y_p$ is given by the sigmoid function $y_p = \sigma(w \cdot x) \in (0,1)$, where $\sigma$ is defined by $$\sigma(w \cdot x) = \dfrac{1}{(1+\exp(-w \cdot x)}$$ $w,x \in \mathbb{R}^n$. The objective variable is $w$ so $x$ could be thought of as a weight. So putting everything together: $$f(w) = y_t \log\left(\dfrac{1}{(1+\exp(-w \cdot x)}\right) + (1 - y_t) \log\left(1 - \dfrac{1}{(1+\exp(-w \cdot x)}\right)$$ My question is: Is $f(w)$ convex? I have read up some references but can't see the relationship: . If anyone has a reference, it will be greatly appreciated!! | Where can I find a good proof that CRF based models and logistic regression based models are convex? Is there a general trick to test/prove that a model or objective function is convex? |
I am running into some trouble accessing my Raspberry Pi (running Raspbian) from my WAN IP. TightVNCserver is installed and running on port 5901 on the Raspberry Pi. Port forwarding is enabled on my router/switch from 5900 to 5901 going to the Raspberry Pi’s internal address. If using the internal 192.x.x.x address the Raspberry Pi is accessible. When attempting to access the Raspberry Pi from my external WAN with port 5901 specified I receive “connection refused.” Ran a nmap -sV scan to verify port 5901 is open on the Raspberry Pi. Temporarily disabled my router’s firewall to see if it was blocking anything and got the same results. Any thoughts? | I have a computer running TightVNC server. It is on my home network. The computer it is installed on has a locally static ip address 192.168.1.100. I am able to connect to this vnc server from my home network fine, but unable to connect from outside my network (using the IP address that I see at ). I have forwarded port 5900 (and 5800) to ip address 192.168.1.100. But if I use I am unable to see that port. I am running Windows 7. Any suggestions? |
The real plane, $R^2$ , is a vector space over $R$. Describe, in geometrical terms, all subspaces of $R^2$. Can anyone help me with exercise? How can I do that in geometrical terms? | I understand how to manipulate vector spaces and subspaces and how to prove various statements about them, but I still don't fully understand what they represent geometrically. I just need an intuitive grasp as to what these are. Is a vector space a geometric area that contains all possible vectors of the field $\Bbb F$? For example, if $V$ is a vector space over $\Bbb R^3$ then does that mean $V$ contains all vectors in three-dimensions that are part of $\Bbb R$? But then what is a subspace of $V$? Would that perhaps be a plane? Would it be a vector space in $\Bbb R^2$? |
So I have this function that takes a function with no parameters: public static bool RetryUntilSuccessOrTimeout(Func<bool> task, TimeSpan timeSpan) { bool success = false; int elapsed = 0; while ((!success) && (elapsed < timeSpan.TotalMilliseconds)) { Thread.Sleep(1000); elapsed += 1000; success = task(); } return success; } And then I have a bunch of functions like: private static bool OnDeleted(object source, FileSystemEventArgs e){...} private static bool OnChanged(object source, FileSystemEventArgs e){...} private static bool OnCreated(object source, FileSystemEventArgs e){...} I have a function that takes same aruments as those three. So I have that information provided. Is there a way to pass these function as ones not taking any arguments (because I provide them) so i can pass it into the "task" of RetryUntilSuccessOrTimeout() ? An encapsulating image of the problem: | Given a method DoSomething that takes a (parameterless) function and handles it in some way. Is there a better way to create the "overloads" for functions with parameters than the snippet below? public static TResult DoSomething<TResult>(Func<TResult> func) { //call func() and do something else } public static TResult DoSomething<T0, TResult>( Func<T0, TResult> func, T0 arg0) { return DoSomething(() => func(arg0)); } public static TResult DoSomething<T0, T1, TResult>( Func<T0, T1, TResult> func, T0 arg0, T1 arg1) { return DoSomething(arg => func(arg, arg1), arg0); } public static TResult DoSomething<T0, T1, T2, TResult>( Func<T0, T1, T2, TResult> func, T0 arg0, T1 arg1, T2 arg2) { return DoSomething(arg => func(arg, arg1, arg2), arg0); } |
My lens Nikon AF 85mm 1.8 will only focus at 22 otherwise I get a fEE flashing on the top display. Any suggestions? I use a D80. | I have a AF Nikkor 50mm f/1.8. When I have the aperture setting on the lens to 22 I can take photos. But when I change the dial to anything other than 22(lowest f/stop) then I get a flashing fEE message and r09 where the number of exposure left is. I don't have the manual for this lens but am just wondering if anyone knows what the issue is here. My camera is a Nikon D70S. |
Why doesn't this c++ code work? It is meant to dynamically cast a base class into a derived class. How would I achieve this? class base { public: int x = 0; }; class a : public base { public: char c = 'a'; }; class b : public base { public: long int d = 'b'; }; std::vector<base> vec; for (int i = 0; i < 5; i++) { b temp; vec.push_back(temp); } for (int i = 0; i < 5; i++) { b* temp = (b*)&vec[i]; std::cout << temp->d << std::endl; } | Someone mentioned it in the IRC as the slicing problem. |
When submitting a form in a contact page, what do you prefer? For me it's better to keep the data in the fields, disable the fields, disable the submit button and give a feedback message to the user. | As a user, when I submit a "Contact us" form with [valid] info, should the page response show in the form (clear the form and show some "We have received your message" type of success message, either at the top or bottom of the form, or should they simply be redirected to another page showing the success message? |
As mentioned in , when tapping a comment in the Android app, we should have a reply icon, letting us reply to the comment, instead of the auto complete on the site: However, when I tap a comment I get the "flag" icon instead of reply icon: What is going on? Can this please be fixed? | When commenting, having an autocomplete when you want to @reply to a user would be wonderful (similar to the one available on the desktop site). Normally when I'm on mobile site, I can copy/paste the username, remove the spaces, and I move on with life. But without copy/paste available within the app, the complex or unicode names are nearly impossible to use @reply. |
WoW has had gone through several expansions now. If I start playing as a new subscriber at this time, will I still get to experience the storyline since its first release or will I miss out all the previous storyline? | I'm just starting WoW for the first time... My question: Is the storyline and quests that I'm doing the same as what players did when the game started (in 2002 or whatever)? Or have events happened in the game that have progressed the entire timeline/story of the game for new players? |
What is the difference between $GLOBALS['wp_the_query'] and global $wp_query? Why prefer one over the other? | It's probably more of a PHP question, but I would like to know if there are any differences in using global $post; echo $post->ID; when compared to echo $GLOBALS['post']->ID; to access the ID of a post in WordPress. This on SO suggests that the first method is quicker to process, while the second method is quicker to write. I also noticed that the first method is often mentioned in the Codex while the second method is mentioned on page. Is this only a matter of preference? Or does it come to performance and security too? Thanks |
Determine exactly $\displaystyle\sum_{i=0}^\infty (-1)^i \dfrac{1}{3i+1}$. From the question it is evident that this sum has an exact value. It is also alternating and since $a_n=\dfrac{1}{3n+1}$ is a positive, decreasing sequence that approaches $0$ as $n\to \infty$ the series converges. I think the Taylor series of $\ln (1+x) = x-\dfrac{x^2}{2}+\dfrac{x^3}{3}-\dots$ might be useful here, but I can't seem to make much progress from that. It seems like the sum can be expressed in terms of $\pi$. | Evaluate : $$\sum_{n=0}^\infty\frac{(-1)^n}{3n+1}$$ I tried using logarithmic functions, but cannot evaluate this please help me |
I am trying to get started with GDAL on a windows machine using Python2.7. I have tried commands such as: gdalinfo RasterFileName.TIF and gdal_translate.py -projwin ulx uly lrx lry -of GTiff input.TIF output.TIF and they run without producing any results. What am I missing that makes these not to work. For example, I am doing the gdal_translate as follows: import os infile = path+'InFileName.TIF' outfile = path+'OUTFileName.TIF' string ='gdal_translate -projwin %.0f %.0f %.0f %.0f -of GTiff %s %s' %(ulx,uly,lrx,lry,infile,outfile) os.system(string) Many thanks | Is it possible to use some gdal API to call gdal_translate from Python code? I do not mean simply executing the gdal_translate.exe from the file system, but rather call it somehow in code so I do not need to know the exact directory the gdal_translate executable is in? |
I am a Pakistani national, and I am traveling to Jamaica via Canada. I have a valid visa for Jamaica and need to catch my connecting flight from Canada without leaving airport international zone. Do I need visa to get my connection? | I'm passing through Canada, on my way to somewhere else. I'm staying only a short time. Is there a website, or some other way of find out out if I need a visa? |
In the Call of Duty online stats pages you see how far away from each challenge you are. You achieve small parts of each challenge just by playing the game, but when a challenge is within reach your behaviour changes and you concentrate on achieving it. Can we have a similar set of stats for gaining new badges? The number you have got so far (or number remaining), then a little progress bar for scanning down the list more easily. If you can only get one instance of a badge then you could mark it as completed. For example: [125] [= ] Copy Editor × 655 Edited 500 posts [68] [=== ] Stellar Question × 889 Question favorited by 100 users You could add more badges for getting badges. E.g. Get all bronze badges, get all silver badges, getting a bronze badge 5/10/x times. I bet analysing the data will show how the visitor behaviour has changed and it'll be a good way to increase traffic as well. | I just noticed the Copy Editor badge progress indicator on , Can we have this for more badges please? In particular the badges where it's not clear to the user how they're doing. Announcer Archaeologist Booster Generalist Pundit Sportsmanship Taxonomist Tenacious Unsung Hero It would also be nice to put it somewhere in stackoverflow.com/badges (tool tip maybe?) |
I installed Marshmallow on my Galaxy Note 4 like 2 months ago. Everything was nice and peaceful, and I was happy to be able to select custom permissions per app. A few days ago, out of the blue, I started getting this very irritating and well known problem, where every time I want to grant an app permissions, I have to get a message that asks me to turn off screen overlays. The most annoying part, is that it doesn't tell me what overlaying app I have to disable. I just get this generic annoying message, PLUS, there's no master switch for overlays on my Note 4! Am I gonna have to spend the next two years being unable to give any app any permissions? Every time this happens, I spend an hour digging... This is crazy and very impractical! What are my options here? How can I get rid of this problem once and for all? PS: My phone is rooted, so please, whatever it takes! Thanks! | I started receiving the “Screen overlay detected” dialog when trying to change apps settings. Tried to turn off all "draw over other apps" as it says here - , first without system and then with, but it still doesn't work. Then, I restored apps to original settings and it just made a bigger mess, dialog continue appearing. Any way to go back to previous settings??? Thanks! |
Replace an employee aged > 50 with a younger employee. I am trying to update an item inside an array I am forEach()ing on. Assigning the current fails while noting the index and replacing the item after forEach() block works. Kindly explain this behaviour? var youngerEmployee = { name: { first: 'B', last: 'C' }, age: 25 } var employees = [ { name: { first: 'X', last: 'Y' }, age: 45 }, { name: { first: 'A', last: 'B' }, age: 54 } ]; /* --- Failed approach --- */ employees.forEach( (employee) => { if(employee.age > 50) { employee = youngerEmployee; } } ); console.log(employees); /* --- Successful approach --- */ var i = -1; employees.forEach( (employee, index) => { if(employee.age > 50) { i = index; } } ); employees[i] = youngerEmployee; console.log(employees); | The primitive types (number, string, etc.) are passed by value, but objects are unknown, because they can be both passed-by-value (in case we consider that a variable holding an object is in fact a reference to the object) and passed-by-reference (when we consider that the variable to the object holds the object itself). Although it doesn't really matter at the end, I want to know what is the correct way to present the arguments passing conventions. Is there an excerpt from JavaScript specification, which defines what should be the semantics regarding this? |
Hey I have a simple question, I want to download the following (for a bash script) with wget: https://app.plex.tv/desktop#!/settings/server/[[long string of letters and numbers]]/status/server-dashboard So ofcourse I typed the following command: wget https://app.plex.tv/desktop#!/settings/server/[[long string of letters and numbers]]/status/server-dashboard But when I press enter, it downloads "desktop", because it stops at # in the link. AKA it downloads https:///app.plex.tv/desktop. This is probably because # or ! means something for wget, so it 'breaks up' the link. I tried surrounding the complete link with ' and " (e.g. 'https://.....dashboard' and "https://.....dashboard") but both didn't make wget download the whole link. Putting \ before # (e.g. /desktop\ #!/settings) or putting \ before ! (e.g. /desktop#\ !/settings) didn't work. When I view the command (with nano) in my bash script, I can see that the ! in the link is green, while the rest of the link is gray. So it's deffinetely breaking the link. How can I make sure wget downloads the whole link and doesn't stop at '#' or '!'? thanks | Well, I have few directories have name contains hashes (#, eg: #abczxy). Now I can't to execute this cd #foo it will redirect me back to the root directory equal with this command cd The question is, is this possible to do that or is there any tricks allow me do that? Thanks. |
I'm wondering how to open files in programs such as Notepad and Picture Viewer depending on the extension the file has. I'm using Python 3.3 on Windows. I've done some research and people have mentioned a module named Image, but when I try and import this module I get an ImportError. Here's what I have so far: def openFile(): fileName = listbox_1.get(ACTIVE) if fileName.endswith(".jpg"): fileName.open() I will also have HTML and JSON files that I will need to open in Notepad. | I need to be able to open a document using its default application in Windows and Mac OS. Basically, I want to do the same thing that happens when you double-click on the document icon in Explorer or Finder. What is the best way to do this in Python? |
Is it posible to convert a js object to json or is a js object exactly a JSON ? Can someone tell me what a JSON exactly is ? | How can I serialize an object to JSON in JavaScript? |
Imagine the following situation: An array of 4 elements of type uint8_t is given that represent 32 bit integer, byte by byte. The goal is to address the whole array as a 32 bit integer. int main( void ) { uint8_t array[4] = { 0, 0, 0, 12 }; uint32_t * ptr = ( uint32_t * )array; printf("%d", *ptr); return 0; } Forget about endianess for now, it is not relevant to the question (I do not think). Now the C standard says that casting a pointer to a type with more strict alignment is undefined behavior. Some examples of compliant and non-compliant code are given here: The code above compiles and gives expected result on latest GCC and IAR compilers I've tried. The question is whether this code is safe in general? I imagine the following situation on the architecture where integer type is self-aligned. My logic is that since array will inherit the alignment specification of its most strict type - char it can be placed anywhere in memory. For example: Memory | Value | integer can start here .... 0x20 | | yes 0x21 | 0 | no <- array begins, uint32_t ptr 0x22 | 0 | no 0x23 | 0 | no 0x24 | 12 | yes .... In this scenario if we dereference a uint32_t pointer we may potentially crash on some architectures. Did I miss something here? Obviously this code works on major compilers and I would imagine that cases where it fails are very specific, more related to legacy architectures and compilers. Nevertheless, is such code safe and portable as according to C standard? If I made incorrect assumptions or interpreted something incorrectly, please let me know. | When asking about , people sometimes refer to the strict aliasing rule. What are they talking about? |
I'm going to be installing a paver patio over an existing poured slap patio. it is surrounded on two sides by brick wall, and a third side by pressure treat wood ( the side of a house build on concrete tubes ). The fourth side is the down hill side, and I would like to allow it to drain. Since there is something constraining on all sides, do I really have to cement the perimeter pavers down, or can I just install again existing surfaces. | I'm going to be putting pavers over an old slab patio. The current patio has settled and spalled, so I'm looking to pitch the paver patio in such a way that it drains as the original slabs did. In some places that will mean 2" of substrate while 1/2" in others. It is surrounded on two sides by brick wall, and a third side by pressure treated wood (the side of a house built on concrete tubes). The fourth side is the down hill side. Since there is something constraining on all sides, do I really have to cement the perimeter pavers down, or can I just install again existing surfaces? I plan on using polymeric sand for the cracks, but what is the best type of substrate to use under the pavers if they are on top of solid concrete? Should I compact the substrate or not? |
this is a fairly basic question, but I have spent all day trying to figure it out (including reading other questions on this page), and I could really use some help. I am trying to run a simple mixed model with one random effect nested under a one fixed effect. In short, I have two study sites with multiple activity measurements (i.e., repeated measures) for individuals at each site. So "activity" is my response, "site" is a fixed effect factor, and "individual" is a random effects factor that is nested under site (i.e., each individual is present at only one site, but I have multiple data points for each individual). I have tried to use the following line of code, but I am not convinced that I am doing it correctly. result <- lme(activity~site+individual,data=table1,random=~1|individual/site) Specifically, my questions are as follows: First, do I need to specify individual both in the second term of the model and in the final term? If I am understanding correctly, the second term specifies the fixed effects, and the final term specifies the random effects, so listing "individual" in both places seems incorrect, but if I don't do that, then I do not get any output for individual. Second, for nesting terms, my initial impression was that you always started with the higher order terms (e.g., "site/individual" would nest individual within site), but if I do that with these data, I get error messages and NaN values. So, do I list individual/site or site/individual? Third, since the nesting term is listed as the random term, will that make the model run with both individual and site as random effects? I need to make sure that the model retains site as a fixed effect, while including individual as a random effect. Thank you for the help Edit: it was pointed out to me that my question may be a duplicate of a previous question (); however, that question ended up not using a nested design, thus the nesting issues that I am asking about were never resolved. Thanks again. | I just fit a model in lme4, and I'm wondering what the heck I fit... I have individuals id, and each is measured pass/fail on items that can be described using two factors, f1 and f2. My theory says that id and f2 can interact. So I want to compare these models: # f2 doesn't matter m1 <- lmer(pass ~ f1 + (1|id), family="binomial") # f2 is a fixed effect, doesn't interact with individuals m2 <- lmer(pass ~ f1 + f2 + (1|id), family="binomial") # f2 is a nested random effect, interacting with individuals m3 <- lmer(pass ~ f1 + (1|f2/id), family="binomial") First, am I right that there's a random effect of each level of f2, and each individual's level of f2 is partially pooled, depending on the number of observations for that individual? Second, does it make sense to fit f2 as a fixed effect with random individuals nested within each level of f2? How does one write that? Third, what's this, with f2 and id reversed in the formula? I typed it by accident, but now I want to understand it. m3weird <- lmer(pass ~ f1 + (1|id/f2), family="binomial") |
The Edo were described as a pre-warp civilization. So, wasn't this a violation of First Contact regulations? Rimmick brings up the Edo incident in the episode Coming of Age. But his charges were just about how Picard interfered with the government, to rescue Wesley. It seems the Enterprise shouldn't have made contact at all. | In a first season episode of Star Trek: The Next Generation the Enterprise visits a planet named Rubicun III where () the Edo live. It is often mentioned in Star Trek that the Prime Directive requires that pre-Warp civilisations be ignored until they discover Warp mechanics. But this planet and civilisation appears to be exempt from that status. Why? |
When I'm playing/working on my laptop the keyboard sometimes key-in randomly, so I ask: How can I disable its on-board keyboard? System: Laptop Acer v3 772g OS: Windows 8 | I have a HP Compaq Presario C700 laptop with Windows 7 installed on it. My laptop's keyboard is not working properly; some keys never work and some keys will keep on pressing. I've formatted the OS but it didn't solve my problem. I bought an external USB keyboard and it works well. As some keys in the built-in keyboard activate themselves, I still couldn't work effectively. After searching Google I tried the following steps to disable the built-in keyboard: Disabled keyboard drivers: This didn't work because when the system reboots, the driver gets installed again automatically. Installed irrelevant driver for keyboard: This failed - I couldn't install the driver. After rebooting it installed the correct driver automatically. Can anyone help explain how I can temporarily uninstall my built-in keyboard? I don't want to remove it manually (removing the hardware cable). |
I have two rectangles and want to detect if rectangle intersects with other rectangle in geographic coordinate. My actual code working only with positive geographic coordinate values if (rect1.MaxLongitude < rect2.MinLongitude || rect2.MaxLongitude < rect1.MinLongitude || rect1.MaxLatitude < rect2.MinLatitude || rect2.MaxLatitude < rect1.MinLatitude) { return false; } else { return true; } How can i achieve detecting in geographic coordinate with negative and positive values (even in one coordinate)? | I am trying to write a C++ program that takes the following inputs from the user to construct rectangles (between 2 and 5): height, width, x-pos, y-pos. All of these rectangles will exist parallel to the x and the y axis, that is all of their edges will have slopes of 0 or infinity. I've tried to implement what is mentioned in question but I am not having very much luck. My current implementation does the following: // Gets all the vertices for Rectangle 1 and stores them in an array -> arrRect1 // point 1 x: arrRect1[0], point 1 y: arrRect1[1] and so on... // Gets all the vertices for Rectangle 2 and stores them in an array -> arrRect2 // rotated edge of point a, rect 1 int rot_x, rot_y; rot_x = -arrRect1[3]; rot_y = arrRect1[2]; // point on rotated edge int pnt_x, pnt_y; pnt_x = arrRect1[2]; pnt_y = arrRect1[3]; // test point, a from rect 2 int tst_x, tst_y; tst_x = arrRect2[0]; tst_y = arrRect2[1]; int value; value = (rot_x * (tst_x - pnt_x)) + (rot_y * (tst_y - pnt_y)); cout << "Value: " << value; However I'm not quite sure if (a) I've implemented the algorithm I linked to correctly, or if I did exactly how to interpret this? Any suggestions? |
Everything worked fine and I never had any problems with this code. But somehow I now get a null object when I try to receive a Tab that is not in the first position: java.lang.NullPointerException: Attempt to invoke virtual method 'android.support.design.widget.TabLayout$Tab android.support.design.widget.TabLayout$Tab.setCustomView(android.view.View)' on a null object reference tabLayoutSetup is called in onCreateView. private void tabLayoutSetup(){ // Get the ViewPager and set it's PagerAdapter so that it can display items Bugger.t(context,"tablayout"); viewPager.setAdapter(pagerAdapter); // Give the TabLayout the ViewPager tabLayout.setupWithViewPager(viewPager); createTabs(); } //this method is creating all tabs for account's tablayout private void createTabs(){ TabLayout.Tab ShareTab = tabLayout.getTabAt(0); TabLayout.Tab MarkTab = tabLayout.getTabAt(1); //*********************************************************************************************************** //inflating template for first tab, Activities. View TabView = LayoutInflater.from(context).inflate(R.layout.account_tablayout_customtab, null); //template TextView titel = (TextView) TabView.findViewById(R.id.tab_titel); //populating first template for 'Activities' titel.setText(getResources().getString(R.string.SharesTab)); titel.setTextColor(ContextCompat.getColor(context,R.color.tabLayout_active)); ShareTab.setCustomView(TabView); //********************************************************************************************************** //inflating template for second tab, Messages. TabView = LayoutInflater.from(context).inflate(R.layout.account_tablayout_customtab, null); //template titel = (TextView) TabView.findViewById(R.id.tab_titel); //populating second template for 'Messages' titel.setText(getResources().getString(R.string.MarkTab)); MarkTab.setCustomView(TabView); It's really strange because it worked smoothly before. Receiving the Tab at the position 0 (.getTabAt(0)) is not a problem at all. However, I cannot receive the Tab at the position one. XML: <android.support.design.widget.TabLayout android:id="@+id/account_tabLayout" android:layout_width="match_parent" android:layout_height="52dp" android:layout_marginTop="12dp" android:visibility="visible" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/account_bio"> </android.support.design.widget.TabLayout> | What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? |
I want to make a bootable Windows installation USB on OSX. However, I run into the problem with isntall.wim file that doesn't fit into FAT32 4GB file limit. All google results about this problem () describe the solutions that I can use on a Windows system. How can I split the install.wim file if I only have a working OS X system? Is there anything similar to Dism /Split-Image console tool that I can use? | So I am attempting to create a Windows 10 install USB on my MBP running macOS 10.14 Mojave. To create a bootable USB it needs to be formatted into FAT32, not exFAT. The issue is that when copying the .iso to the USB it fails because the file sources/install.wim is 4.4GB. I can't format as exFAT because I cannot boot from that format and I cannot use FAT32 because of the 4.4GB file. I used the command cp -rpv /Volumes/CCCOMA_X64FRE_EN-US_DV9/* /Volumes/WINDOWS10/ after Boot Camp Assistant failed to create the USB with a "Drive too small" error, even though it was a 16GB drive. When I wasn't paying attention, the cp completed and the installer booted, but failed with a missing: sources/install.wim error because the file can't be copied. Is there any solution to this problem, or should I just burn a DVD with the installer on it? EDIT: I forgot to specify that I was creating a USB for a PC, not a Mac. The Mac was just being used to create an install USB. Heres the file: |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.