qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
1,357
Mine is simple. I up vote any answer I think will be of value to the OP and to others with a similar problem. If I think the answer will only be of use to the OP (this usually stems from the question being very localized), I will up vote the answer when the answer takes a broad view of the question and goes sufficientl...
2014/07/27
[ "https://mathematica.meta.stackexchange.com/questions/1357", "https://mathematica.meta.stackexchange.com", "https://mathematica.meta.stackexchange.com/users/3066/" ]
I wasn't around when this was asked, but I feel I should also be putting in my take. My upvoting criterion is capriciously arbitrary: if I "enjoyed" reading the answer, or learned something genuinely new, or it is an answer that I would have written myself (also counting the case where it was written in a far better s...
My approach is subjective. I upvote answers from which I learn something new and unexpected. I sometimes downvote an answer when I have the impression that it too heavily relies on comments or answers already given. Sometimes I downvote questions if the OP doesn't participate ("Do my homework but don't bother me with q...
1,357
Mine is simple. I up vote any answer I think will be of value to the OP and to others with a similar problem. If I think the answer will only be of use to the OP (this usually stems from the question being very localized), I will up vote the answer when the answer takes a broad view of the question and goes sufficientl...
2014/07/27
[ "https://mathematica.meta.stackexchange.com/questions/1357", "https://mathematica.meta.stackexchange.com", "https://mathematica.meta.stackexchange.com/users/3066/" ]
I don't really have a firm "policy" - I have a tendency towards indecisiveness and I'd spend far too much time pondering whether or not an answer met my criteria (and whether or not my criteria needed revising!). So I vote fast and often, without overthinking it. If I read an answer and think "yeah, good answer", I up...
This is a Q & A page. When I need answers to specific questions, I search with keywords and usually find fair questions but even better answers. If a Q / A element solves my question or brings me a good bit closer to the solution I rate also old solutions positive. I do upvote "old" responses. One time "Questioner...
1,357
Mine is simple. I up vote any answer I think will be of value to the OP and to others with a similar problem. If I think the answer will only be of use to the OP (this usually stems from the question being very localized), I will up vote the answer when the answer takes a broad view of the question and goes sufficientl...
2014/07/27
[ "https://mathematica.meta.stackexchange.com/questions/1357", "https://mathematica.meta.stackexchange.com", "https://mathematica.meta.stackexchange.com/users/3066/" ]
I suppose I should answer this because: * According to [the records](https://mathematica.stackexchange.com/users?tab=Voters&filter=all) I have cast more votes in total than anyone else * I am also one of the "very high rep members" that m\_goldberg refers to * As a Community Moderator my conduct should be held to a hi...
This is a Q & A page. When I need answers to specific questions, I search with keywords and usually find fair questions but even better answers. If a Q / A element solves my question or brings me a good bit closer to the solution I rate also old solutions positive. I do upvote "old" responses. One time "Questioner...
1,357
Mine is simple. I up vote any answer I think will be of value to the OP and to others with a similar problem. If I think the answer will only be of use to the OP (this usually stems from the question being very localized), I will up vote the answer when the answer takes a broad view of the question and goes sufficientl...
2014/07/27
[ "https://mathematica.meta.stackexchange.com/questions/1357", "https://mathematica.meta.stackexchange.com", "https://mathematica.meta.stackexchange.com/users/3066/" ]
My policy is simple too: Try to act, **always**. It is important that this doesn't automatically means an up-vote. It includes down-votes, close-votes, reopen-votes or comments. The idea behind this is simple, if I take the time click on a post to read a question, I have already spend some of my time. Usually, I do thi...
My approach is subjective. I upvote answers from which I learn something new and unexpected. I sometimes downvote an answer when I have the impression that it too heavily relies on comments or answers already given. Sometimes I downvote questions if the OP doesn't participate ("Do my homework but don't bother me with q...
820,491
I got this question: Let $f$ be the integrable function defined on the interval $[0,2]$ by the rule: $f(x)= \begin{cases} 4x^3 & \text{if $0 \leq x \leq 1$} \\ x^2+2 & \text{if $1<x \leq 2$} \\ \end{cases}$ Does there exist real numbers $c1$ and $c2$ such that the function $F$ defined below is an antiderivative for...
2014/06/04
[ "https://math.stackexchange.com/questions/820491", "https://math.stackexchange.com", "https://math.stackexchange.com/users/108043/" ]
Usually one begins studying the $\sin$ function in connection with right triangles. Here the notion of angle is not questioned, so I shall stick with this intuitive concept. It follows that we have $\sin \theta$ defined for $0\leq\theta\leq{\pi\over2}$. As a next step one considers polar angles in the $(x,y)$-plane, m...
It follows from the definition of $\sin(\theta)$ as a ratio of length of $\theta$'s opposite side to hypotenuse ([Wikipedia](http://en.wikipedia.org/wiki/Sine)). As long as hypotenuse length is not equal to zero (otherwise the triangle degenerates into line or point), the division is a function which yields only one a...
820,491
I got this question: Let $f$ be the integrable function defined on the interval $[0,2]$ by the rule: $f(x)= \begin{cases} 4x^3 & \text{if $0 \leq x \leq 1$} \\ x^2+2 & \text{if $1<x \leq 2$} \\ \end{cases}$ Does there exist real numbers $c1$ and $c2$ such that the function $F$ defined below is an antiderivative for...
2014/06/04
[ "https://math.stackexchange.com/questions/820491", "https://math.stackexchange.com", "https://math.stackexchange.com/users/108043/" ]
The proof is based simply on similar triangles. If a right-angled triangle has an angle $\theta$ then the other two angles are $90^{\circ}$ and $(90-\theta)^{\circ}$. If two triangles have the same angles then they are similar. My picture shows two similar triangles: $\triangle OAB$ and $\triangle OA'B'$. Since $\th...
It follows from the definition of $\sin(\theta)$ as a ratio of length of $\theta$'s opposite side to hypotenuse ([Wikipedia](http://en.wikipedia.org/wiki/Sine)). As long as hypotenuse length is not equal to zero (otherwise the triangle degenerates into line or point), the division is a function which yields only one a...
820,491
I got this question: Let $f$ be the integrable function defined on the interval $[0,2]$ by the rule: $f(x)= \begin{cases} 4x^3 & \text{if $0 \leq x \leq 1$} \\ x^2+2 & \text{if $1<x \leq 2$} \\ \end{cases}$ Does there exist real numbers $c1$ and $c2$ such that the function $F$ defined below is an antiderivative for...
2014/06/04
[ "https://math.stackexchange.com/questions/820491", "https://math.stackexchange.com", "https://math.stackexchange.com/users/108043/" ]
I'm afraid that from a pre-calculus point of view, there is no consistent definition of the functional relationships that allows to discuss them as real functions (real valued in one real variable). The big gap to be closed is the notion of an angle. In geometry, an angle is defined by a pair of rays from the same poi...
It follows from the definition of $\sin(\theta)$ as a ratio of length of $\theta$'s opposite side to hypotenuse ([Wikipedia](http://en.wikipedia.org/wiki/Sine)). As long as hypotenuse length is not equal to zero (otherwise the triangle degenerates into line or point), the division is a function which yields only one a...
820,491
I got this question: Let $f$ be the integrable function defined on the interval $[0,2]$ by the rule: $f(x)= \begin{cases} 4x^3 & \text{if $0 \leq x \leq 1$} \\ x^2+2 & \text{if $1<x \leq 2$} \\ \end{cases}$ Does there exist real numbers $c1$ and $c2$ such that the function $F$ defined below is an antiderivative for...
2014/06/04
[ "https://math.stackexchange.com/questions/820491", "https://math.stackexchange.com", "https://math.stackexchange.com/users/108043/" ]
Usually one begins studying the $\sin$ function in connection with right triangles. Here the notion of angle is not questioned, so I shall stick with this intuitive concept. It follows that we have $\sin \theta$ defined for $0\leq\theta\leq{\pi\over2}$. As a next step one considers polar angles in the $(x,y)$-plane, m...
More precisely, in Analysis, **sin(x)** is defined as the limit of a specific series. Before, we know that the below series converges for every $x\in\mathbb{R}$: $$\sum\_{n=0}^\infty \frac{(-1)^n}{(2n+1)!}x^{2n+1}$$ And then we define : $$\sin(x)=\sum\_{n=0}^\infty \frac{(-1)^n}{(2n+1)!}x^{2n+1}$$ By this definition, ...
820,491
I got this question: Let $f$ be the integrable function defined on the interval $[0,2]$ by the rule: $f(x)= \begin{cases} 4x^3 & \text{if $0 \leq x \leq 1$} \\ x^2+2 & \text{if $1<x \leq 2$} \\ \end{cases}$ Does there exist real numbers $c1$ and $c2$ such that the function $F$ defined below is an antiderivative for...
2014/06/04
[ "https://math.stackexchange.com/questions/820491", "https://math.stackexchange.com", "https://math.stackexchange.com/users/108043/" ]
The proof is based simply on similar triangles. If a right-angled triangle has an angle $\theta$ then the other two angles are $90^{\circ}$ and $(90-\theta)^{\circ}$. If two triangles have the same angles then they are similar. My picture shows two similar triangles: $\triangle OAB$ and $\triangle OA'B'$. Since $\th...
More precisely, in Analysis, **sin(x)** is defined as the limit of a specific series. Before, we know that the below series converges for every $x\in\mathbb{R}$: $$\sum\_{n=0}^\infty \frac{(-1)^n}{(2n+1)!}x^{2n+1}$$ And then we define : $$\sin(x)=\sum\_{n=0}^\infty \frac{(-1)^n}{(2n+1)!}x^{2n+1}$$ By this definition, ...
820,491
I got this question: Let $f$ be the integrable function defined on the interval $[0,2]$ by the rule: $f(x)= \begin{cases} 4x^3 & \text{if $0 \leq x \leq 1$} \\ x^2+2 & \text{if $1<x \leq 2$} \\ \end{cases}$ Does there exist real numbers $c1$ and $c2$ such that the function $F$ defined below is an antiderivative for...
2014/06/04
[ "https://math.stackexchange.com/questions/820491", "https://math.stackexchange.com", "https://math.stackexchange.com/users/108043/" ]
I'm afraid that from a pre-calculus point of view, there is no consistent definition of the functional relationships that allows to discuss them as real functions (real valued in one real variable). The big gap to be closed is the notion of an angle. In geometry, an angle is defined by a pair of rays from the same poi...
More precisely, in Analysis, **sin(x)** is defined as the limit of a specific series. Before, we know that the below series converges for every $x\in\mathbb{R}$: $$\sum\_{n=0}^\infty \frac{(-1)^n}{(2n+1)!}x^{2n+1}$$ And then we define : $$\sin(x)=\sum\_{n=0}^\infty \frac{(-1)^n}{(2n+1)!}x^{2n+1}$$ By this definition, ...
820,491
I got this question: Let $f$ be the integrable function defined on the interval $[0,2]$ by the rule: $f(x)= \begin{cases} 4x^3 & \text{if $0 \leq x \leq 1$} \\ x^2+2 & \text{if $1<x \leq 2$} \\ \end{cases}$ Does there exist real numbers $c1$ and $c2$ such that the function $F$ defined below is an antiderivative for...
2014/06/04
[ "https://math.stackexchange.com/questions/820491", "https://math.stackexchange.com", "https://math.stackexchange.com/users/108043/" ]
Usually one begins studying the $\sin$ function in connection with right triangles. Here the notion of angle is not questioned, so I shall stick with this intuitive concept. It follows that we have $\sin \theta$ defined for $0\leq\theta\leq{\pi\over2}$. As a next step one considers polar angles in the $(x,y)$-plane, m...
If you want to verify this intuitively for yourself, then this answer could prove to be helpful. But remember, *this is not a proof*. First try to visualize what $\sin\theta$ looks like. If you need some help, this is what it looks like. [![Alt text](https://i.stack.imgur.com/vLA0e.gif)](https://i.stack.imgur.com/vLA...
820,491
I got this question: Let $f$ be the integrable function defined on the interval $[0,2]$ by the rule: $f(x)= \begin{cases} 4x^3 & \text{if $0 \leq x \leq 1$} \\ x^2+2 & \text{if $1<x \leq 2$} \\ \end{cases}$ Does there exist real numbers $c1$ and $c2$ such that the function $F$ defined below is an antiderivative for...
2014/06/04
[ "https://math.stackexchange.com/questions/820491", "https://math.stackexchange.com", "https://math.stackexchange.com/users/108043/" ]
The proof is based simply on similar triangles. If a right-angled triangle has an angle $\theta$ then the other two angles are $90^{\circ}$ and $(90-\theta)^{\circ}$. If two triangles have the same angles then they are similar. My picture shows two similar triangles: $\triangle OAB$ and $\triangle OA'B'$. Since $\th...
If you want to verify this intuitively for yourself, then this answer could prove to be helpful. But remember, *this is not a proof*. First try to visualize what $\sin\theta$ looks like. If you need some help, this is what it looks like. [![Alt text](https://i.stack.imgur.com/vLA0e.gif)](https://i.stack.imgur.com/vLA...
820,491
I got this question: Let $f$ be the integrable function defined on the interval $[0,2]$ by the rule: $f(x)= \begin{cases} 4x^3 & \text{if $0 \leq x \leq 1$} \\ x^2+2 & \text{if $1<x \leq 2$} \\ \end{cases}$ Does there exist real numbers $c1$ and $c2$ such that the function $F$ defined below is an antiderivative for...
2014/06/04
[ "https://math.stackexchange.com/questions/820491", "https://math.stackexchange.com", "https://math.stackexchange.com/users/108043/" ]
I'm afraid that from a pre-calculus point of view, there is no consistent definition of the functional relationships that allows to discuss them as real functions (real valued in one real variable). The big gap to be closed is the notion of an angle. In geometry, an angle is defined by a pair of rays from the same poi...
If you want to verify this intuitively for yourself, then this answer could prove to be helpful. But remember, *this is not a proof*. First try to visualize what $\sin\theta$ looks like. If you need some help, this is what it looks like. [![Alt text](https://i.stack.imgur.com/vLA0e.gif)](https://i.stack.imgur.com/vLA...
21,835,593
I'm running a forum on a VPS, running Percona DB, with PHP 5.5.8, Opcode caching, etc, it's all very speed orientated. I'm also running New Relic, (yes I have the t-shirt). As I'm tuning the application, optimising queries the forum is making to the DB for any query at the top of my time consumed list. Right now, th...
2014/02/17
[ "https://Stackoverflow.com/questions/21835593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/290847/" ]
Assuming `id_topic` is indexed, you're not going to get better. The only recommendation I would have is to look at the other indexes on this table and make sure you don't have redundant ones that include `num_views` in them. That would decrease update speed on this update. For example if you had the following indexes...
Not sure if that is an improvement, but you could check the following: How about only adding a row for each page hit to the table instead of locking and updating the row? And then using a count to get the results, and cache them instead of doing the count each time? (And maybe compacting the table once per day?)
58,155,951
I have 2 models: `city` and `hotel`. And they have 1 to n relationship. I want my user to be able to search in both models at once. So when I want my api to be called when ever my user type any word which is the frontends concern, but I get to problem when it comes to searching. I want to search in 2 models to see an...
2019/09/29
[ "https://Stackoverflow.com/questions/58155951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3357687/" ]
You can use `orWhere` like this ``` $result = City::orWhereHas('hotel', function (Builder $query) use($request) { $query->where('name', 'like', '%' . $request->name . '%'); })->orWhere('name', 'like', '%' . $request->name . '%')->get(); ``` hope this helps. Thanks
Try this and let me know what is happening Hotel.php ``` public function city() { return $this->belongsTo(City::class, 'id', 'city_id'); } ``` City.php ``` public function hotel() { return $this->hasMany(City::class, 'id', 'city_id'); } ``` In Controller ``` $city= City::find(1); ...
61,562,794
We currently have around 80 applications (Around 200 K8s replicas) writing 16-17 Million records everyday to kafka and some of those records were failing intermittently with time out and rebalance exceptions. The failure rate was less than 0.02%. We have validated and configured all the parameters properly as suggeste...
2020/05/02
[ "https://Stackoverflow.com/questions/61562794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12826187/" ]
You can declare the generic `T` as below ``` <T> void add(Collection<T> value) { for (T v : value) { if(v instanceof Boolean) { add((Boolean) v); } else if (v instanceof Integer) { add((Integer) v); } else { throw new Ille...
One could write something like: ``` void add(Collection<Object> value) { for (Object v : value) { if(v instanceof Integer){ add((int)v); } else if(v instanceof Boolean){ add((boolean)v); } } } ``` but that doesn't look elegant and nice.
189,183
My colleague and I are currently teaching "true infinitesimal calculus" (TIC), in the sense of calculus with infinitesimals, to a class of about 120 freshmen at our university, based on the book by Keisler <https://www.math.wisc.edu/~keisler/calc.html>. Two of my colleagues in Belgium are similarly teaching TIC at two ...
2014/12/08
[ "https://mathoverflow.net/questions/189183", "https://mathoverflow.net", "https://mathoverflow.net/users/28128/" ]
Since you mentioned University of Hawaii -- [David Ross](http://www.math.hawaii.edu/~ross/) regularly teaches nonstandard analysis and infinitesimal calculus at University of Hawaii in various forms, for instance * [MATH 649K](http://www.math.hawaii.edu/~ross/649.htm) (a regular grad course), Spring 2008 * [MATH 699...
So far I have been able to find out that true infinitesimal calculus was taught at the following universities: University of Hawaii; University of Illinois at Urbana-Champaign; University of Iowa; University of Wisconsin at Madison. Anyone who has either taught or studied in such courses there is requested to shar...
47,116
I'm trying to implement a full-duplex communication between my ESP8266 and a socketserver running on my laptop. In concrete I need each of the devices to initiate communication whenever it needs to. The ESP is measuring temperature all the time and when the temperature changes, I want the ESP to transmit the new temper...
2017/11/28
[ "https://arduino.stackexchange.com/questions/47116", "https://arduino.stackexchange.com", "https://arduino.stackexchange.com/users/38721/" ]
Every time you rewrite an Arduino, the previous code is completely wiped out (except for the bootloader, which doesn't change). You will not fill up your arduino -- it is not like a filesystem where you are continually adding new files. Each new programming/upload overwrites all the existing code. Uploading a blank s...
When you upload a new sketch the flash memory (Arduino hard disk) is deleted completely and the new sketch is loaded. If you want a blank code, just upload: ``` void setup() { } void loop() { } ```
18,096,939
We have 100 users in our system,While registering they have entered their zipcodes,Now what i need is if I enter any zipcode it should give me the result with distance between entered zipcode and other 100 users zipcode ? Is it possible to do, help me out if anybody know the solutions ?
2013/08/07
[ "https://Stackoverflow.com/questions/18096939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1459253/" ]
I'd do this in two parts: * A geocoding script, run once and results stored in persistent cache (eg. database). This way you will avoid hitting rate limits and speed up the final lookup. * Script for calculating distance, run when required or cache this too to build a lookup table storing distances between each postco...
There is a Zip Code API that does that - <http://zipcodedistanceapi.redline13.com/API>.
8,223,689
**RESOLVED** P.S.Because I don't have enough reputation to answer my own question right now so I put the solution in the question. I just start using Maven with my android project. I use a game engine called libgdx, it's not in the central repo, so I have to install it by myself. After check the instruction, I use th...
2011/11/22
[ "https://Stackoverflow.com/questions/8223689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/531223/" ]
I agree with Oleg's answer but if the problem persists after all his steps, check your global settings.xml file for possible usage of the tag. The mirror settings always point to the same repo and ignore any you might have defined in your project. e.g. your pom.xml has ``` <repositories> <repository> <id...
1. Run mvn help:effective-pom 2. Look into the `<repositories>` section, locate your `my-local-repo` and look up its *real* path (excluding file:// prefix) 3. run this command (from the link you found yourself) `mvn org.apache.maven.plugins:maven-install-plugin:2.3.1:install-file -Dfile=/path/to/your.jar -DgroupId=your...
234,560
I'm running a Linux server that - from time to time - faces heavy load and the conntrack table overflows. Since it's iptables firewall ruleset is very simple I'd like to turn it to stateless mode. I know that iptables can operate in stateful connection tracking mode and in a stateless mode. My firewall rules are all i...
2011/02/11
[ "https://serverfault.com/questions/234560", "https://serverfault.com", "https://serverfault.com/users/27254/" ]
You need to specify some iptables rules to prevent packets to be conntracked : ``` iptables -t raw -I PREROUTING -j NOTRACK iptables -t raw -I OUTPUT -j NOTRACK ```
Install [conntrack](http://linux.die.net/man/8/conntrack), and look at the output. I am pretty sure if you are stateless no connections will be displayed.
234,560
I'm running a Linux server that - from time to time - faces heavy load and the conntrack table overflows. Since it's iptables firewall ruleset is very simple I'd like to turn it to stateless mode. I know that iptables can operate in stateful connection tracking mode and in a stateless mode. My firewall rules are all i...
2011/02/11
[ "https://serverfault.com/questions/234560", "https://serverfault.com", "https://serverfault.com/users/27254/" ]
You need to specify some iptables rules to prevent packets to be conntracked : ``` iptables -t raw -I PREROUTING -j NOTRACK iptables -t raw -I OUTPUT -j NOTRACK ```
`cat /proc/net/ip_conntrack` shows all connection tracking. So, if it's stateless, the output of the above command should be empty. (Alternatively, use `cat /proc/net/nf_conntrack`)
11,199,540
I'm writing a simple image upload function with php + image magick using amazon ec2 + s3. The function basically receives the image, possibly compresses, and resizes it into 3~4 different sizes and the images get accessed more frequently than they are uploaded. Not being an expert on digital images, I'm still decidin...
2012/06/26
[ "https://Stackoverflow.com/questions/11199540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/811599/" ]
From my experience, you want to keep the original image. You might need it later if you decide to redesign site and change image formats globally. If you don't keep the original, you will not be able to re-process them in such situation. Re. computing power usage -- you should not worry about that. You resize only onc...
It's typically not a great idea to change the image format that a user uploaded. Certain formats have their own characteristics and benefits, and changing the format may not be ideal. For example, png has better support for transparency than gif or jpeg. So the conversion may cause your image to look odd.
11,199,540
I'm writing a simple image upload function with php + image magick using amazon ec2 + s3. The function basically receives the image, possibly compresses, and resizes it into 3~4 different sizes and the images get accessed more frequently than they are uploaded. Not being an expert on digital images, I'm still decidin...
2012/06/26
[ "https://Stackoverflow.com/questions/11199540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/811599/" ]
From my experience, you want to keep the original image. You might need it later if you decide to redesign site and change image formats globally. If you don't keep the original, you will not be able to re-process them in such situation. Re. computing power usage -- you should not worry about that. You resize only onc...
png and gif are better at compressing certain types of images, basically blocky graphics, while jpeg are better for photo-like images. So depending on the type of images your uploading there may not be a gain there in saving bandwidth/storage space. The computation to convert will be expensive and it will slow down yo...
28,090,391
I've 2 separate settings files for production and development and a common base.py settings file **base.py** ``` SECRET_KEY = r"!@#$%^&123456" ``` **prod.py** ``` from .base import * SECRET_KEY = os.environ['SECRET_KEY'] ``` **manage.py** ``` #!/usr/bin/env python import os import sys if __name__ == "__mai...
2015/01/22
[ "https://Stackoverflow.com/questions/28090391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3767206/" ]
I think you are trying this locally, and don't have the `SECRET_KEY` setup in your environment. Set it using ``` export SECRET_KEY="somesecretvalue" ``` and then running `python manage.py shell --settings=entri.settings.prod` should work fine.
I use os.getenv('SECRET\_KEY'), instead of os.environ['SECRET\_KEY'] ``` print os.getenv('SECRET_KEY') #returns None if KEY doesn't exist print os.getenv('SECRET_KEY', 0) #will return 0 if KEY doesn't exist ``` my python version is 2.7.12
28,090,391
I've 2 separate settings files for production and development and a common base.py settings file **base.py** ``` SECRET_KEY = r"!@#$%^&123456" ``` **prod.py** ``` from .base import * SECRET_KEY = os.environ['SECRET_KEY'] ``` **manage.py** ``` #!/usr/bin/env python import os import sys if __name__ == "__mai...
2015/01/22
[ "https://Stackoverflow.com/questions/28090391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3767206/" ]
I think you are trying this locally, and don't have the `SECRET_KEY` setup in your environment. Set it using ``` export SECRET_KEY="somesecretvalue" ``` and then running `python manage.py shell --settings=entri.settings.prod` should work fine.
In Django while trying to secure/hide my secret\_key, my problem was even after setting the secret\_key using the set command on windows, I still got a 'Key must not be empty' error. I solved that by removing all the spaces before and after the assignment operator in the command. In your cmd, write set SECRET\_KEY="kk...
28,090,391
I've 2 separate settings files for production and development and a common base.py settings file **base.py** ``` SECRET_KEY = r"!@#$%^&123456" ``` **prod.py** ``` from .base import * SECRET_KEY = os.environ['SECRET_KEY'] ``` **manage.py** ``` #!/usr/bin/env python import os import sys if __name__ == "__mai...
2015/01/22
[ "https://Stackoverflow.com/questions/28090391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3767206/" ]
I use os.getenv('SECRET\_KEY'), instead of os.environ['SECRET\_KEY'] ``` print os.getenv('SECRET_KEY') #returns None if KEY doesn't exist print os.getenv('SECRET_KEY', 0) #will return 0 if KEY doesn't exist ``` my python version is 2.7.12
In Django while trying to secure/hide my secret\_key, my problem was even after setting the secret\_key using the set command on windows, I still got a 'Key must not be empty' error. I solved that by removing all the spaces before and after the assignment operator in the command. In your cmd, write set SECRET\_KEY="kk...
303,054
I am designing a hunger games map for single player, and wanted to know if I could save myself some work (like 1000 or so command blocks), by doing something like this. ``` /fill ~0 ~0 ~0 ~20 ~10 ~20 minecraft:prismarine 0 replace minecraft:chest{"LootTable:minecraft:chests/HG_Loot_Table"} ``` to replace all prismar...
2017/03/14
[ "https://gaming.stackexchange.com/questions/303054", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/181811/" ]
While you've reversed the order of the blocks specified, `/fill` is not capable of replacing specific blocks if the block you're placing is a tile entity (in this case, a chest). In those cases you can **only** specify NBT data for the tile entity: ``` /fill ~0 ~0 ~0 ~20 ~10 ~20 minecraft:chest 0 replace {LootTable:"m...
You kind of mixed it up, what you want is this: `/fill ~0 ~0 ~0 ~20 ~10 ~20 minecraft:chest 0 replace minecraft:prismarine {"LootTable:minecraft:chests/HG_Loot_Table"}`. This is the proper syntax: `fill <x1> <y1> <z1> <x2> <y2> <z2> <block> <dataValue|state> replace [replaceTileName] [replaceDataValue]`
15,038,444
I currently have this run method that I would like 3 seperate threads to access and wait for another thread to notify. ``` public void run(){ try { System.out.println(this.name + " waits on the table..."); /// waits for agent to signal that new ingredients have been passed out wait(); } catch(...
2013/02/23
[ "https://Stackoverflow.com/questions/15038444", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1533010/" ]
To use [`wait()`](http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.2.1) you have to [own the monitor](http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.2). [You acquire the ownership by using `synchronize`](http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.1). In y...
When the first thread goes to wait it releases the lock. So other threads can acquire the lock
62,079,167
I am unable to locate the HTML table with class `table-light border rounded`. Do you all know why this may be? Here is my attempt: ``` import requests from bs4 import BeautifulSoup url = "https://iextrading.com/trading/eligible-symbols/" r = requests.get(url) soup = BeautifulSoup(r.text, 'html.parser') table = soup....
2020/05/29
[ "https://Stackoverflow.com/questions/62079167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7570259/" ]
It might be the case that the elements are rendered using js AFTER the page has loaded. So, you only get the page and not the javascript rendered parts. I personally refer selenium. You might want to look into <https://medium.com/@hoppy/how-to-test-or-scrape-javascript-rendered-websites-with-python-selenium-a-beginne...
The site is loading data with a xhr request you have to inspect them from networks tab and find out from where they are loading data. In your case they are loading data from [Here](https://iextrading.com/api/mobile/refdata)
62,079,167
I am unable to locate the HTML table with class `table-light border rounded`. Do you all know why this may be? Here is my attempt: ``` import requests from bs4 import BeautifulSoup url = "https://iextrading.com/trading/eligible-symbols/" r = requests.get(url) soup = BeautifulSoup(r.text, 'html.parser') table = soup....
2020/05/29
[ "https://Stackoverflow.com/questions/62079167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7570259/" ]
As Swapnil mentioned, you get that data from the api request. Now why he didn't go further and actually offer the solution to get the table fully, I'm not sure. But that api returns the data in json format. So it's a matter of reading in the json, then use pandas to turn into a table: ``` import requests import panda...
It might be the case that the elements are rendered using js AFTER the page has loaded. So, you only get the page and not the javascript rendered parts. I personally refer selenium. You might want to look into <https://medium.com/@hoppy/how-to-test-or-scrape-javascript-rendered-websites-with-python-selenium-a-beginne...
62,079,167
I am unable to locate the HTML table with class `table-light border rounded`. Do you all know why this may be? Here is my attempt: ``` import requests from bs4 import BeautifulSoup url = "https://iextrading.com/trading/eligible-symbols/" r = requests.get(url) soup = BeautifulSoup(r.text, 'html.parser') table = soup....
2020/05/29
[ "https://Stackoverflow.com/questions/62079167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7570259/" ]
As Swapnil mentioned, you get that data from the api request. Now why he didn't go further and actually offer the solution to get the table fully, I'm not sure. But that api returns the data in json format. So it's a matter of reading in the json, then use pandas to turn into a table: ``` import requests import panda...
The site is loading data with a xhr request you have to inspect them from networks tab and find out from where they are loading data. In your case they are loading data from [Here](https://iextrading.com/api/mobile/refdata)
32,944,473
I'm looking to upload a `cvs` into a db and then find how many times an instance of data appears to create a pick list. I upload a cvs in to the db leaving me with SKU and QUANTITY I use to get the data from the db but I cant seam to find a way to group that data so their is only 1 sku for each item and a number of...
2015/10/05
[ "https://Stackoverflow.com/questions/32944473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5259895/" ]
Starting with Git v2.11.0, the `git submodule` interface accepts the `--progress` option which you can use. It does exactly what you expect. See: <https://github.com/git/git/commit/72c5f88311dab7149fcca1f6029414ccb776fee8> `--progress` wasn't announced in the help text (`git submodule --help`) in earlier versions but...
The closest I came was to use this command: ``` git fetch --recurse-submodules=yes --jobs=10 ``` This is not giving you a progress bar. But it speeds up the fetching of the repositories. This helped me a whole lot on a microservice project with ~30 submodules. Of course, you can combine this with other commands aft...
39,465,941
*Agile Web Development With Rails4* gives an example test code like this: *carts\_controller\_test.rb*: ``` test "should destroy cart" do assert_difference('Cart.count', -1) do session[:cart_id] = @cart.id ... ``` However, when I try this in rails 5 ``` >>rake test ``` an error is raised > > NoMethod...
2016/09/13
[ "https://Stackoverflow.com/questions/39465941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5022713/" ]
I have found the answer in the [Unable to set session hash in Rails 5 controller test](https://stackoverflow.com/questions/37796129/unable-to-set-session-hash-in-rails-5-controller-test) Test controllers of rails5 inherit from ActionDispatch::IntegrationTest by default while rails4 from ActionController::TestCase. Ses...
The following code works: ``` delete cart_url(@cart), params: { 'session' => { :cart_id => @cart.id }} ```
39,465,941
*Agile Web Development With Rails4* gives an example test code like this: *carts\_controller\_test.rb*: ``` test "should destroy cart" do assert_difference('Cart.count', -1) do session[:cart_id] = @cart.id ... ``` However, when I try this in rails 5 ``` >>rake test ``` an error is raised > > NoMethod...
2016/09/13
[ "https://Stackoverflow.com/questions/39465941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5022713/" ]
In Rails 5 it is no longer possible to access session in controller tests: <http://blog.napcs.com/2016/07/03/upgrading-rails-5-controller-tests/>. The suggestion is to access the controller method that would set the appropriate session value for you. This comment shows and example of how you might work around this limi...
I have found the answer in the [Unable to set session hash in Rails 5 controller test](https://stackoverflow.com/questions/37796129/unable-to-set-session-hash-in-rails-5-controller-test) Test controllers of rails5 inherit from ActionDispatch::IntegrationTest by default while rails4 from ActionController::TestCase. Ses...
39,465,941
*Agile Web Development With Rails4* gives an example test code like this: *carts\_controller\_test.rb*: ``` test "should destroy cart" do assert_difference('Cart.count', -1) do session[:cart_id] = @cart.id ... ``` However, when I try this in rails 5 ``` >>rake test ``` an error is raised > > NoMethod...
2016/09/13
[ "https://Stackoverflow.com/questions/39465941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5022713/" ]
In Rails 5 it is no longer possible to access session in controller tests: <http://blog.napcs.com/2016/07/03/upgrading-rails-5-controller-tests/>. The suggestion is to access the controller method that would set the appropriate session value for you. This comment shows and example of how you might work around this limi...
The following code works: ``` delete cart_url(@cart), params: { 'session' => { :cart_id => @cart.id }} ```
675,854
What formula returns speed of a planet, e.g. Earth orbiting Sun, on its ellipse like trajectory orbiting Sun? Input variables have to be $a,b$ (ellipse) and some more, because the speed of the planet movement is not constant, as I have read.
2021/11/07
[ "https://physics.stackexchange.com/questions/675854", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/318616/" ]
You can calculate the speed $v$ of a planet at any time using the so-called [vis-viva equation](https://en.wikipedia.org/wiki/Vis-viva_equation) $$v=\sqrt{GM\left(\frac{2}{r}-\frac{1}{a}\right)}$$ where * $G$ is Newton's gravitational constant, * $M$ is the mass of the sun, * $r$ is the planet's distance from the sun...
We can use the concept of **Orbital Velocity**, it is a concept of satellites revolving around planets. Here, in your case, we can use it for planet to sun revolutions. [Also check this out for a better visualization](https://planetfacts.org/orbital-speed-of-planets-in-order/) **ORBITAL VELOCITY:** orbital velocity, ve...
675,854
What formula returns speed of a planet, e.g. Earth orbiting Sun, on its ellipse like trajectory orbiting Sun? Input variables have to be $a,b$ (ellipse) and some more, because the speed of the planet movement is not constant, as I have read.
2021/11/07
[ "https://physics.stackexchange.com/questions/675854", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/318616/" ]
According to Kepler's laws, a planet orbits the Sun in an ellipse, with the Sun at a focus of the ellipse. Of course, this is only an approximation, because it assumes that the Sun doesn't move, and it ignores the gravity of other bodies, but it's a good approximation. An ellipse with semimajor axis $a$, semiminor axi...
We can use the concept of **Orbital Velocity**, it is a concept of satellites revolving around planets. Here, in your case, we can use it for planet to sun revolutions. [Also check this out for a better visualization](https://planetfacts.org/orbital-speed-of-planets-in-order/) **ORBITAL VELOCITY:** orbital velocity, ve...
675,854
What formula returns speed of a planet, e.g. Earth orbiting Sun, on its ellipse like trajectory orbiting Sun? Input variables have to be $a,b$ (ellipse) and some more, because the speed of the planet movement is not constant, as I have read.
2021/11/07
[ "https://physics.stackexchange.com/questions/675854", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/318616/" ]
You can calculate the speed $v$ of a planet at any time using the so-called [vis-viva equation](https://en.wikipedia.org/wiki/Vis-viva_equation) $$v=\sqrt{GM\left(\frac{2}{r}-\frac{1}{a}\right)}$$ where * $G$ is Newton's gravitational constant, * $M$ is the mass of the sun, * $r$ is the planet's distance from the sun...
According to Kepler's laws, a planet orbits the Sun in an ellipse, with the Sun at a focus of the ellipse. Of course, this is only an approximation, because it assumes that the Sun doesn't move, and it ignores the gravity of other bodies, but it's a good approximation. An ellipse with semimajor axis $a$, semiminor axi...
66,947
During a *pidyon haben* (redemption of 1st born son) the father gives the Cohen 5 silver shekels (or equivalent value.) I'm not sure how much 5 silver shekel is worth in today's U.S. funds. But silver values are rising. I assume the Cohen can keep this money and do what he wishes, or must he use it only for holy purpo...
2016/01/05
[ "https://judaism.stackexchange.com/questions/66947", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/5275/" ]
The answer is from my own experience as a bechor. :) Or at least what i've been told about it... When i was born (<20 years ago) my parents used 5 silver dollar coins for the pidyon, in accordance with common practice (and i suppose what their rabbi said). The kohen returned the money to us as a gift later (which m...
At my son's Pidyon HaBen, I went to a coin store and bought 10 silver half dollars. The kohen kept them. I was then in the Chabura learning Yoreh Deah in Bais Medrash Govoha. The Kohen was Rav Shmuel Meir Katz, even then was involved in p'sak in the Yeshiva. Now he is an accepted poseik for decades. As for the legal ...
66,947
During a *pidyon haben* (redemption of 1st born son) the father gives the Cohen 5 silver shekels (or equivalent value.) I'm not sure how much 5 silver shekel is worth in today's U.S. funds. But silver values are rising. I assume the Cohen can keep this money and do what he wishes, or must he use it only for holy purpo...
2016/01/05
[ "https://judaism.stackexchange.com/questions/66947", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/5275/" ]
In my experience (having being the *Cohen* receiving the *pidyon haben* money), a *Cohen* who does many *pidyonei banim* will often own his own set of 5 silver *shekalim* (I do not, but was gifted a set by someone to whom I later regifted it). The *Cohen* will then sell the silver coins to the father for an agreed upon...
The answer is from my own experience as a bechor. :) Or at least what i've been told about it... When i was born (<20 years ago) my parents used 5 silver dollar coins for the pidyon, in accordance with common practice (and i suppose what their rabbi said). The kohen returned the money to us as a gift later (which m...
66,947
During a *pidyon haben* (redemption of 1st born son) the father gives the Cohen 5 silver shekels (or equivalent value.) I'm not sure how much 5 silver shekel is worth in today's U.S. funds. But silver values are rising. I assume the Cohen can keep this money and do what he wishes, or must he use it only for holy purpo...
2016/01/05
[ "https://judaism.stackexchange.com/questions/66947", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/5275/" ]
In my experience (having being the *Cohen* receiving the *pidyon haben* money), a *Cohen* who does many *pidyonei banim* will often own his own set of 5 silver *shekalim* (I do not, but was gifted a set by someone to whom I later regifted it). The *Cohen* will then sell the silver coins to the father for an agreed upon...
At my son's Pidyon HaBen, I went to a coin store and bought 10 silver half dollars. The kohen kept them. I was then in the Chabura learning Yoreh Deah in Bais Medrash Govoha. The Kohen was Rav Shmuel Meir Katz, even then was involved in p'sak in the Yeshiva. Now he is an accepted poseik for decades. As for the legal ...
33,116,446
As the title says, how can i know if the gecko browser completed loading a web page? I know there is document\_completed event. But it will get triggered for every time a web page loads. Are there any other ways to check if the current webpage is completed loading.
2015/10/14
[ "https://Stackoverflow.com/questions/33116446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5441062/" ]
My Solotion in vb.net and GeckoFX v45.0.34.0 you can use this tool convert to c# (<http://converter.telerik.com/>): ``` Private vWeb As GeckoWebBrowser = New GeckoWebBrowser Private Property pageready As Boolean = False Private Sub WaitForPageLoad() AddHandler vWeb.DocumentCompleted, New EventHandler(Of GeckoDocu...
``` Do While WebBrowser.IsBusy = True Application.DoEvents() Loop ``` Works for me. After `WebBrowser.Navigate` you have to wait for some time (I use 1 second) before `IsBusy` becomes `True`
15,368,049
I have one textfield type text, when I'm typing a number of a plate, if it exist, it will must show one alert, but the event keyup doesn't work. JS ``` $('#mat').keyup(function(){ var matric = $('#mat').val(); $.ajax({type: "POST", url: "compruebaVeh.php", dat...
2013/03/12
[ "https://Stackoverflow.com/questions/15368049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2043074/" ]
in php code, the assignment `$_POST['matric']=$mat;` should be reversed `$mat = $_POST['matric'];` also your script may echo `ok` many times depending on the data in your DB, the loop should become: ``` while ($stmt->fetch()) { if($matricula==$mat){ echo 'ok'; break; } } ``` so now you c...
You'll want to use the new [Promise interface](http://api.jquery.com/category/deferred-object/) JQuery method, like so: ``` $('#mat').on('keyup', function (event) { var matric = $(event.target).val(); var response = $.post("compruebaVeh.php", {data: matric}); response.done(function (data) { aler...
15,368,049
I have one textfield type text, when I'm typing a number of a plate, if it exist, it will must show one alert, but the event keyup doesn't work. JS ``` $('#mat').keyup(function(){ var matric = $('#mat').val(); $.ajax({type: "POST", url: "compruebaVeh.php", dat...
2013/03/12
[ "https://Stackoverflow.com/questions/15368049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2043074/" ]
I'm going to fix this so you don't hammer your backend like this is set up to do. A [question on SO already deals with this](https://stackoverflow.com/questions/4220126/run-javascript-function-when-user-finishes-typing-instead-of-on-key-up) ``` //setup before functions var typingTimer; //timer identifier var doneTypin...
You'll want to use the new [Promise interface](http://api.jquery.com/category/deferred-object/) JQuery method, like so: ``` $('#mat').on('keyup', function (event) { var matric = $(event.target).val(); var response = $.post("compruebaVeh.php", {data: matric}); response.done(function (data) { aler...
15,368,049
I have one textfield type text, when I'm typing a number of a plate, if it exist, it will must show one alert, but the event keyup doesn't work. JS ``` $('#mat').keyup(function(){ var matric = $('#mat').val(); $.ajax({type: "POST", url: "compruebaVeh.php", dat...
2013/03/12
[ "https://Stackoverflow.com/questions/15368049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2043074/" ]
in php code, the assignment `$_POST['matric']=$mat;` should be reversed `$mat = $_POST['matric'];` also your script may echo `ok` many times depending on the data in your DB, the loop should become: ``` while ($stmt->fetch()) { if($matricula==$mat){ echo 'ok'; break; } } ``` so now you c...
Make an exit statement in php code and try again. ``` while ($stmt->fetch()) { if($matricula==$mat){ echo 'ok'; } } exit; ```
15,368,049
I have one textfield type text, when I'm typing a number of a plate, if it exist, it will must show one alert, but the event keyup doesn't work. JS ``` $('#mat').keyup(function(){ var matric = $('#mat').val(); $.ajax({type: "POST", url: "compruebaVeh.php", dat...
2013/03/12
[ "https://Stackoverflow.com/questions/15368049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2043074/" ]
in php code, the assignment `$_POST['matric']=$mat;` should be reversed `$mat = $_POST['matric'];` also your script may echo `ok` many times depending on the data in your DB, the loop should become: ``` while ($stmt->fetch()) { if($matricula==$mat){ echo 'ok'; break; } } ``` so now you c...
in the most cases there id #mat is defined more than one time in the html code, also the keyup might work, but the url may not be correct, and it will not trigger the success branch. Other than that i see $\_POST['matric']=$mat; wich isn't quite right. Probably you wantedd $mat = $\_POST['matric']. You can check using ...
15,368,049
I have one textfield type text, when I'm typing a number of a plate, if it exist, it will must show one alert, but the event keyup doesn't work. JS ``` $('#mat').keyup(function(){ var matric = $('#mat').val(); $.ajax({type: "POST", url: "compruebaVeh.php", dat...
2013/03/12
[ "https://Stackoverflow.com/questions/15368049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2043074/" ]
in php code, the assignment `$_POST['matric']=$mat;` should be reversed `$mat = $_POST['matric'];` also your script may echo `ok` many times depending on the data in your DB, the loop should become: ``` while ($stmt->fetch()) { if($matricula==$mat){ echo 'ok'; break; } } ``` so now you c...
I'm going to fix this so you don't hammer your backend like this is set up to do. A [question on SO already deals with this](https://stackoverflow.com/questions/4220126/run-javascript-function-when-user-finishes-typing-instead-of-on-key-up) ``` //setup before functions var typingTimer; //timer identifier var doneTypin...
15,368,049
I have one textfield type text, when I'm typing a number of a plate, if it exist, it will must show one alert, but the event keyup doesn't work. JS ``` $('#mat').keyup(function(){ var matric = $('#mat').val(); $.ajax({type: "POST", url: "compruebaVeh.php", dat...
2013/03/12
[ "https://Stackoverflow.com/questions/15368049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2043074/" ]
I'm going to fix this so you don't hammer your backend like this is set up to do. A [question on SO already deals with this](https://stackoverflow.com/questions/4220126/run-javascript-function-when-user-finishes-typing-instead-of-on-key-up) ``` //setup before functions var typingTimer; //timer identifier var doneTypin...
Make an exit statement in php code and try again. ``` while ($stmt->fetch()) { if($matricula==$mat){ echo 'ok'; } } exit; ```
15,368,049
I have one textfield type text, when I'm typing a number of a plate, if it exist, it will must show one alert, but the event keyup doesn't work. JS ``` $('#mat').keyup(function(){ var matric = $('#mat').val(); $.ajax({type: "POST", url: "compruebaVeh.php", dat...
2013/03/12
[ "https://Stackoverflow.com/questions/15368049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2043074/" ]
I'm going to fix this so you don't hammer your backend like this is set up to do. A [question on SO already deals with this](https://stackoverflow.com/questions/4220126/run-javascript-function-when-user-finishes-typing-instead-of-on-key-up) ``` //setup before functions var typingTimer; //timer identifier var doneTypin...
in the most cases there id #mat is defined more than one time in the html code, also the keyup might work, but the url may not be correct, and it will not trigger the success branch. Other than that i see $\_POST['matric']=$mat; wich isn't quite right. Probably you wantedd $mat = $\_POST['matric']. You can check using ...
54,212,290
I am unable to retrieve data from mongodb. Problem is: the code `Article.find({});` is not working to retrieve data from database. I am using WebStorm IDE. I want to retrieve all the data from data base. Please help me to find the error in my code. database.js ``` module.exports = { database:'mongodb://localho...
2019/01/16
[ "https://Stackoverflow.com/questions/54212290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8224429/" ]
move database connection code into db.js and import same in article.js db.js ```js let uristring = <your connection string or import database.js>; mongoose.connect(uristring); // When successfully connected mongoose.connection.on('connected', function() { console.log('Mongoose connection open to cluster'); }...
First lets bring in your model, ``` require('./models/article'); ``` the create a variable for the model ``` const Article = mongoose.model('Article'); ``` Next to display your articles from db ``` app.get('/', (req, res) => { Article.find({}).then(Article => { res.render('index', {Article:Article})...
1,983,710
I'm now learning a bit of MATLAB and I have two versions of it. Version 4.2c, that I use on my emulated Windows 3.11 and the lastest one, that I use on my Windows Vista. Here is a screenshot of it: [MATLAB 4.2c On My Windows 3.11 http://img9.imageshack.us/img9/4042/matlabv4.png](http://img9.imageshack.us/img9/4042/...
2009/12/31
[ "https://Stackoverflow.com/questions/1983710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/126353/" ]
**EDIT:** Now that I see the screenshot, I realize you really *are* referring to MATLAB Version 4.2c (R7). I thought perhaps you were mistakenly referring to the MATLAB *Compiler* instead, since I didn't think anyone would still be using [a version that's over 15 years old](http://en.wikipedia.org/wiki/MATLAB#Release_h...
what *isn't* different? I have no idea how much new has been added since then. I remember first learning about MATLAB around then and turning my nose up at the program... my guess is that you would find all the basic operations the same, because I remember these things working: * vector & matrix manipulation * elemen...
1,983,710
I'm now learning a bit of MATLAB and I have two versions of it. Version 4.2c, that I use on my emulated Windows 3.11 and the lastest one, that I use on my Windows Vista. Here is a screenshot of it: [MATLAB 4.2c On My Windows 3.11 http://img9.imageshack.us/img9/4042/matlabv4.png](http://img9.imageshack.us/img9/4042/...
2009/12/31
[ "https://Stackoverflow.com/questions/1983710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/126353/" ]
**EDIT:** Now that I see the screenshot, I realize you really *are* referring to MATLAB Version 4.2c (R7). I thought perhaps you were mistakenly referring to the MATLAB *Compiler* instead, since I didn't think anyone would still be using [a version that's over 15 years old](http://en.wikipedia.org/wiki/MATLAB#Release_h...
There are a huge number of differences since that time. New variable types (logical, sparse, cell arrays, uint(N), single, etc.), objects, anonymous and nested functions, gui tools, toolbox changes galore. Having said that, I have code written in 1988 (20+ years) that still runs with essentially no change. (Maybe vers...
47,915,011
I'm using the same code that is still working for a new version of equipment the company the bought. I can't communicate with the equipment in vb in visual studio (the language of the last code I wrote). But I can make a simple code in LabVIEW to see if the equipment is communicating and it is. So, my question is wh...
2017/12/20
[ "https://Stackoverflow.com/questions/47915011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5315478/" ]
``` *IDN?\n ``` is not the same as : ``` mySerialport.WriteLine("*idn?" + Chr(10)) ``` The former is capitalized while the later is not and it may cause an issue depending on the instrument. You are using the serial port, so the most important thing to consider is the baud rate. It is possible that the later mode...
The question isn’t what language LabVIEW uses. LabVIEW is a programming environment with library APIs to speak to lots of hardware and the ability for anyone to write code to speak to even more hardware. The question is “what language does the HARDWARE speak?” To answer that, you’d post what kind of hardware it is and ...
47,915,011
I'm using the same code that is still working for a new version of equipment the company the bought. I can't communicate with the equipment in vb in visual studio (the language of the last code I wrote). But I can make a simple code in LabVIEW to see if the equipment is communicating and it is. So, my question is wh...
2017/12/20
[ "https://Stackoverflow.com/questions/47915011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5315478/" ]
``` *IDN?\n ``` is not the same as : ``` mySerialport.WriteLine("*idn?" + Chr(10)) ``` The former is capitalized while the later is not and it may cause an issue depending on the instrument. You are using the serial port, so the most important thing to consider is the baud rate. It is possible that the later mode...
"The only thing I see from the labview GUI is \*IDN?/n" That sounds more like you are using the VISA Test Panel in MAX (Measurement and Automation eXplorer). It is related to LabVIEW in that it is also a tool developed by National Instruments (NI). But it does not sound like you have actually touched LabVIEW itself. ...
47,915,011
I'm using the same code that is still working for a new version of equipment the company the bought. I can't communicate with the equipment in vb in visual studio (the language of the last code I wrote). But I can make a simple code in LabVIEW to see if the equipment is communicating and it is. So, my question is wh...
2017/12/20
[ "https://Stackoverflow.com/questions/47915011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5315478/" ]
``` *IDN?\n ``` is not the same as : ``` mySerialport.WriteLine("*idn?" + Chr(10)) ``` The former is capitalized while the later is not and it may cause an issue depending on the instrument. You are using the serial port, so the most important thing to consider is the baud rate. It is possible that the later mode...
As SeanJ pointed out \*IDN?\n is not the same as "idn?". Further, make sure that space character in your calling method is visible. Sometimes machines require you to manually type "\r\n" for complete carriage return.
10,783,546
AIR's `spark.components.WindowedApplication` would resize its contents automatically as I manually stretch window bounds or maximize/restore it. But `spark.components.Window` class does not provide such functionality 'out of the box': the contents of the Window don't change their size as I stretch/maximize/restore the ...
2012/05/28
[ "https://Stackoverflow.com/questions/10783546", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1093712/" ]
Assuming you mean the `spark.components.Window`, this is based on the skinnablecontainer so there shouldn't be anything preventing you from using a percentbased layout / constraint. ```mxml <s:Window xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="l...
The solution is to listen to a RESIZE event coming from the NativeWindow and then to manually set `stageWidth` and `stageHeight` on Window's `stage` instance. See code below. ``` override public function open(openWindowActive:Boolean=true):void { super.open(openWindowActive); if (nativeWindow) { chrom...
16,950,367
Is there a way to use inherited methods with a same name from few classes, but without casting? ``` public class A { someMethod(A a) {} } public class B { someMethod(B b) {} } public class Client : A, B { public Client() { someMethod(new A()); someMethod(new B()); } } ```
2013/06/05
[ "https://Stackoverflow.com/questions/16950367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2394921/" ]
You can achieve this with explicit interface implementation and composition: ``` public interface IA { someMethod(A a) {} } public interface IB { someMethod(A a) {} } public class A : IA { someMethod(B b) {} } public class B : IB { someMethod(B b) {} } public class Client : IA, IB { public Client...
There are some non-language tools for this sort of thing. Check out [PostSharp](http://www.postsharp.net/).
16,950,367
Is there a way to use inherited methods with a same name from few classes, but without casting? ``` public class A { someMethod(A a) {} } public class B { someMethod(B b) {} } public class Client : A, B { public Client() { someMethod(new A()); someMethod(new B()); } } ```
2013/06/05
[ "https://Stackoverflow.com/questions/16950367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2394921/" ]
No. Doing that as you describe is called multiple inheritance. Doing the same thing without inheritance on a subset of the methods is called a mixin . Neither is a feature of c#, sorry.
There are some non-language tools for this sort of thing. Check out [PostSharp](http://www.postsharp.net/).
46,294,071
**Requirement is to display the selected option inside controller and populate other select on the basis of currently selected option.** Below the HTML code snippet: ``` <html ng-app="myApp"> .... <section ng-controller="myCtrl"> <select ng-model="selectedName" ng-options="x for x in category"> </select> <selec...
2017/09/19
[ "https://Stackoverflow.com/questions/46294071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7526865/" ]
[Async](https://caolan.github.io/async/) provides control flow methods allowing to do so. Using [async.each](https://caolan.github.io/async/docs.html#each): ``` async.each(openFiles, function(file, callback) { // Perform operation on file here. console.log('Processing file ' + file); if( file.length > 3...
If you don't want to use a library, you can code it yourself. It would also be very instructive. I took your issue and coded a dummy async loop : ```js function listTopSongs(query) { return new Promise(async(resolve, reject) => { //add async here in order to do asynchronous calls const str = query.split...
46,294,071
**Requirement is to display the selected option inside controller and populate other select on the basis of currently selected option.** Below the HTML code snippet: ``` <html ng-app="myApp"> .... <section ng-controller="myCtrl"> <select ng-model="selectedName" ng-options="x for x in category"> </select> <selec...
2017/09/19
[ "https://Stackoverflow.com/questions/46294071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7526865/" ]
[Async](https://caolan.github.io/async/) provides control flow methods allowing to do so. Using [async.each](https://caolan.github.io/async/docs.html#each): ``` async.each(openFiles, function(file, callback) { // Perform operation on file here. console.log('Processing file ' + file); if( file.length > 3...
Since you are using promise, you can do something like this ``` exports.listTopSongs = function(query) { return Promise.resolve(true).then(function(){ var str = query.split(","); var promises = str.map(function(s){ return sampleFn(str[i], 'sample'); }); return Promise.al...
82,342
Background: I do not wish to debate their merits or lack thereof, but of late I have been experimenting with a couple of "digital art frames" - these are 37" diagonal, 1920x1080 HD, in a nice frame, optimized for maximum viewing angle and low power consumption. The Question: the frame can be hung in landscape (1920x10...
2016/08/29
[ "https://photo.stackexchange.com/questions/82342", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/56201/" ]
I don't know of any standards. I agree that it's frustrating. The ubiquity of cheap 16:9 panels design for television makes it understandable that these digital frames aren't available in more photography-friendly aspect ratios. I think one reason that there's no standard is that it really depends on your content and ...
> > I find that I do not have a lot of content in those aspect ratios. > > > Maybe you do and you don't know it. Back when I used to do chemical photography, I had an enlarging easel that held paper in four sizes: 8x10, 5x7, 3.5x5 and 2.5x3.5. There wasn't a whole lot of aspect ratio diversity there, with one at ...
82,342
Background: I do not wish to debate their merits or lack thereof, but of late I have been experimenting with a couple of "digital art frames" - these are 37" diagonal, 1920x1080 HD, in a nice frame, optimized for maximum viewing angle and low power consumption. The Question: the frame can be hung in landscape (1920x10...
2016/08/29
[ "https://photo.stackexchange.com/questions/82342", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/56201/" ]
I don't know of any standards. I agree that it's frustrating. The ubiquity of cheap 16:9 panels design for television makes it understandable that these digital frames aren't available in more photography-friendly aspect ratios. I think one reason that there's no standard is that it really depends on your content and ...
**The natural choice is to let the user decide.** One of the standout features of using an electronic display compared to print is that you can change not only what images to display, but how to display them. You can see a fine example on any HDTV set. Because there's still plenty of 4:3 video being broadcast every da...
82,342
Background: I do not wish to debate their merits or lack thereof, but of late I have been experimenting with a couple of "digital art frames" - these are 37" diagonal, 1920x1080 HD, in a nice frame, optimized for maximum viewing angle and low power consumption. The Question: the frame can be hung in landscape (1920x10...
2016/08/29
[ "https://photo.stackexchange.com/questions/82342", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/56201/" ]
I don't know of any standards. I agree that it's frustrating. The ubiquity of cheap 16:9 panels design for television makes it understandable that these digital frames aren't available in more photography-friendly aspect ratios. I think one reason that there's no standard is that it really depends on your content and ...
Thank you, everyone - and I do mean that literally, as everyone who responded had something worthwhile to offer. I was especially drawn to the notion of laying things out as a triptych or mosaic - basically, treating the screen real-estate as a space to lay down whatever 'story' I have in mind. Most of the fun I've b...
82,342
Background: I do not wish to debate their merits or lack thereof, but of late I have been experimenting with a couple of "digital art frames" - these are 37" diagonal, 1920x1080 HD, in a nice frame, optimized for maximum viewing angle and low power consumption. The Question: the frame can be hung in landscape (1920x10...
2016/08/29
[ "https://photo.stackexchange.com/questions/82342", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/56201/" ]
An option I don't see mentioned above is the same approach that videographers generally take as they will target a particular aspect ratio, but ensure the content works in other aspect ratios. Obviously this only works if you can go back to the source (and it works with the content). I will usually compose my pictures...
> > I find that I do not have a lot of content in those aspect ratios. > > > Maybe you do and you don't know it. Back when I used to do chemical photography, I had an enlarging easel that held paper in four sizes: 8x10, 5x7, 3.5x5 and 2.5x3.5. There wasn't a whole lot of aspect ratio diversity there, with one at ...
82,342
Background: I do not wish to debate their merits or lack thereof, but of late I have been experimenting with a couple of "digital art frames" - these are 37" diagonal, 1920x1080 HD, in a nice frame, optimized for maximum viewing angle and low power consumption. The Question: the frame can be hung in landscape (1920x10...
2016/08/29
[ "https://photo.stackexchange.com/questions/82342", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/56201/" ]
An option I don't see mentioned above is the same approach that videographers generally take as they will target a particular aspect ratio, but ensure the content works in other aspect ratios. Obviously this only works if you can go back to the source (and it works with the content). I will usually compose my pictures...
**The natural choice is to let the user decide.** One of the standout features of using an electronic display compared to print is that you can change not only what images to display, but how to display them. You can see a fine example on any HDTV set. Because there's still plenty of 4:3 video being broadcast every da...
82,342
Background: I do not wish to debate their merits or lack thereof, but of late I have been experimenting with a couple of "digital art frames" - these are 37" diagonal, 1920x1080 HD, in a nice frame, optimized for maximum viewing angle and low power consumption. The Question: the frame can be hung in landscape (1920x10...
2016/08/29
[ "https://photo.stackexchange.com/questions/82342", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/56201/" ]
An option I don't see mentioned above is the same approach that videographers generally take as they will target a particular aspect ratio, but ensure the content works in other aspect ratios. Obviously this only works if you can go back to the source (and it works with the content). I will usually compose my pictures...
Thank you, everyone - and I do mean that literally, as everyone who responded had something worthwhile to offer. I was especially drawn to the notion of laying things out as a triptych or mosaic - basically, treating the screen real-estate as a space to lay down whatever 'story' I have in mind. Most of the fun I've b...
82,342
Background: I do not wish to debate their merits or lack thereof, but of late I have been experimenting with a couple of "digital art frames" - these are 37" diagonal, 1920x1080 HD, in a nice frame, optimized for maximum viewing angle and low power consumption. The Question: the frame can be hung in landscape (1920x10...
2016/08/29
[ "https://photo.stackexchange.com/questions/82342", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/56201/" ]
Another option is to combine several (related) images, maybe with a large main image and two or three smaller ones filling the space. A 37" screen seems large enough to support that. You could make a mosaic, or a triptychon, or any other arrangement.
> > I find that I do not have a lot of content in those aspect ratios. > > > Maybe you do and you don't know it. Back when I used to do chemical photography, I had an enlarging easel that held paper in four sizes: 8x10, 5x7, 3.5x5 and 2.5x3.5. There wasn't a whole lot of aspect ratio diversity there, with one at ...
82,342
Background: I do not wish to debate their merits or lack thereof, but of late I have been experimenting with a couple of "digital art frames" - these are 37" diagonal, 1920x1080 HD, in a nice frame, optimized for maximum viewing angle and low power consumption. The Question: the frame can be hung in landscape (1920x10...
2016/08/29
[ "https://photo.stackexchange.com/questions/82342", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/56201/" ]
Another option is to combine several (related) images, maybe with a large main image and two or three smaller ones filling the space. A 37" screen seems large enough to support that. You could make a mosaic, or a triptychon, or any other arrangement.
**The natural choice is to let the user decide.** One of the standout features of using an electronic display compared to print is that you can change not only what images to display, but how to display them. You can see a fine example on any HDTV set. Because there's still plenty of 4:3 video being broadcast every da...
82,342
Background: I do not wish to debate their merits or lack thereof, but of late I have been experimenting with a couple of "digital art frames" - these are 37" diagonal, 1920x1080 HD, in a nice frame, optimized for maximum viewing angle and low power consumption. The Question: the frame can be hung in landscape (1920x10...
2016/08/29
[ "https://photo.stackexchange.com/questions/82342", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/56201/" ]
Another option is to combine several (related) images, maybe with a large main image and two or three smaller ones filling the space. A 37" screen seems large enough to support that. You could make a mosaic, or a triptychon, or any other arrangement.
Thank you, everyone - and I do mean that literally, as everyone who responded had something worthwhile to offer. I was especially drawn to the notion of laying things out as a triptych or mosaic - basically, treating the screen real-estate as a space to lay down whatever 'story' I have in mind. Most of the fun I've b...
66,058,468
``` import random number = random.sample(range(0,9999), 10) print(number, file = open("output.txt","a")) ``` I want to add (prefix) characters to a randomly generated number. e.g. `AAA(number)` so that it will become something like `AAA4525`. What's the best way to do it?
2021/02/05
[ "https://Stackoverflow.com/questions/66058468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15149936/" ]
``` import random PREFIX = 'AAA' numbers = random.sample(range(0,10000), 10) # to include also 9999 with open("output.txt","a") as f: for number in numbers: f.write(f'{PREFIX}{number:0>4d}\n') ```
Simple Concatenation can do the trick for you .. ``` def converter(): string="AAA" ans= string+str(number) return ans ```
19,344,009
I have this part of query: ``` IF(orders = NULL OR orders = '', "value1', 'value2') ``` which works with empty cells but not with null ones, any help? When it's NULL it doesn't make anything but when it's '' it runs the query
2013/10/13
[ "https://Stackoverflow.com/questions/19344009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2758571/" ]
It's spelled `orders is NULL` (not `orders = NULL`).
You have to use ``` IF(orders IS NULL OR orders = '', 'value1', 'value2') ``` instead
69,007,111
I'm having trouble getting two-way data binding to work in Vue 3 between a parent component and its child component, which is a form. **parent.vue** ``` <template> <h5>{{ record.title }}</h5> <ChildForm v-model:record="record"></ChildForm> </template> <script lang="ts"> export default { data() { record: un...
2021/09/01
[ "https://Stackoverflow.com/questions/69007111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/437270/" ]
Not going to accept this answer but this does work... ``` "test": "c8 mocha --recursive './lib/**/*.spec.mjs' --require esm" ```
NYC does not yet support Node native ESM. See <https://github.com/istanbuljs/nyc/issues/1287>
69,007,111
I'm having trouble getting two-way data binding to work in Vue 3 between a parent component and its child component, which is a form. **parent.vue** ``` <template> <h5>{{ record.title }}</h5> <ChildForm v-model:record="record"></ChildForm> </template> <script lang="ts"> export default { data() { record: un...
2021/09/01
[ "https://Stackoverflow.com/questions/69007111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/437270/" ]
Not going to accept this answer but this does work... ``` "test": "c8 mocha --recursive './lib/**/*.spec.mjs' --require esm" ```
Thanks Jackie, this worked for me. Using your example: ``` "test": "c8 mocha './tests/**/*.test.js' --exit" ```
515,581
I'm using xubuntu 18.04(Linux 4.15.0-48-generic x86\_64 )(buildd@lgw01-amd64-036) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #51-Ubuntu SMP), after installing anki as shown on anki's web: ``` $ tar xjf Downloads/anki-2.1.12-amd64.tar.bz2 $ cd anki-2.1.12-linux-amd64 $ sudo make install ``` I got this message when...
2019/04/26
[ "https://unix.stackexchange.com/questions/515581", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/350070/" ]
With Xubuntu 18.04, you have (2) options to install **anki** without going through the trouble of compiling it yourself: 1. From the Ubuntu repos: `sudo apt install anki` (version 2.1.0) 2. From Flatpak: `flatpak install flathub net.ankiweb.Anki` (version 2.1.13)
Try reinstalling libxcb: ``` sudo apt purge libxcb sudo apt install libxcb ``` If the package is not found use this: ``` sudo apt purge libxcb1 sudo apt install libxcb1 ``` More info about the packages: `https://packages.ubuntu.com/source/bionic/libxcb` Also, post the output of `ldd /usr/lib/qt/plugins/platform...
515,581
I'm using xubuntu 18.04(Linux 4.15.0-48-generic x86\_64 )(buildd@lgw01-amd64-036) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #51-Ubuntu SMP), after installing anki as shown on anki's web: ``` $ tar xjf Downloads/anki-2.1.12-amd64.tar.bz2 $ cd anki-2.1.12-linux-amd64 $ sudo make install ``` I got this message when...
2019/04/26
[ "https://unix.stackexchange.com/questions/515581", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/350070/" ]
Try: Going to your platforms directory and performing, `ldd libqxcb.so`. Make sure that all the dependencys listed are installed and that they are in your collection of shared librarys. If not install or place them in your shared libs.
Try reinstalling libxcb: ``` sudo apt purge libxcb sudo apt install libxcb ``` If the package is not found use this: ``` sudo apt purge libxcb1 sudo apt install libxcb1 ``` More info about the packages: `https://packages.ubuntu.com/source/bionic/libxcb` Also, post the output of `ldd /usr/lib/qt/plugins/platform...
2,086,243
How to retrieve file icons associated with the file types and add them with the items of Listview in vb.net I read about SHGetFileInfo but I didn't understand anything from that please give me solution or please explain me ho system works with the .net controls in details
2010/01/18
[ "https://Stackoverflow.com/questions/2086243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/235501/" ]
Having looked up [SHGetFileInfo](http://msdn.microsoft.com/en-us/library/bb762179(VS.85).aspx) I can see why you're confused by it, but I think it might be slightly overkill for what I think you're trying to do i.e. enumerating the contents of a folder and adding items to the Listview. If we have a form that contains ...
If you know the file name of the file whose icon you want, you can use the [`System.Drawing.Icon.ExtractAssociatedIcon`](http://msdn.microsoft.com/en-us/library/system.drawing.icon.extractassociatedicon.aspx "MSDN: Icon.ExtractAssociatedIcon Method") function for that purpose. e.g. ``` Icon ico = System.Drawing.Icon.E...
36,013,110
I was trying to build a scraper to catch league names and odds..Been able to catch the odds but matching the two doesnt seem to work..here is my code: ``` import requests from bs4 import BeautifulSoup r = requests.get("http://www.elitebetkenya.com/coupon.php") soup = BeautifulSoup(r.content) for i in soup.findAll("t...
2016/03/15
[ "https://Stackoverflow.com/questions/36013110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6066704/" ]
Suppose you have a function: ``` def sinus2d(x, y): return np.sin(x) + np.sin(y) ``` and you want, for example, to see what it looks like in the range 0 to 2\*pi. How would you do it? There `np.meshgrid` comes in: ``` xx, yy = np.meshgrid(np.linspace(0,2*np.pi,100), np.linspace(0,2*np.pi,100)) z = sinus2d(xx, y...
Behind the scenes: ```py import numpy as np def meshgrid(x , y): XX = [] YY = [] for colm in range(len(y)): XX.append([]) YY.append([]) for row in range(len(x)): XX[colm].append(x[row]) YY[colm].append(y[colm]) return np.asarray(XX), np.asarray(YY) ``` ...
36,013,110
I was trying to build a scraper to catch league names and odds..Been able to catch the odds but matching the two doesnt seem to work..here is my code: ``` import requests from bs4 import BeautifulSoup r = requests.get("http://www.elitebetkenya.com/coupon.php") soup = BeautifulSoup(r.content) for i in soup.findAll("t...
2016/03/15
[ "https://Stackoverflow.com/questions/36013110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6066704/" ]
Suppose you have a function: ``` def sinus2d(x, y): return np.sin(x) + np.sin(y) ``` and you want, for example, to see what it looks like in the range 0 to 2\*pi. How would you do it? There `np.meshgrid` comes in: ``` xx, yy = np.meshgrid(np.linspace(0,2*np.pi,100), np.linspace(0,2*np.pi,100)) z = sinus2d(xx, y...
meshgrid helps in creating a rectangular grid from two 1-D arrays of all pairs of points from the two arrays. ``` x = np.array([0, 1, 2, 3, 4]) y = np.array([0, 1, 2, 3, 4]) ``` Now, if you have defined a function f(x,y) and you wanna apply this function to all the possible combination of points from the arrays 'x' ...
36,013,110
I was trying to build a scraper to catch league names and odds..Been able to catch the odds but matching the two doesnt seem to work..here is my code: ``` import requests from bs4 import BeautifulSoup r = requests.get("http://www.elitebetkenya.com/coupon.php") soup = BeautifulSoup(r.content) for i in soup.findAll("t...
2016/03/15
[ "https://Stackoverflow.com/questions/36013110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6066704/" ]
Courtesy of Microsoft Excel:  [![enter image description here](https://i.stack.imgur.com/8Mbig.png)](https://i.stack.imgur.com/8Mbig.png)
Actually the purpose of `np.meshgrid` is already mentioned in the documentation: > > [`np.meshgrid`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.meshgrid.html) > > > Return coordinate matrices from coordinate vectors. > > > Make N-D coordinate arrays for vectorized evaluations of N-D scalar/vector ...
36,013,110
I was trying to build a scraper to catch league names and odds..Been able to catch the odds but matching the two doesnt seem to work..here is my code: ``` import requests from bs4 import BeautifulSoup r = requests.get("http://www.elitebetkenya.com/coupon.php") soup = BeautifulSoup(r.content) for i in soup.findAll("t...
2016/03/15
[ "https://Stackoverflow.com/questions/36013110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6066704/" ]
Courtesy of Microsoft Excel:  [![enter image description here](https://i.stack.imgur.com/8Mbig.png)](https://i.stack.imgur.com/8Mbig.png)
Suppose you have a function: ``` def sinus2d(x, y): return np.sin(x) + np.sin(y) ``` and you want, for example, to see what it looks like in the range 0 to 2\*pi. How would you do it? There `np.meshgrid` comes in: ``` xx, yy = np.meshgrid(np.linspace(0,2*np.pi,100), np.linspace(0,2*np.pi,100)) z = sinus2d(xx, y...
36,013,110
I was trying to build a scraper to catch league names and odds..Been able to catch the odds but matching the two doesnt seem to work..here is my code: ``` import requests from bs4 import BeautifulSoup r = requests.get("http://www.elitebetkenya.com/coupon.php") soup = BeautifulSoup(r.content) for i in soup.findAll("t...
2016/03/15
[ "https://Stackoverflow.com/questions/36013110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6066704/" ]
Actually the purpose of `np.meshgrid` is already mentioned in the documentation: > > [`np.meshgrid`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.meshgrid.html) > > > Return coordinate matrices from coordinate vectors. > > > Make N-D coordinate arrays for vectorized evaluations of N-D scalar/vector ...
meshgrid helps in creating a rectangular grid from two 1-D arrays of all pairs of points from the two arrays. ``` x = np.array([0, 1, 2, 3, 4]) y = np.array([0, 1, 2, 3, 4]) ``` Now, if you have defined a function f(x,y) and you wanna apply this function to all the possible combination of points from the arrays 'x' ...
36,013,110
I was trying to build a scraper to catch league names and odds..Been able to catch the odds but matching the two doesnt seem to work..here is my code: ``` import requests from bs4 import BeautifulSoup r = requests.get("http://www.elitebetkenya.com/coupon.php") soup = BeautifulSoup(r.content) for i in soup.findAll("t...
2016/03/15
[ "https://Stackoverflow.com/questions/36013110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6066704/" ]
meshgrid helps in creating a rectangular grid from two 1-D arrays of all pairs of points from the two arrays. ``` x = np.array([0, 1, 2, 3, 4]) y = np.array([0, 1, 2, 3, 4]) ``` Now, if you have defined a function f(x,y) and you wanna apply this function to all the possible combination of points from the arrays 'x' ...
Most of the times you just need `list(zip(X,Y))` where `X = np.linspace(x)` and `Y = np.linspace(y)`
36,013,110
I was trying to build a scraper to catch league names and odds..Been able to catch the odds but matching the two doesnt seem to work..here is my code: ``` import requests from bs4 import BeautifulSoup r = requests.get("http://www.elitebetkenya.com/coupon.php") soup = BeautifulSoup(r.content) for i in soup.findAll("t...
2016/03/15
[ "https://Stackoverflow.com/questions/36013110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6066704/" ]
### Basic Idea Given possible x values, `xs`, (think of them as the tick-marks on the x-axis of a plot) and possible y values, `ys`, `meshgrid` generates the corresponding set of (x, y) grid points---analogous to `set((x, y) for x in xs for y in yx)`. For example, if `xs=[1,2,3]` and `ys=[4,5,6]`, we'd get the set of ...
Behind the scenes: ```py import numpy as np def meshgrid(x , y): XX = [] YY = [] for colm in range(len(y)): XX.append([]) YY.append([]) for row in range(len(x)): XX[colm].append(x[row]) YY[colm].append(y[colm]) return np.asarray(XX), np.asarray(YY) ``` ...
36,013,110
I was trying to build a scraper to catch league names and odds..Been able to catch the odds but matching the two doesnt seem to work..here is my code: ``` import requests from bs4 import BeautifulSoup r = requests.get("http://www.elitebetkenya.com/coupon.php") soup = BeautifulSoup(r.content) for i in soup.findAll("t...
2016/03/15
[ "https://Stackoverflow.com/questions/36013110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6066704/" ]
Suppose you have a function: ``` def sinus2d(x, y): return np.sin(x) + np.sin(y) ``` and you want, for example, to see what it looks like in the range 0 to 2\*pi. How would you do it? There `np.meshgrid` comes in: ``` xx, yy = np.meshgrid(np.linspace(0,2*np.pi,100), np.linspace(0,2*np.pi,100)) z = sinus2d(xx, y...
**Short answer** The purpose of `meshgrid` is to help [replace Python loops](https://realpython.com/numpy-array-programming/) (slow interpreted code) by vectorized operations within C NumPy library. Borrowed from [this site](https://python.developpez.com/tutoriels/graphique-2d/matplotlib/#LIV-K). [![enter image desc...
36,013,110
I was trying to build a scraper to catch league names and odds..Been able to catch the odds but matching the two doesnt seem to work..here is my code: ``` import requests from bs4 import BeautifulSoup r = requests.get("http://www.elitebetkenya.com/coupon.php") soup = BeautifulSoup(r.content) for i in soup.findAll("t...
2016/03/15
[ "https://Stackoverflow.com/questions/36013110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6066704/" ]
Courtesy of Microsoft Excel:  [![enter image description here](https://i.stack.imgur.com/8Mbig.png)](https://i.stack.imgur.com/8Mbig.png)
**Short answer** The purpose of `meshgrid` is to help [replace Python loops](https://realpython.com/numpy-array-programming/) (slow interpreted code) by vectorized operations within C NumPy library. Borrowed from [this site](https://python.developpez.com/tutoriels/graphique-2d/matplotlib/#LIV-K). [![enter image desc...
36,013,110
I was trying to build a scraper to catch league names and odds..Been able to catch the odds but matching the two doesnt seem to work..here is my code: ``` import requests from bs4 import BeautifulSoup r = requests.get("http://www.elitebetkenya.com/coupon.php") soup = BeautifulSoup(r.content) for i in soup.findAll("t...
2016/03/15
[ "https://Stackoverflow.com/questions/36013110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6066704/" ]
Courtesy of Microsoft Excel:  [![enter image description here](https://i.stack.imgur.com/8Mbig.png)](https://i.stack.imgur.com/8Mbig.png)
meshgrid helps in creating a rectangular grid from two 1-D arrays of all pairs of points from the two arrays. ``` x = np.array([0, 1, 2, 3, 4]) y = np.array([0, 1, 2, 3, 4]) ``` Now, if you have defined a function f(x,y) and you wanna apply this function to all the possible combination of points from the arrays 'x' ...
9,440,600
Suppose I want to change 'abc' to 'bac' in Python. What would be the best way to do it? I am thinking of the following ``` tmp = list('abc') tmp[0],tmp[1] = tmp[1],tmp[0] result = ''.join(tmp) ```
2012/02/25
[ "https://Stackoverflow.com/questions/9440600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/534298/" ]
You are never editing a string "in place", strings are immutable. You could do it with a list but that is wasting code and memory. Why not just do: ``` x = 'abc' result = x[1] + x[0] + x[2:] ``` or (personal fav) ``` import re re.sub('(.)(.)', r'\2\1','abc') ``` This might be cheating, but if you really want...
You cannot modify strings in place, they are immutable. If you want to modify a list in place, you can do it like in your example, or you could use slice assignment if the elements you want to replace can be accessed with a slice: ``` tmp = list('abc') tmp[0:2] = tmp[1::-1] # replace tmp[0:2] with tmp[1::-1], which ...
273,000
When downloading big files it necessary to pause the download many times. A big file can be downloaded by using `wget`. First start download, then kill `wget`, then resume download by `wget -c`. I want to pause downloads too many times depending on events such as power failure, Network unavailability, etc... and wan...
2013/03/27
[ "https://askubuntu.com/questions/273000", "https://askubuntu.com", "https://askubuntu.com/users/123897/" ]
I strongly recommend `Flareget`. it's free but you have to buy browser integration. here is it's features: [Developer Webpage](http://flareget.com/) [Download flareget](http://flareget.com/download/) **Dynamic File Segmentation:** It uses a robust dynamic file segmentation algorithm to speed up the download. It supp...
Try Flareget, it has all and has its own PPA.
273,000
When downloading big files it necessary to pause the download many times. A big file can be downloaded by using `wget`. First start download, then kill `wget`, then resume download by `wget -c`. I want to pause downloads too many times depending on events such as power failure, Network unavailability, etc... and wan...
2013/03/27
[ "https://askubuntu.com/questions/273000", "https://askubuntu.com", "https://askubuntu.com/users/123897/" ]
despite you seem to be looking for something very specific, and despite you solved it already, I would still like to recommend `uGet`, I've been using it sindce 12.04 (12.10 64 bits now) and I am very satisfied with the results!
If you are in 10.04 get a copy of downloader for X ``` sudo apt-get install d4x ``` Will do everything you want :) <https://apps.ubuntu.com/cat/applications/d4x/>
273,000
When downloading big files it necessary to pause the download many times. A big file can be downloaded by using `wget`. First start download, then kill `wget`, then resume download by `wget -c`. I want to pause downloads too many times depending on events such as power failure, Network unavailability, etc... and wan...
2013/03/27
[ "https://askubuntu.com/questions/273000", "https://askubuntu.com", "https://askubuntu.com/users/123897/" ]
I'm using JDownloader. However, AFAIK running instance cannot be controlled by command line. On the other hand, there are add-ons like: - JD Scheduler or - JD RemoteControl which can do a great job. See: <http://jdownloader.org/home/features> <http://jdownloader.org/home/addons> (I guess that there will be more too...
I strongly recommend `Flareget`. it's free but you have to buy browser integration. here is it's features: [Developer Webpage](http://flareget.com/) [Download flareget](http://flareget.com/download/) **Dynamic File Segmentation:** It uses a robust dynamic file segmentation algorithm to speed up the download. It supp...
273,000
When downloading big files it necessary to pause the download many times. A big file can be downloaded by using `wget`. First start download, then kill `wget`, then resume download by `wget -c`. I want to pause downloads too many times depending on events such as power failure, Network unavailability, etc... and wan...
2013/03/27
[ "https://askubuntu.com/questions/273000", "https://askubuntu.com", "https://askubuntu.com/users/123897/" ]
despite you seem to be looking for something very specific, and despite you solved it already, I would still like to recommend `uGet`, I've been using it sindce 12.04 (12.10 64 bits now) and I am very satisfied with the results!
I am user of fatrat. Thats the best download managee I have in Ubuntu . Fatrat low in size and best in performance. ``` sudo apt-get install fatrat ``` the above command will install the fatrat.
273,000
When downloading big files it necessary to pause the download many times. A big file can be downloaded by using `wget`. First start download, then kill `wget`, then resume download by `wget -c`. I want to pause downloads too many times depending on events such as power failure, Network unavailability, etc... and wan...
2013/03/27
[ "https://askubuntu.com/questions/273000", "https://askubuntu.com", "https://askubuntu.com/users/123897/" ]
I strongly recommend `Flareget`. it's free but you have to buy browser integration. here is it's features: [Developer Webpage](http://flareget.com/) [Download flareget](http://flareget.com/download/) **Dynamic File Segmentation:** It uses a robust dynamic file segmentation algorithm to speed up the download. It supp...
I am user of fatrat. Thats the best download managee I have in Ubuntu . Fatrat low in size and best in performance. ``` sudo apt-get install fatrat ``` the above command will install the fatrat.
273,000
When downloading big files it necessary to pause the download many times. A big file can be downloaded by using `wget`. First start download, then kill `wget`, then resume download by `wget -c`. I want to pause downloads too many times depending on events such as power failure, Network unavailability, etc... and wan...
2013/03/27
[ "https://askubuntu.com/questions/273000", "https://askubuntu.com", "https://askubuntu.com/users/123897/" ]
I'm using JDownloader. However, AFAIK running instance cannot be controlled by command line. On the other hand, there are add-ons like: - JD Scheduler or - JD RemoteControl which can do a great job. See: <http://jdownloader.org/home/features> <http://jdownloader.org/home/addons> (I guess that there will be more too...
despite you seem to be looking for something very specific, and despite you solved it already, I would still like to recommend `uGet`, I've been using it sindce 12.04 (12.10 64 bits now) and I am very satisfied with the results!
273,000
When downloading big files it necessary to pause the download many times. A big file can be downloaded by using `wget`. First start download, then kill `wget`, then resume download by `wget -c`. I want to pause downloads too many times depending on events such as power failure, Network unavailability, etc... and wan...
2013/03/27
[ "https://askubuntu.com/questions/273000", "https://askubuntu.com", "https://askubuntu.com/users/123897/" ]
Finally I solved the question (Thanks @rostislav-stribrny ) **JDownloader** is capable of *handling running instance of download* (throttle, pasue, resume, add etc) . 1. [Download](http://jdownloader.org/download/index) and install JDownloader (Tested in v0.9) 2. Launch it 3. Install add-on **JD Remote Control** (Add...
I am user of fatrat. Thats the best download managee I have in Ubuntu . Fatrat low in size and best in performance. ``` sudo apt-get install fatrat ``` the above command will install the fatrat.
273,000
When downloading big files it necessary to pause the download many times. A big file can be downloaded by using `wget`. First start download, then kill `wget`, then resume download by `wget -c`. I want to pause downloads too many times depending on events such as power failure, Network unavailability, etc... and wan...
2013/03/27
[ "https://askubuntu.com/questions/273000", "https://askubuntu.com", "https://askubuntu.com/users/123897/" ]
I'm using JDownloader. However, AFAIK running instance cannot be controlled by command line. On the other hand, there are add-ons like: - JD Scheduler or - JD RemoteControl which can do a great job. See: <http://jdownloader.org/home/features> <http://jdownloader.org/home/addons> (I guess that there will be more too...
If you are in 10.04 get a copy of downloader for X ``` sudo apt-get install d4x ``` Will do everything you want :) <https://apps.ubuntu.com/cat/applications/d4x/>
273,000
When downloading big files it necessary to pause the download many times. A big file can be downloaded by using `wget`. First start download, then kill `wget`, then resume download by `wget -c`. I want to pause downloads too many times depending on events such as power failure, Network unavailability, etc... and wan...
2013/03/27
[ "https://askubuntu.com/questions/273000", "https://askubuntu.com", "https://askubuntu.com/users/123897/" ]
I strongly recommend `Flareget`. it's free but you have to buy browser integration. here is it's features: [Developer Webpage](http://flareget.com/) [Download flareget](http://flareget.com/download/) **Dynamic File Segmentation:** It uses a robust dynamic file segmentation algorithm to speed up the download. It supp...
FlareGet 1.4-7 which is going to be released next week, supports all the features you need and even supports throttling of downloads. Here is the [changelog](http://flareget.com/changelog) Here is the image, of the pre-release version showing speed limits: ![enter image description here](https://i.stack.imgur.com/pAqq...
273,000
When downloading big files it necessary to pause the download many times. A big file can be downloaded by using `wget`. First start download, then kill `wget`, then resume download by `wget -c`. I want to pause downloads too many times depending on events such as power failure, Network unavailability, etc... and wan...
2013/03/27
[ "https://askubuntu.com/questions/273000", "https://askubuntu.com", "https://askubuntu.com/users/123897/" ]
Finally I solved the question (Thanks @rostislav-stribrny ) **JDownloader** is capable of *handling running instance of download* (throttle, pasue, resume, add etc) . 1. [Download](http://jdownloader.org/download/index) and install JDownloader (Tested in v0.9) 2. Launch it 3. Install add-on **JD Remote Control** (Add...
If you are in 10.04 get a copy of downloader for X ``` sudo apt-get install d4x ``` Will do everything you want :) <https://apps.ubuntu.com/cat/applications/d4x/>
35,660,357
From Node, I am attempting to use Google Cloud Vision API to analyze an image stored in Google Storage. I have successfully base64 encoded an image and uploaded it but would like to speed up the process by executing against files I have in Google Storage. My Request is so, { "requests":[ { "image":{ "source": { "gcsIm...
2016/02/26
[ "https://Stackoverflow.com/questions/35660357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5987837/" ]
You are probably invoking the Cloud Vision API anonymously with a GCS image that is not publicly readable. You are likely providing an API key, but API keys do not authenticate request. You can fix this problem in one of two ways: 1. Make an authenticated request to the Cloud Vision API, authenticating as a particular...
Actually there are two ways.First way is 1)Open the bucket of your google cloud vision and there will be a option called "share publicly" and mark it yes for the document you would like to test.Then run the code and you will get the required result
55,692,850
I'm using Firebase Phone Auth to identify the user, the sms is received but I need to change the SMS sender name (Not the template) in mobile, is there anyway to change the sender name or the messaging service? The sms is received like: `Phonecode 106109 is your verification code for MyAppName` what I need is: `MyAp...
2019/04/15
[ "https://Stackoverflow.com/questions/55692850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1475574/" ]
hi am also using firebase messages for send otp on mobile numbers. I also want to show my app name in text message but there is a firebase document that you can't change body of message in firebase. You can select the language from the Firebase console, however this is a per project setting and you can't modify the tem...
Go to Firebase>Authentication>Templates>Password Reset> Put %APP\_NAME%