how to i concatenate strings in objective c?   - (IBAction)emailButton:(id)sender { MFMailComposeViewController *mailContoller = [[MFMailComposeViewController alloc]init]; [mailContoller setMailComposeDelegate:self]; NSString *email = @"*******gmail.com"; NSString *email1 = @"*******@hotmail.co.uk"; NSArray *emailArray = [[NSArray alloc]initWithObjects:email, email1, nil]; NSString *message = [NSString stringWithFormat:@"%@\n%@\n%@", textField1.text, textField2.text, textField3.text]; [mailContoller setMessageBody:message isHTML:NO]; [mailContoller setToRecipients:emailArray]; [mailContoller setSubject:@"IT WORKS!"]; [self presentViewController:mailContoller animated:YES completion:nil]; }  -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [[self myTextView] resignFirstResponder]; }  -(void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error { [self dismissViewControllerAnimated:YES completion:nil]; } @end   any help on this will be greatly appreciated.  thank you

Are there any shortcuts to (stringByAppendingString:) string concatenation in Objective-C, or shortcuts for working with NSString in general?  For example, I'd like to make:  NSString *myString = @"This"; NSString *test = [myString stringByAppendingString:@" is just a test"];   something more like:  string myString = "This"; string test = myString + " is just a test";


Are there any other reliable ways to find cheap, hostel like accommodation last minute, without using hostel world or hostel bookers?   I'm currently finding all accommodation booked up on these two sites :-\

Always when I'm going to travel to someplace, I book my hostel with precedence. Actually I look only for two Booking sites:      Is there a cheaper site than these two, which has the same service with same quality, with the same number or larger?


Is there a good way to check a form input using regex to make sure it is a proper style email address? Been searching since last night and everybody that has answered peoples questions regarding this topic also seems to have problems with it if it is a subdomained email address.

Over the years I have slowly developed a  that validates MOST email addresses correctly, assuming they don't use an IP address as the server part.  I use it in several PHP programs, and it works most of the time.  However, from time to time I get contacted by someone that is having trouble with a site that uses it, and I end up having to make some adjustment (most recently I realized that I wasn't allowing 4-character TLDs).  What is the best regular expression you have or have seen for validating emails?  I've seen several solutions that use functions that use several shorter expressions, but I'd rather have one long complex expression in a simple function instead of several short expression in a more complex function.


Well I've recently learned that the light doesn't always travel in a straight line.it sometimes curve. Therefore, a change of direction could cause a change of speed? Correct me if im wrong please.

We know that gravity speeds up a body; for instance, a meteor which enters the earth gets constantly accelerated up by earth's gravity. And from relativity we know that light bends near a massive body, because Newton's law of gravitation is just an approximation and actually gravity depends on energy and momentum. So my question is: If a ray of light is aimed exactly at the center of a body, then will it get accelerated like a meteor? And if does get accelerated, then won't it surpass the universal speed limit of 3,00,000 km/s (approx.)?


I m relatively a new resident in the US. I opened an account with BofA (oct/2016) and after struggles they approved me for their student secured credit card account (700$). After 4 months I applied for their cash back and I got approved with a credit line of (5000$). After 2 months I got an invitation from discover and I opened another account with a credit line of (5000$) and now they increased it by 1600 more. My credit score FICO keeps showing that it is impacted by the length of oldest account. My question, I really don't use the very first account and I m thinking of closing it, is it going to affect my credit score? If yes, what is the alternative?

I have a bunch of credit cards with no balance, while others have fairly high balances. I'd like to close the 0 balance cards, but I know that will reduce my overall balance and hurt my credit rating, since my ratios of used to unused credit will rise.  Is it ever a good idea to close credit cards?


Any help on this matter would be appreciated.  I have 64 bit 12.04 LTS installed, I am looking for everything needed, step by step order to install 32 bit wine in order to run windows 32 bit software and drivers to connect to USB devices in order to download stored collected data.  Since the end of free support for windows XP is approaching I am jumping to Linux in order to continue using perfectly good hardware.  The drivers can not be upgraded to work with current windows versions, the company has long been out of business.  Why be forced to stop using perfectly good operating hardware when an OS is no longer supported.  I am trying to do this with the currently installed 64 bit 12.04 LTS without having to uninstall the 64 bit and install the 32 bit version or should I just ditch the 64 bit and start over with the 32 version of ubuntu?  I have some experience with linux but am no expert by any means.  Thanks for any help.

I am looking for a step by step instruction to guide me in the ways of installing, configuring and debugging many of the issues new users have when dealing with Wine in Ubuntu.  What is the recommended way of installing Wine, some of the key issues that it has and how to solve them?  If I have a specific problem with an App in Wine, how do I go about solving it? What are the recommended steps to ensure that I can fix a problem related to an app I wish to use?


I'm in US on a student visa, currently expired; my last entry was 3 years ago. I  do have an approved I-797 (H1-B). Can I travel through London without a transit visa? BTW, the layover is 3 hours and I don't need to change the terminal.   I tried applying for transit visa on  but, with my expired student visa on my passport, it doesn't let me go to next step.   Since I can't transit without visa and I need a visa for the UK connection, what should I do?

Is there a website or some other way to find out if I need a transit visa for a short stop in the UK on my way somewhere else? Ideally this should give me the answer for all nationalities, and take into account any other visas I may have.


Following up with this question  and this   I understand that peer reviewing probably started when there were relatively fewer article submissions than today and when the academic system was going at a slower pace and was less cluttered with people.   But given how the system has evolved, I am wondering why do employers let their employee work for free for the monetary benefit of a third party?  As far I as know no employer pays its employees to make someone else rich. It seems against any economics principle. Wouldn't it be more efficient to pay reviewers so they would be more motivated, quicker to review, and universities/grants/governments would not pay someone to work for free for the economic benefit of someone else? This might also offset the cost of salary of professors. Any economic return to the employer seems very low considering the working hours devoted to reviewing.

One of the most criticized aspects of the current publishing scheme, is that academics do pretty much all the work for free and publishers get the money.  Why don't people just charge a fee when contacted by a publisher to referee an article?    I know , that's not the question. The issue is why do it requesting no monetary compensation when the publisher is getting (for doing next to nothing) an .


For $A\subset \mathbb R^n$ let $\mathcal H^s(A)$ be the $s$-dimensional Hausdorff measure with respect to the Euclidean metric. The Hausdorff dimension of $A$ is given by $$\dim_H(A) = \inf\{s>0\mid\mathcal H^s(A)=0\}.$$ One of the go-to curiosities in measure theory courses is the fact the middle-third Cantor $C$ set has Hausdorff dimension $\log2/\log3$. This value is easily determined using a self-similarity argument assuming that $0<\mathcal H^s(C)<\infty$ for some $s$. However, verifying this assumption for $s=\log2/\log3$ is not quite as easy. Thinking about this and other self-similar objects got me wondering about a more general question:      For non-empty, compact $K\subset\mathbb R^n$ of Hausdorff dimension $d$, is it automatic that $0<\mathcal H^d(K)<\infty$? In other words, do non-empty compacta in $\mathbb R^n$ have finite, non-zero Hausdorff measure in their Hausdorff dimension?   At first, I thought that the answer must be yes for the extreme cases $d=0$ and $d=n$ where the relevant Hausdorff measures are the counting measure and the Lebesgue measure (up to scaling). However, at some point I realized that I had implicitly assumed that Hausdorff dimension 0 or n would imply discreteness or non-empty interior (which may or may not be true, probably not).   I'm now at the point where I've realized that I have already spent much more time thinking about this than I should have. Hence, I resort to the infinite wisdom of the internet. I believe that the answer to the above question is no in the stated generality, but I'm basically at a loss. Maybe someone on here has something up their sleeve.

The $\alpha$-Dimensional Hausdorff-Measure of a Set A is defined as $H^\alpha (A)=\inf_{A\text{ is countable covering}}\sum_{A'\in A} diam(A')^\alpha$. It is easy to show, that for every set $E\subseteq\mathbb{R}^d$ there exists a unique $\beta\in \mathbb{R}$, so that $H^\alpha(E)=0$ for $\alpha>\beta$ and $H^\alpha(E)=\infty$ for $\alpha < \beta$. This $\beta$ is called the Hausdorff-Dimension $dim(E)$ of E. It is easy to show, that $dim(\mathbb{R}^d)=d$ and $H^d(\mathbb{R}^d)=\infty$. I  wonder if there is any Set A with $dim(A)=\alpha$ and $H^\alpha(A)=0$. Does anybody have an idea how to approach this?


Imagine I have a IEnumerable<string> ordered alphabetically. If I filter it like myStrings.where(s=> s.StartsWith(filter));, will the resulting enumerator still be in alphabetic order or not necessarily?  EG: is it there any guarantee that the original order will be maintained?  Edit 1: there is a answer from 2008 about this question. I read it yes, but because it's 12 years old, and a lot changed since then, specially regarding .Net Core and TPL, I would like a fresh, authoritative answer on the matter, to subside further developments. .Where changing the order of a IEnumerable is the kind of problem that is VERY hard to pinpoint and troubleshoot  Edit 2: by "IEnumerable" I don't only mean List<T>, I also mean Dictionaries<T,T>, Array<T>[] and the whole Concurrent versions of it such as ConcurrentBag<T>, ConcurrentDictionary<T,T> and others

I use LINQ to Objects instructions on an ordered array.  Which operations shouldn't I do to be sure the order of the array is not changed?


Show that an integral domain with the property that every strictly decreasing chain of ideals $I_1 \supset I_2\supset \cdots $ must be finite in length is a field.  Attempt: We need to show that every element in the integral domain $D$ is invertible. Let us suppose $\exists~ a \in D$ such that $a$ is not invertible.  Clearly, $ \langle a \rangle \supset \langle a^2 \rangle \supset\cdots \supset\langle a^n \rangle $ where $\langle a^{n } \rangle $ is the last ideal in the chain.  Now,   $\langle a^{n+1} \rangle $ should be equal to one of the  $\langle a^i \rangle ;~ 1 \leq i \leq n$  But $\langle a^{n+1} \rangle $ also satisfies $\langle a^n \rangle \supseteq \langle a^{n+1} \rangle $ and $\langle a^i \rangle \supset\langle a^n \rangle $  $\implies \langle a^j \rangle =\langle a^n \rangle ~~\forall~~j \geq n$  Now, since $a$ is not a unit, $\langle a  \rangle $ does not contain the unity and hence, $\langle a  \rangle \neq D$  How do I move forward and have I interpreted the problem correctly?  Thank you for your help..

If $R$ is a commutative integral domain and it also satisfies descending chain condition on its ideals then how will we show that such ring $R$ will be a field?


If I take either the Magic Initiate or Ritual Caster feat, would I be considered a spellcaster for the purpose of attuning to magic items like the Wand of Lightning Bolts?

Several wands and other magic items in the DMG cite "spellcaster" as an attunement requirement, specifically "requires attunement by a spellcaster" while others list multiple spellcasting classes (e.g., a Staff of Fire "requires attunement by a druid, sorcerer, warlock, or wizard" p. 201). However, all the DMG states in this regard is:  Some magic items require a creature to form a bond with them before their magical properties can be used. This bond is called attunement, and certain items have a prerequisite for it. If the prerequisite is a class, a creature must be a member of that class to attune to the item.¹ (If the class is a spellcasting class, a monster qualifies if that monster has spell slots and uses that class's spell list. [emphasis and footnote added] (p. 136)  The language of the Mage Slayer feat describes a spellcaster as a creature casting or concentrating on a spell.  You have practiced techniques useful in melee combat against spellcasters [...] When a creature within 5 feet of you casts a spell ... [and] When you damage a creature that is concentrating on a spell ... (PHB, p. 168)  From the above, it does not appear that "spellcaster" would necessarily be considered a class or group of classes, so Are characters that can cast spells, regardless of their class(es), considered spellcasters? Or, put another way, Does "spellcaster" (as an attunement prerequisite) mean any creature who can cast a spell or does it mean all classes with the Spellcasting feature? I can think of five particular cases—innate abilities, two subclasses and two feats: High Elves know one wizard cantrip (0-level spell) of their choice. Drow can cast the dancing lights cantrip, 1st-level spell faerie fire and 2nd-level spell darkness. Forest Gnomes know the minor illusion cantrip, and Tieflings can cast the thaumaturgy cantrip and 2nd-level spells hellish rebuke and darkness. Also, many monsters have innate spellcasting abilities, which would trigger the Mage Slayer feat. Starting at 3rd level, both the Eldritch Knight (Fighter Martial Archetype) and Arcane Trickster (Roguish Archetype) gain the ability to cast wizard spells and gain wizard spell slots (potentially) up to 4th-level spells. PHB, pp. 75 & 98. The latter's 17th-level Spell Thief feature also states "you gain the ability to magically steal the knowledge of how to cast a spell from another spellcaster," (Ibid.) which strongly implies that (at least) the Arcane Trickster is a spellcaster, although neither subclass is specifically listed as a prerequisite for any magic item in the DMG. Eldritch Knight and Arcane Trickster are also found under Multiclassing, Spell Slots in the PHB:  You determine your available spell slots by adding together all your levels in the bard, cleric, druid, sorcerer, and wizard classes, half your levels (rounded down) in the paladin and ranger classes, and a third of your fighter or rogue levels (rounded down) if you have the Eldritch Knight or the Arcane Trickster feature. (p. 164)  With the Ritual Caster feat, a character chooses a spellcasting class (except paladin or ranger) and gains the ability to cast spells of that class with the ritual tag as rituals. The character immediately gets two 1st-level ritual spells of that class and has the potential to (eventually) learn all of the ritual spells of the chosen class. PHB, p. 169. With the Magic Initiate feat, a character chooses a particular spellcasting class (except paladin or ranger) and immediately learns two cantrips and one 1st-level spell from the class with no further advancement. PHB, p. 168. By definition, it seems all of the above would qualify as spellcasters, but I feel spellcaster typically (or maybe traditionally) refers to bard, cleric, druid, paladin, ranger, sorcerer, warlock and wizard.   I believe an exception would be a 13th level or higher Thief (Roguish Archetype) due to the Use Magic Device feature. PHB, p. 97.


I am creating an equals method in my linked list which will take a parameter a linked list in the same type. My linkedList has 2 attributes: a CellNode and as usual there is also a head attribute. In my CellNode, there is an object of CellPhone inside. The problem I am having is this equals method always return false when it calls the "smaller" equals method of CellPhone class.  I have tried create 1 linkedlist and then one linked list from clone method but it doesn't work either. And I see nothing can cause problem from the equals method of CellPhone. I tried to compare 2 CellPhone with each other and it works as expected but it shows unexpected result with linked list  Here is the "smaller" equals method inside CellPhone class      public boolean equals(Object obj) {         if((obj == null) || (obj.getClass() != getClass())) {             return false;         } else {             CellPhone cellObj = (CellPhone)obj;             System.out.println(cellObj + " comparing with " + this) ;             if ((this.getBrand() == cellObj.getBrand()) &&                 (this.getPrice() == cellObj.getPrice()) &&                 (this.getYear() == cellObj.getYear()))             {                 System.out.println("equal");                 return true;             } else {                 System.out.println("not equal from CellPhone object");                 return false;             }         }         }   Here is my equals method in Linked list:  public boolean equals(CellList passed) {         CellList other = new CellList(passed);         if(other.size() != passed.size()) {             return false;         }         CellNode index = head;         CellNode otherIndex = other.head;         while(index != null) {             if(index.cell.equals(otherIndex.cell) == false) {                 System.out.println("Not equal from linkedList");                 return false;             }             index = index.next;             otherIndex = otherIndex.next;         }         return true;     }      I am testing by this inside main driver:  //testing         CellList Alist = new CellList();         CellList fake = new CellList();         CellPhone c1 = new CellPhone(1119000, "SonyEricsson", 2009, 347);         CellPhone c2 = new CellPhone(1116700, "Nokia", 2011, 500);         Alist.addToStart(c1);         Alist.addToStart(c2);         //adding element for the fake list         fake.addToStart(c1);         fake.addToStart(c2);         //Comparing         System.out.println(Alist.equals(fake));    I would expect the result comes out as true because I add the same 2 CellPhone objects, but it actually outputs like this:  [1116700: Nokia  500.0$ 2011] comparing with [1116700: Nokia  500.0$ 2011] not equal from CellPhone object Not equal from linkedList false   So it prompts out the not equal line from the CellPhone class although all the attributes were the same. What am I missing here? Thank you

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


How would someone find the limit of the sequence $a_n = \frac{1^k+2^k+...+n^k}{n^{k+1}}, k \in \mathbb{N}$ as $n$ goes to Infinity? Can someone give me maybe a hint where to start?

By considering:  $$\lim_{n\to\infty}\frac{\sum_{k=1}^n k^1}{n^{2}} = \frac 1 2$$ $$\lim_{n\to\infty}\frac{\sum_{k=1}^n k^2}{n^{3}} = \frac 1 3$$ $$\lim_{n\to\infty}\frac{\sum_{k=1}^n k^3}{n^{4}} = \frac 1 4$$  Determine if this is true: $$\lim_{n\to\infty}\frac{\sum_{k=1}^n k^m}{n^{m+1}} = \frac 1 {{m+1}}$$  If it is, prove it.  If it is not, evaluate $\lim\limits_{n\to\infty}\frac{\sum_{k=1}^n k^m}{{m+1}}$.


I'm designing and implementing an algorithm for 3D mesh segmentation. Probably I'll publish the results. However, I'm also interested in using this for commercial means, and to do so I need to hurry with the implementation. For that reason I'll need to hire some coders to implement parts of my algorithm.  In my publication, Do I need to reference this coders? Is this allowed in academia?

We had a master's student working on our project.  He set up a database for us, and wrote some of the initial code with me in a pair programming session.  At one point, he had more commits to the repository than any of the other students working on the project.  Then he went to do an internship for the summer, and after that my advisor did not want to keep him on the project for some reason, even though I thought he was friendly and easy to work with.  My advisor chose not to list him as a coauthor, and put him in the acknowledgements section instead.  However, there was another guy (a professor) who didn't write any code at all, and wasn't there throughout most of the project, but he wrote the introduction and related work sections for us, and he got listed as a coauthor, even though he probably did a day's worth of work on the project (maybe two).  In fact, my advisor gave him the coveted last author position, even though my advisor came up with the idea and directed the whole project.  What determines who gets put as a coauthor, and who gets put in the acknowledgement sections?


I have never really had the ability to draw, but I've also never taken a formal drawing class.  I am interested in graphic design and doing advertisements.  Do you need strong drawing skills to major in graphic design?

Is it true that nice design comes with a nice  drawing?  Do designers have to know how to draw to be a good designer or not?


I need to apply a continue statement that will skip printing the first  10  values.  I already have my code  public class numbers {      public static void main(String[] args) {           for (int number=1; number <= 99; number++){               if (number % 2 == 0)                  System.out.print(number + " " );                          System.out.println();              }          }     }

I saw this keyword for the first time and I was wondering if someone could explain to me what it does.   What is the continue keyword? How does it work? When is it used?


Why do I have this space (red arrow)? Why I do not have more space (orange arrow)?  I use cases and doublespacing.  Even I use \everydisplay\expandafter{\the\everydisplay\setstretch{1}}, because of doublespacing, as suggested in , the problem does not solve.  I have tried array, dcases, drcases, but it does not work.  Thank you!

I am having some difficulty getting this to display properly.      \begin{equation} {\bf H} = -{\bf \mu} \cdot {\bf B} = - \gamma B_o {\bf S}_z = -\frac{\gamma B_o\hbar}{2}  \begin{bmatrix} 1&0\\0&-1 \end{bmatrix}. \end{equation}   Which appears as,    I would like the matrix height to be consistant with the rest of the equation.


used to work with the  installing an ported version of "hal" but it appears to have stopped working (Nov 2015).  I've tried Firefox, Chromium and Chrome, on Ubuntu 14.04.  I've installed hal from  and I've ensured the daemon was running (required sudo) before starting the browser.  Firefox just shows a blank grey space where the player goes; Chrome shows the play buttons but then it just hangs on the endless ubiquitous rotating frustration indicator; Chromium says "flash upgrade required" (I have installed today flashplugin-installed giving me Shockwave Flash v. 11.2 r202)  Obviously the answer would be for public broadcaster Channel 4 to produce a service that was accessible to a wide range of users, but as they've always seemed a little miffed that the internet was invented I don't hold out any hope here so wondering if anyone had found a recent workaround?

I'm using the most up-to-date version of firefox and flash player.  When I go on 4oD and press play I used to get the loading screen showing forever with nothing playing. I then had a search and someone suggested to turn off Ad-Block. So I did and it plays the advertisements. Once the last ad has played it does nothing.   Has anyone else got this problem? Has anyone managed to fix it?  Any help would be appreciated.  Thanks.


unfortunately I cannot bring Texmaker to create a bibliography using BibTeX, so I was wondering: Can I create code that suits the needs of the default environment \begin{thebibliography} importing my .bib database? Is there an automatic procedure, any available piece of software?

I've browsed the forums and found a number of posts that have addressed this issue, but none of the solutions seem to work for me. I have the following script that I just copied from the bibtex home page to get familiar with it. Instead of the citation number I get a question mark. I compile using Latex+Bibtex+Latex+Latex+PDFLatex+ViewPDF just as has been previously suggested and the problem persists.   \documentclass[11pt]{article} \usepackage{cite}  \begin{document}  \title{My Article} \author{Nobody Jr.} \date{Today} \maketitle  Blablabla said Nobody ~\cite{Nobody06}.  \bibliography{mybib} \bibliographystyle{plain} \end{document}   My bibliography (Bib.bbl)  @misc{ Nobody06, author = "Nobody Jr", title = "My Article", year = "2006" }    Looking at previous posts one thing that is concerning is that my .bbl looks empty as shown below. Further, I don't have a .blg  \begin{thebibliography}{}  \end{thebibliography}


Suppose $F_1,F_2$ is closed in $R^n$,and $F_1\cap F_2=\emptyset$,proof there exist$G_1,G_2 $are open set,such that $G_1\cap G_2=\emptyset$,and $F_1\subset G_1,F_2\subset G_2$  Attempt   Suppose $a_n=\frac{1}{n}$ And $F_i\subset \cup _{x\in F_i}B_{a_n}(x)=G_i,i=1,2$  Then I want to use Contradiction,I can get $x_n\in G_1,y_n\in G_2,and z_n\in G_1\cap G_2$,satisfy $|z_n-x_n|<\frac{1}{n},|z_n-y_n|<\frac{1}{n}$  I don’t know what should I do next

By separable I mean, given any pair of disjoint closed sets, $A_1$ and $A_2$, a metric space $(X,d)$, there exists disjoint open sets $O_1$ and $O_2$ such that $A_1\subset O_1$ and $A_2\subset O_2$.  I can prove that for any $x\in A_1$, $x$ is separable from $A_2$, because it's easy to prove that $d(x,A_2)=\delta>0$. (If not, you can find a sequence in $A_2$ that converges to $x$, which contradicts with $A_2$ being closed.)  However it is still not obvious that $A_1$ and $A_2$ are separable because each time you find different $\delta$.


In bash with set -o vi, I use  bind '"\C-]":"\C-[A\C-u cb <<"EOF"\n\C-y\nEOF\n"'   to make ^] in insert mode cat the current line to my clipboard wrapper (cb).  How do I emulate this in zsh (with set -o vi) ?

I have noticed that zsh has a lot of things I see in emacs. I can make a selection with ctrl+space and selecting a region. I can make copies just like in emacs while I stay inside zsh. In emacs I'm able to use my system clipboard (previously with some additional configuration needed but this works out of the box now in emacs). In zsh I can't seem to paste from my clipboard using C-y and copying from zsh to my system cliipboard has the same issue. Is there a way around this?


Let $S$ and $T$ are two subset of a finite group $(G,+)$ so that  $|S|+|T|>|G|$, then      Prove that $S+T=G$, where $S+T=\{s+t:s\in S ,t\in T\}$   My effort: It is clear that $S+T\subseteq G$ as elements of $S$ and $T$ are elements of $G$ also and $G$ is closed under addition.Also $|S+T|<|S||T|$. Then how to show elements of $G$ also in $S+T$? Does the condition $|S|+|T|>|G|$ say it? I don't understand?

Let $G$ be a finite group. Suppose that $A$ and $B$ are to subsets of $G$. If $|G|<|A|+|B|$ prove that $$G=AB.$$


More specifically, I'm supposed to compute $\displaystyle\sum_{k=1}^{n} \frac 1 {k(k + 1)} $ by using the equality $\frac 1 {k(k + 1)} = \frac 1 k - \frac 1 {k + 1}$ and the problem before which just says that, $\displaystyle\sum_{j=1}^{n} a_j - a_{j - 1} = a_n - a_0$.  I can add up the sum for any $n$ but I'm not sure what they mean by "compute".   Thanks!

How can I find the formula for the following equation?  $$\frac{1}{1\cdot 2}+\frac{1}{2\cdot 3}+\frac{1}{3\cdot 4}+\cdots +\frac{1}{n(n+1)}$$  More importantly, how would you approach finding the formula? I have found that every time, the denominator number seems to go up by $n+2$, but that's about as far as I have been able to get:  $\frac12 + \frac16 + \frac1{12} + \frac1{20} + \frac1{30}...$ the denominator increases by $4,6,8,10,12,\ldots$ etc.  So how should I approach finding the formula? Thanks!


With my question I suspect a lot of people may get confused between dynamic styling (what you can achieve by jQuery's .css() function and dynamic CSS rules. The first is where it only changes the styles of existing elements matching the selector. But what I am after is adjusting the rule so any new elements matching the selector will also use that (dynamic) rule.  As an example let's take a set of DIVs with class "pane".  I can change the background color of existing panes using $(".pane").css({"background-color": "#00f"});  But if I then add a new pane $("body").append("

"); it won't use this new style because it isn't a rule.  I don't understand why adding/changing CSS rules isn't the default behaviour? Was this ever discussed by a W3C working group to anyone's knowledge?  Does anyone know if it is possible to add or change CSS rules dynamically client side (ie without communicating with the server)?

I'm looking for a way to insert a "; document.body.appendChild(divNode);   This works in Firefox, Opera and Internet Explorer but not in Google Chrome. Also it's a bit ugly with the
 in front for IE.  Does anyone know of a way to create a


Can someone provide a synonym for the term "pan-handle erf".  It appears in a legal document from Pretoria, South Africa.  Thanks!

The Free Dictionary website states and so does Wikipedia:     erf [ɜːf]   n pl erven [ˈɜːvən]   (Engineering / Civil Engineering) South African a plot of land, usually urban, marked off for building purposes   [Afrikaans]   The term erf is used in legal documentation and technical English throughout South Africa and Namibia, maybe even further afield in the region.  Is it used anywhere else, except maybe the Dutch/Flemish regions in Europe, where I assume the term originated?  An example:      The client purchased Erf 132, Windhoek for a large sum of money. He intends to build a house on this erf.   The capitalisation of "Erf 132" is commonplace, since it is a definition of a location. This is similar to capitalisation of towns or cities. I find it slightly awkward, but that is how it is done.


Hypothetically, let`s say that one day our Sun is suddenly removed from the galaxy. For us, on earth, would take up to 8.3 minutes to notice that the sun was removed, since the distance from the earth and the sun is approximately 8.3 light-minutes.   However, what about gravity? Would we feel immediately here on earth?  Could we say then that, if gravitons really exist, they travel faster than the photons?

A thought experiment: Imagine the Sun is suddenly removed. We wouldn't notice a difference for 8 minutes, because that's how long light takes to get from the Sun's surface to Earth.   However, what about the Sun's gravitational effect? If gravity propagates at the speed of light, for 8 minutes the Earth will continue to follow an orbit around nothing. If however, gravity is due to a distortion of spacetime, this distortion will cease to exist as soon as the mass is removed, thus the Earth will leave through the orbit tangent, so we could observe the Sun's disappearance more quickly.  What is the state of the research around such a thought experiment? Can this be inferred from observation?


I need to transform text file changing variable types by prepending them with specified namespace. But I need to skip base types such as array or string.  So the text  /**  * @param ParamType $param  * @return ReturnType  */ public function SomeFunction(ParamType $param) {    ... }  /**  * @param array $param  * @return string  */ public function OtherFunction($param) {    ... }   Should be converted to  /**  * @param \My\Namespace\ParamType $param  * @return \My\Namespace\ReturnType  */ public function SomeFunction(\My\Namespace\ParamType $param) {    ... }  /**  * @param array $param  * @return string  */ public function OtherFunction($param) {    ... }   My transformation now looks as follows  $classFileText = preg_replace(     [         '/@param\s+([A-Za-z]+)\s+\$(\w+)/',         '/@return\s+([A-Za-z]+)/',         '/@var\s+([A-Za-z]+)/',         '/\s+function\s+([A-Za-z]+)\s*\(\s*([A-Za-z]+)\s+\$(\w+)/',     ],     [         '@param \\' . $typesNamespace . '\\\\$1 $\\2 ',         '@return \\' . $typesNamespace . '\\\\$1',         '@var \\' . $typesNamespace . '\\\\$1',         ' function $1(\\' . $typesNamespace . '\\\\$2 $\\3',     ],     $classFileText );   This works, but base types are prepended as others.  I've tried to solve this using this tip:   And many others... But I failed.  p.s. I came across this, making the transformation of the WSDL schema into a set of classes to access the SOAP service

I know it's possible to match a word and then reverse the matches using other tools (e.g. grep -v). However, is it possible to match lines that do not contain a specific word, e.g. hede, using a regular expression?   Input:  hoho hihi haha hede   Code:  grep "<Regex for 'doesn't contain hede'>" input   Desired output:  hoho hihi haha


I have a $.each cycle and I need to access an external variable and I have troubles managing it. ex:  var f = obj instanceof QuadTable ? _.find(obj.tableCols, {data: arr[2]}) : $("#" + frm + ' input[name=' + arr[0] + ']');  $.each(arrTags, function (i, item) {         var arr=$(item).data('filter').split(":")         var y = obj instanceof QuadTable ? _.find(obj.tableCols, {data: $.trim(arr[0])}) : $("#" + frm + ' input[name=' + $.trim(arr[0]) + ']');         if (y.complexList || (y instanceof $ && y.hasClass("complexList"))) {                 var keys = obj.returnListKeys(y);                 var values = [];                 debugger;                 _.map(keys, function (name, i) {                     debugger;                     var k = _.findIndex(obj.dbColumns, {'db': name});                     values = arr[1].split('@');                     obj.dbColumns[k]["prv_value"] = values[i];                     obj.dbColumns[k]["nxt_value"] = values[i];                 });         }     });   My problem is how to access f inside $.each.

How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?  I have seen  given on Wikipedia, but unfortunately it did not help.


Paul Christiano writes ():     I’ll assume that we have some 256 bit cryptographic hash function F [...] The first important observation is that a 256-bit shared secret allows Alice and Bob to talk for as long as they want, by just using their secret to create a new pseudorandom pad for each message. That is, if Alice and Bob share a secret s, then Alice can send a message m by picking k at random, and sending the pair (k, F(sk) ⊕ m). It’s easy to confirm that Bob can still get the message, and if F is random then this is secure.   This is confusing to me. I was under the impression that there is no way of using a one time pad based on a shared secret of $n$ bits to transmit securely more than $n$ bits but this seems to imply it is possible by sending messages with $k=1,2,\dots$  What am I misunderstanding?

Maybe this is a newbie question:  Stream cypher, will XOR message bits with one-time pad bits. Suppose I have a , like a  or something similar. I could use the pseudorandom string to XOR the message. Use the password as the seed of the generator. Same password = same pseudorandom sequence. Could hashing blocks of the pseudorandom sequence create a stronger one-time pad stream?


I frequently use the water displacement method to seal ziploc freezer bags when I sous vide. I can get maybe 99% of the air out, but technically the bag is not under vacuum. If I clip the top of the bag to the side of my container, any air pockets that emerge collects at the top, and the meat is entirely in contact with the bag and immersion bath. Alternatively, if I seal the bag with a marinade, there are no pockets of air between the meat and the immersion bath.   I can't imagine that the temperature transfer can be any more effective when vacuum sealed. So why does a site like SeriousEats still suggest that a vacuum sealer is needed for best results with longer cooking times?    update from   In the context of food storage in plastic bags, SeriousEats claims, "excess air causes oxidation that can develop into off flavors or promote spoilage." But I never sous vide for the freezer, it gets served when done.   There was a comment that asked if food contamination might occur for cooking times longer than 48 hours, but it was never answered.   What is the science behind this statement? How much residual air is "too much"?   If the bag remains submerged, does not leak, and the food in full contact with the water bath, is that enough to duplicate the benefits of a true vacuum seal?  update 2  Also, what is the scientific impact of trapping small amounts of residual air in a pocket above the water bath?  This assumes that there is still a very strong thermal coupling between the water bath and sous vide item.   In the photo below, you can see at least a 2inch gap between the air pockets above water level and the actual short ribs. From a heat transfer perspective, I can't imagine that a vacuum sealed bag can perform significantly better—certainly not relative to a 48hr cook time. Is there a possibility of bacterial contamination?

Modernist Cuisine recommends that for longer sous vide cooking (times greater than 36 hours) that bags are vacuum sealed rather than just using the water displacement method to remove the air from a ziploc bag.  What is the reason for this? Will I be losing something essential if I just use a regular ziploc bag without vacuum sealing?


I'm trying to disable my button when it's clicked and after button code is complete, button should be enabled. Note that i'm using Thread.Sleep(500) once. I know how to disable the button, but I can't get button enabled properly. It enables before the text appears in textBox.  private void CPU_Click(object sender, EventArgs e)     {         //Disable button after click         CPU.Enabled = false;          //Put cursor in the end of MonitorLog          endPointer();          MonitorLog.AppendText("********************************************\r\n");         MonitorLog.AppendText("Starting System Monitor\r\n\n");          //Check for CPU usage          var perfCpuCount = new PerformanceCounter             ("Processor Information",              "% Processor Time",              "_Total");          //Hide printing first CPU usage value which is always 0%         perfCpuCount.NextValue();         Thread.Sleep(500);         //Changing CPU usage value to number with 2 decimal places and printing it out         double cpuUsage = Math.Round(perfCpuCount.NextValue(), 2);          MonitorLog.SelectionFont = new Font(MonitorLog.Font, FontStyle.Bold);         MonitorLog.AppendText("CPU Usage:");         MonitorLog.SelectionFont = new Font(MonitorLog.Font, FontStyle.Regular);         MonitorLog.AppendText(string.Format(" {0}%\r\n\n", cpuUsage));          //Scrolling to the end of the richTextBox         scrollToEnd();          CPU.Enabled = true;       }

Which is the simplest way to update a Label from another Thread?   I have a Form running on thread1, and from that I'm starting another thread (thread2).  While thread2 is processing some files I would like to update a Label on the Form with the current status of thread2's work.   How could I do that?


I need to generate a "package" (string) that consists in 3 velocities: xvel, yvel and wvel. The most convenient way to do so, is to multiply them by 100 and the convert them to hex. The problem is that I need a constant length in each velocity (in order to easily decode them after). I designed the following code,  but I have no success when trying to concatenate every vector in a single "buffer". Any suggestions?  string buffer [50];  int x = 1.23*100; int y = 0*100; int w = 7.89*100;  string xPadle = ""; string yPadle = ""; string wPadle = "";  if(x <= 15) string xPadle = "00"; else if(x <= 255) string xPadle = "0"; else string xPadle = "";  if(y <= 15) string yPadle = "00"; else if(y <= 255) string yPadle = "0";  if(w <= 15) string wPadle = "00"; else if(w <= 255) string wPadle = "0";   sprintf (buffer, "%s%x%s%x%s%x", xPadle, x, yPadle, y, wPadle, w); //printf("%s", buffer); return 0;

I have some numbers of different length (like 1, 999, 76492, so on) and I want to convert them all to strings with a common length (for example, if the length is 6, then those strings will be: '000001', '000999', '076492').   In other words, I need to add correct amount of leading zeros to the number.  int n = 999; string str = some_function(n,6); //str = '000999'   Is there a function like this in C++?


In Python, is there a function that classifies and orders an array of objects by an attribute?  Example:  class Book:     """A Book class"""     def __init__(self,name,author,year):         self.name = name         self.author = author         self.year = year  hp1 = Book("Harry Potter and the Philosopher's stone","J.k Rowling",1997) hp2 = Book("Harry Potter and the chamber of secretse","J.k Rowling",1998) hp3 = Book("Harry Potter and the Prisioner of Azkaban","J.k Rowling",1999)  #asoiaf stands for A Song of Ice and Fire asoiaf1 = Book("A Game of Thrones","George R.R Martin",1996) asoiaf2 = Book("A Clash of Kings","George R.R Martin",1998)  hg1 = Book("The Hunger Games","Suzanne Collins",2008) hg2 = Book("Catching Fire","Suzanne Collins",2009) hg3 = Book("Mockingjaye","Suzanne Collins",2010);  books = [hp3,asoiaf1,hp1,hg1,hg2,hp2,asoiaf2,hg3] #disordered on purpose  organized_by_autor = magic_organize_function(books,"author")   Does the magic_organize_function exist? Otherwise, what would it be?

I've got a list of Python objects that I'd like to sort by an attribute of the objects themselves.  The list looks like:  >>> ut [<Tag: 128>, <Tag: 2008>, <Tag: <>, <Tag: actionscript>, <Tag: addresses>,  <Tag: aes>, <Tag: ajax> ...]   Each object has a count:  >>> ut[1].count 1L   I need to sort the list by number of counts descending.  I've seen several methods for this, but I'm looking for best practice in Python.


I really thought I got this but I can't seem to get this material right. I'm trying to achieve this:     In case, anyone wants to see more photos of this, it's the Dior foundation cap. But I cant seem to get it to shine like this. Although I've tried various nodes, this is what I'm doing currently:  And this is what I'm getting:  My roughness for the above image is at 0.192 and reducing it further isn't looking great. I've also tried using principal BSDF with metallic at 1 but that didn't look similar to what I want either. This is the HDRI I'm using:  Any tips on how to come closer to the reference images would be really appreciated! Edit for Jachym:

I am trying to render a kitchen sink / Faucet    Here is another reference image of what I want   What I have got so far is this   Settings for World:  I have used an environment map HDRI with 0 saturation.  Material settings:  Triad with glossy, glass anisotropic and there mix shader combinations and the new principled bsdf shader too but didn't get the required result.  Studio lights: Followed multiple youtube tutorials on setting up studio lights in blender but the results were not what I wanted.    LEAVING CYCLES :  Decided to try some other software So, Downloaded Keyshot 5 but keyshot wasn't able to produce cycles like results LoL.  Not : I have always struggled to get professional quality product rendering in cycles      So now I'm back in cycles looking for help.


I am pretty new to graphics programming using DX12. I was testing out my skills by building a shader to add 2 buffers and put the result in an output buffer. I have written this code in "ComputeShader.hlsl" however when i tried to invoke it using the following, i get an error sayin "file not found"  ThrowIfFailed(D3DCompileFromFile(GetAssetFullPath(L"ComputeShader.hlsl").c_str(), nullptr, nullptr, "main", "cs_5_0", compileFlags, 0, &computeShader_madhu, nullptr));  Is there something that I am doing wrong?

So I am new to the DX12 world. I am currently trying to tweek the nbody_gravity DX12 sample, but appending or calling another Compute Shader which is to add 2 buffers to produce an output in a different buffer.   I have written this code in "ComputeShader.hlsl" however when i tried to invoke it using the following, i get an error sayin "file not found" When i printed the debug error it says the following: D3D12GetDebugInterface: This method requires the D3D12 SDK Layers for Windows 10, but they are not present on the system.   I am invoking my shader after the default invocation to the nBodyGravity.hlsl is done:  ComPtr<ID3DBlob> computeShader; ComPtr<ID3DBlob> computeShader_m;  #if defined(_DEBUG)         // Enable better shader debugging with the graphics debugging tools.         UINT compileFlags = D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION; #else         UINT compileFlags = 0; #endif           ThrowIfFailed(D3DCompileFromFile(GetAssetFullPath(L"NBodyGravityCS.hlsl").c_str(), nullptr, nullptr, "CSMain", "cs_5_0", compileFlags, 0, &computeShader, nullptr));  //extra call for my shader ComPtr<ID3DBlob> error_ptr;         ThrowIfFailed(D3DCompileFromFile(GetAssetFullPath(L"ComputeShader.hlsl").c_str(), nullptr, nullptr, "main", "cs_5_0", compileFlags, 0, &computeShader_m, &error_ptr));  if (error_ptr) {     OutputDebugStringA((char *)error_ptr->GetBufferPointer()); }   Is there somthing amiss?


Definition     An ordered field is a field $F$ which is also an ordered set, such that:   (i) $x+y < x+z$ if  $x$,$y$,$z \in F$ and $y<z$   (ii) $xy > 0$ if $x \in F$, $y \in F$, $x > 0$, and $y>0$   Question     Prove that no order can be defined in the complex field that turns it into an ordered field. Hint: -1 is a square   My approach  To prove that there can be no order defined in the complex field, I used the second point of the definition.    Let $x=(0,1)$ and $y=(0,1)$. I state that $x>0$ and $y>0$ (but I am unsure if I can do that). Thus $xy$ should be strictly positive, yet $xy= i^2=-1 <0$, thus this disproves the fact that it is possible to define an order in the complex field.  Would this be an acceptable proof? Can I really state that $x=(0,1)>0$?

Show that there doesn't exist a relation $\succ$ between complex numbers such that (i) For any two complex numbers $z,w$, one and only one of the following is true: $z\succ w,w\succ z,$ or $z=w$ (ii) For all $z_1,z_2,z_3\in\mathbb{C}$ the relation $z_1\succ z_2$ implies $z_1+z_3\succ z_2+z_3$. (iii) For all $z_1,z_2,z_3\in\mathbb{C}$ with $z_3\succ 0$, then $z_1\succ z_2$ implies $z_1z_3\succ z_2z_3$.  Suppose $i\succ 0$. From (iii) we have $i^2\succ 0$, so $-1\succ 0$, so applying (ii) we get $0\succ 1$. But repeating (iii) on $-1\succ 0$ we get $1\succ 0$, a contradiction. So either $i=0$ or $0\succ i$. How can I proceed from here?


The FN keys are not working  Using answer in 166261 question I installed the asus-wmi-dkms_0.2_all.deb.gz package  Now, using xev I see that the keys emit keycodes (for backlight keys xev says for fn-f3 and fn-f4 keycode 237)  But no keyboard backlight, also volume keys have no effect  Description of my framework:  ===========================================================  Machine: Asus N56V laptop  ===========================================================  Software   Kubuntu 12.04 amd64  kernel (3.5.0.5-generic) and drivers from xorg-edgers fresh X crack ppa   ===========================================================  Hardware and problems   after installation do not boot - SOLVED using boot-repair every couple of hours the system freezes - SOLVED using 3.5 kernel keybord FN keys - NOT WORKING Keyboard backlight - NOT WORKING Nvidia GEFORCE GT - NOT USED glxgears says 60 fps Ethernet Atheros card - SOLVED install alx driver external subwoofer - SOLVED adding options snd-hda-intel model=asus-mode4   ==========================================================  Solutions  see the asnwers to the 162047 and 166261 questions  ==========================================================

See .  The FN keys are not working  Using answer in  I installed the asus-wmi-dkms_0.2_all.deb.gz package  Now, using xev I see that the keys emit keycodes (for backlight keys xev says for fn-f3 and fn-f4 keycode 237)  But no keyboard backlight, also volume keys have no effect  ================ original question ========================================  I cannot enable the keyboard backlight Seems that the leds class is missing I've not found the classes used in   Description of my framework:  ===========================================================  Machine: Asus N56V laptop  ===========================================================  Software   Kubuntu 12.04 amd64  kernel (3.5.0.5-generic) and drivers from xorg-edgers fresh X crack ppa   ===========================================================  Hardware and problems   after installation do not boot - SOLVED using boot-repair every couple of hours the system freezes - SOLVED using 3.5 kernel keybord FN keys - NOT WORKING Keyboard backlight - NOT WORKING Nvidia GEFORCE GT - NOT USED glxgears says 60 fps Ethernet Atheros card - SOLVED install alx driver external subwoofer - SOLVED adding options snd-hda-intel model=asus-mode4   ==========================================================  Solutions  see the answers to the  and  question.  ==========================================================


I have three blocks and need to put the second and the third before the first. This one needs to go to another line, with 100% width.  .content{   display:flex;   flex-flow: row-reverse wrap; }  .box1, .box2, .box3{   height: 200px;   background: red;   margin: 10px;   flex-basis: calc(33.333% - 20px);   text-align: center;   font-weight: 700;   font-size: 30px;   font-family: sans-serif;   color: white;   line-height: 200px; }  .box2, .box3{   flex-basis: calc(50% - 20px); }  .box1{   flex-basis: calc(100% - 20px); }

Given a template where the HTML cannot be modified because of other requirements, how is it possible to display (rearrange) a div above another div when they are not in that order in the HTML? Both divs contain data that varies in height and width.

         Content to be below in this situation

         Content to be above in this situation

 Other elements   Hopefully it is obvious that the desired result is:  Content to be above in this situation Content to be below in this situation Other elements   When the dimensions are fixed it easy to position them where needed, but I need some ideas for when the content is variable. For the sake of this scenario, please just consider the width to be 100% on both.  I am specifically looking for a CSS-only solution (and it will probably have to be met with other solutions if that doesn't pan out).   There are other elements following this. A good suggestion was mentioned given the limited scenario I demonstrated—given that it might be the best answer, but I am looking to also make sure elements following this aren't impacted.


So I was curious about, what if we make a tunnel from one side of the earth, to the other side of the earth? Gravity is ofcourse always negative, which makes you "fall" and not "float".  If we take this image, let's imagine that the BLACK LINE in the midle of the earth, is a tunnel from one side of the earth, to the other side of the earth.  The red DOT is the midpoint, where something in theory, should happen to gravity that is out of our forces.  What would happen, if a human were to be in the red dot? Would the human just stay there for eternity?  Notes: Imagine that the being in the center couldn't kill you, neither would it bring you in contact of any substance. Just a long tunnel with nothing but the tunnel itself.

...And you jumped in.  What would happen when you got to the middle of the Earth? Would you gradually slow down, until you got to the middle and once you were in middle would every direction feel like it was up?


Say that there are 5 events, with probabilities $P(A)=0.24$, $P(B)=0.29$, $P(C)=0.65$, $P(D)=0.12$, & $P(E)=0.82$ What is the easiest way to figure out the odds of exactly 3 of those events occurring?  The way I would solve for them right now would be like this (where $P(ABC)$ means $A$,$B$,& $C$ occur but $D$ & $E$ do not).  $P(ABC)+P(ABD)+P(ABE)+P(ACD)+P(ACE)+P(ADE)+P(BCD)+P(BCE)+P(BDE)+P(CDE) =  0.24 \cdot  0.29\cdot 0.65\cdot (1-0.12) (1-0.82) + 0.24 \cdot  0.29(1-0.65) 0.12 (1-0.82) + ...$ and so on.  There has to be an easier way, no?  Thanks!

Given the probability of N unrelated events, each with different probabilities, what is the chance X number of outcomes occur?  Said specifically there are 8 unrelated contracts, what is the chance a company wins 1,2,3,4,5,6,7, and 8 of them?  P(Winning Contract1) = 70% P (Winning Contract 2) = 45% P(C3)= 30% P(C4)=50% P(C5)=55% P(C6)=610% P(C7)=2% P(C8)= 2%  Since there are (I think?) 8 choose 4 or 70 possible ways to win 4 contracts, and you have to sum those probabilities.  P(Winning one contract; not necessarily contract 1, but either 1, or 2, or 3, 4, or..) = ? P (Winning two contracts) =? P (Winning three contracts) = ? P (Winning four contracts) = ? … P (Winning 8 contracts)?  Having a bit of trouble with this, help would be appreciated.


Testing Ubuntu 18.04.2 on Lenovo Yoga 530 and not getting the mouse pad and the Wi-Fi to work.  It works with an external mouse and I can connect to my phone via Bluetooth.    When running rfkill command, I get that there is a hard block on Wireless LAN.  0: ideapad_wlan: Wireless LAN     Soft blocked: no     Hard blocked: yes 1: ideapad_bluetooth: Bluetooth     Soft blocked: no     Hard blocked: yes 3: hci0: Bluetooth     Soft blocked: no     Hard blocked: no   How can I remove the hard block?  Also, running the lscpi | grep Wireless gives me this:  01:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8821CE 802.11ac PCIe Wireless Network Adapter   Running the wireless-info script I get the following result:    Any help appreciated

We just bought a Lenovo  (which is supposed to have the Intel 8265 for wireless). This laptop was bought in part because it is certified to run Ubuntu and as such to me at least it would make sense for things to work out of the box... but no such luck.  First, I installed Ubuntu 17.10 and after installation realised Wi-Fi was not working. I also tried Ubuntu 16.04 from a USB drive since that is the version of Ubuntu it is certified for, but no luck there either.  The wireless chip is not detected by lshw (or even lspci by the looks of it), ip link does not show a wireless interface, and the iwlwifi kernel module is not loaded at boot (I can load this myself using modprobe iwlwifi but this does not make Wi-Fi work). I think it is a combined Wi-Fi/Bluetooth chip, and Bluetooth does appear to work (or at least Bluetooth shows up in Gnome and rfkill list).  modinfo iwlwifi | grep 8265 shows me a file ending in -34 is supposedly loaded but only a file ending in -33 (and some other lower numbers) is present in /lib/firmware, if that helps).  I have also installed the Linux 4.14.9 kernel in an attempt to get things to work, but this did not resolve the issue either.  Further information  root@ThinkPad-E570:~# modinfo iwlwifi | grep 8265 firmware:       iwlwifi-8265-34.ucode root@ThinkPad-E570:~# rfkill list all 0: tpacpi_bluetooth_sw: Bluetooth     Soft blocked: no     Hard blocked: no 1: hci0: Bluetooth     Soft blocked: no     Hard blocked: no root@ThinkPad-E570:~# dmesg | grep iwl root@ThinkPad-E570:~# lspci -nnk | grep 0280 -A3 05:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. Device [10ec:c821]     Subsystem: Lenovo Device [17aa:c024]   Update  I just noticed that the laptop does not have an Intel wireless chip at all, but in fact has a Realtek one... which means that the  of the shop I bought this laptop at were not accurate... Sigh. Same problem stands, however, just with a crappier wireless chip.


Let $X$ be an almost surely positive random variable.  I must demostrate that:  $\sum_1^\infty P(x \geq n) \leq E[X] \leq \sum_0^\infty P(X> n)$  Could someone help me?

Show that für $f\colon (\Omega,\mathcal{A})\to\mathbb{R}_{\geq 0}$ measurable, it is     $$ \sum_{k=1}^{\infty}\mu(\left\{f\geq k\right\})\leq\int f\, d\mu\leq\sum_{k=0}^{\infty}\mu(\left\{f>k\right\}). $$      I do not know if one needs it here, but we defined the integral of a non-negative measurable function $f\colon (\Omega,\mathcal{A})\to (\overline{\mathbb{R}},\overline{\mathcal{B}})$ by $$ \int_{\Omega}f\, d\mu=\sup\left\{\sum_{k=1}^{n}(\inf\left\{f(x): x\in A_k\right\})\mu(A_k): n\in\mathbb{N}, A_1,\ldots,A_n\in\mathcal{A}\mbox{ disjoint },\Omega=\bigcup_{k=1}^{n}A_k\right\}. $$    My first idea was to use this definition, but I did not come along with it...  Maybe you can help me to show that?  (I think, maybe it has something to do with monotone convergence theorem or majorated convergence?)


I want to check that input string is number, is there any way? Basically strings are recieved from text field so need to check that whether the string in number or not.

How to check if the content of a NSString is an integer value? Is there any readily available way?  There got to be some better way then doing something like this:  - (BOOL)isInteger:(NSString *)toCheck {   if([toCheck intValue] != 0) {     return true;   } else if([toCheck isEqualToString:@"0"]) {     return true;   } else {     return false;   } }


I have a centos server and I want to run a job on it at 11PM every 2 days, how do I do that?

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.


Do you know how to make points in one line? They are set up unprofessional.

I would like to align multiple points to a line, or lines within a layer, using a specified tolerance or buffer around the line objects. Please refer to the sample sketch attached.  For the sake of this example, the points closest to the line in the BEFORE picture are within 5 map units of the line, while the outermost points are over 10 map units away. I would like to snap the closest points onto the nearest line, using a tolerance of 5 map units to achieve the result in the AFTER picture.


i have created user jagtar & given sudo access from root with usermod -aG sudo jagtar  but  jagtar@wms:~$ $ sudo apt-get install python3-pip python3-dev libpq-dev nginx $: command not found jagtar@wms:~$ which sudo /usr/bin/sudo jagtar@wms:~$ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin   while basic sudo commands are working  jagtar@wms:~$ sudo apt upgrade Reading package lists... Done Building dependency tree        Reading state information... Done Calculating upgrade... Done The following packages were automatically installed and are no longer required:   app-install-data apt-transport-https cpp-5 espeak-data ethtool   evolution-data-server-online-accounts fonts-stix gconf2-common hardening-includes   hwdata libandroid-properties1 libapparmor-perl libapr1 libaprutil1   libaprutil1-dbd-mysql libaprutil1-ldap libasprintf0v5 libbabeltrace-ctf1   libboost-date-time1.58.0 libboost-iostreams1.58.0 libboost-system1.58.0   libcapnp-0.6.1 libcgmanager0 libdata-alias-perl libdbusmenu-gtk4 libdns162   libespeak1 libevent-2.0-5 libfcitx-gclient0 libfwupd1 libgdbm3   libgnome-desktop-3-12 libgom-1.0-common libgrilo-0.2-1 libgtkspell3-3-0   libgtop-2.0-10 libgweather-3-6 libhardware2 libhud2 libhunspell-1.3-0 libhybris   libhybris-common1 libical1a libisc160 libisccc140 libisccfg140 libisl15   liblircclient0 liblouis9 liblouisutdml6 liblua5.2-0 libmedia1 libmpfr4   libmysqlclient20 libnm-glib-vpn1 libnm-gtk-common libnma-common liborcus-0.10-0v5   libp11-kit-gnome-keyring libpackagekit-glib2-16 libpcre16-3 libpoppler58   libportaudio2 libpython3.5 libqmi-glib1 libqt5feedback5 libqt5multimedia5   libqt5organizer5 libqt5positioning5 libqt5printsupport5 libqt5sensors5   libqt5test5 libquvi-scripts libquvi7 libreoffice-gtk libreoffice-gtk2   libsignon-extension1 libsignon-plugins-common1 libsignon-qt5-1 libtcl8.6   libtxc-dxtn-s2tc0 libvpx3 libwayland-egl1-mesa libwebp5 libwebpmux1   libwinpr-dsparse0.1 libwinpr-heap0.1 libwinpr-input0.1 libwinpr-interlocked0.1   libwinpr-library0.1 libxapian22v5 mysql-common oxideqt-codecs pkg-config   plainbox-provider-resource-generic plainbox-secure-policy pm-utils   python3-checkbox-support python3-jinja2 python3-padme python3-pycurl   python3-pyparsing python3-xlsxwriter signon-keyring-extension   signon-plugin-oauth2 signon-plugin-password signon-ui-service signond tcl8.6 tcpd   ubuntu-mobile-icons ubuntu-ui-toolkit-theme Use 'sudo apt autoremove' to remove them.

Any command that starts with $ returns  command not found   How can I fix this?  I am  using 16.10 Ubuntu.


I am iOS Developer. I have seen and had very bad experiences with App Store approval process.  We have developed an app according to Apple standards which are defined on Apple's official site. Despite this, our app was rejected 2-3 times for different reasons.  Why does Apple not give all reasons for an app rejection? Where can I find more information about the app review process?

Our app was rejected recently with reason Google+ signin, which we understood is not according to Apple policy and need to fix.  While discussing about this issue we came across an interesting question with Apple review process, does Apple review team list all issues (if more than one exists) while rejecting app (or) would they stop reviewing other areas as soon as they found an issue (in our case Google+ signin)?


So im trying to make a command block which activates every 30 seconds. The command in the command block is /kill @e[type=minecraft:arrow] so it kills all arrows on the ground every 30 seconds. How can I do that?

I found 11 questions like this on gamingSE already, but none of them have proper and up-to-date answers. So I'm creating this Q&A:  How do you either activate a command x seconds/minutes/hours/… in the future or every x seconds/minutes/… in a loop?  Repeating command blocks and ticking functions execute 20 times per second, redstone is  in many situations and most of the extremely fancy solutions, like falling blocks in cobwebs, have broken over time or are needlessly complicated.


According to the LibreOffice website as of Feb 24 2018, there is a LibreOffice version 6.0.2. The Ubuntu Software Center installs 5.1.6.2 (that is 1 and a half years old) on my machine. How do I get a more recent version installed? (I am not very proficient with unpacking .tar.gz files). When will the software center get newer versions?

LibreOffice is seeing some dramatic improvements each version and subversion that goes out.   I would like to have always the latest version of LibreOffice on my machine(s). I know of the PPA that exists but is it recommended to use it with 12.04 for daily use? What are the pro and cons of using the PPA? Will it break my system/Libreoffice installation?  Does libreoffice get eventually also upgraded in the Ubuntu repositories or does this upgrade happen only with new releases? Who manages the upgrades of libreoffice in Ubuntu and in the PPA?


I am looking for a way to convert point cloud collected through a  LiDAR scanner to a perfect 3D model of a town.   The sample data is from vehicle mounted scanner, but final data is going to be from aerial and vehicle mounted scanners.   The final 3D model of the town is supposed to be used as a terrain for a FPS (first person shooting) video game.   I am not sure where to begin. I have some sample data. The data is available in the following formats:   SDW SDC LAS/LAZ   Is it even possible? The point cloud has color information. The sample point cloud that I have has RGB values for each point, but as far as I have tested the City Engine doesn't work with point clouds, it needs meshes, am I right?    For classes, can't I use height function for the points, to define all points at a certain height to be the ground, and everything higher buildings? I need to take the cars out anyway, so maybe I can take the trees out too, then I have just two classes, the ground class and the not ground class (the buildings).

I want to try to make a simple 3D map for a small area (10 square miles) with some housing, some roads and some vegetation on it. My geodata is as follows:    shapes with houses/roads/vegetation.  LIDAR point cloud data over the area (can easily be built to a dem). georeferenced aerial image.   Any idea where to start to bundle these geodata together and make a neat looking 3D map?


In Gnome2 there was a listing of applications installed. Since Gnome3 and Unity, you have to search for the application you want. You can use Run Command but you have to know the name of the app you want to open.  Are there any other ways to open applications besides Dash-Applications-Lens and Run Command?

Just installed Ubuntu for the first time... Is there any simple way to browse installed programs?  On Mac there is the Applications top-level folder... here I see Desktop, Documents, Downloads etc but no Apps? That'd be a good idea, no? (is there some way to create this myself?)  On Windows there is the Start menu...  Here it seems like I have to click the 'Dash Home' and then I can see 'Recent Apps' ... I can search for them (I'd rather not)  ...or I can click the ruler/pencil icon at the bottom and see 'Recent Apps' and click to expand 'Installed Apps' ...ok that's all of them - is it possible to get a straight list view instead of the hard-to-scan wrapped rows?  Also, is there any way to get rid of the pointless random selection of 'Apps available for download' at the bottom?


I have the following code: from sklearn.metrics import mean_absolute_error def score_model(model,xt=X_train,yt=y_train,xv=X_valid,yv=y_valid):  model.fit(xt,yt)  pred=model.predict(xv)  mae=mean_absolute_error(pred,yv)  return(round(mae,0))  li=[] for i in range(0,len(models)):  li.append(score_model(models[i]))  print("For model:",i+1,"MAE is:",score_model(models[i]))  the output is:  For model: 1 MAE is: 24015.0  For model: 2 MAE is: 23741.0  For model: 3 MAE is: 23529.0  For model: 4 MAE is: 23997.0  For model: 5 MAE is: 23707.0  Now I'd like to highlight specific parts of the output (the least error for example). How could i'd do that using termcolor or any other library? thanks,

How can I output colored text to the terminal in Python?


How do I make the method shown below to return the name of the property  public class MyClass { private string _MyProperty = "TEST";  public string MyProperty {     get { return _MyProperty; }     set { _MyProperty = value; } }  public string GetName() {     return _MyProperty;  // <- should return "MyProperty"; }   }  i don't wana use return "MyProperty" so any alternative?

There has been a lot of sentiment to include a nameof operator in C#. As an example of how this operator would work, nameof(Customer.Name) would return the string "Name".  I have a domain object. And I have to bind it. And I need names of properties as strings then. And I want them to be type-safe.  I remember coming across a workaround in .NET 3.5 which provided the functionality of nameof and involved lambda expressions. However, I have not been able to locate this workaround. Can anyone provide that workaround to me?  I am also interested in a way to implement the functionality of nameof in .NET 2.0 if that is possible.


!! in bash runs last command. I find it too difficult to type given how much I use it. alias to the rescue, I presumed.  Or not. I tried:  $ alias dl='!!'               # Aliasing $ echo Testing123             # Here's something to test on Testing123 $ dl                          # Testing alias bash: !!: command not found $                             # I AM DISAPPOINT   Without quotes also fails.  What's up?

I'm trying to set an alias for sudo !! in Bash. I tried alias sbb='sudo !!', but it interprets that as a literal  !! and prints   sudo: !!: command not found   If I use double quotes, it substitutes the double bang in the string itself, so that doesn't work.  Is there any way to make this work? Or an alternative alias? `


If we assume that a monochromatic source of light produces waves with uniformly distributed phase differences then the sum of all those waves should be zero and thus also the intensity?

I haven't yet gotten a good answer to this: If you have two rays of light of the same wavelength and polarization (just to make it simple for now, but it easily generalizes to any range and all polarizations) meet at a point such that they're 180 degrees out of phase (due to path length difference, or whatever), we all know they interfere destructively, and a detector at exactly that point wouldn't read anything.  So my question is, since such an insanely huge number of photons are coming out of the sun constantly, why isn't any photon hitting a detector matched up with another photon that happens to be exactly out of phase with it? If you have an enormous number of randomly produced photons traveling random distances (with respect to their wavelength, anyway), that seems like it would happen, similar to the way that the sum of a huge number of randomly selected 1's and -1's would never stray far from 0. Mathematically, it would be:  $$\int_0 ^{2\pi} e^{i \phi} d\phi = 0$$  Of course, the same would happen for a given polarization, and any given wavelength.  I'm pretty sure I see the sun though, so I suspect something with my assumption that there are effectively an infinite number of photons hitting a given spot is flawed... are they locally in phase or something?


Say I have these values in a database table  id = 1 StartDate = 1/3/2010 EndDate =  1/3/2010  id = 2 StartDate = 1/3/2010 EndDate = 1/9/2010   Now I have so far this orderby for my linq  var hold = MyList.OrderBy(x => x.StartDate).ToList();   I want to order it however also using the end date.  Like so the order I would want this in as  id 2 id 1   So endDates that are greater go first. I am not sure if I need to change this to use some compare function or something.

I have two tables, movies and categories, and I get an ordered list by categoryID first and then by Name.  The movie table has three columns ID, Name and CategoryID. The category table has two columns ID and Name.  I tried something like the following, but it didn't work.  var movies = _db.Movies.OrderBy( m => { m.CategoryID, m.Name })


What happens to a tailed beast if it's Jinkiurichi is killed while he still has the tailed beast inside of him/her?

It is shown in the anime that the jinchuruki is caught and the tailed beast is extracted and sealed into the Demonic statue by the Akatsuki. What will happen if the jinchuruki is killed somewhere else? In search for Tsunade arc, during the fight between Jiraiya-Tsunade and Orochimaru, Orochimaru tries to kill Naruto as he is the jinchuruki of the nine tails. What would have happened to the nine tails if he had killed Naruto?


I am trying to overwrite [19] in my array, the first value every time. [19] will not always be the same as it populates off an ID that is passed into the array. I want to replace that first index with a new ID based on certain validation.  I've tried unsetting that value and replacing it but it creates a new entry (shown below).  <pre style='font-size:11px'> [------- var dumping... -------] arrcount: 2 Array (     [19] => Array         (             [quantity] => 1         )      [] => 50 ) </pre>   Rather than have a new entry in the array like [] => 50, I would like to replace [19] with [50] while keeping the quantity value the same. Keeping in mind that these numbers are not static, they are dynamic in the case that it is whatever Id is passed based of outside validation.

I have an associative array in the form key => value where key is a numerical value, however it is not a sequential numerical value. The key is actually an ID number and the value is a count. This is fine for most instances, however I want a function that gets the human-readable name of the array and uses that for the key, without changing the value.  I didn't see a function that does this, but I'm assuming I need to provide the old key and new key (both of which I have) and transform the array. Is there an efficient way of doing this?


I gone through this  and I know about standard exception . My question is, What is the benefit of using exception over simple function calling ?  For Example Code A  #include <stdexcept>  int compare( int a, int b ) {     if ( a < 0 || b < 0 )          throw std::invalid_argument( "received negative value" );     else         // return normal results }  try {     compare( -1, 3 ); } catch( const std::invalid_argument& e ) {     // do stuff with exception...  }   and Code B  int compare( int a, int b ) {     if ( a < 0 || b < 0 )          throwFunc( "received negative value" );     else {         // Perform normal task      } }   compare( -1, 3 );  throwFunc(const std::string& e ) {     // do stuff with exception...  }   What is the benefit of Code A over Code B ? and benefit of standard exception objects ? Ultimately we just throw a variable or string.

I've programmed C and C++ for a long time and so far I've never used exceptions and try / catch. What are the benefits of using that instead of just having functions return error codes?


I found this problem on an old math contest:   $$\lim_{b\to1^+}\int_1^b\frac{dx}{\sqrt{x(x-1)(b-x)}}.$$  I've tried substituting $u=\sqrt{x}$, but that hasn't helped much. I've also looked for ways to interpret this geometrically, since numerical estimation suggests the answer is $\pi$. I've also had the idea to try expressing the integrand as a series to get a better handle on how fast terms are growing, but I can't make that work either.   Mainly, the difficulty seems to come from the fact that the integrand is undefined at both boundaries, and that the width of the interval is also going to 0. I'm not sure how to work around either of these, but any help is much appreciated!

I'm trying to solve the following problem     $$\text{Evaluate:} \lim_{b \to 1^+} \int_1^b \frac{dx}{\sqrt{x(x-1)(b-x)}}$$   I'm tempted to think it's 0 because the bounds would be about equal, but that's not the correct answer. But I don't know what integration techniques to use, so any hints are greatly appreciated.  I don't know how to solve for the indefinite integral itself.


In the third book Lupin uses a boggart to practice expecto patronum with Harry. Why does this work? The boggart is simply changing its appearance to look like a dementor it is not actually becoming one?

In the Prisoner of Azkaban, Harry and Lupin could practice the patronus on the boggart, but when Harry was in the final task in the Goblet of Fire, he tried to use the patronus on the boggart, it didn't work and he then moved on to use ridikkilus.  Why could he use a patronus against the boggart, but then not in another?


I created a link for a test so my students could record their answers on an answer sheet. It was easier than giving them the full URL to the answer sheet. Now that they have taken the test I don't want anybody other students to access the answer sheet. The problem is I can't delete the link or disable it. How can I solve this problem?

I want to delete a shortened link from bit.ly that was created by me.   How can I do that?


How can I make the headerline longer?  At the moment it looks like this:   Minimal Example:  \documentclass[a4,12pt]{article}  \usepackage{fancyhdr} \pagestyle{fancy} \usepackage[top=1.5in, bottom=1.5in, left=1in, right=1in]{geometry}  \begin{document}  \section{section one} test text blablah long text long text long text long text long texttest text blablah long text long text long text long text long text  \end{document}   You can see it also here:

After switching from the report class to the book class and starting to use the fancyhdr package to control headers/footers, the page numbers in my footers are no longer centered.  This is my fancyhdr setup:  \usepackage{fancyhdr} \fancypagestyle{plain}{% \fancyhf{} % clear all header and footer fields \fancyfoot[C]{\thepage} % except the center \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt}} %activate the style: \pagestyle{plain}  \usepackage{geometry} \geometry{a4paper} %paper format \geometry{left=27.5mm,right=27.5mm,bottom=27.5mm,top=27.5mm} %margins  With this the page numbers are placed off-center. On even pages they are to the right of the center and on odd ones they are to the left of it. What I want is a perfectly centered (with respect to the page) pagenumber in the footer of even and odd pages alike (like it was when I used the report class and no fancyhdrs).


A subset is compact iff it is closed and bounded.   I know $[0,1]$ is closed in $\Bbb R$, and the intersection of two closed sets is closed. I don’t know if $\Bbb Q$ is open or closed in $\Bbb R$ and have seen proofs for both.

Statement: $[a, b] \cap \mathbb{Q}$ in $\mathbb{Q}$ is not compact. Thus the interior of all compact subsets of $\mathbb{Q}$ is $\emptyset$.   I am trying to understand the first sentence. I read that a closed subspace of a compact space is compact, so for example, consider the unit interval $[0, 1]$ which is a compact space. Take a closed subspace $[0, 1] \cap \mathbb{Q}$ of $[0, 1]$. This set is closed since it just consists of all the rational numbers in between $0$ and $1$, including $0$ and $1$. So it is a closed subspace of a compact space. But why isn't this compact?


First of all, sorry for the bad English. My problem is, that when I start the rendering (no matter if I start it with F12 or over the button at the top) the render pop-up window doesn't show up. At the bottom of the screen, there is a blue bar that fills up over time like it would render something but if I look in the folder with my rendered images there are only old renders. I have tried to render another file but that doesn't show up as well. Do I need to reinstall Blender? and if I do so, are my files still working then?

So, I've noticed when you render something in version 2.8, it automatically opens a new window, and renders it on that.  What I want to know is this:  Is there anything special about this window, and is there a way to set it so that it renders it in the original window, like it did in version 2.79?


I'm trying to break a url that is part of the figure's caption. I used \burl but didn't work. What can I do?  This is my main code:  \documentclass[11 pt, letterpaper, oneside, openright]{book} \listfiles   \usepackage[spanish]{babel} % Manejo de idiomas} \usepackage[utf8]{inputenc} \usepackage{csquotes} \usepackage[pages = some]{background}  \usepackage{tabularx} \usepackage{epigraph} \usepackage{kantlipsum} \usepackage{nomencl} \usepackage[acronym]{glossaries} \usepackage{graphicx} \graphicspath{ {imagenes/} }  \usepackage[style=ieee, backend=biber]{biblatex} \bibliography{bibliografia}  \usepackage{hyperref} \PassOptionsToPackage{hyphens}{url}  \usepackage{caption} \glsenablehyper  \usepackage{tikz} \usetikzlibrary{mindmap}  \usepackage{geometry}  \geometry{  letterpaper,  left=20mm,  right=20mm,  top=30mm,  bottom=30mm,  }  \begin{document} \include{Chap2} \end{document}   This is my Chap2.tex code:  \begin{figure}[t] \includegraphics[width=\textwidth]{calderacarbon.jpg} \captionof{figure}{Diagrama de una caldera de carbón pulverizado.} \captionsetup{font={footnotesize,it}, width=\textwidth} \caption*{Fuente: Valvexport, Inc. \url{http://www.valvexport.com/soluciones-para-alimentacion-y-combustion-de-carbon-pulverizado.html}} \label{fig:Calderacarbon} \end{figure}   And this is my result:    Thanks for your help  EDIT: I also used \usepackage[hyphens]{url} but as I'm using {hyperref} I need to put it in the following way  \usepackage[colorlinks=false]{hyperref} \PassOptionsToPackage{hyphens}{url}   But this doesn't work either

This question led to a new package:      I wish to typeset some relatively long URLs in a piece of text, and when I use \url{..}, the resulting text does not respect the margin boundaries that govern the main text body, instead going all the way to the edge of the paper before wrapping around.   For reference, my preamble looks like this:  \documentclass[12pt]{article} \usepackage{mathptmx} \usepackage{fullpage} \usepackage[pdftex]{hyperref}   and example of the url I'm including is:  \begin{itemize} \item Some text  \url{very-long-url} ... \end{itemize}   I'm compiling using pdflatex, although I doubt this makes a difference.


Really basic question here. So I'm told that a dot . matches any character EXCEPT a line break. I'm looking for something that matches any character, including line breaks.  All I want to do is to capture all the text in a website page between two specific strings, stripping the header and the footer. Something like HEADER TEXT(.+)FOOTER TEXT and then extract what's in the parentheses, but I can't find a way to include all text AND line breaks between header and footer, does this make sense? Thanks in advance!

For example, this regex  (.*)<FooBar>   will match:  abcde<FooBar>   But how do I get it to match across multiple lines?  abcde fghij<FooBar>


I'm still struggling with the idea of a massless particle (photon) having momentum.  if p = mv then if m=0, p=0  Even in the approach of :  p = mv / Sqrt(1-v^2/c^2)  = p=ymv  if velocity is equal to the speed of light, p would still equal 0?  am I missing something here?  thanks

As an explanation of why a large gravitational field (such as a black hole) can bend light, I have heard that light has momentum. This is given as a solution to the problem of only massive objects being affected by gravity. However, momentum is the product of mass and velocity, so, by this definition, massless photons cannot have momentum.  How can photons have momentum?   How is this momentum defined (equations)?


I am having trouble formatting a wide table. Thanks to  my basic structure seems fine. But I find now that the text in one of the columns is too wide for the cell.  \documentclass{article} \usepackage{booktabs,ragged2e,tabularx,geometry,amsfonts} \begin{document}  \newcolumntype{L}{>{\RaggedRight\arraybackslash}X}   \begin{table}[htbp]      \caption{Lots of vertical rules}  \label{tab:a}     \begin{tabularx}{\textwidth}{|*{7}{l|} *{3}{L|}}         \hline         Ref & \multicolumn{6}{c|}{Model Used}         & Approach & Limitation & Goal \\         \hline         & MBTI & FFM & BFI & KTS & BTR & NEO-FFI          & \multicolumn{3}{l|}{} \\          \hline         [10] &  & &\checkmark & & &          & Interactive personality profiling approach          & Test were based on subjective evidences which may lead to uncertainty.         & In order to propose a structure for effective software team structure. \\         \hline          [20] &  & & & & &\checkmark          & Quazi-Experiment          & This study is conducted with students which leads to ambiguity on difference in nature of students and software engineers.         & In order to propose a structure for effective software team structure. \\         \hline         & & & & & & & & & \\          \hline     \end{tabularx}  \end{table} \end{document}   The problem is that in the sell containing the text "Quazi-Experiment" the words are too long: they are sticking out past the right hand side of the cell. How can I prevent this?

My table is going out of the page. Please give me a solution?  \begin{table}[] \centering \caption{My caption} \label{my-label} \begin{tabular}{|l|l|l|l|l|l|l|l|l|l|} \hline Ref      & \multicolumn{6}{l|}{Model Used}        & Approach                                   & Limitation                                                                                & Goal                                                                                \\ \hline          & MBTI & FFM & BFI & KTS & BTR & NEO-FFI & \multicolumn{3}{l|}{}                                                                                \\ \hline {[}10{]} &      &     &     &     &     &         & Interactive personality profiling appraoch & \begin{tabular}[c]{@{}l@{}}Test were based on subjective evidences which\\ may lead to uncertainty.\end{tabular} & \begin{tabular}[c]{@{}l@{}}In order to propose a structure for effective\\ software team structure.\end{tabular} \\ \hline          &      &     &     &     &     &         &                                            &                                                                                &                                                                                \\ \hline \end{tabular} \end{table}


I have written some code that on the click of a button adds a new tweet(div) to a list of divs. See shortened code below. Now even though the new div has all the same classes as the other divs. It does not perform when clicked.  How can I get the jquery click method to work for newly added divs?  $('.buttonClass').on('click', function() {      ....               $newTweet.insertAfter('button');     });    $('.douglascalhoun').on('click', function() {           $("div").slideToggle();           $("div.douglascalhoun").slideDown();         });

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


I develop an application in c++ with Qt and visual studio 2015.  I want to know how to prevent the application form going to sleep when my application is running. My application should be always running in background and responding to the user commanding it by voice.  Is there any to prevent windows from going to sleep when my application is running?

I have to stop windows from going into sleep when my program is running.  And I don't only want to prevent the sleep-timer, I also want to cancel the sleep-event if I press the sleep-button or in any other way actively tell the computer to sleep. Therefore SetThreadExecutionState is not enough.  Or...I don't actually have to prevent the sleep completely, only delay it 5-10sec to allow my program to finish a task.  (I know that this is bad program behavior but it's only for personal use.)


So, after the DBH quests, I went to the new Sanctuary, and did a lot of other quests, including the main story line, Dawnguard, Hearthfire, and just started the Dragonborn DLC. I've been wandering around with the Aura Whisper shout, and I've not found her. The last time I saw her was when I bought a horse from Whiterun, and rode it around until I reached Windhelm, and then it died due to a dragon. Shadowmere has not respawned (if dead), or turned up after fast-travelling. I tried reloading save files, but then I kept losing her. Is there a way to get her back?--  She wasn't at the black pool at EITHER Sanctuary and I still cannot find her. I've looked about everywhere and still she has not turned up and I've not found her.

I dismounted Shadowmere during a fight in the woods and became separated from her.  Now I can't find her.  Is there any way to find her without wandering aimlessly through the woods?


I've got a .shp file with 40k points (trees) in it. One field is the species name. Is there a way to select those entries that match a desired field name e.g. 'black walnut' so I can move them to a new layer?

I know that it is possible to color a vector map by attribute. I separated a map into 4 colors based on an attribute and now I want to generate a new map for each color. Is there a way to do this in QGIS?


I'm using SheepIt! to render a 501-frame-long 1280x720 scene I'm working on. Right now I'm the only one rendering and, and I noticed something weird. Rendering through SheepIt! produces a weird purple and pink image...  Rendering that exact frame (on the exact same file) produces this;   which is exactly what i need. Anyone know whats going on?

I made a character, and its one of my first times texturing, and I saved my character into a new folder, and when I came back to the model ALL the textures were pink, I used to know what to do, but I stopped texturing, how do I bring my textures back?


Prove that $ (\tan\frac{A}{2})^2 + (\tan \frac{B}{2})^2 + (\tan \frac{C}{2})^2 \ge 1$ when $A,B,C$ are the angles in a triangle.  I am trying to solve it using Jensen's Equality but not getting any desired result. Is there any other methodology of solving this problem.

If $A$ , $B$ and $C$ are the angles of a triangle , I have to show that :   $ \tan^2 \cfrac{A}{2} + \tan^2 \cfrac{B}{2} + \tan^2 \cfrac{C}{2} \ge 1 $ .   I had only arrived at $A+B+C = \pi $ , thus $\cfrac{A}{2} + \cfrac{B}{2} + \cfrac{C}{2} = \cfrac{\pi}{2} $   What to do next?


I am making a automatic item sorter for the piglins but you get non-stackable items and i want to seperate these non-stackable items so there may be in 1 chest splash pot of fire resis but in the other chest there may be regular fire pots.

are super sweet.  But, I have a skeleton farm, and am getting tons of non-stackable drops.  Since armor can be smelted into iron/gold, I'd like to smelt those drops in a furnace, and burn bows in a furnace.  And trash all leather armor.  Is there a way to sort out these non-stackable items in vanilla survival?


Did I stumble across a reserved word here or something?  For, the following statement:  SELECT [Type]  FROM (SELECT 'Receive' AS [Rec], 'Transfer' AS [Trx]) [data] UNPIVOT (     [Orders] FOR [Type] IN ([Rec], [Trx]) ) AS [unpvt];   produces this exception/error: The type of column "Trx" conflicts with the type of other columns specified in the UNPIVOT list.    Working Sample  SELECT [Type]     FROM  --(SELECT 'Receive' AS [Rec], 'Transfer' AS [Trx]) [data] (SELECT 'Rec_eive' AS [Rec], 'Transfer' AS [Trx]) [data] UNPIVOT (     [Orders] FOR [Type] IN ([Rec], [Trx]) ) AS [unpvt];   Database Explorer:

When applying the  function to data that is not normalized, SQL Server requires that the datatype and length be the same.  I understand why the datatype must be the same but why does UNPIVOT require the length to be the same? Let's say that I have the following sample data that I need to unpivot: CREATE TABLE People (     PersonId int,      Firstname varchar(50),      Lastname varchar(25) )  INSERT INTO People VALUES (1, 'Jim', 'Smith'); INSERT INTO People VALUES (2, 'Jane', 'Jones'); INSERT INTO People VALUES (3, 'Bob', 'Unicorn');  If I attempt to UNPIVOT the Firstname and Lastname columns similar to: select PersonId, ColumnName, Value   from People unpivot (   Value    FOR ColumnName in (FirstName, LastName) ) unpiv;  SQL Server generates the error:  Msg 8167, Level 16, State 1, Line 6 The type of column "Lastname" conflicts with the type of other columns specified in the UNPIVOT list.  In order to resolve the error, we must use a subquery to first cast the Lastname column to have the same length as Firstname: select PersonId, ColumnName, Value   from (   select personid,      firstname,      cast(lastname as varchar(50)) lastname   from People ) d unpivot (   Value FOR    ColumnName in (FirstName, LastName) ) unpiv;  See  Prior to UNPIVOT being introduced in SQL Server 2005, I would use a SELECT with UNION ALL to unpivot the firstname/lastname columns and the query would run without the need to convert the columns to the same length: select personid, 'firstname' ColumnName, firstname value from People union all select personid, 'LastName', LastName from People;  See . We are also able to successfully unpivot the data using CROSS APPLY without having the same length on the datatype: select PersonId, columnname, value from People cross apply (     select 'firstname', firstname union all     select 'lastname', lastname ) c (columnname, value);  See . I have read through MSDN but I didn't find anything explaining the reasoning for forcing the length on the datatype to be the same. What is the logic behind requiring the same length when using UNPIVOT?


Given a topological space $X$ consider the quotient space $X \times [0,1]$ such that all points $(x,0)$ are identified to a single point $p$. This space $CX/X \times 0$ is called the cone over $X$. Suppose $X$ is a compact subset of $\mathbb{R}^n$ for some $n$. View $\mathbb{R}^n$ as a subset of $\mathbb{R}^{n+1}$ in the usual way. Choose a point $x_o \in \mathbb{R}^{n+1}-\mathbb{R}^n$. Let $C$ be the subspace of $\mathbb{R}^{n+1}$ consisting of the union of all line segments from $x_0$ to points in $X$. Show that $C$ is homeomorphic to the cone over $X$ as defined above. I am going to try and construct a map $f:CX \rightarrow C$ and use the universal quotient property as described in this problem to show it induces a homeomorphism $g:CX/X \times 0\rightarrow C$.  Define $f:CX \rightarrow C$ by $f(x,t)=x_ot+(1-t)x$. Now I am concerned with how to show $(x',t') \sim (x,t) \implies f(x,t) \sim f(x',t')$. Suppose $(x,t) \sim (x',t')$. Then $x_ot+(1-t)x=x_ot'+(1-t')x'$ or $t=t'=0$ and $x=x'$. Am I on the right track with this? If so how should I finish it up to prove it is a homeomorphism? So by the universal quotient property $g:CX/X \times 0 \rightarrow C$ is continuous.

Let $K\subseteq \mathbb{R}^{n} \times \{ 0 \}\subseteq \mathbb{R}^{n+1} $ and $v=(0,0,\cdots,1) \in \mathbb{R}^{n+1}$.      For every $x \in K$,  let $$Lx=\left \{ tv+(1-t)x \; | \ t \in [0,1] \right \}$$      Define    $$ \text{Cone}(K)=\bigcup_{x \in K}Lx. $$   namely the union of all segments from $v$ to every point of $K$.      According to all definitions that I see on books, Cone is defined:       However the exercise I'm working on  asks to find under what circumstances  $$\text{Cone}(K)=\bigcup_{x \in K}Lx$$ is isomorphic to $(K \times [0,1]) /(K \times \{ 1 \})$ (quotient space).   For example if $$K=\{(1/n,0):n\in\mathbb{N}\} \cup (0,0)$$ I can see both of sets form the same graph but I'm still unable to derive a homeomorphism between these two objets.


Suppose I have no technical knowledge on a topic, and there is a Stack Exchange site for that topic. I want to gain knowledge on that topic. I have been in some sites for quite a few months. I know there are questions, not generally so basic. Moreover, if one is a beginner, he just can't build knowledge by just reading questions and answers. Is there some way, I can learn from a technical Stack Exchange site (say, Cryptography), given I have absolutely no technical knowledge on the subject, or are the sites not meant for this? Can we make some changes for this?

There is so much great information on Stack Exchange. A lot of it one discovers only on a need to know basis when running into a similar situation. I was thinking about a new feature to leverage this.  I think that Stack Exchange holds great value in turning its old questions (which already have answers) into a more direct learning experience. Let us say I'm a user that wants to learn more about a specific topic. SE has some knowledge of my skill level on that topic. If not it can try to estimate it by presenting me with questions which already have answers. If I feel comfortable with answering the questions I receive, and the answers are familiar terrain, I can give feedback on how confident I am in resolving the question and also how entertaining the question is as a learning experience. This way SE can update my skill level and update the difficulty and meta information of the question. With this closed feedback loop it can then continue providing me with questions which are relevant to my skill level. Once I'm at a high skill level it could then occasionally present me with questions which don't have an answer as well.  Do you think this makes sense? Would you use it or do you think it would help attract new users to the site and teach them how to write higher quality answers?


I have an object, that will have variable number of other objects in it. In other words I have a container Object, that has other children object in it. Children do have their own properties.  I need to find a number of children objects in it, for that I found two ways of doing it. I am interested which one is the best practice way.  First way:  var numberOfChildren = Object.keys(parentObject).length;   Second way:  var tempP = parentObject             var count = 0;             for (var p in tempP) {                 if (tempP.hasOwnProperty(p)) {                     count++;                 }                 alert(count)             }   Third Way:  var sizeofChildren= _.size(parentObject);   I have added the third way as well Ideas?

What's the fastest way to count the number of keys/properties of an object?  It it possible to do this without iterating over the object?  i.e. without doing  var count = 0; for (k in myobj) if (myobj.hasOwnProperty(k)) count++;   (Firefox did provide a magic __count__ property, but this was removed somewhere around version 4.)


I'm looking for a proof and/or a hint for this. I just got finished for $n=2$, but got stuck proving it for general $n$, apparently some background knowledge is required that's not present in the book.

Let $R$ be a ring satisfying: $\forall x\in R, \; x^3=x$. Prove that $R$ is a commutative ring.


If $n$ is a perfect number then its sum of divisors is $2n$. I would like to prove that $$\frac{1}{d_1}+\frac{1}{d_2}+\ldots+\frac{1}{d_{K}}=2$$  where $d_k$ are the divisors of $n$.

How do I show that the sum of the reciprocals of divisors of a perfect number is $2$?   I tried $d_i\mid n$ with $i\in\mathbb{N},\;d_i\leq n$ then $$\frac{1}{d_1}+\frac{1}{d_2}+\frac{1}{d_3}+...+\frac{1}{d_i}=2$$ $$\sum_{d\mid n} \frac{1}{d}=2$$  So actually, I have to show this last equality, whereas $n$ is a perfect number.