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
6,233
Suppose you sample uniformly from the unit vectors in R^n. What are the distributions of the order statistics of the magnitudes of the components of the sampled vectors? That is, for 1 <= i <= n and x in [0,1], what is the probability that the i'th largest component of the vector (in absolute value) is less than or equ...
2009/11/20
[ "https://mathoverflow.net/questions/6233", "https://mathoverflow.net", "https://mathoverflow.net/users/1954/" ]
There has been some work in the physics community on extreme statistics (i.e. distribution of largest and smallest components) of random vectors. See, [link text](http://arxiv.org/abs/0708.0176/ "ArXiv:0708.0176") for example. The largest component is approximately distributed like a Gumbel random variable, while the s...
The distribution should be obtainable by integrating over the section of the simplex segment of the surface of the hypersphere bounded by the points (1,0,0,0,...), (1,1,0,0,0...)/sqrt(2), (1,1,1,0,0...)/sqrt(3) etc. along the ith axis. All the distributions (n,m) have support contained within the unit interval, are pi...
6,233
Suppose you sample uniformly from the unit vectors in R^n. What are the distributions of the order statistics of the magnitudes of the components of the sampled vectors? That is, for 1 <= i <= n and x in [0,1], what is the probability that the i'th largest component of the vector (in absolute value) is less than or equ...
2009/11/20
[ "https://mathoverflow.net/questions/6233", "https://mathoverflow.net", "https://mathoverflow.net/users/1954/" ]
The distribution should be obtainable by integrating over the section of the simplex segment of the surface of the hypersphere bounded by the points (1,0,0,0,...), (1,1,0,0,0...)/sqrt(2), (1,1,1,0,0...)/sqrt(3) etc. along the ith axis. All the distributions (n,m) have support contained within the unit interval, are pi...
Your problem is closely related to order statistics for normal random variables, so you may find this paper useful: [Percentage Points and Modes of Order Statistics from the Normal Distribution](https://projecteuclid.org/journals/annals-of-mathematical-statistics/volume-32/issue-3/Percentage-Points-and-Modes-of-Order-S...
39,201,235
I've this code: ``` "SELECT post_id, COUNT(post_id) AS number_of_votes, (SUM(vote) / COUNT(post_id)) AS result FROM " . LOG_TABLE . " , $wpdb->posts AS p WHERE post_id = p.ID AND p.post_s...
2016/08/29
[ "https://Stackoverflow.com/questions/39201235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3472877/" ]
unless you are using subqueries of the below form,Table will be accessed only once(if it is what you meant by count, will be accessed twice),so count will be calculated only once and used everywhere ``` select id,(select min(id) from table1 t2 where t1.id=t2.id)b from table1 t1 ```
Yes, the two `COUNT()` will run twice, but that doesn't mean the row has to be processed twice. For each row of the data the optimizer will set two counters and 1 summing, that shouldn't make any significant difference if using 1 count or two.
39,201,235
I've this code: ``` "SELECT post_id, COUNT(post_id) AS number_of_votes, (SUM(vote) / COUNT(post_id)) AS result FROM " . LOG_TABLE . " , $wpdb->posts AS p WHERE post_id = p.ID AND p.post_s...
2016/08/29
[ "https://Stackoverflow.com/questions/39201235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3472877/" ]
unless you are using subqueries of the below form,Table will be accessed only once(if it is what you meant by count, will be accessed twice),so count will be calculated only once and used everywhere ``` select id,(select min(id) from table1 t2 where t1.id=t2.id)b from table1 t1 ```
Yes,count runs twice indeed.Here's what exactly happens. This part of code `COUNT(post_id) AS number_of_votes` counts the total number of post Id's and this part of code `(SUM(vote) / COUNT(post_id))` adds up with the votes which is further divided by total number of post id's.So yes,the count is running twice but the ...
22,502,238
I have a custom form in wordpress, with radioboxes and custom fields. I want to validate it prior to sending, and I´ve implemented the following JavaScript code: ``` <script type="text/javascript">// <![CDATA[ function validar() { if(document.form1.duracion.value=="") { alert("Falta seleccionar la dur...
2014/03/19
[ "https://Stackoverflow.com/questions/22502238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1970571/" ]
> > Activity.java File > > > ``` final MyJavaScriptInterface myJavaScriptInterface = new MyJavaScriptInterface( this); webView.addJavascriptInterface(myJavaScriptInterface, "activity"); public class MyJavaScriptInterface { Context mContext; MyJavaScriptInterface(Contex...
You have to set up a `JavaScriptInterface` for the `WebView` first. See [here](https://stackoverflow.com/questions/10389572/call-java-function-from-javascript-over-android-webview) for an example.
18,311,428
I have an input filed with a class called restrict-numbers which i want to restrict the entered characters to only accept numbers, i used the following code which is great but the problem that i want to make the same restriction works with pasting in the input filed without totally disabling pasting: ``` function inpu...
2013/08/19
[ "https://Stackoverflow.com/questions/18311428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2102008/" ]
Implement your form with [jquery.numeric](http://www.w3.org/TR/html5/number-state.html) plugin. ``` $(document).ready(function(){ $(".numeric").numeric(); }); ``` Moreover this works with textareas also! Or better change the input when user tries to submit, ``` $('form').submit(function () { if ($('#numeri...
This code is for javascript and used in my angular app. ``` jQuery('#Id').on('paste keyup', function(e){ jQuery(this).val(document.getElementById('Id').value.replace(/[^\d]/g, '')); }); ``` Where Id is input field id and it is blocked alphabet to enter and paste in the field.
18,311,428
I have an input filed with a class called restrict-numbers which i want to restrict the entered characters to only accept numbers, i used the following code which is great but the problem that i want to make the same restriction works with pasting in the input filed without totally disabling pasting: ``` function inpu...
2013/08/19
[ "https://Stackoverflow.com/questions/18311428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2102008/" ]
Implement your form with [jquery.numeric](http://www.w3.org/TR/html5/number-state.html) plugin. ``` $(document).ready(function(){ $(".numeric").numeric(); }); ``` Moreover this works with textareas also! Or better change the input when user tries to submit, ``` $('form').submit(function () { if ($('#numeri...
Other plugin to implement your form is [jquery.autonumeric](http://www.decorplanit.com/plugin/). ``` jQuery(function($) { $('#someID_defaults').autoNumeric('init'); }); ```
18,311,428
I have an input filed with a class called restrict-numbers which i want to restrict the entered characters to only accept numbers, i used the following code which is great but the problem that i want to make the same restriction works with pasting in the input filed without totally disabling pasting: ``` function inpu...
2013/08/19
[ "https://Stackoverflow.com/questions/18311428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2102008/" ]
``` $(".numbersOnly").bind('paste', function(e) { var self = this; setTimeout(function(e) { var val = $(self).val(); if (val != '0') { var regx = new RegExp(/^[0-9]+$/); if (!regx.test(val)) { $(".numbersOnly").val(""); ...
This code is for javascript and used in my angular app. ``` jQuery('#Id').on('paste keyup', function(e){ jQuery(this).val(document.getElementById('Id').value.replace(/[^\d]/g, '')); }); ``` Where Id is input field id and it is blocked alphabet to enter and paste in the field.
18,311,428
I have an input filed with a class called restrict-numbers which i want to restrict the entered characters to only accept numbers, i used the following code which is great but the problem that i want to make the same restriction works with pasting in the input filed without totally disabling pasting: ``` function inpu...
2013/08/19
[ "https://Stackoverflow.com/questions/18311428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2102008/" ]
Implement your form with [jquery.numeric](http://www.w3.org/TR/html5/number-state.html) plugin. ``` $(document).ready(function(){ $(".numeric").numeric(); }); ``` Moreover this works with textareas also! Or better change the input when user tries to submit, ``` $('form').submit(function () { if ($('#numeri...
Maybe you can make yourself less work if you do not control the actual keys pressed by the user, but instead the contents of the input field(s)? You can still work with the keyup-event but, instead of ckecking the keycode you should be looking at the current contents of the input field (`$(this).val()`) by applying a s...
18,311,428
I have an input filed with a class called restrict-numbers which i want to restrict the entered characters to only accept numbers, i used the following code which is great but the problem that i want to make the same restriction works with pasting in the input filed without totally disabling pasting: ``` function inpu...
2013/08/19
[ "https://Stackoverflow.com/questions/18311428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2102008/" ]
Implement your form with [jquery.numeric](http://www.w3.org/TR/html5/number-state.html) plugin. ``` $(document).ready(function(){ $(".numeric").numeric(); }); ``` Moreover this works with textareas also! Or better change the input when user tries to submit, ``` $('form').submit(function () { if ($('#numeri...
Actually it must be like that for jquery; `$('.just_numbers').on('paste keyup', function(e){ $(this).val($(this).val().replace(/[^\d]/g, '')); });` Paste also, pressing also ignoring except numbers.
18,311,428
I have an input filed with a class called restrict-numbers which i want to restrict the entered characters to only accept numbers, i used the following code which is great but the problem that i want to make the same restriction works with pasting in the input filed without totally disabling pasting: ``` function inpu...
2013/08/19
[ "https://Stackoverflow.com/questions/18311428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2102008/" ]
Maybe you can make yourself less work if you do not control the actual keys pressed by the user, but instead the contents of the input field(s)? You can still work with the keyup-event but, instead of ckecking the keycode you should be looking at the current contents of the input field (`$(this).val()`) by applying a s...
Actually it must be like that for jquery; `$('.just_numbers').on('paste keyup', function(e){ $(this).val($(this).val().replace(/[^\d]/g, '')); });` Paste also, pressing also ignoring except numbers.
18,311,428
I have an input filed with a class called restrict-numbers which i want to restrict the entered characters to only accept numbers, i used the following code which is great but the problem that i want to make the same restriction works with pasting in the input filed without totally disabling pasting: ``` function inpu...
2013/08/19
[ "https://Stackoverflow.com/questions/18311428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2102008/" ]
Implement your form with [jquery.numeric](http://www.w3.org/TR/html5/number-state.html) plugin. ``` $(document).ready(function(){ $(".numeric").numeric(); }); ``` Moreover this works with textareas also! Or better change the input when user tries to submit, ``` $('form').submit(function () { if ($('#numeri...
``` $(".numbersOnly").bind('paste', function(e) { var self = this; setTimeout(function(e) { var val = $(self).val(); if (val != '0') { var regx = new RegExp(/^[0-9]+$/); if (!regx.test(val)) { $(".numbersOnly").val(""); ...
18,311,428
I have an input filed with a class called restrict-numbers which i want to restrict the entered characters to only accept numbers, i used the following code which is great but the problem that i want to make the same restriction works with pasting in the input filed without totally disabling pasting: ``` function inpu...
2013/08/19
[ "https://Stackoverflow.com/questions/18311428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2102008/" ]
Maybe you can make yourself less work if you do not control the actual keys pressed by the user, but instead the contents of the input field(s)? You can still work with the keyup-event but, instead of ckecking the keycode you should be looking at the current contents of the input field (`$(this).val()`) by applying a s...
This code is for javascript and used in my angular app. ``` jQuery('#Id').on('paste keyup', function(e){ jQuery(this).val(document.getElementById('Id').value.replace(/[^\d]/g, '')); }); ``` Where Id is input field id and it is blocked alphabet to enter and paste in the field.
18,311,428
I have an input filed with a class called restrict-numbers which i want to restrict the entered characters to only accept numbers, i used the following code which is great but the problem that i want to make the same restriction works with pasting in the input filed without totally disabling pasting: ``` function inpu...
2013/08/19
[ "https://Stackoverflow.com/questions/18311428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2102008/" ]
Maybe you can make yourself less work if you do not control the actual keys pressed by the user, but instead the contents of the input field(s)? You can still work with the keyup-event but, instead of ckecking the keycode you should be looking at the current contents of the input field (`$(this).val()`) by applying a s...
Other plugin to implement your form is [jquery.autonumeric](http://www.decorplanit.com/plugin/). ``` jQuery(function($) { $('#someID_defaults').autoNumeric('init'); }); ```
18,311,428
I have an input filed with a class called restrict-numbers which i want to restrict the entered characters to only accept numbers, i used the following code which is great but the problem that i want to make the same restriction works with pasting in the input filed without totally disabling pasting: ``` function inpu...
2013/08/19
[ "https://Stackoverflow.com/questions/18311428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2102008/" ]
``` $(".numbersOnly").bind('paste', function(e) { var self = this; setTimeout(function(e) { var val = $(self).val(); if (val != '0') { var regx = new RegExp(/^[0-9]+$/); if (!regx.test(val)) { $(".numbersOnly").val(""); ...
Other plugin to implement your form is [jquery.autonumeric](http://www.decorplanit.com/plugin/). ``` jQuery(function($) { $('#someID_defaults').autoNumeric('init'); }); ```
18,153,839
I'm looking to use a more separated system for my models in a Ruby on Rails project. It looked like the solution was DataMapper. However, I see that none of their repositories have been updated in the last year, and when installed in a Rails 4 project, it has gem version dependency conflicts with newer Gems. Searching ...
2013/08/09
[ "https://Stackoverflow.com/questions/18153839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/278899/" ]
As someone who uses DataMapper every day at my job, I would recommend sticking to ActiveRecord unless you are connecting to a legacy database that you don't control the schema of (but I would also consider [Sequel](http://sequel.rubyforge.org/) if that were the case). Beyond the fact that it is EOL (as a maintainer [st...
DataMapper was changed to DataMapper2 and then changed to ruby object mapper. it can be found here <https://github.com/rom-rb/rom>
18,153,839
I'm looking to use a more separated system for my models in a Ruby on Rails project. It looked like the solution was DataMapper. However, I see that none of their repositories have been updated in the last year, and when installed in a Rails 4 project, it has gem version dependency conflicts with newer Gems. Searching ...
2013/08/09
[ "https://Stackoverflow.com/questions/18153839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/278899/" ]
You really should take a look at Sequel if you're considering DataMapper, FWIW I will be migrating away from ActiveRecord to Sequel. However if you like the opinionated Rails ideology then you shouldn't look any further than ActiveRecord for least friction. With no disrespect to the hard work of the Rails community a...
DataMapper was changed to DataMapper2 and then changed to ruby object mapper. it can be found here <https://github.com/rom-rb/rom>
18,153,839
I'm looking to use a more separated system for my models in a Ruby on Rails project. It looked like the solution was DataMapper. However, I see that none of their repositories have been updated in the last year, and when installed in a Rails 4 project, it has gem version dependency conflicts with newer Gems. Searching ...
2013/08/09
[ "https://Stackoverflow.com/questions/18153839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/278899/" ]
DataMapper was changed to DataMapper2 and then changed to ruby object mapper. it can be found here <https://github.com/rom-rb/rom>
There is another gem to achieve DataMapper decoupling in Ruby. It called [Datamappify](https://github.com/fredwu/datamappify). Another nice projects is under development and needs help: Virtus, [rom-rb](https://github.com/rom-rb/rom) and [Sequel](https://github.com/solnic/virtus) (already mentioned in this thread). I...
18,153,839
I'm looking to use a more separated system for my models in a Ruby on Rails project. It looked like the solution was DataMapper. However, I see that none of their repositories have been updated in the last year, and when installed in a Rails 4 project, it has gem version dependency conflicts with newer Gems. Searching ...
2013/08/09
[ "https://Stackoverflow.com/questions/18153839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/278899/" ]
As someone who uses DataMapper every day at my job, I would recommend sticking to ActiveRecord unless you are connecting to a legacy database that you don't control the schema of (but I would also consider [Sequel](http://sequel.rubyforge.org/) if that were the case). Beyond the fact that it is EOL (as a maintainer [st...
You really should take a look at Sequel if you're considering DataMapper, FWIW I will be migrating away from ActiveRecord to Sequel. However if you like the opinionated Rails ideology then you shouldn't look any further than ActiveRecord for least friction. With no disrespect to the hard work of the Rails community a...
18,153,839
I'm looking to use a more separated system for my models in a Ruby on Rails project. It looked like the solution was DataMapper. However, I see that none of their repositories have been updated in the last year, and when installed in a Rails 4 project, it has gem version dependency conflicts with newer Gems. Searching ...
2013/08/09
[ "https://Stackoverflow.com/questions/18153839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/278899/" ]
As someone who uses DataMapper every day at my job, I would recommend sticking to ActiveRecord unless you are connecting to a legacy database that you don't control the schema of (but I would also consider [Sequel](http://sequel.rubyforge.org/) if that were the case). Beyond the fact that it is EOL (as a maintainer [st...
There is another gem to achieve DataMapper decoupling in Ruby. It called [Datamappify](https://github.com/fredwu/datamappify). Another nice projects is under development and needs help: Virtus, [rom-rb](https://github.com/rom-rb/rom) and [Sequel](https://github.com/solnic/virtus) (already mentioned in this thread). I...
18,153,839
I'm looking to use a more separated system for my models in a Ruby on Rails project. It looked like the solution was DataMapper. However, I see that none of their repositories have been updated in the last year, and when installed in a Rails 4 project, it has gem version dependency conflicts with newer Gems. Searching ...
2013/08/09
[ "https://Stackoverflow.com/questions/18153839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/278899/" ]
As someone who uses DataMapper every day at my job, I would recommend sticking to ActiveRecord unless you are connecting to a legacy database that you don't control the schema of (but I would also consider [Sequel](http://sequel.rubyforge.org/) if that were the case). Beyond the fact that it is EOL (as a maintainer [st...
At my work we ran into many problems with DataMapper. Eventually after much research and talking to developers I realised it was a dead-end project. I documented the reasons we decided to abandon it here: <http://opensourceame.com/why-we-abandoned-ruby-datamapper/>
18,153,839
I'm looking to use a more separated system for my models in a Ruby on Rails project. It looked like the solution was DataMapper. However, I see that none of their repositories have been updated in the last year, and when installed in a Rails 4 project, it has gem version dependency conflicts with newer Gems. Searching ...
2013/08/09
[ "https://Stackoverflow.com/questions/18153839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/278899/" ]
You really should take a look at Sequel if you're considering DataMapper, FWIW I will be migrating away from ActiveRecord to Sequel. However if you like the opinionated Rails ideology then you shouldn't look any further than ActiveRecord for least friction. With no disrespect to the hard work of the Rails community a...
There is another gem to achieve DataMapper decoupling in Ruby. It called [Datamappify](https://github.com/fredwu/datamappify). Another nice projects is under development and needs help: Virtus, [rom-rb](https://github.com/rom-rb/rom) and [Sequel](https://github.com/solnic/virtus) (already mentioned in this thread). I...
18,153,839
I'm looking to use a more separated system for my models in a Ruby on Rails project. It looked like the solution was DataMapper. However, I see that none of their repositories have been updated in the last year, and when installed in a Rails 4 project, it has gem version dependency conflicts with newer Gems. Searching ...
2013/08/09
[ "https://Stackoverflow.com/questions/18153839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/278899/" ]
You really should take a look at Sequel if you're considering DataMapper, FWIW I will be migrating away from ActiveRecord to Sequel. However if you like the opinionated Rails ideology then you shouldn't look any further than ActiveRecord for least friction. With no disrespect to the hard work of the Rails community a...
At my work we ran into many problems with DataMapper. Eventually after much research and talking to developers I realised it was a dead-end project. I documented the reasons we decided to abandon it here: <http://opensourceame.com/why-we-abandoned-ruby-datamapper/>
18,153,839
I'm looking to use a more separated system for my models in a Ruby on Rails project. It looked like the solution was DataMapper. However, I see that none of their repositories have been updated in the last year, and when installed in a Rails 4 project, it has gem version dependency conflicts with newer Gems. Searching ...
2013/08/09
[ "https://Stackoverflow.com/questions/18153839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/278899/" ]
At my work we ran into many problems with DataMapper. Eventually after much research and talking to developers I realised it was a dead-end project. I documented the reasons we decided to abandon it here: <http://opensourceame.com/why-we-abandoned-ruby-datamapper/>
There is another gem to achieve DataMapper decoupling in Ruby. It called [Datamappify](https://github.com/fredwu/datamappify). Another nice projects is under development and needs help: Virtus, [rom-rb](https://github.com/rom-rb/rom) and [Sequel](https://github.com/solnic/virtus) (already mentioned in this thread). I...
16,497,317
It seems that newer versions of bash have the `&>` operator, which (if I understand correctly), redirects both stdout and stderr to a file (`&>>` appends to the file instead, as Adrian clarified). What's the simplest way to achieve the same thing, but instead piping to another command? For example, in this line: ``...
2013/05/11
[ "https://Stackoverflow.com/questions/16497317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27641/" ]
(Note that `&>>file` *appends* to a file while `&>` would redirect and *overwrite* a previously existing file.) To combine `stdout` and `stderr` you would redirect the latter to the former using `1>&2`. This redirects stdout (file descriptor 1) to stderr (file descriptor 2), e.g.: ``` $ { echo "stdout"; echo "stderr"...
Bash has a shorthand for `2>&1 |`, namely `|&`, which pipes both stdout and stderr (see the [manual](https://www.gnu.org/software/bash/manual/bash.html#Pipelines)): ``` cmd-doesnt-respect-difference-between-stdout-and-stderr |& grep -i SomeError ``` This was introduced in Bash 4.0, see the [release notes](https://ti...
22,691,610
I have 2 divs. One at the top of the page and one all the down of the page. like so: ``` <div class="collectionHeader"> <h1>Some title</h1> <div class="image"></div> </div> ...... a lot of html code .......... <div class="text"> <img width="558" height="100" src="stoelen.jpg" /> Lorem ipsum...
2014/03/27
[ "https://Stackoverflow.com/questions/22691610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1420771/" ]
Use [**.appendTo()**](http://api.jquery.com/appendTo/) this will insert the element at the end of the target or you can also use [**prependTo()**](https://api.jquery.com/prependTo/) to insert it as the first element ``` $(".text").find("img").appendTo(".image") ```
You can use **[.appendTo()](http://api.jquery.com/appendto/)**: ``` $(".text img").appendTo(".image"); ``` or **[.append()](http://api.jquery.com/append/)** ``` $('.image').append($(".text img")); ```
43,610,552
My website uses the iframe to load content inside div element. My problem is when a page is refresh it redirect to the initial iframe page not to the current iframe page.
2017/04/25
[ "https://Stackoverflow.com/questions/43610552", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3090877/" ]
As mentioned already it is due to wrong architecture either a) Using x64 assembly with Windows x86 b) Using x86 assembly with x64 process or viceversa For best results, ensure all .NET assemblies are built with "Any CPU", and same .NET profile (ie all using .NET Core, or Client Profile or Full .NET). ...or one depend...
In VS, go to **tools**, then click on **options**. Search "iis" in search bar and check this option, and run the project, this is working for me as I was getting error in web project. [![**enter image description here**](https://i.stack.imgur.com/wfns8.png)](https://i.stack.imgur.com/wfns8.png)
43,610,552
My website uses the iframe to load content inside div element. My problem is when a page is refresh it redirect to the initial iframe page not to the current iframe page.
2017/04/25
[ "https://Stackoverflow.com/questions/43610552", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3090877/" ]
As mentioned already it is due to wrong architecture either a) Using x64 assembly with Windows x86 b) Using x86 assembly with x64 process or viceversa For best results, ensure all .NET assemblies are built with "Any CPU", and same .NET profile (ie all using .NET Core, or Client Profile or Full .NET). ...or one depend...
Right click on project settings, then click on build and set the platform target from Any to x64 or x86 , according to your dll settings. For me, I was trying to load x64 dll with AnyCpu setting. I changed the AnyCpu Setting to x64 and it start working for me. [![enter image description here](https://i.stack.imgur.co...
43,610,552
My website uses the iframe to load content inside div element. My problem is when a page is refresh it redirect to the initial iframe page not to the current iframe page.
2017/04/25
[ "https://Stackoverflow.com/questions/43610552", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3090877/" ]
In VS, go to **tools**, then click on **options**. Search "iis" in search bar and check this option, and run the project, this is working for me as I was getting error in web project. [![**enter image description here**](https://i.stack.imgur.com/wfns8.png)](https://i.stack.imgur.com/wfns8.png)
Right click on project settings, then click on build and set the platform target from Any to x64 or x86 , according to your dll settings. For me, I was trying to load x64 dll with AnyCpu setting. I changed the AnyCpu Setting to x64 and it start working for me. [![enter image description here](https://i.stack.imgur.co...
33,862,802
I am trying to join lines of two files as one using python. Can anyone help me out on this: **File 1:** ``` abc|123|apple abc|456|orange abc|123|grape abc|123|pineapple abc|123|mango ``` **File 2:** ``` boise idaho sydney tokyo london ``` Expected Output File: ``` abc|123|apple|boise abc|456|orange|idah...
2015/11/23
[ "https://Stackoverflow.com/questions/33862802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4210950/" ]
Very close, just change the last line to: ``` res.write("{0}|{1}\n".format(line1.rstrip(), line2.rstrip())) ```
A concise version will be like this ``` file1=[y.strip() for y in open("file01").readlines()] # read all lines file2=["|"+x.strip() for x in open("file02").readlines()] #read all lines but add a "|" at begining of line in file2 mergedfile=zip(file1,file2) #combine lines merged_file=open("a_new_file","w") for line in...
68,721,080
I am trying to write a PySpark dataframe to AWS Redshift. I am using `postActions` parameters for deletion. But this snippet is taking a lot of time to complete. Is there a way to improve the `DATAFRAME.write` speed ? ```py from pyspark import SparkContext from pyspark.sql import SQLContext, types EXTRACOPYOPTIONS ...
2021/08/10
[ "https://Stackoverflow.com/questions/68721080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16629447/" ]
`Circle.area` is not a method. It is a simple variable. You can read it with `my_circle.area`. If you want it to be a function, so you can change the radius and recompute, then you need to make it a function. ``` def area(self): return self.radius * self.radius * self.pi ```
I want to explain meaning of error. In python there are callable and non callables. Not only functions but also instances of classes can be callable. float object is not callable (self.area is float). A class is callable if it has `__call__` method defined. ```py 1.1() ``` ``` TypeError: 'float' object is not calla...
68,721,080
I am trying to write a PySpark dataframe to AWS Redshift. I am using `postActions` parameters for deletion. But this snippet is taking a lot of time to complete. Is there a way to improve the `DATAFRAME.write` speed ? ```py from pyspark import SparkContext from pyspark.sql import SQLContext, types EXTRACOPYOPTIONS ...
2021/08/10
[ "https://Stackoverflow.com/questions/68721080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16629447/" ]
Explanation: ============ It's quite straightforward where the issue is. `self.area` is a variable that is being stored and initialized in the object, not a function. Therefore you can just access it without using `()` at the end which is used for a function call (or initializing objects of a class, see additional not...
I want to explain meaning of error. In python there are callable and non callables. Not only functions but also instances of classes can be callable. float object is not callable (self.area is float). A class is callable if it has `__call__` method defined. ```py 1.1() ``` ``` TypeError: 'float' object is not calla...
20,489,779
I tried ``` <welcome-file-list> <welcome-file>http://otherdomain.com/index.html</welcome-file> </welcome-file-list> ``` but it does not work, also, i would like to redirect 404 error to a page in another domain too. Is it possible?
2013/12/10
[ "https://Stackoverflow.com/questions/20489779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/492760/" ]
I don't know if you can adress another domain directly. The tag is called "welcome-file", so URLs may not be possible. A workaround would be to create a welcome page and error page in the domain of the request and just redirect using HTML: ``` <head> <meta http-equiv="refresh" content="0; URL=http://otherdomain.com/...
No you can't redirect welcome page to a page in another domain in different servlet container. **welcome-file-list** The optional **welcome-file-list** element contains an ordered list of welcome-file elements. When the URL request is a directory name, WebLogic Server serves the first file specified in this element...
20,489,779
I tried ``` <welcome-file-list> <welcome-file>http://otherdomain.com/index.html</welcome-file> </welcome-file-list> ``` but it does not work, also, i would like to redirect 404 error to a page in another domain too. Is it possible?
2013/12/10
[ "https://Stackoverflow.com/questions/20489779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/492760/" ]
that's a strange requirement... however: index.jsp ``` <%@page language="java" contentType="text/html; charset=ISO-8859-1" trimDirectiveWhitespaces="true" %> <% response.sendRedirect("http://www.stackoverflow.com"); %> ``` web.xml: ``` <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-...
No you can't redirect welcome page to a page in another domain in different servlet container. **welcome-file-list** The optional **welcome-file-list** element contains an ordered list of welcome-file elements. When the URL request is a directory name, WebLogic Server serves the first file specified in this element...
57,509,466
I need to merge 2 arrays using UniRx in order to get Observable which emits first elements of arrays then second elements and so on, then emits the rest of the longest array I tried Zip but Zip cuts the tail of longest array I tried Merge with Scheduler.DefaultSchedulers.Iteration but it starts a parallel threads whic...
2019/08/15
[ "https://Stackoverflow.com/questions/57509466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11903124/" ]
This works for me as you expect: ``` var a1 = new int[] { 1, 2, 3 }; var a2 = new int[] { 4, 5, 6, 7, 8, 9 }; var x1 = a1.Select(x => (int?)x).ToObservable().Concat(Observable.Repeat((int?)null)); var x2 = a2.Select(x => (int?)x).ToObservable().Concat(Observable.Repeat((int?)null)); var query = x1 .Zip(x...
If you know the length of the arrays, you could concatentate the `Zip` sequence with the other two and skip the number of already zipped elements. This is C# but should get you the idea: ``` var a1 = new int[] { 1, 2, 3 }; var a2 = new int[] { 4, 5, 6, 7, 8, 9 }; var x1 = a1.ToObservable(); var x2 = a2.ToObservable()...
57,509,466
I need to merge 2 arrays using UniRx in order to get Observable which emits first elements of arrays then second elements and so on, then emits the rest of the longest array I tried Zip but Zip cuts the tail of longest array I tried Merge with Scheduler.DefaultSchedulers.Iteration but it starts a parallel threads whic...
2019/08/15
[ "https://Stackoverflow.com/questions/57509466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11903124/" ]
This works for me as you expect: ``` var a1 = new int[] { 1, 2, 3 }; var a2 = new int[] { 4, 5, 6, 7, 8, 9 }; var x1 = a1.Select(x => (int?)x).ToObservable().Concat(Observable.Repeat((int?)null)); var x2 = a2.Select(x => (int?)x).ToObservable().Concat(Observable.Repeat((int?)null)); var query = x1 .Zip(x...
The solution posted by @mm8 will work with two Observables with a defined end (like arrays masquerading as observables), but will hang forever with infinite observables, which are a common case. For example: ``` var odds = Observable.Interval(TimeSpan.FromMilliseconds(10)) .Select(i => i * 2 + 1); var evens = Obse...
31,269,662
I am having a bit of trouble getting my\_first\_steps.rb to proceed further than the initial load test "Given I am on the Welcome Screen". I have sought in depth examples of inputting text into the UISearchBarTextField and have unfortunately fell short of my intended goal of creating a functional test. I am not complet...
2015/07/07
[ "https://Stackoverflow.com/questions/31269662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4949380/" ]
AFAIK, there is no syntax rule which tells that `long` *`T`* is a valid type once *`T`* is a valid type. (But there is some related rule for *qualifiers* like `volatile` or `const`) In other words `long long` should *almost* be seen as a "multi-word keyword" (but the C & C++ standardization committees are very relucta...
Paragraph 2 of **[dcl.type]** has the rules for `long`, `short`, `signed`, `unsigned`, `const` and `volatile`. > > As a general rule, at most one type-specifier is allowed in the complete decl-specifier-seq of a declaration or in a type-specifier-seq or trailing-type-specifier-seq. The only exceptions to this rule are th...
31,269,662
I am having a bit of trouble getting my\_first\_steps.rb to proceed further than the initial load test "Given I am on the Welcome Screen". I have sought in depth examples of inputting text into the UISearchBarTextField and have unfortunately fell short of my intended goal of creating a functional test. I am not complet...
2015/07/07
[ "https://Stackoverflow.com/questions/31269662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4949380/" ]
Alright, I'll answer. First, looking at this: > > a typedef-name is syntactically equivalent to a keyword > > > This only means that typedef-names follow the syntax of keywords. This does not mean that a typedef-name is equivalent to any particular keyword. It's like a new, unique keyword. Then we have, > > A...
AFAIK, there is no syntax rule which tells that `long` *`T`* is a valid type once *`T`* is a valid type. (But there is some related rule for *qualifiers* like `volatile` or `const`) In other words `long long` should *almost* be seen as a "multi-word keyword" (but the C & C++ standardization committees are very relucta...
31,269,662
I am having a bit of trouble getting my\_first\_steps.rb to proceed further than the initial load test "Given I am on the Welcome Screen". I have sought in depth examples of inputting text into the UISearchBarTextField and have unfortunately fell short of my intended goal of creating a functional test. I am not complet...
2015/07/07
[ "https://Stackoverflow.com/questions/31269662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4949380/" ]
AFAIK, there is no syntax rule which tells that `long` *`T`* is a valid type once *`T`* is a valid type. (But there is some related rule for *qualifiers* like `volatile` or `const`) In other words `long long` should *almost* be seen as a "multi-word keyword" (but the C & C++ standardization committees are very relucta...
It might help to note the purpose of introducing the notion of synonym. Synonyms were added to C to address auto-reference when defining structures. For instance when defining a structure type used to represent an element in a linked list, you may want to define it as follows: ``` typedef struct { int ...
31,269,662
I am having a bit of trouble getting my\_first\_steps.rb to proceed further than the initial load test "Given I am on the Welcome Screen". I have sought in depth examples of inputting text into the UISearchBarTextField and have unfortunately fell short of my intended goal of creating a functional test. I am not complet...
2015/07/07
[ "https://Stackoverflow.com/questions/31269662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4949380/" ]
Alright, I'll answer. First, looking at this: > > a typedef-name is syntactically equivalent to a keyword > > > This only means that typedef-names follow the syntax of keywords. This does not mean that a typedef-name is equivalent to any particular keyword. It's like a new, unique keyword. Then we have, > > A...
Paragraph 2 of **[dcl.type]** has the rules for `long`, `short`, `signed`, `unsigned`, `const` and `volatile`. > > As a general rule, at most one type-specifier is allowed in the complete decl-specifier-seq of a declaration or in a type-specifier-seq or trailing-type-specifier-seq. The only exceptions to this rule are th...
31,269,662
I am having a bit of trouble getting my\_first\_steps.rb to proceed further than the initial load test "Given I am on the Welcome Screen". I have sought in depth examples of inputting text into the UISearchBarTextField and have unfortunately fell short of my intended goal of creating a functional test. I am not complet...
2015/07/07
[ "https://Stackoverflow.com/questions/31269662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4949380/" ]
Paragraph 2 of **[dcl.type]** has the rules for `long`, `short`, `signed`, `unsigned`, `const` and `volatile`. > > As a general rule, at most one type-specifier is allowed in the complete decl-specifier-seq of a declaration or in a type-specifier-seq or trailing-type-specifier-seq. The only exceptions to this rule are th...
It might help to note the purpose of introducing the notion of synonym. Synonyms were added to C to address auto-reference when defining structures. For instance when defining a structure type used to represent an element in a linked list, you may want to define it as follows: ``` typedef struct { int ...
31,269,662
I am having a bit of trouble getting my\_first\_steps.rb to proceed further than the initial load test "Given I am on the Welcome Screen". I have sought in depth examples of inputting text into the UISearchBarTextField and have unfortunately fell short of my intended goal of creating a functional test. I am not complet...
2015/07/07
[ "https://Stackoverflow.com/questions/31269662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4949380/" ]
Alright, I'll answer. First, looking at this: > > a typedef-name is syntactically equivalent to a keyword > > > This only means that typedef-names follow the syntax of keywords. This does not mean that a typedef-name is equivalent to any particular keyword. It's like a new, unique keyword. Then we have, > > A...
It might help to note the purpose of introducing the notion of synonym. Synonyms were added to C to address auto-reference when defining structures. For instance when defining a structure type used to represent an element in a linked list, you may want to define it as follows: ``` typedef struct { int ...
11,727,381
I have tested different elements in a char array and if they do not meet the conditions I want to remove them from the array. Is there a way to do this? Here is my code sofar ``` String s; char[] b = inputString.toCharArray(); b = new char[b.length]; do { if(!(b[i]>='0')&&(b[i]<='9')&&(b[i]!=...
2012/07/30
[ "https://Stackoverflow.com/questions/11727381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1532256/" ]
This should do what you want: ``` ArrayList<char> charList = new ArrayList<char>(0); for (int i= 0; i < b.length; i++) { if (b[i] == condition) { charList.Add(b[i]); } } charList.toArray(); ```
It'd probably be a better idea to use a [`switch`](http://docs.oracle.com/javase/tutorial/java/nutsandbolts/switch.html) statement here. Rather than eliminating the character that you don't want from your array (mutation during iteration is evil unless you're using an `Iterator`), why don't you use the [`StringBuilder`...
11,727,381
I have tested different elements in a char array and if they do not meet the conditions I want to remove them from the array. Is there a way to do this? Here is my code sofar ``` String s; char[] b = inputString.toCharArray(); b = new char[b.length]; do { if(!(b[i]>='0')&&(b[i]<='9')&&(b[i]!=...
2012/07/30
[ "https://Stackoverflow.com/questions/11727381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1532256/" ]
Because comments don't allow good code formatting: At the beginning of your code, you get the `String` contents as a `char[]` and immediately lose it again by assigning a new `char[]` of the same size to the variable. ``` char[] b = inputString.toCharArray(); b = new char[b.length]; ``` so the loop after works on a...
It'd probably be a better idea to use a [`switch`](http://docs.oracle.com/javase/tutorial/java/nutsandbolts/switch.html) statement here. Rather than eliminating the character that you don't want from your array (mutation during iteration is evil unless you're using an `Iterator`), why don't you use the [`StringBuilder`...
11,727,381
I have tested different elements in a char array and if they do not meet the conditions I want to remove them from the array. Is there a way to do this? Here is my code sofar ``` String s; char[] b = inputString.toCharArray(); b = new char[b.length]; do { if(!(b[i]>='0')&&(b[i]<='9')&&(b[i]!=...
2012/07/30
[ "https://Stackoverflow.com/questions/11727381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1532256/" ]
This should do what you want: ``` ArrayList<char> charList = new ArrayList<char>(0); for (int i= 0; i < b.length; i++) { if (b[i] == condition) { charList.Add(b[i]); } } charList.toArray(); ```
You wont really be able to delete the element but you could change it by doing something like b[i] = 0; at the end of the given code. Arrays are a certain length and the length cant be changed so if you want to remove that part of the array i would suggest using a list instead. ``` List temp = b.asList(); Iterator it ...
11,727,381
I have tested different elements in a char array and if they do not meet the conditions I want to remove them from the array. Is there a way to do this? Here is my code sofar ``` String s; char[] b = inputString.toCharArray(); b = new char[b.length]; do { if(!(b[i]>='0')&&(b[i]<='9')&&(b[i]!=...
2012/07/30
[ "https://Stackoverflow.com/questions/11727381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1532256/" ]
Because comments don't allow good code formatting: At the beginning of your code, you get the `String` contents as a `char[]` and immediately lose it again by assigning a new `char[]` of the same size to the variable. ``` char[] b = inputString.toCharArray(); b = new char[b.length]; ``` so the loop after works on a...
You wont really be able to delete the element but you could change it by doing something like b[i] = 0; at the end of the given code. Arrays are a certain length and the length cant be changed so if you want to remove that part of the array i would suggest using a list instead. ``` List temp = b.asList(); Iterator it ...
11,727,381
I have tested different elements in a char array and if they do not meet the conditions I want to remove them from the array. Is there a way to do this? Here is my code sofar ``` String s; char[] b = inputString.toCharArray(); b = new char[b.length]; do { if(!(b[i]>='0')&&(b[i]<='9')&&(b[i]!=...
2012/07/30
[ "https://Stackoverflow.com/questions/11727381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1532256/" ]
This should do what you want: ``` ArrayList<char> charList = new ArrayList<char>(0); for (int i= 0; i < b.length; i++) { if (b[i] == condition) { charList.Add(b[i]); } } charList.toArray(); ```
``` char[] finishedArray = new char[0]; char[] arrayToCheck = new char[]{ 'a', 'b', 'c', 'd', 'e', 'f', 'g' }; for( int i = 0; i < arrayToCheck.length; i++ ) { if( !doesNOTMeetSomeCondition( arrayToCheck[ i ] ) ) { //DOES meet keep condition, add to new array char[] newCharArray = new char[ fini...
11,727,381
I have tested different elements in a char array and if they do not meet the conditions I want to remove them from the array. Is there a way to do this? Here is my code sofar ``` String s; char[] b = inputString.toCharArray(); b = new char[b.length]; do { if(!(b[i]>='0')&&(b[i]<='9')&&(b[i]!=...
2012/07/30
[ "https://Stackoverflow.com/questions/11727381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1532256/" ]
This should do what you want: ``` ArrayList<char> charList = new ArrayList<char>(0); for (int i= 0; i < b.length; i++) { if (b[i] == condition) { charList.Add(b[i]); } } charList.toArray(); ```
Because comments don't allow good code formatting: At the beginning of your code, you get the `String` contents as a `char[]` and immediately lose it again by assigning a new `char[]` of the same size to the variable. ``` char[] b = inputString.toCharArray(); b = new char[b.length]; ``` so the loop after works on a...
11,727,381
I have tested different elements in a char array and if they do not meet the conditions I want to remove them from the array. Is there a way to do this? Here is my code sofar ``` String s; char[] b = inputString.toCharArray(); b = new char[b.length]; do { if(!(b[i]>='0')&&(b[i]<='9')&&(b[i]!=...
2012/07/30
[ "https://Stackoverflow.com/questions/11727381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1532256/" ]
This should do what you want: ``` ArrayList<char> charList = new ArrayList<char>(0); for (int i= 0; i < b.length; i++) { if (b[i] == condition) { charList.Add(b[i]); } } charList.toArray(); ```
Something is not right with your program: ``` String s; char[] b = inputString.toCharArray(); b = new char[b.length]; do { if(!(b[i]>='0')&&(b[i]<='9')&&(b[i]!='.')) { ... } } while... ``` You're creating a `char[]` from your `inputString`, and then on the next line you assign a whole new empty `char...
11,727,381
I have tested different elements in a char array and if they do not meet the conditions I want to remove them from the array. Is there a way to do this? Here is my code sofar ``` String s; char[] b = inputString.toCharArray(); b = new char[b.length]; do { if(!(b[i]>='0')&&(b[i]<='9')&&(b[i]!=...
2012/07/30
[ "https://Stackoverflow.com/questions/11727381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1532256/" ]
Because comments don't allow good code formatting: At the beginning of your code, you get the `String` contents as a `char[]` and immediately lose it again by assigning a new `char[]` of the same size to the variable. ``` char[] b = inputString.toCharArray(); b = new char[b.length]; ``` so the loop after works on a...
``` char[] finishedArray = new char[0]; char[] arrayToCheck = new char[]{ 'a', 'b', 'c', 'd', 'e', 'f', 'g' }; for( int i = 0; i < arrayToCheck.length; i++ ) { if( !doesNOTMeetSomeCondition( arrayToCheck[ i ] ) ) { //DOES meet keep condition, add to new array char[] newCharArray = new char[ fini...
11,727,381
I have tested different elements in a char array and if they do not meet the conditions I want to remove them from the array. Is there a way to do this? Here is my code sofar ``` String s; char[] b = inputString.toCharArray(); b = new char[b.length]; do { if(!(b[i]>='0')&&(b[i]<='9')&&(b[i]!=...
2012/07/30
[ "https://Stackoverflow.com/questions/11727381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1532256/" ]
Because comments don't allow good code formatting: At the beginning of your code, you get the `String` contents as a `char[]` and immediately lose it again by assigning a new `char[]` of the same size to the variable. ``` char[] b = inputString.toCharArray(); b = new char[b.length]; ``` so the loop after works on a...
Something is not right with your program: ``` String s; char[] b = inputString.toCharArray(); b = new char[b.length]; do { if(!(b[i]>='0')&&(b[i]<='9')&&(b[i]!='.')) { ... } } while... ``` You're creating a `char[]` from your `inputString`, and then on the next line you assign a whole new empty `char...
8,677,430
Suppose I have different documents in different collections: On **cars**: ``` { "_id": 32534534, "color": "red", ... } ``` On **houses**: ``` { "_id": 93867, "city": "Xanadu", ... } ``` How can I retrieve the corresponding document to the documents below, in **people**: ``` { "name": "Alonso", "owns": [32534534...
2011/12/30
[ "https://Stackoverflow.com/questions/8677430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/359861/" ]
Using [DBrefs](http://www.mongodb.org/display/DOCS/Database+References#DatabaseReferences-DBRef) you can store links to documents outside your collection or even in another mongodb database. You will have to fetch the references in separate queries, different drivers handle this differently, for example with the python...
I think there is no way of achieving querying from multiple collections at once. I may suggest storing them inside the same collection like below with a `type` field. ``` { "_id": 32534534, "type": "car", "color": "red", ... } { "_id": 93867, "type": "house", "city": "Xanadu", ... } ```
8,677,430
Suppose I have different documents in different collections: On **cars**: ``` { "_id": 32534534, "color": "red", ... } ``` On **houses**: ``` { "_id": 93867, "city": "Xanadu", ... } ``` How can I retrieve the corresponding document to the documents below, in **people**: ``` { "name": "Alonso", "owns": [32534534...
2011/12/30
[ "https://Stackoverflow.com/questions/8677430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/359861/" ]
Using [DBrefs](http://www.mongodb.org/display/DOCS/Database+References#DatabaseReferences-DBRef) you can store links to documents outside your collection or even in another mongodb database. You will have to fetch the references in separate queries, different drivers handle this differently, for example with the python...
You need to restructure your people document to have a type to be added ``` { "name": "Alonso", "owns": {ids:[32534534],type:'car'} ... } { "name": "Kublai Khan", "owns":{ids:[93867],type:'house'} ... } ``` so now you can find the people who owns the red color car by ``` db.people.find({type:car,ids:32534534}) ``...
21,441,394
Not sure if you can do this through tail and grep. Lets say I have a log file that I would like to tail. It spits out quite a bit of information when in debug mode. I want to grep for information pertaining to only my module, and the module name is in the log like so: ``` /*** Module Name | 2014.01.29 14:58:01 a multi...
2014/01/29
[ "https://Stackoverflow.com/questions/21441394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2623893/" ]
From your description, it seems like this should work: ``` tail -f log | awk '/^\/\*\*\* Module Name/,/^\*\*\//' ``` but be wary of buffering issues. (Lines printed to the file will very likely see high latency before actually being printed.)
I think you will have to install `pcregrep` for this. Then this will work: ``` tail -f logfile | pcregrep -M "^\/\*\*\* Some Other Module Name \|.*(\n|.)*?^\*\*/$" ``` This worked in testing, but for some reason, I had to append your example text to the log file over 100 times before output started showing up. Howe...
34,785,886
I need to parse a JSON String like this ``` { "someData": [{ "title": "Test!", "content": "hello!" }, { "title": "Test 2!", "content": "hello!" }], "otherData": [{ "title": "Hey", "content": "yes or no" }] } ``` I have some code to parse json. But t...
2016/01/14
[ "https://Stackoverflow.com/questions/34785886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5772573/" ]
If `End_Date` is null then you take it in your results. Is that what you want? If so you could write it like ``` SELECT * FROM DEMO_T WHERE END_DATE > SYSDATE OR END_DATE IS NULL; ``` If you don't want that, could try ``` SELECT * FROM DEMO_T WHERE END_DATE > SYSDATE; ``` In your code: `NVL(End_date,sysdate+3)` ...
You query is fine. You can use that or check for NULL explicitely with `(end_date > sysdate or end_date is null)`. Both do the same and while some people prefer the former, others prefer the latter and still others always use `DECODE` to check nullable columns. Use what you consider most readable and stick to one way i...
34,785,886
I need to parse a JSON String like this ``` { "someData": [{ "title": "Test!", "content": "hello!" }, { "title": "Test 2!", "content": "hello!" }], "otherData": [{ "title": "Hey", "content": "yes or no" }] } ``` I have some code to parse json. But t...
2016/01/14
[ "https://Stackoverflow.com/questions/34785886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5772573/" ]
If `End_Date` is null then you take it in your results. Is that what you want? If so you could write it like ``` SELECT * FROM DEMO_T WHERE END_DATE > SYSDATE OR END_DATE IS NULL; ``` If you don't want that, could try ``` SELECT * FROM DEMO_T WHERE END_DATE > SYSDATE; ``` In your code: `NVL(End_date,sysdate+3)` ...
You should use `trunc` for dates else it will compare time and might give wrong output. ``` select * from Demo_t where trunc(nvl(end_date,sysdate+1)) > trunc(sysdate); ```
34,785,886
I need to parse a JSON String like this ``` { "someData": [{ "title": "Test!", "content": "hello!" }, { "title": "Test 2!", "content": "hello!" }], "otherData": [{ "title": "Hey", "content": "yes or no" }] } ``` I have some code to parse json. But t...
2016/01/14
[ "https://Stackoverflow.com/questions/34785886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5772573/" ]
You query is fine. You can use that or check for NULL explicitely with `(end_date > sysdate or end_date is null)`. Both do the same and while some people prefer the former, others prefer the latter and still others always use `DECODE` to check nullable columns. Use what you consider most readable and stick to one way i...
You should use `trunc` for dates else it will compare time and might give wrong output. ``` select * from Demo_t where trunc(nvl(end_date,sysdate+1)) > trunc(sysdate); ```
12,221,101
assuming we have a class ``` class foo{ } ``` and it has no methods but somewhere in the code , some genius developer called the class and used it like this : ``` $x = new foo(); $x->run(); ``` we have no method "run" in our class , but is there anyway that this foo class can know that some code called the metho...
2012/08/31
[ "https://Stackoverflow.com/questions/12221101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/506822/" ]
You can give the class a [magic method named `__call`](http://www.php.net/manual/en/language.oop5.overloading.php#object.call) that is called when a non existent method is called: ``` class foo{ function __call($method, $params) { echo "Non extisent method $method is called"; } } ```
I'm pretty sure what you are looking for is the [\_\_call()](http://php.net/manual/en/language.oop5.overloading.php) magic method. It is defined as: **\_\_call() is triggered when invoking inaccessible methods in an object context.** At this point you can handle dynamic handling of the call. ``` class Dog { func...
12,221,101
assuming we have a class ``` class foo{ } ``` and it has no methods but somewhere in the code , some genius developer called the class and used it like this : ``` $x = new foo(); $x->run(); ``` we have no method "run" in our class , but is there anyway that this foo class can know that some code called the metho...
2012/08/31
[ "https://Stackoverflow.com/questions/12221101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/506822/" ]
You can give the class a [magic method named `__call`](http://www.php.net/manual/en/language.oop5.overloading.php#object.call) that is called when a non existent method is called: ``` class foo{ function __call($method, $params) { echo "Non extisent method $method is called"; } } ```
It can be achieved with [set\_error\_handler](http://www.php.net/manual/en/function.set-error-handler.php) I think
17,158,861
So what I'm trying to do is animate a box in android. In my drawView.java I have ``` public void box(int x1, int x2, int y1, int y2) { paint.setColor(Color.WHITE); paint.setStrokeWidth(3); canvas.drawLine(x1, y1, x2, y1, paint); canvas.drawLine(x1, y2, x2, y2, paint); canvas.drawLine(x1, y1...
2013/06/18
[ "https://Stackoverflow.com/questions/17158861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2441995/" ]
Swap the two lines: ``` DV.box(x1, x2, y1, y2); DV = new DrawView(this); ``` so that you instantiate `DV` before referencing it. ``` DV = new DrawView(this); DV.box(x1, x2, y1, y2); ``` Also, it's standard Java convention for variables and fields to start with lowercase.
You just have to create the DV object before calling that box method: ``` DV = new DrawView(this); DV.box(x1, x2, y1, y2); ```
16,841
I was discussing with a friend of mine about her research and I came across this problem. The problem essentially boils down to this. $f(x)$ is a function defined in $[0,1]$ such that $f(x) + f(1-x) = f(1)$. I want to find a condition on $f(x)$ so that I can conclude $f(x) = f(1)x$. Clearly, $f \in C^{0}[0,1]$ alone...
2011/01/08
[ "https://math.stackexchange.com/questions/16841", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I presume $\displaystyle f(1) \neq 0$, in which case we can assume $\displaystyle f(1) = 1$. If $\displaystyle f$ is such a function, then $\displaystyle g(x) = \sin^{2}\left(\frac{\pi f(x)}{2}\right)$ is also such a function. If $\displaystyle f(1) = 0$, take $\displaystyle g(x) = \sin(f(x))$. So you will really ne...
Let $g(x) = f(x + 1/2)$, which is defined on $[-1/2, 1/2]$ and which satisfies $g(x) + g(-x) = g(1/2)$. Now, any function $g$ on $[-1/2, 1/2]$ can be written $$g(x) = \frac{g(x) + g(-x)}{2} + \frac{g(x) - g(-x)}{2} = \frac{g(1/2)}{2} + \frac{g(x) - g(-x)}{2}$$ where the first term is the even part and the second term...
16,841
I was discussing with a friend of mine about her research and I came across this problem. The problem essentially boils down to this. $f(x)$ is a function defined in $[0,1]$ such that $f(x) + f(1-x) = f(1)$. I want to find a condition on $f(x)$ so that I can conclude $f(x) = f(1)x$. Clearly, $f \in C^{0}[0,1]$ alone...
2011/01/08
[ "https://math.stackexchange.com/questions/16841", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Let $g(x) = f(x + 1/2)$, which is defined on $[-1/2, 1/2]$ and which satisfies $g(x) + g(-x) = g(1/2)$. Now, any function $g$ on $[-1/2, 1/2]$ can be written $$g(x) = \frac{g(x) + g(-x)}{2} + \frac{g(x) - g(-x)}{2} = \frac{g(1/2)}{2} + \frac{g(x) - g(-x)}{2}$$ where the first term is the even part and the second term...
Whilst this was a post from a while ago; what you are looking at is a symmetric probability function in some cases (under the definition of Segal 1993) And I also noticed that your edited solution would work, a while ago. ie Is the Symmetry a bi-conditional injective claim as well, ie as an iff, claim. ie inverse sym...
16,841
I was discussing with a friend of mine about her research and I came across this problem. The problem essentially boils down to this. $f(x)$ is a function defined in $[0,1]$ such that $f(x) + f(1-x) = f(1)$. I want to find a condition on $f(x)$ so that I can conclude $f(x) = f(1)x$. Clearly, $f \in C^{0}[0,1]$ alone...
2011/01/08
[ "https://math.stackexchange.com/questions/16841", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Let $g(x) = f(x + 1/2)$, which is defined on $[-1/2, 1/2]$ and which satisfies $g(x) + g(-x) = g(1/2)$. Now, any function $g$ on $[-1/2, 1/2]$ can be written $$g(x) = \frac{g(x) + g(-x)}{2} + \frac{g(x) - g(-x)}{2} = \frac{g(1/2)}{2} + \frac{g(x) - g(-x)}{2}$$ where the first term is the even part and the second term...
In fact if F strictly monotonic; with $F(1)=1$, and thus $F(0.5)=0.5$ as a result then midpoint convexity just at at 0 and 1 (mid star convexity at zero or one) Would be sufficient, if $F:[0,1]\to [0,1]$; or just star convexity, given F(1)=1 and $F(1-x)+F(x)=F(1)=1$ just at $0$ for all real t, at zero alone. Not sur...
16,841
I was discussing with a friend of mine about her research and I came across this problem. The problem essentially boils down to this. $f(x)$ is a function defined in $[0,1]$ such that $f(x) + f(1-x) = f(1)$. I want to find a condition on $f(x)$ so that I can conclude $f(x) = f(1)x$. Clearly, $f \in C^{0}[0,1]$ alone...
2011/01/08
[ "https://math.stackexchange.com/questions/16841", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Let $g(x) = f(x + 1/2)$, which is defined on $[-1/2, 1/2]$ and which satisfies $g(x) + g(-x) = g(1/2)$. Now, any function $g$ on $[-1/2, 1/2]$ can be written $$g(x) = \frac{g(x) + g(-x)}{2} + \frac{g(x) - g(-x)}{2} = \frac{g(1/2)}{2} + \frac{g(x) - g(-x)}{2}$$ where the first term is the even part and the second term...
In fact this functional equation belongs to the form of <http://eqworld.ipmnet.ru/en/solutions/fe/fe1116.pdf>. The general solution is $f(x)=\dfrac{f(1)}{2}+C(x,1-x)$ , where $C(u,v)$ is any antisymmetric function.
16,841
I was discussing with a friend of mine about her research and I came across this problem. The problem essentially boils down to this. $f(x)$ is a function defined in $[0,1]$ such that $f(x) + f(1-x) = f(1)$. I want to find a condition on $f(x)$ so that I can conclude $f(x) = f(1)x$. Clearly, $f \in C^{0}[0,1]$ alone...
2011/01/08
[ "https://math.stackexchange.com/questions/16841", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I presume $\displaystyle f(1) \neq 0$, in which case we can assume $\displaystyle f(1) = 1$. If $\displaystyle f$ is such a function, then $\displaystyle g(x) = \sin^{2}\left(\frac{\pi f(x)}{2}\right)$ is also such a function. If $\displaystyle f(1) = 0$, take $\displaystyle g(x) = \sin(f(x))$. So you will really ne...
Whilst this was a post from a while ago; what you are looking at is a symmetric probability function in some cases (under the definition of Segal 1993) And I also noticed that your edited solution would work, a while ago. ie Is the Symmetry a bi-conditional injective claim as well, ie as an iff, claim. ie inverse sym...
16,841
I was discussing with a friend of mine about her research and I came across this problem. The problem essentially boils down to this. $f(x)$ is a function defined in $[0,1]$ such that $f(x) + f(1-x) = f(1)$. I want to find a condition on $f(x)$ so that I can conclude $f(x) = f(1)x$. Clearly, $f \in C^{0}[0,1]$ alone...
2011/01/08
[ "https://math.stackexchange.com/questions/16841", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I presume $\displaystyle f(1) \neq 0$, in which case we can assume $\displaystyle f(1) = 1$. If $\displaystyle f$ is such a function, then $\displaystyle g(x) = \sin^{2}\left(\frac{\pi f(x)}{2}\right)$ is also such a function. If $\displaystyle f(1) = 0$, take $\displaystyle g(x) = \sin(f(x))$. So you will really ne...
In fact if F strictly monotonic; with $F(1)=1$, and thus $F(0.5)=0.5$ as a result then midpoint convexity just at at 0 and 1 (mid star convexity at zero or one) Would be sufficient, if $F:[0,1]\to [0,1]$; or just star convexity, given F(1)=1 and $F(1-x)+F(x)=F(1)=1$ just at $0$ for all real t, at zero alone. Not sur...
16,841
I was discussing with a friend of mine about her research and I came across this problem. The problem essentially boils down to this. $f(x)$ is a function defined in $[0,1]$ such that $f(x) + f(1-x) = f(1)$. I want to find a condition on $f(x)$ so that I can conclude $f(x) = f(1)x$. Clearly, $f \in C^{0}[0,1]$ alone...
2011/01/08
[ "https://math.stackexchange.com/questions/16841", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I presume $\displaystyle f(1) \neq 0$, in which case we can assume $\displaystyle f(1) = 1$. If $\displaystyle f$ is such a function, then $\displaystyle g(x) = \sin^{2}\left(\frac{\pi f(x)}{2}\right)$ is also such a function. If $\displaystyle f(1) = 0$, take $\displaystyle g(x) = \sin(f(x))$. So you will really ne...
In fact this functional equation belongs to the form of <http://eqworld.ipmnet.ru/en/solutions/fe/fe1116.pdf>. The general solution is $f(x)=\dfrac{f(1)}{2}+C(x,1-x)$ , where $C(u,v)$ is any antisymmetric function.
16,841
I was discussing with a friend of mine about her research and I came across this problem. The problem essentially boils down to this. $f(x)$ is a function defined in $[0,1]$ such that $f(x) + f(1-x) = f(1)$. I want to find a condition on $f(x)$ so that I can conclude $f(x) = f(1)x$. Clearly, $f \in C^{0}[0,1]$ alone...
2011/01/08
[ "https://math.stackexchange.com/questions/16841", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
In fact this functional equation belongs to the form of <http://eqworld.ipmnet.ru/en/solutions/fe/fe1116.pdf>. The general solution is $f(x)=\dfrac{f(1)}{2}+C(x,1-x)$ , where $C(u,v)$ is any antisymmetric function.
Whilst this was a post from a while ago; what you are looking at is a symmetric probability function in some cases (under the definition of Segal 1993) And I also noticed that your edited solution would work, a while ago. ie Is the Symmetry a bi-conditional injective claim as well, ie as an iff, claim. ie inverse sym...
16,841
I was discussing with a friend of mine about her research and I came across this problem. The problem essentially boils down to this. $f(x)$ is a function defined in $[0,1]$ such that $f(x) + f(1-x) = f(1)$. I want to find a condition on $f(x)$ so that I can conclude $f(x) = f(1)x$. Clearly, $f \in C^{0}[0,1]$ alone...
2011/01/08
[ "https://math.stackexchange.com/questions/16841", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
In fact this functional equation belongs to the form of <http://eqworld.ipmnet.ru/en/solutions/fe/fe1116.pdf>. The general solution is $f(x)=\dfrac{f(1)}{2}+C(x,1-x)$ , where $C(u,v)$ is any antisymmetric function.
In fact if F strictly monotonic; with $F(1)=1$, and thus $F(0.5)=0.5$ as a result then midpoint convexity just at at 0 and 1 (mid star convexity at zero or one) Would be sufficient, if $F:[0,1]\to [0,1]$; or just star convexity, given F(1)=1 and $F(1-x)+F(x)=F(1)=1$ just at $0$ for all real t, at zero alone. Not sur...
53,877,830
As a little holiday project I want to control an app via an accessibility switch which is connected via 3,5mm headphone jack to the iOS device. This is the switch and the plug:[![enter image description here](https://i.stack.imgur.com/63hTl.png)](https://i.stack.imgur.com/63hTl.png) My problem is that I don't have an...
2018/12/21
[ "https://Stackoverflow.com/questions/53877830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1283056/" ]
If it was as headphone jack, you can handle it using ``` override func remoteControlReceived(with event: UIEvent?) {} ``` and toggle inside of it `event?.type.subType` something like this. ``` override func remoteControlReceived(with event: UIEvent?) { if let e = event , e.type == .remoteControl { ...
Apples wired 3.5 mm headphone with volume control have 4 conductors. In your picture I see only 2 conductors. So your switch can't be sending the Apples's own headphone remote commands - since the the microphone ring for sending data is missing. I'd guess your switch just makes contact between the two conductors. Here...
53,877,830
As a little holiday project I want to control an app via an accessibility switch which is connected via 3,5mm headphone jack to the iOS device. This is the switch and the plug:[![enter image description here](https://i.stack.imgur.com/63hTl.png)](https://i.stack.imgur.com/63hTl.png) My problem is that I don't have an...
2018/12/21
[ "https://Stackoverflow.com/questions/53877830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1283056/" ]
Your button is a "Big Buddy Button Switch," designed by AbleNet for persons with moderate to severe upper extremity and motor disabilities. It is not designed to plug into an IOS device nor into any mobile tablet or phone. There is an "Hook + Switch" interface ($185 at this moment) that is designed to go between this ...
If it was as headphone jack, you can handle it using ``` override func remoteControlReceived(with event: UIEvent?) {} ``` and toggle inside of it `event?.type.subType` something like this. ``` override func remoteControlReceived(with event: UIEvent?) { if let e = event , e.type == .remoteControl { ...
53,877,830
As a little holiday project I want to control an app via an accessibility switch which is connected via 3,5mm headphone jack to the iOS device. This is the switch and the plug:[![enter image description here](https://i.stack.imgur.com/63hTl.png)](https://i.stack.imgur.com/63hTl.png) My problem is that I don't have an...
2018/12/21
[ "https://Stackoverflow.com/questions/53877830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1283056/" ]
Your button is a "Big Buddy Button Switch," designed by AbleNet for persons with moderate to severe upper extremity and motor disabilities. It is not designed to plug into an IOS device nor into any mobile tablet or phone. There is an "Hook + Switch" interface ($185 at this moment) that is designed to go between this ...
Apples wired 3.5 mm headphone with volume control have 4 conductors. In your picture I see only 2 conductors. So your switch can't be sending the Apples's own headphone remote commands - since the the microphone ring for sending data is missing. I'd guess your switch just makes contact between the two conductors. Here...
7,741
`the_content` is always surrounded by paragraphs, it doesn't matter if I'm in HTML view and there's nothing there. Does WordPress have a function to remove them? IS there any way?
2011/01/25
[ "https://wordpress.stackexchange.com/questions/7741", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/781/" ]
Removing the filter that adds the P is the best option. ``` remove_filter('the_content','wpautop'); remove_filter('the_content','shortcode_autounp'); // You may want to do this aswell ```
You can implement your own function in your theme's function.php file and use it instead of "the\_content" ``` function my_content($post){ $content = apply_filters('the_content', $post->post_content); // added to parse shortcodes $content = str_replace(']]>', ']]&gt', $content); // added to parse shortcodes ...
39,220,003
I'm having a problem with linking html to CSS. It doesn't work on Google Chrome, but it does on IE. Is there anything wrong with it. By the way, I downloaded the newest version of Google Chrome moments ago. This is my html: ```css body{ background:black; color:white; font-family:arial,helvetica,sans-serif; ...
2016/08/30
[ "https://Stackoverflow.com/questions/39220003", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5189979/" ]
You can use Cargo's `cargo rustc` command to send arguments to `rustc` directly: ``` cargo rustc -- --emit asm ls target/debug/deps/<crate_name>-<hash>.s ``` For optimized assembly: ``` cargo rustc --release -- --emit asm ls target/release/deps/<crate_name>-<hash>.s ``` If you see multiple `<crate_name>-<hash>-<h...
In addition to kennytm's answer, you can also use the `RUSTFLAGS` environment variable and use the standard cargo commands: ```none RUSTFLAGS="--emit asm" cargo build cat target/debug/deps/project_name-hash.s ``` Or in release mode (with optimizations): ```none RUSTFLAGS="--emit asm" cargo build --release cat targe...
39,220,003
I'm having a problem with linking html to CSS. It doesn't work on Google Chrome, but it does on IE. Is there anything wrong with it. By the way, I downloaded the newest version of Google Chrome moments ago. This is my html: ```css body{ background:black; color:white; font-family:arial,helvetica,sans-serif; ...
2016/08/30
[ "https://Stackoverflow.com/questions/39220003", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5189979/" ]
You can use Cargo's `cargo rustc` command to send arguments to `rustc` directly: ``` cargo rustc -- --emit asm ls target/debug/deps/<crate_name>-<hash>.s ``` For optimized assembly: ``` cargo rustc --release -- --emit asm ls target/release/deps/<crate_name>-<hash>.s ``` If you see multiple `<crate_name>-<hash>-<h...
Both existing answers (using `cargo rustc` and `RUSTFLAGS`) are the best ways to obtain assembly with standard tools. If you find yourself trying to look at assembly fairly often, you might want to consider using [**the `cargo asm` subcommand**](https://github.com/gnzlbg/cargo-asm). After installing it with `cargo inst...
39,220,003
I'm having a problem with linking html to CSS. It doesn't work on Google Chrome, but it does on IE. Is there anything wrong with it. By the way, I downloaded the newest version of Google Chrome moments ago. This is my html: ```css body{ background:black; color:white; font-family:arial,helvetica,sans-serif; ...
2016/08/30
[ "https://Stackoverflow.com/questions/39220003", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5189979/" ]
You can use Cargo's `cargo rustc` command to send arguments to `rustc` directly: ``` cargo rustc -- --emit asm ls target/debug/deps/<crate_name>-<hash>.s ``` For optimized assembly: ``` cargo rustc --release -- --emit asm ls target/release/deps/<crate_name>-<hash>.s ``` If you see multiple `<crate_name>-<hash>-<h...
If you just want to look at the assembly output instead of saving it, e.g. to judge if it's well-optimized, then an easy option is to use: <https://rust.godbolt.org/> (don't forget to add `-O` to the Compiler options box)
39,220,003
I'm having a problem with linking html to CSS. It doesn't work on Google Chrome, but it does on IE. Is there anything wrong with it. By the way, I downloaded the newest version of Google Chrome moments ago. This is my html: ```css body{ background:black; color:white; font-family:arial,helvetica,sans-serif; ...
2016/08/30
[ "https://Stackoverflow.com/questions/39220003", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5189979/" ]
In addition to kennytm's answer, you can also use the `RUSTFLAGS` environment variable and use the standard cargo commands: ```none RUSTFLAGS="--emit asm" cargo build cat target/debug/deps/project_name-hash.s ``` Or in release mode (with optimizations): ```none RUSTFLAGS="--emit asm" cargo build --release cat targe...
If you just want to look at the assembly output instead of saving it, e.g. to judge if it's well-optimized, then an easy option is to use: <https://rust.godbolt.org/> (don't forget to add `-O` to the Compiler options box)
39,220,003
I'm having a problem with linking html to CSS. It doesn't work on Google Chrome, but it does on IE. Is there anything wrong with it. By the way, I downloaded the newest version of Google Chrome moments ago. This is my html: ```css body{ background:black; color:white; font-family:arial,helvetica,sans-serif; ...
2016/08/30
[ "https://Stackoverflow.com/questions/39220003", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5189979/" ]
Both existing answers (using `cargo rustc` and `RUSTFLAGS`) are the best ways to obtain assembly with standard tools. If you find yourself trying to look at assembly fairly often, you might want to consider using [**the `cargo asm` subcommand**](https://github.com/gnzlbg/cargo-asm). After installing it with `cargo inst...
If you just want to look at the assembly output instead of saving it, e.g. to judge if it's well-optimized, then an easy option is to use: <https://rust.godbolt.org/> (don't forget to add `-O` to the Compiler options box)
3,995,009
I have form. I have enabled the transparency on the form and I have removed it's Title Bar and Border. Inside that i have created a Custom UI, Which have the same features like a window. Basically, my idea is to create custom window. Everything is working as expected but only the windows dragging is not working. I am ...
2010/10/22
[ "https://Stackoverflow.com/questions/3995009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/321959/" ]
I've implemented this behavior by capturing mousedown (uncapture on mouseup), and then mousemove. Just move the form co-ordinates (left, top), equivalent amounts to the mouse movement (those events have the amount the mouse moved). This worked fine for me.
The easiest way is to process `WM_NCHITTEST` message and return `HTCAPTION` for the portions of your custom window which work like the title bar does in a normal window. Windows will do the rest.
3,995,009
I have form. I have enabled the transparency on the form and I have removed it's Title Bar and Border. Inside that i have created a Custom UI, Which have the same features like a window. Basically, my idea is to create custom window. Everything is working as expected but only the windows dragging is not working. I am ...
2010/10/22
[ "https://Stackoverflow.com/questions/3995009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/321959/" ]
I've implemented this behavior by capturing mousedown (uncapture on mouseup), and then mousemove. Just move the form co-ordinates (left, top), equivalent amounts to the mouse movement (those events have the amount the mouse moved). This worked fine for me.
``` class YourForm : Form { private const int WM_NCHITTEST = 0x84; private const int HTCLIENT = 0x1; private const int HTCAPTION = 0x2; /// /// Handling the window messages /// protected override void WndProc(ref Message message) { base.WndProc(ref message); ...
3,995,009
I have form. I have enabled the transparency on the form and I have removed it's Title Bar and Border. Inside that i have created a Custom UI, Which have the same features like a window. Basically, my idea is to create custom window. Everything is working as expected but only the windows dragging is not working. I am ...
2010/10/22
[ "https://Stackoverflow.com/questions/3995009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/321959/" ]
``` class YourForm : Form { private const int WM_NCHITTEST = 0x84; private const int HTCLIENT = 0x1; private const int HTCAPTION = 0x2; /// /// Handling the window messages /// protected override void WndProc(ref Message message) { base.WndProc(ref message); ...
The easiest way is to process `WM_NCHITTEST` message and return `HTCAPTION` for the portions of your custom window which work like the title bar does in a normal window. Windows will do the rest.
14,411
I am looking for a *sutta* in which something is said--roughly: that unless one has suppressed the hindrances, one cannot see the welfare of self or other. Or that without jhāna one cannot see one's own welfare or anothers.
2016/03/11
[ "https://buddhism.stackexchange.com/questions/14411", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/120/" ]
[Sangaravo Sutta: Sangarava -- The Hindrances (SN 46.55)](http://www.accesstoinsight.org/tipitaka/sn/sn46/sn46.055.wlsh.html) says that. It says that ... > > he cannot know or see, as it really is, what is to his own profit, nor can he know and see what is to the profit of others, or of both himself and others > >...
Just to add to ChrisW's point on the SN 46.55 sutta. The jhanas are implied in that sutta for thru the jhanas, their 5 Jhana Factors are the key antidotes to the abandonement of the Five Hindrances: 1. One-pointedness/ekaggata counter greed 2. Joy/pity counter anger 3. Applied thought/vitakka counter sloth/torpor 4. H...
14,411
I am looking for a *sutta* in which something is said--roughly: that unless one has suppressed the hindrances, one cannot see the welfare of self or other. Or that without jhāna one cannot see one's own welfare or anothers.
2016/03/11
[ "https://buddhism.stackexchange.com/questions/14411", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/120/" ]
[Sangaravo Sutta: Sangarava -- The Hindrances (SN 46.55)](http://www.accesstoinsight.org/tipitaka/sn/sn46/sn46.055.wlsh.html) says that. It says that ... > > he cannot know or see, as it really is, what is to his own profit, nor can he know and see what is to the profit of others, or of both himself and others > >...
With hindrances you do not properly look at one's welfare or others. > > If there is water in a pot mixed with red, yellow, blue or orange color, a man with a normal faculty of sight, looking into it, could not properly recognize and see the image of his own face. *In the same way, when one's mind is possessed by sen...
51,298,879
I have a list of bit: ``` a = 00111001 ``` And do the multiplication for the list: ``` multi = a * 3 ``` It shows the result like this: ``` a = 001110010011100100111001 ``` However, I need the result shows like this, which is each of the bit appear three times consecutively: ``` a = 0000001111111111000000111 ...
2018/07/12
[ "https://Stackoverflow.com/questions/51298879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10040127/" ]
``` >>> a = '00111001' >>> n=3 >>> ''.join(map(lambda x:x*3, a)) '000000111111111000000111' ```
``` s = '00111001' n = 3 ''.join([s[i]*n for i in range(len(s))]) ``` or more succinctly, ``` ''.join(c*n for c in s) ``` but this assumes that your 'list of bit' is a string of characters that can be iterated over. If you have an actual number, then you can convert it into a string first, but you need to know how...
195,114
I'm trying to do a custom button to my form (which has FormBorderStyle = none) using Visual Studio 2005. I have my 3 states button images in an ImageList linked to the button. ``` this.btnClose.AutoSize = false; this.btnClose.BackColor = System.Drawing.Color.Transparent; this.btnClose.BackgroundImageLayout = System.Wi...
2008/10/12
[ "https://Stackoverflow.com/questions/195114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4386/" ]
``` btnClose.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; ```
Hi you simply can apply these changes to your button easily using these two lines of codes. 1. Set the button's FlatStyle to Flat ``` this.btnClose.FlatStyle = FlatStyle.Flat; ``` 2. Set the button's MouseOverBackColor to Transparent ``` this.btnClose.FlatAppearance.MouseOverBackColor = Color.Transparent; ``` Hop...
195,114
I'm trying to do a custom button to my form (which has FormBorderStyle = none) using Visual Studio 2005. I have my 3 states button images in an ImageList linked to the button. ``` this.btnClose.AutoSize = false; this.btnClose.BackColor = System.Drawing.Color.Transparent; this.btnClose.BackgroundImageLayout = System.Wi...
2008/10/12
[ "https://Stackoverflow.com/questions/195114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4386/" ]
I have got one suggestion.Create your own button class deriving from Button.Then override the MouseEnter event in that.Just remove the code for calling the base implementaion. ``` base.OnMouseEnter(e) ``` PS: You won't be able to use the MouseEnter event outside the derived class (e.g. a project using this control)
To solve the problem, Set the MouseOverBackColor to transparent inorder to remove the grey backgroud.
195,114
I'm trying to do a custom button to my form (which has FormBorderStyle = none) using Visual Studio 2005. I have my 3 states button images in an ImageList linked to the button. ``` this.btnClose.AutoSize = false; this.btnClose.BackColor = System.Drawing.Color.Transparent; this.btnClose.BackgroundImageLayout = System.Wi...
2008/10/12
[ "https://Stackoverflow.com/questions/195114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4386/" ]
I've solved this using a label instead of a button. ``` // // imageListButtons // this.imageListButtons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListButtons.ImageStream"))); this.imageListButtons.TransparentColor = System.Drawing.Color.Transparent; this.imageListButtons.Image...
To solve the problem, Set the MouseOverBackColor to transparent inorder to remove the grey backgroud.
195,114
I'm trying to do a custom button to my form (which has FormBorderStyle = none) using Visual Studio 2005. I have my 3 states button images in an ImageList linked to the button. ``` this.btnClose.AutoSize = false; this.btnClose.BackColor = System.Drawing.Color.Transparent; this.btnClose.BackgroundImageLayout = System.Wi...
2008/10/12
[ "https://Stackoverflow.com/questions/195114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4386/" ]
``` btnClose.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; ```
create Mouse Enter event which is given below. ``` private void forAllButtons_MouseEnter(object sender, EventArgs e) { Button b = (Button)sender; b.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; } ``` then assign this event to all the buttons. Happy programming :)
195,114
I'm trying to do a custom button to my form (which has FormBorderStyle = none) using Visual Studio 2005. I have my 3 states button images in an ImageList linked to the button. ``` this.btnClose.AutoSize = false; this.btnClose.BackColor = System.Drawing.Color.Transparent; this.btnClose.BackgroundImageLayout = System.Wi...
2008/10/12
[ "https://Stackoverflow.com/questions/195114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4386/" ]
I've solved this using a label instead of a button. ``` // // imageListButtons // this.imageListButtons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListButtons.ImageStream"))); this.imageListButtons.TransparentColor = System.Drawing.Color.Transparent; this.imageListButtons.Image...
You can also stop changing color of button by deselecting IsHitTestVisible option in Button Properties>common> IsHitTestVisible Maybe this can also help ...
195,114
I'm trying to do a custom button to my form (which has FormBorderStyle = none) using Visual Studio 2005. I have my 3 states button images in an ImageList linked to the button. ``` this.btnClose.AutoSize = false; this.btnClose.BackColor = System.Drawing.Color.Transparent; this.btnClose.BackgroundImageLayout = System.Wi...
2008/10/12
[ "https://Stackoverflow.com/questions/195114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4386/" ]
create Mouse Enter event which is given below. ``` private void forAllButtons_MouseEnter(object sender, EventArgs e) { Button b = (Button)sender; b.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; } ``` then assign this event to all the buttons. Happy programming :)
Hi you simply can apply these changes to your button easily using these two lines of codes. 1. Set the button's FlatStyle to Flat ``` this.btnClose.FlatStyle = FlatStyle.Flat; ``` 2. Set the button's MouseOverBackColor to Transparent ``` this.btnClose.FlatAppearance.MouseOverBackColor = Color.Transparent; ``` Hop...
195,114
I'm trying to do a custom button to my form (which has FormBorderStyle = none) using Visual Studio 2005. I have my 3 states button images in an ImageList linked to the button. ``` this.btnClose.AutoSize = false; this.btnClose.BackColor = System.Drawing.Color.Transparent; this.btnClose.BackgroundImageLayout = System.Wi...
2008/10/12
[ "https://Stackoverflow.com/questions/195114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4386/" ]
The grey background is due to the setting of "System.Windows.Forms.FlatStyle.Flat", it's the default behaviour, since it need to highlight the button when you hover. To eliminate that, you might have to write a custom button class, inherit from the original button and do some custom painting to achieve that. Btw, inst...
I have got one suggestion.Create your own button class deriving from Button.Then override the MouseEnter event in that.Just remove the code for calling the base implementaion. ``` base.OnMouseEnter(e) ``` PS: You won't be able to use the MouseEnter event outside the derived class (e.g. a project using this control)
195,114
I'm trying to do a custom button to my form (which has FormBorderStyle = none) using Visual Studio 2005. I have my 3 states button images in an ImageList linked to the button. ``` this.btnClose.AutoSize = false; this.btnClose.BackColor = System.Drawing.Color.Transparent; this.btnClose.BackgroundImageLayout = System.Wi...
2008/10/12
[ "https://Stackoverflow.com/questions/195114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4386/" ]
You can also stop changing color of button by deselecting IsHitTestVisible option in Button Properties>common> IsHitTestVisible Maybe this can also help ...
To solve the problem, Set the MouseOverBackColor to transparent inorder to remove the grey backgroud.
195,114
I'm trying to do a custom button to my form (which has FormBorderStyle = none) using Visual Studio 2005. I have my 3 states button images in an ImageList linked to the button. ``` this.btnClose.AutoSize = false; this.btnClose.BackColor = System.Drawing.Color.Transparent; this.btnClose.BackgroundImageLayout = System.Wi...
2008/10/12
[ "https://Stackoverflow.com/questions/195114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4386/" ]
``` btnClose.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; ```
I've solved this using a label instead of a button. ``` // // imageListButtons // this.imageListButtons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListButtons.ImageStream"))); this.imageListButtons.TransparentColor = System.Drawing.Color.Transparent; this.imageListButtons.Image...
195,114
I'm trying to do a custom button to my form (which has FormBorderStyle = none) using Visual Studio 2005. I have my 3 states button images in an ImageList linked to the button. ``` this.btnClose.AutoSize = false; this.btnClose.BackColor = System.Drawing.Color.Transparent; this.btnClose.BackgroundImageLayout = System.Wi...
2008/10/12
[ "https://Stackoverflow.com/questions/195114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4386/" ]
I have got one suggestion.Create your own button class deriving from Button.Then override the MouseEnter event in that.Just remove the code for calling the base implementaion. ``` base.OnMouseEnter(e) ``` PS: You won't be able to use the MouseEnter event outside the derived class (e.g. a project using this control)
You can also stop changing color of button by deselecting IsHitTestVisible option in Button Properties>common> IsHitTestVisible Maybe this can also help ...
1,096,396
My use case is that I'm just making a website that I want people all over the world to be able to use, and I want to be able to say things like "This happened at 5:33pm on October 5" and also "This happened 5 minutes ago," etc. Should I use the datetime module? Or just strftime? Or something fancier that isn't part o...
2009/07/08
[ "https://Stackoverflow.com/questions/1096396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83898/" ]
If you're going to use `datetime`, make sure you read this recent and most excellent article: [Tips on using python's datetime module](http://www.enricozini.org/2009/debian/using-python-datetime/). `datetime` will take care of most of the niceties of handling time arithmetic, but it won't give you the English-language...
There is also the [Time module](http://docs.python.org/library/time.html).
1,096,396
My use case is that I'm just making a website that I want people all over the world to be able to use, and I want to be able to say things like "This happened at 5:33pm on October 5" and also "This happened 5 minutes ago," etc. Should I use the datetime module? Or just strftime? Or something fancier that isn't part o...
2009/07/08
[ "https://Stackoverflow.com/questions/1096396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83898/" ]
You may have a look at Django's [humanize module](http://docs.djangoproject.com/en/dev/ref/contrib/humanize/#ref-contrib-humanize). It is part of Django, but I think it would be quite easy to adapt it to your needs.
Try [relativeDates Module](http://jehiah.cz/archive/printing-relative-dates-in-python) module. It exactly brings you the stuff you wanted.
1,096,396
My use case is that I'm just making a website that I want people all over the world to be able to use, and I want to be able to say things like "This happened at 5:33pm on October 5" and also "This happened 5 minutes ago," etc. Should I use the datetime module? Or just strftime? Or something fancier that isn't part o...
2009/07/08
[ "https://Stackoverflow.com/questions/1096396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83898/" ]
You may have a look at Django's [humanize module](http://docs.djangoproject.com/en/dev/ref/contrib/humanize/#ref-contrib-humanize). It is part of Django, but I think it would be quite easy to adapt it to your needs.
I have always been very happy using the datetime package. You get a lot of stuff for free, and it's pretty easy to create datetime objects as well, calculate duration ect.
1,096,396
My use case is that I'm just making a website that I want people all over the world to be able to use, and I want to be able to say things like "This happened at 5:33pm on October 5" and also "This happened 5 minutes ago," etc. Should I use the datetime module? Or just strftime? Or something fancier that isn't part o...
2009/07/08
[ "https://Stackoverflow.com/questions/1096396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83898/" ]
Take a look at the dateutil module: <http://labix.org/python-dateutil> It's good at doing the types of things you're looking for - see some of the examples in the documentation.
There is also the [Time module](http://docs.python.org/library/time.html).
1,096,396
My use case is that I'm just making a website that I want people all over the world to be able to use, and I want to be able to say things like "This happened at 5:33pm on October 5" and also "This happened 5 minutes ago," etc. Should I use the datetime module? Or just strftime? Or something fancier that isn't part o...
2009/07/08
[ "https://Stackoverflow.com/questions/1096396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83898/" ]
The datetime module in Python will allow you to get/set/manipulate dates and times. A question about relative date formatting in Python has already been asked: [Stack Overflow Post](https://stackoverflow.com/questions/410221/natural-relative-days-in-python) but with very little responce.
There is also the [Time module](http://docs.python.org/library/time.html).
1,096,396
My use case is that I'm just making a website that I want people all over the world to be able to use, and I want to be able to say things like "This happened at 5:33pm on October 5" and also "This happened 5 minutes ago," etc. Should I use the datetime module? Or just strftime? Or something fancier that isn't part o...
2009/07/08
[ "https://Stackoverflow.com/questions/1096396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83898/" ]
The datetime module in Python will allow you to get/set/manipulate dates and times. A question about relative date formatting in Python has already been asked: [Stack Overflow Post](https://stackoverflow.com/questions/410221/natural-relative-days-in-python) but with very little responce.
I have always been very happy using the datetime package. You get a lot of stuff for free, and it's pretty easy to create datetime objects as well, calculate duration ect.