qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
33,033,578
I have a form with select tags for date of birth. The day and month default to the first options (the 1st, and January), which is fine. For the year, I use **selected="selected"** for 1975, since this is the average age for my users. What I want to be able to do is to overwrite this default year value by passing the v...
2015/10/09
[ "https://Stackoverflow.com/questions/33033578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/724006/" ]
To overwrite the default values, you would use something like this to retrieve the variables from the URL: ``` $dob_year = $_GET["dob_year"]; $dob_day = $_GET["dob_day"]; $dob_month = $_GET["doby_month"]; ``` And then for each select drop down, you could do this: ``` echo "<select id = \"dob_month\">"; for($i=1;$i...
I think fastest and most clean way to achieve that is using a short javascript to set proper value when the page is loaded. Assuming you read data like this: ``` $selectedYear = isset($_GET['dob_year']) ? intval($_GET['dob_year']) : null; ``` And you have select block like this: ``` <select id="selectedYear" name=...
7,712,408
I am trying to read a serial response from a hardware device. The string I read is long and I only need a portion of it. To get to portion of the string I want I use `std::string.substr(x,y);` . The problem I run into however is sometimes I get an exception error because the buffer I am reading from doesn't have y char...
2011/10/10
[ "https://Stackoverflow.com/questions/7712408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/539643/" ]
The interface of your `ReadFile` function seems to provide you with the number of bytes read. If you know the length that is expected, you should loop trying reading from the file (probably port descriptor) until the expected number of bytes is read. If the length of the response is not known, you might have to read a...
You should use `ReadFile` to read a certain amount of bytes per cycle into your buffer. This buffer should be filled until `ReadFile` reads `0` bytes, you have reached your `\n` or `\r\n` characters, or filled your buffer to the max. Once you have done this, there would be no need to `substr` your string and you can ...
7,712,408
I am trying to read a serial response from a hardware device. The string I read is long and I only need a portion of it. To get to portion of the string I want I use `std::string.substr(x,y);` . The problem I run into however is sometimes I get an exception error because the buffer I am reading from doesn't have y char...
2011/10/10
[ "https://Stackoverflow.com/questions/7712408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/539643/" ]
The interface of your `ReadFile` function seems to provide you with the number of bytes read. If you know the length that is expected, you should loop trying reading from the file (probably port descriptor) until the expected number of bytes is read. If the length of the response is not known, you might have to read a...
As you said yourself in the last line, you know that the terminator for the response is a new line character. You need to read from the serial until you receive a new line somewhere in the input. Everything you received from the previous new line to the current new line is the response, with everything after the curren...
7,712,408
I am trying to read a serial response from a hardware device. The string I read is long and I only need a portion of it. To get to portion of the string I want I use `std::string.substr(x,y);` . The problem I run into however is sometimes I get an exception error because the buffer I am reading from doesn't have y char...
2011/10/10
[ "https://Stackoverflow.com/questions/7712408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/539643/" ]
The interface of your `ReadFile` function seems to provide you with the number of bytes read. If you know the length that is expected, you should loop trying reading from the file (probably port descriptor) until the expected number of bytes is read. If the length of the response is not known, you might have to read a...
Old question, but I modified @Eli Iser code to: ``` while (ReadFile(hSerial, myBigBuff + indexToBuff, 1, &dwBytesRead, NULL)) { if (strchr(myBigBuff, '-') != NULL || dwBytesRead < 1) break; // Move forward in the buffer. This should be done cyclically indexToBuff += ...
1,442,241
This is so called a hyperbolic set $$\{(x\_1, x\_2) \in \mathbb{R}^2\_{+} \mid x\_1 x\_2 \geq 1\}$$ We proceed to prove that it is convex by showing that a convex combination of points (a line segment) will lie in the set Suppose $x = (x\_1, x\_2)$, $y = (y\_1, y\_2)$ and $x \geq y$ in the elementwise sense Then se...
2015/09/19
[ "https://math.stackexchange.com/questions/1442241", "https://math.stackexchange.com", "https://math.stackexchange.com/users/105951/" ]
Let $(x\_1,y\_1)$ and $(x\_2, y\_2)$ in our set, and $\alpha \in [0,1]$. We need to show that $\alpha (x\_1,y\_1) + (1-\alpha) (x\_2, y\_2)$ is in our set, *i.e.* that $$\alpha^2 x\_1y\_1 + (1-\alpha)^2 x\_2y\_2 + \alpha(1-\alpha)(x\_1y\_2+x\_2y\_1) \geq 1$$ **Hint**: notice that $x\_1y\_1 \geq 1, x\_2y\_2 \geq 1$ and...
Say $f(x)=\frac{1}{x}$, so our set is $\{(x,y): y\geq f(x)\}$. We know that $f(x)$ is convex, that is for $0\leq\theta\leq 1$ $$f(\theta x+(1-\theta)y)\leq \theta f(x)+(1-\theta)f(y).$$ Now take $(x\_1,y\_1)$ and $(x\_2,y\_2)$ in the set. In other words $y\_1\geq f(x\_1)$ and $y\_2\geq f(x\_2)$. For $0\leq\theta\leq 1...
1,442,241
This is so called a hyperbolic set $$\{(x\_1, x\_2) \in \mathbb{R}^2\_{+} \mid x\_1 x\_2 \geq 1\}$$ We proceed to prove that it is convex by showing that a convex combination of points (a line segment) will lie in the set Suppose $x = (x\_1, x\_2)$, $y = (y\_1, y\_2)$ and $x \geq y$ in the elementwise sense Then se...
2015/09/19
[ "https://math.stackexchange.com/questions/1442241", "https://math.stackexchange.com", "https://math.stackexchange.com/users/105951/" ]
Say $f(x)=\frac{1}{x}$, so our set is $\{(x,y): y\geq f(x)\}$. We know that $f(x)$ is convex, that is for $0\leq\theta\leq 1$ $$f(\theta x+(1-\theta)y)\leq \theta f(x)+(1-\theta)f(y).$$ Now take $(x\_1,y\_1)$ and $(x\_2,y\_2)$ in the set. In other words $y\_1\geq f(x\_1)$ and $y\_2\geq f(x\_2)$. For $0\leq\theta\leq 1...
Your hyperbolic set is defined by the following [linear matrix inequality](https://en.wikipedia.org/wiki/Linear_matrix_inequality) (LMI) $$\begin{bmatrix} x\_1 & 1\\ 1 & x\_2\end{bmatrix} \succeq \mathrm O\_2$$ which, using [Sylvester's criterion](https://en.wikipedia.org/wiki/Sylvester%27s_criterion), produces the f...
1,442,241
This is so called a hyperbolic set $$\{(x\_1, x\_2) \in \mathbb{R}^2\_{+} \mid x\_1 x\_2 \geq 1\}$$ We proceed to prove that it is convex by showing that a convex combination of points (a line segment) will lie in the set Suppose $x = (x\_1, x\_2)$, $y = (y\_1, y\_2)$ and $x \geq y$ in the elementwise sense Then se...
2015/09/19
[ "https://math.stackexchange.com/questions/1442241", "https://math.stackexchange.com", "https://math.stackexchange.com/users/105951/" ]
Let $(x\_1,y\_1)$ and $(x\_2, y\_2)$ in our set, and $\alpha \in [0,1]$. We need to show that $\alpha (x\_1,y\_1) + (1-\alpha) (x\_2, y\_2)$ is in our set, *i.e.* that $$\alpha^2 x\_1y\_1 + (1-\alpha)^2 x\_2y\_2 + \alpha(1-\alpha)(x\_1y\_2+x\_2y\_1) \geq 1$$ **Hint**: notice that $x\_1y\_1 \geq 1, x\_2y\_2 \geq 1$ and...
Your hyperbolic set is defined by the following [linear matrix inequality](https://en.wikipedia.org/wiki/Linear_matrix_inequality) (LMI) $$\begin{bmatrix} x\_1 & 1\\ 1 & x\_2\end{bmatrix} \succeq \mathrm O\_2$$ which, using [Sylvester's criterion](https://en.wikipedia.org/wiki/Sylvester%27s_criterion), produces the f...
31,651,501
i'm a newbie on angularjs and angular-ui and i have a problem with module ui-select. I need to select single element from a list and if there isn't a value, the user can add manually, but the tagging system of ui-select doen't work for a single value and i don't know why. This is the ui-select code: ``` <ui-select ta...
2015/07/27
[ "https://Stackoverflow.com/questions/31651501", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3632981/" ]
Check out the thread and the particular answer I'm linking to [here](https://github.com/angular-ui/ui-select/issues/983#issuecomment-109948338). There's a workaround for now where you add the attribute `tagging-label="false"`. Hopefully that fixes your problem! I'm looking at a similar issue, but unfortunately for me, ...
I was facing the same issue and found a better workaround using [ui-select-no-choice](https://github.com/angular-ui/ui-select/wiki/ui-select-no-choice) The problem with tagging and single choice is that it changes the normal behaviour of the dropdown, for example when you type something to search it stops selecting th...
40,533,458
After adding aurelia fetch client to my project i am getting the below exception when i am running `au run` ``` /node_modules/aurelia-fetch-client/dist/aurelia-fetch-client.d.ts(73,43): error TS2304: Cannot find name 'URLSearchParams'. ``` How to resolve this?
2016/11/10
[ "https://Stackoverflow.com/questions/40533458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4058910/" ]
I don't like JavaScriptSerializer, I much prefer to use Json.net from newtonsoft This can be obtained via nu get: ``` > Install-Package Newtonsoft.Json -Version 9.0.1 ```
Use [**Newtonsoft.Json**](https://www.nuget.org/packages/newtonsoft.json/). Here how your class should look like ! ``` public class Enero { public string valor { get; set; } public string almacenado { get; set; } } public class Febrero { public string valor { get; set; } public string almacenado { get...
40,533,458
After adding aurelia fetch client to my project i am getting the below exception when i am running `au run` ``` /node_modules/aurelia-fetch-client/dist/aurelia-fetch-client.d.ts(73,43): error TS2304: Cannot find name 'URLSearchParams'. ``` How to resolve this?
2016/11/10
[ "https://Stackoverflow.com/questions/40533458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4058910/" ]
Your properties on *Mes* class are private. Add the **public** access modifier to the properties. Change it to this: ``` public class Mes { public string valor; public string almacenado; } ```
Use [**Newtonsoft.Json**](https://www.nuget.org/packages/newtonsoft.json/). Here how your class should look like ! ``` public class Enero { public string valor { get; set; } public string almacenado { get; set; } } public class Febrero { public string valor { get; set; } public string almacenado { get...
40,533,458
After adding aurelia fetch client to my project i am getting the below exception when i am running `au run` ``` /node_modules/aurelia-fetch-client/dist/aurelia-fetch-client.d.ts(73,43): error TS2304: Cannot find name 'URLSearchParams'. ``` How to resolve this?
2016/11/10
[ "https://Stackoverflow.com/questions/40533458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4058910/" ]
Your properties on *Mes* class are private. Add the **public** access modifier to the properties. Change it to this: ``` public class Mes { public string valor; public string almacenado; } ```
I don't like JavaScriptSerializer, I much prefer to use Json.net from newtonsoft This can be obtained via nu get: ``` > Install-Package Newtonsoft.Json -Version 9.0.1 ```
411,914
Having exhausted other search options, I was hoping someone might know of a way to change the pgAdmin geometry viewer default tile server? It tries to bring up the OSM one, but we are behind a firewall and it cannot be accessed. However, we have an internal one that could be used. Is this possible?
2021/09/16
[ "https://gis.stackexchange.com/questions/411914", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/40788/" ]
The tile servers are hardcoded in [web/pgadmin/static/js/sqleditor/geometry\_viewer.js](https://git.postgresql.org/gitweb/?p=pgadmin4.git;a=blob;f=web/pgadmin/static/js/sqleditor/geometry_viewer.js;hb=HEAD#l110). In an installed pgAdmin, you can find this file in a minified form in `.../web/pgadmin/static/js/generated...
If you are using the pre-packaged version (rather than building it from source after making changes), you may need to make changes to the generated file under `web/pgadmin/static/js/generated/sqleditor.js` instead. This was tested on pgAdmin 5.7, paths may have changed in more recent versions (e.g. 6.x)
280,208
I'm trying to install VMware Workstation in my Ubuntu 12.04.2 LTS. If I execute the following command: ``` sudo ./VMware-Workstation-9.0.1-894247.x86_64.bundle ``` it finishes at once and the installation never starts. If I execute this command: ``` sudo sh ./VMware-Workstation-9.0.1-894247.x86_64.bundle ``` The...
2013/04/11
[ "https://askubuntu.com/questions/280208", "https://askubuntu.com", "https://askubuntu.com/users/139844/" ]
If the file is not marked as executable you need to call a command shell interpreter to execute it. Examples: * `sudo sh foo` will open *foo* with `sh` using **sudo** privileges. * `sudo bash foo` will open *foo* with `bash` using **sudo** privileges. * `sh foo` will open *foo* with `sh` using your user's privileges....
Sh is a shell for running commands, so executing sh with sudo gives you a root shell. This means all commands in that shell are executed as root. My guess is that script executes something else that needs root, however when you only use sudo not sudo sh, that something else gets executed as a normal user, however with ...
280,208
I'm trying to install VMware Workstation in my Ubuntu 12.04.2 LTS. If I execute the following command: ``` sudo ./VMware-Workstation-9.0.1-894247.x86_64.bundle ``` it finishes at once and the installation never starts. If I execute this command: ``` sudo sh ./VMware-Workstation-9.0.1-894247.x86_64.bundle ``` The...
2013/04/11
[ "https://askubuntu.com/questions/280208", "https://askubuntu.com", "https://askubuntu.com/users/139844/" ]
Sh is a shell for running commands, so executing sh with sudo gives you a root shell. This means all commands in that shell are executed as root. My guess is that script executes something else that needs root, however when you only use sudo not sudo sh, that something else gets executed as a normal user, however with ...
`sudo` is a command that give you root privilege. But `sh` is an interpreter. When you use `sudo command`, you running the command as root privilege. But when you use `sudo sh command`, you running the `sh` command as root.
280,208
I'm trying to install VMware Workstation in my Ubuntu 12.04.2 LTS. If I execute the following command: ``` sudo ./VMware-Workstation-9.0.1-894247.x86_64.bundle ``` it finishes at once and the installation never starts. If I execute this command: ``` sudo sh ./VMware-Workstation-9.0.1-894247.x86_64.bundle ``` The...
2013/04/11
[ "https://askubuntu.com/questions/280208", "https://askubuntu.com", "https://askubuntu.com/users/139844/" ]
If the file is not marked as executable you need to call a command shell interpreter to execute it. Examples: * `sudo sh foo` will open *foo* with `sh` using **sudo** privileges. * `sudo bash foo` will open *foo* with `bash` using **sudo** privileges. * `sh foo` will open *foo* with `sh` using your user's privileges....
`sudo` is a command that give you root privilege. But `sh` is an interpreter. When you use `sudo command`, you running the command as root privilege. But when you use `sudo sh command`, you running the `sh` command as root.
25,914,789
I use the following command to fill an RDD with a bunch of arrays containing 2 strings ["filename", "content"]. Now I want to iterate over every of those occurrences to do something with every filename and content. ``` val someRDD = sc.wholeTextFiles("hdfs://localhost:8020/user/cloudera/*") ``` I can't seem to find...
2014/09/18
[ "https://Stackoverflow.com/questions/25914789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3154217/" ]
You call various methods on the RDD that accept functions as parameters. ``` // set up an example -- an RDD of arrays val sparkConf = new SparkConf().setMaster("local").setAppName("Example") val sc = new SparkContext(sparkConf) val testData = Array(Array(1,2,3), Array(4,5,6,7,8)) val testRDD = sc.parallelize(testData,...
I would try making use of a partition mapping function. The code below shows how an entire RDD dataset can be processed in a loop so that each input goes through the very same function. I am afraid I have no knowledge about Scala, so everything I have to offer is *java* code. However, it should not be very difficult to...
25,914,789
I use the following command to fill an RDD with a bunch of arrays containing 2 strings ["filename", "content"]. Now I want to iterate over every of those occurrences to do something with every filename and content. ``` val someRDD = sc.wholeTextFiles("hdfs://localhost:8020/user/cloudera/*") ``` I can't seem to find...
2014/09/18
[ "https://Stackoverflow.com/questions/25914789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3154217/" ]
You call various methods on the RDD that accept functions as parameters. ``` // set up an example -- an RDD of arrays val sparkConf = new SparkConf().setMaster("local").setAppName("Example") val sc = new SparkContext(sparkConf) val testData = Array(Array(1,2,3), Array(4,5,6,7,8)) val testRDD = sc.parallelize(testData,...
The fundamental operations in Spark are `map` and `filter`. ``` val txtRDD = someRDD filter { case(id, content) => id.endsWith(".txt") } ``` the `txtRDD` will now only contain files that have the extension ".txt" And if you want to word count those files you can say ``` //split the documents into words in one long...
25,914,789
I use the following command to fill an RDD with a bunch of arrays containing 2 strings ["filename", "content"]. Now I want to iterate over every of those occurrences to do something with every filename and content. ``` val someRDD = sc.wholeTextFiles("hdfs://localhost:8020/user/cloudera/*") ``` I can't seem to find...
2014/09/18
[ "https://Stackoverflow.com/questions/25914789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3154217/" ]
You call various methods on the RDD that accept functions as parameters. ``` // set up an example -- an RDD of arrays val sparkConf = new SparkConf().setMaster("local").setAppName("Example") val sc = new SparkContext(sparkConf) val testData = Array(Array(1,2,3), Array(4,5,6,7,8)) val testRDD = sc.parallelize(testData,...
what the `wholeTextFiles` return is a Pair RDD: > > def wholeTextFiles(path: String, minPartitions: Int): RDD[(String, String)] > > > Read a directory of text files from HDFS, a local file system (available on all nodes), or any Hadoop-supported file system URI. Each file is read as a single record and returned in ...
25,914,789
I use the following command to fill an RDD with a bunch of arrays containing 2 strings ["filename", "content"]. Now I want to iterate over every of those occurrences to do something with every filename and content. ``` val someRDD = sc.wholeTextFiles("hdfs://localhost:8020/user/cloudera/*") ``` I can't seem to find...
2014/09/18
[ "https://Stackoverflow.com/questions/25914789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3154217/" ]
You call various methods on the RDD that accept functions as parameters. ``` // set up an example -- an RDD of arrays val sparkConf = new SparkConf().setMaster("local").setAppName("Example") val sc = new SparkContext(sparkConf) val testData = Array(Array(1,2,3), Array(4,5,6,7,8)) val testRDD = sc.parallelize(testData,...
``` for (element <- YourRDD) { // do what you want with element in each iteration, and if you want the index of element, simply use a counter variable in this loop beginning from 0 println (element._1) // this will print all filenames } ```
25,914,789
I use the following command to fill an RDD with a bunch of arrays containing 2 strings ["filename", "content"]. Now I want to iterate over every of those occurrences to do something with every filename and content. ``` val someRDD = sc.wholeTextFiles("hdfs://localhost:8020/user/cloudera/*") ``` I can't seem to find...
2014/09/18
[ "https://Stackoverflow.com/questions/25914789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3154217/" ]
The fundamental operations in Spark are `map` and `filter`. ``` val txtRDD = someRDD filter { case(id, content) => id.endsWith(".txt") } ``` the `txtRDD` will now only contain files that have the extension ".txt" And if you want to word count those files you can say ``` //split the documents into words in one long...
I would try making use of a partition mapping function. The code below shows how an entire RDD dataset can be processed in a loop so that each input goes through the very same function. I am afraid I have no knowledge about Scala, so everything I have to offer is *java* code. However, it should not be very difficult to...
25,914,789
I use the following command to fill an RDD with a bunch of arrays containing 2 strings ["filename", "content"]. Now I want to iterate over every of those occurrences to do something with every filename and content. ``` val someRDD = sc.wholeTextFiles("hdfs://localhost:8020/user/cloudera/*") ``` I can't seem to find...
2014/09/18
[ "https://Stackoverflow.com/questions/25914789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3154217/" ]
I would try making use of a partition mapping function. The code below shows how an entire RDD dataset can be processed in a loop so that each input goes through the very same function. I am afraid I have no knowledge about Scala, so everything I have to offer is *java* code. However, it should not be very difficult to...
what the `wholeTextFiles` return is a Pair RDD: > > def wholeTextFiles(path: String, minPartitions: Int): RDD[(String, String)] > > > Read a directory of text files from HDFS, a local file system (available on all nodes), or any Hadoop-supported file system URI. Each file is read as a single record and returned in ...
25,914,789
I use the following command to fill an RDD with a bunch of arrays containing 2 strings ["filename", "content"]. Now I want to iterate over every of those occurrences to do something with every filename and content. ``` val someRDD = sc.wholeTextFiles("hdfs://localhost:8020/user/cloudera/*") ``` I can't seem to find...
2014/09/18
[ "https://Stackoverflow.com/questions/25914789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3154217/" ]
I would try making use of a partition mapping function. The code below shows how an entire RDD dataset can be processed in a loop so that each input goes through the very same function. I am afraid I have no knowledge about Scala, so everything I have to offer is *java* code. However, it should not be very difficult to...
``` for (element <- YourRDD) { // do what you want with element in each iteration, and if you want the index of element, simply use a counter variable in this loop beginning from 0 println (element._1) // this will print all filenames } ```
25,914,789
I use the following command to fill an RDD with a bunch of arrays containing 2 strings ["filename", "content"]. Now I want to iterate over every of those occurrences to do something with every filename and content. ``` val someRDD = sc.wholeTextFiles("hdfs://localhost:8020/user/cloudera/*") ``` I can't seem to find...
2014/09/18
[ "https://Stackoverflow.com/questions/25914789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3154217/" ]
The fundamental operations in Spark are `map` and `filter`. ``` val txtRDD = someRDD filter { case(id, content) => id.endsWith(".txt") } ``` the `txtRDD` will now only contain files that have the extension ".txt" And if you want to word count those files you can say ``` //split the documents into words in one long...
what the `wholeTextFiles` return is a Pair RDD: > > def wholeTextFiles(path: String, minPartitions: Int): RDD[(String, String)] > > > Read a directory of text files from HDFS, a local file system (available on all nodes), or any Hadoop-supported file system URI. Each file is read as a single record and returned in ...
25,914,789
I use the following command to fill an RDD with a bunch of arrays containing 2 strings ["filename", "content"]. Now I want to iterate over every of those occurrences to do something with every filename and content. ``` val someRDD = sc.wholeTextFiles("hdfs://localhost:8020/user/cloudera/*") ``` I can't seem to find...
2014/09/18
[ "https://Stackoverflow.com/questions/25914789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3154217/" ]
The fundamental operations in Spark are `map` and `filter`. ``` val txtRDD = someRDD filter { case(id, content) => id.endsWith(".txt") } ``` the `txtRDD` will now only contain files that have the extension ".txt" And if you want to word count those files you can say ``` //split the documents into words in one long...
``` for (element <- YourRDD) { // do what you want with element in each iteration, and if you want the index of element, simply use a counter variable in this loop beginning from 0 println (element._1) // this will print all filenames } ```
25,914,789
I use the following command to fill an RDD with a bunch of arrays containing 2 strings ["filename", "content"]. Now I want to iterate over every of those occurrences to do something with every filename and content. ``` val someRDD = sc.wholeTextFiles("hdfs://localhost:8020/user/cloudera/*") ``` I can't seem to find...
2014/09/18
[ "https://Stackoverflow.com/questions/25914789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3154217/" ]
what the `wholeTextFiles` return is a Pair RDD: > > def wholeTextFiles(path: String, minPartitions: Int): RDD[(String, String)] > > > Read a directory of text files from HDFS, a local file system (available on all nodes), or any Hadoop-supported file system URI. Each file is read as a single record and returned in ...
``` for (element <- YourRDD) { // do what you want with element in each iteration, and if you want the index of element, simply use a counter variable in this loop beginning from 0 println (element._1) // this will print all filenames } ```
31,509,949
I want to generate pairs from a given large pool of numbers. I am using two for loops and threads. My function getAllPairs() in the code generates apairs with a given array of numbers. I have an array of length 1000. With one thread, output time is nearly 15 sec. Now I want to use 5-6 threads and reduce this output ti...
2015/07/20
[ "https://Stackoverflow.com/questions/31509949", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4972717/" ]
A solution with a thread-pool, a task split strategy and it collects all results: ``` public class SelectPairs { private static final int NUM_THREADS = 8; private int[] array; public SelectPairs(int[] arr) { array = arr; } // A splitting task strategy public List<Pair> getPartialPai...
regarding the framework of multithreading, you can implement [ThreadPoolExecutor](http://www.javacodegeeks.com/2011/12/using-threadpoolexecutor-to-parallelize.html) as was suggested in a comment. Regarding splitting the workload, it seems that the key is splitting the iteration on the array which is achievable if yo...
52,939,183
I have a fairly long string in PowerShell that I need to split. Each section begins with a date in format `mm/dd/yyyy hh:mm:ss AM`. Essentially what I am trying to do is get the most recent message in the string. I don't need to keep the date/time part as I already have that elsewhere. This is what the string looks li...
2018/10/22
[ "https://Stackoverflow.com/questions/52939183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10543291/" ]
Note: * The solution below assumes that the section are *not* necessarily *chronologically ordered* so that you must inspect *all* time stamps to determine the most recent one. * If, by contrast, you can assume that the *last* message is the most recent one, use [LotPings' much simpler answer](https://stackoverflow.co...
you can split it by timestamp pattern like this: ``` $arr = $str -split "[0-9]{1,2}/[0-9]{1,2}/[0-9]{1,4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2} [AaPp]M\n" ```
52,939,183
I have a fairly long string in PowerShell that I need to split. Each section begins with a date in format `mm/dd/yyyy hh:mm:ss AM`. Essentially what I am trying to do is get the most recent message in the string. I don't need to keep the date/time part as I already have that elsewhere. This is what the string looks li...
2018/10/22
[ "https://Stackoverflow.com/questions/52939183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10543291/" ]
you can split it by timestamp pattern like this: ``` $arr = $str -split "[0-9]{1,2}/[0-9]{1,2}/[0-9]{1,4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2} [AaPp]M\n" ```
To my knowledge you can't use any of the static String methods like Split() for this. I tried to find a regular expression that would handle the entire thing, but wasn't able to come up with anything that would quite break it up properly. So, you'll need to go line by line, testing to see if it that line is a date, th...
52,939,183
I have a fairly long string in PowerShell that I need to split. Each section begins with a date in format `mm/dd/yyyy hh:mm:ss AM`. Essentially what I am trying to do is get the most recent message in the string. I don't need to keep the date/time part as I already have that elsewhere. This is what the string looks li...
2018/10/22
[ "https://Stackoverflow.com/questions/52939183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10543291/" ]
Provided the [datetime] sections are ascending, it should be sufficient to split on them with a RegEx and get the last one ``` ((Get-Content .\test.txt -Raw) -split "\d+/\d+/\d{4} \d+:\d+:\d+ [AP]M`r?`n")[-1] ``` Output based on your sample string stored in file `test.txt` ``` This would be second message Same t...
you can split it by timestamp pattern like this: ``` $arr = $str -split "[0-9]{1,2}/[0-9]{1,2}/[0-9]{1,4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2} [AaPp]M\n" ```
52,939,183
I have a fairly long string in PowerShell that I need to split. Each section begins with a date in format `mm/dd/yyyy hh:mm:ss AM`. Essentially what I am trying to do is get the most recent message in the string. I don't need to keep the date/time part as I already have that elsewhere. This is what the string looks li...
2018/10/22
[ "https://Stackoverflow.com/questions/52939183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10543291/" ]
Note: * The solution below assumes that the section are *not* necessarily *chronologically ordered* so that you must inspect *all* time stamps to determine the most recent one. * If, by contrast, you can assume that the *last* message is the most recent one, use [LotPings' much simpler answer](https://stackoverflow.co...
To my knowledge you can't use any of the static String methods like Split() for this. I tried to find a regular expression that would handle the entire thing, but wasn't able to come up with anything that would quite break it up properly. So, you'll need to go line by line, testing to see if it that line is a date, th...
52,939,183
I have a fairly long string in PowerShell that I need to split. Each section begins with a date in format `mm/dd/yyyy hh:mm:ss AM`. Essentially what I am trying to do is get the most recent message in the string. I don't need to keep the date/time part as I already have that elsewhere. This is what the string looks li...
2018/10/22
[ "https://Stackoverflow.com/questions/52939183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10543291/" ]
Provided the [datetime] sections are ascending, it should be sufficient to split on them with a RegEx and get the last one ``` ((Get-Content .\test.txt -Raw) -split "\d+/\d+/\d{4} \d+:\d+:\d+ [AP]M`r?`n")[-1] ``` Output based on your sample string stored in file `test.txt` ``` This would be second message Same t...
Note: * The solution below assumes that the section are *not* necessarily *chronologically ordered* so that you must inspect *all* time stamps to determine the most recent one. * If, by contrast, you can assume that the *last* message is the most recent one, use [LotPings' much simpler answer](https://stackoverflow.co...
52,939,183
I have a fairly long string in PowerShell that I need to split. Each section begins with a date in format `mm/dd/yyyy hh:mm:ss AM`. Essentially what I am trying to do is get the most recent message in the string. I don't need to keep the date/time part as I already have that elsewhere. This is what the string looks li...
2018/10/22
[ "https://Stackoverflow.com/questions/52939183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10543291/" ]
Provided the [datetime] sections are ascending, it should be sufficient to split on them with a RegEx and get the last one ``` ((Get-Content .\test.txt -Raw) -split "\d+/\d+/\d{4} \d+:\d+:\d+ [AP]M`r?`n")[-1] ``` Output based on your sample string stored in file `test.txt` ``` This would be second message Same t...
To my knowledge you can't use any of the static String methods like Split() for this. I tried to find a regular expression that would handle the entire thing, but wasn't able to come up with anything that would quite break it up properly. So, you'll need to go line by line, testing to see if it that line is a date, th...
13,132,838
Currently, my code is reading an external text file, using: ``` text_file = open("file.txt", 'r', 0) my_list = [] for line in text_file my_list.append(line.strip().lower()) return my_list ``` I would like to send my code to a friend without having to send a separate text file. So I am looking for a way of incorp...
2012/10/30
[ "https://Stackoverflow.com/questions/13132838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1784488/" ]
Here's one approach: ``` for dir in *;do if [ $(find "$dir" -maxdepth 1 -regex '.*/[0-9][0-9]*\.txt' | wc -l) = 0 ]; then echo $dir fi done ```
Since the A\_[0-9] directories are not nested, you can easily do this with a glob in a loop. This implementation is pure bash, and does not spawn in external utilities: ``` for d in A_[0-9]*/; do # the trailing / causes only directories to be matched files=("$d"/[0-9]*.txt) # populate an array with matc...
13,132,838
Currently, my code is reading an external text file, using: ``` text_file = open("file.txt", 'r', 0) my_list = [] for line in text_file my_list.append(line.strip().lower()) return my_list ``` I would like to send my code to a friend without having to send a separate text file. So I am looking for a way of incorp...
2012/10/30
[ "https://Stackoverflow.com/questions/13132838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1784488/" ]
Here's one approach: ``` for dir in *;do if [ $(find "$dir" -maxdepth 1 -regex '.*/[0-9][0-9]*\.txt' | wc -l) = 0 ]; then echo $dir fi done ```
``` for file in *; do if [[ "$file" =~ ^A_([0-9]+)$ && ! -f "$file/${BASH_REMATCH[1]}.txt" ]]; then echo $file; fi done ``` How it works: 1. Checks using regexp (note the `=~` ) that the file/folder's name is "A\_" followed by number. 2. At the same time, it captures the numbers (note the parentheses) and st...
13,132,838
Currently, my code is reading an external text file, using: ``` text_file = open("file.txt", 'r', 0) my_list = [] for line in text_file my_list.append(line.strip().lower()) return my_list ``` I would like to send my code to a friend without having to send a separate text file. So I am looking for a way of incorp...
2012/10/30
[ "https://Stackoverflow.com/questions/13132838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1784488/" ]
Here's one approach: ``` for dir in *;do if [ $(find "$dir" -maxdepth 1 -regex '.*/[0-9][0-9]*\.txt' | wc -l) = 0 ]; then echo $dir fi done ```
A slight variation on a couple of other answers: use bash [extended pattern matching](http://www.gnu.org/software/bash/manual/bashref.html#Pattern-Matching): ``` shopt -s extglob nullglob for dir in A_+([0-9]); do files=($dir/+([0-9]).txt) (( ${#files[@]} == 0 )) && echo $dir done ```
13,132,838
Currently, my code is reading an external text file, using: ``` text_file = open("file.txt", 'r', 0) my_list = [] for line in text_file my_list.append(line.strip().lower()) return my_list ``` I would like to send my code to a friend without having to send a separate text file. So I am looking for a way of incorp...
2012/10/30
[ "https://Stackoverflow.com/questions/13132838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1784488/" ]
Since the A\_[0-9] directories are not nested, you can easily do this with a glob in a loop. This implementation is pure bash, and does not spawn in external utilities: ``` for d in A_[0-9]*/; do # the trailing / causes only directories to be matched files=("$d"/[0-9]*.txt) # populate an array with matc...
``` for file in *; do if [[ "$file" =~ ^A_([0-9]+)$ && ! -f "$file/${BASH_REMATCH[1]}.txt" ]]; then echo $file; fi done ``` How it works: 1. Checks using regexp (note the `=~` ) that the file/folder's name is "A\_" followed by number. 2. At the same time, it captures the numbers (note the parentheses) and st...
13,132,838
Currently, my code is reading an external text file, using: ``` text_file = open("file.txt", 'r', 0) my_list = [] for line in text_file my_list.append(line.strip().lower()) return my_list ``` I would like to send my code to a friend without having to send a separate text file. So I am looking for a way of incorp...
2012/10/30
[ "https://Stackoverflow.com/questions/13132838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1784488/" ]
A slight variation on a couple of other answers: use bash [extended pattern matching](http://www.gnu.org/software/bash/manual/bashref.html#Pattern-Matching): ``` shopt -s extglob nullglob for dir in A_+([0-9]); do files=($dir/+([0-9]).txt) (( ${#files[@]} == 0 )) && echo $dir done ```
``` for file in *; do if [[ "$file" =~ ^A_([0-9]+)$ && ! -f "$file/${BASH_REMATCH[1]}.txt" ]]; then echo $file; fi done ``` How it works: 1. Checks using regexp (note the `=~` ) that the file/folder's name is "A\_" followed by number. 2. At the same time, it captures the numbers (note the parentheses) and st...
147,205
How do I explain the scale-invariant feature transform (SIFT) to a layman?
2015/04/19
[ "https://stats.stackexchange.com/questions/147205", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/60640/" ]
Right, at the first-year undergraduate level, this is how you typically do it. * Firstly, if you were to only take one measurement for x,y and z; use the instrument uncertainty (half its smallest scale or whatever is stated by the manufacturer), and propagate its error to f. So your final answer would look like: [![](...
You need to propagate the error. fortunately your equation is simple and you can plug into a formula and avoid doing any calculus! for multiplication/division like f = D\*xy (sf/f)^2 = (sD/D)2 + (sx/x)^2 + (sy/y)^2 where s is the standard deviation or error you calculated for each measured value, and sf being the er...
14,119
Are drywall screws suitable for attaching a 3/4" tongue-and-groove plywood subfloor? In this case, joists are 16" O.C. and no glue will be used.
2012/05/06
[ "https://diy.stackexchange.com/questions/14119", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/80/" ]
I wouldn't. Drywall screws should only be used for drywall, and a temporary coat hanger. You want more strength and need less space for the threads to secure the subfloor. The drywall screws have a lot of thread to hold the drywall itself, but have very little shear strength.
In the field between the joists, they are fine. As long as you use 3" construction screws to grab the joists and proper adhesives.
14,119
Are drywall screws suitable for attaching a 3/4" tongue-and-groove plywood subfloor? In this case, joists are 16" O.C. and no glue will be used.
2012/05/06
[ "https://diy.stackexchange.com/questions/14119", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/80/" ]
I wouldn't. Drywall screws should only be used for drywall, and a temporary coat hanger. You want more strength and need less space for the threads to secure the subfloor. The drywall screws have a lot of thread to hold the drywall itself, but have very little shear strength.
Nooooo, don't, over time they break. Floors bounce over joist and screws heads that are holding plywoods or OSB's are pulled, worst, the shear stress of wood and joist expansion over seasons will break them. I found that after removing a carpet and saw hundreds of heads screws not talking about all squeakings. Use prop...
14,119
Are drywall screws suitable for attaching a 3/4" tongue-and-groove plywood subfloor? In this case, joists are 16" O.C. and no glue will be used.
2012/05/06
[ "https://diy.stackexchange.com/questions/14119", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/80/" ]
By "drywall screws", I think you are meaning 1 5/8" blued screws. I do not think that they would be a good choice. We usually shoot down plywood subflooring with 2 1/2" to 3" ring shank nails, however 2" to 2 1/2" decking screws work well, but just a lot more work. I would encourage you to use a little adhesive on top ...
In the field between the joists, they are fine. As long as you use 3" construction screws to grab the joists and proper adhesives.
14,119
Are drywall screws suitable for attaching a 3/4" tongue-and-groove plywood subfloor? In this case, joists are 16" O.C. and no glue will be used.
2012/05/06
[ "https://diy.stackexchange.com/questions/14119", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/80/" ]
By "drywall screws", I think you are meaning 1 5/8" blued screws. I do not think that they would be a good choice. We usually shoot down plywood subflooring with 2 1/2" to 3" ring shank nails, however 2" to 2 1/2" decking screws work well, but just a lot more work. I would encourage you to use a little adhesive on top ...
Nooooo, don't, over time they break. Floors bounce over joist and screws heads that are holding plywoods or OSB's are pulled, worst, the shear stress of wood and joist expansion over seasons will break them. I found that after removing a carpet and saw hundreds of heads screws not talking about all squeakings. Use prop...
14,119
Are drywall screws suitable for attaching a 3/4" tongue-and-groove plywood subfloor? In this case, joists are 16" O.C. and no glue will be used.
2012/05/06
[ "https://diy.stackexchange.com/questions/14119", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/80/" ]
Nooooo, don't, over time they break. Floors bounce over joist and screws heads that are holding plywoods or OSB's are pulled, worst, the shear stress of wood and joist expansion over seasons will break them. I found that after removing a carpet and saw hundreds of heads screws not talking about all squeakings. Use prop...
In the field between the joists, they are fine. As long as you use 3" construction screws to grab the joists and proper adhesives.
14,949,886
I've published a grunt plugin to npm that's been tracking the grunt 0.4 RCs by using the `master` tag. I've been publishing with: ``` npm publish --tag master ``` Now that grunt 0.4 final has been released, I've re-published my plugin as `latest` via: ``` npm publish ``` How can I now remove the `master` tag from...
2013/02/19
[ "https://Stackoverflow.com/questions/14949886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/664735/" ]
It was not possible to remove dist-tags from the `npm` registry prior to `npm@2.5.0`. There is now a command-line syntax for this, provided you update to a new version of `npm` -- see <https://github.com/npm/npm/wiki/Troubleshooting#try-the-latest-stable-version-of-npm> for full details on upgrading. Install latest ve...
`master` may be in your npm config. check what this gives: ``` npm config get tag ``` To get back to use `latest`, this should do: ``` npm config set tag latest ``` An other possibility is to un-publish the version with the `master` tag using: ``` npm unpublish <name>[@<version>] ``` this is likely to remove ...
14,949,886
I've published a grunt plugin to npm that's been tracking the grunt 0.4 RCs by using the `master` tag. I've been publishing with: ``` npm publish --tag master ``` Now that grunt 0.4 final has been released, I've re-published my plugin as `latest` via: ``` npm publish ``` How can I now remove the `master` tag from...
2013/02/19
[ "https://Stackoverflow.com/questions/14949886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/664735/" ]
It was not possible to remove dist-tags from the `npm` registry prior to `npm@2.5.0`. There is now a command-line syntax for this, provided you update to a new version of `npm` -- see <https://github.com/npm/npm/wiki/Troubleshooting#try-the-latest-stable-version-of-npm> for full details on upgrading. Install latest ve...
Just to confirm, that (in private repo's in verdaccio), you CAN unpublish tags like this: ``` npm unpublish <name>[@<version>] ``` Which translates to (for instance): ``` npm unpublish @yourdomain/your_package@1.1.100 ``` This will delete the relevant tag.
56,010,719
I'm querying the database using the **SUM** parameter to tally up one column within the DB table. So for example, without using the **SUM** parameter I get the following: ``` UserID | Name | Email | points -------+--------+------------------+------- 1 | name 1 | email1@email.com | 5 1 | name 1 |...
2019/05/06
[ "https://Stackoverflow.com/questions/56010719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1022395/" ]
You will need to add an alias to the SUM column to get it with the name `points`... ``` $result = $wpdb->get_results ( "SELECT user_id, name, email, SUM(points) as points FROM db_tbl order by points DESC" ); ``` You will probably find that the name is something like `SUM(points)`, but it can be easier to add an ali...
There's a couple of issues with your query: > > SELECT user\_id, name, email, SUM(points) FROM db\_tbl order by points DESC > > > 1. The column/expression `points` does not exist in the table. You probably wanted to order as: `order by SUM(points) DESC`. Do you see the difference? 2. You are grouping rows (by usi...
56,010,719
I'm querying the database using the **SUM** parameter to tally up one column within the DB table. So for example, without using the **SUM** parameter I get the following: ``` UserID | Name | Email | points -------+--------+------------------+------- 1 | name 1 | email1@email.com | 5 1 | name 1 |...
2019/05/06
[ "https://Stackoverflow.com/questions/56010719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1022395/" ]
You will need to add an alias to the SUM column to get it with the name `points`... ``` $result = $wpdb->get_results ( "SELECT user_id, name, email, SUM(points) as points FROM db_tbl order by points DESC" ); ``` You will probably find that the name is something like `SUM(points)`, but it can be easier to add an ali...
You can use this query ``` SELECT `UserID`, `Name`, `Email`,SUM(`points`) As total FROM `data` GROUP BY `UserID` ORDER BY SUM(`points`) DESC ``` [LIVE DEMO](http://sqlfiddle.com/#!9/745813/1)
56,010,719
I'm querying the database using the **SUM** parameter to tally up one column within the DB table. So for example, without using the **SUM** parameter I get the following: ``` UserID | Name | Email | points -------+--------+------------------+------- 1 | name 1 | email1@email.com | 5 1 | name 1 |...
2019/05/06
[ "https://Stackoverflow.com/questions/56010719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1022395/" ]
There's a couple of issues with your query: > > SELECT user\_id, name, email, SUM(points) FROM db\_tbl order by points DESC > > > 1. The column/expression `points` does not exist in the table. You probably wanted to order as: `order by SUM(points) DESC`. Do you see the difference? 2. You are grouping rows (by usi...
You can use this query ``` SELECT `UserID`, `Name`, `Email`,SUM(`points`) As total FROM `data` GROUP BY `UserID` ORDER BY SUM(`points`) DESC ``` [LIVE DEMO](http://sqlfiddle.com/#!9/745813/1)
55,149,031
As the title suggest I'm getting my current location as 0.0,0.0 when I check in LogCat. I have tried every solution given on net but not getting any solution. Please help. My code is given below, I have given all permission in Manifest also. Any help would be really appreciated. MapsActivity.java ``` public class Map...
2019/03/13
[ "https://Stackoverflow.com/questions/55149031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11169567/" ]
You should use the onLocationChanged() callback method to listen the current location updates. In that method, location instance will give you both latitude and longitude. Add the marker to map also in that same method. You'll need map instance and send that over to GPStracker class via constructor when you create the ...
Instead of using Location API, try using FusedLocationProviderAPI which is latest and accurate as it optimized the way location is getting fetched. and for the sake of understanding whether the code is working or not try opening Map app and then press GPS button when you get the location then try running your app. Let ...
441,919
Is there a way to play [\*.srt](http://en.wikipedia.org/wiki/SubRip#SubRip_.srt_file_example) subtitles in Windows Media Player? I've followed the instructions in [this](http://www.brighthub.com/computing/windows-platform/articles/41466.aspx), by installing DirectVobSub and renaming the srt file to match the video fil...
2012/06/26
[ "https://superuser.com/questions/441919", "https://superuser.com", "https://superuser.com/users/9825/" ]
What's the file type of the video file you're trying to show subtitles for? On which version of WMP and Windows? If you're running the 64-bit WMP, you'll need the 64-bit version of DirectVobSub as well.
Another solution to that problem is [Local Subtitles for WMP](http://sourceforge.net/projects/wmpsub/). It does not brak codecs pipeline.
441,919
Is there a way to play [\*.srt](http://en.wikipedia.org/wiki/SubRip#SubRip_.srt_file_example) subtitles in Windows Media Player? I've followed the instructions in [this](http://www.brighthub.com/computing/windows-platform/articles/41466.aspx), by installing DirectVobSub and renaming the srt file to match the video fil...
2012/06/26
[ "https://superuser.com/questions/441919", "https://superuser.com", "https://superuser.com/users/9825/" ]
Use the latest version of DirectVobSub and try changing your `.srt` to a `.sub` file. It worked for me. I got it through this [link](http://www.makeuseof.com/tag/this-is-how-you-can-add-external-subtitles-on-windows-media-player/).
What's the file type of the video file you're trying to show subtitles for? On which version of WMP and Windows? If you're running the 64-bit WMP, you'll need the 64-bit version of DirectVobSub as well.
441,919
Is there a way to play [\*.srt](http://en.wikipedia.org/wiki/SubRip#SubRip_.srt_file_example) subtitles in Windows Media Player? I've followed the instructions in [this](http://www.brighthub.com/computing/windows-platform/articles/41466.aspx), by installing DirectVobSub and renaming the srt file to match the video fil...
2012/06/26
[ "https://superuser.com/questions/441919", "https://superuser.com", "https://superuser.com/users/9825/" ]
Change your subtitle file to exact name as your media name but keep the extension. Example: 2 files are `abc.avi` and `xyz.srt`. Change `xyz.srt` to `abc.srt`. Now play the `abc.avi` in Windows Media Player. Right click on the playing windows, check the subtitle setting.
Another solution to that problem is [Local Subtitles for WMP](http://sourceforge.net/projects/wmpsub/). It does not brak codecs pipeline.
441,919
Is there a way to play [\*.srt](http://en.wikipedia.org/wiki/SubRip#SubRip_.srt_file_example) subtitles in Windows Media Player? I've followed the instructions in [this](http://www.brighthub.com/computing/windows-platform/articles/41466.aspx), by installing DirectVobSub and renaming the srt file to match the video fil...
2012/06/26
[ "https://superuser.com/questions/441919", "https://superuser.com", "https://superuser.com/users/9825/" ]
Use the latest version of DirectVobSub and try changing your `.srt` to a `.sub` file. It worked for me. I got it through this [link](http://www.makeuseof.com/tag/this-is-how-you-can-add-external-subtitles-on-windows-media-player/).
Change your subtitle file to exact name as your media name but keep the extension. Example: 2 files are `abc.avi` and `xyz.srt`. Change `xyz.srt` to `abc.srt`. Now play the `abc.avi` in Windows Media Player. Right click on the playing windows, check the subtitle setting.
441,919
Is there a way to play [\*.srt](http://en.wikipedia.org/wiki/SubRip#SubRip_.srt_file_example) subtitles in Windows Media Player? I've followed the instructions in [this](http://www.brighthub.com/computing/windows-platform/articles/41466.aspx), by installing DirectVobSub and renaming the srt file to match the video fil...
2012/06/26
[ "https://superuser.com/questions/441919", "https://superuser.com", "https://superuser.com/users/9825/" ]
Use the latest version of DirectVobSub and try changing your `.srt` to a `.sub` file. It worked for me. I got it through this [link](http://www.makeuseof.com/tag/this-is-how-you-can-add-external-subtitles-on-windows-media-player/).
Another solution to that problem is [Local Subtitles for WMP](http://sourceforge.net/projects/wmpsub/). It does not brak codecs pipeline.
349,185
Whether or not I have scroll direction "natural" checked or not, when I use my mouse wheel to scroll nothing happens. I can scroll with two fingers on the trackpack but turning of the mouse wheel of the MX Ergo that I linked via bluetooth gets ignored. I have installed Logitech Options and can successfully map action...
2019/01/21
[ "https://apple.stackexchange.com/questions/349185", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/88627/" ]
I needed to give the Logitech Option Dameon the ability to control my computer in System Preferences -> Security&Privacy -> Accessibility -> Privacy
Needed to give **System Preferences** > **Security & Privacy** > **Accessibility** > **Privacy** access to "Logi Options Daemon" *and* "Logi Options".
55,443,246
After install Oracle Apex 19.1, it give me error PLS-00306: wrong number or types of arguments in call to 'AJAX'. While others requests works well, ajax calls does not. * Database Versión : Oracle XE 18c * Ords Versión: ords-18.4.0.354.1002 * Apex Versión: apex\_19.1 Example: While exporting interactive reports, on...
2019/03/31
[ "https://Stackoverflow.com/questions/55443246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1783004/" ]
This appears to be a class exercise in understanding C bit operations. It further appears to assume that `unsigned char` is eight bits and `unsigned short` is 16 bits, and likely that `unsigned int` is 32 bits. Your job for the exercise is to understand which bits are moved where and to design new operations that will ...
I assume you mean inverting in the sense of decoding `threebytes` back to its constituent RGB components. First let's just look at what `threebytes` even looks like. The first step `(red << 8) + (blue)` makes a 16 bit number formatted like `rrrr rrrr bbbb bbbb`. The second step, `(us << 5 ) | (us >> 11)`, is a rotat...
61,740,241
I need to look up a user record from the Azure Active Directory corresponding to the Object ID record. I am not sure how to do it. Any example in Powershell, or Azure CLI, or C# would be helpful. Thanks. Bharat
2020/05/11
[ "https://Stackoverflow.com/questions/61740241", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1034658/" ]
The absolute simplest approach is to use the `max` and `count` functions: ``` >>> Positions = [[1,1,1,1,1], [2,2,2,2,2], [3,3,3,3,3], [1,1,1,1,1]] >>> max(Positions.count(a) for a in Positions) 2 ``` If you have some flexibility over how you track `Positions` (i.e. if they don't need to be lists and could instead be...
Normally when you want to count then it's good to look at what `collections.Counter` brings to the table. Counter needs hasable types to count so I convert each inner list into a tuple for counting then use `Counter.most_common()` to do the heavy lifting. ``` In [93]: from collections import Counter In [94]: Position...
61,740,241
I need to look up a user record from the Azure Active Directory corresponding to the Object ID record. I am not sure how to do it. Any example in Powershell, or Azure CLI, or C# would be helpful. Thanks. Bharat
2020/05/11
[ "https://Stackoverflow.com/questions/61740241", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1034658/" ]
To keep it `O(n)`: ```py res={} for el in Positions: res[tuple(el)]=res.get(tuple(el), 0)+1 print(max(res.values())) ``` Which in your case returns `2`
Normally when you want to count then it's good to look at what `collections.Counter` brings to the table. Counter needs hasable types to count so I convert each inner list into a tuple for counting then use `Counter.most_common()` to do the heavy lifting. ``` In [93]: from collections import Counter In [94]: Position...
56,455,851
I am setting up a project in STS with Spring starter project and added required dependencies like spring security and JSP. But the top line of pom file throwing an error as Unknown Can anybody help me out to resolve this? I am using STS 4 ``` <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apac...
2019/06/05
[ "https://Stackoverflow.com/questions/56455851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11519330/" ]
This is the latest surprise [Eclipse bug](https://bugs.eclipse.org/bugs/show_bug.cgi?id=547340) when using with Spring Boot 2.1.5 due to Spring Boot 2.1.5 upgrade `maven-jar-plugin` to 3.1.2 The workaround is to downgrade it to the previous version by adding the following to `pom.xml` : ``` <properties> <maven-ja...
``` <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.4.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> ```
521,761
Arguing with a friend of mine — I am advocating git/hg, he is advocating CLOBs MySQL. What is your preference?
2009/02/06
[ "https://Stackoverflow.com/questions/521761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45652/" ]
I believe that totally and completely depends on your requirements. If my main requirement is to simply keep a versioned copy, so there is always a backup, then you can use GIT or CVS or Subversion, whatever you like. However, if I'm storing large documents for business users, that are frequently accessed and need to b...
Depending on how large large is and how many of them you will have I think you will want to avoid storing them in any database. Version control and file systems are VERY good at storing large digital objects. Relational databases aren't.
521,761
Arguing with a friend of mine — I am advocating git/hg, he is advocating CLOBs MySQL. What is your preference?
2009/02/06
[ "https://Stackoverflow.com/questions/521761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45652/" ]
I believe that totally and completely depends on your requirements. If my main requirement is to simply keep a versioned copy, so there is always a backup, then you can use GIT or CVS or Subversion, whatever you like. However, if I'm storing large documents for business users, that are frequently accessed and need to b...
Usually, databases are easier to interface with than a tool. You may want to look into using something like CouchDB or Apache Jackrabbit which does document versioning.
521,761
Arguing with a friend of mine — I am advocating git/hg, he is advocating CLOBs MySQL. What is your preference?
2009/02/06
[ "https://Stackoverflow.com/questions/521761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45652/" ]
You should follow the golden rule to organize your data storage depending on the intended queries you are going to make. So, it can be just plain files on a NAS, git or mercurial backends, a database or a custom solution. It depends on the way / frequency you will query / update them. So given your lack of context, t...
Depending on how large large is and how many of them you will have I think you will want to avoid storing them in any database. Version control and file systems are VERY good at storing large digital objects. Relational databases aren't.
521,761
Arguing with a friend of mine — I am advocating git/hg, he is advocating CLOBs MySQL. What is your preference?
2009/02/06
[ "https://Stackoverflow.com/questions/521761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45652/" ]
Depending on how large large is and how many of them you will have I think you will want to avoid storing them in any database. Version control and file systems are VERY good at storing large digital objects. Relational databases aren't.
Usually, databases are easier to interface with than a tool. You may want to look into using something like CouchDB or Apache Jackrabbit which does document versioning.
521,761
Arguing with a friend of mine — I am advocating git/hg, he is advocating CLOBs MySQL. What is your preference?
2009/02/06
[ "https://Stackoverflow.com/questions/521761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45652/" ]
You should follow the golden rule to organize your data storage depending on the intended queries you are going to make. So, it can be just plain files on a NAS, git or mercurial backends, a database or a custom solution. It depends on the way / frequency you will query / update them. So given your lack of context, t...
Usually, databases are easier to interface with than a tool. You may want to look into using something like CouchDB or Apache Jackrabbit which does document versioning.
2,156,385
I'm currently struggling to prove that, for all $x \geq 0$, $\sinh (x) \leq x \cosh (x)$. Or equivalently, that $$ \frac{e^x - e^{-x}}{2} \leq \frac{xe^x + xe^{-x}}{2} \hspace{5 mm} \Rightarrow \hspace{5 mm} (1-x)(e^x - e^{-x}) \leq 0 $$ I've attempted to prove this by induction, but have have been unable to use the ...
2017/02/22
[ "https://math.stackexchange.com/questions/2156385", "https://math.stackexchange.com", "https://math.stackexchange.com/users/215853/" ]
$$\sinh(0)\le0\cosh(0)$$ is true, and by differentiation $$\cosh(x)\le\cosh(x)+x\sinh(x)$$ which is obviously true.
HINT: use the analytic definition, that is $$\sinh x=\sum\_{k=0}^\infty\frac{x^{2k+1}}{(2k+1)!},\quad \cosh x=\sum\_{k=0}^\infty\frac{x^{2k}}{(2k)!}$$
2,156,385
I'm currently struggling to prove that, for all $x \geq 0$, $\sinh (x) \leq x \cosh (x)$. Or equivalently, that $$ \frac{e^x - e^{-x}}{2} \leq \frac{xe^x + xe^{-x}}{2} \hspace{5 mm} \Rightarrow \hspace{5 mm} (1-x)(e^x - e^{-x}) \leq 0 $$ I've attempted to prove this by induction, but have have been unable to use the ...
2017/02/22
[ "https://math.stackexchange.com/questions/2156385", "https://math.stackexchange.com", "https://math.stackexchange.com/users/215853/" ]
Dividing each side by $\cosh x$, we have to prove that $$x-\tanh x \ge 0$$ For $x \ge 0$. However, the derivative of $x-\tanh x$ is $$\tanh^2 x \ge 0$$ So, $x-\tanh x$ is an increasing function. However, $0-\tanh 0=0$. So $x \ge \tanh x $. Done!
$$\sinh(0)\le0\cosh(0)$$ is true, and by differentiation $$\cosh(x)\le\cosh(x)+x\sinh(x)$$ which is obviously true.
2,156,385
I'm currently struggling to prove that, for all $x \geq 0$, $\sinh (x) \leq x \cosh (x)$. Or equivalently, that $$ \frac{e^x - e^{-x}}{2} \leq \frac{xe^x + xe^{-x}}{2} \hspace{5 mm} \Rightarrow \hspace{5 mm} (1-x)(e^x - e^{-x}) \leq 0 $$ I've attempted to prove this by induction, but have have been unable to use the ...
2017/02/22
[ "https://math.stackexchange.com/questions/2156385", "https://math.stackexchange.com", "https://math.stackexchange.com/users/215853/" ]
$$\sinh(0)\le0\cosh(0)$$ is true, and by differentiation $$\cosh(x)\le\cosh(x)+x\sinh(x)$$ which is obviously true.
Hint: Since $$\cosh x \leq e^{x^{2}/2}$$ and $$\frac{\sinh x}{x} \leq e^{x^{2}/6} $$ The result follows.
2,156,385
I'm currently struggling to prove that, for all $x \geq 0$, $\sinh (x) \leq x \cosh (x)$. Or equivalently, that $$ \frac{e^x - e^{-x}}{2} \leq \frac{xe^x + xe^{-x}}{2} \hspace{5 mm} \Rightarrow \hspace{5 mm} (1-x)(e^x - e^{-x}) \leq 0 $$ I've attempted to prove this by induction, but have have been unable to use the ...
2017/02/22
[ "https://math.stackexchange.com/questions/2156385", "https://math.stackexchange.com", "https://math.stackexchange.com/users/215853/" ]
$$\sinh(0)\le0\cosh(0)$$ is true, and by differentiation $$\cosh(x)\le\cosh(x)+x\sinh(x)$$ which is obviously true.
It is sufficient to consider when $x > 0$. By the mean value theorem, there is $\xi \in (0, x)$ such that $$ \frac{\sinh x}{x} = (\sinh)'(\xi) = \cosh(\xi) < \cosh x $$ since $\cosh$ is incresing on $[0,\infty)$.
2,156,385
I'm currently struggling to prove that, for all $x \geq 0$, $\sinh (x) \leq x \cosh (x)$. Or equivalently, that $$ \frac{e^x - e^{-x}}{2} \leq \frac{xe^x + xe^{-x}}{2} \hspace{5 mm} \Rightarrow \hspace{5 mm} (1-x)(e^x - e^{-x}) \leq 0 $$ I've attempted to prove this by induction, but have have been unable to use the ...
2017/02/22
[ "https://math.stackexchange.com/questions/2156385", "https://math.stackexchange.com", "https://math.stackexchange.com/users/215853/" ]
Dividing each side by $\cosh x$, we have to prove that $$x-\tanh x \ge 0$$ For $x \ge 0$. However, the derivative of $x-\tanh x$ is $$\tanh^2 x \ge 0$$ So, $x-\tanh x$ is an increasing function. However, $0-\tanh 0=0$. So $x \ge \tanh x $. Done!
HINT: use the analytic definition, that is $$\sinh x=\sum\_{k=0}^\infty\frac{x^{2k+1}}{(2k+1)!},\quad \cosh x=\sum\_{k=0}^\infty\frac{x^{2k}}{(2k)!}$$
2,156,385
I'm currently struggling to prove that, for all $x \geq 0$, $\sinh (x) \leq x \cosh (x)$. Or equivalently, that $$ \frac{e^x - e^{-x}}{2} \leq \frac{xe^x + xe^{-x}}{2} \hspace{5 mm} \Rightarrow \hspace{5 mm} (1-x)(e^x - e^{-x}) \leq 0 $$ I've attempted to prove this by induction, but have have been unable to use the ...
2017/02/22
[ "https://math.stackexchange.com/questions/2156385", "https://math.stackexchange.com", "https://math.stackexchange.com/users/215853/" ]
Dividing each side by $\cosh x$, we have to prove that $$x-\tanh x \ge 0$$ For $x \ge 0$. However, the derivative of $x-\tanh x$ is $$\tanh^2 x \ge 0$$ So, $x-\tanh x$ is an increasing function. However, $0-\tanh 0=0$. So $x \ge \tanh x $. Done!
Hint: Since $$\cosh x \leq e^{x^{2}/2}$$ and $$\frac{\sinh x}{x} \leq e^{x^{2}/6} $$ The result follows.
2,156,385
I'm currently struggling to prove that, for all $x \geq 0$, $\sinh (x) \leq x \cosh (x)$. Or equivalently, that $$ \frac{e^x - e^{-x}}{2} \leq \frac{xe^x + xe^{-x}}{2} \hspace{5 mm} \Rightarrow \hspace{5 mm} (1-x)(e^x - e^{-x}) \leq 0 $$ I've attempted to prove this by induction, but have have been unable to use the ...
2017/02/22
[ "https://math.stackexchange.com/questions/2156385", "https://math.stackexchange.com", "https://math.stackexchange.com/users/215853/" ]
Dividing each side by $\cosh x$, we have to prove that $$x-\tanh x \ge 0$$ For $x \ge 0$. However, the derivative of $x-\tanh x$ is $$\tanh^2 x \ge 0$$ So, $x-\tanh x$ is an increasing function. However, $0-\tanh 0=0$. So $x \ge \tanh x $. Done!
It is sufficient to consider when $x > 0$. By the mean value theorem, there is $\xi \in (0, x)$ such that $$ \frac{\sinh x}{x} = (\sinh)'(\xi) = \cosh(\xi) < \cosh x $$ since $\cosh$ is incresing on $[0,\infty)$.
262,977
i want to add my css file bootstrap.min.css on top of all css file. I used below code ``` wp_enqueue_style( 'bootstrap_css', 'bootstrap.min.css' ); ``` but it add css below theme css file . Issue is that i do not want to modify theme file and want to do from plugin only. I there way i can add my css after tag usi...
2017/04/09
[ "https://wordpress.stackexchange.com/questions/262977", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/70832/" ]
You can use the `is_user_logged_in()` and `is_page (array(1,2,3-page id's))` functions to check. After that you can write the redirection.
Put this CODE in your theme's `functions.php` file: ``` function admin_default_page() { return '/new-url'; } add_filter('login_redirect', 'admin_default_page'); ```
262,977
i want to add my css file bootstrap.min.css on top of all css file. I used below code ``` wp_enqueue_style( 'bootstrap_css', 'bootstrap.min.css' ); ``` but it add css below theme css file . Issue is that i do not want to modify theme file and want to do from plugin only. I there way i can add my css after tag usi...
2017/04/09
[ "https://wordpress.stackexchange.com/questions/262977", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/70832/" ]
Well i have not tested it but you can achieve your point in this way... ``` if(!is_user_logged_in() && is_page(1,2,your-page-ids)){ // wp_redirect(LOGIN_PAGE_URL.'?redirect_to='.get_the_permalink();); } ``` redirect user to login page with a query variable containing link of post or page. put this code i...
Put this CODE in your theme's `functions.php` file: ``` function admin_default_page() { return '/new-url'; } add_filter('login_redirect', 'admin_default_page'); ```
6,349,931
I would like to add an entry into a MySQL table called `fblikes` every time a user likes a something on my site. According to [this](http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/) page, you should be able to do this, and "edge.create" is "fired" when someone likes something. What I want...
2011/06/14
[ "https://Stackoverflow.com/questions/6349931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/158865/" ]
In your form, you are using `<select name='name'>`, but in your PHP script you're calling for `$_POST['id']`. Change it to: ``` <select name='id'> ```
At first glance, it looks like a typo. Try: ``` $id = mysql_real_escape_string($_POST['name']); ```
6,349,931
I would like to add an entry into a MySQL table called `fblikes` every time a user likes a something on my site. According to [this](http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/) page, you should be able to do this, and "edge.create" is "fired" when someone likes something. What I want...
2011/06/14
[ "https://Stackoverflow.com/questions/6349931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/158865/" ]
At first glance, it looks like a typo. Try: ``` $id = mysql_real_escape_string($_POST['name']); ```
``` $team_id = $_POST['name'] ``` Your select element is named "name" and your form is "POST".
6,349,931
I would like to add an entry into a MySQL table called `fblikes` every time a user likes a something on my site. According to [this](http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/) page, you should be able to do this, and "edge.create" is "fired" when someone likes something. What I want...
2011/06/14
[ "https://Stackoverflow.com/questions/6349931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/158865/" ]
At first glance, it looks like a typo. Try: ``` $id = mysql_real_escape_string($_POST['name']); ```
You need to change ``` $id = $_POST['id']; ``` to ``` $id = $_POST['name']; // as name is what you gave your select element ```
6,349,931
I would like to add an entry into a MySQL table called `fblikes` every time a user likes a something on my site. According to [this](http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/) page, you should be able to do this, and "edge.create" is "fired" when someone likes something. What I want...
2011/06/14
[ "https://Stackoverflow.com/questions/6349931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/158865/" ]
In your form, you are using `<select name='name'>`, but in your PHP script you're calling for `$_POST['id']`. Change it to: ``` <select name='id'> ```
The problem is that you don't have a form variable with "id" as its name. It looks to me as you just need to change `<select name='name'>` to `<select name='id'>`.
6,349,931
I would like to add an entry into a MySQL table called `fblikes` every time a user likes a something on my site. According to [this](http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/) page, you should be able to do this, and "edge.create" is "fired" when someone likes something. What I want...
2011/06/14
[ "https://Stackoverflow.com/questions/6349931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/158865/" ]
In your form, you are using `<select name='name'>`, but in your PHP script you're calling for `$_POST['id']`. Change it to: ``` <select name='id'> ```
``` $team_id = $_POST['name'] ``` Your select element is named "name" and your form is "POST".
6,349,931
I would like to add an entry into a MySQL table called `fblikes` every time a user likes a something on my site. According to [this](http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/) page, you should be able to do this, and "edge.create" is "fired" when someone likes something. What I want...
2011/06/14
[ "https://Stackoverflow.com/questions/6349931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/158865/" ]
In your form, you are using `<select name='name'>`, but in your PHP script you're calling for `$_POST['id']`. Change it to: ``` <select name='id'> ```
You need to change ``` $id = $_POST['id']; ``` to ``` $id = $_POST['name']; // as name is what you gave your select element ```
6,349,931
I would like to add an entry into a MySQL table called `fblikes` every time a user likes a something on my site. According to [this](http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/) page, you should be able to do this, and "edge.create" is "fired" when someone likes something. What I want...
2011/06/14
[ "https://Stackoverflow.com/questions/6349931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/158865/" ]
The problem is that you don't have a form variable with "id" as its name. It looks to me as you just need to change `<select name='name'>` to `<select name='id'>`.
``` $team_id = $_POST['name'] ``` Your select element is named "name" and your form is "POST".
6,349,931
I would like to add an entry into a MySQL table called `fblikes` every time a user likes a something on my site. According to [this](http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/) page, you should be able to do this, and "edge.create" is "fired" when someone likes something. What I want...
2011/06/14
[ "https://Stackoverflow.com/questions/6349931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/158865/" ]
The problem is that you don't have a form variable with "id" as its name. It looks to me as you just need to change `<select name='name'>` to `<select name='id'>`.
You need to change ``` $id = $_POST['id']; ``` to ``` $id = $_POST['name']; // as name is what you gave your select element ```
6,349,931
I would like to add an entry into a MySQL table called `fblikes` every time a user likes a something on my site. According to [this](http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/) page, you should be able to do this, and "edge.create" is "fired" when someone likes something. What I want...
2011/06/14
[ "https://Stackoverflow.com/questions/6349931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/158865/" ]
``` $team_id = $_POST['name'] ``` Your select element is named "name" and your form is "POST".
You need to change ``` $id = $_POST['id']; ``` to ``` $id = $_POST['name']; // as name is what you gave your select element ```
26,874,829
**UPDATE: I solved my solution using os.system:** ``` sensortag=0 while sensortag != "B4:99:4C:64:33:E0": #call the command and write to scan.txt file and then fill the process. #loop to find if the MAC address given is available os.system("hcitool lescan> scan.txt & pkill --signal SIGINT hcitool") sca...
2014/11/11
[ "https://Stackoverflow.com/questions/26874829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4241308/" ]
I solved my solution using os.system and killing the scan straight away: ``` sensortag=0 while sensortag != "B4:99:4C:64:33:E0": #call the command and write to scan.txt file and then fill the process. #loop to find if the MAC address given is available os.system("hcitool lescan> scan.txt & pkill --signal S...
After spending a few hours working this out, I came up with this solution. The problem with hcitool lescan is that it doesn't return until it receives a SIGINT, so we send it one with Python: ``` bashCommand = "hcitool lescan" process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE) time.sle...
26,874,829
**UPDATE: I solved my solution using os.system:** ``` sensortag=0 while sensortag != "B4:99:4C:64:33:E0": #call the command and write to scan.txt file and then fill the process. #loop to find if the MAC address given is available os.system("hcitool lescan> scan.txt & pkill --signal SIGINT hcitool") sca...
2014/11/11
[ "https://Stackoverflow.com/questions/26874829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4241308/" ]
I solved my solution using os.system and killing the scan straight away: ``` sensortag=0 while sensortag != "B4:99:4C:64:33:E0": #call the command and write to scan.txt file and then fill the process. #loop to find if the MAC address given is available os.system("hcitool lescan> scan.txt & pkill --signal S...
Using terminal only, following command did work: ``` hcitool lescan > scan.txt & sleep 2 && pkill --signal SIGINT hcito ``` I will just leave it here, maybe this will help someone.
34,080,839
I've got 2 questions (and I'm pretty novice, so be gentle please). The questions are related to this [jsfiddle](http:////jsfiddle.net/dmperkins74/hpm6wzuh/). 1. On the sample url below, why aren't my transitions working at all on chrome. I thought webkit was what I needed for chrome! 2. Is there an easier way to overr...
2015/12/04
[ "https://Stackoverflow.com/questions/34080839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2854639/" ]
The `transition` property is now fully supported by all major browsers for a while, so -webkit- is no longer needed (<http://caniuse.com/#search=transition>) For your issue, just change ``` transition: top 0.4s ease-in-out 0; ``` to ``` transition: top 0.4s ease-in-out; ``` I know it seems weird, but since a del...
Try this. Syntax for transition in the JavaScript was wrong. This is the correct way :) ``` testDiv.style.setProperty("-webkit-transition", "top .3s linear"); ``` ```js testDiv.style.top = "100px"; theBtn.addEventListener('mouseup', function(e) { btnUpFunc(); }, false) theBtn.addEventListener('mousedown', f...
34,080,839
I've got 2 questions (and I'm pretty novice, so be gentle please). The questions are related to this [jsfiddle](http:////jsfiddle.net/dmperkins74/hpm6wzuh/). 1. On the sample url below, why aren't my transitions working at all on chrome. I thought webkit was what I needed for chrome! 2. Is there an easier way to overr...
2015/12/04
[ "https://Stackoverflow.com/questions/34080839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2854639/" ]
Try this. Syntax for transition in the JavaScript was wrong. This is the correct way :) ``` testDiv.style.setProperty("-webkit-transition", "top .3s linear"); ``` ```js testDiv.style.top = "100px"; theBtn.addEventListener('mouseup', function(e) { btnUpFunc(); }, false) theBtn.addEventListener('mousedown', f...
If you remove the below lines ``` testDiv.style.webkitTransition = "none"; testDiv.style.webkitTransition = "top 0.4s ease-in-out 0"; ``` And remove the delay value (or change it to `0s`), then works properly. <http://jsfiddle.net/hpm6wzuh/5/>
34,080,839
I've got 2 questions (and I'm pretty novice, so be gentle please). The questions are related to this [jsfiddle](http:////jsfiddle.net/dmperkins74/hpm6wzuh/). 1. On the sample url below, why aren't my transitions working at all on chrome. I thought webkit was what I needed for chrome! 2. Is there an easier way to overr...
2015/12/04
[ "https://Stackoverflow.com/questions/34080839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2854639/" ]
The `transition` property is now fully supported by all major browsers for a while, so -webkit- is no longer needed (<http://caniuse.com/#search=transition>) For your issue, just change ``` transition: top 0.4s ease-in-out 0; ``` to ``` transition: top 0.4s ease-in-out; ``` I know it seems weird, but since a del...
If you remove the below lines ``` testDiv.style.webkitTransition = "none"; testDiv.style.webkitTransition = "top 0.4s ease-in-out 0"; ``` And remove the delay value (or change it to `0s`), then works properly. <http://jsfiddle.net/hpm6wzuh/5/>
243,879
Is it possible to create a Homebrew Formula that doesn't need a URL to download? In my case the recipe just depends on other recipes and installs a homebrew specific shell script. ``` class Test < Formula desc "Test" homepage "https://test.com" version "1.0" depends_on "yschimke/tap/oksocial" def install ...
2016/06/26
[ "https://apple.stackexchange.com/questions/243879", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/167492/" ]
You have to use an url in your receipt, that's mandatory. You don't have to use the http(s) url scheme, you can also use file:. If you don't need any content, you can use the /dev/null file. It can even have a checksum to silence the related warning. ``` url "file:///dev/null" sha256 "e3b0c44298fc1c149afbf4c8996fb924...
I got it working by creating an empty tar file and linking to that. But I'm curious if there are better ways. ``` $ tar cvf empty.tar --files-from /dev/null ```
3,880,289
$$\sum\_{n=1}^\infty\bigl(3\log(n^2+1)-2\log(n^3+1)\bigr)$$ I tried the limit comparison test with $\sum\_{n=1}^\infty\frac1{n^2}$ and then applied L'Hopital's Rule. What I ended up was a limit which was a real number and as the series of $\frac1{n^2}$ converges, my original series converges as well. However, I was wo...
2020/10/25
[ "https://math.stackexchange.com/questions/3880289", "https://math.stackexchange.com", "https://math.stackexchange.com/users/841670/" ]
The series at hand can be rewritten as $$\sum\_{n=1}^\infty\left[ 3(\log(n^2+1) - 2\log(n)) - 2(\log(n^3+1)-3\log(n))\right]$$ For any $\alpha > 1$, if we apply MVT to $\log(x)$ over interval $(n^\alpha,n^\alpha+1)$, we find there is a $\xi \in (0,1)$ such that $$\log(n^\alpha+1) - \alpha\log(n) = \log(n^\alpha+1) - ...
For each $n\in\Bbb N$, you have\begin{align}3\log(n^2+1)-2\log(n^3+1)&=\log\left(\frac{(n^2+1)^3}{(n^3+1)^2}\right)\\&=\log\left(\frac{\left(1+\frac1{n^2}\right)^3}{\left(1+\frac1{n^3}\right)^2}\right).\end{align}But, near $0$, you have$$\log\left(\frac{(1+x^2)^3}{(1+x^3)^2}\right)=3x^2-2x^3+\cdots$$and therefore$$\lim...
3,880,289
$$\sum\_{n=1}^\infty\bigl(3\log(n^2+1)-2\log(n^3+1)\bigr)$$ I tried the limit comparison test with $\sum\_{n=1}^\infty\frac1{n^2}$ and then applied L'Hopital's Rule. What I ended up was a limit which was a real number and as the series of $\frac1{n^2}$ converges, my original series converges as well. However, I was wo...
2020/10/25
[ "https://math.stackexchange.com/questions/3880289", "https://math.stackexchange.com", "https://math.stackexchange.com/users/841670/" ]
For each $n\in\Bbb N$, you have\begin{align}3\log(n^2+1)-2\log(n^3+1)&=\log\left(\frac{(n^2+1)^3}{(n^3+1)^2}\right)\\&=\log\left(\frac{\left(1+\frac1{n^2}\right)^3}{\left(1+\frac1{n^3}\right)^2}\right).\end{align}But, near $0$, you have$$\log\left(\frac{(1+x^2)^3}{(1+x^3)^2}\right)=3x^2-2x^3+\cdots$$and therefore$$\lim...
Similar to TheSilverDoe's answer, we have that eventually $$3\log(n^2+1)-2\log(n^3+1)=\log\left(\frac{(n^2+1)^3}{(n^3+1)^2}\right)=\ln\left( 1+\frac{3n^4-2n^3+3n^2}{n^6+2n^3+1}\right) \le$$ $$\le \frac{3n^4-2n^3+3n^2}{n^6+2n^3+1} \le \frac{4n^4}{\frac12n^6}=8\frac1{n^2}$$ and we can conclude by direct comparson test...
3,880,289
$$\sum\_{n=1}^\infty\bigl(3\log(n^2+1)-2\log(n^3+1)\bigr)$$ I tried the limit comparison test with $\sum\_{n=1}^\infty\frac1{n^2}$ and then applied L'Hopital's Rule. What I ended up was a limit which was a real number and as the series of $\frac1{n^2}$ converges, my original series converges as well. However, I was wo...
2020/10/25
[ "https://math.stackexchange.com/questions/3880289", "https://math.stackexchange.com", "https://math.stackexchange.com/users/841670/" ]
The series at hand can be rewritten as $$\sum\_{n=1}^\infty\left[ 3(\log(n^2+1) - 2\log(n)) - 2(\log(n^3+1)-3\log(n))\right]$$ For any $\alpha > 1$, if we apply MVT to $\log(x)$ over interval $(n^\alpha,n^\alpha+1)$, we find there is a $\xi \in (0,1)$ such that $$\log(n^\alpha+1) - \alpha\log(n) = \log(n^\alpha+1) - ...
$$3\ln(n^2+1)-2\ln(n^3+1)=\ln\left( \frac{(n^2+1)^3}{(n^3+1)^2}\right)=\ln\left( \frac{n^6+3n^4+3n^2+1}{n^6+2n^3+1}\right)$$ $$=\ln\left( 1+\frac{3n^4-2n^3+3n^2}{n^6+2n^3+1}\right) \sim \frac{3n^4-2n^3+3n^2}{n^6+2n^3+1} \sim \frac{3}{n^2}$$ Therefore the series converges.
3,880,289
$$\sum\_{n=1}^\infty\bigl(3\log(n^2+1)-2\log(n^3+1)\bigr)$$ I tried the limit comparison test with $\sum\_{n=1}^\infty\frac1{n^2}$ and then applied L'Hopital's Rule. What I ended up was a limit which was a real number and as the series of $\frac1{n^2}$ converges, my original series converges as well. However, I was wo...
2020/10/25
[ "https://math.stackexchange.com/questions/3880289", "https://math.stackexchange.com", "https://math.stackexchange.com/users/841670/" ]
$$3\ln(n^2+1)-2\ln(n^3+1)=\ln\left( \frac{(n^2+1)^3}{(n^3+1)^2}\right)=\ln\left( \frac{n^6+3n^4+3n^2+1}{n^6+2n^3+1}\right)$$ $$=\ln\left( 1+\frac{3n^4-2n^3+3n^2}{n^6+2n^3+1}\right) \sim \frac{3n^4-2n^3+3n^2}{n^6+2n^3+1} \sim \frac{3}{n^2}$$ Therefore the series converges.
Similar to TheSilverDoe's answer, we have that eventually $$3\log(n^2+1)-2\log(n^3+1)=\log\left(\frac{(n^2+1)^3}{(n^3+1)^2}\right)=\ln\left( 1+\frac{3n^4-2n^3+3n^2}{n^6+2n^3+1}\right) \le$$ $$\le \frac{3n^4-2n^3+3n^2}{n^6+2n^3+1} \le \frac{4n^4}{\frac12n^6}=8\frac1{n^2}$$ and we can conclude by direct comparson test...
3,880,289
$$\sum\_{n=1}^\infty\bigl(3\log(n^2+1)-2\log(n^3+1)\bigr)$$ I tried the limit comparison test with $\sum\_{n=1}^\infty\frac1{n^2}$ and then applied L'Hopital's Rule. What I ended up was a limit which was a real number and as the series of $\frac1{n^2}$ converges, my original series converges as well. However, I was wo...
2020/10/25
[ "https://math.stackexchange.com/questions/3880289", "https://math.stackexchange.com", "https://math.stackexchange.com/users/841670/" ]
The series at hand can be rewritten as $$\sum\_{n=1}^\infty\left[ 3(\log(n^2+1) - 2\log(n)) - 2(\log(n^3+1)-3\log(n))\right]$$ For any $\alpha > 1$, if we apply MVT to $\log(x)$ over interval $(n^\alpha,n^\alpha+1)$, we find there is a $\xi \in (0,1)$ such that $$\log(n^\alpha+1) - \alpha\log(n) = \log(n^\alpha+1) - ...
Similar to TheSilverDoe's answer, we have that eventually $$3\log(n^2+1)-2\log(n^3+1)=\log\left(\frac{(n^2+1)^3}{(n^3+1)^2}\right)=\ln\left( 1+\frac{3n^4-2n^3+3n^2}{n^6+2n^3+1}\right) \le$$ $$\le \frac{3n^4-2n^3+3n^2}{n^6+2n^3+1} \le \frac{4n^4}{\frac12n^6}=8\frac1{n^2}$$ and we can conclude by direct comparson test...
12,762,256
I used following AutoHotKey code to display the "Go to page" dialog in Adobe Reader: ``` SetTitleMatchMode, 2 #ifWinActive Adobe Reader p:: Send ^+n #ifWinActive ``` The problem is that it prevents me from typing the `P` key in find text box. How can I disable that shortcut while typing?
2012/10/06
[ "https://Stackoverflow.com/questions/12762256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/752603/" ]
``` <?php $dbname = 'mysql_dbname'; if (!mysql_connect('mysql_host', 'mysql_user', 'mysql_password')) { echo 'Could not connect to mysql'; exit; } $sql = "SHOW TABLES FROM $dbname"; $result = mysql_query($sql); if (!$result) { echo "DB Error, could not list tables\n"; echo 'MySQL Error: ' . mysql_err...
You can use the `show tables` command to check what tables there are in the database. If it comes back empty, then the database is empty.
12,762,256
I used following AutoHotKey code to display the "Go to page" dialog in Adobe Reader: ``` SetTitleMatchMode, 2 #ifWinActive Adobe Reader p:: Send ^+n #ifWinActive ``` The problem is that it prevents me from typing the `P` key in find text box. How can I disable that shortcut while typing?
2012/10/06
[ "https://Stackoverflow.com/questions/12762256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/752603/" ]
If you feel you will need some where clauses or something like this in future then use: ``` SELECT table_name FROM information_schema.tables WHERE table_schema = 'somedbname' ``` If you are looking for particular table or tables you can use ``` SELECT table_name FROM information_schema.tables WHERE table_schema = '...
You can use the `show tables` command to check what tables there are in the database. If it comes back empty, then the database is empty.
12,762,256
I used following AutoHotKey code to display the "Go to page" dialog in Adobe Reader: ``` SetTitleMatchMode, 2 #ifWinActive Adobe Reader p:: Send ^+n #ifWinActive ``` The problem is that it prevents me from typing the `P` key in find text box. How can I disable that shortcut while typing?
2012/10/06
[ "https://Stackoverflow.com/questions/12762256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/752603/" ]
The use of mysql\_query and mysql\_list\_tables is discouraged. Instead, you are advised to use mysqli functions. ``` <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); if ($result = mysqli_query($link,"SHOW TABLES [FROM db_name] [LIKE 'pattern']")) { // Check mysqli_num_row...
You can use the `show tables` command to check what tables there are in the database. If it comes back empty, then the database is empty.
12,762,256
I used following AutoHotKey code to display the "Go to page" dialog in Adobe Reader: ``` SetTitleMatchMode, 2 #ifWinActive Adobe Reader p:: Send ^+n #ifWinActive ``` The problem is that it prevents me from typing the `P` key in find text box. How can I disable that shortcut while typing?
2012/10/06
[ "https://Stackoverflow.com/questions/12762256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/752603/" ]
``` <?php $dbname = 'mysql_dbname'; if (!mysql_connect('mysql_host', 'mysql_user', 'mysql_password')) { echo 'Could not connect to mysql'; exit; } $sql = "SHOW TABLES FROM $dbname"; $result = mysql_query($sql); if (!$result) { echo "DB Error, could not list tables\n"; echo 'MySQL Error: ' . mysql_err...
If you feel you will need some where clauses or something like this in future then use: ``` SELECT table_name FROM information_schema.tables WHERE table_schema = 'somedbname' ``` If you are looking for particular table or tables you can use ``` SELECT table_name FROM information_schema.tables WHERE table_schema = '...
12,762,256
I used following AutoHotKey code to display the "Go to page" dialog in Adobe Reader: ``` SetTitleMatchMode, 2 #ifWinActive Adobe Reader p:: Send ^+n #ifWinActive ``` The problem is that it prevents me from typing the `P` key in find text box. How can I disable that shortcut while typing?
2012/10/06
[ "https://Stackoverflow.com/questions/12762256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/752603/" ]
``` <?php $dbname = 'mysql_dbname'; if (!mysql_connect('mysql_host', 'mysql_user', 'mysql_password')) { echo 'Could not connect to mysql'; exit; } $sql = "SHOW TABLES FROM $dbname"; $result = mysql_query($sql); if (!$result) { echo "DB Error, could not list tables\n"; echo 'MySQL Error: ' . mysql_err...
The use of mysql\_query and mysql\_list\_tables is discouraged. Instead, you are advised to use mysqli functions. ``` <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); if ($result = mysqli_query($link,"SHOW TABLES [FROM db_name] [LIKE 'pattern']")) { // Check mysqli_num_row...
12,762,256
I used following AutoHotKey code to display the "Go to page" dialog in Adobe Reader: ``` SetTitleMatchMode, 2 #ifWinActive Adobe Reader p:: Send ^+n #ifWinActive ``` The problem is that it prevents me from typing the `P` key in find text box. How can I disable that shortcut while typing?
2012/10/06
[ "https://Stackoverflow.com/questions/12762256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/752603/" ]
The use of mysql\_query and mysql\_list\_tables is discouraged. Instead, you are advised to use mysqli functions. ``` <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); if ($result = mysqli_query($link,"SHOW TABLES [FROM db_name] [LIKE 'pattern']")) { // Check mysqli_num_row...
If you feel you will need some where clauses or something like this in future then use: ``` SELECT table_name FROM information_schema.tables WHERE table_schema = 'somedbname' ``` If you are looking for particular table or tables you can use ``` SELECT table_name FROM information_schema.tables WHERE table_schema = '...
42,619,875
I recently discovered that adding parallel computing (e.g. using parallel-collections) inside UDFs increases performance considerable even when running spark in `local[1]` mode or using Yarn with 1 executor and 1 core. E.g. in `local[1]` mode, the Spark-Jobs consumes as much CPU as possible (i.e. 800% if I have 8 core...
2017/03/06
[ "https://Stackoverflow.com/questions/42619875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1138523/" ]
Spark does not limit CPU directly, instead it defines the number of concurrent threads spark creates. So for local[1] it would basically run one task at a time in parallel. When you are doing in.par.map{expensive} you are creating threads which spark does not manage and therefore are not handled by this limit. i.e. you...
Spark are configuration of CPU usage examople ``` val conf = new SparkConf() .setMaster("local[2]") .setAppName("CountingSheep") val sc = new SparkContext(conf) ``` change the local[\*] it will utilization all of your CPU cores.