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
53,559,587
I have a short bit of code that needs to run for a long long time. I am wondering if the length of the variable's names that I use can alter the speed at which the program executes. Here is a very simple example written in Python. Program A ``` x = 1 while not x == 0: print('message') ``` Program ...
2018/11/30
[ "https://Stackoverflow.com/questions/53559587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8896653/" ]
The results that @chepner mentioned are correct, Python can take longer to run the code in the console, but once the code is compiled the results are the same. To make sure that this is correct, I created the following code also inspired by the answer from @knifer: ``` from time import time from numpy import average,...
The difference is very small and we cant conclude that is because of name of variable. ``` import timeit x=1 xyz=1 start_time = timeit.default_timer() for i in range(1,1000000): if x==1: print("message") elapsed = timeit.default_timer() - start_time start_time2 = timeit.default_timer() for i in range(1,1...
3,407,525
Suppose I have D, an X-by-Y-by-Z data matrix. I also have M, an X-by-Y "masking" matrix. My goal is to set the elements (Xi,Yi,:) in D to NaN when (Xi,Yi) in M is false. Is there any way to avoid doing this in a loop? I tried using `ind2sub`, but that fails: ``` M = logical(round(rand(3,3))); % mask D = randn(3,3,2);...
2010/08/04
[ "https://Stackoverflow.com/questions/3407525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/408268/" ]
You can do this by replicating your logical mask `M` across the third dimension using [REPMAT](http://www.mathworks.com/access/helpdesk/help/techdoc/ref/repmat.html) so that it is the same size as `D`. Then, index away: ``` D_masked = D; D_masked(repmat(~M,[1 1 size(D,3)])) = NaN; ``` If replicating the mask matrix ...
My Matlab is a bit rusty but I think logical indexing should work: ``` D_masked = D; D_masked[ M ] = NaN; ``` (which probably can be combined into one statement with a conditional expression on the rhs...)
3,407,525
Suppose I have D, an X-by-Y-by-Z data matrix. I also have M, an X-by-Y "masking" matrix. My goal is to set the elements (Xi,Yi,:) in D to NaN when (Xi,Yi) in M is false. Is there any way to avoid doing this in a loop? I tried using `ind2sub`, but that fails: ``` M = logical(round(rand(3,3))); % mask D = randn(3,3,2);...
2010/08/04
[ "https://Stackoverflow.com/questions/3407525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/408268/" ]
Reshape is [basically for free](https://stackoverflow.com/q/36062574/2732801), you can use it here for an efficient solution. reducing the whole to a 2d problem. ``` sz=size(D); D=reshape(D,[],sz(3)); %reshape to 2d D(isnan(M(:)),:)=nan; %perform the operation on the 2d matrix D=reshape(D,sz); %reshape back to 3d ```
My Matlab is a bit rusty but I think logical indexing should work: ``` D_masked = D; D_masked[ M ] = NaN; ``` (which probably can be combined into one statement with a conditional expression on the rhs...)
3,407,525
Suppose I have D, an X-by-Y-by-Z data matrix. I also have M, an X-by-Y "masking" matrix. My goal is to set the elements (Xi,Yi,:) in D to NaN when (Xi,Yi) in M is false. Is there any way to avoid doing this in a loop? I tried using `ind2sub`, but that fails: ``` M = logical(round(rand(3,3))); % mask D = randn(3,3,2);...
2010/08/04
[ "https://Stackoverflow.com/questions/3407525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/408268/" ]
You can do this by replicating your logical mask `M` across the third dimension using [REPMAT](http://www.mathworks.com/access/helpdesk/help/techdoc/ref/repmat.html) so that it is the same size as `D`. Then, index away: ``` D_masked = D; D_masked(repmat(~M,[1 1 size(D,3)])) = NaN; ``` If replicating the mask matrix ...
Reshape is [basically for free](https://stackoverflow.com/q/36062574/2732801), you can use it here for an efficient solution. reducing the whole to a 2d problem. ``` sz=size(D); D=reshape(D,[],sz(3)); %reshape to 2d D(isnan(M(:)),:)=nan; %perform the operation on the 2d matrix D=reshape(D,sz); %reshape back to 3d ```
142,564
I have a use case in a modal where the user can select forms and define criteria based off of what they have selected. All of the criteria dependencies based off what form the user has selected remain the same in 90% of the use cases, but I have identified a new edge case where the dependencies may change. Do you thin...
2022/02/18
[ "https://ux.stackexchange.com/questions/142564", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/141746/" ]
Progressive disclosure is meant to divide the UI into manageable chunks so as not to overwhelm the user with too many options and choices all at once. It's not meant to isolate each decision into a step of its own (that would be a wizard, and quite a tedious one). There's nothing wrong with dynamically changing the UI ...
If Normal Form fits 90% of cases, it should be the default. But, if the user realizes after filling out the fields that Form With Tags would have been the better selection, they might be frustrated with going back and filling in different options - wasted effort. I would recommend changing the Select Form Type dropdow...
19,209,113
Here is my code : ``` Public Class Form1 Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If ComboBox1....
2013/10/06
[ "https://Stackoverflow.com/questions/19209113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2792832/" ]
Use the following way to show the select2 for your Gridview column, hope it helps. ``` array( 'name'=>'category_id', 'type'=>'html', 'value'=>'select2::activeDropDown($model,"my_select",CHtml::listData($dataToShowFromModel,"field_name_for_value","field_name_for_text"),array("empty"=>"","p...
See examples of this [Yii Gridview](http://yii.codexamples.com/v1.1/CGridView/) **In view e.g: admin.php** ``` $this->widget('zii.widgets.grid.CGridView', array( 'dataProvider'=>$dataProvider, 'columns'=>array( 'title', // display the 'title' attribute 'content:html', // display the...
19,209,113
Here is my code : ``` Public Class Form1 Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If ComboBox1....
2013/10/06
[ "https://Stackoverflow.com/questions/19209113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2792832/" ]
I have created a class extending the CDataColumn to add a filter to the column: ``` Yii::import('zii.widgets.grid.CDataColumn'); class TbTableDeviceType extends CDataColumn { public $model; public $fieldName; public function init() { $ajaxUpdate = $this->grid->afterAjaxUpdate; $this->grid...
See examples of this [Yii Gridview](http://yii.codexamples.com/v1.1/CGridView/) **In view e.g: admin.php** ``` $this->widget('zii.widgets.grid.CGridView', array( 'dataProvider'=>$dataProvider, 'columns'=>array( 'title', // display the 'title' attribute 'content:html', // display the...
70,595,234
``` propSet = childRes.getValueMap().keySet(); ``` **Above code written in java can anyone help me to write mock in mockito in junit**
2022/01/05
[ "https://Stackoverflow.com/questions/70595234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15764925/" ]
It seems there is some conflict between Windows 10 Pro and Office 2019 Professional and using port 25 for smtp.office365.com. As mentioned I have several PC's with combinations of Windows 10 Pro/Home and Office 2019 and Office 365 and all of these worked. However, the specific combination of Office 2019 Professional a...
Try to add the configuration field bellow to the ones you are setting: ``` .Item("http://schemas.microsoft.com/cdo/configuration/sendtls") = True ``` Also, try to change the port from 25 to 465 or 587.
841,479
Assuming a single page application accessed initially via HTTP that uses AJAX for all server interaction, is it possible to use HTTP for regular data transfers and then switch to AJAXian HTTPS requests for secure data transfers? If so, how would the browser handle the certificate and locking notification when a HTTPS...
2009/05/08
[ "https://Stackoverflow.com/questions/841479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/103750/" ]
Attempting to switch protocols will violate the [same origin policy](http://en.wikipedia.org/wiki/Same_origin_policy). I am not sure how a workaround using iFrames would behave, but I think the browser may block access to the frame that was loaded as HTTPS, again due to the same origin policy.
I know this is old post but since i arrived here by search engine it would be a worth to spill what I've learn. It is possible to use something called [CORS](http://en.wikipedia.org/wiki/Cross-Origin_Resource_Sharing) but as usual old MSIE has problem [implementing it](http://caniuse.com/#search=cors). It should be s...
14,136,241
4 and JSF 2.1 , Tomcat6 for a sample application. I was trying to show a dailog box when clicked on a image inside a ui:composition. But it is not getting displayed. And if i run that without using the ui:composition> it is working fine. This is my code ``` <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE html ...
2013/01/03
[ "https://Stackoverflow.com/questions/14136241", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1944615/" ]
Facelets skips everything outside the `<ui:composition>` tag, so the dialog will simply not be present in the view in this case. You need to put it also in the `<ui:composition>` tag
hello try the rendered Property by binding it with a boolean variable. Thanks
43,007,176
I am trying to make my selector so when it gets the class of transform with the tagname with p, it will do some event in my case it is mouse hovering but i am having trouble with it. I know there are jquery solutions but i am doing it with pure javascript. here is the code below currently ``` var hoverEvent = documen...
2017/03/24
[ "https://Stackoverflow.com/questions/43007176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6031896/" ]
You can use a CSS selector in `querySelectorAll` to find all paragraphs with that classname: ``` var hoverEvent = document.querySelectorAll("p.transform"); ```
``` var transformPs = document.querySelectorAll("p.transform"); for (let i = 0; i < transformPs .length; i++) { // on mouse over transformPs[i].onmouseover = function () { this.style.color = "yellow"; // changes paragraph with class of transform to yellow during hover }; // on mouse...
43,007,176
I am trying to make my selector so when it gets the class of transform with the tagname with p, it will do some event in my case it is mouse hovering but i am having trouble with it. I know there are jquery solutions but i am doing it with pure javascript. here is the code below currently ``` var hoverEvent = documen...
2017/03/24
[ "https://Stackoverflow.com/questions/43007176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6031896/" ]
You can use a CSS selector in `querySelectorAll` to find all paragraphs with that classname: ``` var hoverEvent = document.querySelectorAll("p.transform"); ```
The vanilla JavaScript equivalent would be using [`document.querySelectorAll`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll): ```js function turnYellow (e) { e.target.style.color = 'yellow' } function turnBlack (e) { e.target.style.color = '' } document.querySelectorAll('p.transform')...
43,007,176
I am trying to make my selector so when it gets the class of transform with the tagname with p, it will do some event in my case it is mouse hovering but i am having trouble with it. I know there are jquery solutions but i am doing it with pure javascript. here is the code below currently ``` var hoverEvent = documen...
2017/03/24
[ "https://Stackoverflow.com/questions/43007176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6031896/" ]
You can use a CSS selector in `querySelectorAll` to find all paragraphs with that classname: ``` var hoverEvent = document.querySelectorAll("p.transform"); ```
you can use **classList** to check class of element ``` var p = document.getElementsByTagName("p"); if (p.classList.contains('transform')){ // do whatever you want to do } ```
14,120,999
Why is my jquery not replacing all spaces with a `'-'`. It only replaces the first space with a `'-'` ``` $('.modhForm').submit(function(event) { var $this = $(this), action = $this.attr('action'), query = $this.find('.topsearchbar').val(); // Use val() instead of attr('value'). ...
2013/01/02
[ "https://Stackoverflow.com/questions/14120999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407503/" ]
It's: "if (action.length >= 2 && query.length >= 2 && **query.length** <=24) {" Not: "if (action.length >= 2 && query.length >= 2 && **query.lenght** <=24) {"
Replace all whitespace (including tabs, spaces, ...): ``` query.replace(/\s/g, '_'); ```
14,120,999
Why is my jquery not replacing all spaces with a `'-'`. It only replaces the first space with a `'-'` ``` $('.modhForm').submit(function(event) { var $this = $(this), action = $this.attr('action'), query = $this.find('.topsearchbar').val(); // Use val() instead of attr('value'). ...
2013/01/02
[ "https://Stackoverflow.com/questions/14120999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407503/" ]
Try this: ``` var str = 'a b c'; var replaced = str.split(' ').join('-'); ```
`String.prototype.replace` only replaces the first when its first argument is a string. To replace all occurrences you need to pass in a global regular expression as the first argument. > > [`replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace?redirectlocale=en-US...
14,120,999
Why is my jquery not replacing all spaces with a `'-'`. It only replaces the first space with a `'-'` ``` $('.modhForm').submit(function(event) { var $this = $(this), action = $this.attr('action'), query = $this.find('.topsearchbar').val(); // Use val() instead of attr('value'). ...
2013/01/02
[ "https://Stackoverflow.com/questions/14120999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407503/" ]
Try this: ``` var str = 'a b c'; var replaced = str.split(' ').join('-'); ```
Try this ``` query.replace(/ +(?= )/g,'-'); ``` This still works, in case your query is `undefinied` or `NaN`
14,120,999
Why is my jquery not replacing all spaces with a `'-'`. It only replaces the first space with a `'-'` ``` $('.modhForm').submit(function(event) { var $this = $(this), action = $this.attr('action'), query = $this.find('.topsearchbar').val(); // Use val() instead of attr('value'). ...
2013/01/02
[ "https://Stackoverflow.com/questions/14120999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407503/" ]
It's: "if (action.length >= 2 && query.length >= 2 && **query.length** <=24) {" Not: "if (action.length >= 2 && query.length >= 2 && **query.lenght** <=24) {"
You can try with custom function ``` String.prototype.replaceAll = function (searchText, replacementText) { return this.split(searchText).join(replacementText); }; var text = "This is Sample Text"; text.replaceAll(" ", "-"); //final output(This-is-Sample-Text) ```
14,120,999
Why is my jquery not replacing all spaces with a `'-'`. It only replaces the first space with a `'-'` ``` $('.modhForm').submit(function(event) { var $this = $(this), action = $this.attr('action'), query = $this.find('.topsearchbar').val(); // Use val() instead of attr('value'). ...
2013/01/02
[ "https://Stackoverflow.com/questions/14120999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407503/" ]
You can try with custom function ``` String.prototype.replaceAll = function (searchText, replacementText) { return this.split(searchText).join(replacementText); }; var text = "This is Sample Text"; text.replaceAll(" ", "-"); //final output(This-is-Sample-Text) ```
Try this ``` query.replace(/ +(?= )/g,'-'); ``` This still works, in case your query is `undefinied` or `NaN`
14,120,999
Why is my jquery not replacing all spaces with a `'-'`. It only replaces the first space with a `'-'` ``` $('.modhForm').submit(function(event) { var $this = $(this), action = $this.attr('action'), query = $this.find('.topsearchbar').val(); // Use val() instead of attr('value'). ...
2013/01/02
[ "https://Stackoverflow.com/questions/14120999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407503/" ]
Try with this: ``` .replace(/\s/g,"-"); ``` Demo: [JSFiddle](http://jsfiddle.net/vYnxm/3/) ----------------------------------------------
Try this: ``` var str = 'a b c'; var replaced = str.split(' ').join('-'); ```
14,120,999
Why is my jquery not replacing all spaces with a `'-'`. It only replaces the first space with a `'-'` ``` $('.modhForm').submit(function(event) { var $this = $(this), action = $this.attr('action'), query = $this.find('.topsearchbar').val(); // Use val() instead of attr('value'). ...
2013/01/02
[ "https://Stackoverflow.com/questions/14120999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407503/" ]
Try this: ``` var str = 'a b c'; var replaced = str.split(' ').join('-'); ```
Replace all whitespace (including tabs, spaces, ...): ``` query.replace(/\s/g, '_'); ```
14,120,999
Why is my jquery not replacing all spaces with a `'-'`. It only replaces the first space with a `'-'` ``` $('.modhForm').submit(function(event) { var $this = $(this), action = $this.attr('action'), query = $this.find('.topsearchbar').val(); // Use val() instead of attr('value'). ...
2013/01/02
[ "https://Stackoverflow.com/questions/14120999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407503/" ]
Try this: ``` var str = 'a b c'; var replaced = str.split(' ').join('-'); ```
You can try with custom function ``` String.prototype.replaceAll = function (searchText, replacementText) { return this.split(searchText).join(replacementText); }; var text = "This is Sample Text"; text.replaceAll(" ", "-"); //final output(This-is-Sample-Text) ```
14,120,999
Why is my jquery not replacing all spaces with a `'-'`. It only replaces the first space with a `'-'` ``` $('.modhForm').submit(function(event) { var $this = $(this), action = $this.attr('action'), query = $this.find('.topsearchbar').val(); // Use val() instead of attr('value'). ...
2013/01/02
[ "https://Stackoverflow.com/questions/14120999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407503/" ]
Try with this: ``` .replace(/\s/g,"-"); ``` Demo: [JSFiddle](http://jsfiddle.net/vYnxm/3/) ----------------------------------------------
You can try with custom function ``` String.prototype.replaceAll = function (searchText, replacementText) { return this.split(searchText).join(replacementText); }; var text = "This is Sample Text"; text.replaceAll(" ", "-"); //final output(This-is-Sample-Text) ```
14,120,999
Why is my jquery not replacing all spaces with a `'-'`. It only replaces the first space with a `'-'` ``` $('.modhForm').submit(function(event) { var $this = $(this), action = $this.attr('action'), query = $this.find('.topsearchbar').val(); // Use val() instead of attr('value'). ...
2013/01/02
[ "https://Stackoverflow.com/questions/14120999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407503/" ]
Use a [regular expression](https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Regular_Expressions) to replace all occurences : ``` query.replace(/\ /g, '-') ```
`String.prototype.replace` only replaces the first when its first argument is a string. To replace all occurrences you need to pass in a global regular expression as the first argument. > > [`replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace?redirectlocale=en-US...
26,025
Will generally accepted papers appear in conferences proceeding without presentation? In particular my paper is accepted for [**this**](http://www.greenorbs.org/TrustCom2014) conference. In the conference web site they pointed out: "Accepted and presented papers will be included in the IEEE CPS Proceedings." In its reg...
2014/07/17
[ "https://academia.stackexchange.com/questions/26025", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/1070/" ]
The [IEEE policy on non-presented papers](http://www.ieee.org/conferences_events/conferences/organizers/handling_nonpresented_papers.html) is as follows: > > Authors are expected to attend the conference in person to present their papers and share their ideas. > > > To encourage attendance, IEEE recommends that con...
In general, at least for the better conferences in the computing and information science research area that I find myself working in, if your paper is **accepted** and at least one author has **registered** for the conference, then your paper will be included in the conference proceedings and available in the usual arc...
4,848,266
I have 4 Paragraph tags inside a div with id=address I want to append a character to this paragraph from a string array. I want that each character should be added after a finite delay. here is the code snippet: ``` $("#address p").each(function(index) { var t_delay = 0; for (var i=0; i<arr[index].length;...
2011/01/31
[ "https://Stackoverflow.com/questions/4848266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/596446/" ]
No jQuery is required. ``` var reps = { UN: "Ali", LC: "Turkey", AG: "29", ... }; return str.replace(/\[(\w+)\]/g, function(s, key) { return reps[key] || s; }); ``` * The regex `/\[(\w+)\]/g` finds all substrings of the form `[XYZ]`. * Whenever such a pattern is found, the function in the 2nd parameter o...
You can do: ``` var array = {"UN":"ALI", "LC":"Turkey", "AG":"29"}; for (var val in array) { str = str.split(val).join(array[val]); } ```
2,703,993
Is there easy way how to round floating numbers in a file to equal length? The file contains other text not only numbers. ``` before: bla bla bla 3.4689 bla bla bla 4.39223 bla. after: bla bla bla 3.47 bla bla bla 4.39 bla. ``` Thanks
2010/04/24
[ "https://Stackoverflow.com/questions/2703993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/282849/" ]
Bash ``` #!/bin/bash shopt -s extglob while read -r line do set -- $line for((i=1;i<=${#};i++)) do s=$(eval echo \${${i}}) case "$s" in +([0-9]).+([0-9]) ) s=$(printf "%.2f " $s);; esac printf "%s " $s done echo done <"file" ``` output ``` $ cat file bla1 bla 2 bla 3.4689 bla bla bla ...
`awk BEGIN{RS="[[:space:]]"} /[0-9].[0-9]/{printf("%.2f%s",$1,RT)} !/[0-9].[0-9]/{printf("%s%s",$1,RT)} f.txt` You might want to change RS to something that can handle a more robust set of word boundaries. This solution has the advantage of preserving the boundary rather than just reprinting the output separated by sp...
68,462,288
Simply put, I am in a entry level computer science class, with the assignment based on fixing the html and javascript files below to create four separate working calculators. As far as I understand, however, I cannot find any formatting issues that prevent the two files from influencing each other, at least in terms of...
2021/07/20
[ "https://Stackoverflow.com/questions/68462288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16491313/" ]
No(t really). You have two fundamental issues here. Primitives don't play the dynamic typing game. ---------------------------------------------- If you have e.g. a `StringCharacteristic` (note that in java we `WriteTypesLikeThis`, not `likeThis`) and a `LocalDateCharacteristic` it's all object refs and we can gener...
Exactly how useful this is depends on what the client wants to do with instances of `Characteristic`, that is when it can't tell what concrete class they are. If there are cases where (for instance) you want to show the names of a set of `Characteristic`s, and perhaps a `toString` of their values, then this will be us...
19,436,277
I am writing an ember app, and not using rails nor grunt for anything. I previously had a short python program that took text files and did some `markdown` stuff with them, and then compiled them all to a `templates.js` file using `ember-precompile`: ``` ember-precompile templates/*.hbs -f templates/templates.js ``` ...
2013/10/17
[ "https://Stackoverflow.com/questions/19436277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/988335/" ]
``` var $this = $(this); $('p a').each(function(){ $this.append('<option value="">' + $(this).text() + '</option>'); }); ``` <http://jsfiddle.net/QgCqE/1/>
No need for a function unless you are planning to use it for sever drop downs. ``` var ddl = $("#select"); $("p a").each(function () { var link = $(this); ddl.append($("<option></option>").val(link.text()).html(link.text())); }); ```
19,436,277
I am writing an ember app, and not using rails nor grunt for anything. I previously had a short python program that took text files and did some `markdown` stuff with them, and then compiled them all to a `templates.js` file using `ember-precompile`: ``` ember-precompile templates/*.hbs -f templates/templates.js ``` ...
2013/10/17
[ "https://Stackoverflow.com/questions/19436277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/988335/" ]
A **Cleaner and more jQuery-oriented solution** of *James Montagne*'s answer: ``` $this.append( $('<option/>').val('').text($(this).text()) ); ``` or the alternative with properties mapping: ``` $this.append($("<option/>", { value: '', text: $(this).text() })); ```
To make the loop in your elements use [$.each](http://api.jquery.com/each/) --- You dont need extend jQuery unless you want to make it reusable. `[**LIVE DEMO**](http://jsfiddle.net/pT6rs/)` ``` $.fn.populate = function(el) { var options = ''; $(el).each(function(i, e) { options += '<option>' + $(thi...
19,436,277
I am writing an ember app, and not using rails nor grunt for anything. I previously had a short python program that took text files and did some `markdown` stuff with them, and then compiled them all to a `templates.js` file using `ember-precompile`: ``` ember-precompile templates/*.hbs -f templates/templates.js ``` ...
2013/10/17
[ "https://Stackoverflow.com/questions/19436277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/988335/" ]
<http://jsfiddle.net/kasperfish/RY3U9/4/> ``` var selectbox=$("#select");//cache our slectbox, so jquery doesn't have to look for it in every loop. $('p > a').each(function(){//select all a tags in p (loop through them) var text=$(this).text();//cache the link text in a variable because we need it twice. sele...
No need for a function unless you are planning to use it for sever drop downs. ``` var ddl = $("#select"); $("p a").each(function () { var link = $(this); ddl.append($("<option></option>").val(link.text()).html(link.text())); }); ```
19,436,277
I am writing an ember app, and not using rails nor grunt for anything. I previously had a short python program that took text files and did some `markdown` stuff with them, and then compiled them all to a `templates.js` file using `ember-precompile`: ``` ember-precompile templates/*.hbs -f templates/templates.js ``` ...
2013/10/17
[ "https://Stackoverflow.com/questions/19436277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/988335/" ]
``` $('#new_organizations').click(loadOrgTypes); function loadOrgTypes() { console.log('retrieving all Org Types'); $.ajax({ type: 'GET', url: rootURL+'org_types', dataType: "json", // data type of response success: renderOrgTypes, error: function(err){ console.log('Error'); co...
To make the loop in your elements use [$.each](http://api.jquery.com/each/) --- You dont need extend jQuery unless you want to make it reusable. `[**LIVE DEMO**](http://jsfiddle.net/pT6rs/)` ``` $.fn.populate = function(el) { var options = ''; $(el).each(function(i, e) { options += '<option>' + $(thi...
19,436,277
I am writing an ember app, and not using rails nor grunt for anything. I previously had a short python program that took text files and did some `markdown` stuff with them, and then compiled them all to a `templates.js` file using `ember-precompile`: ``` ember-precompile templates/*.hbs -f templates/templates.js ``` ...
2013/10/17
[ "https://Stackoverflow.com/questions/19436277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/988335/" ]
A **Cleaner and more jQuery-oriented solution** of *James Montagne*'s answer: ``` $this.append( $('<option/>').val('').text($(this).text()) ); ``` or the alternative with properties mapping: ``` $this.append($("<option/>", { value: '', text: $(this).text() })); ```
No need for a function unless you are planning to use it for sever drop downs. ``` var ddl = $("#select"); $("p a").each(function () { var link = $(this); ddl.append($("<option></option>").val(link.text()).html(link.text())); }); ```
19,436,277
I am writing an ember app, and not using rails nor grunt for anything. I previously had a short python program that took text files and did some `markdown` stuff with them, and then compiled them all to a `templates.js` file using `ember-precompile`: ``` ember-precompile templates/*.hbs -f templates/templates.js ``` ...
2013/10/17
[ "https://Stackoverflow.com/questions/19436277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/988335/" ]
<http://jsfiddle.net/kasperfish/RY3U9/4/> ``` var selectbox=$("#select");//cache our slectbox, so jquery doesn't have to look for it in every loop. $('p > a').each(function(){//select all a tags in p (loop through them) var text=$(this).text();//cache the link text in a variable because we need it twice. sele...
To make the loop in your elements use [$.each](http://api.jquery.com/each/) --- You dont need extend jQuery unless you want to make it reusable. `[**LIVE DEMO**](http://jsfiddle.net/pT6rs/)` ``` $.fn.populate = function(el) { var options = ''; $(el).each(function(i, e) { options += '<option>' + $(thi...
19,436,277
I am writing an ember app, and not using rails nor grunt for anything. I previously had a short python program that took text files and did some `markdown` stuff with them, and then compiled them all to a `templates.js` file using `ember-precompile`: ``` ember-precompile templates/*.hbs -f templates/templates.js ``` ...
2013/10/17
[ "https://Stackoverflow.com/questions/19436277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/988335/" ]
``` var $this = $(this); $('p a').each(function(){ $this.append('<option value="">' + $(this).text() + '</option>'); }); ``` <http://jsfiddle.net/QgCqE/1/>
<http://jsfiddle.net/kasperfish/RY3U9/4/> ``` var selectbox=$("#select");//cache our slectbox, so jquery doesn't have to look for it in every loop. $('p > a').each(function(){//select all a tags in p (loop through them) var text=$(this).text();//cache the link text in a variable because we need it twice. sele...
19,436,277
I am writing an ember app, and not using rails nor grunt for anything. I previously had a short python program that took text files and did some `markdown` stuff with them, and then compiled them all to a `templates.js` file using `ember-precompile`: ``` ember-precompile templates/*.hbs -f templates/templates.js ``` ...
2013/10/17
[ "https://Stackoverflow.com/questions/19436277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/988335/" ]
``` $('#new_organizations').click(loadOrgTypes); function loadOrgTypes() { console.log('retrieving all Org Types'); $.ajax({ type: 'GET', url: rootURL+'org_types', dataType: "json", // data type of response success: renderOrgTypes, error: function(err){ console.log('Error'); co...
No need for a function unless you are planning to use it for sever drop downs. ``` var ddl = $("#select"); $("p a").each(function () { var link = $(this); ddl.append($("<option></option>").val(link.text()).html(link.text())); }); ```
19,436,277
I am writing an ember app, and not using rails nor grunt for anything. I previously had a short python program that took text files and did some `markdown` stuff with them, and then compiled them all to a `templates.js` file using `ember-precompile`: ``` ember-precompile templates/*.hbs -f templates/templates.js ``` ...
2013/10/17
[ "https://Stackoverflow.com/questions/19436277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/988335/" ]
``` var $this = $(this); $('p a').each(function(){ $this.append('<option value="">' + $(this).text() + '</option>'); }); ``` <http://jsfiddle.net/QgCqE/1/>
A **Cleaner and more jQuery-oriented solution** of *James Montagne*'s answer: ``` $this.append( $('<option/>').val('').text($(this).text()) ); ``` or the alternative with properties mapping: ``` $this.append($("<option/>", { value: '', text: $(this).text() })); ```
19,436,277
I am writing an ember app, and not using rails nor grunt for anything. I previously had a short python program that took text files and did some `markdown` stuff with them, and then compiled them all to a `templates.js` file using `ember-precompile`: ``` ember-precompile templates/*.hbs -f templates/templates.js ``` ...
2013/10/17
[ "https://Stackoverflow.com/questions/19436277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/988335/" ]
``` var $this = $(this); $('p a').each(function(){ $this.append('<option value="">' + $(this).text() + '</option>'); }); ``` <http://jsfiddle.net/QgCqE/1/>
To make the loop in your elements use [$.each](http://api.jquery.com/each/) --- You dont need extend jQuery unless you want to make it reusable. `[**LIVE DEMO**](http://jsfiddle.net/pT6rs/)` ``` $.fn.populate = function(el) { var options = ''; $(el).each(function(i, e) { options += '<option>' + $(thi...
766,372
How do I make a python regex like `"(.*)"` such that, given `"a (b) c (d) e"` python matches `"b"` instead of `"b) c (d"`? I know that I can use `"[^)]"` instead of `"."`, but I'm looking for a more general solution that keeps my regex a little cleaner. Is there any way to tell python "hey, match this as soon as possi...
2009/04/19
[ "https://Stackoverflow.com/questions/766372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83435/" ]
You seek the all-powerful `*?` From the docs, [Greedy versus Non-Greedy](http://docs.python.org/3/howto/regex.html#greedy-versus-non-greedy) > > the non-greedy qualifiers `*?`, `+?`, `??`, or `{m,n}?` [...] match as *little* > text as possible. > > >
Using an ungreedy match is a good start, but I'd also suggest that you reconsider any use of `.*` -- what about this? ``` groups = re.search(r"\([^)]*\)", x) ```
766,372
How do I make a python regex like `"(.*)"` such that, given `"a (b) c (d) e"` python matches `"b"` instead of `"b) c (d"`? I know that I can use `"[^)]"` instead of `"."`, but I'm looking for a more general solution that keeps my regex a little cleaner. Is there any way to tell python "hey, match this as soon as possi...
2009/04/19
[ "https://Stackoverflow.com/questions/766372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83435/" ]
Using an ungreedy match is a good start, but I'd also suggest that you reconsider any use of `.*` -- what about this? ``` groups = re.search(r"\([^)]*\)", x) ```
To start with, I do not suggest using "\*" in regexes. Yes, I know, it is the most used multi-character delimiter, but it is nevertheless a bad idea. This is because, while it does match any amount of repetition for that character, "any" includes 0, which is usually something you want to throw a syntax error for, not a...
766,372
How do I make a python regex like `"(.*)"` such that, given `"a (b) c (d) e"` python matches `"b"` instead of `"b) c (d"`? I know that I can use `"[^)]"` instead of `"."`, but I'm looking for a more general solution that keeps my regex a little cleaner. Is there any way to tell python "hey, match this as soon as possi...
2009/04/19
[ "https://Stackoverflow.com/questions/766372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83435/" ]
Would not `\\(.*?\\)` work? That is the non-greedy syntax.
To start with, I do not suggest using "\*" in regexes. Yes, I know, it is the most used multi-character delimiter, but it is nevertheless a bad idea. This is because, while it does match any amount of repetition for that character, "any" includes 0, which is usually something you want to throw a syntax error for, not a...
766,372
How do I make a python regex like `"(.*)"` such that, given `"a (b) c (d) e"` python matches `"b"` instead of `"b) c (d"`? I know that I can use `"[^)]"` instead of `"."`, but I'm looking for a more general solution that keeps my regex a little cleaner. Is there any way to tell python "hey, match this as soon as possi...
2009/04/19
[ "https://Stackoverflow.com/questions/766372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83435/" ]
You seek the all-powerful `*?` From the docs, [Greedy versus Non-Greedy](http://docs.python.org/3/howto/regex.html#greedy-versus-non-greedy) > > the non-greedy qualifiers `*?`, `+?`, `??`, or `{m,n}?` [...] match as *little* > text as possible. > > >
``` >>> x = "a (b) c (d) e" >>> re.search(r"\(.*\)", x).group() '(b) c (d)' >>> re.search(r"\(.*?\)", x).group() '(b)' ``` [According to the docs](http://docs.python.org/library/re.html#regular-expression-syntax): > > The '`*`', '`+`', and '`?`' qualifiers are all greedy; they match as much text as possible. Someti...
766,372
How do I make a python regex like `"(.*)"` such that, given `"a (b) c (d) e"` python matches `"b"` instead of `"b) c (d"`? I know that I can use `"[^)]"` instead of `"."`, but I'm looking for a more general solution that keeps my regex a little cleaner. Is there any way to tell python "hey, match this as soon as possi...
2009/04/19
[ "https://Stackoverflow.com/questions/766372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83435/" ]
``` >>> x = "a (b) c (d) e" >>> re.search(r"\(.*\)", x).group() '(b) c (d)' >>> re.search(r"\(.*?\)", x).group() '(b)' ``` [According to the docs](http://docs.python.org/library/re.html#regular-expression-syntax): > > The '`*`', '`+`', and '`?`' qualifiers are all greedy; they match as much text as possible. Someti...
Would not `\\(.*?\\)` work? That is the non-greedy syntax.
766,372
How do I make a python regex like `"(.*)"` such that, given `"a (b) c (d) e"` python matches `"b"` instead of `"b) c (d"`? I know that I can use `"[^)]"` instead of `"."`, but I'm looking for a more general solution that keeps my regex a little cleaner. Is there any way to tell python "hey, match this as soon as possi...
2009/04/19
[ "https://Stackoverflow.com/questions/766372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83435/" ]
``` >>> x = "a (b) c (d) e" >>> re.search(r"\(.*\)", x).group() '(b) c (d)' >>> re.search(r"\(.*?\)", x).group() '(b)' ``` [According to the docs](http://docs.python.org/library/re.html#regular-expression-syntax): > > The '`*`', '`+`', and '`?`' qualifiers are all greedy; they match as much text as possible. Someti...
As the others have said using the ? modifier on the \* quantifier will solve your immediate problem, but be careful, you are starting to stray into areas where regexes stop working and you need a parser instead. For instance, the string "(foo (bar)) baz" will cause you problems.
766,372
How do I make a python regex like `"(.*)"` such that, given `"a (b) c (d) e"` python matches `"b"` instead of `"b) c (d"`? I know that I can use `"[^)]"` instead of `"."`, but I'm looking for a more general solution that keeps my regex a little cleaner. Is there any way to tell python "hey, match this as soon as possi...
2009/04/19
[ "https://Stackoverflow.com/questions/766372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83435/" ]
``` >>> x = "a (b) c (d) e" >>> re.search(r"\(.*\)", x).group() '(b) c (d)' >>> re.search(r"\(.*?\)", x).group() '(b)' ``` [According to the docs](http://docs.python.org/library/re.html#regular-expression-syntax): > > The '`*`', '`+`', and '`?`' qualifiers are all greedy; they match as much text as possible. Someti...
Using an ungreedy match is a good start, but I'd also suggest that you reconsider any use of `.*` -- what about this? ``` groups = re.search(r"\([^)]*\)", x) ```
766,372
How do I make a python regex like `"(.*)"` such that, given `"a (b) c (d) e"` python matches `"b"` instead of `"b) c (d"`? I know that I can use `"[^)]"` instead of `"."`, but I'm looking for a more general solution that keeps my regex a little cleaner. Is there any way to tell python "hey, match this as soon as possi...
2009/04/19
[ "https://Stackoverflow.com/questions/766372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83435/" ]
You seek the all-powerful `*?` From the docs, [Greedy versus Non-Greedy](http://docs.python.org/3/howto/regex.html#greedy-versus-non-greedy) > > the non-greedy qualifiers `*?`, `+?`, `??`, or `{m,n}?` [...] match as *little* > text as possible. > > >
Do you want it to match "(b)"? Do as Zitrax and Paolo have suggested. Do you want it to match "b"? Do ``` >>> x = "a (b) c (d) e" >>> re.search(r"\((.*?)\)", x).group(1) 'b' ```
766,372
How do I make a python regex like `"(.*)"` such that, given `"a (b) c (d) e"` python matches `"b"` instead of `"b) c (d"`? I know that I can use `"[^)]"` instead of `"."`, but I'm looking for a more general solution that keeps my regex a little cleaner. Is there any way to tell python "hey, match this as soon as possi...
2009/04/19
[ "https://Stackoverflow.com/questions/766372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83435/" ]
You seek the all-powerful `*?` From the docs, [Greedy versus Non-Greedy](http://docs.python.org/3/howto/regex.html#greedy-versus-non-greedy) > > the non-greedy qualifiers `*?`, `+?`, `??`, or `{m,n}?` [...] match as *little* > text as possible. > > >
As the others have said using the ? modifier on the \* quantifier will solve your immediate problem, but be careful, you are starting to stray into areas where regexes stop working and you need a parser instead. For instance, the string "(foo (bar)) baz" will cause you problems.
766,372
How do I make a python regex like `"(.*)"` such that, given `"a (b) c (d) e"` python matches `"b"` instead of `"b) c (d"`? I know that I can use `"[^)]"` instead of `"."`, but I'm looking for a more general solution that keeps my regex a little cleaner. Is there any way to tell python "hey, match this as soon as possi...
2009/04/19
[ "https://Stackoverflow.com/questions/766372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83435/" ]
Would not `\\(.*?\\)` work? That is the non-greedy syntax.
Using an ungreedy match is a good start, but I'd also suggest that you reconsider any use of `.*` -- what about this? ``` groups = re.search(r"\([^)]*\)", x) ```
2,246,571
I'm trying to encrypt/decrypt files in flex (AIR) using the *as3crypto* package. the problem is that when attempting to process slightly large files (over 5M) the process time gets ridiculously long and the client freezes (get the "not responding" title) so i tried to go Async and encrypt/decrypt a chunk at a time and ...
2010/02/11
[ "https://Stackoverflow.com/questions/2246571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/242796/" ]
At first glance it looks like this line: ``` string lastrec = ds.Tables[0].Rows[cnt+1][1].ToString(); ``` cnt+1 is out of the bounds of the collection, and an exception probably told you this. You are probably looking for cnt-1.
I'd probably write ``` int newpcode = int.Parse(lastrec) - 1; ``` as ``` int newpcode = 0; if(Int32.TryParse(lastrec, out newpcode)) { newpcode--; } ``` That way, if it can successfully parse the lastrec, it will decrement. If it can't successfully parse, your newpcode will be 0, but will not throw an error.
14,910,554
I'm trying to disable some portions of my html pages. I read that you can use a transparent div with absolute position on top of your page to prevent clicking on elements beyond it, but is there a way to accomplish this only on a portion of a page (let's assume this portion is all contained in a div) without the use of...
2013/02/16
[ "https://Stackoverflow.com/questions/14910554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/517354/" ]
Put `position: relative` on the div you want to disable, then add the transparent blocking div as a child of this div with `position: absolute` and `top`, `bottom`, `left`, `right` equal to 0. If you are unable to put `position: relative` on the div you want to disable then it will be a bit more difficult as you need...
Make a little 1px x 1px transparent image and save it as a .png file. In the CSS for your DIV, use this code ``` background:transparent url('/images/transparent-bg.png') repeat center top; ``` Remember to change the file path to your transperant image. I think this solution works in all browsers, maybe except for I...
23,954,898
I am having a bit of an issue here. I have an MVC application that has been deployed to IIS 7 on Windows Server 2008. In Visual Studio 2012, whenever an internal server error occurs i.e. http 500, it shows the page I designed for it. However, when I deploy it to IIS, it shows a blank page which could be very annoying b...
2014/05/30
[ "https://Stackoverflow.com/questions/23954898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/464512/" ]
`file:///android_asset` is only for use with `WebView`. I do not know what `ImageLoader` is, but see if it accepts an `InputStream`. If so, use `AssetManager` and `open()` to get an `InputStream` on your desired asset.
I think the URI usage is something like this for assests folder ``` String imageUri = "assets://image.png"; imageLoader.displayImage(imageUri, imageView); ``` Just check [this](https://github.com/nostra13/Android-Universal-Image-Loader#acceptable-uris-examples) reference So your change your code something like thi...
23,954,898
I am having a bit of an issue here. I have an MVC application that has been deployed to IIS 7 on Windows Server 2008. In Visual Studio 2012, whenever an internal server error occurs i.e. http 500, it shows the page I designed for it. However, when I deploy it to IIS, it shows a blank page which could be very annoying b...
2014/05/30
[ "https://Stackoverflow.com/questions/23954898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/464512/" ]
`file:///android_asset` is only for use with `WebView`. I do not know what `ImageLoader` is, but see if it accepts an `InputStream`. If so, use `AssetManager` and `open()` to get an `InputStream` on your desired asset.
Here's a (simplified!) helper routine that will open the asset as an `InputStream` if the URI uses the `file:///android_asset/` pattern: ``` public static InputStream open(String urlString, Context context) throws IOException { URI uri = URI.create(urlString); if (uri.getScheme().equals("file") && uri.getPath...
23,954,898
I am having a bit of an issue here. I have an MVC application that has been deployed to IIS 7 on Windows Server 2008. In Visual Studio 2012, whenever an internal server error occurs i.e. http 500, it shows the page I designed for it. However, when I deploy it to IIS, it shows a blank page which could be very annoying b...
2014/05/30
[ "https://Stackoverflow.com/questions/23954898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/464512/" ]
I think the URI usage is something like this for assests folder ``` String imageUri = "assets://image.png"; imageLoader.displayImage(imageUri, imageView); ``` Just check [this](https://github.com/nostra13/Android-Universal-Image-Loader#acceptable-uris-examples) reference So your change your code something like thi...
Here's a (simplified!) helper routine that will open the asset as an `InputStream` if the URI uses the `file:///android_asset/` pattern: ``` public static InputStream open(String urlString, Context context) throws IOException { URI uri = URI.create(urlString); if (uri.getScheme().equals("file") && uri.getPath...
35,290,070
Story for context: I have an ePetition type service running on my site which I email people a link where they can 'agree' to the petition. This link will only contain the 'petitionID' and 'username' of the person who sent it. This information isn't particularly sensitive but I still require it to be tamper-proof beca...
2016/02/09
[ "https://Stackoverflow.com/questions/35290070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3364482/" ]
Here's what I did (which is practically tamper-proof). I don't use java script as users can disable it anyway. I simply create a UUID, (which is stored in a database next to user details) and then create a link sent in an email during the registration process. ``` http://my_domain_name/Activate?key=6faeecf5-9ab3-46f4-...
While the String.hashcode() may return the same value for the same string across instances, this is not guaranteed. > > Whenever it is invoked on the same object more than once during an > execution of a Java application, the hashCode method must consistently > return the same integer, provided no information used...
196,146
I have andersen 400-series windows throughout the house. I'm renovating the attic so the trim and wallboard are off revealing this situation: [![photo of window in rough opening](https://i.stack.imgur.com/8m7M0.jpg)](https://i.stack.imgur.com/8m7M0.jpg) The window is not attached to the rough opening on the sides or ...
2020/06/26
[ "https://diy.stackexchange.com/questions/196146", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/-1/" ]
There are a lot of problems with that install. But I do know that you do NOT want to nail the window frame to the rough opening on the sides. The flanges that are nailed to the sheathing provide all of the support. Usually there are shims underneath the window at the bottom to 1) bring the window up to the right height...
+1 For getting the Andersen instructions. I installed 21 Series 400 replacement windows a few years back. Not sure what you have here. The basic flow for them, is to level the sill, caulk it, and drop the frame in. Then you start with screws from the top, within the track, from the frame into the rough in, shimming an...
29,511
When I try to view a public document ([example found on the net](https://docs.google.com/document/d/101OVq5lIYOJANVvTGuWCcmlA9XIHL5iUymU6noOApbI/edit)) with my Google Apps account I get this screen: ![Google Drive. You need permission to access this item.](https://i.stack.imgur.com/8oKLS.png) Clicking on the button w...
2012/07/31
[ "https://webapps.stackexchange.com/questions/29511", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/10400/" ]
**Your Google Apps admin has not allowed users to receive documents from outside your domain.** One of the [sharing options you can set for Docs & Drive within a Google Apps account](http://support.google.com/a/bin/answer.py?hl=en&answer=60781) is weither or not users can share documents to people outside the organisa...
Unexpectedly last week, my visitors couldn't access my public docs. I verified had "Users can share". Was still getting errors. My solution was to: 1. Select **Users cannot share**. 2. Save. 3. Select **Users can share**. 4. Save. This was enough to fix the permissions.
3,658,571
I have this code that adds dotted lines under text in text box: ``` // Create an underline text decoration. Default is underline. TextDecoration myUnderline = new TextDecoration(); // Create a linear gradient pen for the text decoration. Pen myPen = new Pen(); myPen.Brush = new LinearGradientBrush(Color...
2010/09/07
[ "https://Stackoverflow.com/questions/3658571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/441418/" ]
Instead of setting the property on the entire TextBlock, create a TextRange for the last six characters and apply the formatting to that: ``` var end = PasswordSendMessage.ContentEnd; var start = end.GetPositionAtOffset(-6) ?? PasswordSendMessage.ContentStart; var range = new TextRange(start, end); range.ApplyPropert...
You could databind your text to the Inlines property of TextBox and make a converter to build the run collection with a seperate Run for the last 6 characters applying your decorations
7,535,530
I want to implement a JQuery script that requires the browser's width at 100% which depends solely on the user's viewing resolution. Can i prepare multiple scripts for the different resolutions for the browser to automatically detect and choose or does there need to be a single script with if/then clauses?
2011/09/23
[ "https://Stackoverflow.com/questions/7535530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/962058/" ]
The success callback doesn't operate on the same `this` that the click handler does. Save it in a variable: ``` $('.deleteQuestion').live('click', function(){ var element = $(this); $.ajax({ type: 'GET', url: '/delete_question/' + $(this).attr('name') + '/', success: function(){ //th...
In the first version `$(this).attr('name')` is evaluated right away. In the second version `this` is not pointing to the current element since it only gets evaluated when the callback function executes, which is in a different context - so it won't work correctly.
7,535,530
I want to implement a JQuery script that requires the browser's width at 100% which depends solely on the user's viewing resolution. Can i prepare multiple scripts for the different resolutions for the browser to automatically detect and choose or does there need to be a single script with if/then clauses?
2011/09/23
[ "https://Stackoverflow.com/questions/7535530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/962058/" ]
The success callback doesn't operate on the same `this` that the click handler does. Save it in a variable: ``` $('.deleteQuestion').live('click', function(){ var element = $(this); $.ajax({ type: 'GET', url: '/delete_question/' + $(this).attr('name') + '/', success: function(){ //th...
I think in this instance neither are working as you intend. In the first version, you have the following: ``` success: $('[what="question"][name="' + $(this).attr('name') + '"]').remove() ``` This is executed as soon as the line is reached and not on the success callback. In the 2nd version, you lose the context o...
7,535,530
I want to implement a JQuery script that requires the browser's width at 100% which depends solely on the user's viewing resolution. Can i prepare multiple scripts for the different resolutions for the browser to automatically detect and choose or does there need to be a single script with if/then clauses?
2011/09/23
[ "https://Stackoverflow.com/questions/7535530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/962058/" ]
The success callback doesn't operate on the same `this` that the click handler does. Save it in a variable: ``` $('.deleteQuestion').live('click', function(){ var element = $(this); $.ajax({ type: 'GET', url: '/delete_question/' + $(this).attr('name') + '/', success: function(){ //th...
`this` is not pointing to what you what in the success function. Try this instead: ``` $('.deleteQuestion').live('click', function() { var that = this; $.ajax({ type: 'GET', url: '/delete_question/' + $(this).attr('name') + '/', success: function() { $('[what="question"][nam...
25,191,954
I am learning qt, and experimenting with examples from a textbook. The original textbook code has the following, set up to save and close on the x button: ``` void MainWindow::closeEvent(QCloseEvent *event) { if (okToContinue()) { writeSettings(); event->accept(); } else { event->ignor...
2014/08/07
[ "https://Stackoverflow.com/questions/25191954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1217150/" ]
You don't have to reimplement MainWindow::close() in your subclass. From the Qt Docs: > > ...QCloseEvent sent when you call QWidget::close() to close a widget > programmatically... > > > So you just have to reimplement MainWindow::closeEvent(QCloseEvent \*event) if you want to control this event. This event fi...
The `closeEvent` and related methods don't actually execute the action that happens when a given event is received. They merely allow you to act on the event and perhaps disable its further processing. The closing of the window is done within `QWidget::event`, where `closeEvent` is called from.
146,435
Lately all the banks around here (Latvia) have been sending out warnings about scammers that try to get access to your online banking. Fair enough. But what confuses me is - so, what can they do after that? I mean, obviously they can transfer my money wherever, but... those transactions will be traceable. They'll just ...
2021/11/21
[ "https://money.stackexchange.com/questions/146435", "https://money.stackexchange.com", "https://money.stackexchange.com/users/71680/" ]
This is the "problem" that all of the myriad money laundering schemes attempt to solve. One of the fastest and most common ways to steal money and get away with it is by purchasing online giftcards to merchants like Amazon, Best Buy, Google Play, iTunes, etc. There are several online platforms where owners of giftcards...
Some transfer methods are NOT reversible. They transfer your money to another victim, and trick them into sending Western Union or Bitcoin. ------------------------------------------------------------------------------------------------- Scammers work as teams and are running several scams at once. The other victim i...
146,435
Lately all the banks around here (Latvia) have been sending out warnings about scammers that try to get access to your online banking. Fair enough. But what confuses me is - so, what can they do after that? I mean, obviously they can transfer my money wherever, but... those transactions will be traceable. They'll just ...
2021/11/21
[ "https://money.stackexchange.com/questions/146435", "https://money.stackexchange.com", "https://money.stackexchange.com/users/71680/" ]
There are wagonloads of schemes for making unsuspecting victims convert money from stolen accounts to real money, making others hold the bag. You can combine this with a dating scam: an online acquaintance in Russia becomes totally infatuated with you and wants to come over for a visit or marriage or whatever. But she ...
The answer is sometimes **not much**. Once in any of my (French) bank accounts, the hacker can obviously see what I have. In order to make a wire transfer * either the target account is "verified" and no extra steps are needed → but in order to "verify" an account there is an extra factor that is needed (an SMS to th...
146,435
Lately all the banks around here (Latvia) have been sending out warnings about scammers that try to get access to your online banking. Fair enough. But what confuses me is - so, what can they do after that? I mean, obviously they can transfer my money wherever, but... those transactions will be traceable. They'll just ...
2021/11/21
[ "https://money.stackexchange.com/questions/146435", "https://money.stackexchange.com", "https://money.stackexchange.com/users/71680/" ]
This is the "problem" that all of the myriad money laundering schemes attempt to solve. One of the fastest and most common ways to steal money and get away with it is by purchasing online giftcards to merchants like Amazon, Best Buy, Google Play, iTunes, etc. There are several online platforms where owners of giftcards...
There are wagonloads of schemes for making unsuspecting victims convert money from stolen accounts to real money, making others hold the bag. You can combine this with a dating scam: an online acquaintance in Russia becomes totally infatuated with you and wants to come over for a visit or marriage or whatever. But she ...
146,435
Lately all the banks around here (Latvia) have been sending out warnings about scammers that try to get access to your online banking. Fair enough. But what confuses me is - so, what can they do after that? I mean, obviously they can transfer my money wherever, but... those transactions will be traceable. They'll just ...
2021/11/21
[ "https://money.stackexchange.com/questions/146435", "https://money.stackexchange.com", "https://money.stackexchange.com/users/71680/" ]
Some transfer methods are NOT reversible. They transfer your money to another victim, and trick them into sending Western Union or Bitcoin. ------------------------------------------------------------------------------------------------- Scammers work as teams and are running several scams at once. The other victim i...
In addition to the many other cases described in the other answers: * If they managed to get an ATM card or other means of making withdrawals on an account (which is not theirs, obviously, or one they managed to create in the name of someone else), then they just transfer money from your account to that account, withd...
146,435
Lately all the banks around here (Latvia) have been sending out warnings about scammers that try to get access to your online banking. Fair enough. But what confuses me is - so, what can they do after that? I mean, obviously they can transfer my money wherever, but... those transactions will be traceable. They'll just ...
2021/11/21
[ "https://money.stackexchange.com/questions/146435", "https://money.stackexchange.com", "https://money.stackexchange.com/users/71680/" ]
Compromised accounts are the backbone of a common "overpayment" scam. It works like this: Scammer takes control of Person A's bank account and uses it to overpay for something they buy from Person B on eBay, Nextdoor, etc. "Oops I accidentally sent you too much money. Please send the difference back to me with Wester...
Your doubts should be shared by everyone who comes to this afresh: the money trail should be traceable. May I assume everyone here understands the concept of a "burner" phone; one used for a very few calls - sometimes, only one - then thrown away? It's much harder to get a bank account than a phone subscription but w...
146,435
Lately all the banks around here (Latvia) have been sending out warnings about scammers that try to get access to your online banking. Fair enough. But what confuses me is - so, what can they do after that? I mean, obviously they can transfer my money wherever, but... those transactions will be traceable. They'll just ...
2021/11/21
[ "https://money.stackexchange.com/questions/146435", "https://money.stackexchange.com", "https://money.stackexchange.com/users/71680/" ]
Your doubts should be shared by everyone who comes to this afresh: the money trail should be traceable. May I assume everyone here understands the concept of a "burner" phone; one used for a very few calls - sometimes, only one - then thrown away? It's much harder to get a bank account than a phone subscription but w...
The answer is sometimes **not much**. Once in any of my (French) bank accounts, the hacker can obviously see what I have. In order to make a wire transfer * either the target account is "verified" and no extra steps are needed → but in order to "verify" an account there is an extra factor that is needed (an SMS to th...
146,435
Lately all the banks around here (Latvia) have been sending out warnings about scammers that try to get access to your online banking. Fair enough. But what confuses me is - so, what can they do after that? I mean, obviously they can transfer my money wherever, but... those transactions will be traceable. They'll just ...
2021/11/21
[ "https://money.stackexchange.com/questions/146435", "https://money.stackexchange.com", "https://money.stackexchange.com/users/71680/" ]
In the United States, at least from my personal experience around 2017, they take the banking information, get an ATM card, and then start pulling cash from ATMs at convenience stores. Cash is harder to trace and easy to convert, and circumventing the security cameras on the ATMs basically comes down to wearing a hat a...
The answer is sometimes **not much**. Once in any of my (French) bank accounts, the hacker can obviously see what I have. In order to make a wire transfer * either the target account is "verified" and no extra steps are needed → but in order to "verify" an account there is an extra factor that is needed (an SMS to th...
146,435
Lately all the banks around here (Latvia) have been sending out warnings about scammers that try to get access to your online banking. Fair enough. But what confuses me is - so, what can they do after that? I mean, obviously they can transfer my money wherever, but... those transactions will be traceable. They'll just ...
2021/11/21
[ "https://money.stackexchange.com/questions/146435", "https://money.stackexchange.com", "https://money.stackexchange.com/users/71680/" ]
This is the "problem" that all of the myriad money laundering schemes attempt to solve. One of the fastest and most common ways to steal money and get away with it is by purchasing online giftcards to merchants like Amazon, Best Buy, Google Play, iTunes, etc. There are several online platforms where owners of giftcards...
Your doubts should be shared by everyone who comes to this afresh: the money trail should be traceable. May I assume everyone here understands the concept of a "burner" phone; one used for a very few calls - sometimes, only one - then thrown away? It's much harder to get a bank account than a phone subscription but w...
146,435
Lately all the banks around here (Latvia) have been sending out warnings about scammers that try to get access to your online banking. Fair enough. But what confuses me is - so, what can they do after that? I mean, obviously they can transfer my money wherever, but... those transactions will be traceable. They'll just ...
2021/11/21
[ "https://money.stackexchange.com/questions/146435", "https://money.stackexchange.com", "https://money.stackexchange.com/users/71680/" ]
This is the "problem" that all of the myriad money laundering schemes attempt to solve. One of the fastest and most common ways to steal money and get away with it is by purchasing online giftcards to merchants like Amazon, Best Buy, Google Play, iTunes, etc. There are several online platforms where owners of giftcards...
In addition to the many other cases described in the other answers: * If they managed to get an ATM card or other means of making withdrawals on an account (which is not theirs, obviously, or one they managed to create in the name of someone else), then they just transfer money from your account to that account, withd...
146,435
Lately all the banks around here (Latvia) have been sending out warnings about scammers that try to get access to your online banking. Fair enough. But what confuses me is - so, what can they do after that? I mean, obviously they can transfer my money wherever, but... those transactions will be traceable. They'll just ...
2021/11/21
[ "https://money.stackexchange.com/questions/146435", "https://money.stackexchange.com", "https://money.stackexchange.com/users/71680/" ]
Compromised accounts are the backbone of a common "overpayment" scam. It works like this: Scammer takes control of Person A's bank account and uses it to overpay for something they buy from Person B on eBay, Nextdoor, etc. "Oops I accidentally sent you too much money. Please send the difference back to me with Wester...
In addition to the many other cases described in the other answers: * If they managed to get an ATM card or other means of making withdrawals on an account (which is not theirs, obviously, or one they managed to create in the name of someone else), then they just transfer money from your account to that account, withd...
74,314,510
I am working on a Nodejs Express project and I keep getting 'Cannot GET /' error on Localhost. This is my server.js file ``` console.clear(); const express = require("express"); const app = express(); const dbConnect = require("./config/dbConnect"); require("dotenv").config(); dbConnect(); app.use(express.json()); ...
2022/11/04
[ "https://Stackoverflow.com/questions/74314510", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19801522/" ]
You can use the filter 'woocommerce\_sale\_flash' to remove default sale flash badge. try out this code. ``` add_action( 'woocommerce_before_shop_loop_item_title', 'new_badge', 3 ); function new_badge() { global $product; if ( $product->is_on_backorder(1) ) { add_filter('woocommerce_sale_flash', func...
Add WooCommerce Sold Out Badge Storewide The most common scenario is the placement of the WooCommerce Sold Out badge across the store for all the products that have been sold out. This can be accomplished by placing the following code snippet in the functions.php file of the theme. add\_action( 'woocommerce\_before\_s...
22,161,552
long time searcher but first time I'm posting a question. I am an IT student going into [haven't started yet] my second programming class. The first was just an intro to Java (we're talking basics really). I have been having a hard time with calling methods within the same class. I have attempted search-foo with poor r...
2014/03/04
[ "https://Stackoverflow.com/questions/22161552", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3377218/" ]
When you call `MethodToCall`, you aren't doing anything with the returned value. You need to store the returned value in your variable i.e. ``` int valueOne = MethodToCall(); ```
It looks like you are confused with the variable scopes. Try doing ``` int valueOne = MethodToCall(); ``` Inside your main.
22,161,552
long time searcher but first time I'm posting a question. I am an IT student going into [haven't started yet] my second programming class. The first was just an intro to Java (we're talking basics really). I have been having a hard time with calling methods within the same class. I have attempted search-foo with poor r...
2014/03/04
[ "https://Stackoverflow.com/questions/22161552", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3377218/" ]
When you call `MethodToCall`, you aren't doing anything with the returned value. You need to store the returned value in your variable i.e. ``` int valueOne = MethodToCall(); ```
When you return something then you need a variable to hold the returned value.. so int valueone = methodtovalue(); would be correct.. Also note that the variable declared in a function would lose its scope when it is reaches the main program because the variable is declared in function. So valueone in function is ...
223,143
I just bought a Powersaves Pro system four days ago, with no problems, except with one game. Animal Crossing: New Leaf. This game was the one I was actually most excited to use. Whenever I tried using the 999,999,999 bells code it always stopped in the second loading section "Uploading Save" about a quarter into it. T...
2015/06/10
[ "https://gaming.stackexchange.com/questions/223143", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/115123/" ]
I think you might have done too many system updates for the codes to work on your system. It is entirely possible that the latest system update prevents you from using powersaves in animal crossing new leaf. Try using a Nintendo 3ds that is older and hasn't been updated for a long time. If that doesn't work, I don't kn...
It happened to me, And It's a problem with the cord. I had to hold it in a really weird way because My game was heavier than my others (I used an old scale thingy) But, It could be your cartridge
20,927,207
I'm trying to make a basic JDBC connection to MySQL. I deployed application on openshift server (tomcat7, mysql) but I can't connect with my db (I use phpmyadmin to create db and tables). I'am using Spring 3.1 MVC, JSF and Primefaces. I deployed some time ago a simple java web application and I used a **class conecti...
2014/01/04
[ "https://Stackoverflow.com/questions/20927207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2283314/" ]
HI you can simply write a code like this.. ``` try{Class.forName("com.mysql.jdbc.Driver").newInstance(); username=asfksjfjs; password=sflkaskfjhsjk; url="jdbc:mysql://178.360.01:3306/demo01"; con = (Connection) DriverManager.getConnection(url,username,password);} ``` just copy those port no and host name from y...
I don't think you can use environment variables in a jdbc.properties file, I don't think they will get parsed (as answered here [Regarding application.properties file and environment variable](https://stackoverflow.com/questions/2263929/regarding-application-properties-file-and-environment-variable)). You MIGHT be able...
20,927,207
I'm trying to make a basic JDBC connection to MySQL. I deployed application on openshift server (tomcat7, mysql) but I can't connect with my db (I use phpmyadmin to create db and tables). I'am using Spring 3.1 MVC, JSF and Primefaces. I deployed some time ago a simple java web application and I used a **class conecti...
2014/01/04
[ "https://Stackoverflow.com/questions/20927207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2283314/" ]
HI you can simply write a code like this.. ``` try{Class.forName("com.mysql.jdbc.Driver").newInstance(); username=asfksjfjs; password=sflkaskfjhsjk; url="jdbc:mysql://178.360.01:3306/demo01"; con = (Connection) DriverManager.getConnection(url,username,password);} ``` just copy those port no and host name from y...
Activate phpmyadmin, and open it you will find the ip in the header, take it and replace it in the OPENSHIFT\_MYSQL\_DB\_HOST variable, the port is the default mysql : 3306.
8,089,232
I am trying to save the selectedIndex of actionsheet into an object. But why does it always read 0? ``` -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { NSNumber *type, *count; if ([actionSheet.title isEqualToString:@"Select Taxi Type"]) { if (buttonIndex !=...
2011/11/11
[ "https://Stackoverflow.com/questions/8089232", "https://Stackoverflow.com", "https://Stackoverflow.com/users/771355/" ]
NSNumber is an object that can hold basic types for storing in data structures like NSDictionary and NSArray. The %f in the NSLog is looking for a double. This code should be giving you a warning. If you do NSLog(@"%i",[type intValue]) you will get the right answer.
Please check out this code. ``` NSNumber *numberNs = [[NSNumber alloc] initWithInteger:buttonIndex]; ``` Hope this helps you.
49,078,971
``` If trigger = "Reconcile" Then If InStr(XXlist, checkmi) > 0 Then If checkmi = "XX1000" Then a = a + 1 Call XX1000Check(location, a, checkmi) End If If checkmi = "XX1001" Then Call XX1001Check(location, checkmi) End If Else: Ca...
2018/03/02
[ "https://Stackoverflow.com/questions/49078971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9361028/" ]
This might be a good spot for a SELECT...CASE Syntax ``` SELECT CASE checkmi CASE "XX1000" a = a + 1 Call XX1000Check(location, a, checkmi) CASE "XX1001" Call XX1001Check(location, checkmi) CASE ELSE SenseCheck(location, lo...
You already terminated the `If` statement by `End If` below: ``` If checkmi = "XX1001" Then Call XX1001Check(location, checkmi) End If '<~~ termination point ``` And you have an open `If` statement where you placed your `Else` statement. ``` If InStr(XXlist, checkmi) > 0 Then If checkmi = "XX1000" Then ...
49,078,971
``` If trigger = "Reconcile" Then If InStr(XXlist, checkmi) > 0 Then If checkmi = "XX1000" Then a = a + 1 Call XX1000Check(location, a, checkmi) End If If checkmi = "XX1001" Then Call XX1001Check(location, checkmi) End If Else: Ca...
2018/03/02
[ "https://Stackoverflow.com/questions/49078971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9361028/" ]
This might be a good spot for a SELECT...CASE Syntax ``` SELECT CASE checkmi CASE "XX1000" a = a + 1 Call XX1000Check(location, a, checkmi) CASE "XX1001" Call XX1001Check(location, checkmi) CASE ELSE SenseCheck(location, lo...
expanding on given answers, just to add that you may consider enhancing your code and improving its maintenance by adopting the same sub for both "XX1000" and "XX1001" `checkmi` values this by means of "optional" parameters that a Sub/Function can have with the only requirement they must be kept as the last ones in th...
49,078,971
``` If trigger = "Reconcile" Then If InStr(XXlist, checkmi) > 0 Then If checkmi = "XX1000" Then a = a + 1 Call XX1000Check(location, a, checkmi) End If If checkmi = "XX1001" Then Call XX1001Check(location, checkmi) End If Else: Ca...
2018/03/02
[ "https://Stackoverflow.com/questions/49078971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9361028/" ]
You already terminated the `If` statement by `End If` below: ``` If checkmi = "XX1001" Then Call XX1001Check(location, checkmi) End If '<~~ termination point ``` And you have an open `If` statement where you placed your `Else` statement. ``` If InStr(XXlist, checkmi) > 0 Then If checkmi = "XX1000" Then ...
expanding on given answers, just to add that you may consider enhancing your code and improving its maintenance by adopting the same sub for both "XX1000" and "XX1001" `checkmi` values this by means of "optional" parameters that a Sub/Function can have with the only requirement they must be kept as the last ones in th...
36,711,939
I have a `Recyclerview` that holds `ratingbar` in list\_items If I user **rtBar.setOnRatingBarChangeListener** , then I get not results , nothing happens in rating bar , not even clickable If I use **rtBar.setOnTouchListener** , it works , but my code does't works when clicked on 4th start ``` public EmployeeViewHol...
2016/04/19
[ "https://Stackoverflow.com/questions/36711939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4432176/" ]
If your RatingBar is not clickable then check in your xml file where RatingBar has attribute `android:isIndicator="false"`. > > If **isIndicator** is **true** then you couldn't able to rate > > >
use interface like that ``` public interface OnRecordEventListener { void onRatingBarChange(Record item,float value); } ``` you create ViewHolder pass listener into constructor like this. ``` public ViewHolder(View itemView, OnRecordEventListener listener) { super(itemView); textViewT...
47,313,619
I have recently started working with VBA and I have to filter a column with string 'NEWV' and to count number of rows that end after that filtering,Currently am using the below code but that doesnt seem to work, ``` ByrNbr = Watchlist.Range("B" & i).Value LookFor = ByrNbr Set Age_rng = Total.Sheets("Counts").Range("...
2017/11/15
[ "https://Stackoverflow.com/questions/47313619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4490346/" ]
Not sure what workbook and worksheet these ranges are on, but you could use something like this, just have to clarify where each range resides. ``` ByrNbr = Watchlist.Range("B" & i).Value Worksheets(???).Range("L27").Value =WorksheetFunction.CountIfs(Watchlist.Range("B:B" ), ByrNbr, Watchlist.Range("G:G"), "...
Try testing this line without the `If` statement ``` Range("L27").Value = Application.WorksheetFunction.COUNTIF(Age_rng,"NEWV") ```
47,313,619
I have recently started working with VBA and I have to filter a column with string 'NEWV' and to count number of rows that end after that filtering,Currently am using the below code but that doesnt seem to work, ``` ByrNbr = Watchlist.Range("B" & i).Value LookFor = ByrNbr Set Age_rng = Total.Sheets("Counts").Range("...
2017/11/15
[ "https://Stackoverflow.com/questions/47313619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4490346/" ]
Not sure what workbook and worksheet these ranges are on, but you could use something like this, just have to clarify where each range resides. ``` ByrNbr = Watchlist.Range("B" & i).Value Worksheets(???).Range("L27").Value =WorksheetFunction.CountIfs(Watchlist.Range("B:B" ), ByrNbr, Watchlist.Range("G:G"), "...
[![enter image description here](https://i.stack.imgur.com/p6Psk.png)](https://i.stack.imgur.com/p6Psk.png) ``` Sub formulatest() MsgBox Application.WorksheetFunction.CountIfs(Sheet1.Range("B13:B16"), Sheet1.Range("C12").Value, Sheet1.Range("G13:G16"), Sheet1.Range("D12").Value) '~~Returns 2 End Sub ```
213,910
I have posts in two languages, managed by WPML. In one post, I share multiple links which are updated in a regular basis. Updating the same links for both languages is not an option (for now I only added this post in one language). Which is the best way to define links text and URL only once, and reuse them in both l...
2016/01/07
[ "https://wordpress.stackexchange.com/questions/213910", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/59235/" ]
Your arguments for both [`wp_get_attachment_image_url()`](https://developer.wordpress.org/reference/functions/wp_get_attachment_image_url/) and [`wp_get_attachment_image()`](https://codex.wordpress.org/Function_Reference/wp_get_attachment_image) are in the wrong order - check the linked documentation for details. Addit...
I simply used CSS for this one. It doesn't work in all scenario's, but often enough it will. Let's take a 300px x 300px image: ``` max-height: 300px; max-width: 300px; width: auto; ``` This constrains the dimensions of the image without losing its width to height ratio. Otherwise you can also use REGEX: ``` $html =...
213,910
I have posts in two languages, managed by WPML. In one post, I share multiple links which are updated in a regular basis. Updating the same links for both languages is not an option (for now I only added this post in one language). Which is the best way to define links text and URL only once, and reuse them in both l...
2016/01/07
[ "https://wordpress.stackexchange.com/questions/213910", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/59235/" ]
Your arguments for both [`wp_get_attachment_image_url()`](https://developer.wordpress.org/reference/functions/wp_get_attachment_image_url/) and [`wp_get_attachment_image()`](https://codex.wordpress.org/Function_Reference/wp_get_attachment_image) are in the wrong order - check the linked documentation for details. Addit...
**Regex approach** After retrieving the raw image output that will include the width and height attributes, simply remove them with a regex replace of an empty string: ``` <?php $raw_image = wp_get_attachment_image( $entry['slide_image_id'], true, 'full'); $final_image = preg_replace('/(height|width)="\d*"\s/', "", $...
213,910
I have posts in two languages, managed by WPML. In one post, I share multiple links which are updated in a regular basis. Updating the same links for both languages is not an option (for now I only added this post in one language). Which is the best way to define links text and URL only once, and reuse them in both l...
2016/01/07
[ "https://wordpress.stackexchange.com/questions/213910", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/59235/" ]
Workaround ---------- I did some core digging/testing and found a workaround through the `wp_constrain_dimensions` filter: ``` // Add filter to empty the height/width array add_filter( 'wp_constrain_dimensions', '__return_empty_array' ); // Display image html echo wp_get_attachment_image( $entry['slide_image_id'], 'f...
I simply used CSS for this one. It doesn't work in all scenario's, but often enough it will. Let's take a 300px x 300px image: ``` max-height: 300px; max-width: 300px; width: auto; ``` This constrains the dimensions of the image without losing its width to height ratio. Otherwise you can also use REGEX: ``` $html =...
213,910
I have posts in two languages, managed by WPML. In one post, I share multiple links which are updated in a regular basis. Updating the same links for both languages is not an option (for now I only added this post in one language). Which is the best way to define links text and URL only once, and reuse them in both l...
2016/01/07
[ "https://wordpress.stackexchange.com/questions/213910", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/59235/" ]
Workaround ---------- I did some core digging/testing and found a workaround through the `wp_constrain_dimensions` filter: ``` // Add filter to empty the height/width array add_filter( 'wp_constrain_dimensions', '__return_empty_array' ); // Display image html echo wp_get_attachment_image( $entry['slide_image_id'], 'f...
**Regex approach** After retrieving the raw image output that will include the width and height attributes, simply remove them with a regex replace of an empty string: ``` <?php $raw_image = wp_get_attachment_image( $entry['slide_image_id'], true, 'full'); $final_image = preg_replace('/(height|width)="\d*"\s/', "", $...
14,714,892
I have a div that needs to be hidden by default. It then can be toggled by a button: ``` <script type="text/javascript"> function toggle() { text = document.getElementById('add_view'); var isHidden = text.style.display == 'none'; text.style.display = isHidden ? 'block' :...
2013/02/05
[ "https://Stackoverflow.com/questions/14714892", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2043533/" ]
You probably need to hide your element by default, and then use the button to toggle visibility. Try this: ``` <div id="add_view" style="display:none">....</div> ```
Make the element hidden in your html to begin with. ``` <div id="add_view" style="display: none;"></div> ```
14,714,892
I have a div that needs to be hidden by default. It then can be toggled by a button: ``` <script type="text/javascript"> function toggle() { text = document.getElementById('add_view'); var isHidden = text.style.display == 'none'; text.style.display = isHidden ? 'block' :...
2013/02/05
[ "https://Stackoverflow.com/questions/14714892", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2043533/" ]
You probably need to hide your element by default, and then use the button to toggle visibility. Try this: ``` <div id="add_view" style="display:none">....</div> ```
Initially, you have to hide it by setting `style="display:none;"` of the div. Once when u want to toggle it, you have to use it as ``` document.getElementById(Id).style.display=""; ``` in javascript.
14,714,892
I have a div that needs to be hidden by default. It then can be toggled by a button: ``` <script type="text/javascript"> function toggle() { text = document.getElementById('add_view'); var isHidden = text.style.display == 'none'; text.style.display = isHidden ? 'block' :...
2013/02/05
[ "https://Stackoverflow.com/questions/14714892", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2043533/" ]
Make the element hidden in your html to begin with. ``` <div id="add_view" style="display: none;"></div> ```
Initially, you have to hide it by setting `style="display:none;"` of the div. Once when u want to toggle it, you have to use it as ``` document.getElementById(Id).style.display=""; ``` in javascript.
50,529,319
I'm trying to send a POST request to [Ghostbin](https://ghostbin.com) via Node.JS and its `request` NPM module. Here's what my code looks like: Attempt 1: ``` reqest.post({ url: "https://ghostbin.com/paste/new", text: "test post" }, function (err, res, body) { console.log(res) }) ``` Attempt 2: ``` reqest...
2018/05/25
[ "https://Stackoverflow.com/questions/50529319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8961491/" ]
You can use `tf.cond`: ``` idx0 = tf.shape(row_index)[0] loss_f_G_filtered = tf.cond(idx0 == 0, lambda: tf.constant(0, tf.float32), lambda: ...another function...) ```
``` loss_f_G = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=y1_filterred, labels=y__filtered), name = "filtered_reg") idx0 = tf.shape(row_index)[0] loss_f_G_filtered = tf.cond(tf.cast(idx0 == 0, tf.bool), lambda: tf.constant(0, tf.float32), lambda:loss_f_G) ``` The problem is that idx0 ...
50,529,319
I'm trying to send a POST request to [Ghostbin](https://ghostbin.com) via Node.JS and its `request` NPM module. Here's what my code looks like: Attempt 1: ``` reqest.post({ url: "https://ghostbin.com/paste/new", text: "test post" }, function (err, res, body) { console.log(res) }) ``` Attempt 2: ``` reqest...
2018/05/25
[ "https://Stackoverflow.com/questions/50529319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8961491/" ]
``` is_empty = tf.equal(tf.size(row_index), 0) ```
You can use `tf.cond`: ``` idx0 = tf.shape(row_index)[0] loss_f_G_filtered = tf.cond(idx0 == 0, lambda: tf.constant(0, tf.float32), lambda: ...another function...) ```
50,529,319
I'm trying to send a POST request to [Ghostbin](https://ghostbin.com) via Node.JS and its `request` NPM module. Here's what my code looks like: Attempt 1: ``` reqest.post({ url: "https://ghostbin.com/paste/new", text: "test post" }, function (err, res, body) { console.log(res) }) ``` Attempt 2: ``` reqest...
2018/05/25
[ "https://Stackoverflow.com/questions/50529319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8961491/" ]
``` is_empty = tf.equal(tf.size(row_index), 0) ```
``` loss_f_G = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=y1_filterred, labels=y__filtered), name = "filtered_reg") idx0 = tf.shape(row_index)[0] loss_f_G_filtered = tf.cond(tf.cast(idx0 == 0, tf.bool), lambda: tf.constant(0, tf.float32), lambda:loss_f_G) ``` The problem is that idx0 ...
41,951,231
I have to send mail using Amazon AWS with PHP, I am able to send simple mail but got following Error, I used many codes get from Google but still I got the same error every time. > > Fatal error: Cannot redeclare Aws\constantly() (previously declared > in /path/vendor/aws/aws-sdk-php/src/functions.php:20) in > phar...
2017/01/31
[ "https://Stackoverflow.com/questions/41951231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7348556/" ]
I had this error about redeclaring `constantly()` and the problem was resolved in our code by simply changing: ``` include('/PATH/TO/aws-sdk-3/aws-autoloader.php'); ``` to ``` include_once('/PATH/TO/aws-sdk-3/aws-autoloader.php'); ``` Maybe that will help you or the next person to Google this error message!
This is just namespacing. Look at the examples for reference - you need to either use the namespaced class or reference it absolutely, for example: ``` use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; //Load composer's autoloader require 'vendor/autoload.php'; ```
39,427,339
I am trying to use CSS so when you hover on something it changes background colors. The code I am using does not work though. I can't seem to find out why though. It should work, right? ```css body { margin: 0; font-family: Arial; font-size: 1em; } .navbar-ul, a { margin: 0; color: white; ...
2016/09/10
[ "https://Stackoverflow.com/questions/39427339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` $ cat ip.txt A B C D E 0 1 . 0 0 1 ./. 0 1 1 1 1 0 0 0 0 0 . . 0 . ./. . . . $ perl -ne '(@c)=/\.\/\.|\./g; print if $#c < 1' ip.txt A B C D E 0 1 . 0 0 1 ./. 0 1 1 1 1 0 0 0 ``` * `(@c)=/\.\/\.|\./g` array of `./.` or `.` matches from current line * `$#c` indicates index of last element, i.e (size of array - ...
Perhaps this is alright. ``` awk '$0 !~/\. \./' file A B C D E 0 1 . 0 0 1 ./. 0 1 1 1 1 0 0 0 ```
39,427,339
I am trying to use CSS so when you hover on something it changes background colors. The code I am using does not work though. I can't seem to find out why though. It should work, right? ```css body { margin: 0; font-family: Arial; font-size: 1em; } .navbar-ul, a { margin: 0; color: white; ...
2016/09/10
[ "https://Stackoverflow.com/questions/39427339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` $ awk '{delete a; for(i=1;i<=NF;i++) a[$i]++; if(a["."]>=2) next} 1' foo A B C D E 0 1 . 0 0 1 ./. 0 1 1 1 1 0 0 0 ``` It iterates all fields (`for`), counts field values and `if` 2 or more `.` in a record, restrains from printing (`next`). If you want to count the periods only from field 3 onward, change the sta...
``` $ cat ip.txt A B C D E 0 1 . 0 0 1 ./. 0 1 1 1 1 0 0 0 0 0 . . 0 . ./. . . . $ perl -ne '(@c)=/\.\/\.|\./g; print if $#c < 1' ip.txt A B C D E 0 1 . 0 0 1 ./. 0 1 1 1 1 0 0 0 ``` * `(@c)=/\.\/\.|\./g` array of `./.` or `.` matches from current line * `$#c` indicates index of last element, i.e (size of array - ...
39,427,339
I am trying to use CSS so when you hover on something it changes background colors. The code I am using does not work though. I can't seem to find out why though. It should work, right? ```css body { margin: 0; font-family: Arial; font-size: 1em; } .navbar-ul, a { margin: 0; color: white; ...
2016/09/10
[ "https://Stackoverflow.com/questions/39427339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
With awk: ``` $ awk '{c=0;for(i=1;i<NF;i++) c += ($i == ".")}c<2' file A B C D E 0 1 . 0 0 1 ./. 0 1 1 1 1 0 0 0 ``` Basically it iterates each column and add one to the counter if the column equals a period (`.`). The `c<2` part will only print the line if there is less than two columns with periods. With sed one...
``` $ cat ip.txt A B C D E 0 1 . 0 0 1 ./. 0 1 1 1 1 0 0 0 0 0 . . 0 . ./. . . . $ perl -ne '(@c)=/\.\/\.|\./g; print if $#c < 1' ip.txt A B C D E 0 1 . 0 0 1 ./. 0 1 1 1 1 0 0 0 ``` * `(@c)=/\.\/\.|\./g` array of `./.` or `.` matches from current line * `$#c` indicates index of last element, i.e (size of array - ...
39,427,339
I am trying to use CSS so when you hover on something it changes background colors. The code I am using does not work though. I can't seem to find out why though. It should work, right? ```css body { margin: 0; font-family: Arial; font-size: 1em; } .navbar-ul, a { margin: 0; color: white; ...
2016/09/10
[ "https://Stackoverflow.com/questions/39427339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Similar to @spasic's answer, but easier (for me) to read! ``` perl -ane 'print if (grep { /^\.$/} @F) < 2' file A B C D E 0 1 . 0 0 1 ./. 0 1 1 1 1 0 0 0 ``` The `-a` separates the space-separated fields into an array called `@F` for me. I then grep in the array `@F` looking for elements that consist of just a perio...
Perhaps this is alright. ``` awk '$0 !~/\. \./' file A B C D E 0 1 . 0 0 1 ./. 0 1 1 1 1 0 0 0 ```
39,427,339
I am trying to use CSS so when you hover on something it changes background colors. The code I am using does not work though. I can't seem to find out why though. It should work, right? ```css body { margin: 0; font-family: Arial; font-size: 1em; } .navbar-ul, a { margin: 0; color: white; ...
2016/09/10
[ "https://Stackoverflow.com/questions/39427339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` $ awk '{delete a; for(i=1;i<=NF;i++) a[$i]++; if(a["."]>=2) next} 1' foo A B C D E 0 1 . 0 0 1 ./. 0 1 1 1 1 0 0 0 ``` It iterates all fields (`for`), counts field values and `if` 2 or more `.` in a record, restrains from printing (`next`). If you want to count the periods only from field 3 onward, change the sta...
Similar to @spasic's answer, but easier (for me) to read! ``` perl -ane 'print if (grep { /^\.$/} @F) < 2' file A B C D E 0 1 . 0 0 1 ./. 0 1 1 1 1 0 0 0 ``` The `-a` separates the space-separated fields into an array called `@F` for me. I then grep in the array `@F` looking for elements that consist of just a perio...
39,427,339
I am trying to use CSS so when you hover on something it changes background colors. The code I am using does not work though. I can't seem to find out why though. It should work, right? ```css body { margin: 0; font-family: Arial; font-size: 1em; } .navbar-ul, a { margin: 0; color: white; ...
2016/09/10
[ "https://Stackoverflow.com/questions/39427339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
With awk: ``` $ awk '{c=0;for(i=1;i<NF;i++) c += ($i == ".")}c<2' file A B C D E 0 1 . 0 0 1 ./. 0 1 1 1 1 0 0 0 ``` Basically it iterates each column and add one to the counter if the column equals a period (`.`). The `c<2` part will only print the line if there is less than two columns with periods. With sed one...
Similar to @spasic's answer, but easier (for me) to read! ``` perl -ane 'print if (grep { /^\.$/} @F) < 2' file A B C D E 0 1 . 0 0 1 ./. 0 1 1 1 1 0 0 0 ``` The `-a` separates the space-separated fields into an array called `@F` for me. I then grep in the array `@F` looking for elements that consist of just a perio...