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
61,916,754
During request GET in Postman (<https://localhost:9001/test>) I've received an error: *Error: write EPROTO 8768:error:1408F10B:SSL **routines:ssl3\_get\_record:wrong version number**:c:\users\administrator\buildkite-agent\builds\pm-electron\postman\electron-release\vendor\node\deps\openssl\openssl\ssl\record\ssl3\_rec...
2020/05/20
[ "https://Stackoverflow.com/questions/61916754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6730856/" ]
it has to be the http not https for localhost "http://localhost:3000" NOT "https://localhost:3000"
the reason was in an incorrect link. In the controller I have used @RequestMapping(value="/{baseSiteId}/test") And this {baseSiteId} was not what I expected.
61,916,754
During request GET in Postman (<https://localhost:9001/test>) I've received an error: *Error: write EPROTO 8768:error:1408F10B:SSL **routines:ssl3\_get\_record:wrong version number**:c:\users\administrator\buildkite-agent\builds\pm-electron\postman\electron-release\vendor\node\deps\openssl\openssl\ssl\record\ssl3\_rec...
2020/05/20
[ "https://Stackoverflow.com/questions/61916754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6730856/" ]
For Localhost we don't really need https, please try with <http://localhost:9001/test>
``` const transporter = nodemailer.createTransport({ host:'smtp.gmail.com', port:587, secure:false, requireTLC:true, auth: { user:'youmail@gmail.com', pass:'youpass' } } ``` Notice that `secure:` is `false`. The error occurs when `secure:` is `true`.
61,916,754
During request GET in Postman (<https://localhost:9001/test>) I've received an error: *Error: write EPROTO 8768:error:1408F10B:SSL **routines:ssl3\_get\_record:wrong version number**:c:\users\administrator\buildkite-agent\builds\pm-electron\postman\electron-release\vendor\node\deps\openssl\openssl\ssl\record\ssl3\_rec...
2020/05/20
[ "https://Stackoverflow.com/questions/61916754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6730856/" ]
For Localhost we don't really need https, please try with <http://localhost:9001/test>
check that you are using the `HTTP` protocol not `HTTPS` to send requests to the server: ### example ```js export const config = { baseUrl: "http://localhost:4000" } ```
61,916,754
During request GET in Postman (<https://localhost:9001/test>) I've received an error: *Error: write EPROTO 8768:error:1408F10B:SSL **routines:ssl3\_get\_record:wrong version number**:c:\users\administrator\buildkite-agent\builds\pm-electron\postman\electron-release\vendor\node\deps\openssl\openssl\ssl\record\ssl3\_rec...
2020/05/20
[ "https://Stackoverflow.com/questions/61916754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6730856/" ]
For Localhost we don't really need https, please try with <http://localhost:9001/test>
it has to be the http not https for localhost "http://localhost:3000" NOT "https://localhost:3000"
61,916,754
During request GET in Postman (<https://localhost:9001/test>) I've received an error: *Error: write EPROTO 8768:error:1408F10B:SSL **routines:ssl3\_get\_record:wrong version number**:c:\users\administrator\buildkite-agent\builds\pm-electron\postman\electron-release\vendor\node\deps\openssl\openssl\ssl\record\ssl3\_rec...
2020/05/20
[ "https://Stackoverflow.com/questions/61916754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6730856/" ]
check that you are using the `HTTP` protocol not `HTTPS` to send requests to the server: ### example ```js export const config = { baseUrl: "http://localhost:4000" } ```
``` const transporter = nodemailer.createTransport({ host:'smtp.gmail.com', port:587, secure:false, requireTLC:true, auth: { user:'youmail@gmail.com', pass:'youpass' } } ``` Notice that `secure:` is `false`. The error occurs when `secure:` is `true`.
61,916,754
During request GET in Postman (<https://localhost:9001/test>) I've received an error: *Error: write EPROTO 8768:error:1408F10B:SSL **routines:ssl3\_get\_record:wrong version number**:c:\users\administrator\buildkite-agent\builds\pm-electron\postman\electron-release\vendor\node\deps\openssl\openssl\ssl\record\ssl3\_rec...
2020/05/20
[ "https://Stackoverflow.com/questions/61916754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6730856/" ]
it has to be the http not https for localhost "http://localhost:3000" NOT "https://localhost:3000"
``` const transporter = nodemailer.createTransport({ host:'smtp.gmail.com', port:587, secure:false, requireTLC:true, auth: { user:'youmail@gmail.com', pass:'youpass' } } ``` Notice that `secure:` is `false`. The error occurs when `secure:` is `true`.
67,760,554
``` <script lang="ts"> import { Vue, Component } from 'vue-property-decorator' @Component export default class Index extends Vue { form = { name: '', adress: '', age: '', items: [], } async fetch() { this.form.items = await fetch('https://api.nuxtjs.dev/posts').then(c =...
2021/05/30
[ "https://Stackoverflow.com/questions/67760554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11069116/" ]
```js const items = [{color: "red"}, {color: "blue"}, {color: "green"}, {color: "orange"}, {color: "blue"}]; const orderedColorsArr = [ ...items.filter(({color}) => color==="blue"), ...items.filter(({color}) => color!=="blue") ].map(({color}) => color); const res = [orderedColorsArr.join(", ")]; console.log(res)...
First of all, you need an array with the colors, then you need to access the strings instead of not given properties and then sort only by the delta of the comparisons with the wanted top color. ```js const items = [{ color: "red" }, { color: "green" }, { color: "orange" }, { color: "blue" }] items.sort((a, b) =>...
67,760,554
``` <script lang="ts"> import { Vue, Component } from 'vue-property-decorator' @Component export default class Index extends Vue { form = { name: '', adress: '', age: '', items: [], } async fetch() { this.form.items = await fetch('https://api.nuxtjs.dev/posts').then(c =...
2021/05/30
[ "https://Stackoverflow.com/questions/67760554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11069116/" ]
```js const items = [{color: "red"}, {color: "blue"}, {color: "green"}, {color: "orange"}, {color: "blue"}]; const orderedColorsArr = [ ...items.filter(({color}) => color==="blue"), ...items.filter(({color}) => color!=="blue") ].map(({color}) => color); const res = [orderedColorsArr.join(", ")]; console.log(res)...
Well, it doesn't look like you're sorting anything here. So why even use sort? Try something like splicing the "blue" element off after getting the index from an indexOf function, then just inserting it at the beginning off the array. ``` let items= [ {color: "red"}, {color: "green"}, {color: "orange"}, {colo...
67,760,554
``` <script lang="ts"> import { Vue, Component } from 'vue-property-decorator' @Component export default class Index extends Vue { form = { name: '', adress: '', age: '', items: [], } async fetch() { this.form.items = await fetch('https://api.nuxtjs.dev/posts').then(c =...
2021/05/30
[ "https://Stackoverflow.com/questions/67760554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11069116/" ]
First of all, you need an array with the colors, then you need to access the strings instead of not given properties and then sort only by the delta of the comparisons with the wanted top color. ```js const items = [{ color: "red" }, { color: "green" }, { color: "orange" }, { color: "blue" }] items.sort((a, b) =>...
Well, it doesn't look like you're sorting anything here. So why even use sort? Try something like splicing the "blue" element off after getting the index from an indexOf function, then just inserting it at the beginning off the array. ``` let items= [ {color: "red"}, {color: "green"}, {color: "orange"}, {colo...
5,450,607
I need a XML library for constructing simple XML messages. I come from a Java background. I've found some suggestions pointing at Xerces-C++ XML library as it was transferred. Other suggested libraries have their advantages in memory in speed, but all of this is none of my needs. I need an API which supports an easy c...
2011/03/27
[ "https://Stackoverflow.com/questions/5450607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/658718/" ]
A simple XML library would be TinyXML, see <http://www.grinninglizard.com/tinyxmldocs/tutorial0.html> for an example (under section 'Building Documents Programatically') edit: If the XML is really simple, you can also just output the XML tags from your code. Something like: ``` std::stringstream s; s << "<tag>" << v...
[RapidXML](http://rapidxml.sourceforge.net/) > > RapidXml is an attempt to create the fastest XML parser possible, while retaining useability, portability and reasonable W3C compatibility. > > > You will build your XML file in RAM, and at any time you can convert it to a string and from that, an array of chars, m...
5,450,607
I need a XML library for constructing simple XML messages. I come from a Java background. I've found some suggestions pointing at Xerces-C++ XML library as it was transferred. Other suggested libraries have their advantages in memory in speed, but all of this is none of my needs. I need an API which supports an easy c...
2011/03/27
[ "https://Stackoverflow.com/questions/5450607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/658718/" ]
A simple XML library would be TinyXML, see <http://www.grinninglizard.com/tinyxmldocs/tutorial0.html> for an example (under section 'Building Documents Programatically') edit: If the XML is really simple, you can also just output the XML tags from your code. Something like: ``` std::stringstream s; s << "<tag>" << v...
My suggestion [tinyxml](http://www.grinninglizard.com/tinyxml/) Excellent performance and easy to use. Usage : [TinyXML Tutorial](http://www.grinninglizard.com/tinyxmldocs/tutorial0.html) or [libtinyxml](https://code.google.com/p/libtinyxml/) The TinyXML library provided with a CMake Build System.
5,450,607
I need a XML library for constructing simple XML messages. I come from a Java background. I've found some suggestions pointing at Xerces-C++ XML library as it was transferred. Other suggested libraries have their advantages in memory in speed, but all of this is none of my needs. I need an API which supports an easy c...
2011/03/27
[ "https://Stackoverflow.com/questions/5450607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/658718/" ]
A simple XML library would be TinyXML, see <http://www.grinninglizard.com/tinyxmldocs/tutorial0.html> for an example (under section 'Building Documents Programatically') edit: If the XML is really simple, you can also just output the XML tags from your code. Something like: ``` std::stringstream s; s << "<tag>" << v...
It seems like [pugixml](https://github.com/zeux/pugixml) library is [fastest](http://pugixml.org/benchmark.html) though fullyfunctional, object-oriented C++ library, with support of XPath queries.
5,450,607
I need a XML library for constructing simple XML messages. I come from a Java background. I've found some suggestions pointing at Xerces-C++ XML library as it was transferred. Other suggested libraries have their advantages in memory in speed, but all of this is none of my needs. I need an API which supports an easy c...
2011/03/27
[ "https://Stackoverflow.com/questions/5450607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/658718/" ]
My suggestion [tinyxml](http://www.grinninglizard.com/tinyxml/) Excellent performance and easy to use. Usage : [TinyXML Tutorial](http://www.grinninglizard.com/tinyxmldocs/tutorial0.html) or [libtinyxml](https://code.google.com/p/libtinyxml/) The TinyXML library provided with a CMake Build System.
[RapidXML](http://rapidxml.sourceforge.net/) > > RapidXml is an attempt to create the fastest XML parser possible, while retaining useability, portability and reasonable W3C compatibility. > > > You will build your XML file in RAM, and at any time you can convert it to a string and from that, an array of chars, m...
5,450,607
I need a XML library for constructing simple XML messages. I come from a Java background. I've found some suggestions pointing at Xerces-C++ XML library as it was transferred. Other suggested libraries have their advantages in memory in speed, but all of this is none of my needs. I need an API which supports an easy c...
2011/03/27
[ "https://Stackoverflow.com/questions/5450607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/658718/" ]
My suggestion [tinyxml](http://www.grinninglizard.com/tinyxml/) Excellent performance and easy to use. Usage : [TinyXML Tutorial](http://www.grinninglizard.com/tinyxmldocs/tutorial0.html) or [libtinyxml](https://code.google.com/p/libtinyxml/) The TinyXML library provided with a CMake Build System.
It seems like [pugixml](https://github.com/zeux/pugixml) library is [fastest](http://pugixml.org/benchmark.html) though fullyfunctional, object-oriented C++ library, with support of XPath queries.
49,188,557
I have the following jobs configuration in `.gitlab-ci.yml`: ``` job1: stage: test services: - name: mariadb alias: mysql entrypoint: [""] command: [...] script: - ... job2: stage: test services: - name: mariadb alias: mysql entrypoint: [""] command: [...] ...
2018/03/09
[ "https://Stackoverflow.com/questions/49188557", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7637120/" ]
You can also utilize Anchors YAML feature - <https://docs.gitlab.com/ee/ci/yaml/#anchors> . ``` .job_template: &job_definition services: - name: mariadb alias: mysql entrypoint: [""] command: [...] job1: <<: *job_definition stage: test ``` When the config is common for all jobs, use glo...
Just define it outside the jobs: <https://docs.gitlab.com/ce/ci/docker/using_docker_images.html#define-image-and-services-from-gitlab-ci-yml> ``` services: - name: mariadb alias: mysql entrypoint: [""] command: [...] job1: stage: test script: - ... job2: stage: test script: - .....
49,188,557
I have the following jobs configuration in `.gitlab-ci.yml`: ``` job1: stage: test services: - name: mariadb alias: mysql entrypoint: [""] command: [...] script: - ... job2: stage: test services: - name: mariadb alias: mysql entrypoint: [""] command: [...] ...
2018/03/09
[ "https://Stackoverflow.com/questions/49188557", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7637120/" ]
You can also utilize Anchors YAML feature - <https://docs.gitlab.com/ee/ci/yaml/#anchors> . ``` .job_template: &job_definition services: - name: mariadb alias: mysql entrypoint: [""] command: [...] job1: <<: *job_definition stage: test ``` When the config is common for all jobs, use glo...
You can use `extends` which was introduced in **GitLab 11.3**. It is an alternative to using [YAML anchors](https://docs.gitlab.com/ee/ci/yaml/#anchors) and is a little more flexible and readable. ``` .db_services: services: - name: mariadb alias: mysql entrypoint: [""] command: [...] job1: ...
15,124,501
I have been assigned the task of fixing an older php site since it has been moved to a newer server. The server it is on now doesn't allow globalized variables and that's pretty much all this site was running off of. When trying to upload an image, my sql statement is showing everything but the id for the listing I am ...
2013/02/27
[ "https://Stackoverflow.com/questions/15124501", "https://Stackoverflow.com", "https://Stackoverflow.com/users/880688/" ]
The first thing you need to do with this kind of problem is work through where the issues seem to be happening. So take your echoed statement... > > UPDATE member\_units SET photo = "\_img.jpg" WHERE id = ` > > > This corresponds to... ``` UPDATE $tbl_units SET photo".$_FILES['img']." = \"" . $imagename . "\" WH...
It seems like 'id' field is not sent in the HTML form. I guess it should be a hidden input ? Be careful, your script can be the target of an SQL injection : you use a user input ($\_POST['id']) directly in an SQL query. You should check if this input is actually set and numeric.
23,854,157
I have a fluid image `width: 100%` fixed to the top of my page. When a user scrolls down the page the text scrolls over the image. See this jsfiddle for a [demo](http://jsfiddle.net/qhs6h/5/show) and my [code](http://jsfiddle.net/qhs6h/5/). This is what I want to happen. The problem I'm having is when the user has not...
2014/05/25
[ "https://Stackoverflow.com/questions/23854157", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1709033/" ]
Its not about re-inventing the wheel or being more 'javascriptic'. You simply have many options to achieve the same goal. Javascript: ``` function grow(parent, tagName) { var node = document.createElement(tagName); //notice, the jQuery wrapper was removed as it is not needed parent.appendChild(node); ...
I found my perfect answer, so I share it. ``` $.fn.grow = function (name) { var child = $(document.createElement(name)); this.append(child); return child; }; ``` It adds a jQuery method and enable this kind of procedural tree building: ``` var ord_list = ["first", "second", "third"]; var n_table = $('#o...
748,478
I just had to re-install mysql and I am having a problem starting it up. It cannot find the socket (mysql.sock). The problem is that neither can I. In my Mac OS X 10.4 terminal, I type: `locate mysql.sock`, and I get back `/private/tmp/mysql.sock`. It makes sense that the socket file exist in that location, but it actu...
2009/04/14
[ "https://Stackoverflow.com/questions/748478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45849/" ]
The original questions seems to come from confusion about a) where is the file, and b) where is it being looked for (and why can't we find it there when we do a locate or grep). I think Alnitak's point was that you want to find where it was linked to - but grep will not show you a link, right? The file doesn't live the...
I couldn't find mysql socket at all so reinstalled mysql server(all tables and phpmyadmin settings were preserved). Here are the commands: 1) Install > > sudo apt-get install mysql-server > > > 2) Follow terminal configuration steps > > sudo mysql\_secure\_installation > > > 3) Check status: (Should retur...
748,478
I just had to re-install mysql and I am having a problem starting it up. It cannot find the socket (mysql.sock). The problem is that neither can I. In my Mac OS X 10.4 terminal, I type: `locate mysql.sock`, and I get back `/private/tmp/mysql.sock`. It makes sense that the socket file exist in that location, but it actu...
2009/04/14
[ "https://Stackoverflow.com/questions/748478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45849/" ]
This found it for me: ``` netstat -ln | grep mysql ``` Mac OSX
I got the exact path using: ``` netstat -ln | grep -o -m 1 -E '\S*mysqld?\.sock' ``` Since this only returns the path and doesn't require any input you could potentially use it in a shell script. MySQL must be currently running on your machine for this to work. Works for MariaDB too.
748,478
I just had to re-install mysql and I am having a problem starting it up. It cannot find the socket (mysql.sock). The problem is that neither can I. In my Mac OS X 10.4 terminal, I type: `locate mysql.sock`, and I get back `/private/tmp/mysql.sock`. It makes sense that the socket file exist in that location, but it actu...
2009/04/14
[ "https://Stackoverflow.com/questions/748478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45849/" ]
to answer the first part of your question: run ``` % mysqladmin -p -u <user-name> variables ``` and check the 'socket' variable
My problem was also the mysql.sock-file. During the drupal installation process, i had to say which database i want to use but my database wasn't found ``` mkdir /var/mysql ln -s /tmp/mysql.sock /var/mysql/mysql.sock ``` the system is searching mysql.sock but it's in the wrong directory all you have to do is to l...
748,478
I just had to re-install mysql and I am having a problem starting it up. It cannot find the socket (mysql.sock). The problem is that neither can I. In my Mac OS X 10.4 terminal, I type: `locate mysql.sock`, and I get back `/private/tmp/mysql.sock`. It makes sense that the socket file exist in that location, but it actu...
2009/04/14
[ "https://Stackoverflow.com/questions/748478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45849/" ]
to answer the first part of your question: run ``` % mysqladmin -p -u <user-name> variables ``` and check the 'socket' variable
``` $ mysqladmin variables | grep sock ``` Try this instead, this will output the demanded result, getting rid of unrelated info.
748,478
I just had to re-install mysql and I am having a problem starting it up. It cannot find the socket (mysql.sock). The problem is that neither can I. In my Mac OS X 10.4 terminal, I type: `locate mysql.sock`, and I get back `/private/tmp/mysql.sock`. It makes sense that the socket file exist in that location, but it actu...
2009/04/14
[ "https://Stackoverflow.com/questions/748478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45849/" ]
I got the exact path using: ``` netstat -ln | grep -o -m 1 -E '\S*mysqld?\.sock' ``` Since this only returns the path and doesn't require any input you could potentially use it in a shell script. MySQL must be currently running on your machine for this to work. Works for MariaDB too.
Unfortunately none of the above have worked in my case. But finally I found solutions. To find where is mysql.sock file, simply open xampp manager, select MySQL and click on Configure on the right. On the config panel click Open Conf File, and simply search for mysql.sock by pressing the CMD+F shortcut. In my case, t...
748,478
I just had to re-install mysql and I am having a problem starting it up. It cannot find the socket (mysql.sock). The problem is that neither can I. In my Mac OS X 10.4 terminal, I type: `locate mysql.sock`, and I get back `/private/tmp/mysql.sock`. It makes sense that the socket file exist in that location, but it actu...
2009/04/14
[ "https://Stackoverflow.com/questions/748478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45849/" ]
to answer the first part of your question: run ``` % mysqladmin -p -u <user-name> variables ``` and check the 'socket' variable
I couldn't find mysql socket at all so reinstalled mysql server(all tables and phpmyadmin settings were preserved). Here are the commands: 1) Install > > sudo apt-get install mysql-server > > > 2) Follow terminal configuration steps > > sudo mysql\_secure\_installation > > > 3) Check status: (Should retur...
748,478
I just had to re-install mysql and I am having a problem starting it up. It cannot find the socket (mysql.sock). The problem is that neither can I. In my Mac OS X 10.4 terminal, I type: `locate mysql.sock`, and I get back `/private/tmp/mysql.sock`. It makes sense that the socket file exist in that location, but it actu...
2009/04/14
[ "https://Stackoverflow.com/questions/748478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45849/" ]
The original questions seems to come from confusion about a) where is the file, and b) where is it being looked for (and why can't we find it there when we do a locate or grep). I think Alnitak's point was that you want to find where it was linked to - but grep will not show you a link, right? The file doesn't live the...
I'm getting the same error on Mac OS X 10.11.6: `ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)` After a lot of agonizing and digging through advice here and in related questions, none of which seemed to fix the problem, I went back and deleted the installed folders, and ...
748,478
I just had to re-install mysql and I am having a problem starting it up. It cannot find the socket (mysql.sock). The problem is that neither can I. In my Mac OS X 10.4 terminal, I type: `locate mysql.sock`, and I get back `/private/tmp/mysql.sock`. It makes sense that the socket file exist in that location, but it actu...
2009/04/14
[ "https://Stackoverflow.com/questions/748478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45849/" ]
to answer the first part of your question: run ``` % mysqladmin -p -u <user-name> variables ``` and check the 'socket' variable
To refresh the locate's database I ran ``` /usr/libexec/locate.updatedb ```
748,478
I just had to re-install mysql and I am having a problem starting it up. It cannot find the socket (mysql.sock). The problem is that neither can I. In my Mac OS X 10.4 terminal, I type: `locate mysql.sock`, and I get back `/private/tmp/mysql.sock`. It makes sense that the socket file exist in that location, but it actu...
2009/04/14
[ "https://Stackoverflow.com/questions/748478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45849/" ]
``` $ mysqladmin variables | grep sock ``` Try this instead, this will output the demanded result, getting rid of unrelated info.
I couldn't find mysql socket at all so reinstalled mysql server(all tables and phpmyadmin settings were preserved). Here are the commands: 1) Install > > sudo apt-get install mysql-server > > > 2) Follow terminal configuration steps > > sudo mysql\_secure\_installation > > > 3) Check status: (Should retur...
748,478
I just had to re-install mysql and I am having a problem starting it up. It cannot find the socket (mysql.sock). The problem is that neither can I. In my Mac OS X 10.4 terminal, I type: `locate mysql.sock`, and I get back `/private/tmp/mysql.sock`. It makes sense that the socket file exist in that location, but it actu...
2009/04/14
[ "https://Stackoverflow.com/questions/748478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45849/" ]
to answer the first part of your question: run ``` % mysqladmin -p -u <user-name> variables ``` and check the 'socket' variable
This found it for me: ``` netstat -ln | grep mysql ``` Mac OSX
57,284,696
How does one get the maximum and minimum values of a Number type like an Integer or a Float? ``` max_value(Int) ```
2019/07/31
[ "https://Stackoverflow.com/questions/57284696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/417896/" ]
For questions like this, you will be best served by looking at the julia docs <https://docs.julialang.org/en/v1/base/base/#Base.typemin> Specifically for this question, `typemin(Int)`, and `typemax(Int)` should do what you want.
But `typemax(Float64)` gives 'Inf' which is probably not what the author wanted. The trick is to use `prevfloat(typemax(Float64))` which is not that obvious. ``` julia> typemax(Float64) Inf julia> prevfloat(typemax(Float64)) 1.7976931348623157e308 ```
14,115,980
Spoiler alert, this is problem 5 of Project Euler. I am attempting to learn Clojure and solved problem 5, but it is a couple orders of magnitude slower (1515 ms in Java versus 169932 ms in Clojure). I even tried using type hinting, unchecked math operations, and inlining functions all for naught. Why is my Clojure co...
2013/01/02
[ "https://Stackoverflow.com/questions/14115980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1054469/" ]
Some performance problems: * The `(range 2 20)` call is creating a new lazy list of numbers for every increment of `i`. This is expensive, and is causing lots of unnecessary GC. * You are doing a lot of boxing by passing through function calls. Even the `(iterate inc 1)` is doing boxing / unboxing at every increment. ...
I have not been able to reproduce the 1500 ms performance. The Clojure code seems actually twice as fast as the Java version after compilation to uberjar. ``` Now timing Java version 232792560 "Elapsed time: 4385.205 msecs" Now timing Clojure version 232792560 "Elapsed time: 2511.916 msecs" ``` I put the j...
14,115,980
Spoiler alert, this is problem 5 of Project Euler. I am attempting to learn Clojure and solved problem 5, but it is a couple orders of magnitude slower (1515 ms in Java versus 169932 ms in Clojure). I even tried using type hinting, unchecked math operations, and inlining functions all for naught. Why is my Clojure co...
2013/01/02
[ "https://Stackoverflow.com/questions/14115980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1054469/" ]
Some performance problems: * The `(range 2 20)` call is creating a new lazy list of numbers for every increment of `i`. This is expensive, and is causing lots of unnecessary GC. * You are doing a lot of boxing by passing through function calls. Even the `(iterate inc 1)` is doing boxing / unboxing at every increment. ...
I know this is an old question, but I've been running into similar things. It looks like the statement from the OP, that Clojure is much worse than Java on simple loops, is true. I went through the process in this thread, starting with OP's code and then adding the performance improvements. At the end of it all, the ja...
14,115,980
Spoiler alert, this is problem 5 of Project Euler. I am attempting to learn Clojure and solved problem 5, but it is a couple orders of magnitude slower (1515 ms in Java versus 169932 ms in Clojure). I even tried using type hinting, unchecked math operations, and inlining functions all for naught. Why is my Clojure co...
2013/01/02
[ "https://Stackoverflow.com/questions/14115980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1054469/" ]
I have not been able to reproduce the 1500 ms performance. The Clojure code seems actually twice as fast as the Java version after compilation to uberjar. ``` Now timing Java version 232792560 "Elapsed time: 4385.205 msecs" Now timing Clojure version 232792560 "Elapsed time: 2511.916 msecs" ``` I put the j...
I know this is an old question, but I've been running into similar things. It looks like the statement from the OP, that Clojure is much worse than Java on simple loops, is true. I went through the process in this thread, starting with OP's code and then adding the performance improvements. At the end of it all, the ja...
4,199,312
I have a UserControl, we'll call it `myUC`, that is one among several UserControls in the main window (`myWindow`) of my WPF application. `myUC` contains a number of standard controls, one of them being a button, we'll call it `myButton`. When I click `myButton`, I would like to execute `myMethod()`, which exists in t...
2010/11/16
[ "https://Stackoverflow.com/questions/4199312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/107899/" ]
What I actually ended up having to do in VB: Create a new Public Class for my custom commands because it was undesirable to have my MainWindow class as Public: ``` Public Class Commands Public Shared myCmd As New RoutedCommand End Class ``` Create the Execute and CanExecute methods that run the desired code. Thes...
Try something like this static helper method: ``` public static T GetParentOfType<T>(DependencyObject currentObject) where T : DependencyObject { // Get the parent of the object in question DependencyObject parentObject = GetParentObject(currentObject); if (parentObject == null...
4,199,312
I have a UserControl, we'll call it `myUC`, that is one among several UserControls in the main window (`myWindow`) of my WPF application. `myUC` contains a number of standard controls, one of them being a button, we'll call it `myButton`. When I click `myButton`, I would like to execute `myMethod()`, which exists in t...
2010/11/16
[ "https://Stackoverflow.com/questions/4199312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/107899/" ]
What I actually ended up having to do in VB: Create a new Public Class for my custom commands because it was undesirable to have my MainWindow class as Public: ``` Public Class Commands Public Shared myCmd As New RoutedCommand End Class ``` Create the Execute and CanExecute methods that run the desired code. Thes...
I recommend learning about [Routed Events](http://msdn.microsoft.com/en-us/library/ms742806.aspx) and [Routed Commands](http://msdn.microsoft.com/en-us/magazine/cc785480.aspx) - this is the sort of thing they're meant to do.
4,199,312
I have a UserControl, we'll call it `myUC`, that is one among several UserControls in the main window (`myWindow`) of my WPF application. `myUC` contains a number of standard controls, one of them being a button, we'll call it `myButton`. When I click `myButton`, I would like to execute `myMethod()`, which exists in t...
2010/11/16
[ "https://Stackoverflow.com/questions/4199312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/107899/" ]
You can create a command in the window and set the Command property of the button to the name of this command. Clicking the button will fire the command, without a need for a reference to the parent window. [This tutorial explains everything very clearly.](https://web.archive.org/web/20121102095816/http://www.switchon...
Try something like this static helper method: ``` public static T GetParentOfType<T>(DependencyObject currentObject) where T : DependencyObject { // Get the parent of the object in question DependencyObject parentObject = GetParentObject(currentObject); if (parentObject == null...
4,199,312
I have a UserControl, we'll call it `myUC`, that is one among several UserControls in the main window (`myWindow`) of my WPF application. `myUC` contains a number of standard controls, one of them being a button, we'll call it `myButton`. When I click `myButton`, I would like to execute `myMethod()`, which exists in t...
2010/11/16
[ "https://Stackoverflow.com/questions/4199312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/107899/" ]
The above is all well and good... but seems a bit convoluted to me... **My similar problem:** I have a Window (MainWindow.xaml) with a UserControl (SurveyHeader.xaml) in it and inside that UserControl is another UserControl (GetSurveyByID.xaml). I have a private void in MainWindow.xaml that i want to run when a butto...
Try something like this static helper method: ``` public static T GetParentOfType<T>(DependencyObject currentObject) where T : DependencyObject { // Get the parent of the object in question DependencyObject parentObject = GetParentObject(currentObject); if (parentObject == null...
4,199,312
I have a UserControl, we'll call it `myUC`, that is one among several UserControls in the main window (`myWindow`) of my WPF application. `myUC` contains a number of standard controls, one of them being a button, we'll call it `myButton`. When I click `myButton`, I would like to execute `myMethod()`, which exists in t...
2010/11/16
[ "https://Stackoverflow.com/questions/4199312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/107899/" ]
The above is all well and good... but seems a bit convoluted to me... **My similar problem:** I have a Window (MainWindow.xaml) with a UserControl (SurveyHeader.xaml) in it and inside that UserControl is another UserControl (GetSurveyByID.xaml). I have a private void in MainWindow.xaml that i want to run when a butto...
Every control has a parent property which tells you that who actually "owns" this control. You can use that along side with type casting to access your myWindow's myMethod. You could also use the *sender* argument of your event handler like this: ``` (sender as MyWindow).myMethod() ```
4,199,312
I have a UserControl, we'll call it `myUC`, that is one among several UserControls in the main window (`myWindow`) of my WPF application. `myUC` contains a number of standard controls, one of them being a button, we'll call it `myButton`. When I click `myButton`, I would like to execute `myMethod()`, which exists in t...
2010/11/16
[ "https://Stackoverflow.com/questions/4199312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/107899/" ]
I recommend learning about [Routed Events](http://msdn.microsoft.com/en-us/library/ms742806.aspx) and [Routed Commands](http://msdn.microsoft.com/en-us/magazine/cc785480.aspx) - this is the sort of thing they're meant to do.
Try something like this static helper method: ``` public static T GetParentOfType<T>(DependencyObject currentObject) where T : DependencyObject { // Get the parent of the object in question DependencyObject parentObject = GetParentObject(currentObject); if (parentObject == null...
4,199,312
I have a UserControl, we'll call it `myUC`, that is one among several UserControls in the main window (`myWindow`) of my WPF application. `myUC` contains a number of standard controls, one of them being a button, we'll call it `myButton`. When I click `myButton`, I would like to execute `myMethod()`, which exists in t...
2010/11/16
[ "https://Stackoverflow.com/questions/4199312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/107899/" ]
You can create a command in the window and set the Command property of the button to the name of this command. Clicking the button will fire the command, without a need for a reference to the parent window. [This tutorial explains everything very clearly.](https://web.archive.org/web/20121102095816/http://www.switchon...
The above is all well and good... but seems a bit convoluted to me... **My similar problem:** I have a Window (MainWindow.xaml) with a UserControl (SurveyHeader.xaml) in it and inside that UserControl is another UserControl (GetSurveyByID.xaml). I have a private void in MainWindow.xaml that i want to run when a butto...
4,199,312
I have a UserControl, we'll call it `myUC`, that is one among several UserControls in the main window (`myWindow`) of my WPF application. `myUC` contains a number of standard controls, one of them being a button, we'll call it `myButton`. When I click `myButton`, I would like to execute `myMethod()`, which exists in t...
2010/11/16
[ "https://Stackoverflow.com/questions/4199312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/107899/" ]
You can create a command in the window and set the Command property of the button to the name of this command. Clicking the button will fire the command, without a need for a reference to the parent window. [This tutorial explains everything very clearly.](https://web.archive.org/web/20121102095816/http://www.switchon...
Every control has a parent property which tells you that who actually "owns" this control. You can use that along side with type casting to access your myWindow's myMethod. You could also use the *sender* argument of your event handler like this: ``` (sender as MyWindow).myMethod() ```
4,199,312
I have a UserControl, we'll call it `myUC`, that is one among several UserControls in the main window (`myWindow`) of my WPF application. `myUC` contains a number of standard controls, one of them being a button, we'll call it `myButton`. When I click `myButton`, I would like to execute `myMethod()`, which exists in t...
2010/11/16
[ "https://Stackoverflow.com/questions/4199312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/107899/" ]
What I actually ended up having to do in VB: Create a new Public Class for my custom commands because it was undesirable to have my MainWindow class as Public: ``` Public Class Commands Public Shared myCmd As New RoutedCommand End Class ``` Create the Execute and CanExecute methods that run the desired code. Thes...
The above is all well and good... but seems a bit convoluted to me... **My similar problem:** I have a Window (MainWindow.xaml) with a UserControl (SurveyHeader.xaml) in it and inside that UserControl is another UserControl (GetSurveyByID.xaml). I have a private void in MainWindow.xaml that i want to run when a butto...
4,199,312
I have a UserControl, we'll call it `myUC`, that is one among several UserControls in the main window (`myWindow`) of my WPF application. `myUC` contains a number of standard controls, one of them being a button, we'll call it `myButton`. When I click `myButton`, I would like to execute `myMethod()`, which exists in t...
2010/11/16
[ "https://Stackoverflow.com/questions/4199312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/107899/" ]
You can create a command in the window and set the Command property of the button to the name of this command. Clicking the button will fire the command, without a need for a reference to the parent window. [This tutorial explains everything very clearly.](https://web.archive.org/web/20121102095816/http://www.switchon...
What I actually ended up having to do in VB: Create a new Public Class for my custom commands because it was undesirable to have my MainWindow class as Public: ``` Public Class Commands Public Shared myCmd As New RoutedCommand End Class ``` Create the Execute and CanExecute methods that run the desired code. Thes...
8,015,790
XCode is driving me nuts, when I register for multiple notification types: > > > ``` > [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge]; > > ``` > > or > > > ``` > [[UIApplication sharedApplication...
2011/11/04
[ "https://Stackoverflow.com/questions/8015790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/635095/" ]
Try casting to `UIRemoteNotificationType`: ``` [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationType)(UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge)]; ```
put parentheses around the parameters like ``` [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge)]; ```
8,015,790
XCode is driving me nuts, when I register for multiple notification types: > > > ``` > [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge]; > > ``` > > or > > > ``` > [[UIApplication sharedApplication...
2011/11/04
[ "https://Stackoverflow.com/questions/8015790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/635095/" ]
For the record I was never able to solve this problem completely. It is definitely a problem with the developer tools. The line in my UIApplicationDelegate didn't work. I was able to work around this by placing this line in my MainViewController rather than my ApplicationDelegate.
put parentheses around the parameters like ``` [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge)]; ```
8,015,790
XCode is driving me nuts, when I register for multiple notification types: > > > ``` > [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge]; > > ``` > > or > > > ``` > [[UIApplication sharedApplication...
2011/11/04
[ "https://Stackoverflow.com/questions/8015790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/635095/" ]
I had this problem too. The trick is if this code is in a .mm file (Objective C++), this error occurs. If you aren't using any C++ features, change the filename extension from .mm to .m and it will compile OK.
put parentheses around the parameters like ``` [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge)]; ```
8,015,790
XCode is driving me nuts, when I register for multiple notification types: > > > ``` > [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge]; > > ``` > > or > > > ``` > [[UIApplication sharedApplication...
2011/11/04
[ "https://Stackoverflow.com/questions/8015790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/635095/" ]
Try casting to `UIRemoteNotificationType`: ``` [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationType)(UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge)]; ```
For the record I was never able to solve this problem completely. It is definitely a problem with the developer tools. The line in my UIApplicationDelegate didn't work. I was able to work around this by placing this line in my MainViewController rather than my ApplicationDelegate.
8,015,790
XCode is driving me nuts, when I register for multiple notification types: > > > ``` > [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge]; > > ``` > > or > > > ``` > [[UIApplication sharedApplication...
2011/11/04
[ "https://Stackoverflow.com/questions/8015790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/635095/" ]
I had this problem too. The trick is if this code is in a .mm file (Objective C++), this error occurs. If you aren't using any C++ features, change the filename extension from .mm to .m and it will compile OK.
Try casting to `UIRemoteNotificationType`: ``` [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationType)(UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge)]; ```
8,015,790
XCode is driving me nuts, when I register for multiple notification types: > > > ``` > [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge]; > > ``` > > or > > > ``` > [[UIApplication sharedApplication...
2011/11/04
[ "https://Stackoverflow.com/questions/8015790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/635095/" ]
I had this problem too. The trick is if this code is in a .mm file (Objective C++), this error occurs. If you aren't using any C++ features, change the filename extension from .mm to .m and it will compile OK.
For the record I was never able to solve this problem completely. It is definitely a problem with the developer tools. The line in my UIApplicationDelegate didn't work. I was able to work around this by placing this line in my MainViewController rather than my ApplicationDelegate.
1,314,640
I used inequality between arithmetic and geometric means to show that a sequence $\{a\_{n}\}$ is bounded: $$a\_{n+2}=\sqrt{a\_{n+1}a\_{n}}\le \frac{a\_{n+1}+a\_{n}}{2}$$ Solving this, I get quadratic inequality $$a^2\_{n+1}-2a\_{n+1}a\_{n}+a^2\_{n}\ge 0$$ which gets me to $$0\le a\_{n}\le 1$$ thus, sequence is bounde...
2015/06/06
[ "https://math.stackexchange.com/questions/1314640", "https://math.stackexchange.com", "https://math.stackexchange.com/users/222321/" ]
Let $c\_n=\log a\_n$. Then the sequence $\{c\_n\}\_{n\in\mathbb N}$ satisfies the recursive relation: $$ c\_{n+2}=\frac{1}{2}c\_{n+1}+\frac{1}{2}c\_{n}, \quad c\_1=\log a,\,\,c\_2=\log b. $$ Then we have $$ c\_{n+2}-c\_{n+1}=-\frac{1}{2}\big(c\_{n+1}-c\_{n})=\cdots=\frac{(-1)^n}{2^n}(c\_2-c\_1). \tag{1} $$ Also $$ c\_{...
* Assume WLOG $a<b$. * Now show that the even subsequence $\{a\_{2n}\}$ and the odd subsequence $\{a\_{2n-1}\}$ are individually monotonic. * Show that all the terms of one of these subsequences are greater than all the terms of the other subsequence. * So you have got bounded monotonic even subsequence and bounded mon...
1,314,640
I used inequality between arithmetic and geometric means to show that a sequence $\{a\_{n}\}$ is bounded: $$a\_{n+2}=\sqrt{a\_{n+1}a\_{n}}\le \frac{a\_{n+1}+a\_{n}}{2}$$ Solving this, I get quadratic inequality $$a^2\_{n+1}-2a\_{n+1}a\_{n}+a^2\_{n}\ge 0$$ which gets me to $$0\le a\_{n}\le 1$$ thus, sequence is bounde...
2015/06/06
[ "https://math.stackexchange.com/questions/1314640", "https://math.stackexchange.com", "https://math.stackexchange.com/users/222321/" ]
Let $c\_n=\log a\_n$. Then the sequence $\{c\_n\}\_{n\in\mathbb N}$ satisfies the recursive relation: $$ c\_{n+2}=\frac{1}{2}c\_{n+1}+\frac{1}{2}c\_{n}, \quad c\_1=\log a,\,\,c\_2=\log b. $$ Then we have $$ c\_{n+2}-c\_{n+1}=-\frac{1}{2}\big(c\_{n+1}-c\_{n})=\cdots=\frac{(-1)^n}{2^n}(c\_2-c\_1). \tag{1} $$ Also $$ c\_{...
A shortcut: assume that a real sequence is given by some values of $c\_1,c\_2$ and the recurrence relation $c\_{n+2}=\frac{c\_n+c\_{n+1}}{2}$. Then it is convergent since: $$ \left|c\_{n+1}-c\_n\right|=\frac{1}{2}\left|c\_{n}-c\_{n-1}\right| \tag{1}$$ and it converges to $\frac{c\_1+2c\_2}{3}$ since: $$ c\_{n}+2 c\_{n+...
15,367,474
I'm trying to get started using Selenium with Chrome, i've had no previous trouble dealing with Selenium+Firefox, but i cannot seem to launch a Chrome browser now - every time I try, a Firefox browser appears instead. Here is my setup: ``` $web_driver = new ChromeDriver("C:\chromedriver\chromedriver.exe"); $session =...
2013/03/12
[ "https://Stackoverflow.com/questions/15367474", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2030573/" ]
Try using ``` $session = $web_driver->session('googlechrome'); ``` instead of ``` $session = $web_driver->session('chrome'); ```
You might want to take a look [here](https://github.com/facebook/php-webdriver/wiki/ChromeDriver) and [here](https://github.com/facebook/php-webdriver). ``` $host = 'http://localhost:4444/wd/hub'; // this is the default $capabilities = DesiredCapabilities::htmlUnitWithJS(); { // For Chrome $options = new ChromeOpt...
56,746,385
I have some configurations in my application.properties file: ``` ... quarkus.datasource.url=jdbc:postgresql://...:5432/.... quarkus.datasource.driver=org.postgresql.Driver quarkus.datasource.username=user quarkus.datasource.password=password quarkus.hibernate-orm.database.generation=update ... ``` I have a schedule...
2019/06/25
[ "https://Stackoverflow.com/questions/56746385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11283188/" ]
Quarkus don't allow you to globally configure the default transaction timeout yet (see <https://github.com/quarkusio/quarkus/pull/2984>). But you should be able to do this at the user transaction level. You can inject the UserTransaction object and set the transaction timeout in a postconstruct bloc. Something like ...
Thanks @loicmathieu for the answer! I will just append some more details below. You need to remove @Transactional and set transaction timeout before begin the transaction. In the end, you must commit the transaction: ``` import io.quarkus.scheduler.Scheduled import javax.enterprise.context.ApplicationScoped import j...
56,746,385
I have some configurations in my application.properties file: ``` ... quarkus.datasource.url=jdbc:postgresql://...:5432/.... quarkus.datasource.driver=org.postgresql.Driver quarkus.datasource.username=user quarkus.datasource.password=password quarkus.hibernate-orm.database.generation=update ... ``` I have a schedule...
2019/06/25
[ "https://Stackoverflow.com/questions/56746385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11283188/" ]
Quarkus don't allow you to globally configure the default transaction timeout yet (see <https://github.com/quarkusio/quarkus/pull/2984>). But you should be able to do this at the user transaction level. You can inject the UserTransaction object and set the transaction timeout in a postconstruct bloc. Something like ...
Use the @TransactionConfiguration annotation and specify the seconds: ``` @Transactional @TransactionConfiguration(timeout = 9876) @Scheduled(every = "7200s") open fun process() { ... my slow proccess goes here... entityManager.persist(myObject) } ```
56,746,385
I have some configurations in my application.properties file: ``` ... quarkus.datasource.url=jdbc:postgresql://...:5432/.... quarkus.datasource.driver=org.postgresql.Driver quarkus.datasource.username=user quarkus.datasource.password=password quarkus.hibernate-orm.database.generation=update ... ``` I have a schedule...
2019/06/25
[ "https://Stackoverflow.com/questions/56746385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11283188/" ]
Seems that this has changed -> it is now possible to set the Transaction timeout: <https://quarkus.io/guides/transaction> You can configure the default transaction timeout, the timeout that applies to all transactions managed by the transaction manager, via the property: ``` quarkus.transaction-manager.default-trans...
Thanks @loicmathieu for the answer! I will just append some more details below. You need to remove @Transactional and set transaction timeout before begin the transaction. In the end, you must commit the transaction: ``` import io.quarkus.scheduler.Scheduled import javax.enterprise.context.ApplicationScoped import j...
56,746,385
I have some configurations in my application.properties file: ``` ... quarkus.datasource.url=jdbc:postgresql://...:5432/.... quarkus.datasource.driver=org.postgresql.Driver quarkus.datasource.username=user quarkus.datasource.password=password quarkus.hibernate-orm.database.generation=update ... ``` I have a schedule...
2019/06/25
[ "https://Stackoverflow.com/questions/56746385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11283188/" ]
Seems that this has changed -> it is now possible to set the Transaction timeout: <https://quarkus.io/guides/transaction> You can configure the default transaction timeout, the timeout that applies to all transactions managed by the transaction manager, via the property: ``` quarkus.transaction-manager.default-trans...
Use the @TransactionConfiguration annotation and specify the seconds: ``` @Transactional @TransactionConfiguration(timeout = 9876) @Scheduled(every = "7200s") open fun process() { ... my slow proccess goes here... entityManager.persist(myObject) } ```
60,520,685
I'm provided with a .txt file every day which contains semicolon-separated data. Users of my app are meant to upload this file to the database daily. Currently, I'm reading and storing the information as such: ``` $array = array(); $csv = str_getcsv($request->file, "\n"); foreach ($csv as &$row) { $row = str_getc...
2020/03/04
[ "https://Stackoverflow.com/questions/60520685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The [`Start-Process`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/start-process) cmdlet has a [`-AgumentList`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/start-process?view=powershell-7#parameters) parameter: ``` $direct = "D:\Learn" Star...
I think they all were arguments of powershell.exe. The whole argument can be wrapped in one double quote in argumentlist. ``` Start-Process "powershell.exe" -ArgumentList "-windowstyle minimized '.\testing.exe' -path $direct" ``` Or even it can be done without start-process: ``` & "powershell.exe -windowstyle minim...
60,520,685
I'm provided with a .txt file every day which contains semicolon-separated data. Users of my app are meant to upload this file to the database daily. Currently, I'm reading and storing the information as such: ``` $array = array(); $csv = str_getcsv($request->file, "\n"); foreach ($csv as &$row) { $row = str_getc...
2020/03/04
[ "https://Stackoverflow.com/questions/60520685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If you want to just run a *File* with some *arguments* ``` $filepath = ".\Testing.exe" $direct = "D:\Learn" Start-Process -FilePath $filepath -ArgumentList $direct -Wait -NoNewWindow ```
I think they all were arguments of powershell.exe. The whole argument can be wrapped in one double quote in argumentlist. ``` Start-Process "powershell.exe" -ArgumentList "-windowstyle minimized '.\testing.exe' -path $direct" ``` Or even it can be done without start-process: ``` & "powershell.exe -windowstyle minim...
51,700,834
usNumber represents the sequence number. cUnitID represents the cassette identifier, but different vendors have different formats to represent it. Where can I find this format? Is there any other place where I can get the logical cash unit identifier (Type number)
2018/08/06
[ "https://Stackoverflow.com/questions/51700834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10180564/" ]
first of all, i do not know what you mean "different formats".usType defined by wosa/xfs library. below definition are from Xfscdm.h, and they are fixed. ``` /* values of WFSCDMCASHUNIT.usType */ #define WFS_CDM_TYPENA (1) #define WFS_CDM_TYPEREJECTCASSETTE (2) #define WFS_CDM...
In addition to the suggested answer which is OK, don't forget to allocate enough memory for printing out the results, e.g r = WFMAllocateMore(sizeof(WFSCDMCASHUNIT), result, (void\*\*)&cashUnitInfo[no]);
857
I have one portfolio with high beta stocks, and one with low beta stocks. Is it better to have higher expected return with high volatility, or medium expected return with medium volatility? (All from a asset allocation, efficient frontier, risk/reward prospective.)
2011/03/30
[ "https://quant.stackexchange.com/questions/857", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/520/" ]
Most portfolio managers look at the [Sharpe ratio](http://en.wikipedia.org/wiki/Sharpe_ratio), or occasionally the [Treynor ratio](http://en.wikipedia.org/wiki/Treynor_ratio). In general, you want to maximize one of the these metrics, though there could be other issues that you haven't currently considered, like turnov...
The empirical evidence shows that low to medium beta portfolios beat high beta portfolios on a risk adjusted basis. Search SSRN for "betting against beta." This flies completely in the face of CAPM but frankly CAPM is crap.
857
I have one portfolio with high beta stocks, and one with low beta stocks. Is it better to have higher expected return with high volatility, or medium expected return with medium volatility? (All from a asset allocation, efficient frontier, risk/reward prospective.)
2011/03/30
[ "https://quant.stackexchange.com/questions/857", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/520/" ]
Most portfolio managers look at the [Sharpe ratio](http://en.wikipedia.org/wiki/Sharpe_ratio), or occasionally the [Treynor ratio](http://en.wikipedia.org/wiki/Treynor_ratio). In general, you want to maximize one of the these metrics, though there could be other issues that you haven't currently considered, like turnov...
You still want to perform portfolio optimization. Put everything into one bucket, run 'global' portfolio optimization, build the portfolio. Even if you prefer Sharpe ratios, you should do that on the overall portfolio - not just on individual ones. Be careful of sharpe ratios for low risk, low return assets. Dividing o...
857
I have one portfolio with high beta stocks, and one with low beta stocks. Is it better to have higher expected return with high volatility, or medium expected return with medium volatility? (All from a asset allocation, efficient frontier, risk/reward prospective.)
2011/03/30
[ "https://quant.stackexchange.com/questions/857", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/520/" ]
From a theoretical point of view (you mentioned beta, so assume we're in a CAPM world), you should hold the market portfolio (let's assume S&P500 index) and be long (or short) the risk-free asset to decrease (or increase) your return and risk. That is, if you'd like higher returns than the S&P500 offers and are willing...
The empirical evidence shows that low to medium beta portfolios beat high beta portfolios on a risk adjusted basis. Search SSRN for "betting against beta." This flies completely in the face of CAPM but frankly CAPM is crap.
857
I have one portfolio with high beta stocks, and one with low beta stocks. Is it better to have higher expected return with high volatility, or medium expected return with medium volatility? (All from a asset allocation, efficient frontier, risk/reward prospective.)
2011/03/30
[ "https://quant.stackexchange.com/questions/857", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/520/" ]
From a theoretical point of view (you mentioned beta, so assume we're in a CAPM world), you should hold the market portfolio (let's assume S&P500 index) and be long (or short) the risk-free asset to decrease (or increase) your return and risk. That is, if you'd like higher returns than the S&P500 offers and are willing...
You still want to perform portfolio optimization. Put everything into one bucket, run 'global' portfolio optimization, build the portfolio. Even if you prefer Sharpe ratios, you should do that on the overall portfolio - not just on individual ones. Be careful of sharpe ratios for low risk, low return assets. Dividing o...
23,344,625
I would like to create a custom event in JavaScript. I have a WPF application with a WebBrowser inside, and a HTML page with JavaScript. I work with a printer. When the state of the printer changes, it triggers an event in .NET. Then, I call a JavaScript method `OnPrinterStateChanged(state)` with the `InvokeScript` ...
2014/04/28
[ "https://Stackoverflow.com/questions/23344625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2558653/" ]
Perhaps something like this? ``` function OnPrinterStateChanged(state) { var evt = new CustomEvent('printerstatechanged', { detail: state }); window.dispatchEvent(evt); } //Listen to your custom event window.addEventListener('printerstatechanged', function (e) { console.log('printer state changed', e.det...
Ok I found a solution. I had to change the WebBrowser IE Version to Internet Explorer 11: <http://weblog.west-wind.com/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Version> And then : ``` function OnPrinterStateChanged(state) { var evt = document.createEvent("Event"); evt.state = state; evt....
23,344,625
I would like to create a custom event in JavaScript. I have a WPF application with a WebBrowser inside, and a HTML page with JavaScript. I work with a printer. When the state of the printer changes, it triggers an event in .NET. Then, I call a JavaScript method `OnPrinterStateChanged(state)` with the `InvokeScript` ...
2014/04/28
[ "https://Stackoverflow.com/questions/23344625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2558653/" ]
Perhaps something like this? ``` function OnPrinterStateChanged(state) { var evt = new CustomEvent('printerstatechanged', { detail: state }); window.dispatchEvent(evt); } //Listen to your custom event window.addEventListener('printerstatechanged', function (e) { console.log('printer state changed', e.det...
I like using this `EventDispatcher` constructor method, which, using a dummy element, isolates the events so they will not be fired on any existing DOM element, nor the `window` or `document`. > > I am using `CustomEvent` and not `createEvent` because it's the newer > approach. [Read more here](https://developer.mozi...
23,344,625
I would like to create a custom event in JavaScript. I have a WPF application with a WebBrowser inside, and a HTML page with JavaScript. I work with a printer. When the state of the printer changes, it triggers an event in .NET. Then, I call a JavaScript method `OnPrinterStateChanged(state)` with the `InvokeScript` ...
2014/04/28
[ "https://Stackoverflow.com/questions/23344625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2558653/" ]
Perhaps something like this? ``` function OnPrinterStateChanged(state) { var evt = new CustomEvent('printerstatechanged', { detail: state }); window.dispatchEvent(evt); } //Listen to your custom event window.addEventListener('printerstatechanged', function (e) { console.log('printer state changed', e.det...
Requirement: ES6 ```js let MyClass = (function () { let __sym = Symbol('MyClass'); class MyClass { constructor() { this[__sym] = {}; } on(event, callback) { this[__sym][event] = { callback: callback } } getError() { let even...
23,344,625
I would like to create a custom event in JavaScript. I have a WPF application with a WebBrowser inside, and a HTML page with JavaScript. I work with a printer. When the state of the printer changes, it triggers an event in .NET. Then, I call a JavaScript method `OnPrinterStateChanged(state)` with the `InvokeScript` ...
2014/04/28
[ "https://Stackoverflow.com/questions/23344625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2558653/" ]
I like using this `EventDispatcher` constructor method, which, using a dummy element, isolates the events so they will not be fired on any existing DOM element, nor the `window` or `document`. > > I am using `CustomEvent` and not `createEvent` because it's the newer > approach. [Read more here](https://developer.mozi...
Ok I found a solution. I had to change the WebBrowser IE Version to Internet Explorer 11: <http://weblog.west-wind.com/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Version> And then : ``` function OnPrinterStateChanged(state) { var evt = document.createEvent("Event"); evt.state = state; evt....
23,344,625
I would like to create a custom event in JavaScript. I have a WPF application with a WebBrowser inside, and a HTML page with JavaScript. I work with a printer. When the state of the printer changes, it triggers an event in .NET. Then, I call a JavaScript method `OnPrinterStateChanged(state)` with the `InvokeScript` ...
2014/04/28
[ "https://Stackoverflow.com/questions/23344625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2558653/" ]
I like using this `EventDispatcher` constructor method, which, using a dummy element, isolates the events so they will not be fired on any existing DOM element, nor the `window` or `document`. > > I am using `CustomEvent` and not `createEvent` because it's the newer > approach. [Read more here](https://developer.mozi...
Requirement: ES6 ```js let MyClass = (function () { let __sym = Symbol('MyClass'); class MyClass { constructor() { this[__sym] = {}; } on(event, callback) { this[__sym][event] = { callback: callback } } getError() { let even...
4,928,128
There's a form with three checkboxes and a button. Upon clicking on the button a messagebox is suppose to show up and display all the items that were checked on the form with price before tax and total. The price before tax and total are taken care of, but how would I display what was checked by the user on that form i...
2011/02/07
[ "https://Stackoverflow.com/questions/4928128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/606895/" ]
First I must say that the code you've written seems to hold a logical eror. If the checkbox isn't checked then you shouldn't do anything. In your code you subtract the item-price from the total price. This way you give a discount of 10. If they don't buy it, don't add it. That's all. So, now you know what they've boug...
If you just want to display a string you generate. Check this out: <http://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox.aspx>
9,975,041
Hi Why am i getting an inalid cast exception? ``` public class RootContainer2 { [DataMember] public string StopName { get; set; } [DataMember] public string StopId { get; set; } [DataMember] public string Stop { get; set; } ...
2012/04/02
[ "https://Stackoverflow.com/questions/9975041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1178083/" ]
**Use this regex :** (UPDATED) ``` <?php $str = '<h1>Page Title</h1><a href="http://www.google.com/">Google</a>'; $text = preg_replace("/href=\"http\:\/\/([a-zA-Z0-9\-]+\.[a-zA-Z0-9]+\.[a-zA-Z]{2,3}(\/*)?)/","href=\"http://www.mysite.com/tracking.php?url=$1\"",$str); echo $text; ?> ``` **Outputs :** ``` <h1>Page...
``` $str = '<h1>Page Title</h1><a href="http://www.google.com">Google</a>'; $text = preg_replace('href=\"http\://([a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?)\"', 'href=\"YOUR_TRACKING_URL=$1\"', $str); echo $text; ``` Warning: preg\_replace() [function.preg-replace]: Delimiter must not be alphanumeric or backslash in /ho...
28,057,228
I'm trying to install WKHTMLtoPDf 0.12.x on a Dreamhost VPS running Ubuntu 12.04.5. I found a realatively new [resource](https://askubuntu.com/questions/556667/how-to-install-wkhtmltopdf-0-12-1-on-ubuntu-server) and it seems like it should be pretty straight forward: ``` sudo add-apt-repository ppa:pov/wkhtmltopdf sud...
2015/01/20
[ "https://Stackoverflow.com/questions/28057228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1148107/" ]
The steps taken to install WKHTMLtoPDF 0.12.x onto Ubuntu 12.04.5 derived from the above question, using these resources ([1](https://askubuntu.com/questions/556667/how-to-install-wkhtmltopdf-0-12-1-on-ubuntu-server) and [2](http://lifeonubuntu.com/ubuntu-missing-add-apt-repository-command/)) where: ``` sudo -s add-ap...
While doing setup on AWS Ubuntu 14.04 Trusty AMD64 Machine i got lot of issues as wkhtmltopdf is not running at all, Giving Cannot connect to X server issue. Finally the solution which worked for me is ``` $ sudo apt-get install xfonts-75dpi $ wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.2/w...
2,135,532
Find the function $f$, given that $$f'(x) = f(x)(1-f(x))$$ and that $f(0) = \frac12$ The answer is $$y = \frac{1}{1+e^{-x}}$$ What I tried doing is changing $f'(x)$ as \frac{dy}{dx} and all the $f(x)$ as $y$ to make it easier to read for myself. Manipulating the equation. I got $$\left(y + \frac1y\right)dy = 1dx$...
2017/02/08
[ "https://math.stackexchange.com/questions/2135532", "https://math.stackexchange.com", "https://math.stackexchange.com/users/371974/" ]
$$\frac{dy}{dx}=y(1-y)$$ $$\int\frac{dy}{y(1-y)}=\int dx$$ $$\int\frac{dy}{y}+\int\frac{dy}{1-y}=\int dx$$ $$\ln y-\ln(1-y)=x+c$$ $$\ln\left(\frac{y}{1-y}\right)=x+c$$ $$f(0)=\frac12$$ Thus, $c=0$. $$\frac{y}{1-y}=e^{x}$$ $$y=e^{x+c}-ye^{x}$$ $$y(1+e^{x+c})=e^{x}$$ $$y(1+e^{-x})=1$$ $$y=\frac{1}{1+e^{-x}}$$
If you expand the right hand side you'll obtain the differential equation: $y'-y= -y^2$ In that equation we let $u=y^{-1}$ so $u'=-y^{-2}y'$ Now we multiply the original equation with $-y^-{2}$. We now have the equation: $-y^{-2}y'+y^-{1}=1$ which by our substitution transforms into: $u'+u=1$ I guess you can take it ...
35,743,615
I want to open login\_activity on first time entering app, and then on the second entering to app open main\_activity. I create something but it wont work. so I wonder what I'm doing wrong? this is my LoginActivity ``` protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...
2016/03/02
[ "https://Stackoverflow.com/questions/35743615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5512319/" ]
1. Create one start-up activity call it as SplashActivity ``` public class SplashActivity extends Activity{ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); // decide here whether to navigate to Login or Main Activity Sha...
You should add another empty activity (with no UI) that loads before anything. Then use `SharedPreferences` to store some value. Thus if the user has already opened your app once, the value is stored. And then use a condition to check this value. If its the value you saved skip `login_activity` and direct to `main_act...
35,743,615
I want to open login\_activity on first time entering app, and then on the second entering to app open main\_activity. I create something but it wont work. so I wonder what I'm doing wrong? this is my LoginActivity ``` protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...
2016/03/02
[ "https://Stackoverflow.com/questions/35743615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5512319/" ]
you can change launcher activity as **main activity**.so that when you open the application it is starting from **main activity** there you can check whether he is logged in or not.if he is not logged in you must navigate him to **login activity** or else you just do it as it is.Following is manifest file.. `<activity...
You should add another empty activity (with no UI) that loads before anything. Then use `SharedPreferences` to store some value. Thus if the user has already opened your app once, the value is stored. And then use a condition to check this value. If its the value you saved skip `login_activity` and direct to `main_act...
35,743,615
I want to open login\_activity on first time entering app, and then on the second entering to app open main\_activity. I create something but it wont work. so I wonder what I'm doing wrong? this is my LoginActivity ``` protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...
2016/03/02
[ "https://Stackoverflow.com/questions/35743615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5512319/" ]
1. Create one start-up activity call it as SplashActivity ``` public class SplashActivity extends Activity{ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); // decide here whether to navigate to Login or Main Activity Sha...
Problem about the line ``` if (pref.getBoolean("activity_executed", false)) { ``` You can Implement this method to call inside if(appIsLoggedIn) ``` public boolean appIsLoggedIn(){ return pref.getBoolean("activity_executed", false); } ```
35,743,615
I want to open login\_activity on first time entering app, and then on the second entering to app open main\_activity. I create something but it wont work. so I wonder what I'm doing wrong? this is my LoginActivity ``` protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...
2016/03/02
[ "https://Stackoverflow.com/questions/35743615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5512319/" ]
1. Create one start-up activity call it as SplashActivity ``` public class SplashActivity extends Activity{ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); // decide here whether to navigate to Login or Main Activity Sha...
you can change launcher activity as **main activity**.so that when you open the application it is starting from **main activity** there you can check whether he is logged in or not.if he is not logged in you must navigate him to **login activity** or else you just do it as it is.Following is manifest file.. `<activity...
35,743,615
I want to open login\_activity on first time entering app, and then on the second entering to app open main\_activity. I create something but it wont work. so I wonder what I'm doing wrong? this is my LoginActivity ``` protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...
2016/03/02
[ "https://Stackoverflow.com/questions/35743615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5512319/" ]
you can change launcher activity as **main activity**.so that when you open the application it is starting from **main activity** there you can check whether he is logged in or not.if he is not logged in you must navigate him to **login activity** or else you just do it as it is.Following is manifest file.. `<activity...
Problem about the line ``` if (pref.getBoolean("activity_executed", false)) { ``` You can Implement this method to call inside if(appIsLoggedIn) ``` public boolean appIsLoggedIn(){ return pref.getBoolean("activity_executed", false); } ```
664,932
Suppose that $\left(a\_n\right)$ is a sequence of real numbers and that $\left(\varepsilon\_n\right)$ is a sequence of IID RVs with $$P\left(\varepsilon\_n = \pm 1\right) = \frac{1}{2}$$ According to Williams (Probability with Martingales (1991), Section 12.3 "Random signs", pp. 113-114), the results below show that ...
2014/02/05
[ "https://math.stackexchange.com/questions/664932", "https://math.stackexchange.com", "https://math.stackexchange.com/users/37058/" ]
The events $$A := \left\{\sum \varepsilon\_k a\_k\ \textrm{diverges to }+\infty\right\}$$ and $$B := \left\{\sum \varepsilon\_k a\_k\ \textrm{diverges to }-\infty\right\}$$ are both tail events, hence by Kolmogorov's $0$-$1$ law $P\left(A\right),P\left(B\right)\in\left\{0,1\right\}$. However by symmetry $P\left(A\r...
Since $ P(ε\_n=±1)=\frac{1}{2}, var(ε\_n ) = 1$ $\Sigma var(ε\_k a\_k)= \Sigma a^2\_k \times var( ε\_k )= \Sigma a^2\_k $
28,897,001
Giving m and n as integers, I can multiply them by successive sums like this: ``` m * n = m + m + m + ... + m (n times) ``` So, let's consider the pseudo code below: ``` m = ... (first number) n = ... (second number) Result = 0; while (n > 0) { Result = Result + m; n = n - ...
2015/03/06
[ "https://Stackoverflow.com/questions/28897001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4640324/" ]
First of all, you can use mutable variables in F#, so your algorithm could be written like this: ``` let multiply1 m n = let mutable result = 0 for i = 1 to n do result <- result + m result ``` But if you want to do it a little more the functional way, you would use recursion. In this case, an in...
You can use Seq (lazy list like in haskell / IEnumerable like in C#) and the pipe operator: ``` let mult n (m:int) = Seq.initInfinite (fun _ -> m) |> Seq.take n |> Seq.sum ```
14,557,720
I am implement Paypal standard payment in my site. I have a resource to receive notification when user issue a subscription and update data base in-order to tracking the sale and user payment. I do accidentally change the notification resource on my site which mean making it stop working. Is there any setting with payp...
2013/01/28
[ "https://Stackoverflow.com/questions/14557720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/692176/" ]
Okay, got it compiled and ran a couple of experiments myself. Thus far it appears to not support this GCC extension: <http://gcc.gnu.org/onlinedocs/cpp/Directives-Within-Macro-Arguments.html#Directives-Within-Macro-Arguments> and also barfs on the Microsoft header file C:\Program Files (x86)\Microsoft Visual Studio 1...
The easiest way to find out if it supports your favorite extension is to just, you know, **try it**. Is probably even *way* faster to ask here and wait for enough comments/answers to accumulate to be able to conclude something. Or check the documentation, if it doesn't talk about GCC/MSC extensions at all, it probably ...
41,104,615
In the latest version on Django REST Swagger (2.1.0) YAML docstrings have been deprecated. I cannot get swagger to show the POST request parameters. Here is my view ``` class UserAuthenticationView(APIView): def post(self, request, *args, **kwargs): serializer = UserAuthenticationSerializer(data=self.requ...
2016/12/12
[ "https://Stackoverflow.com/questions/41104615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4364572/" ]
**django-rest-swagger** uses **rest\_framework.schemas.SchemaGenerator** to generate the schema and **SchemaGenerator** uses **get\_serializer\_fields** to get the serializer information of a view. get\_serializer\_fields checks if a view has a **get\_serializer** method to generate the form. **GenericAPIView** provide...
This is the rest framework get schema code (the part of it): ``` def get_serializer_fields(self, path, method, view): """ Return a list of `coreapi.Field` instances corresponding to any request body input, as determined by the serializer class. """ if method not in ('PUT', 'PATCH', 'POST'): ...
41,104,615
In the latest version on Django REST Swagger (2.1.0) YAML docstrings have been deprecated. I cannot get swagger to show the POST request parameters. Here is my view ``` class UserAuthenticationView(APIView): def post(self, request, *args, **kwargs): serializer = UserAuthenticationSerializer(data=self.requ...
2016/12/12
[ "https://Stackoverflow.com/questions/41104615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4364572/" ]
This is the rest framework get schema code (the part of it): ``` def get_serializer_fields(self, path, method, view): """ Return a list of `coreapi.Field` instances corresponding to any request body input, as determined by the serializer class. """ if method not in ('PUT', 'PATCH', 'POST'): ...
A working example for a custom ViewSet, with django-rest-swagger==2.2.0: ``` from rest_framework import viewsets from rest_framework.schemas import AutoSchema from rest_framework.compat import coreapi, coreschema from rest_framework.decorators import action class DeviceViewSchema(AutoSchema): """ Schema custo...
41,104,615
In the latest version on Django REST Swagger (2.1.0) YAML docstrings have been deprecated. I cannot get swagger to show the POST request parameters. Here is my view ``` class UserAuthenticationView(APIView): def post(self, request, *args, **kwargs): serializer = UserAuthenticationSerializer(data=self.requ...
2016/12/12
[ "https://Stackoverflow.com/questions/41104615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4364572/" ]
**django-rest-swagger** uses **rest\_framework.schemas.SchemaGenerator** to generate the schema and **SchemaGenerator** uses **get\_serializer\_fields** to get the serializer information of a view. get\_serializer\_fields checks if a view has a **get\_serializer** method to generate the form. **GenericAPIView** provide...
A working example for a custom ViewSet, with django-rest-swagger==2.2.0: ``` from rest_framework import viewsets from rest_framework.schemas import AutoSchema from rest_framework.compat import coreapi, coreschema from rest_framework.decorators import action class DeviceViewSchema(AutoSchema): """ Schema custo...
18,986,931
I am new to CodeIgniter and am having trouble figuring out routing. I am getting a 404 page not found error when I go to "/SimplePie1". Is my routing the issue, or have I messed up the controller or view? Thanks. My controller: ``` class Feeder extends CI_Controller { public function index() { $this-...
2013/09/24
[ "https://Stackoverflow.com/questions/18986931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/866360/" ]
The following code means ``` $route['feed_views'] = "SimplePie1"; ``` If you have `feed_views` in the `url` then launch the `SimplePie1` controller and by default the `index` method will be invoked, so now the question is : do you have a controller class named `SimplePie1` ? If not then, it should show a`404` not fo...
What exactly are you trying to do? Assuming you default controller is feeder , so "/feeder" will load the index function which loads the feed\_view without no routes just default controller. In routes you rewrite controllers and it's methods,Not the views names like you mention in your route.php. Review [URI Rooutin...
22,798,333
I've seen questions regarding the same issue, but all of them are about strings. How about integers? Why am I getting the "unary operator expected" error? ``` if [ $(date +%k%M) -ge ${!BLOCK1FRAN} ] ; then whatever ; fi ```
2014/04/01
[ "https://Stackoverflow.com/questions/22798333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2589223/" ]
You are using indirection. If the variable `${BLOCK1FRAN}` points to an empty variable, you'll get the error message. Make sure that the variable pointed by `${BLOCK1FRAN}` contains a valid numeric value. If you want an empty string and nonnumeric values to be evaluated as zero (`0`), use the following syntax. ``` if...
It looks good to me. Are you sure you've set BLOCK1FRAN correctly? ``` whatever() { echo "it works"; } foo=42 BLOCK1FRAN=foo if [ $(date +%k%M) -ge ${!BLOCK1FRAN} ] ; then whatever ; fi it works ```
333,269
regarding the ESA Sentinel-3 file name convention I have got a question; which **time zone (GMT, CEST, ...)** does ESA use? I could not find anything yet, even it should be a critical point for many users... There is no information given on the official website of ESA for the Sentinel-3 SLSTR-product as you can see he...
2019/08/28
[ "https://gis.stackexchange.com/questions/333269", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/148002/" ]
This is the UTC time format according to the official [source1](https://sentinel.esa.int/web/sentinel/user-guides/sentinel-3-altimetry/definitions/conventions), [source2](https://sentinels.copernicus.eu/web/sentinel/technical-guides/sentinel-3-slstr/level-1/calibration-mode-desc): > > The time reference system in the...
It is right there in the link you provided: > > The file naming convention of SLSTR products (see this document for more details) is identified by the sequence of fields described below: > > > MMM\_SL\_L\_TTTTTT\_yyyymmddThhmmss\_YYYYMMDDTHHMMSS\_YYYYMMDDTHHMMSS\_[instance ID]*GGG*[class ID].SEN3 > > > [...] > >...
14,138,098
in LLCP there are 2 transport possibilities: * connection-oriented * connectionless Does someone know which kind of this LLCP transports is used in combination with: * NPP * SNEP NPP is just 1-way, so maybe it is combines with connections-oriented because of the acknowledgements, but i don't know. SNEP has this ack...
2013/01/03
[ "https://Stackoverflow.com/questions/14138098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1269434/" ]
You don't say what OS you are deployed on, but on RHEL 6.7 adding the host name to /etc/hosts fixed this for us.
Its becoz of DB initialization problem ar localhost: You should use your DB server and web server on same url... your jdbc.url should be same as which you have configured in sonar server properties if it is not in your localhost.
22,814,102
I have a model with a scope and a method like so: ``` class Model < ActiveRecord::Base scope :editable, where('updated_at > ? OR (updated_at IS NULL AND created_at > ?)', (Date.today - 3.days).beginning_of_day, (Date.today - 3.days).beginning_of_day) def editable? return (self.updated_at || self.created_at) ...
2014/04/02
[ "https://Stackoverflow.com/questions/22814102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1620081/" ]
Unfortunately there is no easy way to do this at the moment. The closest you can get is ``` def editable? self.class.editable.exists? self end ``` However it will call database to check whether given record exists or not, so it is useless for new records or for records you want to update. The reason why there is ...
As far as I can see there is no code duplication there. The scope will be called on the class, `Model.editable`, retrieving all the records that match that scope. `editable?` will be called on an instance of `Model`, eg: `@model.editable?` returning true or false. The first is a query, the second a logic expression. ...
20,186,146
The following HTML/CSS code is rendering in IE (Version 8) but not in Firefox (Version 25) Any reason why? HTML: ``` <img class="buttonmini" id="btn_Actual_Effort" onclick="showEffortDetail()" disabled="disabled"> ``` CSS: ``` .buttonmini { background: url(../newimages/effort_calendar.gif) no-repeat; h...
2013/11/25
[ "https://Stackoverflow.com/questions/20186146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/259889/" ]
``` select e.employee_id, e.employee_name , (select count(*) from dependent_table where employee_id=e.employee_id) as dependents from employee_table as e ```
Use Group By and Count ``` select em.Employee_id, count(*) from employee em inner join dependant dp on em.employee_id = dp.employee_id group by em.employee_id ```
20,186,146
The following HTML/CSS code is rendering in IE (Version 8) but not in Firefox (Version 25) Any reason why? HTML: ``` <img class="buttonmini" id="btn_Actual_Effort" onclick="showEffortDetail()" disabled="disabled"> ``` CSS: ``` .buttonmini { background: url(../newimages/effort_calendar.gif) no-repeat; h...
2013/11/25
[ "https://Stackoverflow.com/questions/20186146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/259889/" ]
Try this query: ``` select e.employee_id,e.employee_name,count(d.employee_id) as dependents from department d inner join employee e on (e.employee_id=d.employee_id) group by d.employee_id; ``` [Sql Fiddle Example](http://sqlfiddle.com/#!2/75a30/4)
Use Group By and Count ``` select em.Employee_id, count(*) from employee em inner join dependant dp on em.employee_id = dp.employee_id group by em.employee_id ```
20,186,146
The following HTML/CSS code is rendering in IE (Version 8) but not in Firefox (Version 25) Any reason why? HTML: ``` <img class="buttonmini" id="btn_Actual_Effort" onclick="showEffortDetail()" disabled="disabled"> ``` CSS: ``` .buttonmini { background: url(../newimages/effort_calendar.gif) no-repeat; h...
2013/11/25
[ "https://Stackoverflow.com/questions/20186146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/259889/" ]
``` select e.employee_id, e.employee_name , (select count(*) from dependent_table where employee_id=e.employee_id) as dependents from employee_table as e ```
``` select e.employee_id, e.employee_name, count(select * from dependent table where dependent table.employee_id=employee table.employee_id) from employee table e where e.employee_id=123 ``` try this
20,186,146
The following HTML/CSS code is rendering in IE (Version 8) but not in Firefox (Version 25) Any reason why? HTML: ``` <img class="buttonmini" id="btn_Actual_Effort" onclick="showEffortDetail()" disabled="disabled"> ``` CSS: ``` .buttonmini { background: url(../newimages/effort_calendar.gif) no-repeat; h...
2013/11/25
[ "https://Stackoverflow.com/questions/20186146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/259889/" ]
Try this query: ``` select e.employee_id,e.employee_name,count(d.employee_id) as dependents from department d inner join employee e on (e.employee_id=d.employee_id) group by d.employee_id; ``` [Sql Fiddle Example](http://sqlfiddle.com/#!2/75a30/4)
``` select e.employee_id, e.employee_name, count(select * from dependent table where dependent table.employee_id=employee table.employee_id) from employee table e where e.employee_id=123 ``` try this
20,186,146
The following HTML/CSS code is rendering in IE (Version 8) but not in Firefox (Version 25) Any reason why? HTML: ``` <img class="buttonmini" id="btn_Actual_Effort" onclick="showEffortDetail()" disabled="disabled"> ``` CSS: ``` .buttonmini { background: url(../newimages/effort_calendar.gif) no-repeat; h...
2013/11/25
[ "https://Stackoverflow.com/questions/20186146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/259889/" ]
``` select e.employee_id, e.employee_name , (select count(*) from dependent_table where employee_id=e.employee_id) as dependents from employee_table as e ```
try this its worked ``` select a.empid ,a.empname , count(b.deptname) from employee a , dependent b where a.empid = b.empid and b.empid=123; ```
20,186,146
The following HTML/CSS code is rendering in IE (Version 8) but not in Firefox (Version 25) Any reason why? HTML: ``` <img class="buttonmini" id="btn_Actual_Effort" onclick="showEffortDetail()" disabled="disabled"> ``` CSS: ``` .buttonmini { background: url(../newimages/effort_calendar.gif) no-repeat; h...
2013/11/25
[ "https://Stackoverflow.com/questions/20186146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/259889/" ]
Try this query: ``` select e.employee_id,e.employee_name,count(d.employee_id) as dependents from department d inner join employee e on (e.employee_id=d.employee_id) group by d.employee_id; ``` [Sql Fiddle Example](http://sqlfiddle.com/#!2/75a30/4)
``` select e.employee_id, e.employee_name , (select count(*) from dependent_table where employee_id=e.employee_id) as dependents from employee_table as e ```
20,186,146
The following HTML/CSS code is rendering in IE (Version 8) but not in Firefox (Version 25) Any reason why? HTML: ``` <img class="buttonmini" id="btn_Actual_Effort" onclick="showEffortDetail()" disabled="disabled"> ``` CSS: ``` .buttonmini { background: url(../newimages/effort_calendar.gif) no-repeat; h...
2013/11/25
[ "https://Stackoverflow.com/questions/20186146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/259889/" ]
Try this query: ``` select e.employee_id,e.employee_name,count(d.employee_id) as dependents from department d inner join employee e on (e.employee_id=d.employee_id) group by d.employee_id; ``` [Sql Fiddle Example](http://sqlfiddle.com/#!2/75a30/4)
try this its worked ``` select a.empid ,a.empname , count(b.deptname) from employee a , dependent b where a.empid = b.empid and b.empid=123; ```
38,983,642
I need to handle the following exception thrown by my suite when running the test on Chrome browser on Android real device using Appium 1.4.16.1. I believe the exception is thrown because of a timeout (set to 10s) on Appium, after which the session is deleted. However, once the exception is thrown by Selenium Webdriver...
2016/08/16
[ "https://Stackoverflow.com/questions/38983642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2171158/" ]
Use express.js named route parameters: <http://expressjs.com/en/guide/routing.html#route-parameters>
What you are describing is what's referred to as a restful web api implemented with routing You'll typically want to build your site in a MVC (**M**odel **V**iew **C**ontroller) framework to get this functionality. Express.js is new hotness on the block - especially in the context of javascript and node.js categories t...
38,983,642
I need to handle the following exception thrown by my suite when running the test on Chrome browser on Android real device using Appium 1.4.16.1. I believe the exception is thrown because of a timeout (set to 10s) on Appium, after which the session is deleted. However, once the exception is thrown by Selenium Webdriver...
2016/08/16
[ "https://Stackoverflow.com/questions/38983642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2171158/" ]
Use req.params as in express documentation Route path: `/users/:userId/books/:bookId` Request URL: `http://localhost:3000/users/34/books/8989` req.params: `{ "userId": "34", "bookId": "8989" }` **In case of using raw http** for using with raw http module you can use `str.split("/")[2]`; ``` var http = requ...
Use express.js named route parameters: <http://expressjs.com/en/guide/routing.html#route-parameters>
38,983,642
I need to handle the following exception thrown by my suite when running the test on Chrome browser on Android real device using Appium 1.4.16.1. I believe the exception is thrown because of a timeout (set to 10s) on Appium, after which the session is deleted. However, once the exception is thrown by Selenium Webdriver...
2016/08/16
[ "https://Stackoverflow.com/questions/38983642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2171158/" ]
Use req.params as in express documentation Route path: `/users/:userId/books/:bookId` Request URL: `http://localhost:3000/users/34/books/8989` req.params: `{ "userId": "34", "bookId": "8989" }` **In case of using raw http** for using with raw http module you can use `str.split("/")[2]`; ``` var http = requ...
What you are describing is what's referred to as a restful web api implemented with routing You'll typically want to build your site in a MVC (**M**odel **V**iew **C**ontroller) framework to get this functionality. Express.js is new hotness on the block - especially in the context of javascript and node.js categories t...
28,165,647
I have a project using SpecFlow and NUnit 2.6.3 as my test provider. Currently it is working OK but now there is the requirement to run tests in parallel, as they become more and more heavy. Reading along, I can see that NUnit version 3 will support parallelism out of the box, but it is still in alpha. And I am unabl...
2015/01/27
[ "https://Stackoverflow.com/questions/28165647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2160353/" ]
Thanks a lot for the suggestions. I come out with own custom solution - just exploring the test dll with reflection from a custom command line app which then spawns separate OS processes each of them calling nunit-console.exe with the --include parameter specifying only a particular group of tests. This way I avoid a...
I ran into the same situation. I came up with a solution using Selenium Grid, the task parallel library and the DynamicObject class. I wrote about it here <http://blog.dmbcllc.com/running-selenium-in-parallel-with-any-net-unit-testing-tool/>. (Too long to copy and paste). Hope it helps. As far as I know, until 3 releas...
28,165,647
I have a project using SpecFlow and NUnit 2.6.3 as my test provider. Currently it is working OK but now there is the requirement to run tests in parallel, as they become more and more heavy. Reading along, I can see that NUnit version 3 will support parallelism out of the box, but it is still in alpha. And I am unabl...
2015/01/27
[ "https://Stackoverflow.com/questions/28165647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2160353/" ]
I ran into the same situation. I came up with a solution using Selenium Grid, the task parallel library and the DynamicObject class. I wrote about it here <http://blog.dmbcllc.com/running-selenium-in-parallel-with-any-net-unit-testing-tool/>. (Too long to copy and paste). Hope it helps. As far as I know, until 3 releas...
I've tested parallel test case execution at fixture level with NUnit 3.2.0. As of writing, SpecFlow 2.0 does support parallelism and is working well with NUnit 3.2.0, however SpecFlow reporting engine is not able to produce HTML reports from NUnit test execution output. The [issue is being tracked here over GitHub](htt...
28,165,647
I have a project using SpecFlow and NUnit 2.6.3 as my test provider. Currently it is working OK but now there is the requirement to run tests in parallel, as they become more and more heavy. Reading along, I can see that NUnit version 3 will support parallelism out of the box, but it is still in alpha. And I am unabl...
2015/01/27
[ "https://Stackoverflow.com/questions/28165647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2160353/" ]
Thanks a lot for the suggestions. I come out with own custom solution - just exploring the test dll with reflection from a custom command line app which then spawns separate OS processes each of them calling nunit-console.exe with the --include parameter specifying only a particular group of tests. This way I avoid a...
I've tested parallel test case execution at fixture level with NUnit 3.2.0. As of writing, SpecFlow 2.0 does support parallelism and is working well with NUnit 3.2.0, however SpecFlow reporting engine is not able to produce HTML reports from NUnit test execution output. The [issue is being tracked here over GitHub](htt...