body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
This regex works in pythex, but not in python 3.6. I am not sure why: Code in python: import re test = '105297 003 002394 o 0000 20891 0.00 1' pattern = r"(?P<pun1>\d{3})\s+(?P<pun2>\d{6})(\s+(?P<pun3>[01oO])(\s+(?P<pun4>\d{4}))?)?\s.*\s(?P<amt>\d+\.\d\d)\s" match = re.match(pattern, test, re.IGNORECASE) match is None True I haven't been able to figure out why it works in pythex but not in python interpreter.
|
What is the difference between the search() and match() functions in the ? I've read the (), but I never seem to remember it. I keep having to look it up and re-learn it. I'm hoping that someone will answer it clearly with examples so that (perhaps) it will stick in my head. Or at least I'll have a better place to return with my question and it will take less time to re-learn it.
|
Due to the change in the world generation method, I went and found a map seed that was suitable for using to paste our old structures into it. The only problem is, there is a region around spawn (which I moved a ways from the original staring position using the editor) that is completely uneditable. Blocks can neither be mined nor placed Doors don't function properly (door splits between the top half and lower half, changes randomly when interacted) Chests won't open. Immediately outside that area, though, everything behaves fine. I don't know if the behavior is limited to a particular chunk or not. Could deleting something like session.lock work? Maybe a file permissions issue? Currently no one is using the server yet and have a backup of the world, so I should be able to fiddle with it with no risk. Other info: Minecraft 1.0.0 Vanilla server (no mods) Any ideas?
|
The Minecraft forums seem to be filled with threads regarding a "block respawn" bug. I set up a 1.3 SMP server on my LAN, and notice this as well. All blocks respawn a couple of seconds after being destroyed, and non-local players lag tremendously. It makes the game unplayable. Has Notch commented this issue? Is there a solution that makes the game worth buying?
|
In Java programming, despite String being a reference variable and not a primitive, a constructor is not required, e.g String s = "stringValue"; Is the same as String s = new String("stringValue"); I've seen it mentioned before, but never explained. How is String treated as a primitive, and is this functionality able to built into other classes? Edit: Looking for the actual code that makes String different, and how it can be used - not like in the specific example supplied.
|
I'm a C++ guy learning Java. I'm reading Effective Java and something confused me. It says never to write code like this: String s = new String("silly"); Because it creates unnecessary String objects. But instead it should be written like this: String s = "No longer silly"; Ok fine so far...However, given this class: public final class CaseInsensitiveString { private String s; public CaseInsensitiveString(String s) { if (s == null) { throw new NullPointerException(); } this.s = s; } : : } CaseInsensitiveString cis = new CaseInsensitiveString("Polish"); String s = "polish"; Why is the first statement ok? Shouldn't it be CaseInsensitiveString cis = "Polish"; How do I make CaseInsensitiveString behave like String so the above statement is OK (with and without extending String)? What is it about String that makes it OK to just be able to pass it a literal like that? From my understanding there is no "copy constructor" concept in Java?
|
A supermove in Freecell is when you move more than one card at the same time and automatically takes into account any free cells and free columns you have in order to maximise the number you can move. The exact formula is not a problem: 2^emptycolumns * (freecells+1) My question is, when I make a supermove how can I calculate how many moves were made to cells. I am not talking about how many cells were used. This would be easy to calculate. What I mean is, for example, you move 10 cards because you have 4 free cells and 3 free columns, it is simulating a number of steps that include moving to cells and columns and back. So, how many moves were to cells? Edit: does not answer my question. That just gives the formula to calculate how many cards can be moved but not how many cell moves are needed.
|
I'm working on a FreeCell implementation and I'm currently stuck determining how many cards the user is allowed to move from tableau to tableau at once. I've seen multiple formulas for this, but no explanation them. (empty_columns is decreased by 1 if we move to an empty column) 2 ^ empty_columns + free_cells 2 ^ empty_columns * (free_cells+1) (empty_columns+1) * (free_cells+1) What I'd like to know is if one of these is correct or (even better) anyone knows a small algorithm to move cards like the in Microsoft implementation I'm asking this in this stack because this question is not about the implementation itself, but about the game mechanics.
|
According to quantum field theory touching is an electrostatic repulsion between electrons or the Pauli exclusion principle? How can physicists distinguish these two phenomena if they give the same effect?
|
If you've ever been annoyingly poked by a geek, you might be familiar with the semi-nerdy obnoxious response of "I'm not actually touching you! The electrons in the atoms of my skin are just getting really close to yours!" Expanding on this a little bit, it seems the obnoxious geek is right. After all, consider Zeno's paradox. Every time you try to touch two objects together, you have to get them halfway there, then quarter-way, etc. In other words, there's always a infinitesimal distance in between the two objects. Atoms don't "touch" each other; even the protons and neutrons in the nucleus of an atom aren't "touching" each other. So what does it mean for two objects to touch each other? Are atoms that join to form a molecule "touching"? I suppose the atoms are touching, because their is some overlap, but the subatomic particles are just whizzing around avoiding each other. If this is the case, should "touching" just be defined relative to some context? I.e, if I touch your hand, our hands are touching, but unless you pick up some of my DNA, the molecules in our hands aren't touching? And since the molecules aren't changing, the atoms aren't touching either? Is there really no such thing as "touching"?
|
Let's say javascript simple callback function could look like that: function foo(test, clb) { clb(test); } foo("aaa", function(e) { console.log(e); }); //Found solution: function processSomething($arr, callable $callback) { $callback($arr); } processSomething("xx", function($d) { echo $d; });
|
How are callbacks written in PHP?
|
When I was a kid in the early 80's I remember watching a tv show about a big spaceship flying through space. I think it had few episodes, and the story revolved around the lives inside the ship. I think I remember someone having a crossbow as a weapon. It's very vague. Does this ring a bell to someone? I'm sorry for not having further details, but I was 4 or 5 when I saw it. Edit: The answer is effectively a duplicate but not the question, as I didn't recall so many details as the other user. Thanks
|
I have the vaguest memory of a TV show (maybe a BBC import?) in which the protagonists were moving through the sections of a massive generation ship whose inhabitants had forgotten that they were on a spaceship... I know there was an RPG with the same plot (which, after all, is a pretty great blank slate) but I definitely feel I saw this on a static-filled 13" B&W TV back in the day...
|
Assume that $A$ is an $n\times n$ matrix. Assume that $u$ and $v$ are eigenvectors corresponding to eigenvalues $5$ and $9$. Determine all pairs of real numbers $α$ and $β$ such that $αu+βv$ is also an eigenvector of $A$. Could someone please advise if this works! Since u and v are eigenvectors corresponding to eigenvalues 5 and 9, We have Au = 5u …(1) Av = 9v …(2) Now we want to find all pairs of α and β lets call them α_i and β_i such that (α_i u+β_i v) is eigen vector of A i.e. $$ A(α_i u+β_i v)=e_i (α_i u+β_i v) < => Aα_{i} u+Aβ_{i} v=e_{i} (α_{i} u+β_{i} v) < => α_{i} Au+β_{i} Av=e_{i} (α_{i} u+β_{i} v) < => α_{i} 5u+β_{i} 9v=e_{i} (α_{i} u+β_{i} v) < => e_{i}=((α_{i} 5u+β_{i} 9v))/((α_{i} u+β_{i} v) ) …(3) e_{i} $$ will be=k when $$ α_{i}$$ happens to be the multiple of 9 i.e.$$α_{i}=9*k, β_{i} $$ happens to be multiple of 5 i.e.5*k except when k = 0 Thus for$$ (α_{i} u+β_{i} v) $$ to be eigenvector of A $$ (α_{i},β_{i} )=[(9*k,5*k)] ∀ k = ±1,±2,±3$$…and k!=0 So my question is different from the possible duplicate highlighted below - as it has a specific linear combination to deal with
|
I believe I am very close to finishing this proof, but I cannot figure out the last part. If anybody could check my work and maybe give me a little hint, it would be greatly appreciated! Let $V$ be a finite-dimensional vector space and $T \in \mathcal{L}(V)$, and let $\mathbf{u,v} \in V$ be eigenvectors of $T$. Claim: If $\mathbf{u} + \mathbf{v}$ is an eigenvector of $T$, then $\mathbf{u}, \mathbf{v}$, and $\mathbf{u+v}$ all correspond to the same eigenvalue. Proof (So far!): Suppose $T(\mathbf{u}) = \lambda_1 \mathbf{u}$ and $T(\mathbf{v}) = \lambda_2 \mathbf{v}$ with $\mathbf{u}, \mathbf{v} \neq \mathbf{0}$. Now suppose $T(\mathbf{u+v}) = \lambda_3(\mathbf{u+v})$ with $\mathbf{u+v}\neq \mathbf{0}$. Then, $$ T(\mathbf{u}) + T(\mathbf{v}) = \lambda_3 \mathbf{u} + \lambda_3 \mathbf{v}\\ \lambda_1\mathbf{u} + \lambda_2\mathbf{v} = \lambda_3 \mathbf{u} + \lambda_3\mathbf{v}\\ \lambda_1\mathbf{u} + \lambda_2\mathbf{v} - \lambda_3 \mathbf{u} -\lambda_3\mathbf{v} = \mathbf{0}\\ (\lambda_1 - \lambda_3) \mathbf{u} + (\lambda_2 - \lambda_3)\mathbf{v} = \mathbf{0} $$ Now I know in order to show that $\lambda_1 = \lambda_2 = \lambda_3$, I must show that the only solution to the last line is the trivial one. This would imply that $\mathbf{u}$ and $\mathbf{v}$ are linearly independent which I am unconvinced of! The only information I have to my advantage I haven't used yet is the fact that $\mathbf{u}, \mathbf{v}, \mathbf{u+v} \neq \mathbf{0}$. I really cannot see how this information can help me though. Perhaps I am going about this wrong, but that's why I want to ask! Thanks for your help.
|
$$\sum_{k=0}^n \binom{2k}{k} \binom{2n-2k}{n-k} = 4^n$$ Is there a combinatorial proof of above identity, without any arithmetic transformation? Thanks...
|
It's not difficult to show that $$(1-z^2)^{-1/2}=\sum_{n=0}^\infty \binom{2n}{n}2^{-2n}z^{2n}$$ On the other hand, we have $(1-z^2)^{-1}=\sum z^{2n}$. Squaring the first power series and comparing terms gives us $$\sum_{k=0}^n \binom{2k}{k}\binom{2(n-k)}{n-k}2^{-2n}=1$$ that is, $$\sum_{k=0}^n \binom{2k}{k}\binom{2(n-k)}{n-k}=2^{2n}$$ My question: is there a more direct, combinatorial proof of this identity? I've been racking my brains trying to come up with one but I'm not having much success.
|
I want to fit a multiple regression to test the relationship between several independent variables and a dependent variable. A few independent variables are standard demographic variables, the rest of the IVs are summed scores of responses to likert items. The dv is also a sum of responses to likert items. The books I have read before and during my analysis are Discovering statistics using SPSS, by Field, 4th ed., and R in action, data analysis and graphics with r. The problem is that the homoscedasticity assumption has been violated. To test homoscedasticity, I used the ncvTest() available in Car package of R, and the Breusch and Pagan test available in olsrr package for R. Both show violation of homoscedasticity. Both books I have mentioned above, suggest that bootstrapping for robust standard errors and confidence intervals should be used when the homoscedasticity assumption is not met. In his book, Field suggests that when there is heteroscedasticity, the tests of hypotheses may not be valid. I have bootstraped using the Boot function in R package, as well as using SPSS. My problem is that I am unable to work out how to present my results after a bootstrap, and which values may or should change other than standard errors as a result of the bootstrap. I’ll use the output of both R and SPSS as examples to elaborate my question. In R, I know that rlm(), Boot(), summary(ofboot) will give me the bootstrap standard errors. But, when I am going to report my results, should I report the r-squared, f, and t provided by rlm(), should bootstrapping influence r-squared, f and t values? In other words, when I'm constructing the regression results table, I will take the values of standard error from the results of bootstrap, but can I take the t, f, and coefficients values returned by rlm()? SPSS provides two tables of coefficients, both with and without the bootstrap; the bootstrap coefficient table does not have a column for t, so, again, when reporting the results, do I report the t in coefficient table without the bootstrap, f in the ANOVA and r-squared in the model summary table. Field in his book, has provided a bootstrap example, but the process is shown graphically, and since I’m totally blind, I cannot see the image to determine whether his book has an answer to my dumbest question.
|
If in standard OLS regressions two assumptions are violated (normal distribution of errors, homoscedasticity), is bootstrapping standard errors and confidence intervals an appropriate alternative to arrive at meaningful results with respect to the significance of regressor coefficients? Do significance tests with bootstrapped standard errors and confidence intervals still "work" with heteroscedasticity? If yes, what would be applicable confidence intervals that can be used in this scenario (percentile, BC, BCA)? Finally, if bootstrapping is appropriate in this scenario, what would be the relevant literature that needs to be read and cited to arrive at this conclusion? Any hint would be greatly appreciated!
|
Is there any way to Import a table from Latex to Excel or any other format ?
|
I know there are tools to export excel tables to latex, but what about the other way around? I get a lot of latex tables from functions in R (e.g.: texreg) that aren't perfectly customizable via the code, and need some editing. For example, I'll have variables like T:X and X:T as separate rows, based on how whatever model function interpreted an interaction expansion. I'd like to be able to input a tabular object and get .csv-like table, which I could then edit and re-export (using calc2latex in my case). Anything like this exist?
|
I am trying to develop an android app, and in this app I want to display a Google map and on this map I also want to add some layers on the Map which I have created from GeoServer. Basically my requirement is that I want a Google map with some layers of GeoServer in my android app. which layers are online on my server not on my localhost I am new for the android app as well as GeoServer.
|
I am involved in a bigger university mobile application project and my task is to design and develop a mobile module regarding map and location-based services in a native Android application. Shortly my part of app should display different kind of info on a georeferenced map (Google Map or Openstreetmap) based on Oracle data: Shortest path to reach a certain event from a certain location Different layers with domain information to the event (like parking places around it, bus lines ecc. ) GetFeatureInfo option I am new in this kind of topic and I would like to ask you an architectural question regarding it. I thought about using Geoserver to define layers, styles, datasets etc., and WMS protocol to generate the map over a website using HTML 5, OpenLayers, and jQuery-mobile. But how can I accomplish this in a native android app? Building a webpage where I display the map using HTML 5, OpenLayers and jQuery-mobile to interact with Geoserver and then using the Webviews in Android to display the webpage in my app? Would be this a possible solution? Possible drawbacks? What are the alternatives using Geoserver?
|
I am trying to install git on Ubuntu 16.04 LTS but every time I get this message. I have already uninstalled libpcre2-8-0, and synaptic shows nothing in broken packages. It shows only when I mark git-core package to install, and I don't know what to do after. $ sudo apt install git Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: git : Depends: libpcre2-8-0 (>= 10.22) but 10.21-1 is to be installed E: Unable to correct problems, you have held broken packages.
|
Occasionally, when I'm installing stuff, I get an error like the following: Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: package1 : Depends: package2 (>= 1.8) but 1.7.5-1ubuntu1 is to be installed E: Unable to correct problems, you have held broken packages. How can I resolve this?
|
I need to create a mask to cover the rest of the world outside of a single city. (). I've been told by support to open those boundaries "create a new geospatial file that would be made up of a rectangle that covers the whole earth with a hole in the shape of your city in the middle." From there, I need to upload that file to Mapbox Studio and add it to cover the rest of the world outside of my city. I'm looking to style OpenStreetMap in Mapbox afterwards for that city. So this is a workaround for not being able to edit a single city in Mapbox Studio. How would I create this mask?
|
I'm using python in QGIS. I have a layer of polygons (its a result of some earlier dissolving and has no overlapping polygons but some holes and islands in holes etc). I want to build a new layer which contains one polygon representing a bbox of the first layer with each polygon cut from it. Essentially I want to "invert" the layer I have so that where the was polygon, now there is not, and where there was not polygon now there is. All inside a bounding box of the original layer. I can build a bbox easily and I tried to "subtract" the polygon layer from my new bbox polygon layer but the process slows to a stop and then crashes my PC. Here's the algorythm processing.runalg("qgis.difference","path/to/polygon.shp","path/to/bbox.shp","path/to/result.shp") I dont care about attributes (obviously). I just need to cut one set of polygons from one larger polygon. It seems so simple, I wish I could find a simple command or script to acheive this. As stated at the top I'm looking for a solution in python in QGIS.
|
Here is the Context : I try to code a mapper for converting my DomainModel Objects to ViewModel Ojects dynamically. The problem I get, it's when I try to invoke a method of generic class by reflection I get this error : System.InvalidOperationException : Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true. Can someone help-me to figure out where is the fault ? It would be greatly appreciated Here is the Code (I tried to simplified it) : public class MapClass<SourceType, DestinationType> { public string Test() { return test } public void MapClassReflection(SourceType source, ref DestinationType destination) { Type sourceType = source.GetType(); Type destinationType = destination.GetType(); foreach (PropertyInfo sourceProperty in sourceType.GetProperties()) { string destinationPropertyName = LookupForPropertyInDestinationType(sourceProperty.Name, destinationType); if (destinationPropertyName != null) { PropertyInfo destinationProperty = destinationType.GetProperty(destinationPropertyName); if (destinationProperty.PropertyType == sourceProperty.PropertyType) { destinationProperty.SetValue(destination, sourceProperty.GetValue(source, null), null); } else { Type d1 = typeof(MapClass<,>); Type[] typeArgs = { destinationProperty.GetType(), sourceType.GetType() }; Type constructed = d1.MakeGenericType(typeArgs); object o = Activator.CreateInstance(constructed, null); MethodInfo theMethod = d1.GetMethod("Test"); string toto = (string)theMethod.Invoke(o,null); } } } } private string LookupForPropertyInDestinationType(string sourcePropertyName, Type destinationType) { foreach (PropertyInfo property in destinationType.GetProperties()) { if (property.Name == sourcePropertyName) { return sourcePropertyName; } } return null; } }
|
What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime? Consider the following sample code - inside the Example() method, what's the most concise way to invoke GenericMethod<T>() using the Type stored in the myType variable? public class Sample { public void Example(string typeName) { Type myType = FindType(typeName); // What goes here to call GenericMethod<T>()? GenericMethod<myType>(); // This doesn't work // What changes to call StaticMethod<T>()? Sample.StaticMethod<myType>(); // This also doesn't work } public void GenericMethod<T>() { // ... } public static void StaticMethod<T>() { //... } }
|
Why are dot products scalar (in the general sense) if seen from an intuitive point of view ? i am not asking about a particular case like kinetic energy or work but a i want the answer for general dot products
|
I get the physical significance of vector addition & subtraction. But I don't understand what do dot & cross products mean? More specifically, Why is it that dot product of vectors $\vec{A}$ and $\vec{B}$ is defined as $AB\cos\theta$? Why is it that cross product of vectors $\vec{A}$ and $\vec{B}$ is defined as $AB\sin\theta$, times a unit vector determined from the right-hand rule? To me, both these formulae seem to be arbitrarily defined (although, I know that it definitely wouldn't be the case). If the cross product could be defined arbitrarily, why can't we define division of vectors? What's wrong with that? Why can't vectors be divided?
|
How do I do this? Please help me!
|
I have quite a simple question. I was wondering if it was possible to do something like this in LaTeX: But formatted a little more nicely. It doesn't need to be arrows necessarily. Just some form of annotation marker.
|
What are you supposed to do in the "find the bitizen(s)"? All the emperor says is "tipping is acceptable. find the bitizen(s)."
|
In tiny Death Star, Palpatine has given me the mission "Find the Bitizen" with the text "Working for tips is acceptable. Find 1 Bitizen(s)." I assumed I had to wait for one of the events where you have to find a "rebel scum" and tap on it to get rid of. One of those events finally popped up but it did not complete the mission. How do I complete this mission?
|
A few weeks back I create backlinks for my project and they get indexed and showing in SERP properly. But today I again checked 50% of them are not showing in SERP. Backlinks are live and working properly but not showing in google search. Why, Please help me out. Even the SEOquake extension also showing the date when the link gets indexed. And its not about 1-2 nearly 25+ backlinks are not showing.
|
This is a general, community wiki question and answer pair intended to address any questions concerning the reasons a site or specific site contents do not appear in search engine results. If your question was closed as a duplicate of this question and you feel that the information provided here does not provide a sufficient answer, please open a discussion on . My site (or specific pages on my site) is not appearing in search engine results. Why isn't my content indexed and what can I do about it?
|
I just joined the programmers stack exchange site in order to upvote an answer that I thought was particularly worthy but when I clicked on the button I was told that I needed 15 reputation. This is not a problem, I now understand how reputation works. However would it not be better to hide the upvote and downvote buttons on all questions and answers until you can use them? There are many other features of Stack Overflow that are hidden until they become revealed by reputation increases such as deleted questions, reviewing tools, etc. The upvote a comment button and all the other elements above are hidden until useable so why not the main voting buttons? As it stands the interface seems to be inconsistent and frustrating for new and low rep users.
|
Currently, the system makes you think you can upvote/downvote your own question/answer but then you get notified that you can't. Why have the up/down vote buttons there then? In general, if some operation is not allowed, then don't put UI for that up or make it disabled so it is apparently disabled - no post operation error panels please? ps: hope this is not a dupe, but if so, just comment it and I will remove (+a joke: a user notification panel message: I deleted this file. Is this a problem? Yes/No.)
|
I want to search if anyone has asked anything about [how-to-ask]. I typed \[how-to-ask] (brings me \[how-to-ask]), \[how-to-ask\] (brings me \[how-to-ask]) and [how-to-ask\] (brings a non-existent tag). Does anyone know how to search for such stuffs?
|
Situation: It started out as me for the literal string C-c in but it ended up omitting the - sign and showing results which contained the strings C/C++ and C & C++. is an example of a post which contains that string of characters (yet fails to show up in the results). Things I've tried: post suggests that I can use the undocumented code: operator, but when I do that, it just wraps the whole term in double quotes like . As @terdon in Unix & Linux chat has , using this does yield some relevant results, but it doesn't show me that is supposed to be there. edit: It appears that the Symbolhound query no longer returns that result. Finally, says that you can search for literal characters, but as you can see: Quoted phrases are exact matches except for case-sensitivity, for example, you can search or . The second example (symbols) leads to 0 results. So by now I assume that the search engine has changed (but the old documentation still lingers on this site). Is there a method for me to search for strings that include special (or is it literal?) characters?
|
This is the problem 1.1 from the book, A Gentle Course in Local Class Field Theory. Let $p$ be a prime, let $F$ be a field of characteristic $\neq p$, and let $a \in F^{\times} \backslash F^{\times p}$. We make no assumption on the presence of roots of unity in $F$, and we wish to prove that $[F(\alpha):F]=p$, where $\alpha$ is a root of $X^p-a$. For this, we assume $[F(\alpha):F] \neq p$, and work toward a contradiction: Consider the composite field $F(\mu_p, \alpha)$, and show that $F(\alpha) \subset F(\mu_p)$. 2. Deduce that $F(\alpha)/F$ is Galois, and then that $F(\alpha)=F(\mu_p)$ From the fact that $[F(\alpha):F]$ does not depend on the choice of root $\alpha$, conclude. Note that $\mu_p$ stands for a pth primitive root of unity in the algebraic closure of $F$, aka $F^{alg}$. Also, $F^{\times p} = \{f^n|f \in F\}$. I've had a hard time proving that $F(\alpha) \subset F(\mu_p)$ and $F(\alpha)/F$ is Galois, and didn't get how the assumption for absurdness would fit in the proof. Could anyone please give some help on this? I have been aware that the problem is kind of equivalent to the proposition that $x^p-a$ is irreducible iff $x$ has no root in $F$ (there is an answer regrading this). However, I am trying to understand the way from the book.
|
Hungerford's book of algebra has exercise $6$ chapter $3$ section $6$ [Probably impossible with the tools at hand.]: Let $p \in \mathbb{Z}$ be a prime; let $F$ be a field and let $c \in F$. Then $x^p - c$ is irreducible in $F[x]$ if and only if $x^p - c$ has no root in $F$. [Hint: consider two cases: char$(F) = p$ and char$(F)$ different of $p$.] I have attempted this a lot. Anyone has an answer?
|
I am wondering if there is a way to use the APS reference style in a latex article that does not use the revtex article class? Here is a compilable example: \documentclass[a4paper,11pt]{article} %bibliography \usepackage[square,numbers]{natbib} \begin{document} Hello \cite{example}. Hello again \cite{example2}. %\bibliographystyle{unsrt} \bibliographystyle{apsrmp4-1} \bibliography{mybib} \end{document} with the bibliography mybib.bib @article{example, author = {Keinstein, A.}, title = {Not very general theory of relativity}, journal= {Astrostuff}, year = {1000}, volume = {1}, number = {2}, pages = {3-4}, } @article{example2, title = {Cool paper}, author = {X, XX and Y, YY}, journal = {Phys. Rev. A}, volume = {1}, issue = {1}, pages = {000000}, numpages = {1}, year = {2000}, month = {Jan}, publisher = {American Physical Society}, doi = {00.0000/PhysRevA.00.000000}, } compiles to Interestingly only one of the papers is not printed correctly. With the unsrt style, on the other hand, this gives a correct output for both papers. Is there a way for natbib or bibtex to interpret the style file as revtex would? I use the same bibfile as I use in my revtex articles and there I have no problems.
|
I'd like to know if someone ported the bibliography styles used in revtex 4.1 (like apsrev4-1.bst) so they can be used in other classes, like book. Thanks in advance!
|
I know that the Imperial Space Marines are modified to be super human, but apart from violent death in battle do they age at all? Do they ever reach a point where their bodies are no longer fit for battle and they must set aside their battle armor?
|
How long do Space Marines live on average? What technology lets them live longer than we are living now or does it have more to do with their psychas?
|
A very powerful laser pointing to the empty space next to small object in space. The photons in the laser beam does not hit the object. Will the small object be gravitationally affected by that laser beam?
|
I know a photon has zero rest mass, but it does have plenty of energy. Since energy and mass are equivalent does this mean that a photon (or more practically, a light beam) exerts a gravitational pull on other objects? If so, does it depend on the frequency of the photon?
|
I know this question will be closed because I studied many example of this but please see I think I am doing something different. I coded my server side PHP email validation with this: if (!filter_var($user_new_email, FILTER_VALIDATE_EMAIL)) { $errors .="Email,"; $pass = false; } My client side email validation is: function validateEmail(txtEmail){ var a = document.getElementById(txtEmail).value; var filter = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9]+[a-zA-Z0-9.-]+[a-zA-Z0-9]+.[a-z]{1,4}$/; if(filter.test(a)){ return true; } else{ return false; } So in my client side if I enter only username@domain (without .com), it's valid. I don't want that. I need the same validaton in both client and serverside. How to update my regular expression in JavaScript?
|
Is there a regular expression to validate an email address in JavaScript?
|
I have a router with two Internet WANs: DSL (vlan1) and wireless client (eth1). They are both in default route: vlan is the first and eth1 is the second (I am using ip route add default scope global nexthop via …). I want to use eth1 Internet from my laptop using socks proxy. I tried to use srelay socks server with –J eth1 option on the router but it didn’t work (page loads forever) although it works through DSL if I use –J vlan1. I also tried to use ssh as a socks server and mark packets with iptables to route them to eth1 using ip rule: iptables -t mangle -A OUTPUT -o vlan1 -j MARK --set-mark 1 After this command every program on the router starts using eth1 but I need that only the socks server uses eth1. Is it possible to mark only socks server packets? Now I have to use the second router for this purpose. I run socks server on it and add ip rule for its IP on the first router. I already tried and it didn’t work. It’s not "duplicate" because I need this for proxy server on router. The problem is that I can’t mark packets based on port number because proxy server doesn’t keep this mark while proxyfing.
|
My question is basically the same as . I have two interfaces eth1 (10.0.0.2) and wlan0 (192.168.0.2). My default route is for eth1. Let's say I want all https-traffic to go through wlan0. Now if I use the solution suggested in the other question, https traffic will go through wlan0, but will still have the source-address of eth1 (10.0.0.2). Since this address is not routeable for the wlan0 gateway, answers won't ever come back. The easy way would be to just set the bind-addr properly in the application, but in this case it is not applicable. I figure I need to rewrite the src-addr: # first mark it so that iproute can route it through wlan0 iptables -A OUTPUT -t mangle -o eth1 -p tcp --dport 443 -j MARK --set-mark 1 # now rewrite the src-addr iptables -A POSTROUTING -t nat -o wlan0 -p tcp --dport 443 -j SNAT --to 192.168.0.2 Now tcpdump sees the outgoing packets just fine and ingoing packets arrive for 192.168.0.2, however they probably never end up in the application, because all I ever get to see, is that the application is resending the SYN-packet, although the SYN-ACK was already received. So I thought, maybe I need to rewrite the incoming address too: iptables -A PREROUTING -t nat -i wlan0 -p tcp --sport 443 -j DNAT --to 10.0.0.2 but that didn't work either. So I’m kind of stuck here. Any suggestions?
|
I get that this is a dumb question but I couldn't figure this out on google so this is my last resort. Why is it that when I try to compare two doubles that are variables that I know are equal, it returns false? Here's an example that I hope is more clear: double x = 323.23 double y = 323.23 System.out.println(x==y) Output: false Why does this happen? Also, why does it print true if you just compare two doubles that are not variables or a double that is a variable and a double that is not? example: double x = 323.23 System.out.println(x==323.23) System.out.println(323.23==323.23) output: true true
|
In my program I have one array with 25 double values 0.04 When I try to sum these values in a loop I get following results: 0.0 + 0.04 = 0.04 0.04 + 0.04 = 0.08 0.08 + 0.04 = 0.12 0.12 + 0.04 = 0.16 0.16 + 0.04 = 0.2 0.2 + 0.04 = 0.24000000000000002 0.24000000000000002 + 0.04 = 0.28 0.28 + 0.04 = 0.32 0.32 + 0.04 = 0.36 0.36 + 0.04 = 0.39999999999999997 0.39999999999999997 + 0.04 = 0.43999999999999995 0.43999999999999995 + 0.04 = 0.4799999999999999 0.4799999999999999 + 0.04 = 0.5199999999999999 0.5199999999999999 + 0.04 = 0.5599999999999999 0.5599999999999999 + 0.04 = 0.6 0.6 + 0.04 = 0.64 0.64 + 0.04 = 0.68 0.68 + 0.04 = 0.7200000000000001 0.7200000000000001 + 0.04 = 0.7600000000000001 0.7600000000000001 + 0.04 = 0.8000000000000002 0.8000000000000002 + 0.04 = 0.8400000000000002 0.8400000000000002 + 0.04 = 0.8800000000000002 0.8800000000000002 + 0.04 = 0.9200000000000003 0.9200000000000003 + 0.04 = 0.9600000000000003 Why on earth could that happen?!
|
This is my understanding about hashcode and equals method : if obj1.hashcode == obj2.hashcode (returns true) then obj1.equals(obj2) returns true and if obj1.equals(obj2) returns false (returns true) then obj1.hashcode == obj2.hashcode (returns false) is this correct?
|
What issues / pitfalls must be considered when overriding equals and hashCode?
|
How to compute the integral $\int^{\pi/2}_0\ln(1+\tan\theta)d\theta$. If we let $t=\tan\theta$, then the integral becomes to $$\int^{\pi/2}_0\ln(1+\tan\theta)d\theta=\int_0^\infty\frac{\ln(1+t)}{1+t^2}dt$$. Can we calculate this integral explicitly?
|
Can this integral be solved with contour integral or by some application of residue theorem? $$\int_0^\infty \frac{\log (1+x)}{1+x^2}dx = \frac{\pi}{4}\log 2 + \text{Catalan constant}$$ It has two poles at $\pm i$ and branch point of $-1$ while the integral is to be evaluated from $0\to \infty$. How to get $\text{Catalan Constant}$? Please give some hints.
|
Do you know of a neat proof of the algebraic independence (over $\mathbb{C}$) of the functions $f(t) = e^{at}$ and $g(t)=e^{bt}$ when $a$ and $b$ are linearly independent over $\mathbb{Q}$? IMPORTANT: $f$ and $g$ are algebraic independent if for any nonzero polynomial $P \in \mathbb{C}[x, y]$, the function $P(f(t),g(t))$ is not the zero function.
|
Friends, Do you know of a neat proof of the linear independence (over $\mathbb{C}$) of the functions $f(t) = e^{at}$ and $g(t)=e^{bt}$ when $a$ and $b$ are linearly independent over $\mathbb{Q}$?
|
$$\frac{dx}{dy} = \frac{x(\alpha - \beta y)}{y(\delta x - \gamma)}$$ How do I extract two differential equations (y as a function of x and x as a function of y) from the equation above? I could separate the variables, but I don't see how that would help.
|
$$\frac{dx(t)}{dy(t)}=\frac{\alpha x(t) - \beta x(t) y(t)}{-\gamma y(t) + \delta x(t)y(t)}$$ How would one simplify this fraction? Maybe the chain rule could be of any use, but I don't see how.
|
The phrase "helter skelter" is strange because you don't see the word "helter" or "skelter" used anywhere, and when I searched Merriam-Webster dictionary for either word it links me to the definition of "helter skelter." Since helter and skelter are separated by either a space or a hyphen whenever it's used, it seems like a "compound word," but compound words are made up of other words, whereas "helter skelter" is made up of two "non-words" (for lack of a better word (so far)). What do we call this? Is there a term for a word like "helter" that is only a word when it's paired with another, "skelter?"
|
The Japanese language has a special group of words which repeat mostly two syllable word like pera pera, para para, don don, suku suku, that are used adverbially for examples; Pera pera eigowo hanasu– speak English fluently. Iki Iki shiteiru – look vivid (fresh) Don don iku – go fast Para para furu – rain drizzlingly Muka muka suru – feel sick (angry) Pera pera mekuru – turn the page at random Zuki zuki itamu – ache acutely Suka suka tooru - pass smoothly They look like onomatopoeias, but they are not. They don’t reflect any sound, and they are all used adverbially, not as interjections. I don’t know whether such usage is special to Japanese language or not. Are there a lot of similar form of refrains of nonsensical (on their own) two - (sometimes one) syllable words in separation (unlike the type of crisscross, dillydally, riffraff which are single word) used exclusively adverbially except onomatopoeia (which is not my concern) in English and other languages. If there is, I'm curious to know how we call such a group of words or usages.
|
Would you please explain me why getLongitude and getLatitude returns a NullPointerException? The truth is the problem already has been solved, but there's one thing that is bugging me for this might be asked by our thesis coordinator. The situation is that I have to get the user's current coordinates (latitude and longitude). I've decided to use FusedLocationClient.getLastLocation() in order to get the coordinates. mFusedLocationClient = getFusedLocationProviderClient(this); //app already crashes once the line below is executed mFusedLocationClient.getLastLocation().addOnSuccessListener(this, new OnSuccessListener<Location>() { @Override public void onSuccess(Location location) { if(location != null){ //myLocation is an instance variable of this class myLocation = location; }else{ Toast.makeText(PlaceCategoriesActivity.this, "Location fetch failed!", Toast.LENGTH_SHORT).show(); } } }); latitude = myLocation.getLatitude(); //this line throws NullPointerException longitude = myLocation.getLongitude(); The app seems to compile fine but then it crashes, upon inspecting by adding a breakpoint for debugging on myLocation.getLatiude() and myLocation.getLongititude(), it turns out that this method invokes a null pointer exception, which for me is weird because myLocation already has referenced the location object brought by the onSuccess method of the addOnSuccessListener. I've already solved the problem by moving the last two lines of code and putting in within the listener like this: mFusedLocationClient = getFusedLocationProviderClient(this); mFusedLocationClient.getLastLocation().addOnSuccessListener(this, new OnSuccessListener<Location>() { @Override public void onSuccess(Location location) { if(location != null){ myLocation = location; //moved the 2 lines of code and it now works latitude = myLocation.getLatitude(); longitude = myLocation.getLongitude(); }else{ Toast.makeText(PlaceCategoriesActivity.this, "Location fetch failed!", Toast.LENGTH_SHORT).show(); } } }); //Toast returns a value of 0 on latitude and 0 on longitude Toast.makeText(this, "Lat: " + latitude + "Long: + " + longitude, Toast.LENGTH_SHORT).show(); The funny thing is that the longitude and latitude is shown on the Toast and both has a value of 0.
|
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
|
I have been trying to aimlessly make a unity game around a 3d aim trainer and I have been trying to set up the targets that pop up. For now, I just wanted to create targets that pop up once every second at a maximum of 3 targets at one time ever. I have already set up the random spawn of the targets and the removal of them with the help of raycast shooting and made a max of 3 targets, however, to make the max of 3 targets I used an integer with a simple targetCount += 1 and the deletion of the target is being done on a different script as seen below. My problem is making the targets respawn once being shot after spawning the first 3 targets. I tried to use getComponent to reach the targetCount variable in my Target code to just simply targetCount -= 1 every time I delete a target so that as long as the variable doesn't reach 3, it will continue to spawn targets however I was having some troubles. Please let me know if you have any ideas This is my target spawning code using System.Collections; using System.Collections.Generic; using UnityEngine; public class GenerateEnemies : MonoBehaviour { public GameObject theTarget; public float xPos; public float yPos; public int targetCount = 0; void Start(){ StartCoroutine(TargetDrop()); } IEnumerator TargetDrop() { while (targetCount < 3) { xPos = Random.Range(-6, 11.5f); yPos = Random.Range(2.4f, 9); Instantiate(theTarget, new Vector3(xPos, yPos, 13.5f), Quaternion.identity); yield return new WaitForSeconds(1); targetCount += 1; } } } And this is my Code attached to my target using System.Collections; using System.Collections.Generic; using UnityEngine; public class Target : MonoBehaviour, IDamageable { [SerializeField] private TargetStats targetStats; private int currentHealth; /* public GenerateEnemies generateEnemies; private void Awake() { generateEnemies = GetComponent<GenerateEnemies>(); } */ private void Start() { currentHealth = targetStats.maxHealth; } public void DealDamage(int damage) { currentHealth -= damage; CheckIfDead(); } private void CheckIfDead() { if(currentHealth <= 0) { Destroy(gameObject); /*GenerateEnemies.targetCount -= 1;*/ } } }
|
I need to access a variable from another script in Unity, but I can't figure it out. Script: public class move : MonoBehaviour { public float speed; // Use this for initialization void Start () { } // Update is called once per frame void Update () { transform.position += Vector3.left * Time.deltaTime * speed; } } I want to access the variable speed in another script, but I can't. Any help will be appreciated :)
|
I have a code block as follows in a file: BalancerMember http://snode1:80 min=1 max=1000 loadfactor=1 timeout=30 keepalive=on route=tc_snode1 BalancerMember http://snode2:80 min=1 max=1000 loadfactor=1 timeout=30 keepalive=on route=tc_snode2 I want to search for all lines which had tc_ keyword and add status=D at the end of those lines. So, the above entries will become like this BalancerMember http://snode1:80 min=1 max=1000 loadfactor=1 timeout=30 keepalive=on route=tc_snode1 status=D BalancerMember http://snode2:80 min=1 max=1000 loadfactor=1 timeout=30 keepalive=on route=tc_snode2 status=D I am using the following command to achieve this: sed -i '/tc_/a status=D' app.conf But I can see status=D is being after a newline. I don't want a newline for this. It should be appended with a '' (space) .
|
inputs: line1 with the PATTERN that contains ( ) line2 with the PATTERN that contains ( ) lineN with the PATTERN that contains ( ) outputs: line1 with the PATTERN that contains ( ) ; line2 with the PATTERN that contains ( ) ; ... lineN with the PATTERN that contains ( ) ; I tried this: find . -name "test.txt" -print | xargs sed -i "/PATTERN/ s/$)/); /g" but it didn't work.
|
I have a problem with the retrieval of multiple checkbox values in my program. So as you can see below, I'm trying to retrieve from my database based on a set of values from the checkboxlist. If I select ONE check box value, the database would be able to retrieve the item, however if I select MORE THAN ONE checkbox value, nothing will appear. Can someone help me please? I've spent quite some time on it. I've seen other solutions but it doesn't seem to have helped me. Thank you. protected void chkBoxCategories_SelectedIndexChanged(object sender, EventArgs e) { // Create the list to store. List<String> YrStrList = new List<string>(); // Loop through each item. foreach (ListItem item in chkBoxCategories.Items) { if (item.Selected) { // If the item is selected, add the value to the list. YrStrList.Add(item.Value); } else { // Item is not selected, do something else. } } // Join the string together using the ; delimiter. Session["UPCategories"] = String.Join(", ", YrStrList.ToArray()); } The following code is on the other page: SqlDataSource1.SelectCommand = "SELECT sf.*, sfc.* FROM SkillsFuture sf INNER JOIN SkillsFutureCategory sfc ON sfc.SFCatID = sf.fkSFCatID WHERE sfc.SFCatName IN (@catnames) AND sf.SFPrice BETWEEN @min AND @max AND sf.SFCertStatus='Verified'"; SqlDataSource1.SelectParameters.Add("catnames", Session["UPCategories"].ToString()); SqlDataSource1.SelectParameters.Add("min", Convert.ToDecimal(Session["UPBudgetMin"]).ToString()); SqlDataSource1.SelectParameters.Add("max", Convert.ToDecimal(Session["UPBudgetMax"]).ToString()); SqlDataSource1.DataBind();
|
How do I parameterize a query containing an IN clause with a variable number of arguments, like this one? SELECT * FROM Tags WHERE Name IN ('ruby','rails','scruffy','rubyonrails') ORDER BY Count DESC In this query, the number of arguments could be anywhere from 1 to 5. I would prefer not to use a dedicated stored procedure for this (or XML), but if there is some elegant way specific to , I am open to that.
|
I installed Elementary-Desktop from After install I log out and in the session does not show Pantheon for login in LightDM. Why?
|
I want to install Pantheon desktop environment from elementaryOS on Ubuntu, is that possible?
|
I have a multipolygon layer. Some of the polygons within the layer overlap. I would like to dissolve only the polygons which overlap and not any discrete polygons. Is this possible? I am currently using QGIS.
|
I am a fairly new user of QGIS having a question regarding dissolve functionality. I am working with the provided by EU, which I have imported in QGIS. I have created a new layer with only Denmark and Netherlands as you can see in the picture below. The corresponding attribute table is the following. The fields describe the ID and name for each NUTS node, as well as the country code. I have introduced a new attribute field, called Merge_attr. I have managed to dissolve the polygons with the same attribute value of Merge_attr. However, I would like to dissolve polygons based on the Merge_attr value only when they belong to the same country and potentially only when they are adjacent. Can we constrain dissolve functionality to only polygons that are adjacent? This means that the following should not take place (yellow polygons got merged even though not adjacent):
|
I'm having trouble in QGIS with the symbology. I can classify and categorized my data, but I cannot with the graduated symbology? I've try different format in Excel, and I can't find the problem here.
|
I m working on a project on QGIS. I have a point shapefile vector that represents my store. In the attribute table, i have bunch of data such as size, unit per transaction and most importantly store turnover. When I want to graduate the symbology, the turnover isn't present in the list I can choose from. Does someone know why, and how to fix it?
|
I hear some countries require that you have at least 6 months before the expiry date on your passport from the date you enter (or possibly the date you intend to leave). Is there a limit on passport expiry date for entry into Japan? If it makes a difference, I have Australian and British passports.
|
I'm planning to travel to Japan and I just realised my passport will have less than six months validity at the time I travel. I know some countries require at least 6 months validity for entry. Is this likely to be a problem for Japan? (As an Australian citizen I don't require a visa for short term tourist entry)
|
How do I type this symbol on LaTex?. Is a \vee, but with a floor. I've tried using \lhat and \bhat it doesn't work. Thank you very much.
|
I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out?
|
Just the other day, I was talking to my mom about how the people who had been brave enough to take part in world war 2 were people we should look up to. Just the other day, I was talking to my mom about how the people who have been brave enough to take part in world war 2 were people we should look up to. Just the other day, I was talking to my mom about how the people who had been brave enough to take part in world war 2 are people we should up to. Which one amongst the above sentences is grammatically the most accurate? I asked this question once before, I still am kinda doubtful as to whether the first one is the best one to use.
|
Just the other day, I was talking to my mom about how the people who had been brave enough to take part in world war 2 were people we should look up to. Just the other day, I was talking to my mom about how the people who have been brave enough to take part in world war 2 were people we should look up to. Are both the above sentences grammatically correct? What's the difference in their meaning.
|
I am trying to use a particular template (given in the 2nd link below). Before I apply this to my own Tex file for my paper, I'd like to learn how to actually compile the given template. I am having trouble with the following steps: 1) For file prepared in AMS-LATEX format: Download the class file “AIMS.cls” from the following link and place it to the local folder where your tex file resides. . Question: The link isn't a download but rather leads to a page with some code. What exactly should I be adding to my folder and how do I do this? 2) For file prepared in AMS-LATEX format: Download the AMS-LATEX template by clicking the following link and use it as a template to prepare your tex file. How do I put these two together to compile the corresponding PDF for the given template? I've never done this before. I've tried (using TeXworks) to (i) compile the Template_1.tex file, (ii) insert the .cls code into a blank template and then compile, and (iii) insert the .cls code into the Template_1.tex code (does it matter where I insert the code?). In each case, I receive an error. This is pdfTeX, Version 3.14159265-2.6-1.40.16 (MiKTeX 2.9) entering extended mode (C:/Users/Joseph/Desktop/cls.tex LaTeX2e <2015/10/01> patch level 2 Babel <3.9m> and hyphenation patterns for 69 languages loaded. LaTeX Warning: You have requested package `', but the package provides `dcds'. ! Use of \@ doesn't match its definition. \@tempa#1#2\@nil->\edef \@classname{#1} l.14 \expandafter\@tempa\@currnamestack{}{}{}\@nil ? " I see that part of the problem is that I should not use class AMS article nor \amsart but use class \dcds, so how should I make this change in the template? Is it as simple as replacing every occurrence of "amsart" with "dcds"?
|
I'm trying to download a document class from a university, and would like to use this for my thesis. However I'm very new to all of this, and so really have little clue on where to start. The document class package is located below, I've downloaded the 'ecsdocs.zip' file under the 'installation' heading: When unzipped, I am able to extract 5 folders, but can't seem to find my the right local texmf directory to place them in. I have previously placed the files in usr>local>texlive>texmf-local>tex>latex, but can't seem to find the document class after a lyx reconfigure. Is this even the right folder to place the files in? And once placed into the correct folder, what would be the next steps? Would very much appreciate some detailed guidance. Thanks.
|
I read that permanent magnetism is caused by electrons orbiting in a way which produces a net magnetic field. but how can a particle with no dimensions have a magnetic dipole? also I read that photons are the fundamental carriers of electromagnetism. where does that come in here?
|
Experiments used to observe particle spin properties (such as ) rely on a varied magnetic field and a dipole-like reaction in the particle, deflecting it in one direction or another. In the case of a point-particle such as an electron, how is it explained that a dipole with spatially separated poles exists in a single point?
|
I naively entered the following math-mode/text mix in a theorem environment, but the way LaTeX treats the parenthesis doesn't seem right. Especially upright math formulas in italic text parenthesis look strange, even though this is exactly how I would write it in regular text. Also the parenthesis in the end seem weird in contrast to the big upright one in the formula. Is this a problem in LaTeX that is supposed to be circumvented manually? If so, what is the best way to make this look more consistent? \begin{conj} Let $a$ ($b$) be $3$ ($5$). (Recall that $c=\Big( \AImatrix(C) \lor \AIclause(C) \Big)$.) \end{conj}
|
My question is, basically, the same as the one in : how do I force all parentheses in my document to be upright, without replacing them with some commands "by hand"? Unlike the linked question, my main concern are slanted environments (i.e., theorems). At the moment, I'm dealing with elsarticle, which uses \itshape which is not covered by the solutions on above link (and I don't see how I could modify them to do so), nor by the embrac package (explicitly stated in Section 9). MWE: \documentclass{article} \newtheorem{theorem}{Theorem} \begin{document} \begin{theorem} I want parenthesis (around this text) to be upright. \end{theorem} \end{document} I can, of course, write I want parenthesis {\rm (}around this text{\rm )} to be upright. or define some commands for the upright parentheses and use them. However, changing the parentheses in the LaTeX code can lead to errors (for example, missing some of them and introducing inconsistency) and puts a burden of focusing on that detail, instead of the text I'm writing, so I'd prefer some automated way (like the one shown for \emph in the linked document).
|
I m trying regex to get the strings starting with @ and not ending with a dot(.) For that i tried the java code() but this does not show any results - @(\\w+)*(?<!.(.))*$ The string i m trying is - This is a test\nAnother @pradyut@test [email protected]\ntest\n#art\n@cool#paintings#collections This should return pradyut test cool The result html ending with a .com should not return. Regards
|
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 am writing a paper and have included a separate section at the end called "Tables and Graphs" but when I insert an image below the \section{ }, it pushes the title of the section below it. My code is: \newpage \renewcommand{\thesection}{} \section{Tables and Graphs} \begin{figure} \includegraphics[width=\textwidth]{"Provincial Time Series growth".png} \caption{Natural Logarithm of Provincial Real GDP per capita, 1960-2016} \end{figure} Which produces the following image: Not sure why it is doing this. When I don't include the image the title just appears at the top of the page. Anyone see a clear issue with my code or is there something more I need to do?
|
I have a problem when a lot of figures are in question. Some figures tend to "fly around", that is, be a paragraph below, although I placed them before that paragraph. I use code: \begin{figure}[ht] \begin{center} \advance\leftskip-3cm \advance\rightskip-3cm \includegraphics[keepaspectratio=true,scale=0.6]{slike/visina8} \caption{} \label{visina8} \end{center}\end{figure} to place my figures. How can I tell latex I REALLY want the figure in that specific place, no matter how much whitespace will be left?
|
Using Android app 1.0.59 The button to see revisions seems to be broken in the Android app. The app does nothing when I click the "Edited " words (which should bring me to a page with revisions). My internet connection is perfect. The app is not lagging. Is it possible to fix this bug?
|
Basically this suggestion for the Android app: Many times I'll see that a post has been edited on the Android app. I'll want to see exactly what was edited, and the Android app doesn't show this. Can the revision history be added to the Android app?
|
gnome-open is typically used to open files from the CLI using their associated mime-type handler. It doesn't appear to be installed by default anymore in 12.04. The errata has not been well documented or at least I have yet to find it.
|
What is a current replacement of gnome-open command (generic open of files based on the type)? Before: gnome-open mydoc.pdf # opened PDF in default application Now: gnome-open The program 'gnome-open' is currently not installed. You can install it by typing: sudo apt-get install libgnome2-0
|
I've been confused about this one for quite some time now. If I were to create a project of a character by itself, and I created another project with just scenery, how do I put the character into the scenery? I've tried using import, but it won't let me put the full character into the project.
|
I have created several designs for a particular project and they are related, but I don't want to have to keep recreating any similar elements, such as shared materials or textures. How can I use the existing data in a new Blender file?
|
How do we pronounce apostrophe s after th? For example month's? And how do we pronounce deaths?
|
How to pronounce the two and distinguish them in pronunciation as I almost hear them the same.
|
We are producing LED programmable controler, the power supply is 5VDC. Do we need any certification (UL or similar) for the US market?
|
I am interested in making a widget to sell, but it will probably have a small market and small volume. At what level of complexity should I consider UL listing (or otherwise certifying) my widget? I presume that device complexity is the range I should measure the device against to obtain a safety certification. I understand it costs several thousand dollars for such things. For a widget with only a few dollars in parts (off the shelf/eBay prices), and a small market or run, it doesn't make much business sense for sure. However, in general, what level of complexity should I consider to procure some kind of safety certification? The particular widget I am thinking of right now is a PCB with connectors and possibly a small 24V to 12V transformer (<100ma). Basically, something that was wirenutted/butt-spliced together will now be more professional looking on a board in a box. Don't let the example distract you from the overall question though.
|
To begin with, this isn't about keeping users out of page source, as in . It's about keeping browser definitions of F1-F12 (both shifted and unshifted) from interfering with a browser-based terminal emulation. Clearly, it can be done, because the IceCap 5250 emulator/screenscraper does it, and even prevents Chrome from acting on F12, but it's evidently not easy, because fails to keep Firefox from responding to F7 with some dialog about "caret browsing," and fails to keep Chrome from throwing up the Developer Tools sidebar in response to F12. Can anybody here shed any light on this?
|
I want to handle F1-F12 keys using JavaScript and jQuery. I am not sure what pitfalls there are to avoid, and I am not currently able to test implementations in any other browsers than Internet Explorer 8, Google Chrome and Mozilla FireFox 3. Any suggestions to a full cross-browser solution? Something like a well-tested jQuery library or maybe just vanilla jQuery/JavaScript?
|
Is there any way to access the OOTB of salesforce communities from an LWC or Aura component? We have custom Theme and wondering if we can include this as part of our layout rather than dragging it to the page as a separate component.
|
Is it possible to reference a standard Lightning page component in a Lightning Web Component? And if so, how is this done? I have not been able to find any documentation on this subject. (I am specifically wanting to reference the "Related Record" component in an LWC)
|
Objective is to come out of 'final result while loop' (added as comment) once p1 or p2 wins. I have created a global flag which is initially False but once the winningfunc() returns result1 or result 2 equals to 3, flag is turned to True. I understand there might be verbose, but I am new to python or coding of any sort. Trying to make a simple tic tac toe. Any help is appreciated :) frame=[[" ","|"," ","|"," "], ["-","-","-","-","-"], [" ","|"," ","|"," "], ["-","-","-","-","-"], [" ","|"," ","|"," "]] # Name assignment while True: p1_name=input("Enter player 1 name: ") p2_name=input("Enter player 2 name: ") if p1_name.lower()==p2_name.lower(): print("Both names entered are same, please re-enter!") else: break # Notation assignment while True: p1_nt=input(f"{p1_name}, choose 'X' or 'O' to play with: ") if p1_nt.lower()=="x": p1_nt="X" p2_nt="O" print(f"{p1_name} will play with 'X' & {p2_name} will play with 'O'") break elif p1_nt.lower()=="o": p1_nt="O" p2_nt="X" print(f"{p1_name} will play with 'O' & {p2_name} will play with 'X'") break else: print("Entered notation is wrong, please re-enter!") # dict dc={"1":[4,0],"2":[4,2],"3":[4,4],"4":[2,0],"5":[2,2],"6":[2,4],"7":[0,0],"8":[0,2],"9":[0,4]} # winning logic definition flag=False def winningfunc (): def mf(v1,v2,v3): result1=0 result2=0 for x in range(v1,v2,v3): if frame[dc[str(x)][0]][dc[str(x)][1]]==p1_nt: result1+=1 elif frame[dc[str(x)][0]][dc[str(x)][1]]==p2_nt: result2+=1 else: pass if result1==3: flag=True print(f"Congratulations, {p1_name} wins! ") elif result2==3: flag=True print(f"Congratulations, {p2_name} wins! ") else: pass mf(1,4,1) # for c4 mf(4,7,1) # for c2 mf(7,10,1) # for c0 mf(1,10,4) # for d1 mf(3,8,2) # for d2 mf(1,8,3) # for r0 mf(2,9,3) # for r2 mf(3,10,3) # for r3 # loop for payer input while not flag: # for final result while True: # for p1 data filling s1=input(f"{p1_name} its your turn: ") if 0<=int(s1)<=9 and frame[dc[str(s1)][0]][dc[str(s1)][1]]==" ": if p1_nt=="X": frame[dc[str(s1)][0]][dc[str(s1)][1]]="X" else: frame[dc[str(s1)][0]][dc[str(s1)][1]]="O" break else: print(f"Wrong entry {p1_name}, try once again!") x1=None for x1 in range(len(frame)): f1="".join(frame[x1]) print(f1) # Result check for p1 winningfunc() while True: # for p2 data filling s2=input(f"{p2_name} its your turn: ") if 0<=int(s1)<=9 and frame[dc[str(s2)][0]][dc[str(s2)][1]]==" ": if p2_nt=="X": frame[dc[str(s2)][0]][dc[str(s2)][1]]="X" else: frame[dc[str(s2)][0]][dc[str(s2)][1]]="O" break else: print(f"Wrong entry {p2_name}, try once again!") x2=None for x2 in range(5): f2="".join(frame[x2]) print(f2) # Result check for p2 winningfunc()
|
How can I create or use a global variable in a function? If I create a global variable in one function, how can I use that global variable in another function? Do I need to store the global variable in a local variable of the function which needs its access?
|
My expertise is in math & science, not grammar. For mathematicians, 'thus' is generally seen as a synonym for 'therefore'. If I were to write, "The equation should be written thus:", most would tend to interpret this as "The equation should be written therefore:". On the other hand, if I were to write, "The equation should be written thusly:", this would be interpreted as "The equation should be written as follows:". In this case, is 'thus' still considered preferable to 'thusly'? This is now just a matter of curiosity since I think I've already decided to replace 'thusly' with 'as follows'.
|
I read an article that used "thusly" and was wondering if there is any grammatical credence to it. The : The issue started when Sokolowski quickly ran out of storage capacity in his 32GB Surface after adding media files. After poking around, he realized that while the device has a 32GB drive, only 16GB of that capacity is available for users’ data. Thusly Microsoft is being sued for false advertisement, with the suit seeking class action status. Is thusly an outmoded form of thus, or does it have a different meaning altogether?
|
Whenever I do sudo apt install with some package name it is showing E: Unable to locate package . I have removed 'install-info' file earlier. Does this causing the problem? Also software center is showing no applications.
|
When I try to install any package through the command line, I get an error. $ sudo apt-get install <package> Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package <package> Can anyone help me on this?
|
I am currently working through Abbott's analysis, and am asked to prove the following: Denote the power set of $\mathbb{N}$ by $\mathcal{P}(\mathbb{N})$. Show that $\mathcal{P}(\mathbb{N})\sim\mathbb{R}$; that is, to show that there exists a bijection $F:\mathcal{P}(\mathbb{N})\rightarrow\mathbb{R}$. I am quite sure that we have to use Schroder-Bernstein Theorem where we have to injections to show that there is a bijection, but I'm not sure how to find an injection in either direction.
|
I have learnt that the cardinality of the power set of the natural numbers is equal to the cardinality of the real numbers. What is the function that gives the one-to-one correspondence between these two sets? I have also learnt that there exists no set whose cardinality is strictly between the natural numbers and the real numbers. Is there a proof of this or at least some intuitiveness behind it?
|
I tried many ways to solve this but failed. Any tips or way to solve?
|
Is there a way to calculate the number of simple connected graphs possible over given edges and vertices? Eg: 3 vertices and 2 edges will have 3 connected graphs But 3 vertices and 3 edges will have 1 connected graph Then 4 edges and 3 will have 4 connected graphs Till such values...it is easy to see its V choose E But what about when the number of vertices are less than number of edges...how to calculate then? I am not able to visualize that Can it be a variation of the Stars and Bars problem Like...number of ways 7 edges(balls) can be connected to (kept in) 5 vertices(bags) such that no vertex(bag) is isolated (is empty) Here maybe we might have to consider the number of edges twice as each edge needs two vertices...
|
After enabling Hyper-V on my Windows 10 laptop I have 5 extra generic pnp monitors detected in my display settings panel and in my device manager. When I remove the Hyper-V feature these monitors are gone. When I now connect an extra display to my HDMI port and I want do duplicate my second screen is never on a same display number. So today I extend display 1 and 6 but tomorrow it can be 1 and 5. I am using a Dell Precision M2800 Any ideas why this happens?
|
After a recent update, or after I played around with installing Ionic Framework and Visual Studio 2015 Community Edition, right after a restart, I suddenly have not 2, but several monitors detected by Windows 10. Screen 1 is my laptop screen, and screen 2 is my monitor, connected via HDMI. When they first appeared, some of them were duplicated in groups of 2, while others were extensions. When I disconnect my monitor, these screens don't disappear, and even worse - I can't disconnect one of these "screens", so I have to duplicate it with my laptop screen. I have alleviated all major symptoms of the problem, except for one more: The sound from the speakers embedded in my monitor has also ceased to work. With all of that, I really don't want to fix any more symptoms, but want to get to the core of the problem and remove all of this junk. I tried uninstalling Intel(R) HD Graphics 4600 drivers, but they got themselves re-installed and all of this junk re-appeared again. I tried several restarts obviously, and it didn't help. I tried disabling the device from the device manager and it didn't have any effect. Under the "Monitors" section of the Device Manager in Windows I have 4x "Generic Non-PnP Monitor", and 2x "Generic PnP Monitor". I tried restoring from a restore point but that failed miserably (with a memory error right at the start). What might be causing it? And how can I fix it?
|
I just met this review audit: Wow, that's difficult to miss. You can see the high score of the answer, as well as the author's rep which is higher than 100k. However, I remember that the review audits in the Close Votes review queue will "anonymize" the vote count and the author so that it can catch robo-reviewers more easily. More specifically, the vote count is replaced with a 0 instead of the original high score, and the user's name and reputation count is replaced so it is more obscure. Why isn't this the case for the Low Quality Posts review audits? Shouldn't this be applied as well?
|
Today I came across an OBVIOUSLY good answer in /review. It had 7 upvotes, contained lists, paragraphs of explanation, and well-applied sample code. It was also moderately long. How does a question like this get flagged for review? I don't really know how the algorithm works. If this is low-quality then I feel bad about all of my answers. Here's a if you care to see it in context. It's not really a huge problem (as Bart's comment emphasizes), but this seems like an extreme outlier in every measurable aspect.
|
this is example code that i got the error "undefined reference to`Parent::mMyClass'" class Parent{ //A and B inherit Parent for mMyClass variable protected: enum MyClass{ ClassA, ClassB, }; static MyClass mMyClass; }; class A : Parent { public: void setClass(){ mMyClass = Parent::ClassA; //Error Here } }; class B : Parent { public: void setClass(){ mMyClass = Parent::ClassB; //Error Here } }; int main() { A a; B b; a.setClass(); b.setClass(); return 0; } I am trying to share the variable "mMyClass" to use for class A and B. Any solution for solving this problem in a better way? Thanks
|
Can anyone explain why following code won't compile? At least on g++ 4.2.4. And more interesting, why it will compile when I cast MEMBER to int? #include <vector> class Foo { public: static const int MEMBER = 1; }; int main(){ vector<int> v; v.push_back( Foo::MEMBER ); // undefined reference to `Foo::MEMBER' v.push_back( (int) Foo::MEMBER ); // OK return 0; }
|
I'm connecting from an incoming international flight (Hong Kong - LA) to a domestic flight (LA - Austin) at LAX. Both flights are with American Airlines, booked under one ticket. I have a 2 hour layover, and I have Global Entry. Will I pass through immigration and customs at LA or Austin? Will I need to check out my luggage at LAX and check them back in?
|
I'm flying to the USA, from Australia, through LAX and catching a connecting flight 6 hours later, think it's the same ticket, booked all at once. I've never traveled before, and I'm wondering what happens with customs. Do I collect my bags at LAX so they can be checked? Do I have to check in at every airport or is it all done when I catch the first flight? There are 4 flights on my itinerary.
|
I remember Richard Feynman stating on a few occasions (like ) that physics has no explanation of what causes inertia, that it seems to be some sort of deeply mysterious first principle. I am wondering: have there been made any advances at all towards an explanation in recent decades/years - maybe more recent developments in particle/quantum physics, string theory, ... have shed some light on the matter (pun definitely intended)? Or does Feynman's statement still stand and is this phenomenon as mysterious as ever nowadays? Edit, since this question is seen as a possible duplicate: my question is subtly different I think. I would like to know whether inertia is still seen as a first principle, or if there have been recent discoveries that reveal it to emerge from underlying principles or ideas, interactions of this or that type of particle with this or that field, ...
|
In R P Feynman relates a story where his father told him that, even though we know the word "inertia" and what it means, nobody knows why inertia happens. Is that still true?
|
Spoilers ahead, so do not read if you're not up to date with Marvel Movies. and maybe this is a silly or unanswerable question but it bugged me after watching Spiderman homecoming. During Civil War, I don't remember the exact quote but Tony said she'd left him and it sounded pretty final. At the end of Spiderman Homecoming there was talk about a marriage proposal (somewhat jokingly as the real announcement didn't happen). The obvious answer I suppose is that they got back together, though that as never explained and, frankly, seems like bad writing. It was nice to see her make a cameo, but is there any official word on this? Did they split and get back together? Part of me thinks this is a really dumb question where that's the obvious answer, but I'm still a little bit curious if there's more info on this anywhere.
|
I really don't know how to do this in terms of spoilers, but here goes... After watching the end of Homecoming, it appears that Tony and Pepper are very much back together. Is there any in-universe explanation for this change from the way the universe seemed to be in Civil War?
|
Whenever I try sudo apt upgrade I keep getting this error below: dpkg: unrecoverable fatal error, aborting: files list file for package 'libnss3:amd64' contains empty filename<br> E: Sub-process /usr/bin/dpkg returned an error code (2) What might be the cause for this problem?
|
When I try to install I get this error: dpkg: unrecoverable fatal error, aborting: files list file for package `fonts-tlwg-kinnari' contains empty filename E: Sub-process /usr/bin/dpkg returned an error code (2) And the installation is aborted. I'm using Ubuntu 14.04
|
I am aware how GB classifiers are constructed as regression trees and predictions are made, but not sure how the initial tree and node splitting for it is done. Can someone please explain how the first tree in GBM (classifier) is constructed, and how the node splitting criteria for the first tree is decided. I am not sure, what we are predicting for the first tree (even assuming a constant is initialized, how gradient of loss are computed from the constant). If mse is the node split criteria, what is it composed of (I mean, squared difference of what values??). Thank you.
|
For the input training set ${ \{ ({ x }_{ i }{ y }_{ i })\} }_{ i=1 }^{ n }$ if the loss function is L(y, f(x)), then we initialize the model $M_0$ by finding the $\gamma$ which minimizes: $$ F_0(x) = \sum _{ i=1 }^{ n }{ L{ (y }_{ i, } } \gamma ) $$ which means, for every 'x' we define a model which always gives a constant value $\gamma$ So, now, in the 1st iteration, how come we are able to calculate the derivate of Loss function with respect to the previous model's function, (which is a constant $\gamma$), as derivates with respect to constant are not defined. Can anyone explain what I'm understanding wrong over here ?
|
I know that ${\rm Aut} (\Bbb Z/p \times \Bbb Z/p)$ is $2\times 2$ invertible matrix with all possible entries mod $p$. I was asked to count how many elements in this group, but it gets complicated as I tried to count by dividing into several cases. How can I go about it?
|
I happen to know that Aut($\mathbb{Z_p} \times \mathbb{Z_p}$) $\simeq$ $GL_2(p)$, and so has order $p(p^2-1)(p-1)$. Which means something is wrong with the following argument: An automorphism $\phi$ is determined by its value on the two generating elements $(1,0) $ and $(0,1)$ of $\mathbb{Z_p} \times \mathbb{Z_p}$. These must be sent to elements of the same order, $p$. In fact every nonzero element of $\mathbb{Z_p} \times \mathbb{Z_p}$ has order $p$, so there are $p^2-1$ choices to which each generator must go. Therefore the number of automorphisms is $(p^2-1)^2$. So I've overcounted by $(p^2-1)(p-1)$; I imagine some of the homomorphisms in my argument were not distinct, or not isomorphisms. is there a way to easily rectify for the overcounting? Or do we throw the whole argument away?
|
I have a data set and I performed the following operation: from sklearn.decomposition import PCA from sklearn.preprocessing import StandardScaler scaler = StandardScaler() X_scaled = scaler.fit_transform(X_train) pca_test = PCA(n_components=10) pca_test.fit(X_scaled) #------------Using scaled data cvr = np.cumsum(pca_test.explained_variance_ratio_) pca_test = PCA(n_components=10) pca_test.fit(X_train) #------------Using non scaled data cvr2 = np.cumsum(pca_test.explained_variance_ratio_) print(np.round(cvr, 2)) [0.31 0.52 0.69 0.81 0.9 0.96 0.98 0.99 1. 1. ] print(np.round(cvr2, 2)) [0.97 0.99 0.99 1. 1. 1. 1. 1. 1. 1. ] What does the large explained variance in the two method tell me about data or what I am doing with data rather? Essentially when I scale the data there is no variance reduction. So, does it mean that in my case it is not the best idea to apply standardization ?
|
What are the main differences between performing principal component analysis (PCA) on the correlation matrix and on the covariance matrix? Do they give the same results?
|
It is shown in Stargate that there is a limited number of chevrons in each gate. Since we need a chevron for the origin point at the end of each "dialup", it can not be more origin planets than chevrons (e.g. 39). Since there are obviously more than 39 planets shown on the TV show, how could the series be so long? How could it last long enough long to even Atlantis and Universe? EDIT: Note: this is not a duplicate of because there an estimation of the number of stargates is requested, and here the question is about how could that number be so high when you need Point of Origin chevrons and there are not so many different PoO chevrons available.
|
I'm trying to figure out how many planets have stargates in the Stargate universe, preferably separated by galaxy. I've recently thought about just how many stars there are in the galaxy, and roughly what fraction of them would have a stargate, just to run through some numbers. Bonus points if you compare the number of stargates to the number of stars in the galaxy, distance between stargates, etc.
|
I’m confused about the right way of saying it. Please tell me the correct answer and why it is correct.
|
Most of the time one or the other feels better, but every so often, "which" vs. "what" trips me up. So, what's the exact difference and when should you use one or the other?
|
I have a MacBook Pro with retina display model A1502. I updated it to MacOS X El Capitan. The Wi-Fi connection is still not working. It works for sleep mode. I followed this answer but it is not working for me.
|
I've tried everything I can think of. Resetting the router, changing the channel number and band. The internet connection is fine, and then just hangs for a minute or 2, then returns to normal. The wifi icon remains connected, and I have the latest 10.10.4 update installed. At first I thought it was a DNS bug with Yosemite, and have played with the settings such as changing DNS provider, changing the IPV6 to IPV4 only etc. Driving me nuts. Has anyone had a similar problem? I've checked the surroundings with wifi scanners and have chosen the best channel available. One thing I have noticed, it seems a lot more reliable on 5GHz as opposed to 2.4Ghz It seems to affect my Macbook Pro Retina 13in Early 2015 a lot more than the other devices on the network. I'm using a Virginmedia 1.
|
Looking at the Steam Community page on my inventory, I can see that any community item such as a profile background, trading cards or emoticon can be converted into a certain amount of gems. However, I never entirely understood what defines this value. What I have noticed is that the more popular its respective game is, the more valuable the item will be in gems. But if that's the case, what defines that game as being popular? How many times it's been purchased, the amount of reviews? And what about any base values? How are the gem values calculated?
|
In the Steam Auction, every Steam item (card, booster pack, background and emoticon) has a gem value, which is awarded when the item is "recycled" (user clicks the Turn into Gems... button). How is that gem value worked out? Is there some sort of biasness for rare items? Valve-made items? I've noticed that all the sale emoticons/backgrounds are worth 100 gems each, along with items from Valve games^, free-to-play games and sales, while all other games only reach a maximum of 80. ^CS:GO somehow fits this rule, but Half-Life 2 doesn't.
|
My question is : Suppose a block of mass $m$ is kept on an ideal floor. To lift it, why I need to apply an upward force which is of magnitude $mg$? Force $mg$ is acting on the block in downward direction which is the force of gravity. If I apply an upward force $mg$ it just makes net force acting on the block zero. Then why the it would move upward? And why with zero acceleration
|
Consider there is a box of mass $m$ at rest on the floor. Most books give an example that we need to do a work of $mgh$ to lift the box $h$ upward. If we analyze this work done, the external force acting on the box by us should be equal to the weight of the box. Therefore the net force is zero which in turn there is no acceleration. If there is no acceleration and the initial velocity of the box is also zero, how can the box move upward?
|
time command1 | command2 Does time apply to command1 or command1 | command2? If your answer is one of the two, how would you specify the other? Could you explain your answer based on the grammar of bash or how the shell interprets the command? When the shell parses the command, does it recognize time as a reserved word before recognizing | as a control operator? Does the order between recognizing time as a reserved word and recognizing | as a control operator determines whether time applies to command1 or command1 | command2? Thanks.
|
I want to time a command which consists of two separate commands with one piping output to another. For example, consider the two scripts below: $ cat foo.sh #!/bin/sh sleep 4 $ cat bar.sh #!/bin/sh sleep 2 Now, how can I get time to report the time taken by foo.sh | bar.sh (and yes, I know the pipe makes no sense here, but this is just an example)? It does work as expected if I run them sequentially in a subshell without piping: $ time ( foo.sh; bar.sh ) real 0m6.020s user 0m0.010s sys 0m0.003s But I can't get it to work when piping: $ time ( foo.sh | bar.sh ) real 0m4.009s user 0m0.007s sys 0m0.003s $ time ( { foo.sh | bar.sh; } ) real 0m4.008s user 0m0.007s sys 0m0.000s $ time sh -c "foo.sh | bar.sh " real 0m4.006s user 0m0.000s sys 0m0.000s I've read through a similar question () and also tried the standalone time executable: $ /usr/bin/time -p sh -c "foo.sh | bar.sh" real 4.01 user 0.00 sys 0.00 It doesn't even work if I create a third script which only runs the pipe: $ cat baz.sh #!/bin/sh foo.sh | bar.sh And then time that: $ time baz.sh real 0m4.009s user 0m0.003s sys 0m0.000s Interestingly, it doesn't appear as though time exits as soon as the first command is done. If I change bar.sh to: #!/bin/sh sleep 2 seq 1 5 And then time again, I was expecting the time output to be printed before the seq but it isn't: $ time ( { foo.sh | bar.sh; } ) 1 2 3 4 5 real 0m4.005s user 0m0.003s sys 0m0.000s Looks like time doesn't count the time it took to execute bar.sh despite waiting for it to finish before printing its report1. All tests were run on an Arch system and using bash 4.4.12(1)-release. I can only use bash for the project this is a part of so even if zsh or some other powerful shell can get around it, that won't be a viable solution for me. So, how can I get the time a set of piped commands took to run? And, while we're at it, why doesn't it work? It looks like time immediately exits as soon as the first command has finished. Why? I know I can get the individual times with something like this: ( time foo.sh ) 2>foo.time | ( time bar.sh ) 2> bar.time But I still would like to know if it's possible to time the whole thing as a single operation. 1 This doesn't seem to be a buffer issue, I tried running the scripts with unbuffered and stdbuf -i0 -o0 -e0 and the numbers were still printed before the time output.
|
I was curious seeing as how my work uses it, so will it run? or is there a way of getting it to run?
|
I want to know how to install Microsoft Office (specifically, Microsoft Office 2010) in Ubuntu? I am a die hard fan of MS Office and I want to know if there is a way I can use it in Ubuntu.
|
The image resolution for the respective megapixels remains the same whether the camera is of medium format or full frame or APS-C or even mobile phones. However the sensor sizes differ in these aspects. For example, the maximum output image resolution remains the same for a 20 megapixel full frame or APS-C sensors. How is the image impacted here?
|
I'm reading on sensor size: Digital compact cameras have substantially smaller sensors offering a similar number of pixels. As a consequence, the pixels are much smaller, which is a key reason for the image quality difference, especially in terms of noise and dynamic range. Could you please elaborate on the last sentence: what's the relation between sensor size and image quality? In particular, what are the advantages and disadvantages of a small sensor (of a compact camera, in contrast to a large sensor of a DSLR camera)?
|
I have a template function, that accepts a read-only parameter of the templated type. This is a library function for various platforms, from 8-bit (AVR8) to 32 bit (Cortex). How to pass this parameter? template< typename T > void f( const T p ){ ... } template< typename T > void f( const T & p ){ ... } By value is (probably) more efficient for parameter types that are smaller than a pointer, by reference is (probably) more efficient for parameter types that are larger than a pointer, and/or expensive to copy. Is there any standard way to abstract this choice, like template< typename T > void f( pass_efficiently< T > p ){ ... } ?
|
Is it better in C++ to pass by value or pass by constant reference? I am wondering which is better practice. I realize that pass by constant reference should provide for better performance in the program because you are not making a copy of the variable.
|
I have this simple setup of a sphere and a plane. The sphere is animated the first 15 seconds and then the rigid body is turned to dynamic. When the sphere hits the plane it starts bouncing and continues to do that till frame 250 and then stops bouncing (although the animation ends at frame 1000). Why is stopping with bouncing ?
|
I've set up the physics of a swinging wrecking ball and set the animation to run for 240 frames. This was not long enough for the entire "swing" of the ball-and-chain. I'm unable to reset the timeline, but I can set the end frame to (say) 1000 frames, but when I try to play the animation, the animation progress halts at frame 240 and I cannot get it to go any further. There are no markers or keyframes in the timeline. What should I do to "force reset" the animation-timeline, to allow changes to the length?
|
I'm trying to rotate an arrow based on an attribute but the arrow is off by 90 degrees. Is there a method for doing a mathematical expression on the attribute within the sld? I've gone over and but have not had any luck. It so far everything I have found pertains to arrows on lines and not arrows alone this is how Im currently rotating <se:PointSymbolizer> <se:Graphic> <se:Mark> <se:WellKnownName>arrow</se:WellKnownName> <se:Fill> <se:SvgParameter name="fill">#236de5</se:SvgParameter> </se:Fill> <se:Stroke> <se:SvgParameter name="stroke">#000000</se:SvgParameter> </se:Stroke> </se:Mark> <se:Size>30</se:Size> <se:Rotation> <ogc:PropertyName>heading</ogc:PropertyName> </se:Rotation> </se:Graphic> </se:PointSymbolizer> After reviewing along with reading the geoserver documentation again it is still unclear on where in the function you choose your operator. In my case I would like to use addition. The above question is for multiplication. I would be multiplying by 90 not adding 90, the documentation doe not have comparative examples of mathematical functions being used. I do not see in the documentation where <ogc:Mul> is described. I can assume that <ogc:Add> would work but where is this supported with documentation.
|
Is it possible to use simple Math in an SLD file on Geoserver? Suppose I want to read a text size property from a database and multiply its value, how can I do this? <sld:TextSymbolizer> ... <sld:CssParameter name="font-size"> <ogc:PropertyName>text_size</ogc:PropertyName> * 2.1 </sld:CssParameter> ... </sld:TextSymbolizer> This simple approach obviously doesn't work, so I thought there must be some way to achieve this.
|
I am using JUnit as a framework and I am trying to set parallel testing, everywhere I lookedonline I can only find examples for TestNG. I have the Grid up and running and I can test cross platform and cross browser but I need to wait for each test to finish in order for the next to start? I just need a basic example to get me started which I think will be of great help to others like me using JUnit.
|
I'm using JUnit 4.4 and Maven and I have a large number of long-running integration tests. When it comes to parallelizing test suites there are a few solutions that allow me to run each test method in a single test-class in parallel. But all of these require that I change the tests in one way or another. I really think it would be a much cleaner solution to run X different test classes in X threads in parallel. I have hundreds of tests so I don't really care about threading individual test-classes. Is there any way to do this?
|
I tried the following code: int a[4] = {0}; int b[4] = {5}; int c[4]; printf("%d %d %d %d %d %d\n", a[0], a[3] , b[0], b[3], c[0], c[3]); And got the following result: 0 0 5 0 random random While I get why I got random values for the c array, I don't understand why the assignation {5} does not work as {0} and only initialize the first element of the array. Is there a way to initialize array b elements to the same value different from 0? (without using a memset, or a for loop)
|
I have a large array in C (not C++ if that makes a difference). I want to initialize all members of the same value. I could swear I once knew a simple way to do this. I could use memset() in my case, but isn't there a way to do this that is built right into the C syntax?
|
Say I take this pic: and turn it into this (plus adding title and name of author): And then use it as a cover for a book at Amazon. Is that copyright infringement?
|
Under the U.S.'s Copyright Law, would it be an act of copyright infringement if we were to change the color of another artist's image to black and white? The answer to this question is provided . For further information, please check out , which is also provided below. This question was asked to make it clear for those who may think that by changing the color or the size of another artist's work, you did not violate the U.S Copyright Law, which is not true. Instead of trying to manipulate another artist's image to entitle ourselves as the "original" owner, the right and proper action is to request the permission to use it.
|
I bought a VPS Host that gave me only 1 IP Address which I used on my first domain name and it works without any problems. Now my second domain name I can't use the same ip address as it points to the first domain name. So I figured my only option was to use a GoDaddy hosted iframe redirection which redirects to a sub folder on my first domain which worked so far. Now I'm trying to load paypal from <?php headers() ?> and I get a permission error because of that iframe Refused to display 'https://www.paypal.com/cgi-bin/webscr?notify_url=&cmd=_cart&upload=1&business=removed&address_override=1' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. How do I avoid the Iframe solution for my second domain while not messing up my first domain? Somebody I forgot once told me it doesn't matter if you have 1 IP Address you could host multiple websites on it? how it that possible the DNS doesn't seem to work off ports afaik, yes I could host multiple websites on different folders but that's not what I call hosting a real website it has to be pointed by a domain name, so this iframe issue doesn't happen My server configuration is httpd (apache) that comes with CentOS 6 (Linux) operating system
|
I have a VPS that I've installed a Apache Web Server on. What I want to do is forward my own website domains to that server and host those websites' files inside my Apache Web Server. As far as I understand a DNS server is required to manage which domain is hosted where (IP-wise). But what I want to do is host my websites under the same IP address, the one that my web server has. How can I separate those websites' files inside my web server so I don't have to use http://host/foo for www.foo.com and http://host/bar for www.bar.com?
|
I want to install a package on Ubuntu 16.04, but receive an error when performing this command: $ sudo apt-get install libavcodec-dev libsdl1.2-dev xsltproc libbullet-dev libsdl1.2-dev libgoogle-glog-dev protobuf-compiler python-wstool E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it? What seems to be the problem?
|
I'm trying to run this command in the terminal: sudo apt install software-properties-common This is the error message I get: E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
|
I'm having trouble of understanding the very basic concept of returning a value in functions (JS etc). Why should I use function add(x,y){ result=x+y; return result; } add(5,3); instead of var result=0; function add(x,y){ result=x+y; } add(5,3); I guess it's about saving memory, isn't it?
|
What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?
|
Was taught in UK schools in the 80s. The city was a grubby but sterile environment with the usual tropes of bloody sports and I think high tech policing: then, through a big old fence was the country, very gentrified country piles, but the gent who takes our hero in has I think been lobotomised for being too passionate and thus we learn that aside from the wealth, amenities, health care, education, space and general comfort, the rich have it just as tough (!)
|
I am trying to remember a book I read years ago probably in the early 2000's, but I don't know how old the book is. But I do remember the basic plot. The world, or at least the country it is set in, is split in half. One half is a dystopian poorer world where crime rates are high and blood sports are the most popular form of entertainment. Libraries are all but abandoned. The protagonist lives in this half; he likes to read and longs to escape to the other half of the world/city. The world is split by a giant wall which I believe he tunnels under to get to the better half of the world, which is more like the countryside, rather than the city he has come from. Everyone is well educated and seems perfect. The protagonist gets to live with a wealthy family; the father takes him under his wing and teaches him about how to make bonsai trees. From this he finds out this father figure was once a rebel trying to let city people into their half, but bad behavior results in a partial lobotomy to make them calm. When the protagonist finds this out he tries to escape back to the city half of the world. For the life of me I cannot remember the books name. I've tried a Google search and get results like Nineteen Eighty-Four, which I expect the book I'm looking for took influence from.
|
It is given to me that r, s and t are prime numbers and that p, q are two positive integers such that the LCM of p and q is $$N=r^2t^4s^2 $$ and we want to find the numer of ordered pairs (p, q). Here since LCM of (p, q) is N then both the numbers must be divisors of N. If we calculate the total number of divisors of N we get 45 divisors which means that our (p, q) belongs to a set of these 45 divisors. Hence number of ways of choosing the two numbers are C(45,2) and then we arrange them in 2! ways thus getting $$ \binom{45 } { 2 } \cdot 2!$$ But my answer deviates completely from the actualy answet which truly implies that maybe my whole method is wrong. Can anybody help me in this problem?
|
If $r,s,t$ are prime numbers and $p,q$ are the positive integers such that LCM of $p,q$ is $r^2s^4t^2$, then the number of ordered pairs $(p,q)$ is? My attempt to the solution: Let $r^a s^b t^c$ be the LCM where $a=2,b=4,c=2$ Then the cases that arise are I case 1) $p$ has $r^as^bt^c$ then there are a total of $(2+1)(4+1)(2+1)$ options II case 1) $p$ has $r^as^b$ or $s^bt^c$,$r^at^c$ then there are total of $(2+1)(4+1)(2+1)(3)$ options. The answers comes out to be $45*4$ but the answer is $45*5$. Which case am I missing?
|
could you please tell me.. How to remove duplicates from list of objects by id In java
|
I have an ArrayList<String>, and I want to remove repeated strings from it. How can I do this?
|
How will accelerating a container with an ideal gas in it affect the conditions? My initial thoughts are that the ideal gas will collect at the opposite end of acceleration, which means that the volume drops. According to the formula $PV = nRT$, either the pressure or the temperature would have to raise as well. Firstly, which quantity would rise if I just squeezed a gas in normal conditions? I don't see how I can differentiate between squeezing isothermally and squeezing isobarically, so would they both rise? Upon further thought however, we are already experiencing 9.8 metres per second squared acceleration, and that has minimal effect at low heights. So does this mean at low accelerations the afore-mentioned effect can be ignored?
|
I was thinking about a situation where some gas is enclosed inside a container and kept in a train at rest. The train accelerates, gains a maximum speed and then suddenly stops. Would the temperature of the gas change during this process? I know that temperature is directly proportional to average kinetic energy of gas molecules but would the train during this process change the kinetic energy of the gas molecules inside the closed container?
|
Sorry if this has been asked, i searched but found nothing. We can take these as facts, that humans/roumlans/vulans/klingons/betazoids/etc can interbreed and have non-sterile children. We also know that some species like Vulans, Romulans, exist and that in earth mythology those same names occur as names of gods. It seems to me that this all seems to point to the fact that there was some founding species ages ago who spread their seed and culture through out the galaxy. From a genetic point of view, the fact that all these species can interbreed should show they diverged from the same genome at some period in the past, otherwise it is unprecedented to common medical knowledge. Also imagine that these same founder gods left their culture, their myths, their stories, etc, with their offspring they left on the planet. Our myths of the gods Vulcan and Romulus/Remus are really just imprints left from the original founders and interpreted/mis-interpreted by us. Anyway I am just wondering if someone has ever addressed this. Seems kinda interesting to me.
|
Romulus, Vulcan, Kronos, Orion,... and many other examples in the Star Trek universe. Is there a reason why they all have names from Roman and Greek mythology? is there a reason for that ? Are they just using Federation (human) designations when in fact they have different names in their respective culture's native languages?
|
I am a financial noob. I wonder what are some intrinsic value of stocks. While purchasing a stock, I expect that the price of it will go up, and I'll sell it to gain the price difference. However, the price is determined by the mass, which also applies to currencies or such. If no one wants the stock tomorrow, its price will be zero. What, then, contributes to the price of stocks, other than the expectation for the price to grow?
|
I read somewhere that companies are not required to pay dividends to shareholders (this is correct, yes?). If so, then if company A never pays dividends to its shareholders, then what is the point of owning company A's stock? Surely the right to one vote for company A's Board can't be that valuable. What is it that I'm missing?
|
Example: INPUT STRING : "I think we have to point certain things out to this man, and after that point some other things out to him as well" MY REGULAR EXPRESSION : (point).*(out) RETURNING WRONG RESULT : "I think we have to point certain things out to this man, and after that point some other things out to him as well" EXPECTING RESULT : "I think we have to point certain things out to this man, and after that point some other things out to him as well" How to change my regular expression to get the first groups occurrence ?
|
I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}: The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?
|
Can someone construct an example of this? i.e., $E[X^2] < \infty$ but $E[X^3] = \infty$. Results could be in terms of pdf, or cdf, or survival function. Justification would be appreciated
|
Suppose $X$ is a random real variable with zero mean and finite second moment $\langle X^2\rangle$. Under what conditions can we give a bound (upper/lower) for the third moment $\langle X^3\rangle$?
|
Featured questions are badly formatted Screenshot: App Version: 1.0.85 Device Manufacturer: Sony Device Model: SGP771 OS Version: 6.0.1 (1994651638)
|
The lines wrap so much on v1.0.85 that only a few items can be displayed. Edit: This is on the world's most low end tablet, Azpen A727. Screenshots of the old: and new, showing loss of quality
|
I searched for "stack overflow" in the search bar, but it doesn't list the results normally. Instead, it redirects me to the tag . Why is this happening, and how can I search for posts literally containing "stack overflow"?
|
If I search for kiosk on StackOverflow, I get redirected to an empty tag. Instead, I would like the search results for the general term, kiosk. Is there a way to force the search function to not redirect to a tag?
|
The Sheet has a column with cells populated by a dropdown list offering 3 choices: Good; Very Good; Rejected; In that context, it would be practical to sort the column according to a specific/custom order on those 3 values, no matter the alphabetic order. E.g.: Rejected in first, Very Good in second and Good in last. Filter offers only A-Z or Z-A. Is there a way to decide the order base on values in a column?
|
I'm using a Query in Google Sheets to pull data from another sheet. That query looks something like this: =QUERY('Raw Data'!A2:AB,"SELECT E, A, C, D, Y, R, S WHERE S = 'New York'",1 ) What I'd like to do, though, is build a custom sort order within the function so that the Query automatically sorts by rows that have "string1" in column E, followed by those that have "string2" in column E, etc etc. The desired order is not alphabetical so I can't use a clause to sort in ascending or descending order. I'd also prefer to do this without having to create another sheet where I rank my sort order in a table.
|
Let $x$ be an individual variable. What is $x = x$? An open sentence? Or a true proposition? Well, I think it's an open sentence, due to the presence of the free variable $x$. I do not know if I'm wrong. I ask for help.
|
I have a doubt. I need help. Can the basic axioms of equality be presented as "open axioms"? I) (reflexivity) $\qquad x = x$ II) (Substitutivity) $\qquad (x = y) \to \big(F (x, x) \to F (x, y)\big)$
|
I have Two dropdown boxes, if i select 4 from first select box, the value of the second dropdown value must be less than the first dropdown. if it fails show a custom error message, like that. <select name="t_dropdown" id="t_dropdown" class="form-control required"> <option value="">Select Value</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> <select name="p_dropdown" id="p_dropdown" class="form-control required"> <option value="">Select Value</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value=">6">>6</option> </select> Please let me know, how to do it using jquery validations.
|
How do you create a simple, custom rule using the jQuery Validate plugin (using ) that doesn't use a regex? For example, what function would create a rule that validates only if at least one of a group of checkboxes is checked?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.