body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
I think most of us are quite aware of Archimedes principle, but is there a reason to why it occurs? Is it just an observed property? Why is the upthrust equal to the weight of the liquid? | Yesterday my friends and I were solving this easy-looking question: A metal cube is placed in an empty vessel. When water is filled in the vessel so that the cube is completely immersed in the water, the force on the bottom of the vessel in contact with the cube: (A) Will Increase (B) Will Decrease (C) Will remain the same (D) Will become zero At first we thought the answer to be (B) considering the buoyant force acting opposite to the weight of the cube. But then, a question popped up in my mind: "What causes this buoyant force even if no fluid was actually displaced?" So I referred to the Archimedes' Statement: Any object, wholly or partially immersed in a fluid, is buoyed up by a force equal to the weight of the fluid displaced by the object. — Archimedes of Syracuse But according to the question, no such fluid was displaced by the block ! So, here are my questions: What is the basic reason behind buoyancy? Is it the pressure difference in fluids or the 'liquid-displaced' theory? What must be the answer to the question (That I was solving) ? Considering the case that you may say- "The reason behind buoyancy is the pressure difference in the fluids"; Will there be no buoyant force applied to the iron cube as there is no fluid layer present below the cube i.e. no pressure difference? (Considering the iron cube is VERY dense and thus not allowing any fluid layer to push its way below it) Or you might add another statement to the above question that-"Yes, buoyant force is applied as there is always a fluid layer present below it..." .Please do explain yourself. If your answer is according to the Principle given by Archimedes of Syracuse , will there be no buoyant force on the cube as the cube didn't actually displace any fluid? Just like the case where you may consider it to be a part of the vessel itself. |
My problem is that I have header-file (custom unit-test framework) with function definitions in it. For example: unit_test.h: #pragma once ... void Assert(bool b, const string& hint = {}) { AssertEqual(b, true, hint); } ... it's convenient for me to keep some functions defined right in the header, because I often use this functional by simply including (unit_test.h is located in separate directory C:/Dev/include). But if I am dealing with a project where multiple cpp files use this functionality, I get a multiple definition error as expected. Simple project looks like: main.cpp: #include "unit_test.h" void foo(); int main() { Assert(1); foo(); return 0; } foo.cpp: #include "unit_test.h" void foo() { Assert(2); } So I want to know if there is a right way to keep function definitions in a header file and use it in project without getting an multiple definition error? (Or would it be better to move the function definitions to the source and compile it separately each time, or compile unit_test into a static library?) | I have a class which has many small functions. By small functions, I mean functions that doesn't do any processing but just return a literal value. Something like: string Foo::method() const{ return "A"; } I have created a header file "Foo.h" and source file "Foo.cpp". But since the function is very small, I am thinking about putting it in the header file itself. I have the following questions: Is there any performance or other issues if I put these function definition in header file? I will have many functions like this. My understanding is when the compilation is done, compiler will expand the header file and place it where it is included. Is that correct? |
So I have this spreadsheet with data in it, there are 29 columns and 54 rows. On the 2nd sheet I'm trying to find all of the rows that fit a certain criteria. For some reason, if I include the column X in my query data, the results are completely messed up. The 1st row of the result is just concatenating the first 23 rows together whether they fit the criteria or not. If I only include up to Column W the query is OK and it returns the correct results. But the problem is that I need to get data from Columns A and AB, so I need to include column X in my data range. In this spreadsheet you can see the data on Sheet1, the query that includes column X on Sheet2, and on Sheet3 I have the same exact query except it only goes up to Column W and you can see the correct results there. Basically, I need the query to return the value of Column A and Column AB for every row where Column B is marked with an "x". | I'm getting some really weird results from my QUERY() Here is an image with an example: I'm querying for the name where No Show = "No Show". It find the correct name Name 5 but also returns a concatenated list of names separated by a space. Why is this happening? How do I fix it? |
How can I solve this Diophantine equation: $$(n-1)!+1=n^m$$ with $n,m$ positive integers? From Wilson's theorem we can note that $n$ is a prime number. I proved to rewriting the equation as:$$(n-2)!=n^{m-1}+n^{m-2}+....+1$$ but in vain. I proved to solve also through the theorem LTE bur I analysed only some cases without obtain a general solution. | How to find all positive integers $n$ such that $(n-1)!+1$ can be written as $n^k$ for some positive integer $k$? |
I've installed Ubuntu 14.04. I'm disappointed to see synapse gone from Ubuntu Software Centre. I've added repository available in Launchpad. It resulted in error 404. How can I install synapse? | I really like that synapse application launcher, but there seems to be no way of installing it in ubuntu 14.04. Any ideas why? Or does anyone know how I could get it? |
I have a class as shown below and wanted to create several instance of it where each object should be unique based on the content of map. For this equals and hashcode functions should be specified and I'm looking a way to implement using the map. private class A { private Map<String, Object> map; public A () { this.map = new HashMap<>(); } public void addElement (String s, Object v) { map.put(s, v); } @Override public boolean equals (Object o) { // should be on map } @Override public int hashCode () { // should be on map } } | What issues / pitfalls must be considered when overriding equals and hashCode? |
I want to subtract days from date in java. But I dont want to use external libraries. I have referred some of questions from stackoverflow but they are suggesting to use external libraries. So I have applied following logic noOfDays = 24; Date compareDate = new Date(currentDate - noOfDays * 24 * 60 * 60 * 1000); System.out.println("compare date " + compareDate); It is working fine till 24 days.But after 24 days it is giving unexpected result. Is there any solution to this ? | Anyone know a simple way using Java calendar to subtract X days from a date? I have not been able to find any function which allows me to directly subtract X days from a date in Java. Can someone point me to the right direction? |
I am aware of Ctrl+L on bash terminal (using it on Ubuntu) which clears the screen by applying appropriate scrolling on bash terminal. After learning that the terminal is by default set to emacs mode and that I have been using vim on the rest of my programming life, I wanted to shift to vi editing mode on terminal by using: set -o vi. But it seems there is a learning curve here too. Here is my simple question: How to clear the terminal in vi mode? On a parallel note, am I right if I assume that every (at least the most used) command in emacs mode has equivalents in vi mode? Clarification of similarity: There seems to be a similar question -- Which asks to force Ctrl+l as well to work in vi mode. But clearly, it doesn't clarify whether is an existing/default way of clear-screen operation, in vi mode!! So, I reckon its a different question. P.S. : Update: As @Gilles pointed out, the Ctrl+L seem to work in command mode of vi style editing. That means we have two possible ways to clear the screen of a terminal in vi mode: From the default insert-mode, we should press Esc to move to command-mode and then use Ctrl+L. Use the answers in to get Ctrl+L working directly in insert-mode My current question requests to explain any method other than the two, possibly native to insert-mode. | When you press Ctrl+L in bash default mode the screen is cleared. But when I run set -o vi and press Ctrl+L the keystroke is printed (^L). Is there any way to keep this behavior? |
Is there a StackExchange logo in Latex (package)? Something like this: I have managed to find packages for similar . but couldn't find one for StackExchange? | I am using modernCv, classic style and I need to include my linkedIn and gitHub icons next to my account address in my cv. None of the solutions mentioned nor have worked for me. Do you have any suggestions? |
I want the ability to restart a xorg server via simple bash script. Something like this: #!/bin/bash exec killall X exec startx Please, do not ask me why, I am who asks. | I would like to know how can I restart xorg server via simple bash script. I want to learn bash and this script will help my friend with his problem. My friend's issue: He wanted a display manager, but does not wanted his xorg server to be run by root, and the plan was to create a bash script that kills the display manager in his case SDDM, and then, script would startx as a regular user. He is running gentoo. |
If the gravity of a star can change the trajectory of a photon, is the speed of the photon reduced at the moment of departure from the stellar's surface? Can modern science calculate the measure of change? | How do I solve the speed of light in gravitational field? Should I just add gravitational acceleration in speed of light? $$c'=c_0+g(r)t~?$$ |
In Selenium 2 - Java, what's the difference between ChromeDriver driver = new ChromeDriver(); and WebDriver driver = new ChromeDriver(); ? I've seen both of these used in various tutorials, examples, etc and am not sure about the difference between utilizing the ChromeDriver vs WebDriver objects. | I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this? I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly. Is it just so if you were to do: IInterface classRef = new ObjectWhatever() You could use any class that implements IInterface? When would you need to do that? The only thing I can think of is if you have a method and you are unsure of what object will be passed except for it implementing IInterface. I cannot think how often you would need to do that. Also, how could you write a method that takes in an object that implements an interface? Is that possible? |
I reported a bug with LibreOffice (the 'official' bionic-upgrade version) and LO support person suggested upgrading to a current version from their site. They said I was using an old version. I prefer to upgrade via 'Ubuntu Software' in an attempt to reduce risk (security and stability) so I looked there. It caused me to wonder if the more up-to-date, snap version, which also appears in 'Ubuntu Software' alongside , is (more) trustworthy than the Canonical distributed one. Basically, how much trust can be placed in snap of a provider? This obviously requires comparing it to the trustworthiness of Canonical Corp...! p.s. Please don't simply suggest to learn to read code and I won't suggest you learn DIY open heart surgery; humans specialise. | I don't like installing apps outside my distro's official repositories. Linux's security relies a lot on having a repository meticulously curated and tested for library compatibility with current distro version, stability and security. Once I installed, from outside repos, a fancy terminal emulator that mimicked retro green/amber phosphor monitors. This app wreaked havoc in my system and I had to reinstall Ubuntu. I hesitate a lot about using PPAs as well. I only trust very few external sources, PPAs or packages downloaded from websites. But now Snap and seems to be all the rage in Ubuntu-specialized sites. Is it safe to install Snap apps or Flatpak apps? Are there official repos for such? How is stability taken cared of with this non-apt stuff? |
Question : For each $n \in \mathbb N$, Define : $\gamma_n=1+\frac{1}{2}+\dots+\frac{1}{n}-\int_1^n \frac{1}{x}dx$ Prove that $\{\gamma_n\}$ is convergent. Note 1 : I know that $\sum_1^\infty \frac{1}{k}$ diverges. I can guess that this sequence is convergent to $0$ because of the similar terms inside the integration and outside of it. The problem is that the integration is continuous. I mean that $x$ is not just integers. What can we do with the values left?! ( For example, $\frac{1}{2.5}$ ) Also, Notice that this problem should be solved with some elementary tools. ( It's from a part of my book which is even before any discussion about the Fundamental theorem of calculus. ) Note 2 : I'm not good at integration and i'm learning it. Any good details can help me. Thanks in advance. | Problem Prove that the sequence $$x_n=1+\frac{1}{2}+\frac{1}{3}+\cdots+\frac{1}{n}-\ln n,~~~(n=1,2,\cdots)$$is convergent. One Proof This proof is based on the following inequality $$\frac{1}{n+1}<\ln \left(1+\frac{1}{n}\right)<\frac{1}{n}$$ where $n=1,2,\cdots$, which will be used repeatedly. On one hand, we obtain that $$\ln 2-\ln 1<1,~~\ln 3-\ln 2<\frac{1}{2},~~\ln 4-\ln 3<\frac{1}{3},~~\cdots,~~\ln (n+1)-\ln n<\frac{1}{n}.$$ Adding up all of these,we have that $\ln(n+1)<1+\dfrac{1}{2}+\dfrac{1}{3}+\cdots+\dfrac{1}{n}.$ Hence,$$x_{n+1}=1+\frac{1}{2}+\frac{1}{3}+\cdots+\frac{1}{n}+\frac{1}{n+1}-\ln(n+1)>\frac{1}{n+1}>0.$$ This shows that $x_n$ is bounded below. On the other hand,$$x_n-x_{n+1}=-\frac{1}{n+1}+\ln(n+1)-\ln n=\ln \left(1+\frac{1}{n}\right)-\frac{1}{n+1}>0.$$ This shows that $x_n$ is decreasing. Combining the two aspects, according to Monotone Bounded Theorem, we can assert that $\lim\limits_{n \to \infty}x_n$ exists. Let $\gamma$ (so-called Euler–Mascheroni Constant) denote the limit, i.e. $$\gamma=\lim_{n \to \infty}\left(1+\frac{1}{2}+\frac{1}{3}+\cdots+\frac{1}{n}-\ln n\right),$$which equals $0.577216 \cdots$. We may also express that as $$1+\frac{1}{2}+\frac{1}{3}+\cdots+\frac{1}{n}=\gamma+\ln n+\varepsilon_n,$$where $\varepsilon_n$ represents an infinitesimal related to $n$ under the process $n \to \infty$. |
(EDIT: I now see after having posted that it . But I think it is worth considering again.) It is different from a previous . And I am not requesting to because I believe you should read the whole question before deciding to vote. The idea is to have a visual sign that you have upvoted/(downvoted) a given question in question lists and in particular in favorite lists. One has already a visual clue that a question has been accepted and that one has favorited a question. I think that it would be useful, especially in the favorite list (where by definition you have only questions that you have favorited), to have a visual clue that you have voted this question up as well. Your use of the site may vary, but I often favorite a question when I intend to go back to it later, as a kind of reminder. I do not always upvote the question or its answer since I may need time to read and assess it carefully. It would among other things allow to go on recently changed questions for which you have still the possibility to upvote. Another use on classical question lists is to allow to go quickly to potential interesting questions that you can upvote if it is deserved. Going through old questions (especially with ambiguous titles), this is also quite handy to check if one has already been there or not. | There's been several times where I have been surfing the site, and noticed a question that I am not sure I've checked. Even if I've checked the question before, I can't recall off-hand whether or not I've voted on it or its answer. Is there a way we can have our personal voting history reflected to some degree or another, in the Questions listing? For example, could there be an indicator as to whether or not we have already voted (up or down) on a question, and perhaps maybe an additional indicator as to whether we've up-voted any of its answers? It would be very convenient to have some of this data available up-front, without actually having to view the question again. |
I'm reading Serre's Trees and in Example 1.5.3 he claims that $PSL_2(\mathbb{Z})$ is isomorphic to $\mathbb{Z}_2 \ast \mathbb{Z}_3$. $\mathbb{Z}_2 \ast \mathbb{Z}_3 = \langle x, y | x^2 = y^3 = 1 \rangle$. But does $PSL_2(\mathbb{Z})$ even have elements of order $2$ or $3$ to begin with? Previously, I thought since all elements of $PSL_2(\mathbb{Z})$ is in the form of $$ \begin{bmatrix} 1 & n \\ 0 & 1 \end{bmatrix}. $$ Hence $\mathbb{Z}$ injects in $PSL_2(\mathbb{Z})$. Let $\phi: \begin{bmatrix} 1 & n \\ 0 & 1 \end{bmatrix} \mapsto n$. $\phi$ is a homomorphism and in fact bijective. Hence $\mathbb{Z} \cong PSL_2(\mathbb{Z})$. Thus $PSL_2(\mathbb{Z})$ cannot have any $2$-torsion or $3$-torsion. I must be missing something. Any help is appeciated! | Prove that $PSL(2,\mathbb{Z})=C_2 \star C_3$. Now $C_2 \star C_3=\langle a,b\ |\ a^2, b^3 \rangle$ i.e. the free product. But how do I show that presentation of $PSL(2,\mathbb{Z})$ is this? |
I am trying to use this IEEE to write a report. I don't see any package named \usepackage{multicol} which is used for multi-column. So I can not change it from two column to single column. Problem is, I have a big table which need whole page without two column. That is, my table should be in single column with whole page. You can see the example image. Sorry for bad image. Also, I have to use this template to write my report. | I'm trying to get images in my document in two different ways: On top of the entire page, centered On top of a single column I tried it with both twocols and multicols. I ruled out twocols because it forces a new page every time you turn it on, because I need the abstract to be wide and the rest of the cover page to be two columns. Here are some examples of both points (screenshot from a downloaded PDF): I want to achieve both, but somehow I can only solve the first point with: \end{multicols} \begin{figure} \centering \includegraphics[width=0.5\textwidth]{figure} \caption{Dataflow pipeline of the edge detector} \label{fig:workflowedge} \end{figure} \begin{multicols}{2} Is it awkward to turn off multicols, then turn it back on again? For my second point, I've tried everything, but almost always, the image doesn't show up at all! The only way I can get it to show at all is by specifying the H placement specifier, but that places the image inside the text where I defined it, not on top of the column. This is my best try, but it hides the image and breaks all references to ??: \begin{figure}[t!] \centering \includegraphics[width=0.25\textwidth]{figure} \caption{Dataflow pipeline of the edge detector} \label{fig:workflowedge} \end{figure} and I'm getting the warning: Package multicol Warning: Floats and marginpars not allowed inside `multicols' environment!. How can I make a figure a non-float? I also tried the figure* environment, but that just creates an image centered on top of the page, like my first point. |
I have implemented Maximum-entropy Markov model (MEMM) for the Named entity recognition (NER) problem. I have four classes: geographical, people, material (book titles etc) and other. Class other is overrepresented in the training & test datasets. It occurs 88% (about 40k samples) of the time. I'm sure other authors must have had this problem. How do you suggest I go about solving this problem? EDIT: A single data sample is a whole tagged sentence. Most of the sentence is tagged as other. I'm guessing the resampling techniques won't work here? Do you suggest I use single tokens for training dataset, instead of whole sentences? EDIT 2: In response to my post being a duplicate: you do realize you've linked to a question that was asked 2 years after mine, right? | This is a question in general, not specific to any method or data set. How do we deal with a class imbalance problem in Supervised Machine learning where the number of 0 is around 90% and number of 1 is around 10% in your dataset.How do we optimally train the classifier. One of the ways which I follow is sampling to make the dataset balanced and then train the classifier and repeat this for multiple samples. I feel this is random, Is there any framework to approach these kind of problems. |
I have searched all over internet for exact map of Game of Thrones cities. But every map is different from each other and rather confuses me as they have embedded story-line into it. Can anybody give a link/photograph/illustration of complete map of Game of Thrones with all mentioned cities of seven kingdoms of westeros and also Essos and Sothoryos? This question is different from because I disagree that the map does not exist: Here it is: But this map lacks details of isolation of seven kingdoms in westeros, regions of Essos and Sothoryos. In a nutshell, I need a one political map instead of many scattered political maps. Reference: | The Dothraki come from a land (Essos) that is east of Westeros, and separated by the Narrow Sea. But the map given in the book (A Game of Thrones) doesn't show anything beyond Dragonstone. Is there a reason for this? |
My players will get a choice as they are assaulting a castle. There will be three magical siege engines they will need to stop so their troops don't get slaughtered. Now knowing they have a fight with the big bad coming, they can either sneak in and stop all three towers themselves, or just stop one then move in to the boss fight leaving the other two towers to their retainers. Should the players decide to leave the other towers to their retainers I want a simple way to decide some off screen combat because the retainers might die if it's left to them. How would you guys handle it? | I'm about to run a premade adventure, and reading through it I see a potential situation where one group of monsters could, though PC actions, end up fighting each other. As a PC, I hate seeing my DM, for lack of better words, play with himself. NPC vs. NPC combats played out blow-for-blow in initiative order, while the party fights other foes or just ends up watching. Is there a tried and tested better way of doing this? I want the PCs to be able to take advantage of the situation, but ideally not track HP and roll damage round for round if they decide to sit and wait. If it's a full "background battle" then I'd assume the highest CR group wins, with losses. But if this is not the case - both enemy groups are hostile to the party and each other - how do I resolve the NPC-NPC combats quickly and cleanly so my players aren't bored waiting for the results? |
I'm trying to run a shell script in (#!/bin/sh in HP-UX) on exact times(hh:mm:ss) hh:05:00 .. hh:10:00 .. hh:15:00 .. hh:20:00 .. hh:25:00 and so on. I understand this could be done using cron but I'm looking for another way to do this. Adding: watch/repeat are not supported | There's a built-in Unix command repeat whose first argument is the number of times to repeat a command, where the command (with any arguments) is specified by the remaining arguments to repeat. For example, % repeat 100 echo "I will not automate this punishment." will echo the given string 100 times and then stop. I'd like a similar command – let's call it forever – that works similarly except the first argument is the number of seconds to pause between repeats, and it repeats forever. For example, % forever 5 echo "This will get echoed every 5 seconds forever and ever." I thought I'd ask if such a thing exists before I write it. I know it's like a 2-line Perl or Python script, but maybe there's a more standard way to do this. If not, feel free to post a solution in your favorite scripting language. PS: Maybe a better way to do this would be to generalize repeat to take both the number of times to repeat (with -1 meaning infinity) and the number of seconds to sleep between repeats. The above examples would then become: % repeat 100 0 echo "I will not automate this punishment." % repeat -1 5 echo "This will get echoed every 5 seconds forever." |
I'm trying to remove all files more than 1 days old.Before I execute a script to remove the files,I try to find the files using mtime. however, I face same problem with my command- My Current date is Wed Jan 27 11:49:20 BDT 2016 My file lists are- Jan 25 15:11 25-01-2016.txt Jan 26 13:05 26-01-2016.txt Jan 27 02:30 27-01-2016.txt Jan 25 15:11 dfk-25-01-2016.txt Jan 26 13:05 dfk-26-01-2016.txt Jan 27 02:30 dfk-27-01-2016.txt I thought -mtime +1 was supposed to list all files over a day old. find /etc/output/*.txt -mtime +1 find /etc/output/*.txt -mtime +0 /output/25-01-2016.txt /output/dfk-25-01-2016.txt find /etc/output/*.txt -mtime -1 /output/26-01-2016.txt /output/27-01-2016.txt /output/dfk-26-01-2016.txt /output/dfk-27-01-2016.txt My desired out output is as followings, find /etc/output/*.txt -mtime +1 /output/25-01-2016.txt /output/dfk-25-01-2016.txt find /etc/output/*.txt -mtime +0 /output/26-01-2016.txt /output/dfk-26-01-2016.txt /output/25-01-2016.txt /output/dfk-25-01-2016.txt | I'm struggling to wrap my mind around why the find interprets file modification times the way it does. Specifically, I don't understand why the -mtime +1 doesn't show files less than 48 hours old. As an example test I created three test files with different modified dates: [root@foobox findtest]# ls -l total 0 -rw-r--r-- 1 root root 0 Sep 25 08:44 foo1 -rw-r--r-- 1 root root 0 Sep 24 08:14 foo2 -rw-r--r-- 1 root root 0 Sep 23 08:14 foo3 I then ran find with the -mtime +1 switch and got the following output: [root@foobox findtest]# find -mtime +1 ./foo3 I then ran find with the -mmin +1440 and got the following output: [root@foobox findtest]# find -mmin +1440 ./foo3 ./foo2 As per the man page for find, I understand that this is expected behavior: -mtime n File’s data was last modified n*24 hours ago. See the comments for -atime to understand how rounding affects the interpretation of file modification times. -atime n File was last accessed n*24 hours ago. When find figures out how many 24-hour periods ago the file was last accessed, any fractional part is ignored, so to match -atime +1, a file has to have been accessed at least two days ago. This still doesn't make sense to me though. So if a file is 1 day, 23 hours, 59 minutes, and 59 seconds old, find -mtime +1 ignores all that and just treats it like it's 1 day, 0 hours, 0 minutes, and 0 seconds old? In which case, it's not technically older that 1 day and ignored? Does... not... compute. |
I would like to backup all files older than 90 days and greater plus gzip them. I could execute: find /path/to/files -type f -mtime 90 -exec gzip "{}" \; Problem with this command is it includes files 90 days old and not older ones. So it will gzip June's files but not May's. Thanks! | I want to find files which are greater than 1 GB and older than 6 months in entire server. How to write a command for this? |
I have to add a \supervisor field to the title page of my presentation. Is there a way to do that in beamer? I tried adding the supervisor information to the \author field, but the content of the author field are also displayed on the footer of all the slides, and I wanted just my name to be there. If adding a field is not possible is there a way to display custom text at the footer? | I am editing a presentation of a research project, I am wondering if there is a field for "supervisor" on the page of the title, for instance \supervisor(which actually does not work)... If not, where do people conventionally add it? |
Let $\mathbb{Z}\left [ i \right ]=\left \{ a+bi:a,b \in \mathbb{Z} \right \}.$ Show that the field of quotient of $\mathbb{Z}\left [ i \right ]$ is ring isomorphic to $\mathbb{Q}\left [ i \right ]=\left \{ r+si: r,s \in \mathbb{Q} \right \}$ Let's try to construct the field of quotient: The field of quotient is the smallest field of fraction contained in an integral domain. Try: $F=\left \{ \frac{a+bi}{c+di} : a+bi, c+di \in \mathbb{Z}\left [ i \right ]\right \}$ I never liked these sort of questions involving function construction. I wish I could obtain a bit of help here to get me further. Thanks in advance. | I'm looking to prove that $\Bbb Q[i] = \{ p + qi : p, q \in \Bbb Q \}$ is the field of fractions of $\Bbb Z[i] = \{p + qi : p, q \in Z\}$. I am familiar with definition of a field of fractions. For example, I understand that if one has an integral domain $D$, it can be embedded in a field of fractions $F_D$, and every element of $F_D$ can be written as the quotient of two elements in $D$. However I have been confused by two questions: (1) If one has a field $F$, and one can show that any element in $F$ can be expressed as the quotient of two elements in an integral domain $D$, does that imply that $F$ is the field of fractions of $D$? (i.e. Would it suffice in my case to show that every element in $\Bbb Q[i]$ can be written as a the quotient of 2 elements of $\Bbb Z[i]$?) (2) How can I show that element in $\Bbb Q[i]$ can be written as a the quotient of 2 elements of $\Bbb Z[i]$? When I write an element of $\Bbb Q[i]$ like $$q = \frac ab + \frac cdi$$ I get mixed up trying to come up with 2 elements of $\Bbb Z[i]$ that could equal that. I set $z = u+vi$ and $w = x+yi$, equate $q = z/w$ and I end up with these equations like this: $$a = ux + vy; b = x^2 + y^2; c = vx - uv; d = x^2 + y^2$$ This doesn't strike me as the way to go. Possibly there is a way to take advantage of fact that the elements are equivalence classes, but I'm not seeing it. Thank you very much! |
so i faced strange behaviour with this code below. I am getting error that local variable flag is referenced before assignment, but its assigned at the top as global variable. Can someone tell me whats going here and why flag is not incrementing as expected? import concurrent.futures flag = 0 def make_some(): try: flag += 1 except Exception as e: print(e) with concurrent.futures.ThreadPoolExecutor(max_workers=3) as executor: tasks = { executor.submit( make_some ): task_id for task_id in [1,2,3] } for future in concurrent.futures.as_completed(tasks): pass | The following code works as expected in both Python 2.5 and 3.0: a, b, c = (1, 2, 3) print(a, b, c) def test(): print(a) print(b) print(c) # (A) #c+=1 # (B) test() However, when I uncomment line (B), I get an UnboundLocalError: 'c' not assigned at line (A). The values of a and b are printed correctly. This has me completely baffled for two reasons: Why is there a runtime error thrown at line (A) because of a later statement on line (B)? Why are variables a and b printed as expected, while c raises an error? The only explanation I can come up with is that a local variable c is created by the assignment c+=1, which takes precedent over the "global" variable c even before the local variable is created. Of course, it doesn't make sense for a variable to "steal" scope before it exists. Could someone please explain this behavior? |
g(x)=f(-x), where $g:[-b,-a] \rightarrow R$ and it is given that $f$ is integrable on $[a,b]$ Need to prove that $\int_{-b}^{-a}f(-x)dx$ is integrable if $\int_{a}^{b}f(x)dx$ is. Is there a way to do this using the properties of integrals? | $f:[a,b]\rightarrow R$ that is integrable on [a,b] So we need to prove: $$\int_{-b}^{-a}f(-x)dx=\int_{a}^{b}f(x)dx$$ 1.) So we'll use a property of definite integrals: (homogeny I think it's called?) $$\int_{-b}^{-a}f(-x)dx=-1\int_{-b}^{-a}f(x)dx$$ 2.) Great, now using the fundamental theorem of calculus: $$-1\int_{-b}^{-a}f(x)dx=(-1)^2\int_{-a}^{-b}f(x)dx=\int_{-a}^{-b}f(x)dx$$ This is where I'm stuck. For some reason I think it might be smarter to skip step 2, to leave it asL $$-1\int_{-b}^{-a}f(x)dx$$ because graphically, we've "flipped" the graph about the x-axis, but we're still calculating the same area. Proving that using properties seems to have stumped me. I prefer hints over solutions, thanks. |
The question is Prove that $a\mathbb{Z}\cap b\mathbb{Z}=[a,b]\mathbb{Z}$. Hint:First prove $b\mid a \Leftrightarrow a\mathbb Z\le b\mathbb Z$ and then prove $a\mathbb Z+b\mathbb Z=(a,b)\mathbb Z$ I managed to prove $b\mid a\Leftrightarrow a\mathbb Z\le b\mathbb Z$. About the next claim: From the first statement ($b\mid a...$) it follows that since $(a,b)\mid a$ and $(a,b)\mid b, a\mathbb Z+b\mathbb Z\le(a,b)\mathbb Z$. My problem is proving the opposite side (a.k.a $a\mathbb Z+b\mathbb Z\ge(a,b)\mathbb Z$). How can I do so and how can I proceed from $(a,b)$ to $[a,b]$? | Let be $$ a_1,\ldots,a_r \in \mathbb{N} $$ I want to show that $$ a_1 \Bbb Z \cap \dotsb \cap a_r \mathbb{Z} = {\rm lcm}(a_1, \ldots, a_r) \Bbb Z$$ ok,I know that $ {2}\Bbb Z \cap 3\mathbb{Z} = 6\mathbb{Z}. $ I struggle getting an idea of how to prove it correctly, maybe you guys can help! |
C-3PO has, in the words of and related question, a "fussy and worry-prone personality". He reacts poorly to dangerous situations, usually exclaiming some variation of "we're all going to die!" For example, the very first line spoken in all of Star Wars: Did you hear that? They've shut down the main reactor. We'll be destroyed for sure. In the top answer to the linked question, Null C-3PO's personality is (mostly) that of a standard protocol droid, and it is natural for one to become anxious in dangerous situations. A often serves diplomatic functions. Negotiations and other diplomatic relations are potentially tense and stressful, and I think that you would want the people and droids involved to be able to stay calm. While some of the situations in which we see Threepio—like actual battles—are probably outside normal operating parameters, he should still be able to deal with some level of stress. However, he even seems uncomfortable when working for Jabba the Hutt, even though that is exactly the sort of work protocol droids are supposed to do. Even in the more extreme situations, I can't think of any advantage to a diplomat or interpreter showing such visible fear and anxiety. What reason is there for a protocol droid, like C-3PO, to be so anxious in stressful situations? | Droids . Purging the memory should clear the personality, too. Unfortunately, this didn't work on C-3PO. It looks like this personality is hardwired to him. In the prequel trilogy, he was fussy and worry-prone. In the original trilogy, he was again fussy and worry-prone despite having memory wipe. If you look at the first version of C-3PO, you'll find that he had the same personality even that time. This brings the question: From where did kid Anakin get this fussy and worry-prone personality data to burn it as fail-safe default of C-3PO? |
I would really like to answer some questions and upvote some answers I see, but I only have one reputation point and need way more. What can I do? Does anybody else have this same problem? | I've seen a few questions I'd like to comment on or give a different answer, but seeing how I don't have 50 reputation (I've been a lurker for years, finally decided to participate) do I really need to ask a few questions before I can comment/answer other people's stuff? Or am I missing something here? Sorry if this has been answered before, but with a few search tries I couldn't find any similar stuff, even tried google just for "50 reputation stackoverflow" but that didn't give me anything either. |
I'm struggling with this problem for a few days now ;( I want to install Chrome and Chromedriver to use selenium on ubuntu, so I connected to Ubuntu 18.04 with Putty (windows 10 user) and write some codes that are needed for chrome installation, but the error is occurred as below: Could anyone please tell me what to do? ubuntu@ip-172-31-35-176:~$ wget -q -O - https://dl-ssl.google.com/linux/linux_s igning_key.pub | sudo apt-key add - OK ubuntu@ip-172-31-35-176:~$ sudo sh -c 'echo "deb [arch=amd64] http://dl.google.c om/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' ubuntu@ip-172-31-35-176:~$ sudo apt-get update E: Malformed entry 1 in list file /etc/apt/sources.list.d/google.list (Component ) E: The list of sources could not be read. | I have unistalled and reinstalled the Ubuntu Software Center as per info I found in a similar thread and I got the same response about line 91 or something like that. I just tried to upload a screen shot but since I'm new it won't allow me to. I also can not figure out how to cut and paste anything so I have to hand type what the error screen says, both when I attempt to open the software center and nothing happens, when I try to enter commands into the terminal to uninstall, reinstall, whatever I get the same following: COULD NOT INTITIALIZE THE PACKAGE INFORMATION An unresolvable problem occured while initializing the package information Please report t:his bug against the 'update-manager' package and include the following error message: 'E: Malformed line 91 in source list/etc/apt/sources.list (dist parse) E: The list of sources could not be read., E: The package list of status file could not be parsed or opened. How do I report bugs? What can be done about this. I have searched and everything everyone says to do leads me back to the same line error message. So, I don't know how to get to line 91 in the source list; to tell you what it says. Sorry, I'm really new to this. That is what I need is to find out how to get there and fix what it says. I would really like to NOT have to re partition my hard drive and start from scratch, so I'm really looking forward to getting this problem solved. I need to be able to install new software. |
Find all positive integers $x,y,z$ such that $$x!+y!=z!$$ My Progress: let $x=y=1$ so that you get $2!$ Which is true. How do I compute this algebraically instead of substituting random values? | I have the formula $x! + y! = z!$ and I'm looking for positive integers that make it true. Upon inspection it seems that x = y = 1 and z = 2 is the only solution. The problem is how to show it. From the definition of the factorial function we know $x! = x(x-1)(x-2)...(2)(1)$ So we can do something like this: $$ [x(x-1)(x-2)...(2)(1)] + [y(y-1)(y-2)...(2)(1)] = [z(z-1)(z-2)...(2)(1)]$$ we can then factor all of the common terms out on the LHS. $$ [...(2)(1)][x(x-1)(x-2)... + y(y-1)(y-2)...] = [z(z-1)(z-2)...(2)(1)]$$ and divide the common terms out of the right hand side $$[x(x-1)(x-2)...] + [y(y-1)(y-2)...] = [z(z-1)(z-2)...]$$ I'm stuck on how to proceed and how to make a clearer argument that there is only the one solution (if indeed there is only the one solution). If anybody can provide a hint as to how to proceed I would appreciate it. |
With , what is the most recent date which can be accurately determined, and why? Is there an accepted time range, within which, accurate results can be attained using carbon-14 dating? I understand that the method can provide dating up to ca. 50,000 years into the past, but I'm interested in the other end of the time range: is there a point in time when younger (recent) specimens can no longer be dated with accepted accuracy? I have read sources that place this limit anywhere between 50 and 500 years. I have read that this difficulty in the young-sample range is due to the fact that not enough material has been depleted to calculate accurately. I also understand the concerns with carbon-14 dating regarding the impact of fossil fuels / atomic activity in recent dating attempts. I also am aware of new carbon contamination when sampling. I am a paintings conservator and have been requested to examine a panel painting from approximately 1550 A.D., and I have evidence which supports this date. Would a carbon-14 analysis be of equal accuracy in this case? | A friend and I recently discussed the idea that radioactive decay rates are constant over geological times, something upon which dating methods are based. A large number of experiments seem to have shown that decay rate is largely uninfluenced by the environment (temperature, solar activity, etc.). But how do we know that decay rates are constant over billions of years? What if some property of the universe has remained the same over the one hundred years since radioactivity was discovered and measured, but was different one billion years ago? An unsourced statement on the Wikipedia page on radioactive decay reads: [A]strophysical observations of the luminosity decays of distant supernovae (which occurred far away so the light has taken a great deal of time to reach us) strongly indicate that unperturbed decay rates have been constant. Is this true? I'm interested in verifying constancy of decay rates over very long periods of time (millions and billions of years). Specifically, I'm not interested in radiocarbon dating or other methods for dating things in the thousands-of-years range. Radiocarbon dates, used for dating organic material younger than 50,000 years, are and crossed-checked with non-radioactive data of millennial trees and similarly countable yearly deposits in marine , a method of verification that I find convincing and that I am here not challenging. |
Ginny surely didn't know Parseltongue. It was a dark and rare skill. Talking about Riddle's diary, it was merely hypnotizing Ginny. But, how exactly did Ginny control Basilisk without knowing Parseltongue? | Tom Riddle used Ginny Weasley to open the Chamber of Secrets, which requires the ability to speak Parseltongue. Ginny must have spoken Parseltongue to open the chamber -- does this qualify Ginny as a Parselmouth? |
If two matrices $A$ and $B$ commute, then $e^{A+B} = e^A e^B$ by rearrangement of the $A$'s and $B$'s in the sum. But would the converse be true? So far I've tried to find a counterexample by considering the cases where $A$ and $B$ are 2x2 real upper triangular matrices, but those don't work. Any hint is appreciated, thanks. | It is a well known fact that if $A,B\in M_{n\times n}(\mathbb C)$ and $AB=BA$, then $e^Ae^B=e^Be^A.$ The converse does not hold. Horn and Johnson give the following example in their Topics in Matrix Analysis (page 435). Let $$A=\begin{pmatrix}0&0\\0&2\pi i\end{pmatrix},\qquad B=\begin{pmatrix}0&1\\0&2\pi i\end{pmatrix}.$$ Then $$AB=\begin{pmatrix}0&0\\0&-4\pi^2\end{pmatrix}\neq\begin{pmatrix}0&2\pi i\\0&-4\pi^2\end{pmatrix}=BA.$$ We have $$e^A=\sum_{k=0}^{\infty}\frac 1{k!}\begin{pmatrix}0&0\\0&2\pi i\end{pmatrix}^k=\sum_{k=0}^{\infty}\frac 1{k!}\begin{pmatrix}0^k&0\\0&(2\pi i)^k\end{pmatrix}=\begin{pmatrix}e^0&0\\0&e^{2\pi i}\end{pmatrix}=\begin{pmatrix}1&0\\0&1\end{pmatrix}.$$ For $S=\begin{pmatrix}1&-\frac i{2\pi}\\0&1 \end{pmatrix},$ we have $$e^B=e^{SAS^{-1}}=Se^AS^{-1}=S\begin{pmatrix}1&0\\0&1\end{pmatrix}S^{-1}=\begin{pmatrix}1&0\\0&1\end{pmatrix}.$$ Therefore, $A,B$ are such non-commuting matrices that $e^Ae^B=\begin{pmatrix}1&0\\0&1\end{pmatrix}=e^Be^A.$ It is clear that $\pi$ is important in this particular example. In fact, the authors say what follows. It is known that if all entries of $A,B\in M_n$ are algebraic numbers and $n\geq 2,$ then $e^A\cdot e^B=e^B\cdot e^A$ if and only if $AB=BA.$ No proof is given. How does one go about proving that? |
I have checked with update manager, it shows some simple updates of some useless software and that is also not getting installed and gives the message the broken package and it is irritating me with same message. It gave me this command sudo apt-get install -f after running it says: $ sudo apt-get install -f Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following package was automatically installed and is no longer required: openjdk-7-jre-lib Use 'apt-get autoremove' to remove it. The following extra packages will be installed: libfuse2:i386 The following NEW packages will be installed: libfuse2:i386 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. 1 not fully installed or removed. Need to get 0 B/138 kB of archives. After this operation, 323 kB of additional disk space will be used. Do you want to continue [Y/n]? y (Reading database ... 236898 files and directories currently installed.) Unpacking libfuse2:i386 (from .../libfuse2_2.9.0-1ubuntu3_i386.deb) ... dpkg: error processing /var/cache/apt/archives/libfuse2_2.9.0-1ubuntu3_i386.deb (--unpack): trying to overwrite shared '/usr/share/doc/libfuse2/Makefile.gz', which is different from other instances of package libfuse2:i386 Errors were encountered while processing: /var/cache/apt/archives/libfuse2_2.9.0-1ubuntu3_i386.deb E: Sub-process /usr/bin/dpkg returned an error code (1) | I tried to upgrade Intel graphics in ubuntu 16.10 using the official installer. The last stage of unpacking libcairo2 produces an error (see figure). When I do upgrade I get the same error also: Preparing to unpack .../0-libcairo2_1.15.2-0intel1_amd64.deb ... Unpacking libcairo2:amd64 (1.15.2-0intel1) over (1.15.2-0intel1) ... dpkg: error processing archive /tmp/apt-dpkg-install-aYhdFd/0 libcairo2_1.15.2-0intel1_amd64.deb (--unpack): trying to overwrite shared '/usr/share/doc/libcairo2/changelog.Debian.gz', which is different from other instances of package libcairo2:amd64 Preparing to unpack .../1-libcairo2_1.15.2-0intel1_i386.deb ... Unpacking libcairo2:i386 (1.15.2-0intel1) over (1.15.2-0intel1) ... dpkg: error processing archive /tmp/apt-dpkg-install-aYhdFd/1-libcairo2_1.15.2-0intel1_i386.deb (--unpack): trying to overwrite shared '/usr/share/doc/libcairo2/changelog.Debian.gz', which is different from other instances of package libcairo2:i386 Errors were encountered while processing: /tmp/apt-dpkg-install-aYhdFd/0-libcairo2_1.15.2-0intel1_amd64.deb /tmp/apt-dpkg-install-aYhdFd/1-libcairo2_1.15.2-0intel1_i386.deb E: Sub-process /usr/bin/dpkg returned an error code (1) It seems that there is a conflict in thelibcairo releases; if yes, how to resolve it ? |
What is the average distance of two points chosen uniformly on a unit square? What I am asking is how to calculate $E\left(\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}\right)$ for $x_1, x_2, y_1, y_2$ spread uniformly on $[0,1]$. | A square with side $a$ is given. What is the average distance between two uniformly-distributed random points inside the square? For more general "rectangle" case, see . The proof found there is fairly complex, and I am looking for a simpler proof for this special case. I expect it could be significantly simpler. See also . |
I tried to set environment variable as aaa.bbb in powershell from windows platform however it looks like it does not like .. This works. $Env:aaa = "testvalue" This fails. $Env:aaa.bbb = "testvalue2" Is it possible to have environment variable name to have .? | I know I can access environment variables in PowerShell using $Env. For example, I can access FOO with $Env:FOO. I can't figure out how to access the environment variable called FOO.BAR. $Env:FOO.BAR doesn't work. How can I access this from within PowerShell? |
I have been given the following complete systems of eigenvectors $$\mathbf{Q}\mid\mathbf{q} \rangle=\mathbf{q}\mid\mathbf{q} \rangle, \quad \mathbf{P}\mid\mathbf{p} \rangle=\mathbf{p}\mid\mathbf{p} \rangle, \quad \langle \mathbf{q} \mid\mathbf{p} \rangle=\frac{1}{(2\pi\hbar)^{n/2}}e^{i\mathbf{q}\cdot\mathbf{p}/\hbar},$$ but I cannot see where the 3rd expression comes from, I cannot understand why it isnt just 1? I think it may be somehow related to the delta function of which I have the integral representation $$\frac{1}{(2\pi\hbar)^n}\int_{\mathbb{R}^n}e^{i\mathbf{p}\cdot\mathbf{q}/\hbar}d^np=\delta^n(\mathbf{q}).$$ | I'm curious whether I can find the overlap $\langle q | p \rangle$ knowing only the following: $|q\rangle$ is an eigenvector of an operator $Q$ with eigenvalue $q$. $|p\rangle$ is an eigenvector of an operator $P$ with eigenvalue $p$. $Q$ and $P$ are Hermitian. $[Q,P] = i \hbar$. I'm asking because books and references I've looked in tend to assume that $Q$ is a differential operator when viewed in the $P$-basis, then show that it satisfies the commutation relation. (I haven't read one yet that proves that the form given for $Q$ is the only possible one.) I've heard, though, that we can work purely from the hypothesis of the commutation relation and prove the properties of $Q$ and $P$ from it. |
In my UV image editor I have a few textures, that I don't use anymore. I tried to delete these from the list there, by clicking on the minus button, the delete key. ( - ) but nothing got deleted. I saved the project and reopened , but that didn't help anything, the files are still there, I can click a hundred times on the delete button, it won't delete. The list is located right between to the image menu and the plus button in the UV image editor. Is there a way to get these textures out of my list ? Not all of them but just one or a few. | I'm creating a model for a 3D game that will eventually be exported using a custom Python script. This model makes heavy use of UV textures. However, the project now references a bunch of images that are not used by any objects in the project. Example: I don't want the first two, or the red_bubble.png image. However, I have no idea how to remove them from the project. Selecting one of them reveals that there are "2 users of the data" although I am not using it anywhere. How can I get rid of these excess images? |
I don't know... I just thought it might sound really pretty, or "deep" in some way. I've been compiling a list of beautiful and rare words and I'm pretty sure I am addicted to words so I thought "why not?". I would appreciate an answer, and thank you in advance! | I want to be able to describe the love for, or obsession with, words. It may also be a condition from other's perspective. It maybe because he is a lunatic who wants to aggrandize his vocabulary, a crazy person who can't forget the words he hears wafting around, or someone who wants to set a world record or something. Try fitting it in these: He is a _______ who can blurt a thousand synonyms for good. He is so ______ that he can be called a dictionary with a heartbeat. He is showing what a _____ he is. If thesaurus was a ghost, he would be dwelling in that _____'s body. Any word or phrase would do. |
Some creatures have Magic Resistance: The [...] has advantage on saving throws against spells and other magical effects. We know from that this works against Turn Undead, but does it work against Stunning Strike, Death Strike, Fey Presence, etc? How do we decide? | Often confusion arises when the spell is used, an is worn, or the 's anti-magic ray is employed, whether a given character's ability will still function. The spell does give you some guidelines on how to adjudicate the effects of the loss of magic but says very little about how to determine what is affected. In short, how do I tell if an ability is magical? |
I ask this because I noticed the partial sum $\sum_{n=1}^x {1\over \sqrt{n}}$ is very close to $2\sqrt{x}$, so close in fact that it appears their difference approaches a constant value, like $H_x$ and $\ln x$. However, when I put this limit as is into Wolfram, it said the limit diverged. But, I found a way to transform the limit into an infinite sum, by using the transformation $f(x) = f(0) + \sum_{n=1}^x f(n) - f(n-1)$, an application of telescoping series to partial sums. Thus, \begin{align*}\lim_{x\to \infty} \left(2\sqrt{x}- \sum_{n=1}^x {1\over \sqrt{n}} \right) &= \lim_{x\to \infty} \left( 2\sqrt{0} + \sum_{n=1}^x \left( 2\sqrt{n} - 2\sqrt{n-1} \right) - \sum_{n=1}^x {1\over \sqrt{n}} \right) \\ &= \sum_{n=1}^{\infty} \left(2\sqrt{n} - 2\sqrt{n-1} -{1\over \sqrt{n}} \right) \end{align*} This sum converges according to Wolfram by comparison test, and according to me by the integral test, but what does it converge to? It converges incredibly slowly; my best guess is $\approx 1.458$ | How to find $\lim\limits_{n\to\infty}\left({2\sqrt n}-\sum\limits_{k=1}^n\frac1{\sqrt k}\right)$ ? And generally does the limit of the integral of $f(x)$ minus the sum of $f(x)$ exist? How to prove that and find the limit? |
So I am working on a lab dealing with cards and decks. The code I have written in the deck.java is supposed to initialize a deck. However, I get a nullPointException and I don't know why. Here is a snippet of the code (I get the error on the line where it says "cards.add(thisCard);": import java.util.List; import java.util.ArrayList; import java.lang.Math; /** * The Deck class represents a shuffled deck of cards. * It provides several operations including * initialize, shuffle, deal, and check if empty. */ public class Deck { /** * cards contains all the cards in the deck. */ private List<Card> cards; /** * size is the number of not-yet-dealt cards. * Cards are dealt from the top (highest index) down. * The next card to be dealt is at size - 1. */ private int size; /** * Creates a new <code>Deck</code> instance.<BR> * It pairs each element of ranks with each element of suits, * and produces one of the corresponding card. * @param ranks is an array containing all of the card ranks. * @param suits is an array containing all of the card suits. * @param values is an array containing all of the card point values. */ public Deck(String[] ranks, String[] suits, int[] values) { for (int i = 0; i < ranks.length; i++){ Card thisCard = new Card(ranks[i], suits[i], values[i]); cards.add(thisCard); } size = cards.size(); shuffle(); } } | 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? |
In France there are three levels (these are the same for most countries in Europe I think): Licence (3 years) Master (2 years) Doctorat (about 3 years) In the U.S. I believe there are three levels: Undergraduate (4 years) after which we earn a "Bachelor's degree" Graduate (about 2-3 years I think) after which we earn a "Master's degree" maybe (I'm not sure at all) Doctorate (or maybe this is included in the "Graduate" part? I don't know) I'm a French student and I'm planning to arrive in the U.S. for the beginning of the Graduate part (I'm going to study astronomy). I know I should begin the application process at least 7-8 months before leaving France, but should I be leaving right after I finish the 3rd year of Licence or right after I finish the 1st year of Master? In other words... Which one is generally considered to be equivalent to a U.S. Bachelor's degree: the 3rd year of Licence or the 1st year of Master? Does it depends on the quality of the universities? Maybe second-rate universities accept students who have the 3rd year of Licence to their Graduate programs ; while first-rate universities only accept students who have the 1st year of Master to their Graduate programs? | In France the higher education is like this: 3 years of "Licence" 2 years of "Master" 3 years of "Doctorat" But what about in the United States? I heard that they have things called "undergraduate", "graduate" and "postgraduate". How many years do each of those take? And what are the equivalencies between these and the "Licence - Master - Doctorat"? Note: If the answer to this question depends on the field of studies, then the field is physics. |
Visiting and then navigating to other sites of the Stack Exchange network through the top menu bar, then the other sites are called without https. The links in the menu should be fixed. | When I'm on, for example, the secure SO site, and then open the "StackExchange" drop-down, links to other SE sites include their "https" equivalent as well, which is expected. (If I'm on the the regular http site, then the links are all http.) But links to questions via the "Inbox" and "Achievements" drop-downs lead back to the insecure, http equivalent, even when I'm on a secure page. Can those links be generated in such a way that we're kept on the secure version of the site? |
We know $$i^2=-1 $$then why does this happen? $$ i^2 = \sqrt{-1}\times\sqrt{-1} $$ $$ =\sqrt{-1\times-1} $$ $$ =\sqrt{1} $$ $$ = 1 $$ EDIT: I see this has been dealt with before but at least with I'm not making the fundamental mistake of assuming an incorrect definition of $i^2$. | I know there must be something unmathematical in the following but I don't know where it is: \begin{align} \sqrt{-1} &= i \\\\\ \frac1{\sqrt{-1}} &= \frac1i \\\\ \frac{\sqrt1}{\sqrt{-1}} &= \frac1i \\\\ \sqrt{\frac1{-1}} &= \frac1i \\\\ \sqrt{\frac{-1}1} &= \frac1i \\\\ \sqrt{-1} &= \frac1i \\\\ i &= \frac1i \\\\ i^2 &= 1 \\\\ -1 &= 1 \quad !!? \end{align} |
I needed to find the IP address for the local machine on of the webservices. In C#, I have ManagementObjectSearcher objC = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'TRUE'"); ManagementObjectCollection objCollection = objC.Get(); How could I do it in C++ Linux? | This Question is almost the same as the previously asked -Question. However I need to find the IP address(es) of a Linux Machine. So: How do I - programmatically in C++ - detect the IP addresses of the linux server my application is running on. The servers will have at least two IP addresses and I need a specific one (the one in a given network (the public one)). I'm sure there is a simple function to do that - but where? To make things a bit clearer: The server will obviously have the "localhost": 127.0.0.1 The server will have an internal (management) IP address: 172.16.x.x The server will have an external (public) IP address: 80.190.x.x I need to find the external IP address to bind my application to it. Obviously I can also bind to INADDR_ANY (and actually that's what I do at the moment). I would prefer to detect the public address, though. |
While doing research for a high school report I came across the fact that WDL actually has two forms, one for peak frequency and one for peak wavelength, and that these two forms are not the same and can not be used interchangeably. My question is why peak frequency isn't the same as peak wavelength? That is, since wavelength is directly determined by frequency (since frequency = speed of light divided by wavelength), there is a one-to-one correspondence between a given wavelength and its frequency. Therefore why doesn't a peak in frequency correspond to a peak in wavelength, and visa versa (meaning that the two forms of WDL could be used interchangeably)? I know that this question was already posted elsewhere, but I did not understand the answers. Since I am a high school student, complicated terminology can fly right over my head, so I would greatly appreciate it if someone could take the time to explain it clearly and simply (i.e. no monster equations). | I read that it makes a difference whether you calculate $\frac{dE(\lambda) }{d \lambda}=0$ or $\frac{dE(\omega)}{d \omega}=0$ in the sense that the maximum energy density with respect to the wavelength does not coincide with the frequency maximum that one would assume to be at $\omega_{max} = \frac{c}{\lambda_{max}}$. Actually, I do not understand why this is so ( Now, I am only interested in a pure physical explanation, mathematically this is clear and due to the chain rule). Does anybody know how to explain this odd thing? Somehow I feel that the core of the question has not been completely answered. Although I can easily look up wikipedia, where the need for the chain rule is explained, I am rather interested in understanding where the following argument breaks down, which seems to be why this question has caused some confusion in the past(as you can see by googling this question): So we have $E(\omega)$ the energy radiated at a given frequency. Now this function has a maximum somewhere, so there is a frequency where a maximal amount of energy is emitted. In other words: If you add the sum of the photon's energies at each frequency that are emitted, you will notice that the maximum is reached at this frquency. Now $E(\lambda)$ tells you basically the same for the wavelength, but again: We know where at which frequency the maximal amount of energy is radiated, so we know the corresponding wavelength. I think there is a need to explain this. If anything is unclear, please let me know. |
Is there a function that generates all the permutations of a list of lists, while keeping their orders? For example: func([[1, 2, 3], [10, 20, 30]]) produces: [[1, 10], [1, 20], [1, 30], [2, 10], [2, 20], [2, 30], [3, 10], [3, 20], [3, 30]] | How can I get the Cartesian product (every possible combination of values) from a group of lists? Input: somelists = [ [1, 2, 3], ['a', 'b'], [4, 5] ] Desired output: [(1, 'a', 4), (1, 'a', 5), (1, 'b', 4), (1, 'b', 5), (2, 'a', 4), (2, 'a', 5) ...] |
Can anyone give me an example of a normal matrix that isn't unitary? Here, $A \in \mathbb{C^{n \times n}}$. | I have to find out a normal transformation that is neither hermitian nor unitary. gives me the answer. However, I would like to know how to find it out mathematically, not just guess and test. Can I go from the properties of eigenvalues of hermitian and unitary to get the answer? For example: eigenvalues of a hemitian must be real, then I choose (i,-i,0) as eigenvalues of the required matrix. Those eigenvalues satisfy the condition that the required matrix is not unitary whose eigenvalues are |1|. From those, I have characteristic equation has the form of x(x^2+1)= 0 which leads to the form of the required matrix has the trace =0 and det = 0. Can I do it? |
I found an old SSD and decided to use it for Ubuntu on my desktop where I only had Windows 10. I installed it and everything worked fine (dual booting, that is). Turns out that the reason the SSD was lying around was because it was broken. So I figured that I would just remove the SSD and proceed with only Windows 10 but when I remove the SSD, I can't boot at all. I get into some sort of grub rescue environment. As they were on different hard drives, I don't understand how I could mess up the Windows 10 SSD mbr? Any suggestions for how to get out of this? tl;dr Ubuntu on one SSD, Windows 10 on one SSD. I want to physically remove the Ubuntu SSD and only run W10. How? | I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows. How do I remove Ubuntu and reinstall Windows? Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot. |
I'm new in the C language and im trying to make a luck fortune with leds, it will "spin" blinking the 8 leds in order and then blink only the winner one but i dont know if i can do it in C without making a case switch for every P2OUT of the microcontroller (the interrupt is because it will interact with a bluetooth module across with a cellphone application ) #include <msp430g2553.h> #include <stdlib.h> // libreria para el uso de rand() #include<time.h> int x; int a; int numero; volatile int Counter=0; /** * main.c */ #pragma vector=TIMER0_A0_VECTOR __interrupt void Timer_A (void){ Counter--; //Disminuir el Contador en 1 LPM3_EXIT; //Salir del modo de bajo poder 3 } void wait(int seconds){ Counter= seconds*2; while(Counter){ LPM3; } } void main(void) { WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer BCSCTL1= CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; P1SEL=0x06; P1SEL2=0x06; P2SEL=0x0; P2SEL2=0x0; P2DIR=0xFF; P2OUT=0x00; UCA0CTL1=0x81;//Enabled USCI logic held in reset state UCA0CTL0=0x0;//UART Mode, Odd Parity, 8bit Data, 1 bit de parada, asynchronous UCA0BR0=0x68;//Baud rate 9600 UCA0BR1=0x0;//Baud rate (UCA0BR0+UCA0BR1x256=9600) UCA0MCTL=0x2; UCA0STAT=0x0; UCA0CTL1 =0x80;//Disabled USCI logic held in reset state IE2=1; __enable_interrupt(); for (;;){ if (a==49){ // 1 recieved from bluetooth "49" in code ASCII srand (time(NULL)); //seed of random number based on the time numero = rand(1,9); //generated random number between 1 and 9 for(int i=0,i<9,i++){ P2OUT=BIT(i); //HELP HERE BLINKING THE LEDS WITH CYCLE FOR wait(5) //function of delay } P2OUT=; } } } } #pragma vector=USCIAB0RX_VECTOR //interruption for bluetooth module HC-05 __interrupt void uartbt(void) { a=UCA0RXBUF;//INTERRUPCION DONDE SE ALMACENA EL VALOR CUANDO HAY COMUNICACION EN EL BLUETOOTH IFG2=0;//Limpiamos bandera de interrupción para salir } | How do you set, clear, and toggle a bit? |
I have downloaded L8 OLI/TIRS C1 Higher Level Data from USGS Earth Explorer to map Chlorophyll content in lake. The file contains original images and surface reflectance images. When I calculate NDWI using the original images, the lakes and surrounding area can be distinguised clearly. However, when I use the surface reflectance images, they produce a map of single colour. I have used the same NDWI formula for both the images. I have used the following code to calculate NDWI: LS_ndwi <- (tmp3-tmp5)/(tmp3+tmp5) plot(LS_ndwi) Here tmp3 is the Green band and tmp5 is the NIR band. I wanted to know, should I use the original images or the surface reflectance images for my analysis? I have to retrieve the reflectance data from the images for my analysis, so wanted to use the surface reflectance imageries. I checked my data type and it is in "FLT8S". So the problem of integer is not valid here I think. | I have made atmospheric corrections to my Landsat 8-OLI raster using 'ENVI FLAASH' having surface reflectance values scaled between 1-100. In ArcGIS I am using simple expression to compute NDVI using 'Raster Calculator' tool as illustrated below. However, the results are not respectable. The same results are faced using 'ENVI Band Math' tool. Interestingly, this is not the case with the outcome from 'Spectral Indices' or 'NDVI' tools built within ENVI. Why there is great discrepancy in results in all these cases? |
I often hear native speakers say for some reason, but I think reason is usually a countable noun and "some reasons" can have the meaning of "an unspecified number of reasons". I think for some reasons ought to be a correct form of it. What's your comment? Is "for some reasons" used in everyday English? If it is, what's the difference between it and "for some reason"? ( doesn't help, because it lists both singular and plural words used with "some".) | I usually use the plural form after "some." Example: I bought some books about France But I would also say some source states that France is best toured in fall. Is there a specific grammar rule? May I say that in the second sentence I am really thinking at a very specific source, so singular is needed? |
I received an upvote on an old post early this morning. I log back in this evening and see my rep down 30 points. Upon examining the reputation log I see, in triplicate, a "User removed" -10: Another curious thing is that the actual vote count on the post in question did not change at all. It was +4 after getting the single upvote this morning and now it remains at +4. Is there something I'm missing? | Message appearing when a user was removed. It seems I lost 1765 reputation points on Stack Overflow yesterday. The reason given in my history is "removed", with the description of "User was removed ()". I don't understand what that means. What caused this? |
Hello i have difficulties understanding inline and static functions. I have 6 files: main.cpp #include <iostream> #include <stdio.h> #include <stdlib.h> #include "Data_1.h" #include "Data_2.h" using namespace std; int main() { Data_1 Data_1_Test; Data_2 Data_2_Test; Data_1_Test.Print_Data_1(); Data_2_Test.Print_Data_2(); cout << "Hello world!" << endl; return 0; } Helper.h #ifndef HELPER_H_INCLUDED #define HELPER_H_INCLUDED #include <stdio.h> #include <stdlib.h> #include <string.h> void Func() { printf("Func() called\n"); } #endif // HELPER_H_INCLUDED Data_1.h #ifndef DATA_1_H_INCLUDED #define DATA_1_H_INCLUDED #include <stdio.h> #include <stdlib.h> #include "Helper.h" class Data_1 { public: Data_1(); void Print_Data_1(); ~Data_1(); }; #endif // DATA_1_H_INCLUDED Data_1.cpp #include "Data_1.h" Data_1::Data_1(){} void Data_1::Print_Data_1() { printf("Data 1 called \n"); Func(); } Data_1::~Data_1(){} Data_2.h #ifndef DATA_2_H_INCLUDED #define DATA_2_H_INCLUDED #include <stdio.h> #include <stdlib.h> #include "Helper.h" class Data_2 { public: Data_2(); void Print_Data_2(); ~Data_2(); }; #endif // DATA_2_H_INCLUDED Data_2.cpp #include "Data_2.h" Data_2::Data_2(){} void Data_2::Print_Data_2() { printf("Data 2 called\n"); Func(); } Data_2::~Data_2(){} When compiling i received a error message: C:/Users/MY_NAME/Documents/CodeBlocksProj/C++_Test/Helper.h:9: multiple definition of `Func()'; C:/Users/MY_NAME/Documents/CodeBlocksProj/C++_Test/Helper.h:9: first defined here So, in Helper.h i decided to make the function Func() inline (L8) inline void Func() { printf("Func() called\n"); } After making Func() inline,i tried to compile the code and it compiled successfuly. So, i decided to change the code again,this time i made Func() static static void Func() { printf("Func() called\n"); } I tried to compile the code and it compiled successfully. As you can see,i first tried to compile the code without making Func() static or inline and the compilation failed,so i tried to compile the code by making Func() inline or static and the compilation was successful. I have 2 questions: Why the code failed to compile when Func() was without static or inline. What is static and inline in c++ ? | I've seen the word static used in different places in C code; is this like a static function/class in C# (where the implementation is shared across objects)? |
I was reading Principles of Mathematical Analysis - Walter Rudin. In the start (pg-11), it is shown that the equation $p^2 = 2$ is not satisfied by any rational $p$ i.e. $\sqrt{2}$ is irrational. After this the book says: "We now examine this situation a little more closely. Let $A$ be the set of all positive rationals $p$ such that $p^2 < 2$ and let $В$ consist of all positive rationals $p$ such that $p^2 > 2$. We shall show that $A$ contains no largest number and $В$ contains no smallest. More explicitly, for every $p \in A$ we can find a rational $q \in A$ such that $p < q$, and for every $p \in В$ we can find a rational $q \in В$ such that $q < p$. To do this, we associate with each rational $p > 0$ the number $$ \begin{align} q &= p - \frac{(p^2 - 2)}{p + 2} &(2)\\ &=\frac{2p + 2}{p + 2} &(3)\\ &\Rightarrow q^2 - 2 = \frac{2(p^2 - 2)}{(p + 2)^2} &(4) \end{align} $$ If $p \in A$ then $p^2 — 2 < 0$, (3) shows that $q > p$, and (4) shows that $q^2 < 2$. Thus $q \in A$. If $p \in В$ then $p^2 — 2 > 0$, (3) shows that $0 < q < p$, and (4) shows that $q^2 > 2$. Thus $q \in B$." I am unable to follow this part, specially how we construct the equations (3) and (4). Can somebody explain? | First, my apologies if this has already been asked/answered. I wasn't able to find this question via search. My question comes from Rudin's "Principles of Mathematical Analysis," or "Baby Rudin," Ch 1, Example 1.1 on p. 2. In the second version of the proof, showing that sets A and B do not have greatest or lowest elements respectively, he presents a seemingly arbitrary assignment of a number $q$ that satisfies equations (3) and (4), plus other conditions needed to show that $q$ is the right number for the proof. As an exercise, I tried to derive his choice of $q$ so that I may learn more about the problem. If we write equations (3) as $q = p - (p^2 - 2)x$, we can write (4) as $$ q^2 - 2 = (p^2 - 2)[1 - 2px + (p^2 - 2)x^2]. $$ Here, we need a rational $x > 0$, chosen such that the expression in $[...]$ is positive. Using the quadratic formula and the sign of $(p^2 - 2)$, it can be shown that we need $$ x \in \left(0, \frac{1}{p + \sqrt{2}}\right) \mbox{ for } p \in A, $$ or, for $p \in B$, $x < 1/\left(p + \sqrt{2}\right)$ or $x > 1/\left(p - \sqrt{2}\right)$. Notice that there are MANY solutions to these equations! The easiest to see, perhaps, is letting $x = 1/(p + n)$ for $n \geq 2$. Notice that Rudin chooses $n = 2$ for his answer, but it checks out easily for other $n$. The Question: Why does Rudin choose $x = 1/(p + 2)$ specifically? Is it just to make the expressions work out clearly algebraically? Why doesn't he comment on his particular choice or the nature of the set of solutions that will work for the proof? Is there a simpler derivation for the number $q$ that I am missing? |
I have seen this question in many formats, including C/C+ and Javascript. I've also seen this question in it's converse form... . But, just suppose you already have a specific date. Let's say, for example, 2014-01-04 and I would like to calculate a date ($diff) three WORKING days before that excluding any weekends or holidays. A direct subtraction of three days would result in 2014-01-01, so we know that won't work. So, I subtract another day and get 2013-12-31 - again, no good. Another attempt gives us 2013-12-30. Finally, we have three ACTUAL WORKING DAYS between the two dates!! But, let's just say that as it will in 2014, 2013-12-30 falls on a Sunday.... man, oh man - shafted again! Well, I think you get my point here. How in the world do I get the results I want? | I need a method for adding "business days" in PHP. For example, Friday 12/5 + 3 business days = Wednesday 12/10. At a minimum I need the code to understand weekends, but ideally it should account for US federal holidays as well. I'm sure I could come up with a solution by brute force if necessary, but I'm hoping there's a more elegant approach out there. Anyone? Thanks. |
I have this database table where I insert multiple results during 1 action. In php I have a submit button when pressed, inserts 1-50 rows(depending on the user input). I've got a foreign key in this table which has the same value on the rows inserted during that action(so when the primary key connected to the foreign key gets deleted, the 1-50 rows will be deleted as well). Now I've got an Auto Increment in my table and during testing, I find out that the ID's are somewhat like this: 1,2,3,200,249,460,670. So like huge differences between the ID's. Whenever I would create a new row, it will get the ID 671. I feel like it would be better if the ID would just get 4 in this case. Is there any way of doing this automatically and not typing ALTER TABLE users AUTO_INCREMENT=4; manually? If so, are there any advantages/disadvantages? | For example, I have a table for user registration: CREATE TABLE IF NOT EXISTS test_user ( user_id int(10) unsigned NOT NULL AUTO_INCREMENT, user_name varchar(50) NOT NULL, PRIMARY KEY (user_id), ) ENGINE=InnoDB DEFAULT CHARSET=utf8 I want the user_id field ID numbers to be continuous, without gaps. Failed transactions will occupy some ID numbers, is there any way around this? |
Are the following statements in /etc/network/interfaces equivalent? allow-hotplug eth0 and.. auto eth0 allow-hotplug eth0 That is, does allow-hotplug do everything that auto does and more? | I understood the very basic concept of how to use /etc/network/interfaces, but all I find online are examples, example after example, which I can copy-paste from. What I miss is an explanation of the syntax, an explanation of the meaning of the commands and which order the commands require. I want to understand, because most of the time copy-paste is not enough, because I'm not working on a fresh machine, so I can't just overwrite existing configurations because it would break a lot of stuff. man interfaces was not very helpful since it is written very complicated. Example questions I have: what does inet in an iface line mean exactly (I could not even find it in the manpage), what does manual in an iface line mean exactly (many examples use it, but according to manpage it needs an extra config file then, which the examples don't present), when do I use or need them? When not? When I create a bridge, what exactly happens to the interfaces? |
Iam writing a code to print the all devices connected in the network using python pcapy. In the out put, it prints "Tunnel adapter isatap" details . Can anyone please tell me what it would means... i was expected to get print the interface name which ever is named with. Please see the attached screen shot Appreciate for the support | I don't understand why is the "tunnel" metaphor used to describe a networking tunnel. At first I thought the reason was because the data sent is encrypted, and so an eavesdropper will not be able to see the data (he sees the data wrapped in a tunnel!). But what about the tunneling protocols that do not use encryption, why are they also called a "tunnel"! |
After I compile my code, I see this as the output: [I@7852e922 I'm assuming I need to use Array.toString after some searching but when I I seem to have other errors so I'm assuming I'm not putting it in the right place. Here is my code: public class TwoSum { static int[] arraynums = new int[]{2, 7, 11, 15}; static int target = 9; public static void main(String args[]) { //TwoSum name = new TwoSum(); //name.twoSums(arraynums, target); System.out.println(twoSums(arraynums, target)); } public static int[] twoSums(int[] nums, int target) { int sum = 0; for (int i = 0; i < nums.length; i++) { for (int j = 0; j < nums.length; j++) { sum = nums[i] + nums[j]; if (sum == target) { //System.out.println(i + " " + j); return new int[] {i,j}; } } } return new int[] {}; } } | In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the of the array, as defined by Object.toString(): int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray); // prints something like '[I@3343c8b3' But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs: // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5] // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob] |
Take an example that there is a bubble in a bottomless container (saying that that is possible) if the bubble is deep enough would the water pressure cancel out the buoyancy acting on the bubble and if so what would happen to the bubble? And at what point would this be (This question is slightly different to the other one as this is not limited to the deepest point on earth) | Can water pressure ever become high enough to trap gas bubbles and/or keep them from surfacing? |
I was wondering how this kind of slide is made in the beamer. I wonder how the background is set. Also how the heading is set? Any thoughts? It seems like we can use any image we want to set in the background perhaps. | I successfully use the usebackgroundtemplate command to set a background image for a specific slide in Beamer as follows \documentclass{beamer} \mode<presentation> { \usetheme{CambridgeUS} } \begin{document} \usebackgroundtemplate{% \includegraphics[width=\paperwidth,height=\paperheight]{example-image-a}} \begin{frame}[t] \frametitle{hello} blahblah \end{frame} \end{document} However, the image seems to have just covered the main body area, the background of the \frametitle is still white as before. How could I set this image as background for the entire slide? Or at least for the \frametitle as well (just for the slides I want, not for the entire presentation)? Or any better solutions? |
When I am idle on Stack Overflow, I see an update of x recent questions were added. After clicking, the questions load properly, but they do not reflect: If any of them were already answered. If any of the existing questions were answered in the idle time. -- Also, as per Richards comment - It often happens that one lands in "has been deleted" page off an idle page that has loaded up new questions. Only after a full page reload, all the questions are updated with correct number of answers, votes and views. -- I would like it if the page refreshes on clicking the load recent questions link so that the questions which were already answered will get highlighted with correct information. | First, you see the banner: Then you click it and the 5 new questions appear: But all of them have 0 votes, 0 answers and 1 view. You have to refresh to see the real numbers: |
I state a theorem first, and want to write the proof in the later section. And I want to restate the theorem when I am going to prove it. So in the whole paper, I write the theorem for two times, but I want them have the same number. How can i do this? | Often in my papers I want to mention theorems in the introduction that are introduced in more detail and proved in a later section. I'd like to include the statement of these theorems twice over, each time numbered as the theorem would naturally appear in its later section. My current solution (using amsthm) is, e.g. %(in the introduction) \newtheorem*{thm:associativity}{Theorem \ref{thm:associativity}} \begin{thm:associativity} Lorem ipsum ... \end{thm:associativity} %(in a later section) \begin{thm} \label{thm:associativity} Lorem ipsum ... \end{thm} Can anyone think of a cleaner solution? |
Could you explain how to find this limit? $\lim_{n \rightarrow \infty} \sum^n_{k=1} \frac{1}{k+n}$ | What is the sum of the 'second half' of the harmonic series? $$\lim_{k\to\infty}\sum\limits_{n=k+1}^{2k}{\frac{1}{n}} =~ ?$$ More precisely, what is the limit of the above sequence of partial sums? |
I am creating logos and simple images in Illustrator and when I import the AI file OR the png into the InDesign document they are blurry. I have already selected the High-Performance view and it changes the other images but not the imported ones. | Illustrations I create in Procreate show up pixelated at edges despite high resolution when I place them in Indesign. I'm working on illustrating books for print. It's my first time working on a print project, I usually do digital illustration for the web. I use Procreate on Ipad Pro for illustrations, and need to place them into Indesign layouts. I do my best to create clean lines in my illustrations, and use a huge resolution as well (each illustration is about 3000x3000px in size), but when I place them in Indesign there's some weird stuff happening with illustration edges. I use 4000x4000 at 300dpi resolution for my canvas. Then export the image as PNG before placing into Indesign. What am I doing wrong? Maybe it's exactly because the resolution is too high? Or it's a PNG issue? |
I have a pc with pentium 4, 256 mb RAM and 80 gb of harde disk. I want to install Ubuntu but I don't know which is the best option! | I'm thinking about installing Ubuntu Desktop, but I don't know what flavor is the best for my system. What are the minimum and recommended hardware requirements? What kind of CPU? How much memory? Should I have Hardware Acceleration? What flavor should I use? This is an attempt of a canonical answer. My answers have the "official requirements", the recommended are a mix of official sources and opinion based (along with the answer it's told the source). You can comment or edit if you feel that the information is obsolete or incomplete. It is a good rule of thumb that any system capable of running Windows Vista, 7, 8, x86 (Intel) OS X will almost always be a lot faster with any Ubuntu flavor even if they are lower-spec than described below. |
In many manga and anime involving modern schools, there is a scene on or at least showing the rooftop of the building. It is a place students can freely go to, often depicted with having a bust-height railing along the edge and the typical 'small building' from which you leave the school building, often also having a ladder to get up (nonetheless being a popular 'hiding' or 'being alone' spot even without one). I wanted to ask: is this one of many clichés about Japanese culture that appear throughout the whole media type, or are they a common thing in Japanese schools? | Why there are many scenes in anime that take place on roofs, particularly the roof of schools? School roof seem to be a popular place for students who want to be alone with no one else there. Sometimes they come in for lunch, or just relax there. Angel Beats!, Boku wa Tomodachi ga Sukunai, Kampfer, Mahou Shoujo Madoka Magica This is also on the roof, but it's hopital roof The Disappearance of Haruhi Suzumiya They even use it for fighting scene Ichiban Ushiro no Daimaou Sometimes there's even a garden on the roof of the school. The World God Only Knows Any reason why does this common occurrence? |
this is my attempt in python 3.4: import imp def my_example_function(): print("my_example_function:") class my_class: def __init__(self): module = imp.load_source(my_example_function, __file__) my_class_instance = my_class() result is: Traceback (most recent call last): File "D:\Python34\test.py", line 10, in <module> my_class_instance = my_class() File "D:\Python34\test.py", line 8, in __init__ module = imp.load_source(my_example_function, __file__) File "D:\python34\lib\imp.py", line 166, in load_source spec = util.spec_from_file_location(name, pathname, loader=loader) File "<frozen importlib._bootstrap>", line 932, in spec_from_file_location File "<frozen importlib._bootstrap>", line 1439, in is_package AttributeError: 'function' object has no attribute 'rpartition' It looks like some kind of internal error a bug in python itself. | I've read that it is possible to add a method to an existing object (i.e., not in the class definition) in Python. I understand that it's not always good to do so. But how might one do this? |
Four different positive integers $a, b, c, d$ are such that $a^2 + b^2 = c^2 + d^2$. What is the smallest possible value of $abcd$? $$a^2 - c^2 = d^2 - b^2$$ $$(a-c)(a+c) = (d-b)(d+b)$$ $$(a-c)(a+c) - (d-b)(d+b) = 0$$ So there is one pair I see: $$a -c = d - b, a + c = d + b$$ Suppose WLOG, $a > b > c > d > 0$ But that doesnt strike anything. | Four different positive integers $a, b, c$, and $d$ are such that $a^2 + b^2 = c^2 + d^2$ What is the smallest possible value of $abcd$? I just need a few hints, nothing else. How should I begin? Number theory? |
I am reading an XML file with a Java project. Everything is alright if the tags are regular i.e. with start tag and end tag. Example: <Packages> <Number>20</Number> <Marks_one>ONE</Marks1_one> <Marks_two> <null/> </Marks_two> <code>PX</code> <name>Pallet </Kind> </Packages> All of the value of these tags can be read including whice is . But in the same file I have like this: <Packages> <Number/> <Marks_one>ONE</Marks1_one> <Marks_two> <null/> </Marks_two> <code>PX</code> <name>Pallet </Kind> </Packages> Here is self closing and also doesn't have any attribute. Java is giving exception here and exception is null. I shall omit the tag if it is self closing. Please tell how to find out if that tag is self closing or regular? Code for parsing XML is given below: NodeList Packages_List = Item_Element.getElementsByTagName("Packages"); System.out.println("Packages_List.getLength() : "+Packages_List.getLength());Node Packages_Node = Packages_List.item(0);if(Packages_Node.getNodeType() == Node.ELEMENT_NODE){ Element Packages_Element = (Element)Packages_Node; NodeList Number_of_packages_List = Packages_Element.getElementsByTagName("Number"); Element Number_of_packages_element =(Element)Number_of_packages_List.item(0); NodeList text_Number_of_packages_List = Number_of_packages_element.getChildNodes(); Number=((Node)text_Number_of_packages_List.item(0)).getNodeValue().trim(); System.out.println("Number : "+Number); } | 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? |
my problem is best illustrated in the picture below: the text won't center between the paper marge. I've used some commands from related problems on this website but nothing happens when I run it. The text remains as such: \documentclass[11pt]{article} \usepackage[a4paper]{geometry} \usepackage[none]{hyphenat} \begin{document} \begin{center} { \textbf{\underline{Random text to show that the right side of the text goes beyond the paper marge and don't know how to fix this} }} \end{center} \end{document} | I have a simple itemized list like the following MWE: \documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \usepackage{hyperref} \usepackage{lmodern} \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage{lipsum} \begin{document} \begin{itemize} \item \href{http://google.com}{[ID1]: \underline{\lipsum[1]}} \end{itemize} \end{document} This unfortunately doesn't break the block of text as expected, as shown below: How can I fix this item so it will line break properly? |
Several years back I read The Hobbit and Lord of the Rings. I recently discovered (when going through some old boxes I hadn't unpacked after moving house) that I've got a few additional books which I've never read, mainly The Silmarillion and The Book of Lost Tales Pt. 1 + 2. Is there any order to these? Which should I read first? Or doesn't it matter? | I've already read The Hobbit and The Lord of the Rings, which I assume would be the best start in any case. I also got about halfway through The Silmarillion several years ago and am quite familiar with the legendarium as a whole, but for the sake of argument let's assume I'm starting from scratch. What is the best order for a budding scholar of Middle-earth to read Tolkien's books? Or does it even matter once you've covered the core novels? Chronological order clearly isn't the most logical approach here, and even publication date isn't necessarily best. The Hobbit The Lord of the Rings The Silmarillion The Children of Hurin The History of Middle-earth Unfinished Tales The Letters of J.R.R. Tolkien Anything else Note: After asking this question I found on Reddit. It covers even more material and in more detail than my original question or any answers here. |
I realize that one uses set.seed() in R for pseudo-random number generation. I also realize that using the same number, like set.seed(123) insures you can reproduce results. But what I don't get is what do the values themselves mean. I am playing with several functions, and some use set.seed(1) or set.seed(300) or set.seed(12345). What does that number mean (if anything)- and when should I use a different one. Example, in a book I am working through- they use set.seed(12345) when creating a training set for decision trees. Then in another chapter, they are using set.seed(300) for creating a Random Forest. Just don't get the number. | I tried some usual google search etc. but most of the answers I find are either somewhat ambiguous or language/library specific such as Python or C++ stdlib.h etc. I am looking for a language agnostic, mathematical answer, not the specifics of a library. As an example, many say that the seed is a starting point of random number generator and the same seed always produces the same random number. What does it mean? Does it mean the output number is a deterministic function of a specific seed, and the randomness comes from the value of the seed? But if that is the case, then by supplying the seed, are not we, the programmers, creating the randomness instead of letting the machine do it? Also, what does a starting point mean in this context? Is this a non-rigorous way of saying an element $x\in\mathfrak{X}$ of the domain of a map $f:\mathfrak{X}\rightarrow\mathfrak{Y}$? Or am I getting something wrong? |
This is a common phenomenon and most of the people have encountered this while moving on ice:falling down! Why does this occur? According to me, it is due to lack of static friction. But why will it be absent here? What is the cause? I have heard that there is a thin layer of water above the ice . But why,unlike other solids, is this thin layer present? Will it not cool down to ice? | Some textbooks I came across, and a homework assignment I had to do several years ago, suggested that the reason we can skate on ice is the peculiar $p(T)$-curve of the ice-water boundary. The reasoning is that due to the high pressure the skates put on the ice, it will melt at temperaturs below $273 K$ and thus provide a thin film of liquid on which we can skate. It was then mentioned as fun fact that you could ice-skate on a planet with lakes of frozen dioxide because that gas has the $p(T)$-curve the other way round. My calculations at that time told me that this was, pardon my french, bollocks. The pressure wasn't nearly high enough to lower the melting point to even something like $-0.5$ degrees Celsius. I suppose it is some other mechanism, probably related to the crystal structure of ice, but I'd really appreciate if someone more knowledgeable could tell something about it. |
I am trying to create a graph in Latex with the given code: \documentclass[11pt]{article} \begin{document} \begin{table}[H] \centering \caption{A table showing the raw data.} \vspace{0.3cm} \begin{tabular}{|c|c|c|c|} \multicolumn{1}{l}{\textit{Height, $h$/$\SI{}{cm}$ ($\pm \SI{1.00}{cm}$) }} & \multicolumn{3}{c}{\textit{Horizontal Distance Travelled, $x$/$\SI{}{cm}$ ($\pm \SI{0.100}{cm}$)}} \\ \hline & 1 & 2 & 3 \\ \hline 2.40 & 17.9 & 18.5 & 18.3 \\ 3.40 & 24.0 & 24.3 & 25.0 \\ 5.10 & 27.4 & 28.1 & 28.6 \\ 7.10 & 34.8 & 36.0 & 36.4 \\ 9.00 & 38.0 & 38.7 & 39.0 \\ 12.0 & 45.7 & 45.3 & 44.7 \\ 15.0 & 50.5 & 48.4 & 48.4 \\ 18.0 & 55.0 & 57.2 & 57.3 \\ 21.0 & 60.6 & 60.2 & 58.2 \\ 24.0 & 56.9 & 62.4 & 64.0 \\ 25.6 & 62.3 & 63.3 & 64.2 \\ \hline \end{tabular}% \label{tab:addlabel}% \end{table}% \end{document} But when I compile, the table looks very uneven: What is causing the table to align itself in this way and how can I fix this issue? The latex code here has been changed to the code I meant. The other question was a mistake that I would like to delete. Thanks, Aidanaidan12 | I am trying to create a graph in Latex with the given code: \begin{table}[htbp] \centering \caption{Table showing the processed data.} \scalebox{0.7}{ \begin{tabular}{|c|c|c|c|} \hline \multicolumn{1}{l}{Average distance, x/ $\SI{}{cm}$} & \multicolumn{1}{l}{Uncertainty in average distance/ $\pm \SI{}{cm}$} & \multicolumn{1}{l}{Average distance squared/ $\SI{}{cm^2}$} & \multicolumn{1}{l}{Uncertainty in average distance squared / $\pm \SI{}{cm^2}$} \\ \hline 18.2 & 0.3 & 332 & 10.9 \\ 24.4 & 0.5 & 597 & 24.4 \\ 28.0 & 0.6 & 786 & 33.6 \\ 35.7 & 0.8 & 1280 & 57.2 \\ 38.6 & 0.5 & 1490 & 38.6 \\ 45.2 & 0.5 & 2050 & 45.2 \\ 49.1 & 1.1 & 2410 & 103.1 \\ 56.5 & 1.2 & 3190 & 130.0 \\ 59.7 & 1.2 & 3560 & 143.2 \\ 61.1 & 3.6 & 3730 & 433.8 \\ 63.3 & 1.0 & 4000 & 120.2 \\ \hline \end{tabular} } \label{tab:addlabel}% \end{table}% But when I compile, the table looks very uneven: What is causing the table to align itself in this way and how can I fix this issue? Thanks, Aidanaidan12 |
Does anyone know of good reference material on exploratory analysis and diagnostic plots for count data? | What diagnostic plots (and perhaps formal tests) do you find most informative for regressions where the outcome is a count variable? I'm especially interested in Poisson and negative binomial models, as well as zero-inflated and hurdle counterparts of each. Most of the sources I've found simply plot the residuals vs. fitted values without discussion of what these plots "should" look like. Wisdom and references greatly appreciated. The back story on why I'm asking this, if it's relevant, is . Related discussions: |
Is the DJI as sharp as the Leica on a OMD E-10 Mark II ? | When reading lens reviews on the Internet, I often find subjective statements about the image quality that a lens produces, such as "good contrast" or "sharp". The problem is that I don't think I am capable to actually see these qualities on an image. I don't even think I could tell the difference between a cheap kit lens and a top lens, if not by "this just looks better". So my question is: without looking at sharpness tests and MTF curves, how do you learn to judge the quality of a lens based only on sample images? What are the characteristics you look for and what constitutes good or bad in each of them? |
I have some application that passes a string parameter to a method that is invoked using a thread inside a loop like this, this thread is create 50 times Thread t = new Thread(new ThreadStart(() => { StartExtraction( savedFileName); })); t.Name = "do"; t.Start(); in the StartExtraction method I noticed that the parameters are overwritten , I mean if the first invocation was with savedFileName="abc" and the second was with savedFilename="xyz" ,the method always processes "xyz", I mean StartExtraction when debugged, the parameter is overwritten, , why? | I met an interesting issue about C#. I have code like below. List<Func<int>> actions = new List<Func<int>>(); int variable = 0; while (variable < 5) { actions.Add(() => variable * 2); ++ variable; } foreach (var act in actions) { Console.WriteLine(act.Invoke()); } I expect it to output 0, 2, 4, 6, 8. However, it actually outputs five 10s. It seems that it is due to all actions referring to one captured variable. As a result, when they get invoked, they all have same output. Is there a way to work round this limit to have each action instance have its own captured variable? |
How do I name each desktop within the Windows 10 Taskview? If I click the Taskview button on the Taskbar then the view zooms out from the current desktop. A top bar shows the available desktops. I have two Taskview desktops named Desktop 1 and Desktop 2. I would like useful names for the desktops; e.g. Gaming, or Project ABC, or Work, etcetera. | When adding on Windows 10 they are just named sequentially: Desktop 1, Desktop 2, ... etc Is there a way to modify these names to provide something more meaningful? i.e. Home, School, Work, Project? Note: This has been a for |
In my code, I'm using a lot of expressions like: #if DEBUG printf("Some text = %d", param); #endif I was wondering if it is possible to change it to macro like: DEBUG("Some text = %d", param); or at least to: DEBUG("Some text =", param); ? | Is it possible to do something like this #ifdef SOMETHING #define foo // #else #define foo MyFunction #endif The idea is that if SOMETHING is defined, then calls to foo(...) become comments (or something that doesn't get evaluated or compiled), otherwise it becomes a call to MyFunction. I've seen __noop used, but I don't believe I can use that. EDIT(s): I don't think I can really use a macro here, because MyFunction takes a variable number of arguments. Also, I'd like to make it so the arguments are NOT evaluated! (So doing something like commenting out the body of MyFunction doesn't really give me what I need, as the arguments will still be evaluated) |
I can't figure out how (cosx+isinx)^4 expands to 1-8 cos^2(x)+8 cos^4(x)-4 i cos(x) sin(x)+8 i cos^3(x) sin(x) I got it equal to sin^4(x)+cos^4(x)+i (4 sin(x) cos^3(x)-4 sin^3(x) cos(x))-6 sin^2(x) cos^2(x) How do I make it equal to 1-8 cos^2(x)+8 cos^4(x)-4 i cos(x) sin(x)+8 i cos^3(x) sin(x) | Obtain another expression for $(\cos θ + i \sin θ)^4$ by direct multiplication (i.e., expand the bracket). Use the two expressions to show $$ \cos 4\theta = 8 \cos^4 \theta − 8 \cos^2 \theta + 1,\\ \sin 4\theta = 8\cos^3\theta \sin\theta − 4 \cos \theta\sin \theta. $$ You may use the well-known identity: $\sin^2 \theta + \cos^2 \theta = 1$, but do not use any multiple angle formula. I got using DMT that $(\cos \theta + i\sin \theta)^4 = (cos 4\theta + i\sin 4\theta)$ and using direct multiplication, I got $\cos^4\theta + \sin^4\theta - 4\cos^3\theta*\sin\theta*i - 4\cos\theta \sin^3\theta i - 6\cos^2\theta\sin^2\theta$ |
According to OpenGL specs 4.5, bool in std140 layout block reserve 1 byte (sizeof(GLboolean) == 1). But when I get the offset of b, it is 4. Where is the misunderstanding? layout (std140) uniform Uniforms { bool a; bool b; }; The following structure expands 4 bytes to 64. Why engineers created a so super resource-wasted standard? layout (std140) uniform Uniforms { bool a[4]; }; | Admittedly I don't get it. Say you have a memory with a memory word of length of 1 byte. Why can't you access a 4 byte long variable in a single memory access on an unaligned address(i.e. not divisible by 4), as it's the case with aligned addresses? |
I have a paper copy of some old LaTeX notes, but I lost the source file. If I scanned them as a .pdf, does any OCR software exist that could convert the scanned .pdf to LaTeX source (.tex)? I also have a paper copy of some old notes created using Microsoft Word's Equation Editor. While I am considerably less hopeful, I ask the same question -- does an OCR software exist that could convert a scanned .pdf to .tex? Thank you for your help. | I know that hardly any information is passed to the PDF when a .tex file is compiled. But is there a tool that can convert a PDF document back to (La)TeX? |
In the chorus of the song "Gone Country" by Alan Jackson, there is this sentence: She/He's gone country, look at them boots How come them is used instead of their? I am not a native English speaker so I am interested in knowing about this peculiar (at least to me) word choice. This would tend to indicate that them can be used for that, but look at that boots don't really make sense? | Background Nowadays, I see "them" used to mean "those" a lot. I don't know if it was as common in the past. For example, take "one of ". On researching about it, I found some people say it comes from a dialect of British English. Some others say it is a "non-standard" usage. I see this usage in Canadian English also, and it seems some people use it in a sarcastic way. Moreover, I have seen a song titled "one of them days". I also read, in the book called "A Broken Promise", "" Finally, Wikipedia says that it is a usage in (a common name for the Southern Midland dialect of American English): Pronouns and demonstratives "Them" is sometimes used in place of "those" as a demonstrative in both nominative and oblique constructions. Examples are "Them are the pants I want" and "Give me some of them crackers." Question(s): What would you say about the usage of this word? Is it correct? Could we use it in daily speech? Could this usage go beyond a specific dialect and be used in other dialects, regions, etc.? Does it really originate from Appalachian English? Why did this usage become popular among other English speakers? Note: I have already seen a similar question: However, it only says, "ungrammatical," there. This question is specific to this situation only, and there is more to it. |
My attempt: Consider the map $σ : F→ F$ such that $∀a ∈ F, σ(a) = a^p$. Then $σ$ is a field automorphism of $F$. $ker(σ) = 0$ and since $F$ is a finite field, $σ ∈ Gal(F : K)$, the galois group of order $k$. Since the order of the galois group is $k$ it is generated by $σ$ so we can deduce that $Gal(F : K)$ is a cyclic group $Z_n$. By the Fundamental Theorem of Galois Theory, $|G| = |Gal(F : K)| = [F : K]$, for the field extension $F : K$ of finite degree. $Gal(F : K)$ is a cyclic group of order $[F : K]$. | I have to compute Galois group of $\mathbb F_q/\mathbb F_p$ where $q=p^n$. I know already that $\mathbb F_q/\mathbb F_p$ is galois, so I don't need to prove it. Moreover, I know that \begin{align*}\sigma :\mathbb F_q&\longrightarrow \mathbb F_q\\ x&\longmapsto x^p\end{align*} is an automorphism that fix elements of $\mathbb F_p$ and thus $\sigma \in Gal(\mathbb F_q/\mathbb F_p)$. Now, I know that if $k<p^n$ then $\sigma ^k(x)=(x^{p})^k=x^{pk}\neq 1$ and thus $\sigma $ is of order $p^n$. Now if I can prove that $|Gal(\mathbb F_q/\mathbb F_p)|=p^n$, then $Gal(\mathbb F_q/\mathbb F_p)=\left<\sigma \right>$ and it would be finish, but I can't prove it since even $X^q-X$ split over $\mathbb F_q$, theis polynomial is not irreducible, and thus, I can't conclude. So how can I find an irreducible polynomial of degree $q$ that split over $\mathbb F_q$ ? |
Seriously, almost all of the flags I get are in the JavaScript room. . In case you are tired, it leads to the "Ask a question" screen. I don't care about these silly flags, really. But I wondered if there is something we can do to make the flags more pertinent and save them for when things really are obscene. If I am right and the majority of flags come from a certain place (and assuming most are dismissed) should this chat be closed? Of course they could go to another chat and similar things happen. I'm not sure how to know what users or how often they are flagging but it seems to be like "the chat room who cried wolf". If nothing else, I would like to bring attention to those who are flagging there. If the chat is that bad then make it a gallery or stop visiting it. Edit OK, I don't really think the chat should be closed. This was a poorly-formed question from the beginning, because that wasn't my main point of the post. It was more to get a discussion about why it seems, at least to me, that most of the flags (at least lately) appear to come from there and if there is anything to be done about it. | Yes, I know the topic has been discussed before. I know that Meta already has threads that complain about how flagging doesn't work. I wanted to give a practical example. Today, a came in to the chat and asked the : Hey guys, as soon as I embed javascript, all my html elements are gone. Even if the script is empty!? ...Can anyone help out? The example is really minimalistic <script type='text/javascript' src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"/> <script type='text/javascript' src="script.js"/> These lines make everything vanish. script.js is empty! I use google chrome and the file is on localhost Some context: The JS room encourages people to come and ask questions that are too small/badly put for main. The room encourages people to just ask questions rather than ask to ask. In fact we even have a bot that prompts users to just ask if they have a question whenever they join. The above user has a good Q to A ratio having 1K rep in the main site and over 80 answers. The user has no negative context in the chat. No previous offenses or anything like that. That message got 7 flags Had a mod (ThiefMaster) not been present and invalidated those flags in time that user would have probably been suspended from the chat. This is bad, it sends the wrong message and it is very rude. Now, some other rooms don't allow people to just come and ask questions right away so maybe users from other rooms validated the flag. Maybe users thought he was being rude? I don't know. I do know that we don't want this sort of negative atmosphere in the JS room (and I'm sure other useful rooms such as PHP don't want it either), we have enough on our hands trying to maintain a community while helping people joining and handing with vamps/trolls. Possible solutions: Drop spam/offensive flags altogether. Make spam/offensive flags room specific for big enough (tm) rooms. Give room owners just the ability to invalidate spam/offensive flags. |
From the above image im getting ? symbols in option in database there is a chareter present how can i resolve this issue.. I have a header like this <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> And i am looking for permanent solution this is my code: and when print the variable it is coming like this:console.log(getContact); function get_question_detail(q_id){ $("#all_option").html(""); var temp_ques = sessionStorage.getItem(q_id); if (temp_ques){ var getContact = JSON.parse(temp_ques); for (var j = 1; j <= ans_option_count; j++) { var temp_var = "sr_no" + j; var full_div = '<div class="answer_option"><input type="radio" name="ans_option" value="' + j + '" class="validate[required]" />&nbsp;&nbsp;&nbsp;' + getContact['option'][temp_var] + ''; $("#all_option").append(full_div); // console.log(full_div); } | 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'm having some trouble proving the following: Let $d$ be the smallest positive integer such that $a^d \equiv 1 \pmod m$, for $a \in \mathbb Z$ and $m \in \mathbb N$ and with $\gcd(a,m) = 1$. Prove that, if $a^n \equiv 1 \pmod m$ then $d\mid n$. The first thing that came to my mind was Euler's theorem but I couldn't conclude anything because I'm not very skilled when it comes to using Euler's totient function. Can someone give me any tips or show me how to solve this? | I've read about Fermat's little theorem and generally how congruence works. But I can't figure out how to work out these two: $13^{100} \bmod 7$ $7^{100} \bmod 13$ I've also heard of this formula: $$a \equiv b\pmod n \Rightarrow a^k \equiv b^k \pmod n $$ But I don't see how exactly to use that here, because from $13^1 \bmod 7$ I get 6, and $13^2 \bmod 7$ is 1. I'm unclear as to which one to raise to the kth power here (I'm assuming k = 100?) Any hints or pointers in the right direction would be great. |
How to make quick disabling/enabling of all the elements in any div (inputs, links and jQ Buttons)? | I was under the assumption that if I disabled a div, all content got disabled too. However, the content is grayed but I can still interact with it. Is there a way to do that? (disable a div and get all content disabled also) |
Does anyone know of a way to set Visual Studio to use the same browser window again, instead of opening a new one, every time you start/debug an ASP.NET project? This is a simple issue. When I click 'Start with Debugging' to test my ASP.NET application, it launches my project in a new browser window. During development at any one point I have nearly a dozen browser windows open, which is not a big deal, but having to open the developer tools and get the browser setup again so I can see what is going on is annoying. I have looked around for an answer to this, but I did not find anything. | I already have a window open with the web site I'm debugging. I don't need VS to launch another one for me every time I need to debug. Is there a way to stop this behavior? |
I logged onto my 1.15.2 world one day, and all of the chunks in were out of place. I am aware that you can fix it by manually editing all the chunks back in place. But is there an alternative way to do that? Preferably via the code or one that's not so time consuming? I DO NOT want to RESET the chunks, just rearrange them back to where they are supposed to be. | I was stupid and didn't keep a backup of my Minecraft server. Now, it crashed, biomes changed, chunks were moved around, part of my city of gone, an underground chunk was moved aboveground, is there ANY way I can fix this? I.E. easily move chunks and change biomes. |
I'd like to add a method to the Int32 to do a "FromSomething" stuff. Something that could allow me to write something like this: Int32 i = Int32.FromSomething(mySourceData); How could I achieve this? | I'm a fan of extension methods in C#, but haven't had any success adding an extension method to a static class, such as Console. For example, if I want to add an extension to Console, called 'WriteBlueLine', so that I can go: Console.WriteBlueLine("This text is blue"); I tried this by adding a local, public static method, with Console as a 'this' parameter... but no dice! public static class Helpers { public static void WriteBlueLine(this Console c, string text) { Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine(text); Console.ResetColor(); } } This didn't add a 'WriteBlueLine' method to Console... am I doing it wrong? Or asking for the impossible? |
It was in a collection of short stories by different authors, which I read in the mid 80's. The crew of the ship keep complaining about how the Captain is rude to them and the only 'person' he says 'please' and 'thank you' to is the ship's computer. Eventually they decide on mutiny and murder the Captain after forcing him to make recordings of the voice commands necessary to steer the ship. It is not until after they kill the Captain, that they realise the commands he recorded lacked the 'please' and 'thank you', which were crucial to make them work. Thus the crew of the ship drift through space contemplating the irony. | The crew mutinies on a spaceship whose captain controls it with verbal orders. They test whether they can control the ship with recordings of the captain's voice with an order to increase orbital speed (currently orbiting a planet). It works, so they force the captain to record all the possible orders they may need, and execute him. Only then do they realize that the ship obeys only orders couched in polite language, and only the test recording was like this, but the other recordings are not. They will die once the ship's faster orbit somehow causes it to run out of fuel, or something like that. I seem to remember the ship's "computer" following the captain around on robotic legs. I read the story circa 1980, but it might have been published much earlier. |
I'm a complete novice with LaTeX. Excuse the bluntness of this ignorant question which most likely has an obvious answer. On my LaTeXit, the display window fails to update past the 46th line of code. Are there any potential maladies in the code that may have caused this or am I missing some simple procedure to continue on seeing further lines of code in the display window. | I'm a beginer in Latex and I like to learn about it, as I'm user Mac, I installed LaTeXit, but I have multiple problems. I begin to write in the editor area, but I just get the first page of the document, I don't know why. Here an screenshoot: I don't see the second part, even when I export the document. I just simply follow an tutorial, but that it doesn't work. Here my config: \documentclass[10pt]{article} \usepackage[utf8]{inputenc} \title{First document} \author{User} \date{2017-01-01} Preambles config. And in the Body config, I have: \begin{document} \end{document} |
I'm trying to search through the files and directories of a specific folder. For example, I was looking in /usr/bin for my python binaries. To do so, I used ls | grep python. When I did this, I was able to find, for example, python3, python3-config, etc. While this works fine, I know that there are easier ways to do that: I shouldn't have to pipe to grep. But when I tried find . -name python, as per my understanding of the find man page, it yielded no results. I know that grep searches through a file. What is the correct way to search through a given directory? | I want to list all the files, in directory I am currently in, with for example "a" in their name. I know that the first part of the command would be ls -l, but i do not know how to finish it. |
is there a way to mount and dismount a connected harddrive through a script or a simple utility software in Windows 8.1? Basically, I have a hard drive in the ultrabay slot of my ThinkPad (instead of the dvd-drive). When booting the system, this hard drive is automatically being mounted and visible to me. Using the icon in the taskbar I can unmount it. Unfortunately, it is then only available again when I reboot the system. So I wanted to ask if there is any command line script I can execute to dismount the drive and mount it again with another script without having to reboot? This way I could call the unmount-script after booting, so the drive isn't always running, only when I need some stuff from it, I call the mount-script and then can access the files. Would be great if anybody has any ideas on how to solve this! Thank you! | On my work computer I have two USB hard drives that I use rarely. They have a power save mode that sends them into sleep after a couple of minutes of them being idle. Whenever I open a context menu on a file, the drives are woken up (most likely caused by the "send to" handler). So I eject the drive, but I can't find a way to get it back, other than unplugging and replugging it in. Is there a way to unmount the drives, and then remount them only when I actually need them? (On Windows 7 Ultimate.) |
Subsets and Splits