body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
I'm looking into creating a python datetime-subclass which provides a default timezone when created. For the sake of keeping this question simple, let's assume I always want to hard-code my datetimes to be in UTC. I can't figure out why the following works: import datetime, dateutil.tz def foo(*args, **kwargs): kwargs['tzinfo'] = dateutil.tz.tzutc() return datetime.datetime(*args, **kwargs) But the following doesn't work: class Foo(datetime.datetime): def __init__(self, *args, **kwargs): kwargs['tzinfo'] = dateutil.tz.tzutc() super(Foo, self).__init__(*args, **kwargs) Running the first method gives me the datetime object I expect: >>> foo(2012, 11, 10) datetime.datetime(2012, 11, 10, 0, 0, tzinfo=tzutc()) >>> foo(2012, 11, 10).tzinfo is None False But creating an instance of the Foo class doesn't seem to set the tzinfo object. >>> Foo(2012, 11, 10) Foo(2012, 11, 10, 0, 0) >>> Foo(2012, 11, 10).tzinfo is None True Any ideas of what's going on here? Thanks! | Why doesn't the following work (Python 2.5.2)? >>> import datetime >>> class D(datetime.date): def __init__(self, year): datetime.date.__init__(self, year, 1, 1) >>> D(2008) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: function takes exactly 3 arguments (1 given) I wanted to create a class that was just like datetime.date, but with a different __init__ function. Apparently my function never gets called. Instead the original datetime.date.__init__ is called and fails because that expects 3 arguments and I am passing in one. What's going on here? And is this a clue? >>> datetime.date.__init__ <slot wrapper '__init__' of 'object' objects> Thanks! |
i am currently using win 7 and am planning on installing ubuntu alongside win7 but i have unable to do so. Previously i used to install ubuntu inside win using wubi but this time i wanted it as a native os . I have a 500 gb hd. c: win 7 (71gb capacity) d: some stuff (289gb capcaity ) e: (98 gb capcaity ) i want to install it in e drive. since it is having free space so it shrank the vol and created an un allocated space of 35gb for installing. while in ubuntu install process i choose something else and tried to choose 35gb partiton as to create root,boot and home partitions it wont select. all the drives c,d,f are in ntfs ...even while formatting wont show anyother option except ntfs | I currently have Windows 7 on my computer and I want to install Ubuntu alongside Windows safely. Could someone please provide clear instructions? |
MY question is how to prove $|X-Y|\le|X|+|Y|$. My textbook proves another version of triangular inequality, which is $|A|-|B|\le|A-B|$ by substituting X=A-B and Y=B into $|X+Y|\le|X|+|Y|$, but it leaves the above version as an exercise, and I can't solve it. Thank you in advance. :) | Show that $|x-y|\leq |x|+|y|$. I know this probably applies the triangle inequality in some way, but I can't figure it out. |
Is it possible to upgrade a dell streak mini5? android operating system to v3 or above please? if so how? | This Community Wiki question is designed to be the "canonical question" for questions asking how to upgrade one's device to a new Android version. I want to get a newer version of the OS for my Android device. How can I do that? See also: |
In the graveyard scene in Harry Potter and the Goblet of Fire, Voldemort looks around at the Death Eaters, and lectures the ones who disappointed and failed him. When he reaches a wide gap of 6 people, he says three of them are dead, one was too scared to return, one has forever left him, and one is his most loyal servant. " (...) Your exploits at the Quidditch World Cup were fun, I daresay... but might not your energies have been better directed toward finding and aiding your master?” “My Lord, I was constantly on the alert,” came Lucius Malfoy’s voice swiftly from beneath the hood. “Had there been any sign from you, any whisper of your whereabouts, I would have been at your side immediately, nothing could have prevented me —” “And yet you ran from my Mark, when a faithful Death Eater sent it into the sky last summer?” (...) He had reached the largest gap of all, and he stood surveying it with his blank, red eyes, as though he could see people standing there. “And here we have six missing Death Eaters... three dead in my service. One, too cowardly to return... he will pay. One, who I believe has left me forever... he will be killed, of course... and one, who remains my most faithful servant, and who has already reentered my service.” The Death Eaters stirred, and Harry saw their eyes dart sideways at one another through their masks. “He is at Hogwarts, that faithful servant, and it was through his efforts that our young friend arrived here tonight.... Who are the three Death Eaters, and which one of them is the loyal, the cowardly, and the betraying? The obvious answer is Barty Crouch Jr. is loyal, Karkaroff is cowardly, and Snape is betraying. But if this is the case, why didn't Voldemort kill Snape, and why did he give him a second chance? My question is different from this one because I wasn't asking about Snape specifically, but rather for different possible interpretations of the passage. There is no one correct answer, but the other question only provides one answer, which is a bit one dimensional. | In Goblet of Fire, Voldemort says of the missing six Death Eaters: “And here we have six missing Death Eaters… three dead in my service. One, too cowardly to return… he will pay. One, who I believe has left me forever… he will be killed, of course… and one, who remains my most faithful servant, and who has already reentered my service." The answer to speculates about who the three dead Death Eaters were. We know who the last one is. I’m guessing one of the remaining two is Karkaroff. Is the other Snape? If so, which one? |
"After your computer restarts, choose 'Ubuntu' from the boot menu." is it possible to choose between ubuntu and windows each time the desktop is started up ? | First I want to install Ubuntu completely, and then I want to install Windows XP 64 bit as the 2nd boot OS. How can I do this? Currently I am using Windows XP as the main OS and 2nd boot is Ubuntu. |
I have a scene with a house in front of the camera and behind the house some trees. I want to render them in separate layers, but I want the HDR image in the background for the first render and without in the second render with only the trees. I can only check the Transparent in the Film section in the Render tab, but that affect both render layers. I guess I can render them manually one by one and change the settings for Transparent, but perhaps there are some other alternative? EDIT: I'm not asking HOW to render a background with HDR image! I have two render layers. The first render layer I want to render with the HDR background and in the second render layer without the HDR background. But if I enable the Transparent option, both render layer are affected by this settings and the HDR background isn't visible in any render layer. How to fix this was my question. | I have an object with an hdr for the background. What do I do in Cycles to render the background with my object? How is this different from an ordinary render in Cycles? The hdr is a big one, 350MB. |
Isn't this sentence: He stole the singer of that band's wife. a wrong attempt at saying: He stole the wife of that band's singer. Someone pointed this out: The <singer of the band>'s wife is the wife of the <singer of the band>. The wife of the <singer of the band> is the wife of the <band's singer>. Apostrophes aren't that hard. I guess my question is - can you place an 's targeting a previous, but not necessarily the last word in a sentence? Thanks. | Please don't throw this one out as a duplicate of I'm not asking about the plurality of the noun immediately following those two words - I'm interested in exactly why the example below is problematic (context: I have several children, one named John)... 1: One of my children's name is John. I can't see any obvious reason why singular name there is completely unacceptable, but it certainly doesn't sit well with me. It seems to turn on whether one of my children can be treated collectively as the "subject" of the Saxon genitive 's, but I don't see a problem with... 2: It's actually one of my children's, but you can sleep in this bed. I realise that in practice we'd normally pluralise names in the first example. But of course, this implies that one of attaches to my children's names, which isn't really the same construction. So - is there some kind of "rule, principle" debarring #1 above? Or is it just "one of those things"? (Apologies if my later switch from brothers to children invalidates any comments or answers.) |
How much fried chicken should I buy for 80 adults and 20 children? Pulled pork will be served as well as mac n cheese and green beans. | Catering a small event tomorrow for twenty people. Serving beef brisket, pulled pork, and veggie lasagna. Question is how much brisket & pork should allow for each person? also serving three sides, rolls, etc. |
Theorem: Every compact metric space $K$ has a countable base and therefore $K$ is separable. A: Since every infinite subset of $K$ has a limit point in $K$ as $K$ is a compact metric space, it follows that $K$ is separable and since every separable metric space has a countable base so does $K$. This proves the theorem. Now, let's say that this A is not known to us so we proceed as below: Choose $\delta \gt 0$, Clearly $K\subseteq \cup_{x\in K} N_\delta (x)$. Since, $K$ is compact, there must exist a finite subset $K_f\subset K$ such that $K\subseteq \cup_{x\in K_f} N_\delta (x)=B$ Let $G\subseteq K$ be any open subset of $K$. For some $t\in G$, $\exists \epsilon_t\gt 0$ such that $N_{\epsilon_{t}}(t)\subset G$. Clearly, $t\in B$ and hence $d(t,x)\lt \delta$ for some $x\in K_f$ If $a\in N_\delta (x)$ then $d(a,x)\lt \delta$ Hence, $d(a,t)\le d(a,x)+d(x,t)\lt 2\delta$ Since $\delta\gt 0$ is arbitrary, we choose $\delta =\epsilon_t/2\implies d(a,t)\lt \epsilon_t\implies a\in G$. Thus we have proved that for any $x\in G, x \in N_\delta (x) \text{(for some $\delta \gt 0$)}\subset G$. Hence, $B$ is a countable base of $K$. I am stuck at proving (if this is true at all): $K$ has a countable base $\implies K$ is separable. If this statement is not true, then $A$ can be employed to prove $K$ is separable. Please help. Thanks. | I know that every separable metric space has a countable base. I was wondering if we can get a countable dense subset from every metric space that has a countable base. Thank you very much!! |
I just messed up with my /var permissions , setting the chmod -R 775 and chown $USER:USER to it.. My poblem is, i want to set its default permission. Is there someone who can help me on this problem? | Ok I just royally screwed up my /var folder's permissions. I thought I was inside /var/www and did a chmod xxx ./* on the parent folder /var instead. Now all the permissions inside /var are messed up. What can I do to correct it? |
I am Sri Lankan citizen. I have been working as an Engineer for the last 2 years in Sri Lanka and joined my most recent company 6 months ago. I recently applied for UK tourist visa and got a refusal. I wanted to visit London as it was one of my dream destinations. I was refused on three facts. the origin of income is not clear. That may be because I was working remotely and they paid me via petty cash rather than pay slips. November salary is higher as I joined 5 days before the payroll date and that amount is higher than what I stated in the form. I don't have any property or family ties to Sri Lanka. Apart from my salary, there are no other deposits in my account. I am unmarried and don't own any assets. I want address these issues. My company is ready to provide a justification from their end on the petty cash/salary slips issue and they are happy to even provide full sponsorship as I worked very hard during the last 6 months. I have a bond of 2500 dollar with my company as I received some training so I will definitely return to the country after the visit. Previously I applied saying that I am covering my expenses myself. One of my friends sent me an invitation letter (no sponsor letters). My passport is not a fresh passport i have stamps for few countries on tourist visas. I am planing to reapply but really am worried because I would not like to get a second refusal. As I am getting a sponsorship now from the company will that make improve the application or seem suspicious? My company is very stable and reputed people have been to UK before for training. | Many of the UK visa refusals we see here share a common pattern and the prevailing reasons refer to V 4.2 (a) and (c). I do understand that, while the applicants may describe very different individual circumstances, there's a consistent pattern and, broadly, fall into specific categories: Credibility (lifestyle, lack of ties, visit history, lies & omissions) Funding (insufficient funds, provenance of funds, funds parking) Sponsorship (family, friends, employer) Question: What most commonly triggers a UK visa refusal where V 4.2 (a) and (c) are given as the grounds? Secondarily: Given that there is a clear pattern, to what extent are these refusals predictable? Does sponsorship make a difference? Is there a set of personal circumstances, however abstract, where a refusal is all but guaranteed? For example, why do those we see here on TSE who sought entry for the PLAB or British Army appear to be refused with a common theme? Is there a uniform shortcoming or is it just discrimination? PLAB: What is about applications for a visa, for the purpose of sitting the Professional and Linguistic Assessments Board (PLAB) exam, that seem to invite refusals. After all, the test is given so that international medical graduates can show that they qualify to practise medicine in the UK. The first part, PLAB 1, can be taken in centres outside of the UK. However, PLAB 2 can be taken only in the UK. Why can't you can't get a visa just to sit the exam, promising that you'll leave immediately after? British Army: Since Commonwealth citizens are eligible to apply online to join, even those who don't reside in the UK, why is it so difficult to get a visa just to attend an interview to see whether you are suitable? Even with an invitation from the Army, such visa applications seem to be unsuccessful. Isn't a career in the British Army a valid reason? Lastly: After such a refusal, what approaches would increase the chance of a successful application? |
The problem is 'In a finite group, show that the number of nonidentity elements that satisfy the equation $x^5=e$ is a multiple of 4.'. I did it and got answer that cause $x$, $x^2$, $x^3$, $x^4$ always come together but when the condition that group be finite is omitted, what can I say the number of nonidentity elements that satisfy the equation? I first thought it would be $\aleph_0+\aleph_0+\aleph_0+\aleph_0$. But $\aleph_0+\aleph_0=\aleph_0$? or $2\aleph_0$? This algebra problem makes me solve set theory problem. | Since $X$ and $Y$ are countable, we have two bijections: (1) $f: \mathbb{N} \rightarrow X$ ; (2) $g: \mathbb{N} \rightarrow Y$. So to prove that $X\cup Y$ is countable, I figure I need to define some function, h: $\mathbb{N} \rightarrow X\cup Y$ Thus, I was wondering if I could claim something similar to the following: since we have (1) & (2) it follows that we also have the bijections $\alpha : \{n\in \mathbb{N} : n = 2k + 1, k\in \mathbb{N}\} \rightarrow X$; $\beta : \{n\in \mathbb{N} : n = 2k, k\in \mathbb{N}\} \rightarrow Y$; because we have bijections from $\mathbb{N}$ to the evens and odds respectively. Then define $h := \alpha$ for odd $n$, $h := \beta$ for even $n$. Thus, since $\forall n\in \mathbb{N}$(either $n$ is even or $n$ is odd but not both) $h$ is a bijection from $\mathbb{N}$ to $X\cup Y$. Thanks for reading, and for answering if you answer. I'm just really unsure if my logic holds here, or if I'm even approaching this right because I've been stuck on this problem for a little while today. p.s sorry for asking so many questions recently, I'm trying to study on my own and apparently I get confused and stuck more easily than I thought I would without a teacher. EDIT: (1) fixed the even and odd. (2) I do mean countably infinite. My bad, going through some notes I found online they were using the notation of "countable" for what you call "countably infinite", and "at most countable" for what you called "countable" (3) Thanks for the good answers, I do see now that this makes breaks down when they are not disjoint, but at least I'm not too far off. |
Superposition between discrete states of a system is widely considered in the literature, but this system, e.g., a $H$ atom, can also have a continuum in its energy spectrum. Can the state of a system be in a superposition of an energy level in the discrete part of the spectrum with one level in the continuum part (or with an interval thereof)? In other words: Can an electron in a $H$ atom be in a superposition of bound to and free from the proton? | For a system has both continuous and discrete spectrum, is it possible that a physical states is something like: $$\psi(x)=\sum_{n=n_1}^{n=n2}c_n\psi_n(x)+\int_{E_0-\Delta_E}^{E_0+\Delta_E}\psi_E(x)\mathrm{d}E$$ I am asking this because of some comments under my to this Phys.SE question: |
An exercise : A quality control engineer gets 1000 items. How big a sample will he require to say that the he is 95% confident that the sample represents the population?? Is this possible to answer without knowing anything else?? All examples that I have seen so far work with either certain values and/or known standard deviation and certain samples. My question basically is: is Cochran's formula enough / suitable if I want to determine minimum sample size to examine in order to get confidence about the whole population? Lets say I have a batch of 1000 phones. I cannot test all of them but I need to test enough of them to be somehow confident that the whole population has the same property (e.g. simply is working). This Cochran's formula seems to be exactly what I need but I am not sure. Can Cochran's formula be used here? | I have read through existing answers on CrossValidated (plus elsewhere online) and can't find what I'm looking for, but do please point me to existing sources if I've missed them. Let's say I have a data set of N=1000 records, each of which can be manually sampled and labelled as either 'Valid' or 'Invalid' (or True/False, Right/Wrong, etc). I want to achieve a given level of confidence that all records in the data set are Valid. As I sample records, if I find a single Invalid one I would go back and amend how the data set is created to rectify that and similar problems. So, after some iterations of spotting Invalids, fixing and recreating the data set, I do some sampling that only includes Valid records. If I want to be (say) 99% or 95% sure that all records are Valid, how big does my sample have to be? (Ideally as a function of N.) I've tried playing around with Hypergeometric tests () - in that context I want to know what k should be, but I don't have a fixed value of K. Rather I want to choose k such that K is likely to be equal to N - but setting K=N obviously works out to a Probability of 1! I'm also wondering if I need to use a Bayesian approach but I don't understand Bayesian stats enough. |
I'm having a problem with a simple if statement and i'm not too sure why. I've got an edittext box and a button, when the user inputs a value into the edittext and then presses the button, whatever was input into the box is converted to string and stored in a variable, this variable is then displayed in a toast. Now this works perfectly fine as it is but I would like it to only display if a certain value is input into the editbox but when I put in an if statement to validate this, it seems to completely disgregard the if statement and does nothing. It does not cause any errors but it stops any toast from being displayed even if the correct string is input. I'm sure this is something simple but I can't seem to work it out. It would be great if anyone could work out why it does this. Code below: Working code when the if statement is commented out: saveBtn1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Global.controlNum = inputTxt1.getText().toString(); // if((Global.controlNum == "1")||(Global.controlNum == "2" )){ Toast toast= Toast.makeText(SettingsScreen.this,"hello " + Global.controlNum, Toast.LENGTH_SHORT); toast.setGravity(Gravity.CENTER, 0, -100); toast.show(); // } } }); if the if statement is brought in then it will do nothing: saveBtn1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Global.controlNum = inputTxt1.getText().toString(); if((Global.controlNum == "1")||(Global.controlNum == "2" )){ Toast toast= Toast.makeText(SettingsScreen.this,"hello " + Global.controlNum, Toast.LENGTH_SHORT); toast.setGravity(Gravity.CENTER, 0, -100); toast.show(); } } }); | I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug. Is == bad? When should it and should it not be used? What's the difference? |
On the achievement screen, badge award notifications use the badge symbol of the site you're currently viewing, not the one you earned the badge on. This is confusing because, for example, has a distinctive badge symbol that makes me think I earned a badge there at first glance, even though the site icon is from another site. The expected behavior is to take each badge symbol from the relevant site. | It's so cool that the notification reminds you of the colour of badge you've earned. But I am a little puzzled by the symbols: Is it feasible to use the symbol from the earned site? At the moment it uses the symbol from the site I happen to be on (as you can see by looking to the left of the dropdown in each case.) |
I have a book document with a lot of formatting, and I would like my dedication paragraph to appear in a font, that will just be used here, in the entire document. Let's say I want to use Tex Gyre Chorus () to be used in that paragraph. How to do this, without breaking everything, and inadvertently affecting the fonts I use for the rest of my document? Here is a toy example: \documentclass[12pt]{book} \usepackage{lipsum} \usepackage{lmodern} \usepackage[sf=false]{libertine} \begin{document} \lipsum Hello World! I would like this text to appear in Tex Gyre Chorus. \lipsum \end{document} | The standard font packages make global changes to the fonts in my document. What if I want to use a particular font for just a portion of my text? How do I find the right name of the font? How do I select the font? How do I restrict the scope of the font change? There are separate answers for different flavors of TeX (quick links): |
Previously, I could give links to images on the web and they would be uploaded as shown in the old UI screenshots in this answer: However as of 2018-11-8, the link from "You can also provide a link from the web" part is gone: Is there some workaround? That was a very good feature. Chromium 70 Ubuntu 18.04. | I want to take an image address from online and put the picture into my Stack Exchange answer. I used to be able to paste the image URL and it would be uploaded to Imgur and inserted into my post. Now I don't see how to do this any more. |
I need to add 2 empty person objects to array and after populate it. Chrome complains TypeError: object is not a function at new <anonymous>. What's wrong? $scope.person = { firstName : '', lastName : '', dateOfBirth : '', sex : '', nationality : '' }; $scope.persons = []; $scope.persons.push(new $scope.person); // error $scope.persons.push(new $scope.person); | What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but . I've done things like obj = JSON.parse(JSON.stringify(o)); but question the efficiency. I've also seen recursive copying functions with various flaws. I'm surprised no canonical solution exists. |
I'm a bit frustrated because I am writing my thesis in latex and I used the graduate-thesis template from sharelatex. I just want to reduce the spacing before a new Chapter that is generated between the top of the space and the "Chapter x" with the \chapter{"example chapter"} command. How can I do that? Thanks in advance! | I am using LaTeX to write my dissertation, and I have realised that on the table of contents and on every chapter page, LaTeX leaves a lot of empty space. What I mean is that lets say in the page where chapter 1 begins, from the top of the page until the chapter title there is much more vertical space than on any other page. The same goes with chapter 2 etc... and for contents page as well. Can anybody help me to remove that space? Is there any mistake in my code or something like that? Is this a default of LaTeX? the preamble is \documentclass[12pt,twoside]{report} \pagestyle{plain} \usepackage{a4paper} \usepackage{setspace} \doublespacing \usepackage{amssymb} \usepackage{amsmath} I've tried the methods below, but none of them work properly. |
Unfortunately, he forgot to support the brickwork above the hole he had made, and the bedroom floor above sagged about a meter and they had to call in a builder to put it right. It was his wife who insisted he do any work out in the garden in future. The last sentence I am not sure if it is right, after "It was his wife who insisted he DO..." Maybe it is not right. Why do? —maybe him doing instead of the written example? Please explain the grammar. | He has rare autoimmune disease which requires he be injected with gamma globulin once every 21 days. Why do we use "be" in the sentence above? What does it mean? |
Many (all?) document classes have a draft option. Some packages, such as microtype and hyperref, can detect whether or not the class is in draft mode, and take action accordingly. How do packages know whether or not the document is in draft mode? I see that the memoir class has a draftdoc boolean that is set in draft mode, but this does not appear to be standard among other document classes. For example: \documentclass[draft]{article} % or any other class \begin{document} \ifdraftmode % pseudo-code. This I what I seek. yes \else no fi \end{document} So, what I want to know is, what would I really test, rather than the fictitious ifdraftmode? | How can I test within a document, whether or not the initial \documentclass[a4paper,11pt,twoside,fleqn,draft]{report} includes the "draft" option? My naive attempt \newif\ifmydraft \mydraftfalse \DeclareOption{draft}{\mydrafttrue} does not work, and breaks a later \usepackage command. |
When mathematicians state: "let $x$ be an arbitrary integer" "let $x$ be any integer" "let $x$ be an integer" what do they actually mean? I asked a very similar question here: however, here I am not asking whether my interpretation is correct, but instead how most mathematicians actually think about these statements. Thank you for your time. | I have a question about how to interpret arbitrary elements. When we say: "let $x$ be an arbitrary integer" "let $x$ be any integer" "let $x$ be an integer" at the beginning of proofs, are we saying: "let the symbol $x$ represent one of the integers, although it is not clear which specific integer the symbol $x$ represents". If not, please let me know how I should think about the above statements. Thank you for your time. Edit: I had a follow up question to the one I asked earlier. What do mathematicians mean by “arbitrary element” or “any element”. I can understand when mathematicians say “let $x$ be $4$” as this means “the symbol $x$ represents $4$”. Could someone please elaborate on why the specific terms “arbitrary” and “any” are used? |
Let $G$ be a group and $a,\,b\in G$ such that $a$ has order $5$ and $a^3b=ba^3$. Prove $ab=ba$. Attempt. Since $a^5=e$, multiplying from the left with $a^2$ and from the right with $a^2$ the given equality we get $ba^2=a^2b$. How may we conclude that $ab=ba$? Thanks in advance. | Let $a, b$ be elements of a group $G$. Suppose that a has order $5$ and that $a^3b = ba^3$. I want to show that that $ab = ba$. Here is what I think: We know that we have $a^1, a^2, a^3, a^4, a^5 = 1$. So, $a^4 = a^{-1}$ and $a^3 = a^{-2}$ and $a^{2} = a^{-4}$. Now, $a^3b = ba^3$ then $a^{-2}b = ba^{-2}$ then $ba^2 = a^2b$ then $ba^{-4} = a^{-4}b$ then $a^{-1}b = ba^{-1}$ then multiply on the left and right by $a$ to get $ba=ab$. Is this correct or is there a simpler approach? |
my hard disk is damaged, i tried to install ubuntu 18.04.1 on c: partition instead of windows. I formatted that partition. Unfortanatly the installation had some errors, while ubuntu system files has been installed. I figure out then, that some of my important data were stored in C:. My question does testdisk command help in this case. If yes, since i am not able to install any OS, I used ubuntu with usb key. I can access to D: but C: does contain only ubuntu folders. If someone would suggest testdisk, how could i install it from terminal since i was not able to do it for any package when i boot from usb key. Thanks in advance | For some reason I can't boot my system. I get an error akin to Operating System Not Found. I tried bootrepair, and that didn't work. So then I decided I would just save my personal files, wipe everything, and reinstall. But in the live session, when I go to the /home directory, my username folder isn't there, instead it goes to the Live CD's desktop and other directories. Is there some other error occurring? Is there a way to recover the files? |
I stored a decimal value 0.57 as number (10,2) in the database. When I retrieve the value on my screen using Ruby on Rails it shows 0.570000000001 | Consider the following code: 0.1 + 0.2 == 0.3 -> false 0.1 + 0.2 -> 0.30000000000000004 Why do these inaccuracies happen? |
I'm new to jquery, I've created a date-picker, I want to deselect the weekend and holidays while end user click the date-picker button. Can you please suggest me how to proceed this? HTML <p>Date: <input type="text" id="datepicker"></p> JS $(document).ready(function(){ $("#datepicker").datepicker(); $("#datepicker").datepicker("option", "dateFormat", "d-M-yy"); }); }); Please advise. | I use a datepicker for choosing an appointment day. I already set the date range to be only for the next month. That works fine. I want to exclude Saturdays and Sundays from the available choices. Can this be done? If so, how? |
Let $F \in \mathbb{R}[x_1, \ldots, x_n]$ be irreducible over $\mathbb{R}$. I am trying to understand why the Krull dimension of the ring $\mathbb{R}[x_1, \ldots, x_n]/(F)$ is $n-1$. Any comments are appreciated! Thank you! PS In fact is it always the case that if $P$ is a prime ideal of height $k$ then the Krull dimension of the ring $\mathbb{R}[x_1, \ldots, x_n]/P$ is $n-k$? | Let $A$ be an integral domain of finite Krull dimension. Let $\mathfrak{p}$ be a prime ideal. Is it true that $$\operatorname{height} \mathfrak{p} + \dim A / \mathfrak{p} = \dim A$$ where $\dim$ refers to the Krull dimension of a ring? Hartshorne states it as Theorem 1.8A in Chapter I (for the case $A$ a finitely-generated $k$-algebra which is an integral domain) and cites Matsumura and Atiyah–Macdonald, but I haven't been able to find anything which looks relevant in either. (Disclaimer: I know nothing about dimension theory, and very little commutative algebra.) If it is true (under additional assumptions, if need be), where can I find a complete proof? It is obvious that $$\operatorname{height} \mathfrak{p} + \dim A/\mathfrak{p} \le \dim A$$ by a lifting argument, but the reverse inequality is eluding me. Localisation doesn't seem to be the answer, since localisation can change the dimension... |
I was doing an exercise of my python class and after seeing the results i was imagining what could i do to shorten the resultant variable (to avoid results like: 3.888888888, and transform it to 3.8 or 3.88. Someone could help me?! (Also the code is working very well i just wanna improve it) OBS: My code is at my native language, so ill explain. The user type a number and it will show your double, triple, square root (b,c and d; respectively) a = float(input("Digite um número para descobrir: \n\nSeu Dobro \nSeu Triplo \nSua Raiz Quadrada \n\nDigite um número: ")) b = a * 2 c = a * 3 import math d = math.sqrt(a) print() print("RESULTADOS: \n\nDobro: {} \nTriplo: {} \nRaiz Quadrada: {} \n".format(b, c, d)) | I want a to be rounded to 13.95. >>> a 13.949999999999999 >>> round(a, 2) 13.949999999999999 The function does not work the way I expected. |
Why did apt-get update fail? What is cdrom in it? | Every time I try update (using sudo apt-get update) my Ubuntu I get this problem: W: The repository 'cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1) xenial Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. W: The repository 'ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu xenial Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. E: Failed to fetch cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)/dists/xenial/main/binary-amd64/Packages Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs E: Failed to fetch cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)/dists/xenial/main/binary-i386/Packages Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs E: Failed to fetch ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found E: Failed to fetch ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu/dists/xenial/main/binary-i386/Packages 404 Not Found E: Some index files failed to download. They have been ignored, or old ones used instead. How can I fix it? I use Ubuntu 16.04 LTS |
I just downloaded the Ubuntu file to my chromebook and its not letting me open the file to actually download it. When I click on it to open the file it tells me to go to the chromestore to find an app that can open this type of file because the file is not supported. I just got my chromebook today so I dont think its a computer issue. I don't understand why it's not letting me open the file. I downloaded it directly off of the ubuntu website and downloaded what ubuntu had recommended me to download. | I have an Acer C720, with a 64 gb SSD, in which I would like to install Ubuntu. But I don't want the "crouton" version. If I follow the directions from here () will I get a "real" version of Ubuntu? If not how should I proceed? Thanks |
I have schengen visa issued by French embassy and my longer stay would also be in the same country. My first stay would also be at Paris. However, as per my flight, I will break the journey at Frankfurt, Germany and have to go for immigration before taking connecting flight to Paris in next two hours. Will it have any problem at immigration at Frankfurt? | In case, if I get a multiple-entry Schengen visa in one of the embassies in Ukraine, Kyiv - should my first trip be to the country which issued the visa? Any there any requirements of this sort? Does this condition vary depending on embassy which issued the visa? What are the possible consequences on not visiting that country first? Does it somehow depend on country where the embassy is (i.e. non-Schengen and not EU members)? |
When I go to run: root@vps [~]# yum update -y openssl I get: Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.beyondhosting.net * extras: centos.mirror.nac.net * updates: centos.netnitco.net Setting up Update Process No Packages marked for Update And if I run: root@vps [~]# yum info openssl I get this, which is not the latest version of OpenSSL and is vulnerable to heartbleed: Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.beyondhosting.net * extras: centos.mirror.nac.net * updates: centos.netnitco.net Installed Packages Name : openssl Arch : x86_64 Version : 1.0.1e Release : 16.el6_5.7 Size : 4.0 M Repo : installed From repo : updates Summary : A general purpose cryptography library with TLS implementation URL : http://www.openssl.org/ License : OpenSSL Description : The OpenSSL toolkit provides support for secure communications : between machines. OpenSSL includes a certificate management tool : and shared libraries which provide various cryptographic : algorithms and protocols. Available Packages Name : openssl Arch : i686 Version : 1.0.1e Release : 16.el6_5.7 Size : 1.5 M Repo : updates Summary : A general purpose cryptography library with TLS implementation URL : http://www.openssl.org/ License : OpenSSL Description : The OpenSSL toolkit provides support for secure communications : between machines. OpenSSL includes a certificate management tool : and shared libraries which provide various cryptographic : algorithms and protocols. Or is this version of 1.0.1e not vulnerable to heartbleed for some reason? | This is a about understanding and remediating the Heartbleed security issue. What exactly is CVE-2014-0160 AKA "Heartbleed"? What is the cause, what OSs and versions of OpenSSL are vulnerable, what are the symptoms, are there any methods to detect a successful exploit? How can I check to see if my system is affected? How can this vulnerability be mitigated? Should I be concerned that my keys or other private data have been compromised? What other side effects should I be concerned about? |
My Nan was originally on Windows XP so I changed it to Ubuntu. She had problems using it so I changed it to Xubuntu (as I could make it look similar to Windows and she woul d find it easier to use. But then she bought a new computer and gave me this one, but I want it back to Ubuntu. How do I do this? | A few days ago I installed Xubuntu on top of a normal Ubuntu system: sudo apt-get install xubuntu-desktop I didn't play around for long on Xubuntu before I realised that I liked Ubuntu 2D better. Now my problem is how do I uninstall Xubuntu and all of it's dependencies and the recommended packages like Thunar and Abiword. For now I just run: sudo apt-get remove xubuntu-* but I still have a lot left from Xubuntu. It would be nice if by doing apt-get remove xubuntu-desktop all of the packages installed with the metapackages were also removed, but that is not the case. |
Every hospital I know of has a serious shortage of masks, not just N95 masks, but even just OR masks. The CDC just recommended a bandana if you don't have a mask. I was wondering if people can make facemasks which are better at filtering air than OR masks. My kids (health care providers) are not being given N95 masks unless there is a dire need (e.g. to intubate patients). Even OR mask usage is being unreasonably restricted. I do some sewing, and I was wondering what I can use to make launderable facemasks. I was thinking of a fabric sandwich, better face fitting than OR masks, in which some filter could be inserted into a clean envelope. The metal nose "mold" could be removed, cleaned, and reinserted into a slot for that purpose. The problem is the filter. Would a high MERV home VAC filter be better than an OR mask? The filter could be taken apart and the fabric cut to size to slip into the fabric sandwich. I did read that in the Pacific Northwest, a hospital asked for community volunteers to but the products they provided were medical grade material that is not available commercially. I was going to use cotton for the envelope, but would that retain too much moisture? I also have a polyester/spandex knit (used in leggings, athletic sportswear, etc.) in abundance. Ideas? | There have been a number of do-it-yourself (DIY) mask designs released and tested by both universities and other institutions on account of world wide Personal Protection Equipment (PPE) shortages. Some were designed at the time of the SARS epidemic, and use double-folded kitchen paper towels with tissue. Even though double tea towel masks are more effective in reducing viral exposure, it's difficult to breathe with it on. What design has been tested to provide relatively good protection while being comfortable to wear and breathe while wearing them? And it needs to use readily available materials throughout the world. |
What's the best books to understand the basic laws of thermodynamics and other things such as enthalpy, Carnot's cycle, entropy, Maxwell equations etc? | I've been working on some projects lately where it would be very handy to know more about thermodynamics than I do, but sadly I never had a chance to take a proper thermodynamics course in college. Unfortunately, right now I don't have the time to work through a 500-600 page undergraduate text on the subject. Can anyone recommend a book/online resource/PDF that perhaps gives a (calculus based) broad overview of classical thermodynamics, say in something less than 200 pages? |
Given an Annulus with $A(0,r,R)$ show by considering Cauchy's Theorem for primitives that there is no holomorphic function with $f'(z)=\dfrac{1}{z}$. I am struggling to picture this since but it seems like there are issues because $f(z)=\log z$ isn't well defined in the same range as $\dfrac{1}{z}$. Am I looking to show that $\int_Ag(z)dz = 0$ where $g(z) = \dfrac{1}{z}$? | An old exam question states Let $0 \leq R_1 < R_2$ and consider the set $ A:=$ {$z \in \mathbb{C}: R_1 < |z| < R_2$}, along with the function $g: A \rightarrow \mathbb{C}$ given as $g(z) = {1 \over z}$, $\forall z \in A$. Show that, even though $g$ is analytic in $A$, there is no analytic function $h$ in $A$ such that $h' = g$. By contradiction, suppose such an $h$ exists. Naively, I'd assume it's a branch of log($z$). Is the only issue, then, that $h$ may not be well defined, since part of the real axis is included in $A$? |
There is my simple script that I try #!/bin/bash DIR="$(cd "$(dirname $0)" && pwd)" echo $DIR When I execute it like $ ./my_script.sh, get the path correctly. But, when I source it like $ source my_script.sh, it gets the path /bin How can I get the path of script by source it? What is the different between source and execute? | Is there a way for a sourced shell script to find out the path to itself? I'm mainly concerned with bash, though I have some coworkers who use tcsh. I'm guessing I may not have a ton of luck here, since sourcing causes commands to be executed in the current shell, so $0 is still the current shell's invocation, not the sourced script. My best thought currently is to do source $script $script, so that the first positional parameter contains the necessary information. Anyone have a better way? To be clear, I am sourcing the script, not running it: source foo.bash |
After running this command - sudo chown -R $(whoami) usr/{lib/node_modules,bin,share} I am not able to run sudo anymore: sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set. How do I fixed that? I read but I am not sure what advice to follow and if it's applicable to my case. | I accidently ran sudo chmod 755 -R / instead of sudo chmod 755 -R ./ I stopped it after few seconds, but now there is some problems such as sudo: must be setuid root How can I revert permissions back? |
While watching I found this scene, Is Stark creating new shield for Captain America ??. Why would Tony Stark do that, considering they had a bad fight ? | In Spider-Man: Homecoming while Happy (Jon Favreau) is loading the plane at Avengers Tower he mentions a "prototype of Cap's new shield". Does that mean Captain America is back with the Avengers and whatever was between Tony and Steve is over? |
My question is about a proof of Theorem 4.12 given in the text Introduction to Set Theory by Hrbacek and Jech. Let $V$ be the class of all sets, $\operatorname{Ord}$ be the class of all ordinals, and $G,G_1,G_2,G_3$ be class functions from $V$ to $V$. Theorem 4.11: There exists a class function $F:V\times\operatorname{Ord}\to V$ such that, for all $z\in V$ $F(z,0)=G_1(z,\emptyset)$ $F(z,\alpha+1)=G_2(z,F_z(\alpha))$ for all $\alpha\in\operatorname{Ord}$, with $F_z(\alpha):=F(z,\alpha)$ $F(z,\alpha)=G_3(z,F_z\restriction\alpha)$ for all $\alpha\neq 0$ limit, with $F_z\restriction \alpha:=\{\langle\beta,F(z,\beta)\rangle\mid\beta<\alpha\}$ Theorem 4.12: For any set $a$, there is a unique infinite sequence $(f_n\mid n\in \Bbb N)$ such that (1) $f_0=a$ (2) $f_{n+1}=G(f_n,n)$ for all $n\in \Bbb N$ The proof for Theorem 4.12 is given in the text as follows: Let $G:V\to V$ be a class function. We want to find, for every set $a$, a sequence $(f_n\mid n\in \Bbb N)$ such that $f_0=a$ and $f_{n+1}=G(f_n,n)$ for all $n\in \Bbb N$. By Theorem 4.11, there is class function $F$ such that $F(0)=a$ and $F(n+1)=G(F(n),n)$ for all $n\in \Bbb N$. Now we apply the Axiom of Replacement: There exists a sequence $(f_n\mid n\in \Bbb N)$ that is equal to $F\restriction \omega$ and the Theorem follows. I don't understand how Theorem 4.11 is used to derive the class function $F$ in the proof of Theorem 4.12. Can someone elaborate on how to obtain the desired $F$? Thank you for your help! | My question is about a proof of Theorem 4.12 given in the text Introduction to Set Theory by Hrbacek and Jech. The authors first prove Theorems 4.9, 4.10, and 4.11. For reference, I quote these theorems below. Let $V$ be the class of all sets, $\operatorname{Ord}$ be the class of all ordinals, and $G:V\to V$ be a class function. Theorem 4.9: Transfinite Recursion Theorem There exists a class function $F:\operatorname{Ord}\to V$ such that $F(\alpha)=G(F\restriction \alpha)$ for all $\alpha\in\operatorname{Ord}$. Theorem 4.10: Transfinite Recursion Theorem, Parametric Version There exists a class function $F:\operatorname{Ord}\to V$ such that $F(z,\alpha)=G(z,F_z\restriction \alpha)$ for all $\alpha\in\operatorname{Ord}$ and $z\in V$ where $F_z\restriction \alpha:=\{\langle\beta,F(z,\beta)\rangle\mid\beta<\alpha\}$. Theorem 4.11: Let $G_1,G_2,G_3$ be class functions from $V$ to $V$. There exists a class function $F:\operatorname{Ord}\to V$ such that (1) $F(0)=G_1(\emptyset)$ (2) $F(\alpha+1)=G_2(F(\alpha))$ for all $\alpha\in\operatorname{Ord}$ (3) $F(\alpha)=G_3(F\restriction\alpha)$ for all limit $\alpha\neq 0$ Then they say A parametric version of Theorem 4.11 is straightforward and we leave it to the reader. From my attempt, the parametric version of Theorem 4.11 is as follows (Honestly, I'm not sure if my attempt is correct or not) Let $G_1,G_2,G_3$ be class functions from $V$ to $V$. There exists a class function $F$ such that, for all $z\in V$ $F(z,0)=G_1(z,\emptyset)$ $F(z,\alpha+1)=G_2(z,F_z(\alpha))$ for all $\alpha\in\operatorname{Ord}$ $F(z,\alpha)=G_3(z,F_z\restriction\alpha)$ for all limit $\alpha\neq 0$ Next they make use of this parametric version of Theorem 4.11 in the proof of Theorem 4.12. Theorem 4.12: For any set $a$, there is a unique infinite sequence $(f_n\mid n\in \Bbb N)$ such that (1) $f_0=a$ (2) $f_{n+1}=G(f_n,n)$ for all $n\in \Bbb N$ The proof for Theorem 4.12 given in the text is as follows: Let $G:V\to V$ be a class function. We want to find, for every set $a$, a sequence $(f_n\mid n\in \Bbb N)$ such that $f_0=a$ and $f_{n+1}=G(f_n,n)$ for all $n\in \Bbb N$. By the parametric version of the Transfinite Recursion Theorem 4.11, there is class function $F$ such that $F(0)=a$ and $F(n+1)=G(F(n),n)$ for all $n\in \Bbb N$. Now we apply the Axiom of Replacement: There exists a sequence $(f_n\mid n\in \Bbb N)$ that is equal to $F\restriction \omega$ and the Theorem follows. I don't understand how the parametric version of Theorem 4.11 is used to derive the class function $F$ in the proof of Theorem 4.12. Can someone please help me fill in the blanks? |
I don't have password set for a public computer. Is there a way to auto unlock the computer after hibernating or sleeping so I don't have to press the user? This is what my login screen looks like: | When Windows 7 hibernates and then I wake it up, it always shows a screen where I have to click before I can get into the Windows environment. I don't have a password set so this intermediate screen serves no purpose - just one wasted mouse click and an unnecessary wait every time. How do I disable this so that I go from hibernating directly into my desktop without a click? |
Presently I have run in my context menu. I would like to have similar functionality for Powershell as Admin. Can any one guide me, how do I achieve that? Simply I tried to change cmd.exe with powershell.exe and change context name. It didn't work. It replaced existing Command Prompt and opened non-usable Powershell | I want the option to open a Command window or Powershell window as Administrator from the drive and directory context menus in Windows. I can have either by creating and populating the special 'runas' registry keys shown below, but is there a way I can have both listed on the context menu and have both run as Administrator? [HKEY_CLASSES_ROOT\Drive\shell\runas] ... [HKEY_CLASSES_ROOT\Drive\shell\runas\command] ... [HKEY_CLASSES_ROOT\Directory\shell\runas] ... [HKEY_CLASSES_ROOT\Directory\shell\runas\command] ... [HKEY_CLASSES_ROOT\Directory\Background\shell\runas] ... [HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command] ... |
I am working on a project for which I need a stable crystal oscillator of 1 Hz. I am planning on using a 32.768 kHz quartz crystal and then convert it to 1 Hz by frequency divider circuit( CD4060 + Flipflop ). I need to reduce the phase jitter and shift of the clock. Can anyone suggest any circuit or resources on that.? | For that I need a 1 hz stable clock with 3 SPY. Which oscillator should I use? Crystal Oscillator or RC oscillators? |
Let $K$ a finite field. I want to show that $|K|=p^d$. I consider an homomorphism $\Phi:\mathbb Z\to K$ which is clearly not injective, therefore $\ker\Phi\neq\{0\}$. What I want is to prove that $\ker \Phi= p\mathbb Z$ for a certain prime, and thus $\mathbb Z/p\mathbb Z\cong \text{Im}(\Phi)$. In particular, I would like to have $\text{Im}(\Phi)=K$ and thus, since $\Phi(\mathbb Z/p\mathbb Z)=k$, we need to have $p\mid |K|$ and thus $|K|=p^d$. Well, every thing is confuse in my mind, so any help si welcome. PS: My hint is : consider $\Phi: \mathbb Z\to K$. | Let $F$ be a finite field. How do I prove that the order of $F$ is always of order $p^n$ where $p$ is prime? |
I have written this trigger and trying to write the test class but the code coverage is not happening. Can anybody suggest where i am missing something? Trigger Benchmarks on Recruitment_Benchmark__c (before insert, before update) { Set<id>rid=new set<id>(); Date Fdate; Date Tdate; Integer interviewshappened; Integer Psourced; Integer Alist; for (Recruitment_Benchmark__c BM: trigger.new){ rid.add(BM.Recruiter_Name__c); Fdate= BM.From_Date__c; Tdate=BM.To_Date__c; } Psourced=[select count() from contact where ownerid IN:rid AND CreatedDate >=: Fdate AND CreatedDate<=:Tdate ]; Alist=[select count() from SCSCHAMPS__Appointment__c where ownerid IN:rid AND CreatedDate >=: Fdate AND CreatedDate<=:Tdate]; interviewshappened=[select count() from SCSCHAMPS__Interview__c where ownerid IN:rid AND CreatedDate >=: Fdate AND CreatedDate<=:Tdate]; for(Recruitment_Benchmark__c BM: trigger.new){ BM.profiles_sourced__c= Psourced; BM.placements_done__c= Alist; BM.interviews_happened__c=interviewshappened; } } test class: @Istest public class Benchmarks_Testclass{ static testMethod void testBenchmarks(){ User[] user = [select Id,LastName,FirstName,Alias, Email, EmailEncodingKey, LanguageLocaleKey, LocaleSidKey, TimeZoneSidKey, Username from User limit 2]; Recruitment_Benchmark__c RB = new Recruitment_Benchmark__c(); RB.Recruiter_Name__c='00541000002BhVw'; RB.From_Date__c = system.today(); RB.To_Date__c = system.today(); } } | The trigger: What I have been trying for the test class: I am a total noob when it comes to writing these unit tests. I would greatly appreciate any guidance to help me get this figured out. |
How do I change the vertical location of a line by specifying an absolute value measured from the top or bottom of the page? I know that the vspace command can put an arbitrary space, but it is always a relative value from the previous line. | I know that there is tikz, but also eso-pic and textpos. I'd like to see a list of possible ways (not necessarily packages) for absolute positioning of things (which I believe amounts to "boxes") on the page, together with their advantages and disadvantages (for instance: tikz's current page node is very easy to use, but usually requires two LaTeX runs, and overhead from loading tikz if you don't need it for any other things is considerable). Both LaTeX and ConTeXt solutions are welcome |
Hi all i have a question, i have to find how many times words in a file repeat, so i write a code like this public class CountWords { FileReader fr; ArrayList<String> wordsList = new ArrayList<>(); public CountWords(String fname) { try { fr = new FileReader(fname); Scanner s = new Scanner(fr); while(s.hasNextLine()){ String[] parola = s.nextLine().split("[\\p{Blank}]|[\\p{Punct}&&\\p{Blank}]|[\\p{Punct}]"); for (int i = 0; i < parola.length;){ if (parola[i] == " "){ i ++; }else { wordsList.add(parola[i]); i++; } } } s.close(); }catch (FileNotFoundException e) { e.printStackTrace(); } } public List<String> getResult() { ArrayList<String> res = new ArrayList<String>(); HashMap<String,Integer> set = new HashMap<>(); for(String slowa : wordsList) { set.put(slowa, set.containsKey(slowa) ? set.get(slowa) + 1 : 1 ); } for(String key : set.keySet()){ res.add(key + " " + set.get(key)); } return res; } } After the last try where i put a lot of Puncts in between the words i have the problem that the output give me in the array "parola" the blank spaces too how to not include the blank spaces in the array? | I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug. Is == bad? When should it and should it not be used? What's the difference? |
I have two scripts to run backup task, one is for full backup, another one is for incremental backup. I want to run full backup at specific time every day, and run incremental backup every 10 mins after that specific time. How can I use cron job doing this one? | This is a about using cron & crontab. You have been directed here because the community is fairly sure that the answer to your question can be found below. If your question is not answered below then the answers will help you gather information that will help the community help you. This information should be edited into your original question. The answer for 'Why is my crontab not working, and how can I troubleshoot it?' can be seen below. This addresses the cron system with the crontab highlighted. |
I recently acquired a shapefile that when added in ArcMap 10.2, the software says it has an unknown spatial reference system. The X and Y coordinates are both 6 digit coordinates (for example, 712568.799, 257083.471). I would like to be helped on how to convert these coordinates to Arc 1950 UTM Zone 36s which is a system used in Malawi. If the Y coordinate had 8 in front it could have worked perfectly but this is not the case. | I have a Shapefile but its coordinate system is Unknown, and there is no *.prj file. How can I identify it now? |
I'm a little confused. What is the difference between these. Please don't reference really old postings. I notice that accessing some of the styles are different inline in html as well as in style sheets. <input type=button> vs <button> I guess I'm wondering which one will out live which? or which is the best when taking into account ease of compatibility between all the general technologies that go into website creation? aka. which is going to cause the least amount of trouble | When looking at most sites (including SO), most of them use: <input type="button" /> instead of: <button></button> What are the main differences between the two, if any? Are there valid reasons to use one instead of the other? Are there valid reasons to use combine them? Does using <button> come with compatibility issues, seeing it is not very widely used? |
Is this sentence correct with regard to commas? Especially around "...let alone attain...". Thank you :) In a dynamic market, the Central Planning Board would be too slow to significantly approach, let alone attain, equilibrium. | I notice that "let alone" is used in sentences that have a comma. The structure of the sentence is what comes before the comma is some kind of negative statement. Right after the comma is "let alone," followed by the rest of the sentence. What does "let alone" mean here? Does it mean the same thing as "or even?" Can someone explain this phrase and sentences that have it? |
I'm fairly new to blender but have used 3d modelling programs before, and I've become baffled by a fairly simple problem. I'm trying to model a pool table and I'm building the table bed. I make a cube the right dimensions, and placed a cylinder at one corner. I used modifiers to mirror the cylinder to four corners: As I understand it, I should then be able to add a boolean modifier to the cube to subtract the cylinders, but I just can't seem to make it work. I can subtract the cube from the cylinders, leaving 4 cylinders with the cube corners chopped out, but nothing seems to work the other way. What am I doing wrong? | I'm trying to model a M16 but I have a problem with cutting the holes on top of the handguard of the weapon. As you can see in the picture above, I have tried to cut holes into the handguard (The marked mesh in edit mode) with the object above it (The multiple cylinder one). But I simply can't. I have tried the Boolean modifier but the handguard just disappears and doesn't make any holes. Same with the Knife Project thing. Nothing works, it won't make a hole in it. I also installed the BoolTool 0.2 but that didn't work either...The multiple cylinder object goes invisible and doesn't make any cuts. In the picture above you can see how I want the cuts to be made. I want the holes of the multiple cylinder object to be there on the handguard when I take it away. Nothing works. The 3 methods I tried with worked on other parts of this model but not on the handguard. It should be the handguards mesh's fault but I can do nothing about it. Is there any solution? |
I study statistics and not physics, but I am interested in the role probabilities have within physics, e.g. within classical mechanics. I wonder whether it is possible to understand classical mechanics (or any other physical field that is based on probabilities) with basically no pre-knowledge of physics? And if so how would you recommend me to approach this topic. My main interest is the philosophical interpretation of probabilities (are probabilities objetive, etc.) and I am currently reading the book "Probabilities in physics" (2011) which is sometimes hard to follow without an understanding of quantum mechanics, statistical mechanics, etc.. What I hope for is that an understanding of statistical mechanics will improve my understanding of probabilities. So my question is basically which books would you recommend to achieve this goal? Or which topics would you reccoomend me to try to understand? | I learned thermodynamics and the basics of statistical mechanics but I'd like to sit through a good advanced book/books. Mainly I just want it to be thorough and to include all the math. And of course, it's always good to give as much intuition about the material. Some things I'd be happy if it includes (but again, it mostly just needs to be a clear book even if it doesn't contain these) are: As much justifications for the postulates if possible, I'm very interested in reading more about how Liouville's theorem connects to the postulates. Have examples of calculating partition functions, hopefully not just the partition function for the ideal gas. |
In it is explained that s * n or n * s means items in the sequence s are not copied; they are referenced multiple times. I am able to get that theoretically but unable to understand the example they have given: >>> lists = [[]] * 3 >>> lists [[], [], []] # Output >>> lists[0].append(3) >>> lists [[3], [3], [3]] # Output I am confused because if we do the similar thing with strings, it behaves differently as: list_of_str = (["str"] * 3) print(list_of_str) list_of_str[0] = "str_1" print(list_of_str) | I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3 The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]] Then I changed one of the innermost values: my_list[0][0] = 5 Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]] which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it? |
I can change the twitter setting on iOS 6, but in the latest version of Twitter on iOS 7, there is no "Turn on notification" button in the user's setting. How can I set this? This is how to on iOS 6 | On my iPhone, I'd like to get a push alert when there's a new tweet from a twitter account. How can I achieve this? |
I have done binary logistic regression for a dichotomous outcome and used 5 predictors (3 continuous and 2 dichotomous); one of the dichotomous predictor gave a big number of OR and 95% CI (108.28, CI= 6.64- 1764.6, $p < .001$). Is such a big number okay to report, or is something wrong? Sample size was 55 cases. By the way, the continuous independent variables were linearly related to the logit of the dependent variable. I tested this Box-Tidwell procedure by adding the interaction terms between the existing continuous independent variables and their natural log transformations to the logistic regression, and they were nonsignificant. | If you have a variable which perfectly separates zeroes and ones in target variable, R will yield the following "perfect or quasi perfect separation" warning message: Warning message: glm.fit: fitted probabilities numerically 0 or 1 occurred We still get the model but the coefficient estimates are inflated. How do you deal with this in practice? |
I am using system() and need this in a string format. What is the best way to approach this? int main () { system("systeminfo"); string id = std::to_string(system("whoami")); //Doesn't work system("ipconfig"); return 0; } | I am looking for a way to get the output of a command when it is run from within a C++ program. I have looked at using the system() function, but that will just execute a command. Here's an example of what I'm looking for: std::string result = system("./some_command"); I need to run an arbitrary command and get its output. I've looked at , but I have not found anything that will give me what I need. |
Imagine you have a container ship with an extremely heavy mass on it. Why does the water level on the ship drop when the mass is placed in water? | This comes from a brain teaser but I'm not sure I can solve it: You are in a rowing boat on a lake. A large heavy rock is also in the boat. You heave the rock overboard. It sinks to the bottom of the lake. What happens to the water level in the lake? Does it rise, fall or stay the same? I'd say that the water level drops, because when you drop the stone in the lake, the water level rises according to the volume of the stone, BUT the water level decreases by a volume of water weighting the stone's weight, when you take it off the boat. Is that correct? |
Ubuntu reports in dmesg: DMI: Hewlett-Packard HP ProDesk 490 G1 MT/18EB, BIOS L02 v02.01 09/22/2013 But I cannot find information about this anywhere. I do can check (almost) every single piece of hardware (various chips, the controllers, the ethernet, the audio and so on) but that's not the motherboard. Every motherboard make and model is actually unique. Whatever tool I'd use I wouldn't get any more details from what the kernel. I do know what is my hardware (read the quoted text). I simply don't know anything more than the bare name. I would like to know, for example, the chipset brand/model and other MB-related stuff. No way, no matter the tool I use. How can I know details about the motherboard I am using without opening the case? Is there anyone knowing anything about it? Or simply, this cannot be done even in the twenty first century? | Is there any built-in software or terminal method allowing me to view the hardware profiles on my system? Windows equivalent of such a feature would be Device Manager. |
Is there a way to make the folders tagged in any color (red, blue, purple, etc.) appear in a more visible way than the OSX 10.9 way? For instance, on OSX 10.8, the whole title of the item was colored. A long time ago (System 7), even the color of the folder was changed. | I don't like the almost invisible little colored dots (tags) that have replaced the full-length color highlighted labels used in Mountain Lion. Is there a way to go back to using full-field labels? |
Will the limit as x approaches infinity of a polynomial over an exponential ever tend to infinity? I know the limit as x approaches infinity of x^2/e^x tends to 0, but will we ever be able to generate a power to the x large enough that it dominates over the exponential and doesn't tend to 0? | In other words, how to prove: For all real constants $a$ and $b$ such that $a > 1$, $$\lim_{n\to\infty}\frac{n^b}{a^n} = 0$$ I know the definition of limit but I feel that it's not enough to prove this theorem. |
If I connnect a external drive to a computer that has viruses, and somehow these viruses get on the external drive, like someone copying infected files on it or whatever, and then I connect this drive to a clean computer, can that computer get the virus? I mean just by connecting the drive. I know that the drive has infected files so obviously I won't run any program from it, but I still need to connect the drive so I can erase the files. I also know that having a anti-virus installed would be the safest method but I'd like to avoid going trough the process of installing annoying anti-virus software if possible. | Someone told me that it's possible for a virus to run itself from Flash memories even if autorun.inf is not present or this feature is disabled using gpedit.msc. He said a virus can run itself as soon as I plug in a flash memory. Is it correct? |
My LaTeX document does not properly represent German character. In my opinion, I have my preamble set correctly. what needs to be set correctly, so that the characters such as Ä, ß, etc. are represented? My preamble: \usepackage{lmodern} \renewcommand{\sfdefault}{lmss} \renewcommand{\ttdefault}{lmtt} \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc} \usepackage{fancyhdr} \pagestyle{fancy} \setcounter{secnumdepth}{3} \setlength{\parskip}{\medskipamount} \setlength{\parindent}{0pt} \usepackage{babel} \usepackage{amsmath} \usepackage{amssymb} \usepackage{graphicx} \usepackage{nomencl} and the document settings: \documentclass[12pt,a4paper,english,ngerman,intoc,bibliography=totoc,index=totoc,BCOR10mm,captions=tableheading,titlepage,fleqn]{scrbook} | I assume this is really basic question, I'm new to LaTeX, I read a first step tutorial to get ready to write some documents but I couldn't answer my own question at this time and I really don't know where to search. When I try to write é and compile my document, this character is not shown. I know the sequence is \'e to make it happen in the document but that is really disturbing to write. Is there someway to write a paragraph "normally" and convert all the special chars into the LaTeX syntax? Or is there a way to allow é, à, ... writing so the compilation includes them into the document? |
I'm running a couple web applications on the same set of servers. In my logs across a number of different queries in both apps (as well as calls to the ASPState session state database) I see errors similar to the following: System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The wait operation timed out.) ---System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out&#xD;&#xA; at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal&amp; connection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource 1 retry, DbConnectionOptions userOptions, DbConnectionInternal&amp; connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource 1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal&amp; connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource 1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource 1 retry) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource 1 retry) at System.Data.SqlClient.SqlConnection.Open() at One web application is fairly heavily accessed (~500 requests/sec) and one is very lightly used. I see the errors in the logs for both apps, so it seems to be an environment issue as opposed to a specific app. The server setup is 4 web servers behind a load balancer connected to 2 SQL servers in an AlwaysOn availability group. All of this is running in Azure. Lots of searching, but can't seem to find anything that helps either identify the cause or even narrow it down to a SQL configuration issue vs Azure configuration vs network connectivity issue vs clustering issue vs ??? As best I can tell it can't connect either because it can't find the network path or the server can't accept connections. Any help would be appreciated. Thanks! | We're running a couple SQL servers in Azure that are set up with an Always On availability group and Windows Failover Clustering. The servers are Windows 2019 and we're running SQL Server 2019. When we set up the cluster, it was set up to use a Distributed Network Name instead of a static cluster IP address. Thanks to this we shouldn't need an internal load balancer according to these notes: . I'm struggling to understand exactly how this works though. Based on what I read, it seems like our connection strings will point to the DNS name of the cluster (let's call it AgCluster). If I look in DNS, there is an A record for AgCluster pointing to sql1 and another pointing to sql2. When I use AgCluster in my connection string it seems to always connect me to the primary server, even if I have ApplicationIntent=ReadOnly set. When I query @@SERVERNAME I always get the same server. So with the Distributed Network Name setup, what should I use in my connection strings to make sure read/write queries go to the primary and read only go to a secondary? Any guides on setting this up in general would be helpful. Thanks! |
I am supposed to use this fact to help prove it. If $p$ is an odd prime, then at least one of the numbers $2,5,10$ is a quadratic residue mod $p$ I can prove this by saying let $(\frac{10}{p}) = 1$ Then $(\frac{2}{p}) = -1$ $(\frac{5}{p}) = -1$ let $(\frac{10}{p}) = -1$ Then $(\frac{2}{p})$ or $(\frac{5}{p}) = 1$ So to start off we know that p is a odd prime $>11$ $2,5$ or $10$ is a quadratic residue of p I am assuming the best way to start this is to say Let $(\frac{2}{p}) = 1$ where $p>11$ Then try to show that $(\frac{3}{p}) = 1$ where $p>11$ is a quadratic residue Then do the same for the other two. But i am unsure about how to go about this | For any prime $p\gt 5$,prove that there are consecutive quadratic residues of $p$ and consecutive non-residues as well(excluding $0$).I know that there are equal number of quadratic residues and non-residues(if we exclude $0$), so if there are two consecutive quadratic residues, then certainly there are two consecutive non-residues,therefore, effectively i am seeking proof only for existence of consecutive quadratic residues. Thanks in advance. |
Let $R$ be a Noetherian ring and $x\in R$ an $R-\mathrm{regular}$ element. Show that $\mathrm{Ass}_R(R/(x^n))=\mathrm{Ass}_R(R/(x))$ for every $n\geqslant 1$. Let $M$ be an $R-\mathrm{module}$. An element $a\in R$ is called a non-zero-divisor on $M$ or $M-\mathrm{regular}$ if whenever $x\in M$ and $ax=0$, then $x=0$. | Let $A$ be a Noetherian ring and let $x \in A$ be an element which is neither a unit nor a zerodivisor. Why the ideals $xA$ and $x^{n}A$ (where $n \in \mathbb{N}$) have the same prime divisors? i.e. $$\operatorname{Ass}(A/xA) = \operatorname{Ass}(A/x^{n}A).$$ (Matsumura, Commutative Ring Theory, Exercise 6.3) |
find this limit $$\lim \limits_{x\to+\infty}e^{-x}\left(1+\dfrac{1}{x}\right)^{x^2}$$ my idea: $$\lim \limits_{x\to+\infty}e^{-x}\left(1+\dfrac{1}{x}\right)^{x^2}=\lim \limits_{x\to+\infty}e^{-x}\cdot e^x=1$$ But book is answer is not 1? and How about find it? Thank you | Can someone show me how to calculate the limit: $$\lim_{x \to \infty }\left(\frac{1}{e}\left(1+\frac{1}{x}\right)^x\right)^x $$ I tried to use taylor series but failed. Thanks |
I followed these steps to install Apache 2.4.2 in Ubuntu 12.04, but it seems Apache is not installed, here's what I did (I followed the steps on this site ): sudo apt-get install build-essential sudo apt-get build-dep apache2 wget http://apache.mirrors.pair.com/httpd/httpd-2.4.2.tar.gz tar -xzvf httpd-2.4.2.tar.gz && cd httpd-2.4.2 sudo ./configure --prefix=/usr/local/apache2 --enable-mods-shared=all --enable-deflate --enable-proxy --enable-proxy-balancer --enable-proxy-http --with-mpm=prefork sudo make sudo make install when I tried to start by issuing sudo /usr/local/apache2/bin/apachectl start at terminal, I got the following warning: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message" and when I typed **top** at terminal, the apache is not there. I also tried to go to <CODE>http://localhost/</CODE> or 127.0.0.1 or even 127.0.1.1 it showed "Can't establish connection to server ..." message. P.S.: I checked the error log and it showed [Fri Jul 27 15:49:00.703901 2012] [proxy_balancer:emerg] [pid 20781] AH01177: Failed to lookup provider 'shm' for 'slotmem': is mod_slotmem_shm loaded?? [Fri Jul 27 15:49:00.704083 2012] [:emerg] [pid 20781] AH00020: Configuration Failed, exiting What am I missing? | I need to install the latest versions of apache, php and mysql that are available on their websites, but the problem is that apt repositories don't have these updates versions yet. Versions that I want: Apache 2.4.4, PHP 5.4.16 and MySQL 5.6.12. Versions available via apt: Apache 2.2.22, PHP 5.4.15, MySQL 5.5.31. Ubuntu doesn't support the above versions of packages. Please, I want help! Thanks! P.S. Tasksel also doesn't have these versions of packages yet. |
I often use cd - to go back to where I was. How can I do this multiple times in bash? Or would zsh or some other tool support this? | cd - can move to the last visited directory. Can we visit more history other than the last one? |
I have four tables on one line that I would like to refer to as separate figures. I would like them to appear like this: This is how the tables currently appear: \begin{table}[h!] \medskip \begin{tabular}{|c|c|c|} \hline -1 & -1 & -1 \\ \hline 2 & 2 & 2 \\ \hline -1 & -1 & -1 \\ \hline \end{tabular} \hfill \begin{tabular}{|c|c|c|} \hline 2 & -1 & -1 \\ \hline -1 & 2 & -1 \\ \hline -1 & -1 & 2 \\ \hline \end{tabular} \hfill \begin{tabular}{|c|c|c|} \hline -1 & 2 & -1 \\ \hline -1 & 2 & -1 \\ \hline -1 & 2 & -1 \\ \hline \end{tabular} \hfill \begin{tabular}{|c|c|c|} \hline -1 & -1 & 2 \\ \hline -1 & 2 & 1 \\ \hline 2 & -1 & -1 \\ \hline \end{tabular} \captionof{figure}{Masks for line detection} \label{table:mul} \end{table} I want to caption each of the tables with (a) text, (b) text, ect. What is the proper way to do this, so that I can caption each of the tables, but referenced as figures? | I have a figure (lets say a picture of a couple ) for which I want two subcaptions (1 a that will be under the first half of the figure and will show the man and 1 b that will be under the second half of the picture and will show the woman). I underline that there is only one figure that I want to caption as if there were two. |
Even after doing the change in the Settings > Brightness & Lock, by increasing the value for Turn screen off when inactive for to 5 minutes, it didn't work. I did try the other options there as well. I've already gone through the steps in this . Is this a current bug, or is there any hack to prevent this? Any help would be appreciated. | I would like to have my screen fully powered at all times, but it goes to standby once I lock my PC. |
On a default Ubuntu (15.04) installation, We have 7 TTYs that we can switch with Ctrl+Alt+F1 (or F2 - F7), where TTY1-6 are terminals and TTY7 is the graphical X session. I would like to have more than one TTY with graphical login, so e.g. make TTY6 an additional GUI terminal. Is this possible and if yes, how do I set it up and are there restrictions (like don't log into the same account graphically twice)? And when I manually start an x session in a TTY, how do I quit that graphical session again afterwards and revert the TTY back to a terminal? | I want to have more than one user logged on at the same time, on the same computer. Each user should have a full X session. It is easy enough to log in to multiple concurrent non-X Linux terminals, but I want the X factor. Maybe I've missed something, but I only see a Main Menu option to Log out of the current user, and nothing for Switch User. Is there a simple way to do this? |
Does anyone know how I can install the Ubuntu updates (equivalent of sudo apt-get updateand sudo apt-get upgrade) without an internet connection at that machine? I've got internet at home, but not at the remote site. I also would like to do do-release-upgrade. This isn't a duplicate since I'm trying to update everything, similar to apt-get upgrade. | I have a friend who has got a computer that is not connected to the Internet. Is there any way to install software offline easily? |
Evaluate $$\int_0^{\infty} \frac{\ln{\left(x^4+1\right)}}{x^2+1} \; \mathrm{d}x$$ I tried $x=\tan{t}$, $t=\frac{1}{x}$, factoring $x^4+1$ and split the log, and more. This didnt go anywhere though. Ideas? Maybe complex analysis would be best here? | How to evaluate these two integrals below $$\int_{0}^{\infty }\frac{\ln\left ( 1+x^{4} \right )}{1+x^{2}}\mathrm{d}x~,~\int_{0}^{1}\frac{\arctan x}{x}\frac{1-x^{4}}{1+x^{4}}\mathrm{d}x$$ For the first one,I tried to use $$\mathcal{I}'(s)=\int_{0}^{\infty }\frac{x^4}{(1+sx^4)(1+x^{2})}\mathrm{d}x$$ but it seems hard to solve. |
Why on assigning value to a specific index in 2d array of python, changes all the index with the value? def binomial_coff(n, k): inter = [[-1]*(n+1)]*(n+1) for i in range(n+1): inter[i][0] = 1 inter[i][i] = 1 print(inter) for i in range(2, n+1): for j in range(1, i): inter[i][j] = inter[i-1][j-1] + inter[i-1][j] print(i, j, inter[i][j], inter[i-1][j-1], inter[i-1][j]) print(inter) return inter[n][k] I had tried the block in jupyter notebook and repl.it | I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3 The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]] Then I changed one of the innermost values: my_list[0][0] = 5 Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]] which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it? |
If $A$ and $B$ are sets, and $A$ is an element of $B$ does this mean that every element of $A$ is in $B$, or some element of $A$ is in $B$, still makes $A$ element of $B$? | I have to prove a few different statements. The first is if $A \subset B$ and $B \subset C$ then prove $A \subset C$. This one is fairly straight forward, but I'm stuck on how the next one differs. Prove that if $A \in B$ and $B \in C$ then $A \in C$. I don't really understand how to put this in logical symbols. I've only seen $a \in A$ written out but never "a set $A$ is an element of a set $B$". Here's what I have for a proof at this point, assuming I understand what "a set $A$ is an element of a set $B$" means: suppose $A \in B$ and $B \in C$. Then $A \in C$. |
Let we have the following sequence $$x_n=\left(\frac{n^n}{n!}\right)^{\frac{1}{n}}$$ Determine if the following sequence is convergent and find its limit | I'm trying to find $$\lim_{n\to\infty}\frac{n}{\sqrt[n]{n!}} .$$ I tried couple of methods: Stolz, Squeeze, D'Alambert Thanks! Edit: I can't use Stirling. |
I have a set of commands that i am executing through java. I stored them in .bat file and then executing through java. When i run bat file through command prompt it executes but when i execute it through java, only 1-2 commands execute and program exits. Please suggest me the solution for this. Please suggest me the jar file too if any other command referenced Code: public static String cmdExec(String cmd) throws IOException { Process p = Runtime.getRuntime().exec(cmd); } | In my Java application, I want to run a batch file that calls "scons -Q implicit-deps-changed build\file_load_type export\file_load_type" It seems that I can't even get my batch file to execute. I'm out of ideas. This is what I have in Java: Runtime. getRuntime(). exec("build.bat", null, new File(".")); Previously, I had a Python Sconscript file that I wanted to run but since that didn't work I decided I would call the script via a batch file but that method has not been successful as of yet. |
Apologies if this question has already been answered somewhere already. Is there somewhere I can view a list of tags which have been burninated/blacklisted from certain sites? UPDATE: I'm building a script which tags documents with relevant Stackoverflow tags. I was seeking a way of excluding at least some meta/unhelpful/ambiguous tags from my corpus of tags, to get rid of some noise in my data. Shadow Wizard's suggestion basically provides what I need. | Would it be possible to make the list of blacklisted tags public? The list would help establish precedence when determining if a tag should be put forward for burnination. This will simplify the task of proposing and evaluating a . For example, when I come across a tag I believe shouldn't be used, I in a hope of finding burninated tags that are similar. If I find something similar, I submit a burnination request; otherwise I simply clean up the tags and move on. Having a definitive list will substantially speed up this process. |
I have created a 2D array to store double values,on executing the below code the decimal range of some values are getting modified unexpectedly ! package learnJavaProj; public class SquareRootin2D { public static void main(String[] args) { double [][] arr = new double[10][10]; double f= 0.00; double g=0.00; for(int i=0;i<10;i++) { for(int j=0;j<10;j++) { arr[i][j]=0.00; } } for (int i=0;i<10;i++) { arr[i][0]=f; arr[0][i]=g; g=g+0.10; f++; } for(int i=0;i<10;i++) { for(int j=0;j<10;j++) { System.out.print(arr[i][j]+" "); } System.out.println("\n"); } } } Output : 0.0 0.1 0.2 0.30000000000000004 0.4 0.5 0.6 0.7 0.7999999999999999 0.8999999999999999 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 4.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 5.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 6.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 7.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 8.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 9.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 This kind of fluctuation appeared while using float too ! Kindly explain this chaos. Thank You ! | Consider the following code: 0.1 + 0.2 == 0.3 -> false 0.1 + 0.2 -> 0.30000000000000004 Why do these inaccuracies happen? |
How can I get the right answer to the 3rd squirrel question ("how many candies" etc.), as I am gaining 21 of them each second and I am not very good at mental calculus? ;) | I encountered The Squirrel at "A tree." | | | | " Hello, I'm The | | Squirrel. I can | | provide you candies, | | and lots of things. | I know how much you | _.-'''-, love candies. But I | .' `\ feel alone in this | / / forest. " | | / .--^_^ | | | / C ,,\ | | | \ _.) ___ | \ | / \ ____.----'.-' | '-, \./ \)\) .-' -- __.-' | \ `-/ );/ ___/ - _.-' | \_________''--'-'________.-' -- / | - -- - - - __.-' - -- - -- -- / _________________________.-' He asks you some questions. What are the correct answers, and what is the reward for getting them correct? |
Me getting a hangover is nothing like her getting a hangover. - I'd rather contemplate you singing than him singing. Is this grammatically correct? | I assume that the following sentences are grammatically correct: He resents your being more popular than he is. Most of the members paid their dues without my asking them. They objected to the youngest girl's being given the command position. What do you think about his buying such an expensive car? We were all sorry about Jane's losing her parents like that. I'm still getting used to this possessive gerund structure. It sounded so weird to me at first. Is the structure used in both formal and informal contexts? Are there any alternative structures that result in the same meaning and are more frequently used? (Examples taken from ) |
Consider the following 3D potential: $$V(r)=\begin{cases}-V_0 \ \ \ \ \ \ & r \leq a\\ 0 &r > a\end{cases}$$ we want to find the eigenfunctions for $\ell=0$, in particular we are interested in the bounded states. Of course we get: $$\left[\frac{p_r}{2m}+V(r)\right]R(r)=ER(r)$$ and so with: $$u(r):=rR(r)$$ $$-\frac{\hbar ^2}{2m}u(r)+V(r)u(r)=Eu(r)$$ so for bounded states we get: $$u(x)=\begin{cases}A\sin{\alpha r}+B\cos{\alpha r} \ \ \ \ \ \ & r \leq a\\Ce^{-\beta r} & r > a\end{cases}$$ I kind of breeze trough this introductory part, I hope it's all clear. Now I have a problem: I would like to impose continuity and continuity of the derivative in $a$, to get more information about the shape and the energy of the solution, in particular I would like to find the number of bounded state in function of the value of $V_0$; but the calculation that derives from this procedure seems pretty hard. But: looking for the resolution for this exercise I found out that $u(r)$ must be $0$ in $r=0$, and this of course implies that in the first region the function becomes a $\sin$. $$u(x)=\begin{cases}A'\sin{\alpha r} \ \ \ \ \ \ & r \leq a\\Ce^{-\beta r} & r > a\end{cases}$$ and this, other than being the correct system of equations, greatly simplify the calculations. However: I don't understand why $u(r)$ must be zero in $r=0$. So my question is: Why must $u(r)$ be zero in $r=0$? | I was playing around with a 3-D potential $V$ such that $V_{(r)} = 0$ for $r<a$, and $V_{(r)} = V_0>0$ otherwise. By using the Schrödinger Equation, I showed that: $$\frac{-\hbar}{2m}\frac{1}{r^2}\frac{d}{dr}\bigl( r^2\frac{d}{dr}\bigr)\psi = E\psi$$ I then used the substitution $\psi_{(r)}=f_{(r)}/r$ and $k=\sqrt{2mE}/\hbar$ to get: $$\frac{1}{r}\frac{d^2f_{(r)}}{dr^2}=-\frac{k^2}{r}f_{(r)} \tag{I}$$ which describes the wavefunction $\psi_{(r)}=f_{(r)}/r$ inside the sphere. Hence, the differential equation has the domain $0\leq r<a$, and I cannot multiply both sides by $r$. This is unfortunate, because there is a similar equation for the outside of the sphere: $$\frac{1}{r}\frac{d^2f_{(r)}}{dr^2}=\frac{k'^2}{r}f_{(r)}$$ As this is outside the sphere, I can multiply both sides by $r$ to get a familiar differential equation that can be solved easily: $$\frac{d^2f_{(r)}}{dr^2}=k'^2f_{(r)}$$ If I do the same thing to $(I)$, I obtain the equation for simple harmonic motion, but substituting the solution back into $(I)$ as a sanity check gives a division by zero when evalutating for $r=0$. After that, I tried a number of substitutions to make $(I)$ have a more recognisable form - to no avail. Then I had the idea of multiplying my trial solution by some other function of $r$ so that upon substitution into $(I)$, the evaluation of $r=0$ doesn't give an infinity... but I don't know quite how to do that... Long story short..... my question is: what trick do I need to get a meaningful solution to $(I)$? |
I am new to vi editor.I am using to edit one of my file. But when i opened it through vi i can't edit it properly. when pressing arrowkeys it inserts alphabets(toparrow-A,bottomarrow-B,leftarrow-D,rightarrow-C).I dont know what is happening? How to solve this problem? | Recently I installed ubuntu in my laptop for using c programming. but when I open the terminal and typed vi test.c, It open it but it will not work properly. when i pressed backspace it will not work and when i press arrow key it will print some alphabets. What will i do to work properly. please anybody help for this related problem. thank you |
$f(x)$ is defined on$(0,\infty)$, and $\frac{f(x)}{x}$ is monotone decreasing, how to prove $\forall a>0,b>0$ $f(a+b)\leq f(a) +f(b)$. Thanks pretty much in advance | If $\frac{f(x)}{x}$ is decreasing in $(0,\infty)$, prove that $f(a+b) \leq f(a) + f(b)$ for $a,b >0$ |
The post editor image uploader supports drag-and-drop and it also supports pasting an image directly into the window. The chat uploader does support drag-and-drop (as long as you drop directly into the filename text box) but does not support pasting an image into the window. Can chat get the same that the sites have? | We've already got it for questions and answers. Let's get it for chat too! Most of my images come from screen captures so this would be really great! |
In the Harry Potter world, we see many forms of continuation beyond death -- ghosts, portraits, and even newspaper clippings appear to retain some part of the personality of the original person. However, they all appear to be mere echoes of the original. Despite this, ghosts and portraits continue to learn and act as the original, and thus may be considered indistringuishable from the outside. Enter the Resurrection Stone. This Hallow supposedly brings back the souls of the dead, allowing discussion (and tearful moments for our hero, who then... purposefully loses it in a forest). However realistic these spirits are, they don't appear to have any special features that differentiate them from the other magical constructs, so how does one know that they are the actual, unique soul of the original person? Granted the nature of the Hallows -- being either unique artifacts of unique power, or merely super well enchanted items with standard powers, it would be fitting for the "spirits" to merely be duplicates, as in the case of paintings and ghosts. Is there any proof (via word of god, most likely) that the Resurrection Stone actually brings back the actual spirit of the person called? | Dumbledore himself said that no spell can reawaken the dead. Isn't that the main objective of the resurrection stone? If one can't reawaken the dead then what is the use of the stone? Surely then one of the Hallows is flawed? |
I'm trying to prove (using induction) that: $$\sum_{k=1}^n \frac{1}{n+k} = \sum_{k=1}^{2n} \frac{1}{k}(-1)^{k-1}.$$ I have found problems when I tried to establish an induction hypothesis and solving this because I've learned to do things like: $$ \sum_{k=1}^{n+1} \frac{1}{k}= \sum_{k=1}^{n} \frac{1}{k} + \frac{1}{n+1}.$$ But, in this case, $n$ appears in both parts of summation and I have no idea how make a relation with $$\sum_{k=1}^n \frac{1}{n+k} $$ and $$\sum_{k=1}^{n+1} \frac{1}{n+1+k}. $$ Because I've seen tha, the case with "$n+1$" should be like: $$\sum_{k=1}^{n+1} \frac{1}{n+1+k} = \sum_{k=1}^{2n+2} \frac{1}{k}(-1)^{k-1}$$ and I cant find a connection between $$\sum_{k=1}^{n+1} \frac{1}{n+1+k} $$ and $$\sum_{k=1}^{n} \frac{1}{n+k}.$$ Could anyone help me with this? | The title pretty much summarizes my question. I am trying to prove the following: $$\displaystyle \forall N \in \mathbb{N}: \sum^{2N}_{n=1} \frac{(-1)^{n-1}}{n} = \sum^{N}_{n=1} \frac{1}{N+n}.$$ I tried proving this using induction. Starting with the base case $N = 1$: $$\displaystyle \sum^{2}_{n=1} \frac{(-1)^{n-1}}{n} = \frac{1}{1} + \frac{-1}{2} = \frac{1}{2} = \frac{1}{1+1} = \sum^{1}_{n=1} \frac{1}{N+n}.$$ My problem is the inductive step for $N+1$, starting with $$\displaystyle \sum^{2(N+1)}_{n=1} \frac{(-1)^{n-1}}{n} = \sum^{N+1}_{n=1} \frac{1}{(N+1)+n}.$$ And now my problem: \begin{align} \sum^{2(N+1)}_{n=1} \frac{(-1)^{n-1}}{n} &\Leftrightarrow \sum^{2N}_{n=1} \frac{(-1)^{n-1}}{n} + \sum^{2}_{n=1} \frac{(-1)^{n-1}}{n} \\[1em] &\underset{\Leftrightarrow}{\text{ind. hyp.}} \sum^{N}_{n=1} \frac{1}{N + n} + \sum^{2}_{n=1} \frac{(-1)^{n-1}}{n} \end{align} Is this the correct start, and if so, how do I continue? |
Maybe an illegal question. Sorry. Having read that a photon has both wave and a light characteristics it is natural for a novice like myself to wonder "what is the amplitude? " Naturally I have looked on wiki and other sources and there are a number of answers some of which appear not so much to contradict one another of varying opinions of which is the most meaningful in physics. I seem to get a higher number of physics sources saying the amplitude depends on how many photons you have and if you have one the question has no meaning. Of course I have not idea if this is accurate or how one would even test this. Maybe there are some physics teachers in the audience that can give me a layman's intuition with a little math tossed in. | Referring to this question I'm curious about what is a amplitude of a light wave. Especially for light from a thermic source. |
I have a with shapelength and shapearea, and would like to convert to WGS84 to use with ggmap. Eventually, I would like to get plot google map of individual regions of the shapefile, and overlay it with other date What can I use in R program to do this, i.e. convert to WGS84? | I have a number of shapefiles in different CRSs (mostly WGS84 lat/lon) that I'd like to transform into a common projection (likely Albers Equal Area Conic, but I may ask for help on choosing in another question once my problem gets better-defined). I spent a few months doing spatial stats stuff in R, but it was 5 years ago. For the life of me, I cannot remember how to transform an sp object (e.g. SpatialPolygonsDataFrame) from one projection to another. Example code: P4S.latlon <- CRS("+proj=longlat +datum=WGS84") hrr.shp <- readShapePoly("HRR_Bdry"), verbose=TRUE, proj4string=P4S.latlon) # Shapefile available at # http://www.dartmouthatlas.org/downloads/geography/hrr_bdry.zip # but you must rename all the filenames to have the same # capitalization for it to work in R Now I have a SpatialPolygonsDataFrame with appropriate projection information, but I'd like to transform it to the desired projection. I recall there being a somewhat unintuitively-named function for this, but I can't remember what it is. Note that I do not want just to change the CRS but to change the coordinates to match ("reproject", "transform", etc.). Edit Excluding AK/HI which are annoyingly placed in Mexico for this shapefile: library(taRifx.geo) hrr.shp <- subset(hrr.shp, !(grepl( "AK-" , hrr.shp@data$HRRCITY ) | grepl( "HI-" , hrr.shp@data$HRRCITY )) ) proj4string(hrr.shp) <- P4S.latlon |
I have a kind of problem. I am trying to hard-link all my dotfiles [files that customize certain apps] in one folder for ease of use, called ~/dotfiles/ , but multiple programs that I have, have entire directories for that. Some are in .config, some just have a directory at the home folder, so I tried to check whether I could hard-link a directory. After looking into it, I saw all the problems, warning, etc. about hard-linking directories, and why it's a giant nono. So I'm fully discouraged from hard-linking directories, however, I still need to do it somehow. I found a way around this, which is by creating directories within ~/dotfiles/ and hardlinking the contents of the directories INTO those created ones, but that immediately hit a brick wall called boredom and repetition. A bunch of programs had multiple dirs, some with nested directories, and I didn't feel like spending a lot of time creating directories just so that I'm able to hard-link config files. All I'm wondering is this. Is there a way to simulate a hard-link? For example, I have a directory called ~/Testconfig/, and I want to hard-link it into ~/dotfiles/. Theoretically, a hardlink would place a directory in ~/dotfiles/ with all of it's contents, including its files and its nested directories. Is there a way to achieve that without actually creating a hardlink? My idea is that a bash script could be made that automates all of this, but I know next to nothing about bash, so that would be difficult. | The example below is simplified to show the core of the problem, not the problem itself(my file tree is more complicated than that). Let's say that I have two files I want to back up; one in ~/somedir/otherdir, the other in ~/otherdir/somedir/. I want to backup files from both directories in one git repository. How can I do this? Soft links only carry information about where file is stored, not the actual file, whereas hard links are somewhat foreign to me. Is this a case where hard links should be used? Clarification: I want to use git because of four reasons: I want to store dotfiles/scripts/configurations that are text files and keep track of changes over time, I know git, I have a private git repository I could use to store them, and I want to be able to share these files across multiple PCs. |
Let $( | )$ be the standard inner product on $\mathbb{R^2}$ , and let $T$ be the linear operator $T(x_1,x_2)=(-x_2,x_1)$. Now $T$ is 'rotation through $90°$' and has the property that $(\alpha |T\alpha)=0$ for all $\alpha$ in $\mathbb{R^2}$ . Find all inner products $[ | ]$ on $\mathbb{R^2}$ such that $[\alpha | T\alpha]=0$ for each $\alpha$. My Attempt since $\alpha\in \mathbb{R^2}$. So let us assume $\alpha=(x,y)$ then $(\alpha |T\alpha)=((x,y) | T(x,y))=-xy+xy=0$ where $x,y\in \mathbb{R}$. So I think we have as many inner product on $\mathbb{R^2}$ as positive real numbers in $\mathbb{R}$. Is it correct? Any help or hint will be appreciated. | Suppose that we are dealing with the real field $\mathbb{R}$ and we define $T:\mathbb R^2\to\mathbb R^2$ by $$T(u,v):=(-v,u).$$ It is trivial to see that $\langle(u,v),T(u,v)\rangle = 0$ for all $u, v \in \mathbb{R}$, where $\langle \, \cdot \, , \, \cdot \, \rangle$ is the standard inner product. A question in Hoffmann-Kunze asks us to define all possible inner products $[ \, \cdot \, , \, \cdot \, ]$ such that $[\alpha, T(\alpha)]=0$ for all $\alpha\in\mathbb R^2$ and $T$ is as above. How does one find all such inner products? |
I upgraded to Ubuntu 18.04. I have Dbvis (DbVisualizer - database editortu) installed, but now it will not work. I get the following when I run dbvis from the command-line: java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper at java.awt.Toolkit.loadAssistiveTechnologies(Toolkit.java:807) at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:886) at java.awt.Toolkit.getEventQueue(Toolkit.java:1736) at java.awt.EventQueue.invokeLater(EventQueue.java:1294) at javax.swing.SwingUtilities.invokeLater(SwingUtilities.java:1295) at com.onseven.dbvis.DbVisualizerGUI.main(Z:594) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:85) at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:62) :~$ java -version openjdk version "10.0.2" 2018-07-17 OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1) OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1, mixed mode) :~$ javac -version javac 10.0.2 Any thoughts on how to resolve this? Thanks for any help. | $ java -jar aprof-plot.jar Exception in thread "main" java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper at java.awt.Toolkit.loadAssistiveTechnologies(Toolkit.java:807) at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:886) at java.awt.Toolkit.getEventQueue(Toolkit.java:1734) at java.awt.EventQueue.invokeLater(EventQueue.java:1264) at aprofplot.Main.newWindow(Main.java:33) at aprofplot.Main.main(Main.java:359) Possible explanations I saw here was to install Java-access-bridge. But I am unable to install libaccess-java-bridge. |
I've read than in 2014, Google will reward HTTPS sites in ranking. In the other hand, I have also read that HTTPS is slower than HTTP. So, in my site, I just have a few HTTPS pages, so my question is: Should I put all my site in HTTPS, or just the few pages I need? | I would like to set up a new business site. I plan to direct www.example.com to example.com and only use that domain. My plan is also to only use HTTPS and not HTTP. Does this affect the SEO for the site? E.g. do Google put lower or higher rank for sites that is only available via HTTPS? |
John is feeling well. John is feeling good. "well" is an adverb and "good" is an adjective. Is #2 grammatically correct at all or is it ok to construct Subject + Linking Verb + Adjective where adjective is describing the subject? If #2 is grammatical, what is the difference between the two sentences? | Most of the time, I use good and well interchangeably. However, on many occasions I would find well or good a misfit. Please suggest the proper usage. |
I found some sentences like "Most people work by day and sleep by night." Is it appropriate to use these sort of wordings like "sleep by night"? If so, what's difference between "sleep by night" and "sleep at night"? | say by has the meaning of 6. indicating the period in which something happens: ‘this animal always hunts by night’ Then do we need to say, ‘Why does the sky glitter by night?’ And can’t we say, ‘Why does the sky glitter at night?’? If we can use both, what’s the difference between the two? |
In the Android App, one cannot distinguish between normal posts abs community wiki ones. Firstly example, below is a screen shot of a question from the mobile view, and the same from the app: Screenshot from app: Why is there an anomaly like this? This should be edited as fast as possible. | I'm requesting that Community Wiki questions and answers display differently than non-wiki ones or otherwise indicate that they are wikis. Example CW post in browser: How the same post looks in the app: One can clearly see it is impossible to distinguish between CW and regular posts in the Android app. |
On any 18.10 application when I have an open window which is very wide and I then open a new window of same application the new window will auto maximize its size. How can I disable this auto-maximize on new window creation? If it's possible, I wish to disable any type of auto-maximize window behavior I tried following suggested solution from 18.04 which fails to work on 18.10 : Open Terminal and run gsettings set org.gnome.mutter edge-tiling false You may also have to run gsettings set org.gnome.shell.overrides edge-tiling false | Each time I open any application, it zooms to fill-up the entire desktop and so I am always forced to use "Unmaximize" using Alt+Space menu. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.